/* Chess Clock Analyser — clean, minimal styles. Light by default; dark via system setting or the toggle. */
:root {
  --bg: #f5f5f7;
  --card: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --border: rgba(0, 0, 0, 0.08);
  --grid: #ececf0;
  --fill: #f0f0f3;
  --fill-strong: #e8e8ed;
  --accent: #0071e3;
  --accent-text: #ffffff;
  --crosshair: #1d1d1f;
  --focus: #0071e3;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.05);
  --danger-bg: #fff2f0;
  --danger-text: #b3261e;
  --info-bg: #eef5ff;
  --info-text: #0b4a8f;
  --good: #1e7d4f;
  --bad: #c0392b;
  /* chart colours (colour-blind friendly; series also differ by line style / position / symbol) */
  --c-white: #c77700;
  --c-black: #0b62a4;
  --c-blunder: #c0392b;
  --c-rushed: #8e44ad;
  --c-think: #00866b;
  --c-trouble: #c0392b;
  --c-should: #d63384;
  --c-pace: #8e8e93;
  --c-zone: rgba(192, 57, 43, 0.08);
  --c-eval-above: rgba(200, 200, 205, 0.6);
  --c-eval-below: rgba(40, 40, 45, 0.6);
  --c-eval-line: #3a3a3c;
  --radius: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --card: #1c1c1e; --text: #f5f5f7; --muted: #98989d; --border: rgba(255, 255, 255, 0.1);
    --grid: #2c2c2e; --fill: #2c2c2e; --fill-strong: #3a3a3c; --accent: #2997ff; --accent-text: #ffffff; --crosshair: #f5f5f7; --focus: #2997ff;
    --shadow: none; --danger-bg: #3a1d1b; --danger-text: #ffb4a9; --info-bg: #10233d; --info-text: #9ecbff; --good: #57d39a; --bad: #ff8a80;
    --c-white: #f0b429; --c-black: #5aaee8; --c-blunder: #ff7b6b; --c-rushed: #d39cf0; --c-think: #3fd1a8; --c-trouble: #ff7b6b; --c-should: #ff79c6; --c-pace: #8e8e93;
    --c-zone: rgba(255, 123, 107, 0.12); --c-eval-above: rgba(235, 235, 240, 0.55); --c-eval-below: rgba(0, 0, 0, 0.65); --c-eval-line: #d1d1d6;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --card: #1c1c1e; --text: #f5f5f7; --muted: #98989d; --border: rgba(255, 255, 255, 0.1);
  --grid: #2c2c2e; --fill: #2c2c2e; --fill-strong: #3a3a3c; --accent: #2997ff; --accent-text: #ffffff; --crosshair: #f5f5f7; --focus: #2997ff;
  --shadow: none; --danger-bg: #3a1d1b; --danger-text: #ffb4a9; --info-bg: #10233d; --info-text: #9ecbff; --good: #57d39a; --bad: #ff8a80;
  --c-white: #f0b429; --c-black: #5aaee8; --c-blunder: #ff7b6b; --c-rushed: #d39cf0; --c-think: #3fd1a8; --c-trouble: #ff7b6b; --c-should: #ff79c6; --c-pace: #8e8e93;
  --c-zone: rgba(255, 123, 107, 0.12); --c-eval-above: rgba(235, 235, 240, 0.55); --c-eval-below: rgba(0, 0, 0, 0.65); --c-eval-line: #d1d1d6;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.47 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; letter-spacing: -0.01em;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { letter-spacing: -0.02em; margin: 0; }
h2 { font-size: 1.6rem; font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; }
h4 { font-size: 1rem; font-weight: 600; margin: 1.25rem 0 0.4rem; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--card); padding: 8px 12px; z-index: 100; }
.skip-link:focus { left: 8px; top: 8px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.wrap-row { flex-wrap: wrap; }
kbd { font: inherit; font-size: 0.8em; border: 1px solid var(--border); border-radius: 5px; padding: 0 5px; background: var(--fill); }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--border); }
.topbar-row { height: 48px; display: flex; align-items: center; justify-content: space-between; }
.topbar-home { font-size: 0.85rem; color: var(--muted); min-width: 90px; }
.topbar-title { font-weight: 600; font-size: 0.95rem; }

/* ---------- buttons & controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
  font: inherit; font-size: 0.95rem; font-weight: 500; padding: 9px 20px; min-height: 40px;
  border-radius: 980px; border: 0; background: var(--fill-strong); color: var(--text); white-space: nowrap;
  transition: background 0.15s, opacity 0.15s;
}
.btn:hover { background: color-mix(in srgb, var(--fill-strong) 85%, var(--text)); }
.btn.primary { background: var(--accent); color: var(--accent-text); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn.block { width: 100%; }
.btn[disabled], .icon-btn[disabled], .link-btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.link-btn { font: inherit; font-size: 0.95rem; background: none; border: 0; padding: 4px 2px; color: var(--accent); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.link-btn.back { font-size: 0.9rem; margin-bottom: 2px; }
.icon-btn { font: inherit; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--fill); color: var(--text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 0.95rem; }
.icon-btn:hover { background: var(--fill-strong); }
select, .search-input, textarea {
  font: inherit; font-size: 0.95rem; color: var(--text); background: var(--fill); border: 1px solid transparent; border-radius: 12px; padding: 9px 12px;
}
select:focus, .search-input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); background: var(--card); }
textarea { width: 100%; resize: vertical; font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* segmented control */
.segmented { display: inline-flex; padding: 2px; margin: 0; border: 0; background: var(--fill); border-radius: 10px; gap: 2px; }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span { display: block; padding: 6px 14px; font-size: 0.88rem; font-weight: 500; border-radius: 8px; color: var(--muted); white-space: nowrap; }
.segmented input:checked + span { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
:root[data-theme="dark"] .segmented input:checked + span { background: var(--fill-strong); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .segmented input:checked + span { background: var(--fill-strong); } }
.segmented input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: -2px; }
.small-seg span { padding: 4px 10px; font-size: 0.8rem; }

/* switch */
.switch { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 0.88rem; color: var(--muted); cursor: pointer; }
.switch input { appearance: none; -webkit-appearance: none; width: 38px; height: 22px; border-radius: 11px; background: var(--fill-strong); position: relative; flex: none; cursor: pointer; transition: background 0.15s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); transition: transform 0.15s; }
.switch input:checked { background: #34c759; }
.switch input:checked::after { transform: translateX(16px); }

/* ---------- cards ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; box-shadow: var(--shadow); min-width: 0; }
:root[data-theme="dark"] .card { border: 1px solid var(--border); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .card { border: 1px solid var(--border); } }
.card.flush { padding: 6px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 28px 0 14px; flex-wrap: wrap; }

/* ---------- start ---------- */
.start { padding: 6vh 0 2vh; transition: padding 0.2s; }
.hero { text-align: center; margin-bottom: 26px; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1.08; }
.hero-sub { font-size: clamp(1.1rem, 2.2vw, 1.4rem); color: var(--muted); margin: 10px 0 0; }
.search { max-width: 640px; margin: 0 auto; padding: 18px; }
.search-top { display: flex; justify-content: center; margin-bottom: 12px; }
.search-row { display: flex; gap: 8px; }
.search-row + .search-row { margin-top: 8px; }
.search-input { flex: 1; min-width: 0; font-size: 1.05rem; padding: 12px 16px; border-radius: 14px; }
.search-input.small { font-size: 0.9rem; padding: 10px 14px; }
.search-links { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-top: 12px; color: var(--muted); }
.options { display: inline-block; }
.options summary { list-style: none; display: inline; }
.options summary::-webkit-details-marker { display: none; }
.options[open] .options-body { display: flex; }
.options-body { flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 10px; width: 100%; }
.search .options[open] { display: block; width: 100%; text-align: center; }
.options-body label { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; color: var(--muted); text-align: left; }
.inline-options { margin-top: 10px; }
.inline-options .options-body { justify-content: flex-start; }
.paste-panel { margin-top: 14px; }
.paste-panel .row { margin-top: 10px; }
.fine-print { text-align: center; color: var(--muted); font-size: 0.85rem; margin: 14px 0 0; }
.fine-print .link-btn { font-size: 0.85rem; }
.help-panel { max-width: 640px; margin: 10px auto 0; font-size: 0.9rem; color: var(--muted); }
.help-panel ul { padding-left: 1.2rem; margin: 0; }
.help-panel li { margin-bottom: 6px; }
/* once results are on screen, the start area becomes a compact search bar */
body.has-results .start { padding: 18px 0 0; }
body.has-results .hero, body.has-results .fine-print, body.has-results .help-panel { display: none; }
body.has-results .search { max-width: none; display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; align-items: center; padding: 12px 14px; }
body.has-results .search-top { margin: 0; }
body.has-results .search-links { grid-column: 1 / -1; justify-content: flex-start; margin: 0; }
body.has-results #cc-user-row { grid-column: 1 / -1; margin: 0; }
body.has-results .paste-panel { grid-column: 1 / -1; margin: 0; }

/* ---------- messages, progress, toast ---------- */
.message { padding: 14px 18px; border-radius: 14px; margin: 18px 0; background: var(--danger-bg); color: var(--danger-text); }
.message.info { background: var(--info-bg); color: var(--info-text); }
.message h2 { font-size: 1.05rem; margin-bottom: 6px; }
.message ul { margin: 6px 0 0; padding-left: 1.2rem; }
.progress { margin-top: 18px; }
.progress-title { font-weight: 600; margin: 0 0 10px; }
.progress p { margin: 6px 0 0; }
progress { width: 100%; height: 6px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 3px; background: var(--fill); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--fill); border-radius: 3px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 3px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 3px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 980px; font-size: 0.9rem; z-index: 60; max-width: calc(100vw - 32px); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2); }

/* ---------- export menu & dialog ---------- */
.menu { position: absolute; z-index: 40; min-width: 210px; background: var(--card); border-radius: 14px; padding: 6px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18); border: 1px solid var(--border); }
.menu button { display: block; width: 100%; text-align: left; font: inherit; font-size: 0.92rem; background: none; border: 0; color: var(--text); padding: 9px 12px; border-radius: 9px; cursor: pointer; }
.menu button:hover, .menu button:focus-visible { background: var(--fill); outline: none; }
.dialog { border: 0; border-radius: var(--radius); padding: 26px; max-width: 440px; width: calc(100vw - 32px); background: var(--card); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); }
.dialog::backdrop { background: rgba(0, 0, 0, 0.35); backdrop-filter: blur(4px); }
.dialog h2 { font-size: 1.3rem; margin-bottom: 8px; }
.dialog p { margin: 0 0 18px; font-size: 0.95rem; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- disclosure ("show more") ---------- */
details.more { margin-top: 14px; }
details.more > summary { list-style: none; cursor: pointer; color: var(--accent); font-size: 0.92rem; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: "›"; display: inline-block; transition: transform 0.15s; font-size: 1.1em; }
details.more[open] > summary::after { transform: rotate(90deg); }
details.more.top { margin-top: 0; }
details.more.top > summary { color: var(--text); font-size: 1.1rem; font-weight: 600; }

/* ---------- game view ---------- */
.game-head h2 { font-size: 1.6rem; }
.game-head p { margin: 4px 0 0; }
.summary-card .summary-top { margin-bottom: 4px; justify-content: flex-end; }
.verdict { font-size: clamp(1.15rem, 2vw, 1.45rem); font-weight: 600; line-height: 1.35; letter-spacing: -0.02em; margin: 6px 0 18px; }
.summary-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.player-stats { background: var(--fill); border-radius: 14px; padding: 14px 16px; }
.player-stats.you { box-shadow: 0 0 0 2px var(--accent) inset; }
.player-stats h4 { margin: 0 0 10px; font-size: 0.95rem; display: flex; align-items: center; gap: 8px; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat .v { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 0.75rem; color: var(--muted); line-height: 1.25; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.board-col { position: sticky; top: 64px; }
.chart-head h3 { margin: 0; }
.chart-head { margin-bottom: 6px; }
.chart-sub { margin: 16px 0 4px; font-size: 1rem; }
.chart-box { position: relative; height: 210px; }
.chart-box.tall { height: 270px; }
.chart-box.mid { height: 230px; }
.chart-box.strip { height: 120px; }
.chart-help { margin: 12px 0 0; }
.chart-tip { position: absolute; top: 6px; z-index: 5; pointer-events: none; background: var(--card); color: var(--text); border-radius: 12px; padding: 10px 12px; font-size: 0.82rem; line-height: 1.45; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18); border: 1px solid var(--border); min-width: 170px; max-width: 250px; }
.board { width: 100%; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden; }
.board .cg-wrap { width: 100%; height: 100%; }
.board-nav { display: flex; justify-content: center; gap: 8px; margin: 12px 0 4px; }
.move-info { margin: 10px 0 12px; min-height: 5.5em; font-size: 0.9rem; }
.move-info .mv { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.02em; }
.move-info .facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 8px 0; }
.move-info .facts .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.move-info .facts .k { font-size: 0.72rem; color: var(--muted); }
.move-info .tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.review-nav { margin-top: 8px; }
.note-more textarea { margin-top: 8px; font: inherit; font-size: 0.9rem; min-height: 70px; }
.key-red { color: #d0312d; font-weight: 600; }
.key-green { color: #15781b; font-weight: 600; }
.tag { display: inline-block; font-size: 0.74rem; font-weight: 600; padding: 2px 9px; border-radius: 980px; background: var(--fill); color: var(--muted); white-space: nowrap; }
.tag.blunder { color: var(--c-blunder); background: color-mix(in srgb, var(--c-blunder) 12%, transparent); }
.tag.rushed { color: var(--c-rushed); background: color-mix(in srgb, var(--c-rushed) 12%, transparent); }
.tag.think { color: var(--c-think); background: color-mix(in srgb, var(--c-think) 12%, transparent); }
.tag.trouble { color: var(--c-trouble); background: color-mix(in srgb, var(--c-trouble) 12%, transparent); }
.tag.should { color: var(--c-should); background: color-mix(in srgb, var(--c-should) 12%, transparent); }
.tag.note { color: var(--muted); }

.insights { padding-left: 1.1rem; margin: 0; }
.insights li { margin-bottom: 0.6rem; }
.critical { padding-left: 1.3rem; margin: 0; }
.critical li { margin-bottom: 0.6rem; }
.critical .swing { font-weight: 600; }
.linkish { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--accent); cursor: pointer; }
.linkish:hover { text-decoration: underline; }
.about .btn { margin-top: 8px; }

/* tables */
.table-scroll { overflow-x: auto; }
.data-table { border-collapse: collapse; width: 100%; font-size: 0.88rem; }
.data-table th, .data-table td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table th { color: var(--muted); font-weight: 500; font-size: 0.8rem; }
.data-table tbody th { color: var(--text); font-weight: 500; font-size: 0.88rem; }
.data-table td.num, .data-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table tr:last-child td, .data-table tr:last-child th { border-bottom: 0; }
.moves-scroll { max-height: 420px; overflow-y: auto; margin-top: 8px; }
.moves thead th { position: sticky; top: 0; background: var(--card); }
.moves tr.selected td { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.games-scroll { max-height: 520px; overflow-y: auto; }
.bucket-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.bucket-grid h5 { margin: 6px 0 2px; font-size: 0.9rem; }
.bar-cell { min-width: 90px; }
.bar-cell .bar { display: inline-block; height: 8px; border-radius: 4px; background: var(--c-blunder); vertical-align: middle; margin-right: 6px; opacity: 0.7; }

/* ---------- games list & profile ---------- */
.profile-builder h3 { margin: 0; }
.profile-builder p { margin: 2px 0 12px; }
.res-W { color: var(--good); font-weight: 600; }
.res-L { color: var(--bad); font-weight: 600; }
.res-D { color: var(--muted); font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.tile { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
:root[data-theme="dark"] .tile { border: 1px solid var(--border); }
.tile .k { color: var(--muted); font-size: 0.8rem; }
.tile .v { font-size: 1.9rem; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; margin: 2px 0; }
.tile .s { color: var(--muted); font-size: 0.78rem; }
.habits { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.habits li { background: var(--fill); border-radius: 12px; padding: 12px 14px; font-size: 0.92rem; }
.habits strong { display: block; font-size: 0.98rem; margin-bottom: 2px; }
.tips { margin: 0; padding-left: 1.2rem; }
.tips li { margin-bottom: 0.6rem; }
.speed { font-size: 0.76rem; font-weight: 600; padding: 2px 9px; border-radius: 980px; background: var(--fill); }
.speed.fast { color: var(--good); }
.speed.slow { color: var(--bad); }
.speed.average { color: var(--muted); }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.profile-tiles { margin-bottom: 18px; }

/* ---------- footer ---------- */
.site-footer { padding: 28px 0 40px; margin-top: 30px; font-size: 0.8rem; color: var(--muted); border-top: 1px solid var(--border); }
.site-footer summary { cursor: pointer; color: var(--text); }
.site-footer ul { padding-left: 1.1rem; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .board-col { position: static; order: -1; }
  .board-card { max-width: 460px; margin-left: auto; margin-right: auto; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .wrap { padding: 0 14px; }
  .card { padding: 16px; border-radius: 16px; }
  .start { padding-top: 4vh; }
  .search-row { flex-direction: column; }
  .search-row .btn { width: 100%; }
  body.has-results .search { grid-template-columns: 1fr; }
  .chart-box { height: 230px; }
  .chart-box.tall, .chart-box.mid { height: 250px; }
  .stat .v { font-size: 1.25rem; }
  .zoom-seg span { padding: 4px 7px; }
  h2, .game-head h2 { font-size: 1.35rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- printing ---------- */
@media print {
  :root { --bg: #fff; --card: #fff; --text: #000; --muted: #444; --border: #ccc; --fill: #f3f3f3; --shadow: none; }
  body { background: #fff; font-size: 11pt; }
  .no-print, .skip-link, .chart-tip, .topbar { display: none !important; }
  .card { border: 1px solid #ccc; break-inside: avoid; }
  details.more > summary { display: none; }
  details.more > *:not(summary) { display: block; }
  .layout { grid-template-columns: 1fr 240px; }
  .board-col { position: static; }
  .moves-scroll, .games-scroll { max-height: none; overflow: visible; }
}
