/* Layout: one narrow column of "screens" (start → quiz → result); the result is a work ID card with a hazard band. */
:root {
  --bg: #e9ebe7;          /* бетон */
  --surface: #f7f8f5;
  --fg: #1d2124;          /* графит */
  --muted: #5d6468;
  --line: #c9cdc8;
  --accent: #f26a12;      /* сигнальный оранжевый */
  --accent-fg: #ffffff;
  --hazard: #f5c400;
  --hazard-dark: #1d2124;
  --ok: #2f7d46;
  --bad: #b3361e;
  --font-display: "Russo One", "Arial Black", Impact, sans-serif;
  --font-body: "Golos Text", "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15181a; --surface: #1e2225; --fg: #e8eae6; --muted: #9aa1a4; --line: #353b3f;
    --accent: #ff7a26; --accent-fg: #15181a; --hazard: #e6b800; --hazard-dark: #15181a;
    --ok: #5cbf7a; --bad: #ff7a62; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15181a; --surface: #1e2225; --fg: #e8eae6; --muted: #9aa1a4; --line: #353b3f;
  --accent: #ff7a26; --accent-fg: #15181a; --hazard: #e6b800; --hazard-dark: #15181a;
  --ok: #5cbf7a; --bad: #ff7a62; color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  background: var(--bg); color: var(--fg);
  font-family: var(--font-body); font-size: 16px; line-height: 1.55;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.wrap { max-width: 720px; margin: 0 auto; padding-block: 28px 64px; display: grid; gap: 28px; }

.tag { font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; text-wrap: balance; margin: 0; line-height: 1.1; }
h1 { font-size: clamp(34px, 7vw, 56px); }
h1 em { font-style: normal; color: var(--accent); }
h2 { font-size: clamp(24px, 4.5vw, 32px); }
h3 { font-size: 20px; }
p { margin: 0; }
.lead { font-size: 18px; color: var(--muted); max-width: 58ch; }

.hazard {
  height: 14px; border-radius: 2px;
  background: repeating-linear-gradient(-45deg, var(--hazard) 0 14px, var(--hazard-dark) 14px 28px);
}

.hero { display: grid; gap: 16px; }

/* role chips */
.roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.chip {
  font: inherit; font-size: 15px; text-align: left; cursor: pointer;
  padding: 12px 14px; border-radius: 6px;
  background: var(--surface); color: var(--fg); border: 1.5px solid var(--line);
  transition: border-color .15s, background .15s;
}
@media (hover: hover) { .chip:hover { border-color: var(--accent); } }
.chip[aria-pressed="true"], .steps-nav .chip[aria-current="true"] { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); font-weight: 600; }
.chip small { display: block; font-family: var(--font-mono); font-size: 11px; opacity: .75; }

button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.btn {
  font: inherit; font-weight: 600; font-size: 16px; cursor: pointer;
  padding: 14px 22px; border-radius: 6px; border: 0;
  background: var(--fg); color: var(--bg); text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn.primary { background: var(--accent); color: var(--accent-fg); }
.btn.ghost { background: transparent; color: var(--fg); border: 1.5px solid var(--line); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* quiz */
.progress { display: grid; gap: 8px; }
.bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); transition: width .25s; }
.answers { display: grid; gap: 10px; }
.answer {
  font: inherit; text-align: left; cursor: pointer;
  padding: 16px 18px; border-radius: 6px; background: var(--surface); color: var(--fg);
  border: 1.5px solid var(--line); display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: baseline;
}
@media (hover: hover) { .answer:hover { border-color: var(--accent); } }
.answer b { font-family: var(--font-mono); color: var(--accent); }

/* result: удостоверение */
.card { background: var(--surface); border: 1.5px solid var(--line); border-radius: 8px; overflow: hidden; }
.card .hazard { border-radius: 0; }
.card-body { padding: 22px; display: grid; gap: 18px; position: relative; }
.card-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.fields { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.fields dt { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding-top: 3px; }
.fields dd { margin: 0; font-weight: 600; min-width: 0; }
.prof { font-family: var(--font-display); font-size: clamp(30px, 6.5vw, 46px); line-height: 1.05; color: var(--accent); text-wrap: balance; }
.joke { font-size: 18px; max-width: 54ch; }
.stamp {
  position: absolute; right: 18px; bottom: 16px; transform: rotate(-12deg);
  font-family: var(--font-mono); font-weight: 600; font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); border: 2px solid var(--accent); border-radius: 50%;
  width: 96px; height: 96px; display: grid; place-items: center; text-align: center; opacity: .55; pointer-events: none;
}
.card-body .fields { padding-right: 96px; }
@media (max-width: 480px) { .stamp { display: none; } .card-body .fields { padding-right: 0; } .fields { grid-template-columns: 1fr; gap: 2px; } .fields dd { margin-bottom: 8px; } }

.share { display: grid; gap: 10px; }
.share-text { font-family: var(--font-mono); font-size: 13px; padding: 12px; border-radius: 6px; background: var(--bg); border: 1px dashed var(--line); word-break: break-word; }
.toast { font-family: var(--font-mono); font-size: 13px; color: var(--ok); }

.others { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.other { padding: 14px; border-radius: 6px; border: 1.5px solid var(--line); display: grid; gap: 4px; background: transparent; color: var(--fg); font: inherit; text-align: left; cursor: pointer; }
@media (hover: hover) { .other:hover { border-color: var(--accent); } }
.other .pct { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }

.serious { display: grid; gap: 22px; border-top: 2px solid var(--fg); padding-top: 22px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.fact { display: grid; gap: 4px; }
.fact .v { font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.list { margin: 0; padding-left: 20px; display: grid; gap: 8px; max-width: 64ch; }
.list li::marker { color: var(--accent); font-weight: 700; }

.mini { background: var(--surface); border: 1.5px solid var(--line); border-radius: 8px; padding: 18px; display: grid; gap: 12px; }
.mini .answer[data-state="right"] { border-color: var(--ok); }
.mini .answer[data-state="wrong"] { border-color: var(--bad); }
.verdict { font-weight: 600; }
.verdict.right { color: var(--ok); }
.verdict.wrong { color: var(--bad); }

.links { display: flex; flex-wrap: wrap; gap: 10px; }
.note { font-size: 13px; color: var(--muted); max-width: 64ch; }
footer { font-size: 13px; color: var(--muted); }

/* картинка для шеринга */
.shot { display: block; width: 100%; height: auto; border-radius: 6px; border: 1.5px solid var(--line); background: var(--surface); aspect-ratio: 1200 / 630; }

/* где учиться */
.courses { display: grid; gap: 10px; }
.course { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; padding: 14px 16px; border-radius: 6px; border: 1.5px solid var(--line); background: var(--surface); }
.course .name { font-weight: 600; min-width: 0; }
.course .price { font-family: var(--font-mono); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.course .desc { grid-column: 1 / -1; font-size: 14px; color: var(--muted); }
.course .seg { grid-column: 1 / -1; }
.course.warn { border-style: dashed; }
.course .where { grid-column: 1 / -1; font-family: var(--font-mono); font-size: 12px; }
.course .where.yes { color: var(--ok); }
.course .where.no { color: var(--muted); }
.course .desc a { color: var(--accent); }
.city { display: grid; gap: 6px; max-width: 320px; }
.city label { font-weight: 600; }
.city select { font: inherit; padding: 10px 12px; border-radius: 6px; border: 1.5px solid var(--line); background: var(--surface); color: var(--fg); }
.city .note { min-height: 1.2em; }
.city-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.city-inline select { font: inherit; padding: 6px 10px; border-radius: 6px; border: 1.5px solid var(--line); background: var(--surface); color: var(--fg); }
.course.free .price { color: var(--ok); font-weight: 600; }
@media (max-width: 480px) { .course { grid-template-columns: 1fr; } .course .price { text-align: left; } }

/* лендинг для партнёров */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { padding: 16px; border-radius: 6px; background: var(--surface); border: 1.5px solid var(--line); display: grid; gap: 6px; align-content: start; }
.stat .n { font-family: var(--font-display); font-size: 34px; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.stat .src { font-size: 12px; color: var(--muted); }
.steps { display: grid; gap: 12px; counter-reset: s; }
.steps li { list-style: none; display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: baseline; }
.steps li::before { counter-increment: s; content: counter(s); font-family: var(--font-mono); font-weight: 600; color: var(--accent-fg); background: var(--accent); border-radius: 4px; text-align: center; padding: 2px 0; }
.steps { padding: 0; margin: 0; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.plan { padding: 18px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--surface); display: grid; gap: 8px; align-content: start; }
.plan.hl { border-color: var(--accent); }
.form { display: grid; gap: 12px; padding: 18px; border-radius: 8px; background: var(--surface); border: 1.5px solid var(--line); }
.form label { display: grid; gap: 4px; font-size: 14px; font-weight: 600; }
.form input, .form select { font: inherit; padding: 10px 12px; border-radius: 6px; border: 1.5px solid var(--line); background: var(--bg); color: var(--fg); min-width: 0; }
.form .two { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
footer a { color: inherit; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
/* v2: язык, страна, риск ИИ */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.langs { display: flex; gap: 6px; }
.langs button { font: inherit; font-family: var(--font-mono); font-size: 13px; padding: 6px 10px; border-radius: 4px; cursor: pointer;
  background: transparent; color: var(--fg); border: 1.5px solid var(--line); }
.langs button[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.geo { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.geo label { display: grid; gap: 6px; font-weight: 600; }
.geo select, .geo-inline select { font: inherit; padding: 10px 12px; border-radius: 6px; border: 1.5px solid var(--line); background: var(--surface); color: var(--fg); min-width: 0; }
.geo-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.geo-inline select { padding: 6px 10px; }
.risk-box { display: grid; gap: 8px; padding: 16px; border-radius: 6px; background: var(--surface); border: 1.5px solid var(--line); }
.risk-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pill { font-family: var(--font-mono); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: 3px 10px; border-radius: 999px; color: var(--accent-fg); }
.pill.high { background: var(--bad); }
.pill.mid { background: var(--accent); }
.pill.low { background: var(--ok); }
.chip .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot.high { background: var(--bad); } .dot.mid { background: var(--accent); } .dot.low { background: var(--ok); }
.prof-risk { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }

/* ---------- v3 ---------- */
html { -webkit-text-size-adjust: 100%; }
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
body { margin: 0; }
[hidden] { display: none !important; }
img { max-width: 100%; }
a { color: var(--accent); }

/* профиль по чертам */
.traits { display: grid; gap: 8px; }
.trait { display: grid; grid-template-columns: minmax(110px, 160px) 1fr 44px; gap: 12px; align-items: center; }
.trait .name { font-size: 15px; }
.trait .track { height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; }
.trait .track > i { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.trait.top .name { font-weight: 700; }
.trait .v { font-family: var(--font-mono); font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.why-match { max-width: 64ch; }

/* рекламные места */
.ad { display: grid; gap: 6px; padding: 14px 16px; border-radius: 6px; border: 1.5px dashed var(--accent); background: transparent; }
.ad .tag { color: var(--accent); }
.ad.filled { border-style: solid; background: var(--surface); }
.ad .cta { font-weight: 600; }

/* заставка «Who are you?» */
.intro { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: grid; grid-template-rows: 1fr auto; overflow: hidden;
  padding: env(safe-area-inset-top, 0px) max(16px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(16px, env(safe-area-inset-left, 0px)); }
.intro canvas { width: 100%; height: 100%; display: block; }
.intro .skip { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); }
.intro .caption { text-align: center; font-family: var(--font-display); font-size: clamp(22px, 5vw, 34px); padding-block: 8px 28px; }
.stack { display: grid; gap: 12px; }
.stack-sm { display: grid; gap: 6px; }

/* Где ты: определённое место + уточнение, ручной выбор спрятан */
.loc { display: grid; gap: 6px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--surface); }
.loc-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.loc-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); align-self: center; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
.loc .geo { margin-top: 6px; }
.linkish { font: inherit; font-size: 14px; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tag.km { color: var(--fg); }

/* Страница рекламодателя */
.pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pick .chip { width: auto; }
.field { display: grid; gap: 6px; }
.field .label, .form label { font-size: 14px; font-weight: 600; }
.plan.off { opacity: .65; }
/* Работодатели и рассылка — отдельные аудитории: карточка во всю ширину, пример справа */
.plan.wide { grid-column: 1 / -1; }
@media (min-width: 640px) { .plan.wide { grid-template-columns: 1fr 1fr; column-gap: 20px; } .plan.wide .preview { grid-column: 2; grid-row: 1 / span 4; margin: 0; } }
.plan .preview { margin-top: 4px; font-size: 14px; pointer-events: none; }
.form textarea { font: inherit; }

/* Кнопка «Начать» прилипает к низу экрана, как только роль выбрана: список ролей длинный */
.cta.sticky { position: sticky; bottom: 0; z-index: 5; margin: 0 -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 70%, transparent); }
.cta.sticky .btn { flex: 1; max-width: 420px; }
.tg .cta.sticky { position: static; background: none; margin: 0; padding: 0; }   /* в Telegram это MainButton */
#brand a { color: inherit; text-decoration: none; }

/* Липкие ссылки на разделы результата */
.jumps { position: sticky; top: 0; z-index: 4; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin: 0 -16px; padding: 10px 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
.jumps::-webkit-scrollbar { display: none; }
.jumps .chip { width: auto; flex: none; padding: 7px 11px; font-size: 14px; }
[id^="res-"] { scroll-margin-top: 64px; }
.roles { grid-auto-flow: row dense; }
.roles .risk-box { grid-column: 1 / -1; scroll-margin-bottom: 96px; }   /* не под липкой «Начать» */
.back-mine { justify-self: start; }

/* Пошаговый режим (Mini App): виден только текущий шаг результата */
.steps #screen-result[data-step="card"] [data-page]:not([data-page="card"]),
.steps #screen-result[data-step="why"] [data-page]:not([data-page="why"]),
.steps #screen-result[data-step="learn"] [data-page]:not([data-page="learn"]),
.steps #screen-result[data-step="jobs"] [data-page]:not([data-page="jobs"]) { display: none; }
.tg .step-next { display: none; }   /* в Telegram это MainButton */
