/* Оформление теста, отчёта и страницы администратора. Цвета и размеры — в переменных ниже. */

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(manrope-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(manrope-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --ink: #0f1b2a;
  --ink-2: #2b3a4c;
  --muted: #5b6878;
  --line: #e3e7ec;
  --line-strong: #cbd2da;

  --accent: #0f6e6a;
  --accent-dark: #0a5552;
  --accent-soft: #e7f3f2;
  --accent-ring: rgba(15, 110, 106, .28);

  --desirable: #157a3f;  --desirable-soft: #e7f4ec;
  --normal: #4a5668;     --normal-soft: #eef1f5;
  --attention: #a65a06;  --attention-soft: #fcf1e1;
  --urgent: #b42318;     --urgent-soft: #fdecea;
  --profile: #0b4f6c;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 27, 42, .05);
  --shadow: 0 1px 2px rgba(15, 27, 42, .04), 0 8px 24px -8px rgba(15, 27, 42, .12);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 380px at 50% -120px, rgba(15, 110, 106, .09), transparent 70%),
    var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: rgba(15, 110, 106, .18); }

h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.9rem; line-height: 1.18; font-weight: 800; letter-spacing: -.02em; text-wrap: balance; }
h2 { font-size: 1.08rem; line-height: 1.3; font-weight: 700; letter-spacing: -.005em; }
h3 { font-weight: 700; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-dark); }

.icon { width: 18px; height: 18px; flex: none; }

kbd {
  display: inline-block; min-width: 20px; padding: 0 5px; margin: 0 2px;
  font: 600 .74rem/18px var(--mono); color: var(--ink-2); text-align: center;
  background: var(--surface); border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px;
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { max-width: 640px; margin: 40px auto; padding: 0 16px; }

/* ---------- каркас ---------- */

.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 255, 255, .86);
  -webkit-backdrop-filter: saturate(180%) blur(10px); backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { max-width: 960px; margin: 0 auto; padding: 0 20px; height: 60px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: -.01em; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-mark rect { fill: var(--accent); }
.brand-mark polyline { fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.topbar-meta { color: var(--muted); font-size: .9rem; font-weight: 600; font-variant-numeric: tabular-nums; }

.app { max-width: 960px; margin: 0 auto; padding: 36px 20px 72px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}

.start, .question, .thanks, .app > .card { max-width: 720px; margin-left: auto; margin-right: auto; }

.eyebrow { color: var(--accent); font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 8px; }
.lead { color: var(--muted); margin-top: 12px; font-size: 1.08rem; line-height: 1.55; }
.hint { color: var(--muted); font-size: .88rem; line-height: 1.5; }
.aside { margin-top: 24px; text-align: center; font-size: .92rem; }
.quiet-link { color: var(--muted); font-size: .88rem; text-decoration: none; }
.quiet-link:hover { color: var(--accent); text-decoration: underline; }

/* ---------- кнопки ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  font: inherit; font-weight: 700; font-size: .95rem; text-decoration: none; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s;
  touch-action: manipulation;
}
.btn:active:not([disabled]) { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(10, 85, 82, .25), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn.primary:hover { background: var(--accent-dark); color: #fff; }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { border-color: #aeb7c2; background: var(--surface-2); color: var(--ink); }
.btn.text { background: transparent; color: var(--muted); padding-left: 10px; padding-right: 10px; }
.btn.text:hover { color: var(--urgent); background: var(--urgent-soft); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: .86rem; gap: 6px; }
.btn.small .icon { width: 16px; height: 16px; }
.btn.large { min-height: 52px; font-size: 1.02rem; }
.btn.wide { width: 100%; }
.btn.icon-btn { width: 36px; min-height: 36px; padding: 0; background: transparent; color: var(--muted); }
.btn.icon-btn .icon { width: 17px; height: 17px; }
.btn.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.btn.danger:hover { color: var(--urgent); background: var(--urgent-soft); }
.btn[disabled] { opacity: .45; cursor: default; }
.btn:focus-visible, .answer:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent-ring); outline-offset: 2px;
}
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* ---------- поля ---------- */

.form { margin-top: 24px; display: grid; gap: 18px; }
.field { display: grid; gap: 7px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field label, .field legend { font-weight: 700; font-size: .92rem; padding: 0; color: var(--ink-2); }
.field legend { margin-bottom: 7px; }
.field-age { max-width: 140px; }
input[type="text"], input[type="number"], input[type="password"], input[type="search"], textarea {
  width: 100%; min-height: 48px; padding: 11px 14px; font: inherit; font-size: 1rem; color: inherit;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
input:hover, textarea:hover { border-color: #aeb7c2; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
input::placeholder, textarea::placeholder { color: #8b96a3; }
.choice { display: flex; gap: 10px; flex-wrap: wrap; }
.choice label {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 18px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface);
  font-weight: 600; cursor: pointer; transition: border-color .15s, background-color .15s;
}
.choice label:hover { border-color: #aeb7c2; }
.choice label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.choice input { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
.form-error { color: var(--urgent); font-weight: 700; font-size: .92rem; min-height: 1.4em; }
.form-error:empty { display: none; }

/* ---------- стартовая страница ---------- */

.start-card { padding: 40px; }
.start-hero h1 { font-size: 2.3rem; }
.start-facts { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 22px 0 0; padding: 0; }
.start-facts li {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px;
  font-size: .88rem; font-weight: 600; color: var(--ink-2);
}
.start-facts .icon { width: 16px; height: 16px; color: var(--accent); }

.resume { margin-top: 26px; padding: 18px 20px; border: 1px solid #ecd9ae; background: #fdf7ea; border-radius: 12px; }
.resume p { display: grid; gap: 2px; }
.resume-meta { color: var(--muted); font-size: .9rem; }
.resume-bar { height: 5px; margin-top: 12px; background: rgba(166, 90, 6, .14); border-radius: 99px; overflow: hidden; }
.resume-bar span { display: block; height: 100%; background: var(--attention); border-radius: 99px; }
.resume-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

.how { margin-top: 30px; padding-top: 28px; border-top: 1px solid var(--line); }
.how-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.how-key {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2);
  font-size: .9rem; font-weight: 600; line-height: 1.3;
}
.how-key .answer-sign { width: 32px; height: 32px; font-size: 1.25rem; }
.tips { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.tips li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink-2); font-size: .95rem; }
.tips .icon { width: 18px; height: 18px; margin-top: 3px; color: var(--accent); }

.start-form { margin-top: 30px; padding-top: 28px; border-top: 1px solid var(--line); }
.form-row { display: grid; grid-template-columns: 140px 1fr; gap: 18px; align-items: start; }
.form-row .field-age { max-width: none; }

/* ---------- вопрос ---------- */

.question { padding: 32px 32px 26px; }
.q-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.q-number { color: var(--muted); font-size: .88rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.q-percent { color: var(--accent); font-size: .88rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.progress { height: 8px; background: #e8ecf0; border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, #13857f, var(--accent)); border-radius: 99px; transition: width .3s var(--ease); }
.q-text { margin-top: 28px; font-size: 1.6rem; line-height: 1.32; font-weight: 700; letter-spacing: -.015em; min-height: 4em; text-wrap: pretty; }

.answers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 26px; }
.answer {
  position: relative; display: grid; justify-items: center; align-content: center; gap: 10px;
  padding: 22px 12px 18px; min-height: 132px;
  background: var(--surface); color: var(--ink); border: 1.5px solid var(--line-strong); border-radius: 14px;
  font: inherit; cursor: pointer; touch-action: manipulation;
  transition: border-color .15s, background-color .15s, box-shadow .15s, transform .1s;
}
.answer:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.answer-y:hover, .answer-y.pressed { border-color: var(--desirable); background: var(--desirable-soft); }
.answer-m:hover, .answer-m.pressed { border-color: var(--normal); background: var(--normal-soft); }
.answer-n:hover, .answer-n.pressed { border-color: var(--urgent); background: var(--urgent-soft); }
.answer.pressed { transform: scale(.98); box-shadow: none; }
.answer-sign {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  font-size: 1.6rem; line-height: 1; font-weight: 800;
}
.answer-y .answer-sign { color: var(--desirable); background: var(--desirable-soft); }
.answer-m .answer-sign { color: var(--normal); background: var(--normal-soft); }
.answer-n .answer-sign { color: var(--urgent); background: var(--urgent-soft); }
.answer:hover .answer-sign, .answer.pressed .answer-sign { background: var(--surface); }
.answer-label { font-size: .95rem; font-weight: 700; text-align: center; line-height: 1.25; }
.answer-key { position: absolute; top: 10px; right: 10px; margin: 0; color: var(--muted); }
.q-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.keys-hint { text-align: center; font-size: .82rem; }

@media (prefers-reduced-motion: no-preference) {
  .question .q-text, .question .answers { animation: rise .22s var(--ease) both; }
  .question .answers { animation-delay: .04s; }
  @keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}

/* ---------- сообщения: спасибо, доступ закрыт, вход ---------- */

.message-card { text-align: center; padding: 44px 36px 36px; }
.message-card .lead { max-width: 46ch; margin-left: auto; margin-right: auto; }
.message-card .actions { justify-content: center; }
.message-icon {
  display: inline-grid; place-items: center; width: 64px; height: 64px; margin-bottom: 20px;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent);
}
.message-icon .icon { width: 30px; height: 30px; }
.message-icon.ok { background: var(--desirable-soft); color: var(--desirable); }
.message-card .form { text-align: left; }

.send-status {
  display: inline-flex; align-items: flex-start; gap: 10px; margin-top: 22px; padding: 10px 16px;
  border-radius: 12px; background: var(--surface-2); color: var(--muted); font-weight: 600; text-align: left;
}
.send-status .icon, .send-status .spinner { margin-top: 3px; }
.send-status.ok { background: var(--desirable-soft); color: var(--desirable); }
.send-status.fail { background: var(--urgent-soft); color: var(--urgent); }

.app > .card.login { max-width: 460px; }
.login h1 { font-size: 1.55rem; }

/* ---------- код результата ---------- */

.code-box {
  margin-top: 16px; resize: vertical;
  font: .9rem/1.5 var(--mono); word-break: break-all;
  background: var(--surface-2);
}

/* ---------- отчёт ---------- */

.report { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.back-link { margin-bottom: -4px; font-size: .92rem; font-weight: 700; }
.back-link a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.back-link .icon { width: 16px; height: 16px; }

.report-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px 32px; padding: 24px 28px; }
.report-person { display: flex; align-items: center; gap: 16px; min-width: 0; }
.report-head .eyebrow { margin-bottom: 4px; }
.avatar {
  display: inline-grid; place-items: center; flex: none; width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 1.1rem; letter-spacing: .02em;
}
.avatar.small { width: 30px; height: 30px; font-size: .72rem; }
.facts { display: flex; flex-wrap: wrap; gap: 10px 0; margin: 0; }
.facts > div { padding: 0 20px; border-left: 1px solid var(--line); }
.facts > div:first-child { padding-left: 0; border-left: 0; }
.facts dt { color: var(--muted); font-size: .76rem; font-weight: 600; }
.facts dd { margin: 2px 0 0; font-weight: 700; }

.graph-card { padding: 22px 16px 18px; }
.graph-wrap { overflow-x: auto; }
.graph { display: block; width: 100%; min-width: 660px; height: auto; font-family: var(--font); }
.graph .band-normal { fill: #eef1f4; }
.graph .band-attention { fill: #dde3e9; }
.graph .grid { stroke: #cfd6de; stroke-width: .8; }
.graph .grid-zero { stroke: #7c8896; stroke-width: 1.4; }
.graph .grid-v { stroke: #dfe4ea; stroke-width: 1; }
.graph .tick { font-size: 12px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.graph .letter { font-size: 16px; font-weight: 800; fill: var(--ink); }
.graph .pole { font-size: 10.5px; font-weight: 600; letter-spacing: .02em; fill: var(--muted); }
.graph .profile-line { fill: none; stroke: var(--profile); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.graph .profile-dot { fill: var(--profile); stroke: #fff; stroke-width: 2; }
.graph .manic-ring { fill: none; stroke: var(--profile); stroke-width: 1.5; stroke-dasharray: 3 3; }
.graph .value { font-size: 12.5px; font-weight: 800; fill: var(--profile); paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; font-variant-numeric: tabular-nums; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 22px; list-style: none; margin: 14px 0 0; padding: 0 12px; color: var(--muted); font-size: .82rem; }
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.swatch { width: 14px; height: 14px; border-radius: 4px; border: 1px solid #b9c2cc; }
.sw-desirable { background: #fff; }
.sw-normal { background: #eef1f4; }
.sw-attention { background: #dde3e9; }
.sw-urgent { background: #fff; border-style: dashed; }

.numbers { padding: 20px 24px; }
.numbers-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.numbers-line { margin-top: 10px; padding: 10px 14px; background: var(--surface-2); border-radius: var(--radius-sm); font: 600 .95rem/1.6 var(--mono); overflow-wrap: anywhere; }
.numbers-line.manic { color: var(--profile); }

.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 22px 24px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pill { padding: 5px 12px; border-radius: 99px; font-size: .84rem; font-weight: 700; line-height: 1.4; }
.pill.zone-desirable { background: var(--desirable-soft); }
.pill.zone-normal { background: var(--normal-soft); }
.pill.zone-attention { background: var(--attention-soft); }
.pill.zone-urgent { background: var(--urgent-soft); }
.summary .hint { margin-top: 10px; }
@media (max-width: 640px) { .summary { grid-template-columns: 1fr; } }

.notes { padding: 20px 24px; background: #fbfcfd; border-color: #c9d6e0; }
.notes p { margin-top: 8px; color: var(--ink-2); }

.section-title { margin: 22px 4px 4px; font-size: 1.3rem; font-weight: 800; letter-spacing: -.015em; }
.traits { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.trait { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow-sm); }
.trait::before { content: ''; position: absolute; left: -1px; top: 18px; bottom: 18px; width: 3px; border-radius: 0 3px 3px 0; background: currentColor; }
.trait > * { color: var(--ink); }
.trait-head { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start; }
.trait-letter { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2) !important; }
.trait-title h3 { font-size: 1.04rem; line-height: 1.35; }
.trait-title .vs { color: var(--muted); font-weight: 500; }
.trait-about { color: var(--muted); font-size: .87rem; margin-top: 3px; line-height: 1.45; }
.trait-score { display: grid; justify-items: end; gap: 6px; }
.trait-value { font-size: 1.6rem; font-weight: 800; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.chip { font-size: .74rem; font-weight: 800; padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.meter {
  position: relative; height: 8px; margin: 16px 0 14px; border-radius: 99px;
  background: linear-gradient(to right, var(--urgent-soft) 0 40%, var(--attention-soft) 40% 50%, var(--normal-soft) 50% 66%, var(--desirable-soft) 66% 100%);
  box-shadow: inset 0 0 0 1px rgba(15, 27, 42, .05);
}
.meter-zero { position: absolute; left: 50%; top: -3px; width: 2px; height: 14px; margin-left: -1px; border-radius: 2px; background: #7c8896; }
.meter-dot { position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: currentColor; border: 3px solid #fff; box-shadow: 0 1px 3px rgba(15, 27, 42, .3); }
.trait .meter-dot { color: inherit; }
.trait-text { font-size: .97rem; color: var(--ink-2); }
.trait-hint { margin-top: 8px; font-size: .84rem; color: var(--muted) !important; }
@media (max-width: 560px) {
  .trait-head { grid-template-columns: auto 1fr; }
  .trait-score { grid-column: 1 / -1; grid-auto-flow: column; justify-content: start; align-items: center; gap: 10px; }
}

.zone-desirable { color: var(--desirable); }
.zone-normal { color: var(--normal); }
.zone-attention { color: var(--attention); }
.zone-urgent { color: var(--urgent); }
.zone-desirable .chip { background: var(--desirable-soft); color: var(--desirable); }
.zone-normal .chip { background: var(--normal-soft); color: var(--normal); }
.zone-attention .chip { background: var(--attention-soft); color: var(--attention); }
.zone-urgent .chip { background: var(--urgent-soft); color: var(--urgent); }
.zone-desirable .trait-value, .zone-desirable .meter-dot { color: var(--desirable); }
.zone-normal .trait-value, .zone-normal .meter-dot { color: var(--ink-2); }
.zone-attention .trait-value, .zone-attention .meter-dot { color: var(--attention); }
.zone-urgent .trait-value, .zone-urgent .meter-dot { color: var(--urgent); }
.zone-desirable .meter-dot { background: var(--desirable); }
.zone-normal .meter-dot { background: var(--ink-2); }
.zone-attention .meter-dot { background: var(--attention); }
.zone-urgent .meter-dot { background: var(--urgent); }

/* ---------- график в целом и сочетания шкал ---------- */

.reading { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.reading .section-title { margin-bottom: 0; }
.reading .section-title:not(:first-child) { margin-top: 26px; }
.section-lead { color: var(--muted); font-size: .93rem; padding: 0 4px; max-width: 72ch; }

.overview { padding: 22px 24px 8px; }
.groups { margin-top: 18px; }
.group { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 6px 28px; padding: 16px 0; border-top: 1px solid var(--line); }
.group-name { font-weight: 800; }
.group-value { font-variant-numeric: tabular-nums; }
.group-meta { color: var(--muted); font-size: .82rem; line-height: 1.45; margin-top: 2px; }
.group-text { font-size: .96rem; color: var(--ink-2); }
@media (max-width: 680px) { .group { grid-template-columns: 1fr; } }

.scale-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.scale-chip {
  padding: 1px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line);
  font: 700 .78rem/1.7 var(--mono); white-space: nowrap;
}

.combos { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.combo { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; box-shadow: var(--shadow-sm); }
.combo::before { content: ''; position: absolute; left: -1px; top: 16px; bottom: 16px; width: 3px; border-radius: 0 3px 3px 0; background: var(--attention); }
.combo.kind-resource::before { background: var(--desirable); }
.combo.kind-note::before { background: #9aa5b1; }
.combo-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.combo-head h3 { font-size: 1.02rem; line-height: 1.35; }
.combo p { margin-top: 10px; font-size: .96rem; color: var(--ink-2); }
.tag {
  padding: 2px 9px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
  font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap;
}
.more-combos summary { display: inline-flex; padding: 10px 4px; color: var(--accent); font-weight: 700; cursor: pointer; }
.more-combos[open] summary { margin-bottom: 4px; }
.no-combos { padding: 18px 22px; color: var(--muted); }

/* ---------- ИИ-анализ под должность ---------- */

.ai { padding: 28px 30px; margin-top: 14px; border-color: #cfe3e1; background: linear-gradient(180deg, #f6fbfa 0, var(--surface) 160px); }
.ai-head { display: flex; align-items: center; gap: 12px; }
.ai-head h2 { font-size: 1.3rem; font-weight: 800; letter-spacing: -.015em; }
.ai-badge { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--accent); color: #fff; }
.ai-badge .icon { width: 20px; height: 20px; }
.ai-head .tag { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.ai-lead { margin-top: 10px; color: var(--muted); max-width: 70ch; }
.ai-form { margin-top: 20px; }
.ai-form textarea { resize: vertical; min-height: 88px; }
.ai-form .optional { color: var(--muted); font-weight: 500; }
.ai-unavailable { margin-top: 16px; padding: 12px 16px; background: var(--surface-2); border-radius: var(--radius-sm); }
.ai-status { display: flex; align-items: center; gap: 10px; margin-top: 18px; color: var(--muted); font-weight: 600; }
.spinner { flex: none; width: 16px; height: 16px; border: 2px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
.ai-output { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); max-width: 72ch; color: var(--ink-2); }
.ai-output h3 { margin: 26px 0 8px; font-size: 1.1rem; line-height: 1.3; color: var(--ink); }
.ai-output h3:first-child { margin-top: 0; }
.ai-output h4 { margin: 14px 0 6px; font-size: 1rem; color: var(--ink); }
.ai-output p { margin-top: 8px; }
.ai-output strong { color: var(--ink); }
.ai-output ul, .ai-output ol { margin: 8px 0 0; padding-left: 22px; }
.ai-output li + li { margin-top: 6px; }
.ai-output li::marker { color: var(--accent); }
.ai-footer { margin-top: 20px; display: grid; gap: 6px; }
.ai-meta:empty { display: none; }
[hidden] { display: none !important; }

.disclaimer { color: var(--muted); font-size: .85rem; padding: 0 4px; }
.code-card .code-box { margin-top: 10px; }

/* ---------- страница администратора ---------- */

.app-wide, .topbar-wide .topbar-inner { max-width: 1280px; }
.app-wide > .card.admin { max-width: none; padding: 28px 28px 24px; }
.admin-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.admin-head h1 { font-size: 1.7rem; }
.admin-head .hint { margin-top: 6px; font-weight: 600; }
.admin-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin: 22px 0 14px; }
.search { position: relative; display: block; flex: 0 1 340px; }
.search .icon { position: absolute; left: 13px; top: 50%; margin-top: -9px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 40px; min-height: 44px; }
.share { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.share .icon { width: 16px; height: 16px; }
.table-wrap { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.results { width: 100%; border-collapse: collapse; font-size: .9rem; }
.results th, .results td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.results th { background: var(--surface-2); font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.results tbody tr:last-child td { border-bottom: 0; }
.results tbody tr { transition: background-color .12s; }
.results tbody tr:hover { background: #f7fafa; }
.results .num { text-align: center; white-space: nowrap; padding-left: 4px; padding-right: 4px; }
.results th.num { text-align: center; }
.results .nowrap { white-space: nowrap; }
.results .name a { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); text-decoration: none; white-space: nowrap; }
.results .name a:hover span:last-child { color: var(--accent); text-decoration: underline; }
.score {
  display: inline-block; min-width: 46px; padding: 3px 6px; border-radius: 7px;
  font-size: .84rem; font-weight: 800; font-variant-numeric: tabular-nums; text-align: center;
}
.score.zone-desirable { background: var(--desirable-soft); }
.score.zone-normal { background: var(--normal-soft); color: var(--ink-2); }
.score.zone-attention { background: var(--attention-soft); }
.score.zone-urgent { background: var(--urgent-soft); }
.actions-cell { white-space: nowrap; text-align: right; }
.actions-cell .btn + .btn { margin-left: 4px; }
.flags { min-width: 96px; }
.flag { display: inline-block; margin: 2px 4px 2px 0; padding: 2px 8px; border-radius: 99px; font-size: .72rem; font-weight: 700; background: var(--normal-soft); color: var(--normal); white-space: nowrap; }
.flag.warn { background: var(--attention-soft); color: var(--attention); }
.empty { padding: 36px 0 12px; text-align: center; color: var(--muted); }
.admin .legend { margin-top: 16px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }

/* таблица результатов на узком экране — карточками */
@media (max-width: 720px) {
  .table-wrap { overflow: visible; border: 0; border-radius: 0; }
  .results thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .results, .results tbody { display: block; }
  .results tbody tr {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px 6px;
    padding: 14px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  }
  .results tbody tr:hover { background: var(--surface); }
  .results td { display: block; padding: 0; border: 0; }
  .results td.name { grid-column: 1 / -1; order: -3; }
  .results td[data-label="Дата"] { grid-column: 1 / span 3; order: -2; color: var(--muted); font-size: .84rem; }
  .results td[data-label="Возраст, пол"] { grid-column: 4 / -1; order: -2; color: var(--muted); font-size: .84rem; text-align: right; }
  .results .num { display: grid; justify-items: center; gap: 2px; }
  .results .num::before { content: attr(data-label); font-size: .7rem; font-weight: 800; color: var(--muted); }
  .results .score { min-width: 0; width: 100%; }
  .results .flags { grid-column: 1 / -1; min-width: 0; }
  .results .flags:empty { display: none; }
  .results .actions-cell { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; padding-top: 6px; border-top: 1px solid var(--line); }
}

/* ---------- телефон ---------- */

@media (max-width: 560px) {
  .topbar-inner { height: 56px; padding: 0 16px; }
  .brand-mark { width: 26px; height: 26px; }
  .app { padding: 20px 16px 56px; }
  .card, .start-card, .question { padding: 22px 18px; }
  .message-card { padding: 32px 20px 26px; }
  h1 { font-size: 1.5rem; }
  .start-hero h1 { font-size: 1.75rem; }
  .how-keys { gap: 8px; }
  .how-key { flex-direction: column; justify-content: flex-start; gap: 8px; padding: 12px 6px; text-align: center; font-size: .78rem; }
  .how-key .answer-sign { width: 30px; height: 30px; font-size: 1.1rem; }
  .start-facts li { font-size: .82rem; padding: 6px 11px; }
  .form-row { grid-template-columns: 1fr; }
  .form-row .field-age { max-width: 140px; }
  .q-text { font-size: 1.25rem; min-height: 0; margin-top: 22px; }
  .answers { grid-template-columns: 1fr; gap: 10px; }
  .answer { grid-template-columns: 44px 1fr; justify-items: start; align-items: center; gap: 14px; min-height: 64px; padding: 10px 14px; }
  .answer-sign { width: 40px; height: 40px; font-size: 1.4rem; }
  .answer-key, .keys-hint { display: none; }
  .report-head { padding: 20px 18px; }
  .facts > div { padding: 0 14px; }
  .avatar { width: 48px; height: 48px; }
  .ai { padding: 22px 18px; }
  .app-wide > .card.admin { padding: 20px 14px; }
  .search { flex-basis: 100%; }
}

/* ---------- печать ---------- */

@media print {
  @page { margin: 12mm; }
  body { background: #fff; font-size: 11pt; }
  .topbar { position: static; }
  .no-print { display: none !important; }
  .app { max-width: none; padding: 0; }
  .card, .trait, .combo, .group { box-shadow: none; break-inside: avoid; }
  .ai { break-inside: auto; background: #fff; }
  .ai-output { max-width: none; }
  .ai-output h3 { break-after: avoid; }
  .more-combos summary { display: none; }
  .graph { min-width: 0; }
  .graph-wrap { overflow: visible; }
  .report { gap: 10px; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
