/* Шахматный радар — фирменный стиль: чернильно-синий и янтарь */
:root {
  --bg: #f5f7fc;
  --surface: #ffffff;
  --ink: #14213d;
  --text-2: #33415e;
  --muted: #6a7792;
  --line: #d6ddeb;
  --navy: #14213d;
  --on-navy: #f5f7fc;
  --amber: #f2a93b;
  --amber-hi: #e39422;
  --on-amber: #14213d;
  --sel-bg: #14213d;
  --sel-ink: #ffffff;
  --win: #1f9d6b;
  --draw: #98a3b8;
  --loss: #e0503c;
  --sq-light: #e4eaf5;
  --sq-dark: #c6d1e5;
  --display: "Manrope", "Segoe UI", system-ui, sans-serif;
  --font: "Golos Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --mono: "JetBrains Mono", "Consolas", "Menlo", monospace;
  --r: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1322; --surface: #131c30; --ink: #e8edf7; --text-2: #c3cbdc; --muted: #8592ad; --line: #26324c;
    --navy: #1b2744; --on-navy: #e8edf7; --sel-bg: #e8edf7; --sel-ink: #0c1322;
    --win: #3cc48a; --draw: #5e6b85; --loss: #f06a55; --sq-light: #1b2742; --sq-dark: #141e35;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c1322; --surface: #131c30; --ink: #e8edf7; --text-2: #c3cbdc; --muted: #8592ad; --line: #26324c;
  --navy: #1b2744; --on-navy: #e8edf7; --sel-bg: #e8edf7; --sel-ink: #0c1322;
  --win: #3cc48a; --draw: #5e6b85; --loss: #f06a55; --sq-light: #1b2742; --sq-dark: #141e35;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--font); }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- Шапка ---------- */
.top { max-width: 1120px; margin: 0 auto; padding: 20px 20px 8px; display: grid; grid-template-columns: 1fr auto; gap: 18px 20px; align-items: center; }
.logo { white-space: nowrap; display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 700 16px/1 var(--display); letter-spacing: -0.01em; }
.logo-mark { width: 24px; height: 24px; display: grid; grid-template-columns: repeat(3, 1fr); border-radius: 5px; overflow: hidden; background: var(--sq-light); }

.logo-mark i:nth-child(5) { background: var(--amber); }
.top-right { display: flex; align-items: center; gap: 14px; }
.about-link { white-space: nowrap; color: var(--muted); text-decoration: none; font-size: 15px; }
.about-link:hover, .about-link[aria-current] { color: var(--ink); }
@media (max-width: 440px) { .about-link { display: none; } }
.theme-btn { width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; display: grid; place-items: center; }
.theme-btn:hover { border-color: var(--ink); }
.theme-btn span { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--ink); background: linear-gradient(90deg, var(--ink) 50%, transparent 50%); }

/* Переключатель разделов — как шахматные часы */
.switch { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; max-width: 520px; padding: 5px; background: var(--navy); border-radius: 16px; }
.switch a { position: relative; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; color: color-mix(in srgb, var(--on-navy) 70%, transparent); font-weight: 500; font-size: 16px; }
.switch a::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: color-mix(in srgb, var(--on-navy) 30%, transparent); }
.switch a:hover { color: var(--on-navy); }
.switch a[aria-current] { background: var(--amber); color: var(--on-amber); font-weight: 600; }
.switch a[aria-current]::before { background: var(--on-amber); }

/* ---------- Типографика ---------- */
main { max-width: 1120px; margin: 0 auto; padding: 8px 20px 72px; }
.intro { max-width: 540px; }
h1, h2 { font-family: var(--display); letter-spacing: -0.02em; line-height: 1.12; }
h1 { font-size: clamp(30px, 5.5vw, 44px); font-weight: 700; margin: 40px 0 16px; }
h2 { font-size: clamp(22px, 3.4vw, 28px); font-weight: 500; margin: 64px 0 18px; }
h3 { font-size: 19px; font-weight: 600; margin: 32px 0 12px; line-height: 1.3; }
.lead { font-size: 18px; color: var(--text-2); margin: 0 0 30px; }
.hint { font-size: 14px; color: var(--muted); margin: 8px 0 14px; }
p { max-width: 68ch; }

/* ---------- Формы ---------- */
.form { display: grid; gap: 14px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .two { grid-template-columns: 1fr; } }
.text { font: inherit; font-size: 16px; color: var(--ink); background: var(--surface); width: 100%; min-width: 0; height: 58px; padding: 0 18px; border: 1.5px solid var(--line); border-radius: var(--r); }
.text::placeholder { color: var(--muted); }
.text:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--amber) 35%, transparent); }
.field { border: 0; padding: 0; margin: 10px 0 0; min-width: 0; }
.field legend { padding: 0; margin-bottom: 10px; font-size: 15px; font-weight: 600; color: var(--ink); }

.seg { display: grid; gap: 8px; }
.seg-2 { grid-template-columns: repeat(2, 1fr); }
.seg-3 { grid-template-columns: repeat(3, 1fr); }
.seg-4 { grid-template-columns: repeat(4, 1fr); }
.seg-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 520px) { .seg-5 { grid-template-columns: repeat(3, 1fr); } }
.seg label { position: relative; display: block; min-width: 0; }
.seg input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg span { display: flex; align-items: center; justify-content: center; gap: 8px; text-align: center; min-height: 54px; padding: 6px 8px; line-height: 1.2;
  border: 1.5px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink); font-size: 16px; cursor: pointer; transition: background .15s, border-color .15s; }
.seg label:hover span { border-color: var(--muted); }
.seg input:checked + span { background: var(--sel-bg); border-color: var(--sel-bg); color: var(--sel-ink); font-weight: 600; box-shadow: inset 0 -3px 0 var(--amber); }
.seg input:focus-visible + span { outline: 3px solid var(--amber); outline-offset: 2px; }
.seg-sm span { min-height: 40px; font-size: 14px; }
.pw::before { content: ""; flex: none; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid currentColor; }
.pw-w::before { background: #fff; border-color: #14213d; }
.pw-b::before { background: #14213d; border-color: #14213d; }
.seg input:checked + .pw-b::before { border-color: var(--sel-ink); }
.pw-q::before { background: linear-gradient(90deg, #fff 50%, #14213d 50%); border-color: #14213d; }
.row-controls { display: grid; grid-template-columns: 1.3fr 1fr; gap: 10px; }
@media (max-width: 700px) { .row-controls { grid-template-columns: 1fr; } }

.more { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r); padding: 0 18px; }
.more > summary { cursor: pointer; padding: 15px 0; color: var(--text-2); list-style: none; display: flex; justify-content: space-between; align-items: center; }
.more > summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin-right: 4px; transition: transform .2s; }
.more[open] > summary::after { transform: rotate(-135deg); }
.more > summary::-webkit-details-marker { display: none; }
.more[open] { padding-bottom: 18px; }
.more .field { margin-top: 18px; }

.btn { font: 600 17px/1 var(--font); cursor: pointer; border: 0; border-radius: var(--r); background: var(--amber); color: var(--on-amber); height: 58px; padding: 0 26px; margin-top: 6px;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none; box-shadow: 0 2px 0 var(--amber-hi); }
.btn:hover { background: var(--amber-hi); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); box-shadow: none; margin-top: 0; font-weight: 500; }
.btn-ghost:hover { background: var(--surface); border-color: var(--ink); }
.demo-link { justify-self: start; color: var(--ink); font-size: 15px; font-weight: 500; text-decoration: underline; text-decoration-color: var(--amber); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.demo-link:hover { text-decoration-color: var(--ink); }
.demo-note { background: color-mix(in srgb, var(--amber) 16%, var(--surface)); border-left: 4px solid var(--amber); border-radius: 8px; padding: 14px 18px; margin: 48px 0 0; max-width: 72ch; }
.status { min-height: 1.5em; margin: 0; font-size: 15px; color: var(--muted); }
.status.err { color: var(--loss); }
.errors { margin: 0; padding: 0; list-style: none; color: var(--loss); font-size: 15px; }

/* ---------- Сводка ---------- */
.summary { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); align-items: start; background: var(--surface); border: 1.5px solid var(--line); border-radius: 18px; padding: 26px; }
@media (max-width: 780px) { .summary { grid-template-columns: 1fr; padding: 20px; } }
.sum-big { font: 700 clamp(60px, 11vw, 96px)/1 var(--display); margin: 0; letter-spacing: -0.04em; }
.sum-cap { margin: 10px 0 16px; color: var(--muted); }
.sum-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 18px 24px; margin: 24px 0 0; }
.sum-grid dt { font-size: 14px; color: var(--muted); }
.sum-grid dd { margin: 2px 0 0; font-weight: 600; }
.sum-grid small { color: var(--muted); font-weight: 400; }
.sum-board { margin: 0; }
.sum-board figcaption { font-size: 13px; color: var(--muted); margin-top: 12px; line-height: 1.8; }

/* ---------- Доска результатов ---------- */
.board { display: grid; grid-template-columns: repeat(8, 1fr); aspect-ratio: 1; width: 100%; border-radius: 10px; overflow: hidden; border: 5px solid var(--navy); }
.sq { background: var(--sq-light); display: block; }
.sq.dark { background: var(--sq-dark); }
.sq.r-win { background: var(--win); }
.sq.r-draw { background: var(--draw); }
.sq.r-loss { background: var(--loss); }
.sq.dark.r-win, .sq.dark.r-draw, .sq.dark.r-loss { filter: brightness(.86); }
a.sq:hover { filter: none; box-shadow: inset 0 0 0 3px var(--amber); }
.lg { white-space: nowrap; }
.lg::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin: 0 6px 0 10px; vertical-align: -1px; }
.lg-w::before { background: var(--win); } .lg-d::before { background: var(--draw); } .lg-l::before { background: var(--loss); }

/* ---------- Полосы и проценты ---------- */
.bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--line); min-width: 60px; }
.bar span { display: block; height: 100%; }
.b-w { background: var(--win); } .b-d { background: var(--draw); } .b-l { background: var(--loss); }
.wdl { font-size: 13px; white-space: nowrap; }
.t-w { color: var(--win); } .t-d { color: var(--muted); } .t-l { color: var(--loss); }
.sc { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 3.2em; text-align: right; }
.sc-good { color: var(--win); } .sc-bad { color: var(--loss); }
.sc-few { color: var(--muted); font-weight: 400; }
.cnt { font-variant-numeric: tabular-nums; color: var(--muted); text-align: right; }

/* ---------- Вкладки цвета ---------- */
.tabs { display: inline-grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; margin: 0 0 14px; min-width: min(100%, 360px); }
.tab { font: 500 15px/1 var(--font); cursor: pointer; height: 42px; padding: 0 16px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.tab::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid #14213d; }
.tab[data-color="white"]::before { background: #fff; }
.tab[data-color="black"]::before { background: #14213d; }
.tab[aria-selected="true"] { background: var(--sel-bg); color: var(--sel-ink); font-weight: 600; }
.tab[aria-selected="true"][data-color="black"]::before { border-color: var(--sel-ink); }

/* ---------- Дерево и таблица дебютов ---------- */
.tree, .ops, .lvl, .recent { background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; overflow: hidden; }
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
.node > summary, .op > summary { display: grid; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.node:last-child > summary, .op:last-child > summary { border-bottom: 0; }
.node[open] > summary, .op[open] > summary { border-bottom: 1px solid var(--line); }
.node > summary { grid-template-columns: 5.5em 7em 3em minmax(80px, 1fr) 3.5em; }
.node > summary:hover, .op > summary:hover { background: color-mix(in srgb, var(--amber) 7%, var(--surface)); }
.node[open] > summary, .op[open] > summary { background: color-mix(in srgb, var(--amber) 12%, var(--surface)); }
.mv { font-family: var(--mono); font-weight: 500; }
.mv-big { font-size: 18px; }
.share { font-size: 14px; color: var(--muted); }
.kids-cap { font-size: 13px; font-weight: 600; color: var(--muted); margin: 14px 16px 6px; }
.kids, .vars { list-style: none; margin: 0 0 12px; padding: 0 16px; }
.kids li { display: grid; grid-template-columns: 5.5em 3em minmax(80px, 1fr) 3.5em; gap: 14px; align-items: center; padding: 6px 0; }
.vars li { display: grid; grid-template-columns: minmax(0, 1fr) 3em minmax(60px, 180px) 3.5em; gap: 14px; align-items: center; padding: 6px 0; }
.v-name { overflow-wrap: anywhere; }
.op-head, .op > summary { grid-template-columns: minmax(0, 2.2fr) 3.5em minmax(120px, 1.4fr) 3.5em 5.5em; }
.op-head { display: grid; gap: 14px; padding: 12px 16px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); background: var(--bg); }
.op-head span:nth-child(2), .op-head span:nth-child(4), .op-head span:nth-child(5) { text-align: right; }
.op-name { display: grid; min-width: 0; }
.op-ru { font-weight: 600; overflow-wrap: anywhere; }
.op-en { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.op-bar { display: grid; gap: 5px; }
.op-rt { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.op-few { opacity: .55; }
.op-body { padding: 0 0 8px; border-bottom: 1px solid var(--line); }
.gls { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 10px; }
.gl { font-size: 13px; text-decoration: none; padding: 5px 10px; border-radius: 8px; background: var(--bg); border-left: 4px solid; }
.gl.r-win { border-left-color: var(--win); } .gl.r-draw { border-left-color: var(--draw); } .gl.r-loss { border-left-color: var(--loss); }
.gl:hover { text-decoration: underline; }
.empty { color: var(--muted); padding: 16px; margin: 0; }
@media (max-width: 640px) {
  .op-head { display: none; }
  .op > summary { grid-template-columns: minmax(0, 1fr) 3.5em; }
  .op > summary .op-bar { grid-column: 1 / -1; grid-row: 2; }
  .op > summary .cnt { grid-row: 1; grid-column: 2; }
  .op > summary .sc { grid-row: 3; grid-column: 2; }
  .op > summary .op-rt { display: none; }
  .node > summary { grid-template-columns: 4.8em 1fr 3.5em; }
  .node > summary .share { display: none; }
  .node > summary .bar { grid-column: 1 / -1; }
  .kids li { grid-template-columns: 4.8em 2.5em 1fr 3.2em; gap: 8px; }
  .vars li { grid-template-columns: 1fr 2.5em 3.2em; }
  .vars li .bar { display: none; }
}

/* ---------- Выводы и план ---------- */
.ins { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.in { position: relative; padding: 14px 18px 14px 46px; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r); max-width: 72ch; line-height: 1.55; }
.in::before { content: ""; position: absolute; left: 18px; top: 19px; width: 14px; height: 14px; border-radius: 4px; background: var(--draw); }
.in-good::before { background: var(--win); }
.in-bad::before { background: var(--loss); }
.in b { font-weight: 700; }
.plan { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.plan.single { grid-template-columns: minmax(0, 720px); }
.plan h3 { display: flex; align-items: center; gap: 10px; margin-top: 0; }
.pawn { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid #14213d; flex: none; }
.pawn-w { background: #fff; } .pawn-b { background: #14213d; }
:root[data-theme="dark"] .pawn-b { border-color: var(--ink); }

/* ---------- Последние партии ---------- */
.recent { list-style: none; padding: 0; margin: 0; }
.recent li + li a { border-top: 1px solid var(--line); }
.recent a { display: grid; grid-template-columns: 10px 6.5em 5.5em minmax(0, 1fr) minmax(0, 12em); gap: 14px; align-items: center; padding: 12px 16px; text-decoration: none; }
.recent a:hover { background: color-mix(in srgb, var(--amber) 7%, var(--surface)); }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.r-win { background: var(--win); } .dot.r-draw { background: var(--draw); } .dot.r-loss { background: var(--loss); }
.rc-date, .rc-col, .rc-vs { color: var(--muted); font-size: 14px; }
.rc-op, .rc-vs { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) { .recent a { grid-template-columns: 10px 5.8em minmax(0, 1fr); } .rc-col, .rc-vs { display: none; } }

/* ---------- Стиль игрока ---------- */
.style-label { font: 500 22px/1.3 var(--display); letter-spacing: -0.01em; margin: 0 0 4px; }
.traits { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 20px 0 0; }
.traits > div { background: var(--surface); border: 1.5px solid var(--line); border-top: 4px solid var(--amber); border-radius: var(--r); padding: 16px 18px; }
.traits dt { font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.traits dd { margin: 0; line-height: 1.5; }
.lvl { max-width: 780px; }
.lvl-head, .lvl-row { display: grid; grid-template-columns: minmax(0, 2fr) 4em 5.5em 6em 5.5em; gap: 12px; align-items: center; padding: 12px 16px; }
.lvl-row { border-top: 1px solid var(--line); }
.lvl-head { font-size: 13px; color: var(--muted); background: var(--bg); }
.lvl-head span:nth-child(n+2), .lvl-row span:nth-child(n+2) { text-align: right; }
.lvl-row b { font-weight: 500; display: block; }
.lvl-row small { color: var(--muted); font-size: 13px; }
.lvl-row:last-child { background: var(--bg); }
.lvl-row:last-child b { font-weight: 700; }
@media (max-width: 560px) {
  .lvl-head { display: none; }
  .lvl-row { grid-template-columns: 1fr 4.5em 4.5em; }
  .lvl-row span:nth-child(2), .lvl-row span:nth-child(4) { display: none; }
}

/* ---------- Главная ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 540px) minmax(0, 400px); justify-content: space-between; gap: 48px; align-items: center; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }
.hero-fig { margin: 40px 0 0; }

/* ---------- Текстовая страница ---------- */
.prose { max-width: 720px; }
.prose p, .prose li { color: var(--text-2); }
.steps { counter-reset: s; list-style: none; padding: 0; display: grid; gap: 14px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 2.6em 1fr; gap: 12px; align-items: start; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 2.2em; height: 2.2em; border-radius: 8px; background: var(--navy); color: var(--amber); font: 700 15px/1 var(--display); }

footer { max-width: 1120px; margin: 0 auto; padding: 24px 20px 40px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); }
footer a { color: var(--ink); }

@media (prefers-reduced-motion: no-preference) {
  .board.animate .sq { animation: pop .35s ease-out both; animation-delay: calc(var(--i, 0) * 12ms); }
  @keyframes pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
}
.logo-mark i:nth-child(even) { background: var(--ink); }
.logo-mark i:nth-child(5) { background: var(--amber); }
.pw-b::before, .pw-q::before, .tab::before, .pawn { border-color: var(--muted); }
.seg input:checked + .pw::before { border-color: var(--sel-ink); }

/* Загрузка файла */
.file { position: relative; display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 8px; border: 1.5px dashed var(--line); border-radius: var(--r); background: var(--bg); cursor: pointer; }
.file:hover { border-color: var(--muted); }
.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.file input:focus-visible ~ .file-btn { outline: 3px solid var(--amber); outline-offset: 2px; }
.file-btn { flex: none; padding: 9px 14px; border-radius: 9px; background: var(--sel-bg); color: var(--sel-ink); font-weight: 600; font-size: 14px; }
.file-name { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Варианты ход за ходом */
.lines { list-style: none; counter-reset: ln; margin: 0; padding: 0; display: grid; gap: 12px; }
.ln { counter-increment: ln; display: grid; grid-template-columns: minmax(0, 1fr) 208px; gap: 22px; align-items: start; background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; padding: 18px 18px 18px 60px; position: relative; }
.ln::before { content: counter(ln); position: absolute; left: 18px; top: 18px; width: 28px; height: 28px; border-radius: 8px; background: var(--navy); color: var(--amber); display: grid; place-items: center; font: 700 14px/1 var(--display); }
.ln-few { opacity: .75; }
.ln-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ln h4 { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.3; }
.ln-score { font: 700 24px/1 var(--display); flex: none; }
.ln-line { margin: 10px 0 10px; color: var(--muted); font-size: 15px; }
.ln-line .mv { color: var(--ink); font-size: 15px; background: color-mix(in srgb, var(--amber) 14%, transparent); padding: 1px 6px; border-radius: 5px; }
.ln-bar { max-width: 360px; margin: 0 0 8px; }
.ln-stats { margin: 0 0 8px; font-size: 15px; color: var(--text-2); }
.few-tag { display: inline-block; font-size: 12px; font-weight: 600; color: var(--loss); border: 1px solid currentColor; border-radius: 6px; padding: 0 6px; margin-left: 4px; }
.ln-next { margin: 0 0 8px; font-size: 15px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }
.nx { color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 2px 8px; font-size: 14px; }
.nx small { color: var(--muted); }
.ln-last { font-size: 13px; color: var(--muted); }
a.ln-last:hover { color: var(--ink); }
.ln-board { width: 208px; }
.dia { display: block; width: 100%; height: auto; border-radius: 4px; box-shadow: 0 2px 8px rgba(20, 33, 61, .28); }
@media (max-width: 640px) {
  .ln { grid-template-columns: 1fr; padding: 16px; padding-top: 56px; }
  .ln::before { top: 16px; left: 16px; }
  .ln-board { width: min(260px, 100%); }
}
.side-title { display: flex; align-items: center; gap: 10px; }
.side-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.side-tag .pawn { width: 12px; height: 12px; }
.tab { font-variant-numeric: tabular-nums; }

/* Партии варианта и просмотрщик */
.ln-games { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 12px; }
.ln-games .kids-cap { margin: 0 0 8px; }
.gms { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.gm { width: 100%; text-align: left; font: inherit; color: var(--ink); cursor: pointer; display: grid; grid-template-columns: 10px 1fr; gap: 2px 10px; align-items: center;
  padding: 9px 12px; background: var(--bg); border: 1.5px solid var(--line); border-radius: 10px; }
.gm:hover { border-color: var(--muted); }
.gm[aria-expanded="true"] { border-color: var(--amber); background: color-mix(in srgb, var(--amber) 12%, var(--surface)); }
.gm .dot { grid-row: 1 / span 3; }
.gm-res { font-weight: 600; font-size: 14px; }
.gm-vs { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-vs small { color: var(--muted); }
.gm-meta { font-size: 13px; color: var(--muted); }
.gv-slot:not(:empty) { margin-top: 12px; }
.gv { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 22px; background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px; padding: 16px; }
@media (max-width: 700px) { .gv { grid-template-columns: 1fr; } }
.gv-board .dia { max-width: 320px; }
.gv-head { margin: 0 0 10px; font-size: 14px; color: var(--text-2); }
.gv-head b { color: var(--ink); }
.gv-moves { display: flex; flex-wrap: wrap; gap: 2px 2px; align-items: baseline; font-family: var(--mono); font-size: 14px; margin-bottom: 8px; }
.gv-no { color: var(--muted); margin: 0 2px 0 6px; }
.gv-mv { font: inherit; border: 0; background: transparent; color: var(--ink); padding: 2px 5px; border-radius: 5px; cursor: pointer; }
.gv-mv.gv-in { background: color-mix(in srgb, var(--amber) 16%, transparent); }
.gv-mv.gv-out { color: var(--text-2); }
.gv-mv:hover { background: color-mix(in srgb, var(--amber) 30%, transparent); }
.gv-mv.gv-cur { background: var(--sel-bg); color: var(--sel-ink); }
.gv-legend { margin: 0 0 10px; font-size: 12px; color: var(--muted); display: flex; gap: 12px; }
.gv-key::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.gv-key.gv-in::before { background: color-mix(in srgb, var(--amber) 45%, transparent); }
.gv-key.gv-out::before { border: 1px solid var(--line); }
.gv-nav { display: flex; gap: 6px; margin-bottom: 12px; }
.gv-nav button { width: 44px; height: 38px; border-radius: 9px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font-size: 14px; }
.gv-nav button:hover { border-color: var(--ink); }
.gv-links { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.gv-btn { height: 40px; font-size: 14px; padding: 0 14px; }

/* Подробный план */
.in-k { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 3px; }
.in .mvline { display: inline-block; font-size: 14px; background: color-mix(in srgb, var(--amber) 14%, transparent); padding: 1px 6px; border-radius: 5px; margin: 2px 0; }
.in-dia { display: grid; grid-template-columns: minmax(0, 1fr) 132px; gap: 16px; align-items: start; max-width: 860px; }
.in-board .dia { width: 132px; }
@media (max-width: 560px) { .in-dia { grid-template-columns: 1fr; } .in-board .dia { width: 180px; } }
#plan-avoid .ins, #plan-weak .ins { max-width: 860px; }

/* Дерево ходов */
.ex { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 22px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; padding: 18px; }
@media (max-width: 700px) { .ex { grid-template-columns: 1fr; } .ex-left { max-width: 300px; } }
.ex-sum { font-size: 14px; color: var(--muted); margin: 10px 0 0; }
.ex-crumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ex-crumb, .ex-back { font: inherit; font-size: 14px; cursor: pointer; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 8px; padding: 4px 9px; }
.ex-crumb.mv { font-family: var(--mono); }
.ex-crumb:hover, .ex-back:hover { border-color: var(--muted); }
.ex-crumb.ex-here { background: var(--sel-bg); color: var(--sel-ink); border-color: var(--sel-bg); }
.ex-back { margin-left: auto; }
.ex-who { display: flex; align-items: center; gap: 8px; font-weight: 600; margin: 0 0 8px; }
.ex-head, .ex-row { display: grid; grid-template-columns: 6.5em 5.5em minmax(80px, 1fr) 4em; gap: 14px; align-items: center; }
.ex-head { font-size: 13px; color: var(--muted); padding: 0 10px 6px; }
.ex-head span:nth-child(2), .ex-head span:nth-child(4) { text-align: right; }
.ex-row { width: 100%; font: inherit; color: var(--ink); text-align: left; cursor: pointer; background: transparent; border: 0; border-top: 1px solid var(--line); padding: 10px; }
.ex-row:hover { background: color-mix(in srgb, var(--amber) 10%, var(--surface)); }
.ex-row .cnt small { color: var(--muted); }
@media (max-width: 560px) { .ex-head, .ex-row { grid-template-columns: 5.5em 4.5em 1fr 3.2em; gap: 8px; } }
.op-line { display: block; font-size: 13px; color: var(--text-2); margin-top: 3px; font-weight: 400; }

/* Ветки плана и переворот доски */
.pl-pre { color: var(--muted); }
.in .mvline b { font-weight: 700; }
.gv-flip { width: auto !important; padding: 0 12px; }
.ex-flip { display: block; margin-top: 10px; font: inherit; font-size: 14px; cursor: pointer; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 8px; padding: 6px 10px; }
.ex-flip:hover { border-color: var(--muted); }
.plan .in-dia { grid-template-columns: minmax(0, 1fr) 120px; }
.plan .in-board .dia { width: 120px; }
@media (max-width: 560px) { .plan .in-dia { grid-template-columns: 1fr; } .plan .in-board .dia { width: 180px; } }
.plan { grid-template-columns: minmax(0, 1fr); max-width: 900px; }
.plan .in-dia { grid-template-columns: minmax(0, 1fr) 150px; }
.plan .in-board .dia { width: 150px; }
.mv { white-space: nowrap; }
.mvline { white-space: normal; }
.plan .in, .plan .in-dia { max-width: none; }
.h2h-games { border-top: 0; margin-top: 14px; padding-top: 0; }
.ex-games { grid-column: 1 / -1; }
.op-games { padding: 12px 16px 4px; border-top: 0; }

/* ================= Шапка v2 ================= */
.top { grid-template-columns: auto 1fr auto; grid-template-areas: "logo sub right" "switch switch switch"; }
.logo { grid-area: logo; }
.subnav { grid-area: sub; display: flex; gap: 4px 18px; justify-content: flex-end; flex-wrap: wrap; }
.subnav a { color: var(--muted); text-decoration: none; font-size: 15px; white-space: nowrap; padding: 4px 0; border-bottom: 2px solid transparent; }
.subnav a:hover { color: var(--ink); }
.subnav a[aria-current] { color: var(--ink); border-bottom-color: var(--amber); }
.top-right { grid-area: right; }
.switch { grid-area: switch; }
.switch-3 { grid-template-columns: repeat(3, 1fr); max-width: 640px; }
.user-chip { display: inline-block; line-height: 35px; height: 38px; padding: 0 14px; border-radius: 19px; border: 1.5px solid var(--line); text-decoration: none; font-size: 14px; font-weight: 600; background: var(--surface); max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip:hover { border-color: var(--ink); }
.user-chip.in::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--win); margin-right: 7px; vertical-align: 1px; }
@media (max-width: 860px) {
  .top { grid-template-columns: 1fr auto; grid-template-areas: "logo right" "switch switch" "sub sub"; }
  .subnav { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
}
@media (max-width: 440px) { .switch a { font-size: 14px; } .switch a::before { display: none; } }

/* ================= Вход и доступ ================= */
.gate { background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; padding: 22px; }
.gate h2 { margin: 0 0 8px; font-size: 22px; }
.gate p { color: var(--text-2); }
.gate-btns { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
.gate-btns .btn { margin-top: 0; }
.note-box { background: color-mix(in srgb, var(--amber) 14%, var(--surface)); border: 1.5px solid color-mix(in srgb, var(--amber) 45%, var(--line)); border-radius: 10px; padding: 12px 14px; font-size: 15px; }
.note-box a { font-weight: 600; }
.login-grid, .contacts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 24px; }
.card-box { background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; padding: 20px; }
.card-box h3 { margin-top: 2px; }
.card-box p { color: var(--text-2); }
.k { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0; }
.ok-line { color: var(--win) !important; }
.acc-box { background: var(--surface); border: 1.5px solid var(--win); border-radius: 12px; padding: 14px 16px; margin-bottom: 8px; }
.acc-box p { margin: 0 0 8px; }
.cc-form { gap: 10px; }
.cc-steps { margin: 4px 0; padding-left: 20px; color: var(--text-2); font-size: 15px; }
.cc-steps li { margin: 4px 0; }
.cc-code { font-family: var(--mono); background: color-mix(in srgb, var(--amber) 25%, transparent); padding: 1px 6px; border-radius: 5px; color: var(--ink); user-select: all; }

/* ================= Подсказки курсов ================= */
.cta { margin-top: 16px; max-width: 900px; background: var(--navy); color: var(--on-navy); border-radius: 16px; padding: 20px 22px; }
.cta .cta-k { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--amber); }
.cta h4 { font: 700 20px/1.25 var(--display); margin: 6px 0; }
.cta p { color: color-mix(in srgb, var(--on-navy) 85%, transparent); margin: 0 0 12px; }
.cta .cta-why { color: var(--on-navy); }
.cta .btn { margin-top: 4px; }
.cta-soft { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); }
.cta-soft p { color: var(--text-2); }
.cta-soft .cta-k { color: var(--muted); }

/* ================= Главная ================= */
.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; margin-top: 44px; }
.tool { display: block; text-decoration: none; background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; padding: 20px; }
.tool:hover { border-color: var(--ink); }
.tool h3 { margin: 6px 0 8px; }
.tool p { color: var(--text-2); margin: 0; font-size: 15px; }
.tool-k { display: inline-block; font-size: 13px; font-weight: 600; background: var(--navy); color: var(--amber); padding: 3px 10px; border-radius: 8px; }
.club-strip { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; margin-top: 28px; background: var(--navy); color: var(--on-navy); border-radius: 18px; padding: 24px; }
.club-strip h2 { margin: 6px 0 8px; }
.club-strip p { color: color-mix(in srgb, var(--on-navy) 85%, transparent); margin: 0; }
.club-strip .k { color: var(--amber); }
.club-strip .btn-ghost { color: var(--on-navy); border-color: color-mix(in srgb, var(--on-navy) 35%, transparent); }

/* ================= Мероприятия ================= */
.evs { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; max-width: 900px; }
.ev { display: grid; grid-template-columns: 76px 1fr; gap: 18px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; padding: 18px; }
.ev-date { background: var(--navy); color: var(--on-navy); border-radius: 12px; display: grid; place-items: center; align-content: center; height: 76px; }
.ev-day { font: 700 28px/1 var(--display); color: var(--amber); }
.ev-mon { font-size: 13px; margin-top: 4px; }
.ev h3 { margin: 0 0 4px; }
.ev-meta { color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.ev-btn { height: 40px; font-size: 14px; }
.evs-past .ev { opacity: .65; }
.ex-tag { display: inline-block; margin-left: 8px; font: 600 11px/1.6 var(--font); color: var(--muted); border: 1px dashed var(--muted); border-radius: 6px; padding: 0 6px; vertical-align: middle; }

/* ================= Обучение ================= */
.courses { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.course, .train { background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; padding: 20px; transition: box-shadow .3s; }
.course h3, .train h3 { margin: 4px 0 8px; }
.course p, .train p { color: var(--text-2); }
.course-status { margin: 0; font-size: 13px; font-weight: 600; color: var(--win); }
.course-points { padding-left: 20px; color: var(--text-2); }
.course-points li { margin: 4px 0; }
.course-meta { font-size: 14px; color: var(--muted) !important; }
.course.hl, #training-sec.hl .train { box-shadow: 0 0 0 3px var(--amber); }
.enroll-form { max-width: 640px; }
.textarea { height: auto; padding: 14px 18px; resize: vertical; font: inherit; font-size: 16px; }
.sel-label { display: grid; gap: 6px; font-size: 15px; font-weight: 600; }
.sel-label select { font-weight: 400; }
.f-text { white-space: pre-wrap; background: var(--surface); border: 1.5px solid var(--line); border-radius: 10px; padding: 12px; font: 14px/1.5 var(--mono); color: var(--ink); }

/* ================= Контакты ================= */
.contacts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; max-width: 900px; }
.contact { display: grid; gap: 2px; text-decoration: none; background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; padding: 16px 18px; }
a.contact:hover { border-color: var(--ink); }
.c-label { font-weight: 700; }
.c-val { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.contact-off { opacity: .55; }

/* ================= Теория ================= */
.th-head, .th-row { display: grid; grid-template-columns: minmax(0, 2fr) 5em 10em 9em; gap: 14px; align-items: center; }
.th-row { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.th-row:last-child { border-bottom: 0; }
.th-head > span:nth-child(n+2), .th-row > span:nth-child(n+2) { text-align: right; }
@media (max-width: 640px) { .th-head { display: none; } .th-row { grid-template-columns: 1fr 3em; } .th-row > span:nth-child(3) { grid-column: 1; text-align: left; color: var(--muted); font-size: 14px; } .th-row > span:nth-child(4) { grid-row: 1; grid-column: 2; } }
.ln-th .side-tag { color: var(--loss); }
footer p { margin: 4px 0; max-width: none; }

/* Вопрос или идея */
.fb-fab { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 50; display: inline-flex; align-items: center; gap: 8px;
  font: 600 15px/1 var(--font); cursor: pointer; border: 0; border-radius: 24px; padding: 12px 16px 12px 12px; background: var(--navy); color: var(--on-navy); box-shadow: 0 6px 20px rgba(12, 19, 34, .3); }
.fb-fab span { width: 24px; height: 24px; border-radius: 50%; background: var(--amber); color: var(--on-amber); display: grid; place-items: center; font-weight: 700; }
.fb-fab:hover { filter: brightness(1.15); }
@media (max-width: 520px) { .fb-fab { padding: 12px; } .fb-fab { font-size: 0; gap: 0; } .fb-fab span { font-size: 16px; width: 28px; height: 28px; } }
.fb-dialog { width: min(600px, calc(100vw - 24px)); max-height: calc(100vh - 40px); border: 1.5px solid var(--line); border-radius: 18px; padding: 20px; background: var(--bg); color: var(--ink); }
.fb-dialog::backdrop { background: rgba(12, 19, 34, .55); }
.fb-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.fb-head h2 { margin: 0; font-size: 22px; }
.fb-close { width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer; }
.fb-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.fb-form { position: relative; }
.fb-topics span { font-size: 13px; }
@media (max-width: 520px) { .fb-topics { grid-template-columns: repeat(2, 1fr); } }
.fb-page { max-width: 640px; }
.fb-mail { height: 40px; font-size: 14px; margin-left: 6px; }
.footer-social { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 !important; }
.footer-social a { text-decoration: none; font-weight: 600; font-size: 14px; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: 18px; padding: 6px 12px; }
.footer-social a:hover { border-color: var(--ink); }
.footer-social:empty { display: none; }

/* ================= Пачка 1: логотип, навигация ================= */
.logo-txt { display: grid; line-height: 1.05; }
.logo-txt small { font: 500 11px/1.2 var(--font); color: var(--muted); letter-spacing: 0; margin-top: 2px; }
.switch-5 { grid-template-columns: repeat(5, 1fr); max-width: 860px; }
@media (max-width: 720px) { .switch-5 { grid-template-columns: repeat(6, 1fr); } .switch-5 a { grid-column: span 2; } .switch-5 a:nth-child(4), .switch-5 a:nth-child(5) { grid-column: span 3; } }
.nav-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--loss); margin-left: 5px; vertical-align: 2px; }
.report-bar { display: flex; justify-content: flex-end; margin: 36px 0 -20px; }
.soon-box { max-width: 720px; }
.soon-box h3 { margin-top: 0; }

/* ================= Радар, рейтинг ================= */
.radar-wrap { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 24px; align-items: center; background: var(--surface); border: 1.5px solid var(--line); border-radius: 18px; padding: 20px; }
@media (max-width: 760px) { .radar-wrap { grid-template-columns: 1fr; } }
.radar { width: 100%; max-width: 360px; display: block; }
.rd-ring { fill: none; stroke: var(--line); stroke-width: 1; }
.rd-axis { stroke: var(--line); stroke-width: 1; }
.rd-area { fill: color-mix(in srgb, var(--amber) 35%, transparent); stroke: var(--amber-hi); stroke-width: 2; }
.rd-dot { fill: var(--navy); stroke: var(--amber); stroke-width: 2; }
.rd-lbl { font: 600 12px var(--font); fill: var(--ink); }
.rd-na { fill: var(--muted); font-weight: 400; }
.radar-txt { font-size: 17px; margin-top: 0; }
.radar-list { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; }
.radar-list li { display: grid; grid-template-columns: 9.5em 3em 1fr; gap: 10px; align-items: baseline; font-size: 15px; }
.rl-v { font: 700 16px var(--display); text-align: right; }
.rl-n { color: var(--muted); font-size: 13px; }
.rt-tabs { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 10px; }
.rt-box { background: var(--surface); border: 1.5px solid var(--line); border-radius: 18px; padding: 18px; }
.rchart { width: 100%; height: auto; display: block; }
.ch-grid { stroke: var(--line); stroke-width: 1; }
.ch-v { stroke-dasharray: 2 4; }
.ch-lbl { font: 11px var(--font); fill: var(--muted); }
.ch-line { fill: none; stroke: var(--navy); stroke-width: 2.5; stroke-linejoin: round; }
:root[data-theme="dark"] .ch-line { stroke: var(--amber); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ch-line { stroke: var(--amber); } }
.ch-area { fill: color-mix(in srgb, var(--amber) 16%, transparent); }
.ch-dot { fill: var(--amber); stroke: var(--navy); stroke-width: 2; }
.rt-grid { margin-top: 12px; }

/* ================= Сравнение ================= */
.cmp { background: var(--surface); border: 1.5px solid var(--line); border-radius: 18px; padding: 20px; max-width: 900px; }
.cmp-head, .cmp-row, .cmp-score { display: grid; grid-template-columns: 1fr minmax(0, 1.3fr) 1fr; gap: 12px; align-items: center; }
.cmp-head { padding-bottom: 12px; border-bottom: 1.5px solid var(--line); }
.cmp-name { font: 700 22px var(--display); overflow-wrap: anywhere; }
.cmp-name.cmp-a { color: var(--win); } .cmp-name.cmp-b { color: var(--loss); text-align: right; }
.cmp-vs { text-align: center; color: var(--muted); font-size: 14px; }
.cmp-score { padding: 12px 0; font: 700 28px var(--display); }
.cmp-score .cmp-b { text-align: right; } .cmp-score .cmp-k { font: 500 13px var(--font); text-align: center; color: var(--muted); }
.cmp-row { padding: 9px 0; border-top: 1px solid var(--line); }
.cmp-k { text-align: center; color: var(--text-2); font-size: 14px; }
.cmp-v { font-weight: 600; font-variant-numeric: tabular-nums; }
.cmp-v.cmp-b { text-align: right; }
.cmp-win { color: var(--win); }
.cmp-v.cmp-win::after { content: " ▲"; font-size: 10px; }
.cmp h3 { margin-top: 22px; }

/* ================= Тренировка ================= */
.tr-tabs { min-width: min(100%, 560px); grid-template-columns: repeat(3, 1fr); margin-bottom: 20px; }
.tr-tabs .tab::before, .pz-modes .tab::before { display: none; }
.bts { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.bt { background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.bt-main { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.bt-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--draw); }
.bt-dot.on { background: var(--win); }
.bt-name { font-size: 16px; }
.bt-r { font: 700 16px var(--display); }
.bt-g { color: var(--muted); font-size: 13px; }
.bt-tag { font-size: 12px; font-weight: 600; border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; color: var(--muted); }
.bt-eq { color: var(--on-amber); background: var(--amber); border-color: var(--amber); }
.bt-note { margin: 6px 0 0; font-size: 14px; color: var(--text-2); }
.bt-bio { font-size: 14px; color: var(--text-2); background: var(--bg); border-radius: 8px; padding: 8px 10px; }
.bt-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.bt-slot:not(:empty) { margin-top: 10px; }
.dossier { border-top: 1px solid var(--line); padding-top: 8px; }
.dossier p { margin: 6px 0; }
.bt-band { background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; margin-bottom: 8px; }
.bt-band > summary { padding: 12px 14px; display: flex; gap: 10px; align-items: center; }
.bt-band .bts { padding: 0 10px 10px; }
.filter-box { margin: 24px 0; max-width: 860px; }
.flt { padding-left: 20px; }
.flt li { margin: 8px 0; }
.op-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.op-chip { font: inherit; font-size: 14px; cursor: pointer; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 10px; padding: 8px 12px; }
.op-chip:hover { border-color: var(--ink); }
.drill { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 22px; background: var(--surface); border: 1.5px solid var(--amber); border-radius: 16px; padding: 18px; margin-bottom: 24px; }
@media (max-width: 700px) { .drill { grid-template-columns: 1fr; } }
.drill-side h3 { margin-top: 0; }
.lv { grid-template-columns: repeat(8, 1fr); }
.pz-modes { min-width: min(100%, 360px); grid-template-columns: repeat(2, 1fr); }
.pz { display: grid; grid-template-columns: minmax(0, var(--board-max, 440px)) minmax(0, 1fr); gap: 24px; align-items: start; margin-top: 12px; }
@media (max-width: 760px) { .pz { grid-template-columns: 1fr; } }
.pz-board .dia { max-width: var(--board-max, 440px); cursor: pointer; }
.pz-meta { color: var(--muted); font-size: 14px; }
.pz-msg { font-size: 17px; font-weight: 600; }
.pz-msg.good { color: var(--win); } .pz-msg.bad { color: var(--loss); }
.storm-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; background: var(--navy); color: var(--on-navy); border-radius: 12px; padding: 10px 16px; margin: 12px 0; }
.st-score { font: 700 30px var(--display); color: var(--amber); }
.st-time { font: 700 22px var(--display); margin-left: auto; }
.st-err { margin-left: auto; }
.storm-bar .btn-ghost { color: var(--on-navy); border-color: color-mix(in srgb, var(--on-navy) 35%, transparent); }

/* ================= Карточка ================= */
.pc-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; margin: 30px 0 16px; }
.pc-head h2 { margin: 2px 0 4px; }
.pc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 16px; }
.pc-perfs { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.pc-perfs li { background: var(--bg); border-radius: 10px; padding: 8px 10px; display: grid; }
.pc-perfs span { font-size: 13px; color: var(--muted); } .pc-perfs b { font: 700 20px var(--display); } .pc-perfs small { color: var(--muted); font-size: 12px; }
.ttl { color: var(--amber-hi); font-weight: 700; }
.pc-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; max-width: 760px; }
.pc-list li { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; background: var(--surface); border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.pc-list .hint { margin: 0; }
.star { font-size: 18px; line-height: 1; background: none; border: 0; cursor: pointer; color: var(--line); padding: 0; }
.star.on { color: var(--amber); }
.pc-files { margin-top: 24px; max-width: 760px; }
.pc-import { cursor: pointer; }

/* ================= Новости, магазин, cookie ================= */
.news { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; max-width: 820px; }
.news-item { background: var(--surface); border: 1.5px solid var(--line); border-left: 4px solid var(--amber); border-radius: 14px; padding: 16px 18px; }
.news-item h3 { margin: 2px 0 6px; }
.news-item p { margin: 0 0 8px; color: var(--text-2); }
.news-date { font-size: 13px; color: var(--muted) !important; }
.news-home { margin-top: 40px; }
.nh-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; max-width: 820px; }
.nh-head h2 { margin: 0 0 12px; }
.product-soon { opacity: .9; }
.product-soon .course-status { color: var(--muted); }
.price { font: 700 22px var(--display); }
.cookie-bar { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 60; max-width: 720px; margin: 0 auto; display: flex; gap: 12px; align-items: center; background: var(--navy); color: var(--on-navy); border-radius: 14px; padding: 12px 14px; box-shadow: 0 8px 24px rgba(12, 19, 34, .35); }
.cookie-bar p { margin: 0; font-size: 14px; max-width: none; }
.cookie-bar a { color: var(--amber); }
.cookie-bar .btn { margin: 0; height: 40px; flex: none; }
.ln-actions { margin-top: 8px; }

/* ================= Печать (PDF) ================= */
@media print {
  .top, footer, .fb-fab, .cookie-bar, .no-print, form, .gate-wrap, .note-box, .demo-link, .tabs, .row-controls, .seg, .btn, .gv-slot, .ex-crumbs, .ex-flip, .intro .lead { display: none !important; }
  body { background: #fff !important; color: #000 !important; font-size: 12px; }
  main { max-width: none; padding: 0; }
  h1 { font-size: 22px; margin: 0 0 8px; }
  h2 { font-size: 17px; margin: 18px 0 8px; break-after: avoid; }
  section, .ln, .in, .card-box, .cmp, .summary { break-inside: avoid; }
  .summary, .ln, .in, .tree, .ops, .cmp, .radar-wrap, .rt-box { box-shadow: none !important; border-color: #ccc !important; background: #fff !important; }
  #results { display: block !important; }
  a { color: #000; text-decoration: none; }
}
/* Кнопка отчёта — по левому краю, над результатами */
.report-bar { justify-content: flex-start; margin: 28px 0 12px; max-width: 900px; }
.radar-list li { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 8px 0; border-top: 1px solid var(--line); }
.rl-top { display: flex; align-items: baseline; gap: 10px; }
.rl-top .rl-k { font-weight: 600; min-width: 9em; }
.rl-t { font-size: 12px; font-weight: 600; border-radius: 6px; padding: 1px 7px; background: var(--bg); color: var(--muted); }
.rl-good { background: color-mix(in srgb, var(--win) 18%, transparent); color: var(--win); }
.rl-bad { background: color-mix(in srgb, var(--loss) 15%, transparent); color: var(--loss); }
.radar-scale { background: var(--bg); border-radius: 8px; padding: 8px 10px; }
.pz-board { touch-action: none; user-select: none; -webkit-user-select: none; }
.pz-ghost { position: fixed; z-index: 80; pointer-events: none; filter: drop-shadow(0 4px 6px rgba(0,0,0,.35)); }
.bt-band > summary .bt-g { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60ch; }

/* Шрифт Manrope: ровные заголовки и табличные цифры */
h1, h2 { letter-spacing: -0.025em; font-weight: 800; }
h2 { font-weight: 700; }
.sum-big, .cmp-score, .st-score, .ev-day, .ln-score, .rl-v, .bt-r, .pc-perfs b, .price { font-variant-numeric: tabular-nums lining-nums; font-weight: 800; }
body, .cnt, .sc, .lvl-row span, .cmp-v, .op-rt { font-variant-numeric: tabular-nums; }
/* Таблица «На фоне соперников»: ровные колонки */
.lvl-head, .lvl-row { grid-template-columns: minmax(0, 2fr) 5em 7.5em 8.5em 6.5em; }
.lvl-row span:nth-child(n+2) { color: var(--ink); font-weight: 600; }
.lvl-row span.cnt { color: var(--muted); font-weight: 500; }
.lvl-head span { line-height: 1.25; }
@media (max-width: 560px) { .lvl-row { grid-template-columns: 1fr 5em 5em; } }

/* ================= Мои дебюты ================= */
.tr-tabs { grid-template-columns: repeat(5, 1fr); min-width: min(100%, 880px); }
@media (max-width: 560px) { .tr-tabs { grid-template-columns: repeat(2, 1fr); } .tr-tabs .tab:last-child { grid-column: 1 / -1; } }
.rep-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-bottom: 20px; }
.rep-card { background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; padding: 16px; cursor: pointer; }
.rep-card:hover { border-color: var(--ink); }
.rep-card h3 { margin: 4px 0; }
.rep-prog { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 8px 0 4px; }
.rep-prog span { display: block; height: 100%; background: var(--win); border-radius: 4px; }
.rep-add { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.rep-add .card-box { display: grid; gap: 10px; align-content: start; }
.rep-add h3 { margin: 0; }
.rep-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.rep-title { margin: 0; }
.rep-actions { margin: 8px 0 16px; }
.rp-del { color: var(--loss); }
.rep-main { display: grid; grid-template-columns: minmax(0, var(--board-max, 480px)) minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 820px) { .rep-main { grid-template-columns: 1fr; } }
.rep-board { touch-action: none; user-select: none; -webkit-user-select: none; }
.rep-board .dia { max-width: var(--board-max, 480px); cursor: pointer; }
.rep-side { background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; padding: 14px 16px; display: grid; gap: 10px; }
.rep-comment { background: color-mix(in srgb, var(--amber) 12%, var(--surface)); border-left: 3px solid var(--amber); border-radius: 8px; padding: 8px 10px; margin: 6px 0; font-size: 15px; }
.rep-moves { max-height: 360px; overflow-y: auto; font: 14px/1.9 var(--mono); border-top: 1px solid var(--line); padding-top: 8px; }
.rep-moves:empty { display: none; }
.rm { cursor: pointer; border-radius: 4px; padding: 1px 3px; }
.rm:hover { background: var(--bg); }
.rm-cur { background: var(--navy); color: var(--amber); }
.rm-c { font: 13px/1.5 var(--font); color: var(--text-2); }
.rm-var { margin: 2px 0 2px 14px; padding-left: 10px; border-left: 2px solid var(--line); }
.rep-branch { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rep-branch .k { width: 100%; }
.rep-tree { background: var(--navy); border-radius: 18px; padding: 14px 16px 12px; }
.rt-svg { display: block; height: auto; }
.rt-link { fill: none; stroke-width: 4; stroke-linecap: round; opacity: .9; }
.rt-card rect { fill: #111a2c; stroke-width: 2; }
.rt-card { cursor: pointer; }
.rt-mv { font: 700 15px var(--display); fill: #eef2fa; }
.rt-st { font: 600 10px var(--font); letter-spacing: .06em; text-transform: uppercase; }
.rt-done rect { stroke: #2fb47c; } .rt-done .rt-st { fill: #2fb47c; } .rt-link.rt-done { stroke: #2fb47c; }
.rt-cur rect { stroke: #f2a93b; } .rt-cur .rt-st { fill: #f2a93b; } .rt-link.rt-cur { stroke: #f2a93b; }
.rt-part rect { stroke: #7fb6ff; } .rt-part .rt-st { fill: #7fb6ff; } .rt-link.rt-part { stroke: #7fb6ff; }
.rt-ahead rect { stroke: #3a4a66; } .rt-ahead .rt-st { fill: #8494b3; } .rt-link.rt-ahead { stroke: #3a4a66; }
.rt-legend { color: #c9d2e6; font-size: 13px; margin: 10px 0 0; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; max-width: none; }
.rt-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; }
.rt-dot.rt-done { background: #2fb47c; } .rt-dot.rt-cur { background: #f2a93b; } .rt-dot.rt-part { background: #7fb6ff; } .rt-dot.rt-ahead { background: #3a4a66; }

.install-row { margin: 8px 0 !important; font-size: 14px; }
.pc-ids .two { gap: 10px; }
.copyright { color: var(--muted); font-size: 13px; }

.games-counter { margin-top: 36px; display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; background: var(--navy); color: var(--on-navy); border-radius: 18px; padding: 18px 24px; }
.gc-num { margin: 0; font: 800 clamp(34px, 6vw, 52px)/1 var(--display); color: var(--amber); font-variant-numeric: tabular-nums; }
.gc-cap { margin: 0; font-size: 18px; }

/* Настройки доски: размер и текст под доской */
.board-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 12px 0 4px; font-size: 14px; color: var(--muted); }
.bt-label { font-weight: 700; color: var(--text-2); margin-left: 6px; }
.bt-label:first-child { margin-left: 0; }
.bt-btn { border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 4px 12px; font: inherit; font-weight: 600; cursor: pointer; min-width: 34px; }
.bt-btn:hover { border-color: var(--amber); }
.bt-btn[aria-pressed="true"] { background: var(--navy); color: var(--on-navy); border-color: var(--navy); }
.bt-size { min-width: 64px; text-align: center; font-variant-numeric: tabular-nums; }
.board-below .pz, .board-below .rep-main, .board-below .an-grid { grid-template-columns: 1fr; }
.board-below .pz-board .dia, .board-below .rep-board .dia { margin: 0 auto; }
.board-below .pz-side, .board-below .rep-side { max-width: var(--board-max, 520px); margin: 0 auto; width: 100%; }
@media (max-width: 820px) { .board-tools .bt-label:nth-of-type(2), .board-tools [data-bt-below] { display: none; } }

/* Список всех ботов онлайн — свёрнут по умолчанию */
.bt-all { margin-top: 26px; }
.bt-all > summary { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; cursor: pointer; list-style: none; }
.bt-all > summary::-webkit-details-marker { display: none; }
.bt-all > summary h2 { margin: 0; display: inline; }
.bt-all-hint { color: var(--amber); font-weight: 700; font-size: 15px; }
.bt-all[open] .bt-all-hint { display: none; }

/* Период и разбор поражений */
.period-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 6px 0 18px; }
.period-label { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.period-sel { width: auto; min-width: 230px; padding-top: 8px; padding-bottom: 8px; }
.period-hint { margin: 0; }
.ls-title { margin-top: 18px; }
.ls-list { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 8px; }
.ls-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.ls-main { min-width: 0; }

/* Поиск дебюта и гамбиты */
.op-search { margin: 4px 0 6px; max-width: 520px; }
.op-chip.op-gambit { border-color: color-mix(in srgb, var(--amber) 60%, var(--line)); }

/* Дерево вариантов: окно с перемещением и масштабом */
.rt-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 10px; }
.rt-tools .bt-btn { background: #1d2a45; color: #eef2fa; border-color: #3a4a66; }
.rt-tools .bt-btn:hover { border-color: #f2a93b; }
.rt-zoom { color: #c9d2e6; min-width: 48px; text-align: center; font-variant-numeric: tabular-nums; font-size: 14px; }
.rt-tip { color: #8494b3; font-size: 13px; margin-left: 6px; }
.rt-view { position: relative; overflow: hidden; height: 440px; border-radius: 12px; background: #0e1626; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.rt-view.rt-tall { height: min(78vh, 820px); }
.rt-dragging .rt-view { cursor: grabbing; }
.rt-canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.rt-canvas .rt-svg { display: block; max-width: none; }
@media (max-width: 560px) { .rt-view { height: 360px; } .rt-tip { display: none; } }

/* Меню из шести разделов */
.switch-6 { grid-template-columns: repeat(6, 1fr); max-width: 1040px; }
.switch-6 a { font-size: 15px; padding: 0 6px; text-align: center; }
@media (max-width: 980px) { .switch-6 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 440px) { .switch-6 a { font-size: 13px; } }

/* ================= Тренерский разбор партии ================= */
.an-input { max-width: 900px; }
.an-pgn { width: 100%; min-height: 110px; resize: vertical; font: 14px/1.45 var(--mono, ui-monospace, Consolas, monospace); }
.an-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-top: 10px; }
.an-row .btn { margin: 0; }
.an-depth-l { display: flex; align-items: center; gap: 8px; margin: 0; }
.an-depth-l select { width: auto; padding-top: 8px; padding-bottom: 8px; }
.an-grid { display: grid; grid-template-columns: minmax(0, var(--board-max, 520px)) minmax(0, 1fr); gap: 22px; align-items: start; margin-top: 22px; }
@media (max-width: 900px) { .an-grid { grid-template-columns: 1fr; } }
.an-left { min-width: 0; }
.an-right { display: grid; gap: 14px; min-width: 0; }
.an-right .card-box { margin: 0; }
.an-player { margin: 6px 0; font-size: 15px; }
.an-board .dia { max-width: var(--board-max, 520px); }
.an-nav { display: flex; gap: 6px; margin-top: 10px; }
.an-nav .btn { flex: 1; margin: 0; padding-left: 0; padding-right: 0; }
.an-engine { margin-top: 10px; }
.an-engine .hint { margin: 0 0 6px; }
.an-progress { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.an-progress span { display: block; height: 100%; width: 0; background: var(--amber); transition: width .2s; }
.an-graph { margin-top: 12px; height: 120px; border-radius: 10px; overflow: hidden; border: 1.5px solid var(--line); cursor: pointer; }
.an-graph-svg { display: block; width: 100%; height: 100%; }
.an-opening { margin: 0 0 8px; }
.an-meta { width: 100%; border-collapse: collapse; font-size: 15px; }
.an-meta th { color: var(--muted); font-size: 12px; font-weight: 600; text-align: right; padding: 2px 6px; }
.an-meta td { text-align: right; padding: 4px 6px; font-variant-numeric: tabular-nums; border-top: 1px solid var(--line); }
.an-meta td:first-child, .an-meta th:first-child { text-align: left; }
.an-acc { font-weight: 800; font-size: 18px; }
.c-inacc { color: #b8901c; } .c-mistake { color: #e2852b; } .c-blunder { color: #d64545; }
.an-now h3 { margin: 0 0 6px; }
.an-facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 15px; }
.an-facts dt { color: var(--muted); } .an-facts dd { margin: 0; }
.an-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 700; color: #fff; vertical-align: 2px; }
.b-blunder { background: #d64545; } .b-mistake { background: #e2852b; } .b-inacc { background: #c9a227; } .b-best { background: #2f9e6a; } .b-missed { background: #7a4fd6; }
.an-moves { display: grid; grid-template-columns: 2.6em 1fr 1fr; gap: 2px 4px; max-height: 340px; overflow-y: auto; font-variant-numeric: tabular-nums; }
.an-moves .no { color: var(--muted); text-align: right; padding: 4px 4px 4px 0; font-size: 13px; }
.an-mv { border: 0; background: none; text-align: left; padding: 4px 8px; border-radius: 6px; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; }
.an-mv:hover { background: var(--bg); }
.an-mv.cur { background: var(--navy); color: var(--on-navy); }
.an-mv .s { font-weight: 800; margin-left: 2px; }
.s.blunder { color: #d64545; } .s.mistake { color: #e2852b; } .s.inacc { color: #b8901c; }
.an-mv.cur .s { color: inherit; }
#an-moments-box, .an-trainer { margin-top: 22px; }
.an-moments { display: grid; gap: 8px; }
.an-moment { display: grid; gap: 2px; text-align: left; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 12px; padding: 10px 12px; font: inherit; cursor: pointer; }
.an-moment:hover { border-color: var(--amber); }
.an-moment small { color: var(--muted); }
.an-trainer { border-color: var(--amber); }
.an-license { margin-top: 30px; }
.an-report { display: none; }

/* Отчёт PDF разбора: печатается только он */
@media print {
  body.an-printing main > *:not(.an-report) { display: none !important; }
  body.an-printing .an-report { display: block !important; color: #000; }
  .an-report h1 { font-size: 20px; margin: 2px 0 4px; }
  .an-report h2 { font-size: 15px; margin: 16px 0 6px; border-bottom: 1px solid #ccc; padding-bottom: 3px; }
  .an-report h3 { font-size: 13px; margin: 0 0 4px; }
  .an-report p { margin: 2px 0; max-width: none; }
  .rp-k { text-transform: uppercase; letter-spacing: .08em; font-size: 10px; color: #b07a1a; font-weight: 700; }
  .rp-graph { height: 90px; border: 1px solid #ccc; }
  .rp-graph svg { width: 100%; height: 100%; display: block; }
  .rp-cap { font-size: 10px; color: #555; }
  .rp-moment { display: grid; grid-template-columns: 170px 1fr; gap: 14px; align-items: start; break-inside: avoid; margin: 10px 0; }
  .rp-dia .dia { width: 170px; box-shadow: none; }
  .rp-moves { font-size: 11px; line-height: 1.7; }
  .rp-moves sup { color: #c0392b; font-weight: 700; }
  .rp-foot { margin-top: 18px; border-top: 2px solid #f2a93b; padding-top: 8px; font-size: 11px; break-inside: avoid; }
  .an-meta td, .an-meta th { padding: 2px 6px; font-size: 12px; }
  .an-meta .an-acc { font-size: 14px; }
}

/* ================= Курсы задач ================= */
.cr h3 { margin-top: 26px; }
.cr-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: flex-start; }
.cr-bands { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.op-chip.cr-on { background: var(--navy); color: var(--on-navy); border-color: var(--navy); }
.cr-warn { color: var(--loss); font-weight: 600; }
.cr-score { display: grid; grid-template-columns: auto auto; gap: 0 8px; align-items: baseline; background: var(--navy); color: var(--on-navy); border-radius: 14px; padding: 10px 16px; }
.cr-score b { font: 800 26px/1.1 var(--display); color: var(--amber); text-align: right; }
.cr-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-top: 8px; }
.cr-card { display: grid; gap: 4px; align-content: start; text-align: left; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 14px; padding: 12px 14px; font: inherit; cursor: pointer; min-height: 74px; }
.cr-card:hover { border-color: var(--amber); }
.cr-name { font-weight: 700; }
.cr-d { color: var(--muted); font-size: 13px; }
.cr-ic { font-size: 22px; line-height: 1; }
.cr-stars { color: var(--amber); letter-spacing: 2px; }
.cr-stars i { color: var(--line); font-style: normal; }
.cr-badge { display: inline-block; justify-self: start; background: color-mix(in srgb, var(--win) 16%, transparent); color: var(--win); border-radius: 8px; padding: 1px 8px; font-size: 12px; font-weight: 700; }
.cr-io { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cr-io .hint { flex-basis: 100%; }
.cr-imp { cursor: pointer; }
.cr-h { margin: 4px 0 12px; }
.cr-levels { display: grid; gap: 12px; max-width: 760px; }
.cr-level { border: 1.5px solid var(--line); background: var(--surface); border-radius: 16px; padding: 14px 16px; }
.cr-level.cr-done { border-color: color-mix(in srgb, var(--win) 55%, var(--line)); }
.cr-level.cr-locked { opacity: .6; }
.cr-lv-h { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; margin-bottom: 8px; }
.cr-lv-h span { color: var(--muted); font-size: 14px; }
.cr-lock { font-size: 13px; }
.cr-exam { border-style: dashed; }
.cr-count { display: flex; gap: 18px; font-weight: 700; color: var(--text-2); margin-bottom: 4px; }
.btn[disabled] { opacity: .5; cursor: default; }
.cr-cert-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin: 14px 0; max-width: 640px; }
.cr-cert-form .sel-label { flex: 1; min-width: 220px; }
.cr-cert { max-width: 720px; border: 3px double var(--amber); border-radius: 18px; padding: 34px 28px; text-align: center; background: var(--surface); }
.cr-cert h2 { font-size: 40px; margin: 6px 0 14px; letter-spacing: .04em; }
.cr-cert p { margin: 6px auto; max-width: none; }
.cr-cert-k { text-transform: uppercase; letter-spacing: .12em; font-size: 13px; color: var(--amber); font-weight: 700; }
.cr-cert-name { font: 800 30px/1.2 var(--display); margin: 10px 0 !important; }
.cr-cert-course { font-size: 22px; font-weight: 700; }
.cr-cert-foot { margin-top: 22px !important; color: var(--muted); font-size: 14px; }
@media print {
  body.cr-printing main > *:not(#tab-courses) { display: none !important; }
  body.cr-printing #tab-courses > *:not(.cr-cert) { display: none !important; }
  body.cr-printing .cr-cert { border-color: #c8891f; margin: 40px auto; color: #000; background: #fff; }
}

/* Тренерские объяснения */
.an-summary p { margin: 0 0 10px; max-width: 80ch; }
.an-summary a { color: inherit; text-decoration: underline; text-decoration-color: var(--amber); }
.an-expl { margin-top: 8px; padding: 10px 12px; border-left: 3px solid var(--amber); background: var(--bg); border-radius: 0 10px 10px 0; color: var(--ink); font-size: 15px; line-height: 1.5; }
.an-expl p { margin: 0 0 6px; max-width: none; }
.an-expl p:last-child { margin-bottom: 0; }
.an-better { color: var(--win); font-weight: 600; }
.an-lesson { color: var(--text-2); font-size: 14px; }
@media print { .an-expl { background: #f6f6f6; border-left-color: #c8891f; font-size: 11px; padding: 6px 8px; } .an-better { color: #1f7a4f; } }
