/* Цвета графиков — эталонная палитра (категориальная, зоны, сетка); тёмная тема — свои шаги тех же цветов. */
:root {
  color-scheme: light;
  --page: #f3f3f0;
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #6b6963;
  --axis-muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, .10);
  --border-strong: rgba(11, 11, 11, .20);
  --zone: #f0efec;
  --accent: #256abf;
  --accent-hover: #1c5cab;
  --accent-soft: #e3edfa;
  --link: #1c5cab;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --series-6: #008300;
  --lj-line: #6dbf6a;            /* линия профиля A–J — как в LifeJob */
  --good: #0ca30c;
  --good-ink: #006300;
  --good-bg: #e8f4e6;
  --warning: #fab219;
  --warn-bg: #fdf3dc;
  --critical: #d03b3b;
  --crit-bg: #fbeceb;
  --radius: 12px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media screen and (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --ink: #ffffff;
    --ink-2: #c3c2b7;
    --muted: #a19f96;
    --axis-muted: #898781;
    --grid: #2c2c2a;
    --axis: #383835;
    --border: rgba(255, 255, 255, .10);
    --border-strong: rgba(255, 255, 255, .20);
    --zone: #242422;
    --accent-soft: #1a2b42;
    --link: #86b6ef;
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
    --series-5: #d55181;
    --series-6: #008300;
    --lj-line: #6fcf6b;
    --good-ink: #5fcf5f;
    --good-bg: #16261a;
    --warn-bg: #2b2310;
    --crit-bg: #2e1817;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font-size: 15px; line-height: 1.5; }
a { color: var(--link); }
h1 { font-size: 26px; line-height: 1.25; margin: 0 0 8px; font-weight: 650; }
h2 { font-size: 19px; line-height: 1.3; margin: 0 0 10px; font-weight: 650; }
h3 { font-size: 15px; margin: 0 0 6px; }
p { margin: 0 0 12px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.wrap-narrow { max-width: 780px; margin: 0 auto; padding: 0 16px; }
.main { padding-top: 24px; padding-bottom: 56px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.mt { margin-top: 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* шапка */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; min-height: 56px; flex-wrap: wrap; }
.brand { font-weight: 650; color: var(--ink); text-decoration: none; font-size: 16px; }
.brand-sub { color: var(--muted); font-weight: 400; margin-left: 8px; font-size: 13px; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav form { margin: 0; }
.nav a, .nav-btn { padding: 7px 12px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font: inherit; background: none; border: 0; cursor: pointer; }
.nav a:hover, .nav-btn:hover, .nav a[aria-current="page"] { background: var(--zone); color: var(--ink); }

/* карточки */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 16px; }
.card.narrow { max-width: 460px; margin: 24px auto; }
.card-accent { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.page-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.stats { display: flex; gap: 16px; flex-wrap: wrap; color: var(--ink-2); font-size: 14px; }
.stats b { color: var(--ink); font-size: 16px; }
.eyebrow { color: var(--muted); font-size: 13px; margin: 0 0 4px; }
.lead { font-size: 17px; color: var(--ink-2); }
.back { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.empty { color: var(--muted); padding: 24px 0 8px; text-align: center; }

/* формы и кнопки */
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }
.form small { color: var(--muted); font-size: 12.5px; }
.form .check { display: flex; gap: 10px; align-items: flex-start; color: var(--ink); }
.check input { margin: 3px 0 0; width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
input:not([type]), input[type=text], input[type=password], input[type=search], input[type=number], select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 9px 11px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
textarea { resize: vertical; }
.grid-form { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; }
.grid-form .span2 { grid-column: span 2; }
.row-form { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
@media (max-width: 760px) {
  .grid-form, .row-form { grid-template-columns: 1fr; }
  .grid-form .span2 { grid-column: auto; }
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600;
  font-size: 14px; color: #fff; background: var(--accent); border: 1px solid var(--accent); border-radius: 8px;
  padding: 9px 16px; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--zone); border-color: var(--border-strong); }
.btn-danger { background: transparent; color: var(--critical); border-color: transparent; }
.btn-danger:hover { background: var(--crit-bg); border-color: transparent; }
.btn-small { padding: 5px 10px; font-size: 13px; }
.btn-big { padding: 12px 26px; font-size: 16px; }
.push-right { margin-left: auto; }

/* сообщения */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; background: var(--zone); }
.flash-ok { background: var(--good-bg); }
.flash-error { background: var(--crit-bg); }
.notice { display: flex; gap: 12px; padding: 14px 18px; border-radius: var(--radius); margin-bottom: 16px; }
.notice ul { margin: 6px 0 8px; padding-left: 18px; }
.notice p { margin: 4px 0 0; }
.notice-warn { background: var(--warn-bg); }
.notice-good { background: var(--good-bg); }
.notice-icon { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; }
.notice-warn .notice-icon { background: var(--warning); color: #0b0b0b; }
.notice-good .notice-icon { background: var(--good); }

/* статусы */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--zone); color: var(--ink-2); }
.badge-done { background: var(--good-bg); color: var(--good-ink); }
.badge-progress { background: var(--accent-soft); color: var(--link); }

/* таблицы */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--grid); }
.table td { padding: 10px; border-bottom: 1px solid var(--grid); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table th.num, .table td.num { text-align: right; }
.table .name { font-weight: 600; color: var(--ink); text-decoration: none; }
.table .name:hover { text-decoration: underline; }
.col-check { width: 30px; }
.col-check input { width: 17px; height: 17px; accent-color: var(--accent); }
.col-actions { text-align: right; white-space: nowrap; }
.col-actions form { display: inline; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filters input[type=search] { flex: 1 1 240px; width: auto; }
.filters select { width: auto; }
.compare-bar { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.copyrow { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
.copyrow input { flex: 1 1 280px; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }
details.msg summary { cursor: pointer; color: var(--link); margin: 4px 0 8px; }
details.msg textarea { margin-bottom: 8px; }
.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 16px 0 0; }
.meta dt { color: var(--muted); font-size: 12.5px; }
.meta dd { margin: 2px 0 0; }

/* отчёт */
.chart { margin: 10px 0 4px; }
.viz { width: 100%; height: auto; display: block; font-size: 13px; }
.viz.viz-narrow { display: none; }
@media screen and (max-width: 600px) {
  .viz.viz-wide { display: none; }
  .viz.viz-narrow { display: block; }
}
.viz text { fill: var(--ink-2); }
.viz .viz-label { fill: var(--ink); }
.viz .viz-value { fill: var(--ink); font-weight: 600; }
.viz .viz-small { font-size: 11px; font-weight: 500; fill: var(--ink-2); }
.viz .viz-muted { fill: var(--axis-muted); font-size: 12px; }
.viz .viz-num { font-variant-numeric: tabular-nums; }
.viz .viz-grid { stroke: var(--grid); stroke-width: 1; }
.viz .viz-axis { stroke: var(--axis); stroke-width: 1; }
.viz .viz-zone { fill: var(--zone); }
.viz .viz-hitbox { fill: transparent; }
.viz .viz-hit { outline: none; }
.viz .viz-hit:hover .viz-bar, .viz .viz-hit:focus-visible .viz-bar { opacity: .8; }
.viz-bar.s1 { fill: var(--series-1); } .swatch.s1 { background: var(--series-1); }
.viz-bar.s2 { fill: var(--series-2); } .swatch.s2 { background: var(--series-2); }
.viz-bar.s3 { fill: var(--series-3); } .swatch.s3 { background: var(--series-3); }
.viz-bar.s4 { fill: var(--series-4); } .swatch.s4 { background: var(--series-4); }
.viz-bar.s5 { fill: var(--series-5); } .swatch.s5 { background: var(--series-5); }
.viz-bar.s6 { fill: var(--series-6); } .swatch.s6 { background: var(--series-6); }
.viz-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz-line.s1 { stroke: var(--series-1); } .viz-dot.s1 { fill: var(--series-1); }
.viz-line.s2 { stroke: var(--series-2); } .viz-dot.s2 { fill: var(--series-2); }
.viz-line.s3 { stroke: var(--series-3); } .viz-dot.s3 { fill: var(--series-3); }
.viz-line.s4 { stroke: var(--series-4); } .viz-dot.s4 { fill: var(--series-4); }
.viz-line.s5 { stroke: var(--series-5); } .viz-dot.s5 { fill: var(--series-5); }
.viz-line.s6 { stroke: var(--series-6); } .viz-dot.s6 { fill: var(--series-6); }
.viz-line.lj { stroke: var(--lj-line); stroke-width: 1.75; } .viz-dot.lj { fill: var(--lj-line); }
.viz-line.ref { stroke: var(--axis-muted); stroke-width: 1.5; stroke-dasharray: 5 4; } .viz-dot.ref { fill: var(--axis-muted); }
.viz-dot { stroke: var(--surface); stroke-width: 2; opacity: 0; }     /* линии без точек; точка — только при наведении */
.viz .viz-hit:hover .viz-dot, .viz .viz-hit:focus-visible .viz-dot { opacity: 1; }
.tag { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--accent-soft); color: var(--link); white-space: nowrap; }
.viz .viz-letter { fill: var(--ink-2); font-size: 12.5px; }
.viz .viz-pole { fill: var(--ink-2); font-size: 12px; }
.viz .viz-vals { fill: var(--ink-2); font-size: 13px; }
.viz .viz-tick { fill: var(--ink-2); font-size: 12px; }
.swatch.line { width: 18px; height: 3px; border-radius: 2px; vertical-align: middle; margin-bottom: 2px; }
.swatch.lj { background: var(--lj-line); }
.swatch.ref { background: repeating-linear-gradient(90deg, var(--axis-muted) 0 5px, transparent 5px 9px); }
.letter { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 8px; border-radius: 6px; background: var(--zone); color: var(--ink); font-weight: 700; font-size: 12.5px; }
.section-title { margin: 28px 0 12px; font-size: 21px; }
.h-sub { font-size: 16px; margin: 14px 0 0; color: var(--ink-2); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 0; margin: 10px 0 4px; }
.legend a { color: var(--ink); font-weight: 600; text-decoration: none; }
.legend a:hover { text-decoration: underline; }
.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--grid); }
.summary ul { margin: 0; padding-left: 18px; }
.summary .num { color: var(--muted); margin-left: 6px; }
.domain-head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; }
.subtitle { font-weight: 400; color: var(--muted); font-size: 15px; margin-left: 4px; }
.score { display: grid; justify-items: end; gap: 6px; text-align: right; flex: none; min-width: 150px; }
.score-num { font-size: 40px; font-weight: 650; line-height: 1; }
.interp { background: var(--zone); border-radius: 8px; padding: 12px 14px; }
.facets td:first-child { width: 38%; }
.row-domain td { background: var(--zone); }
.indent { padding-left: 26px !important; color: var(--ink-2); }
.compare-table th .swatch { vertical-align: baseline; }
.lj-form { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 8px; align-items: end; }
.lj-form label { display: grid; gap: 4px; justify-items: center; font-weight: 700; font-size: 13px; color: var(--ink); }
.lj-form input { text-align: center; padding: 8px 4px; font-variant-numeric: tabular-nums; }
.lj-form .btn { grid-column: 1 / -1; justify-self: start; }
.lj-del { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.diff-big { color: var(--critical); font-weight: 600; }
@media (max-width: 640px) {
  .lj-form { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .hide-sm { display: none; }
  .lj-table th, .lj-table td { padding-left: 6px; padding-right: 6px; }
  .lj-table .letter { margin-right: 5px; }
}
.tooltip { position: fixed; z-index: 10; pointer-events: none; background: var(--ink); color: var(--surface); font-size: 13px; padding: 6px 9px; border-radius: 6px; max-width: 300px; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
@media (max-width: 640px) {
  .summary { grid-template-columns: 1fr; }
  .domain-head { flex-direction: column; gap: 8px; }
  .score { justify-items: start; text-align: left; }
  .card { padding: 16px; }
}

/* кандидат */
.facts { padding-left: 20px; margin: 0 0 16px; }
.facts li { margin-bottom: 6px; }
.progress-wrap { position: sticky; top: 0; z-index: 5; background: var(--page); padding: 12px 0 10px; }
.progress-top { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; color: var(--ink-2); margin-bottom: 6px; }
.progress { height: 6px; background: var(--grid); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width .2s; }
.instr { font-weight: 600; margin: 10px 0 12px; }
.qform { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.q { padding: 16px 18px; border-bottom: 1px solid var(--grid); }
.q-text { font-size: 16px; margin: 0 0 10px; }
.q-num { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 2px; }
.q-missing { background: var(--crit-bg); }
.scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.scale label { display: block; position: relative; }
.scale input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.scale span {
  display: flex; align-items: center; justify-content: center; text-align: center; min-height: 46px; padding: 6px 4px;
  border: 1px solid var(--border-strong); border-radius: 8px; font-size: 12.5px; line-height: 1.2; color: var(--ink-2);
  cursor: pointer; user-select: none; transition: background .1s;
}
.scale span:hover { background: var(--zone); color: var(--ink); }
.scale input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.scale input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.qnav { display: flex; flex-direction: row-reverse; justify-content: space-between; gap: 12px; padding: 16px 18px; }
.done-icon { width: 56px; height: 56px; margin: 8px auto 12px; border-radius: 50%; background: var(--good); color: #fff; display: grid; place-items: center; font-size: 28px; font-weight: 700; }
@media (max-width: 560px) {
  .q { padding: 14px 12px; }
  .scale { gap: 4px; }
  .scale span { min-height: 42px; padding: 4px 2px; }
}

/* печать: отчёт без кнопок и шапки, карточки не рвутся между страницами */
@media print {
  body { background: #fff; font-size: 12px; }
  .topbar, .noprint, .flash { display: none !important; }
  .main { padding: 0; }
  .wrap { max-width: none; padding: 0; }
  .card, .notice { border: 1px solid #ddd; break-inside: avoid; }
  .domain { break-before: auto; }
  a { color: inherit; text-decoration: none; }
}
