/* Раздел для сотрудников ITSPB. Цвета и шрифты — как на itspb.com, разметка — по прототипу аттестации. */
@font-face { font-family: 'Onest'; src: url('/assets/fonts/onest-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Onest'; src: url('/assets/fonts/onest-cyrillic-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'JetBrains Mono'; src: url('/assets/fonts/jetbrains-mono-latin-wght-normal.woff2') format('woff2'); font-weight: 100 800; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'JetBrains Mono'; src: url('/assets/fonts/jetbrains-mono-cyrillic-wght-normal.woff2') format('woff2'); font-weight: 100 800; font-display: swap; unicode-range: U+0400-045F; }

:root {
  --bg: #f3f5f8; --surface: #ffffff; --sunk: #e9edf3; --fg: #15171c; --muted: #646c7a; --line: #dde2ea;
  --accent: #0b63f6; --accent-soft: #e6effe; --on-accent: #ffffff;
  --good: #1f8a52; --good-soft: #e3f4ea; --warn: #b26f00; --warn-soft: #fbefd9; --bad: #c62f2f; --bad-soft: #fbe3e3;
  --f-body: 'Onest', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --r: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) {
  --bg: #0b0d12; --surface: #12151c; --sunk: #191d26; --fg: #eef1f6; --muted: #8d95a4; --line: #262c38;
  --accent: #3d86ff; --accent-soft: #14233d; --on-accent: #ffffff;
  --good: #5fcf8e; --good-soft: #12291c; --warn: #f0b04f; --warn-soft: #33260f; --bad: #f2827a; --bad-soft: #3a1a18; color-scheme: dark; } }
:root[data-theme='dark'] {
  --bg: #0b0d12; --surface: #12151c; --sunk: #191d26; --fg: #eef1f6; --muted: #8d95a4; --line: #262c38;
  --accent: #3d86ff; --accent-soft: #14233d; --on-accent: #ffffff;
  --good: #5fcf8e; --good-soft: #12291c; --warn: #f0b04f; --warn-soft: #33260f; --bad: #f2827a; --bad-soft: #3a1a18; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--f-body); font-size: 15px; line-height: 1.55;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 0 60px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1080px; margin: 0 auto; padding: 14px 0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; color: var(--fg); }
.brand img { width: 28px; height: 28px; }
.brand span { color: var(--muted); font-weight: 500; }
.who { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.wrap { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.wrap.wide { max-width: 1080px; }
h1, h2, h3 { text-wrap: balance; margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 20px; font-weight: 650; }
h3 { font-size: 16px; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.eyebrow { font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spread { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
ul.plain { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
button, .btn { font: inherit; cursor: pointer; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); padding: 8px 16px; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
button:hover, .btn:hover { border-color: var(--accent); }
button.primary, .btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600; }
button.danger { color: var(--bad); border-color: var(--bad); }
button.link { border: none; background: none; color: var(--accent); padding: 4px 0; text-decoration: underline; border-radius: 4px; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button:focus-visible, .btn:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type=text], textarea, select { font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; width: 100%; }
textarea { min-height: 120px; resize: vertical; }
textarea.short { min-height: 64px; }
label { cursor: pointer; }
.steps { display: flex; gap: 6px; flex-wrap: wrap; }
.step { font-size: 13px; padding: 4px 10px; border-radius: 99px; background: var(--sunk); color: var(--muted); }
.step.on { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.step.done { background: var(--accent-soft); color: var(--accent); }
.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.timer { font-family: var(--f-mono); font-size: 18px; font-weight: 600; }
.timer.over { color: var(--warn); }
.save { font-size: 13px; color: var(--muted); }
.save.err { color: var(--bad); font-weight: 600; }
.q { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.qhead { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.qnum { font-family: var(--f-mono); font-weight: 600; color: var(--accent); }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--sunk); color: var(--muted); }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.opt input { margin-top: 4px; accent-color: var(--accent); flex: none; }
.opt.dk { border-style: dashed; color: var(--muted); }
code { font-family: var(--f-mono); font-size: 0.92em; background: var(--sunk); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
.scenario { background: var(--sunk); border-radius: 10px; padding: 10px 12px; }
.notice { border-radius: 10px; padding: 10px 12px; background: var(--warn-soft); color: var(--fg); }
.notice.bad { background: var(--bad-soft); }
.notice.good { background: var(--good-soft); }
.confirm { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; background: var(--sunk); padding: 10px 12px; border-radius: 10px; }
.tbl-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
td.c, th.c { text-align: center; }
td input { accent-color: var(--accent); }
.attempts { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.att { text-align: left; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; border-radius: var(--r); }
.att.sel { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; }
.chip.ok { background: var(--good-soft); color: var(--good); }
.chip.wip { background: var(--warn-soft); color: var(--warn); }
.chip.no { background: var(--bad-soft); color: var(--bad); }
.chip.na { background: var(--sunk); color: var(--muted); }
.score-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.tile { background: var(--sunk); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.tile b { font-family: var(--f-mono); font-size: 20px; }
.tile.total { background: var(--accent-soft); }
.ans { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--sunk); border-radius: 10px; padding: 10px 12px; min-height: 40px; }
.ans.empty { color: var(--muted); font-style: italic; }
.crit { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border: none; border-radius: 0; padding: 5px 10px; font-family: var(--f-mono); font-size: 13px; background: var(--surface); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--accent); color: var(--on-accent); }
.pick { font-size: 14px; }
.pick.right { color: var(--good); }
.pick.wrong { color: var(--bad); }
details { border-top: 1px solid var(--line); padding-top: 8px; }
summary { cursor: pointer; color: var(--accent); font-size: 14px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.excluded { opacity: 0.55; }
.growth { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.gates li.ok { color: var(--good); }
.gates li.fail { color: var(--bad); }
.gates li.na { color: var(--muted); }
.login { max-width: 440px; margin: 12vh auto 0; }
.login .btn.primary { justify-content: center; padding: 12px 18px; font-size: 16px; }
[hidden] { display: none !important; }
/* Переключатель темы: три кнопки в одной капсуле */
.theme-switch { display: inline-flex; padding: 2px; gap: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.theme-switch button { border: none; padding: 4px 10px; min-width: 34px; justify-content: center; font-size: 13px; line-height: 1.2; color: var(--muted); background: none; }
.theme-switch button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.theme-switch button:hover { color: var(--fg); }
.theme-switch button[aria-pressed="true"]:hover { color: var(--on-accent); }
@media (max-width: 560px) { h1 { font-size: 23px; } .crit { grid-template-columns: 1fr; } .who .email { display: none; } }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* Печать заключения: на бумагу выводится только подготовленный блок #print */
#print { display: none; }
@media print {
  body { background: #fff; color: #000; padding: 0; font-size: 12pt; }
  body > *:not(#print) { display: none !important; }
  #print { display: block; }
  #print h1 { font-size: 18pt; margin-bottom: 4pt; }
  #print h2 { font-size: 13pt; margin: 14pt 0 4pt; }
  #print p, #print li { margin: 2pt 0; }
  #print table { font-size: 10pt; }
  #print th, #print td { border-bottom: 1px solid #ccc; color: #000; }
}
