:root {
  --ink: #16202b;
  --muted: #5b6673;
  --bg: #f5f7f6;
  --card: #ffffff;
  --line: #e2e7e4;
  --accent: #0f7a4a;
  --accent-hover: #0b6038;
  --accent-soft: #e6f3ec;
  --warn: #9a4a07;
  --warn-soft: #fdf1e3;
  --danger: #a3261b;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(22, 32, 43, .05), 0 4px 16px rgba(22, 32, 43, .05);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--font); }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(28px, 4.2vw, 40px); }
h2 { font-size: clamp(21px, 2.6vw, 26px); margin-top: .2em; }
h3 { font-size: 18px; }
p { margin: 0 0 1em; }
code { font-family: var(--mono); font-size: .88em; background: #eef1ef; border-radius: 6px; padding: .12em .45em; white-space: nowrap; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--card); padding: 8px 12px; border-radius: 8px; z-index: 10; }

.wrap { width: 100%; max-width: 880px; margin: 0 auto; padding: 0 16px; }

.topbar { background: var(--card); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1080px; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 18px; }
.brand-mark { width: 30px; height: 30px; }
.brand-mark-bg { fill: var(--accent); }
.brand-mark-fg { fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.nav { display: flex; gap: 18px; flex-wrap: wrap; }
.nav a { color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 500; }
.nav a:hover { color: var(--accent); }

main { padding: 24px 0 48px; }
.page-head { margin: 8px 0 20px; }
.lead { font-size: 19px; color: #2b3640; max-width: 46em; }
.eyebrow { color: var(--muted); font-size: 14px; margin-bottom: 6px; text-transform: none; }

.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { color: var(--muted); }
.crumbs .sep { color: #b5bdb8; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border: 0; border-radius: var(--radius-sm); background: var(--accent); color: #fff; font: 600 16px/1 var(--font); text-decoration: none; cursor: pointer; transition: background .15s; }
.btn:hover { background: var(--accent-hover); color: #fff; }
.btn:focus-visible, .choice:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(15, 122, 74, .35); outline-offset: 2px; }
.btn-ghost { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent-hover); }
.btn-small { min-height: 36px; padding: 0 14px; font-size: 14px; }

.tool { background: var(--card); border: 1.5px solid var(--accent); border-radius: var(--radius); padding: 20px; margin: 0 0 20px; box-shadow: var(--shadow); }
.tool-title { font-weight: 700; font-size: 18px; margin: 0 0 12px; display: block; }
.hint { font-size: 14px; color: var(--muted); margin: 10px 0 0; }
.decoder-row { display: flex; gap: 10px; }
.decoder-row input { flex: 1; min-width: 0; }

input[type=text], input[type=number], input[type=date], select {
  width: 100%; min-height: 48px; padding: 10px 14px; border: 1.5px solid #cfd6d2; border-radius: var(--radius-sm);
  background: #fff; color: var(--ink); font: 16px/1.3 var(--font);
}
input:focus, select:focus { border-color: var(--accent); }
label, .label { display: block; font-weight: 600; font-size: 15px; margin: 14px 0 6px; }

.choices { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice { display: flex; align-items: center; min-height: 56px; height: 100%; padding: 12px 16px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: #fbfcfb; color: var(--ink); text-decoration: none; font-weight: 500; line-height: 1.35; transition: border-color .15s, background .15s; }
.choice:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }

.block { background: var(--card); border-radius: var(--radius); padding: 22px; margin: 0 0 16px; box-shadow: var(--shadow); }
.prose p:last-child, .prose ul:last-child { margin-bottom: 0; }
.prose ul, .prose ol { padding-left: 1.2em; margin: 0 0 1em; }
.prose li { margin-bottom: .35em; }

.facts-what { font-size: 18px; }
.facts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; margin: 0; }
.facts-grid > div { min-width: 0; }
.facts-grid .wide { grid-column: 1 / -1; }
.facts-grid dt { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 4px; }
.facts-grid dd { margin: 0; overflow-wrap: anywhere; }
.facts-grid dd ul { margin: 0; padding-left: 1.1em; }
.facts-grid code { white-space: normal; display: inline-block; margin: 0 4px 4px 0; }

.platforms { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.platform { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; }
.platform h3 { font-size: 16px; margin-bottom: 8px; }
.platform ol { margin: 0; padding-left: 1.2em; font-size: 15px; }
.platform li { margin-bottom: .3em; }
.note { font-size: 14px; color: var(--muted); margin: 12px 0 0; }

.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.tile { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; font-weight: 500; }
.tile:hover { border-color: var(--accent); color: var(--accent); }

.cta { background: var(--accent-soft); border-radius: var(--radius); padding: 22px; margin: 0 0 16px; }
.cta-title { font-weight: 700; font-size: 20px; margin-bottom: 6px; }

.faq details { border-top: 1px solid var(--line); padding: 12px 0; }
.faq details:first-of-type { border-top: 0; }
.faq summary { cursor: pointer; font-weight: 600; list-style-position: outside; }
.faq details p { margin: 10px 0 0; }

.links { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 24px; }
.links li { break-inside: avoid; margin-bottom: 8px; }
.checked { font-size: 14px; color: var(--muted); }

/* Разбор */
.wizard { background: var(--card); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.step { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
.step legend { font-weight: 700; font-size: 21px; padding: 0; margin-bottom: 12px; }
.js .wizard .step { display: none; }
.js .wizard .step.is-active { display: block; }
.radio-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.radio-card, .pill { margin: 0; font-weight: 500; cursor: pointer; }
.radio-card input, .pill input { position: absolute; opacity: 0; pointer-events: none; }
.radio-card span { display: flex; align-items: center; min-height: 56px; height: 100%; padding: 12px 16px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); line-height: 1.35; }
.pill span { display: inline-block; padding: 10px 16px; border: 1.5px solid var(--line); border-radius: 999px; }
.radio-card input:checked + span, .pill input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.radio-card input:focus-visible + span, .pill input:focus-visible + span { outline: 3px solid rgba(15, 122, 74, .35); }
.radio-row { display: flex; flex-wrap: wrap; gap: 8px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row label { margin-top: 0; }
.wizard-nav { display: flex; gap: 10px; flex-wrap: wrap; }
.field-error, .alert { color: var(--danger); font-weight: 600; font-size: 15px; margin: 6px 0; }
.alert { background: #fbeceb; padding: 12px 16px; border-radius: var(--radius-sm); }
[hidden] { display: none !important; }

.verdict { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 8px 0 18px; }
.verdict-item { background: var(--card); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); border-top: 4px solid var(--accent); }
.level-2 .verdict-item:first-child { border-top-color: #c98a12; }
.level-1 .verdict-item:first-child { border-top-color: var(--warn); }
.verdict-label { display: block; font-size: 14px; color: var(--muted); }
.verdict-value { display: block; font-size: 26px; font-weight: 700; }
.basis { margin: 0 0 24px; font-size: 15px; }
.basis summary { cursor: pointer; color: var(--accent); font-weight: 600; }

.ladder { list-style: none; counter-reset: step; padding: 0; margin: 0 0 28px; }
.ladder li { counter-increment: step; position: relative; padding: 0 0 18px 48px; border-left: 2px solid var(--line); margin-left: 16px; }
.ladder li:last-child { border-left-color: transparent; }
.ladder li::before { content: counter(step); position: absolute; left: -17px; top: -2px; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; display: grid; place-items: center; }
.ladder-title { font-weight: 700; margin-bottom: 4px; }
.ladder p { margin-bottom: 6px; }
.when { display: inline-block; font-weight: 500; font-size: 13px; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 999px; margin-left: 6px; vertical-align: 2px; }
.doc-link { font-size: 15px; font-weight: 600; }

.doc { background: var(--card); border-radius: var(--radius); padding: 18px 20px; margin: 0 0 14px; box-shadow: var(--shadow); }
.doc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.doc-head h3 { margin: 0; }
.doc-text { white-space: pre-wrap; font: 15px/1.55 var(--font); background: #fafbfa; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; margin-top: 12px; overflow-wrap: anywhere; }
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0; }
.disclaimer { font-size: 14px; color: var(--muted); }

.found { background: var(--card); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 18px 20px; margin: 0 0 18px; box-shadow: var(--shadow); }
.found-weak { border-left-color: #c98a12; }
.found-title { font-weight: 700; font-size: 20px; margin-bottom: 6px; }

.legal { background: var(--card); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.legal h2 { font-size: 20px; margin-top: 1.2em; }

.footer { border-top: 1px solid var(--line); background: var(--card); padding: 28px 0; font-size: 15px; }
.footer-inner { max-width: 1080px; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col a { color: var(--ink); text-decoration: none; }
.footer-col a:hover { color: var(--accent); }
.footer-brand { font-weight: 700; margin: 0; }

@media (max-width: 720px) {
  body { font-size: 16px; }
  .lead { font-size: 17px; }
  .choices, .radio-cards, .facts-grid, .verdict, .row { grid-template-columns: 1fr; }
  .decoder-row { flex-direction: column; }
  .block, .tool, .wizard, .cta, .legal { padding: 16px; }
  .links { columns: 1; }
  .footer-inner { grid-template-columns: 1fr; }
  .nav { gap: 14px; }
  .ladder li { padding-left: 36px; }
}

@media print {
  .topbar, .footer, .result-actions, .fb-wrap, .btn, .doc-link, .crumbs, .basis summary, .ladder, .verdict { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .doc { box-shadow: none; page-break-inside: avoid; padding: 0; }
  .doc-text { border: 0; background: none; padding: 0; }
}

.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .shake { animation: none; } * { scroll-behavior: auto !important; } }

/* Отзыв */
.fb-wrap { margin: 24px 0; }
html:not(.js) .fb-wrap { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.fb { position: relative; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.fb-step { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.fb-step[hidden] { display: none; }
.fb-q { margin: 0; font-weight: 700; }
.fb-q:focus { outline: none; }
.fb .fb-q { padding-right: 32px; }
.fb-close { position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 999px; background: none; color: var(--muted, #6b7a73); cursor: pointer; transition: background .15s, color .15s; }
.fb-close:hover { background: var(--accent-soft); color: var(--ink); }
.fb-row { display: flex; gap: 10px; }
.fb-answer { min-width: 7rem; }
.fb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-chip { min-height: 44px; padding: 8px 16px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); font: 500 15px/1.25 var(--font); cursor: pointer; transition: border-color .15s, background .15s; }
.fb-chip:hover { border-color: var(--accent); }
.fb-chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.fb-chip:focus-visible, .fb-link:focus-visible, .fb textarea:focus-visible { outline: 3px solid rgba(15, 122, 74, .35); outline-offset: 2px; }
.fb textarea { width: 100%; min-height: 84px; padding: 10px 14px; border: 1.5px solid #cfd6d2; border-radius: var(--radius-sm); background: #fff; color: var(--ink); font: 16px/1.4 var(--font); resize: vertical; }
.fb textarea:focus { border-color: var(--accent); }
.fb-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 15px; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.fb-link:hover { color: var(--accent); }
.fb .fb-link { color: var(--accent); }
@media (prefers-reduced-motion: no-preference) { .fb { animation: fb-in .24s ease-out; } }
@keyframes fb-in { from { opacity: 0; transform: translateY(6px); } }
@media (max-width: 720px) { .fb { padding: 16px; } .fb-answer { flex: 1; } .fb-send { width: 100%; } }

/* Кокпит */
.admin section { margin-bottom: 36px; }
.admin h2 { font-size: 1.125rem; margin-bottom: 10px; }
.admin-head { display: flex; justify-content: space-between; align-items: center; }
.table-scroll { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; background: var(--card); }
.admin-table th, .admin-table td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.admin-table th { font-weight: 600; color: var(--muted); }
.admin-login { display: flex; flex-direction: column; gap: 16px; max-width: 22rem; }
.admin-login input[type=password] { width: 100%; min-height: 48px; padding: 10px 14px; border: 1.5px solid #cfd6d2; border-radius: var(--radius-sm); background: #fff; color: var(--ink); font: 16px/1.3 var(--font); }
.admin-login input[type=password]:focus { border-color: var(--accent); }
