/* HR — стиль Пульса (design.md → «Эталон: стиль Пульса»). Токены совпадают с Пульсом. */
:root {
  --bg: #f4f5f9; --surface: #ffffff; --surface-2: #f7f8fb; --border: #e4e6ee; --border-strong: #d5d8e3;
  --text: #111318; --muted: #6b7385; --faint: #9aa1b4; --accent: #3b82f6; --accent-soft: rgba(59,130,246,.12);
  --pos: #16a34a; --neg: #dc2626; --warn: #d97706; --grid: #eceef4;
  --pos-soft: rgba(22,163,74,.12); --neg-soft: rgba(220,38,38,.10); --warn-soft: rgba(217,119,6,.12);
  --violet: #8b5cf6; --violet-soft: rgba(139,92,246,.12); --teal: #0ea5a4; --teal-soft: rgba(14,165,164,.12);
  --shadow: 0 1px 2px rgba(17,19,24,.04), 0 8px 24px -12px rgba(17,19,24,.12);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0a0b0f; --surface: #12141a; --surface-2: #181b23; --border: #23262f; --border-strong: #2f333e;
  --text: #f1f2f6; --muted: #8a91a5; --faint: #5f667a; --accent: #5b9dff; --accent-soft: rgba(91,157,255,.14);
  --pos: #34c759; --neg: #ff453a; --warn: #ffb340; --grid: #1c1f28;
  --pos-soft: rgba(52,199,89,.14); --neg-soft: rgba(255,69,58,.14); --warn-soft: rgba(255,179,64,.14);
  --violet: #a78bfa; --violet-soft: rgba(167,139,250,.14); --teal: #2dd4bf; --teal-soft: rgba(45,212,191,.14);
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 12px 32px -16px rgba(0,0,0,.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { overflow-anchor: none; }
html, body { background: var(--bg); color: var(--text); margin: 0; min-height: 100%; }
body { font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a.link { color: var(--accent); }
a.link:hover { text-decoration: underline; }
h1, h2, h3 { letter-spacing: -0.02em; font-weight: 600; margin: 0; }
h1 { font-size: 22px; } h2 { font-size: 15px; } h3 { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.sm { font-size: 12px; } .xs { font-size: 11px; }
.wrap { max-width: 1680px; margin: 0 auto; padding: 0 20px; }
.surface { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
.fade-in { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
svg.i.xs { width: 12px; height: 12px; }

/* шапка */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 1px solid transparent;
  transition: border-color .2s ease, box-shadow .2s ease; }
.topbar[data-compact="true"] { border-bottom-color: var(--border); box-shadow: 0 10px 24px -22px rgba(0,0,0,.55); }
.topbar .row { display: flex; align-items: center; gap: 12px; padding: 14px 0 10px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { width: 32px; height: 32px; transition: transform .2s ease; transform-origin: left center; }
.brand-text b { display: block; font-size: 16px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.brand-text span { font-size: 12px; color: var(--muted); }
.topbar[data-compact="true"] .brand img { transform: scale(.8); }
.topbar[data-compact="true"] .brand-text span { display: none; }
.spacer { flex: 1; }
.nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 13px; font-weight: 500;
  transition: all .15s ease; cursor: pointer; font-family: inherit; white-space: nowrap; }
.btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn[aria-current="page"] { border-color: var(--border-strong); box-shadow: var(--shadow); }
.btn.icon { padding: 7px; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; padding: 3px 12px 3px 3px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 500; white-space: nowrap; }
.user-avatar { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 600; }
.theme-sun { display: none; } [data-theme="dark"] .theme-sun { display: block; } [data-theme="dark"] .theme-moon { display: none; }

/* вкладки вакансий */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 12px; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid transparent; color: var(--muted); font-size: 14px; font-weight: 500; white-space: nowrap; transition: all .15s ease; }
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab[aria-selected="true"] { color: var(--text); background: var(--surface); border-color: var(--border-strong); box-shadow: var(--shadow); }
.tab .dot { width: 8px; height: 8px; border-radius: 999px; background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); }
.tab .dot.open { color: var(--pos); } .tab .dot.paused { color: var(--warn); } .tab .dot.closed { color: var(--faint); }
.tab .count { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.topbar[data-compact="true"] .tabs { padding-bottom: 8px; }
.tab-more { position: relative; }
.tab-more summary { list-style: none; cursor: pointer; }
.tab-more summary::-webkit-details-marker { display: none; }
.tab-menu { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; min-width: 240px; padding: 6px; display: grid; gap: 2px; }
.tab-menu a { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 9px; font-size: 13.5px; color: var(--muted); }
.tab-menu a:hover { background: var(--surface-2); color: var(--text); }
.tab-menu .dot { width: 8px; height: 8px; border-radius: 999px; background: var(--faint); }
.topbar[data-compact="true"] .tab { padding: 5px 11px; font-size: 13px; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 6px 0 16px; }
.kpi { padding: 14px 16px; }
.kpi-label { font-size: 12px; font-weight: 500; color: var(--muted); }
.kpi-value { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12px; color: var(--muted); }

/* доска воронки */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px;
  overflow-x: auto; padding-bottom: 12px; align-items: start; scroll-snap-type: x proximity; }
.col { background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; padding: 10px;
  min-height: 120px; scroll-snap-align: start; }
.col-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 10px; gap: 8px; }
.col-head h2 { font-size: 13px; }
.col-count { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 1px 8px; font-variant-numeric: tabular-nums; }
.cards { display: grid; gap: 8px; }
.card { display: block; padding: 11px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 1px 2px rgba(17,19,24,.04); transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.card-name { font-weight: 600; font-size: 13.5px; line-height: 1.3; letter-spacing: -0.01em; }
.card-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.card-status { font-size: 12px; margin-top: 7px; color: var(--text); display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.empty { color: var(--faint); font-size: 12px; text-align: center; padding: 18px 0; }

.score { flex: none; display: inline-grid; place-items: center; min-width: 34px; height: 24px; padding: 0 7px;
  border-radius: 8px; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.score.hi { background: var(--pos-soft); color: var(--pos); }
.score.mid { background: var(--accent-soft); color: var(--accent); }
.score.lo { background: var(--warn-soft); color: var(--warn); }
.score.bad { background: var(--neg-soft); color: var(--neg); }
.score.none { background: var(--surface-2); color: var(--faint); border: 1px dashed var(--border-strong); }
.score.lg { min-width: 56px; height: 40px; font-size: 20px; border-radius: 12px; }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px;
  font-weight: 500; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.chip.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chip.pos { background: var(--pos-soft); color: var(--pos); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.neg { background: var(--neg-soft); color: var(--neg); border-color: transparent; }
.chip.violet { background: var(--violet-soft); color: var(--violet); border-color: transparent; }
.chip.teal { background: var(--teal-soft); color: var(--teal); border-color: transparent; }

/* боковые стадии под доской */
.side { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin: 8px 0 32px; }
.side details { padding: 0; }
.side summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; font-weight: 600; font-size: 13px; }
.side summary::-webkit-details-marker { display: none; }
.side ul { list-style: none; margin: 0; padding: 0 8px 10px; max-height: 420px; overflow: auto; }
.side li a { display: flex; justify-content: space-between; gap: 8px; padding: 7px 8px; border-radius: 9px; font-size: 13px; }
.side li a:hover { background: var(--surface-2); }

/* карточка кандидата */
.cand-head { padding: 18px 20px; display: grid; gap: 14px; }
.cand-title { display: flex; align-items: flex-start; gap: 14px; justify-content: space-between; flex-wrap: wrap; }
.cand-title h1 { font-size: 24px; }
.crumbs { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; margin: 4px 0 12px; flex-wrap: wrap; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.fact { background: var(--surface); padding: 10px 12px; min-width: 0; }
.fact .k { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.fact .val { font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; margin: 16px 0 40px; align-items: start; }
.sec { padding: 16px; margin-bottom: 16px; scroll-margin-top: 140px; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.sec-head .hint { font-size: 12px; color: var(--faint); }
.secnav { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.secnav a { font-size: 12.5px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); font-weight: 500; }
.secnav a:hover { color: var(--text); border-color: var(--border-strong); }
.qa { display: grid; gap: 12px; }
.qa .q { font-size: 12px; color: var(--muted); font-weight: 500; }
.qa .a { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.qa .item + .item { border-top: 1px solid var(--border); padding-top: 12px; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }

.timeline { display: grid; gap: 10px; }
.msg { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--surface); max-width: 88%; }
.msg.out { margin-left: auto; background: var(--accent-soft); border-color: transparent; }
.msg.note { max-width: 100%; background: var(--surface-2); border-style: dashed; }
.msg-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.msg-subj { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; }
.msg details summary { cursor: pointer; color: var(--accent); font-size: 12px; margin-top: 4px; }

.list { display: grid; gap: 8px; }
.row-item { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 12px; }
.events { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13px; }
.events li { display: grid; grid-template-columns: 92px 1fr; gap: 8px; }
.crit { display: grid; gap: 8px; }
.crit-row { display: grid; grid-template-columns: minmax(0, 1fr) 54px; gap: 4px 10px; align-items: center; }
.bar { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: var(--grid); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), #7fb1ff); }
.crit-why { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }

table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-size: 11.5px; font-weight: 500; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border);
  background: var(--surface-2); position: sticky; top: 0; }
table.t td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
.table-wrap { overflow: auto; border-radius: 16px; }

/* как работает */
.docs { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; margin: 10px 0 40px; }
.toc { position: sticky; top: 130px; align-self: start; display: grid; gap: 2px; font-size: 13px; }
.toc a { padding: 5px 10px; border-radius: 8px; color: var(--muted); }
.toc a:hover { background: var(--surface); color: var(--text); }
.docs section { padding: 18px 20px; margin-bottom: 14px; scroll-margin-top: 130px; }
.docs section p, .docs section li { color: var(--text); }
.docs code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 0 5px; font-size: 12.5px; }
.callout { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 10px 14px; border-radius: 0 10px 10px 0; margin: 10px 0; }

.locked { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.locked .surface { max-width: 460px; padding: 28px; text-align: center; }

@media (max-width: 1100px) { .layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .wrap { padding: 0 14px; }
  .docs { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; display: flex; flex-wrap: wrap; }
  .board { grid-auto-columns: 84%; }
  .brand-text span { display: none; }
  .nav .label { display: none; }
  .tab { padding: 6px 11px; font-size: 13px; }
  .msg { max-width: 100%; }
  .cand-title h1 { font-size: 20px; }
  .topbar[data-compact="true"] .brand-text { display: none; }
}
@media (prefers-reduced-motion: reduce) { .fade-in, .card { animation: none; transition: none; } }

/* Публичная анкета кандидата /f/<slug> (0.5.0) */
.apply { max-width: 760px; margin: 0 auto; padding: 20px 0 56px; display: grid; gap: 12px; }
.apply-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 2px 8px; }
.apply-brand { display: grid; line-height: 1.25; } .apply-brand b { font-size: 16px; letter-spacing: -0.02em; }
.apply-intro { padding: 22px 24px; display: grid; gap: 10px; }
.apply-intro p { margin: 0; white-space: pre-line; color: var(--muted); }
.apply-form { display: grid; gap: 12px; }
.field { padding: 16px 18px; display: grid; gap: 8px; }
.field label { font-weight: 500; }
.field input, .field textarea { width: 100%; font: inherit; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; }
.field textarea { min-height: 104px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field.has-error { border-color: var(--neg); }
.field-error { margin: 0; color: var(--neg); font-size: 12px; }
.req { color: var(--neg); }
.apply-notice { padding: 12px 16px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); font-weight: 500; }
.apply-submit { display: grid; gap: 8px; justify-items: start; padding: 4px 2px; }
.apply-submit p { margin: 0; }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; padding: 10px 20px; font-size: 14px; }
.btn.primary:hover { background: var(--accent); filter: brightness(1.06); }
.btn.primary:disabled { opacity: .6; cursor: default; }
.apply-done { padding: 32px 24px; text-align: center; display: grid; gap: 8px; justify-items: center; }
.apply-done p { margin: 0; max-width: 460px; }
.apply-ok { width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center;
  background: var(--pos-soft); color: var(--pos); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 760px) { .apply { padding-top: 8px; } .field, .apply-intro { padding: 14px; } }
