/* Layout: «ведомость». Шапка с жирной линейкой, ниже рабочая область раздела. Блоки разделены линейками, а не карточками. Подбор: список слева, профиль справа. Аналитика: вывод одной фразой, сводка, детали. */
:root {
  --bg: #ffffff;
  --ink: #111111;
  --muted: #555550;
  --faint: #b5b5ae;
  --line: #e4e4e0;
  --field: #c9c9c3;
  --panel: #f4f4f1;
  --accent: #1f3fbf;
  --accent-ink: #14297f;
  --accent-soft: #eef1fb;
  --on-accent: #ffffff;
  --warn: #b3441a;
  --warn-soft: #fbf1ea;
  --f-display: "Inter Tight", "Segoe UI", system-ui, sans-serif;
  --f-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #121211; --ink: #ecece8; --muted: #a3a39b; --faint: #5c5c56; --line: #2c2c29; --field: #4a4a45; --panel: #1b1b19;
  --accent: #8ea2ff; --accent-ink: #b5c2ff; --accent-soft: #1c2340; --on-accent: #121211; --warn: #f08a5d; --warn-soft: #3a2418; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #121211; --ink: #ecece8; --muted: #a3a39b; --faint: #5c5c56; --line: #2c2c29; --field: #4a4a45; --panel: #1b1b19;
  --accent: #8ea2ff; --accent-ink: #b5c2ff; --accent-soft: #1c2340; --on-accent: #121211; --warn: #f08a5d; --warn-soft: #3a2418; color-scheme: dark; }

body { background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.5; }
a { color: var(--accent); } a:hover { color: var(--accent-ink); }
.wrap { max-width: 1360px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); box-sizing: border-box; }
@media (min-width: 900px) { .wrap { padding-left: max(40px, env(safe-area-inset-left, 0px)); padding-right: max(40px, env(safe-area-inset-right, 0px)); } }
header.bar { border-bottom: 1px solid var(--line); }
header.bar .wrap { display: flex; align-items: center; gap: 8px 40px; flex-wrap: wrap; padding-block: 14px; }
.brand { display: flex; align-items: baseline; gap: 16px; }
.brand b { font-family: var(--f-display); font-weight: 800; font-size: 24px; letter-spacing: -0.03em; }
.brand span { font-family: var(--f-mono); font-size: 12px; color: var(--muted); }
nav.tabs { display: flex; gap: 0 28px; flex-wrap: wrap; }
nav.tabs a { text-decoration: none; color: var(--muted); font-weight: 500; padding: 12px 0; border-bottom: 2px solid transparent; margin-bottom: -16px; }
nav.tabs a:hover { color: var(--ink); }
nav.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
main.wrap { padding-block: 40px 64px; display: flex; flex-direction: column; gap: 32px; }

h1 { font-family: var(--f-display); font-weight: 800; font-size: clamp(32px, 4vw, 52px); letter-spacing: -0.035em; line-height: 1.02; margin: 0; text-wrap: balance; max-width: 22ch; }
h2 { font-family: var(--f-display); font-weight: 800; font-size: 26px; margin: 0; letter-spacing: -0.02em; line-height: 1.15; }
h3 { font-family: var(--f-display); font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; margin: 0; }
.lead { color: var(--muted); margin: 10px 0 0; max-width: 62ch; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap; }

button, .btn { font: 500 14px var(--f-body); color: var(--ink); background: var(--bg); border: 1px solid var(--field); border-radius: 0; min-height: 44px; padding: 0 16px; cursor: pointer; }
button:hover { border-color: var(--ink); }
button:disabled { opacity: .5; cursor: default; }
button.primary, button.ai { background: var(--accent-fill, var(--accent)); border-color: var(--accent-fill, var(--accent)); color: var(--on-accent); font-weight: 600; }
button.primary:hover, button.ai:hover { background: var(--accent-fill-ink, var(--accent-ink)); border-color: var(--accent-fill-ink, var(--accent-ink)); }
button.link { border: 0; background: none; padding: 0; min-height: 0; color: var(--accent); font-weight: 500; }
button.danger { color: var(--warn); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.panel { border-top: 1px solid var(--line); padding-top: 16px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.grid-match { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 48px; align-items: start; }
@media (max-width: 900px) { .grid-match { grid-template-columns: minmax(0, 1fr); } }
.list { display: flex; flex-direction: column; max-height: 680px; overflow-y: auto; border-top: 1px solid var(--line); }
.list button { text-align: left; border: 0; border-bottom: 1px solid var(--line); padding: 12px 8px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 2px 8px; background: none; min-height: 0; font-weight: 400; }
.list button:hover { background: var(--panel); }
.list button[aria-pressed="true"] { background: var(--accent-soft); }
.list button[aria-pressed="true"] b { font-weight: 600; }
.list b { font-weight: 500; }
.list small { color: var(--muted); grid-column: 1 / -1; font-size: 12px; font-family: var(--f-mono); }
input[type=search], input[type=text], input[type=number], input[type=url], select, textarea { font: 15px var(--f-body); color: var(--ink); background: var(--bg); border: 1px solid var(--field); border-radius: 0; padding: 10px 12px; width: 100%; box-sizing: border-box; min-height: 44px; }
textarea { min-height: 100px; resize: vertical; }

.chips { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 15px; }
.chip { font-family: var(--f-mono); font-size: 13px; }
.chip.hit { color: var(--accent); }
.chip.hit::before { content: "✓ "; }
.chip.miss { color: var(--warn); }
.chip.miss::before { content: "− "; }
.chip.new { font: 500 13px var(--f-mono); color: var(--accent); background: none; border: 1px dashed var(--accent); min-height: 36px; padding: 0 10px; }
.pill { font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); white-space: nowrap; }
.pill.case, .pill.ok { color: var(--accent); }
.code { font-family: var(--f-mono); font-size: 13px; color: var(--muted); }
.example { font-family: var(--f-mono); font-size: 11px; font-weight: 400; letter-spacing: 0; color: var(--muted); border: 1px dashed var(--field); padding: 1px 6px; vertical-align: middle; }

.profile-top { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-end; }
.profile-top h2 { font-size: clamp(36px, 4vw, 56px); letter-spacing: -0.035em; line-height: 1; margin-top: 6px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts div { display: flex; flex-direction: column; padding: 12px 16px; border-right: 1px solid var(--line); }
.facts div:first-child { padding-left: 0; }
.facts div:last-child { border-right: 0; }
.facts span { font-size: 12px; color: var(--muted); }
.facts b { font-family: var(--f-display); font-weight: 600; font-size: 22px; font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.match { display: flex; flex-wrap: wrap; gap: 12px 24px; padding: 24px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.score { flex: 0 0 88px; font-family: var(--f-display); font-weight: 800; font-size: 48px; line-height: .9; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.score.top { color: var(--accent); }
.m-body { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.m-meta { font-size: 13px; color: var(--muted); }
.m-title { font-family: var(--f-display); font-weight: 600; font-size: 21px; letter-spacing: -0.01em; text-transform: none; margin: 0; }
.why { margin: 0; max-width: 62ch; }
.gap-note { margin: 0; font-size: 14px; }
.gap-note span { color: var(--muted); }
.reqs { flex: 0 0 200px; margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-family: var(--f-mono); font-size: 13px; }
.reqs .hit { color: var(--accent); } .reqs .hit::before { content: "✓ "; }
.reqs .miss { color: var(--warn); } .reqs .miss::before { content: "− "; }
.status { font-size: 14px; color: var(--muted); }
.status.err { color: var(--warn); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 48px 40px; }
.card { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card .meta { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; font-size: 13px; }
.card .company { font-weight: 500; }
.card h2 { font-size: 24px; }
.card p { margin: 0; }
.card .foot { margin-top: auto; display: flex; gap: 8px 16px; flex-wrap: wrap; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--line); }
.subs { display: flex; flex-direction: column; gap: 0; }
.subs h3 { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.subs li { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: center; font-size: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.subs li > .score { font-size: 26px; flex: none; color: var(--accent); }
.subs > button { margin-top: 12px; align-self: flex-start; }
ul.plain { list-style: none; margin: 0; padding: 0; }
.seg { display: inline-flex; gap: 0 24px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.seg button { border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 0; min-height: 40px; color: var(--muted); background: none; }
.seg button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--accent); }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
@media (max-width: 720px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { padding: 16px; display: flex; flex-direction: column-reverse; gap: 6px; border-right: 1px solid var(--line); }
.kpi:first-child { padding-left: 0; }
.kpi:last-child { border-right: 0; }
.kpi b { font-family: var(--f-display); font-weight: 800; font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.kpi span { font-size: 13px; color: var(--muted); }
.kpi.alert b { color: var(--warn); }
.split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 56px; align-items: start; }
@media (max-width: 960px) { .split { grid-template-columns: minmax(0, 1fr); } }
.bars { display: flex; flex-direction: column; }
.bar-row { display: grid; grid-template-columns: 160px minmax(0, 1fr) 84px; gap: 12px; align-items: center; font-size: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 520px) { .bar-row { grid-template-columns: 104px minmax(0,1fr) 64px; } }
.bar-row .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.track { position: relative; height: 10px; }
.track .d { position: absolute; inset: 0 auto 0 0; background: var(--ink); }
.track .h { position: absolute; left: 0; top: 3px; bottom: 3px; background: var(--accent); }
.bar-row .val { font-family: var(--f-mono); font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.bar-row.gap { background: var(--warn-soft); padding-inline: 8px; }
.bar-row.gap .lbl { color: var(--warn); }
.bar-row.gap .track .d { background: var(--warn); }
.legend { display: flex; gap: 6px 20px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 14px; height: 10px; margin-right: 6px; vertical-align: -1px; }
.tbl-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th:first-child, td:first-child { padding-left: 0; }
thead tr { border-bottom: 1px solid var(--line); }
th { font-size: 12px; font-weight: 500; color: var(--muted); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--f-mono); font-size: 13px; }
.advice { background: var(--panel); padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.advice p { margin: 0; }
.advice li { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.advice li:last-child { border-bottom: 0; padding-bottom: 0; }
.empty { color: var(--muted); padding: 32px 0; border-top: 1px solid var(--line); }

.overlay { position: fixed; inset: 0; background: rgba(17, 17, 17, .5); display: flex; align-items: flex-start; justify-content: center; padding: max(24px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); overflow-y: auto; z-index: 20; }
.modal { background: var(--bg); border-top: 1px solid var(--line); padding: 24px; width: 100%; max-width: 640px; display: flex; flex-direction: column; gap: 16px; box-sizing: border-box; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.form label.full { grid-column: 1 / -1; }
@media (max-width: 520px) { .form { grid-template-columns: minmax(0,1fr); } }
.toast { position: fixed; bottom: max(20px, env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 18px; font-size: 14px; z-index: 30; }

/* Главная для гостей: документация с оглавлением слева */
.docs { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 56px; align-items: start; border-top: 1px solid var(--line); padding-top: 24px; }
.docs-nav { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; font-size: 14px; }
.docs-nav summary { font: 600 13px var(--f-display); letter-spacing: .08em; text-transform: uppercase; cursor: pointer; list-style: none; padding: 4px 0 8px; }
.docs-nav summary::-webkit-details-marker { display: none; }
.docs-nav ol { list-style: none; margin: 0; padding: 0; }
.docs-nav > details > ol > li { margin-bottom: 14px; }
.docs-nav > details > ol > li > span { display: block; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.docs-nav li li a { display: block; padding: 4px 0 4px 12px; border-left: 2px solid var(--line); color: var(--muted); text-decoration: none; }
.docs-nav li li a:hover { color: var(--ink); border-left-color: var(--field); }
.docs-nav li li a[aria-current] { color: var(--accent); border-left-color: var(--accent); font-weight: 500; }
.docs-body { display: flex; flex-direction: column; gap: 48px; max-width: 760px; min-width: 0; }
.docs-body section { scroll-margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.docs-body section p { margin: 0; }
.docs-tag { font: 500 11px var(--f-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.docs-tag.st { color: var(--accent); }
.docs-tag.co { color: #8a5a00; }
.docs-tag.vu { color: #2f7a3e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .docs-tag.co { color: #e0b35c; } :root:not([data-theme="light"]) .docs-tag.vu { color: #7cc58c; } }
.docs-roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.docs-roles div { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.docs-roles p { color: var(--muted); font-size: 14px; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: st; display: flex; flex-direction: column; gap: 10px; }
.steps > li { counter-increment: st; position: relative; padding-left: 38px; min-height: 24px; }
.steps > li::before { content: counter(st); position: absolute; left: 0; top: 0; font: 600 13px var(--f-mono); color: var(--accent); background: var(--accent-soft); width: 24px; height: 24px; display: grid; place-items: center; }
.docs-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.path { font: 500 13px var(--f-mono); background: var(--panel); border: 1px solid var(--line); padding: 1px 6px; white-space: nowrap; }
.docs-tip { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 10px 14px; font-size: 14px; }
.faq { border-bottom: 1px solid var(--line); padding: 10px 0; }
.faq summary { cursor: pointer; font-weight: 500; }
.faq p { margin: 8px 0 0 !important; color: var(--muted); }
.docs-cta { border-top: 1px solid var(--line); padding-top: 16px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.docs-cta p { margin: 0; font: 800 24px var(--f-display); }
@media (max-width: 900px) {
  .docs { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .docs-nav { position: static; max-height: none; border: 1px solid var(--line); padding: 10px 14px; }
  .docs-nav summary::after { content: " ▾"; }
  .path { white-space: normal; }
}

/* Факты (город, зарплата, направления) на телефоне: длинные значения переносятся, а не наезжают на соседнюю ячейку */
.facts div { min-width: 0; }
.facts b { overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts div { border-right: 0; border-bottom: 1px solid var(--line); }
  .facts div:nth-child(odd):not(:last-child) { border-right: 1px solid var(--line); }
  .facts div:nth-last-child(-n+2):nth-child(odd), .facts div:last-child { border-bottom: 0; }
  .facts b { font-size: clamp(16px, 4.6vw, 20px); }
}

/* Хлебная крошка вместо кнопок «Назад», «Все собеседования», «К профилю»: раздел › подраздел */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13.5px; color: var(--muted); margin: 0 0 -8px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.crumbs > span[aria-hidden] { color: var(--faint); }

/* Значки: единый набор templates/core/_icons.html, вставляется тегом {% icon "имя" %} (core/templatetags/icons.py).
   Сетка 20 × 20, линия 1,5 px. Размер — атрибутами width/height (по умолчанию 20) или правилом места;
   толщину линии место не меняет, цвет берётся из color (currentColor). */
.ic-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; overflow: visible; }
