/* Classic review workspace. Notebook rules below size the board to leave room
 * for navigation. Existing chessboard code retains piece motion and input. */
html[data-interface="classic"] body.analysis-active :is(.board-panel, .side > .card, .tab-pane > .card) {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
html[data-interface="classic"] body.analysis-active :is(h2, h3, .big) { color: var(--text); }
html[data-interface="classic"] body.analysis-active .match-copy b,
html[data-interface="classic"] body.analysis-active .player-profile-link { color: var(--accent); }
html[data-interface="classic"] body.analysis-active .analysis-tabs { border-bottom-color: var(--line); }
html[data-interface="classic"] body.analysis-active .analysis-tabs button {
  color: var(--muted);
  background: transparent;
  border-bottom-color: transparent;
}
html[data-interface="classic"] body.analysis-active .analysis-tabs button.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
html[data-interface="classic"] body.analysis-active :is(.panel-controls button, .back-btn, .mobile-move-nav button) {
  color: var(--accent);
  background: var(--panel2);
  border-color: transparent;
  box-shadow: none;
}
html[data-interface="classic"] body.analysis-active :is(.panel-controls button, .back-btn, .mobile-move-nav button):hover {
  color: var(--accent-deep);
  background: var(--surface-hover);
}
html[data-interface="classic"] body.analysis-active .settingsGear {
  background: var(--panel2) !important;
  color: var(--accent) !important;
  border-color: transparent !important;
}
html[data-interface="classic"] body.analysis-active :is(.board-current-position, .board-evaluation #evalNumber) { color: var(--text); }
html[data-interface="classic"] body.analysis-active :is(.board-evaluation, .eval-graph-heading, .match-copy small) { color: var(--muted); }

/* Numbers and category filters remain available without a wall of cards. */
html[data-interface="classic"] body.analysis-active .summary-grid > div {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
html[data-interface="classic"] body.analysis-active .summary-grid b { color: var(--text); }
html[data-interface="classic"] body.analysis-active :is(.summary-grid span, .review-overview-stats span) { color: var(--muted); }
html[data-interface="classic"] body.analysis-active :is(.category-counts .cat, .review-chip) {
  background: transparent;
  border-color: transparent;
  border-radius: 5px;
  box-shadow: none;
}
html[data-interface="classic"] body.analysis-active :is(.category-counts .cat span, .category-counts .cat em, .review-chip span, .review-chip em) { color: var(--text); }
html[data-interface="classic"] body.analysis-active :is(.category-counts .cat.current, .review-chip.current) {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: none;
}
html[data-interface="classic"] body.analysis-active :is(.category-counts .cat:hover, .review-chip:hover) { background: var(--panel2); }
html[data-interface="classic"] body.analysis-active .review-quality-details > summary { color: var(--accent); }
html[data-interface="classic"] body.analysis-active :is(.accuracy-label, .accuracy-source, .accuracy-caption, .diagnosis-coach) { color: var(--muted); }

/* The critical lesson gets the only strong surface in Summary. */
html[data-interface="classic"] body.analysis-active .loss-report {
  background: #ede1d8;
  border-color: transparent;
  border-left-color: var(--red);
  border-radius: 5px;
  box-shadow: none;
}
html[data-interface="classic"] body.analysis-active .loss-report :is(b, h3) { color: var(--text); }
html[data-interface="classic"] body.analysis-active .loss-report :is(p, span) { color: #674b3f; }
html[data-interface="classic"] body.analysis-active :is(.loss-report-jump, .loss-proof button, .loss-proof-status button, .loss-proof-board-nav button) {
  background: var(--panel);
  border-color: var(--line);
  color: var(--accent);
  box-shadow: none;
}
html[data-interface="classic"] body.analysis-active :is(.loss-proof, .loss-proof-board-nav) { border-color: #cdbdaf; color: var(--muted); }
html[data-interface="classic"] body.analysis-active .loss-proof > summary { color: var(--accent); }
html[data-interface="classic"] body.analysis-active :is(.loss-proof > p, .loss-proof-status) { color: #674b3f; }
html[data-interface="classic"] body.analysis-active .loss-proof-moves button[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
html[data-interface="classic"] body.analysis-active :is(.train-mistakes, .blunder-notes, .review-settings-panel) {
  background: var(--surface-inset);
  border-color: transparent;
  border-radius: 5px;
  box-shadow: none;
}
html[data-interface="classic"] body.analysis-active :is(.review-settings-panel label, .review-settings-panel span, .review-settings-panel .kbd-hint) { color: var(--accent); }
html[data-interface="classic"] body.analysis-active .train-mistakes .training-controls button {
  color: var(--accent);
  background: var(--panel2);
  border-color: transparent;
}
html[data-interface="classic"] body.analysis-active .train-mistakes .training-controls .tryVariation,
html[data-interface="classic"] body.analysis-active .mobile-review-training {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: none;
}
html[data-interface="classic"] body.analysis-active .correction-item {
  background: var(--panel);
  border-color: var(--line);
  color: var(--text);
}
html[data-interface="classic"] body.analysis-active .correction-item span { color: var(--text) !important; }

/* A restrained navy curve on paper. Existing chart hit targets are untouched. */
html[data-interface="classic"] body.analysis-active .eval-graph { background: var(--surface-inset) !important; border-color: var(--line); }
html[data-interface="classic"] body.analysis-active .eval-svg polyline { stroke: var(--accent) !important; filter: none !important; }
html[data-interface="classic"] body.analysis-active .eval-svg .curve-fill { fill: #203c5b20 !important; }
html[data-interface="classic"] body.analysis-active .eval-zero { background: #6a6b6355 !important; }
html[data-interface="classic"] body.analysis-active .eval-current { border-left-color: var(--accent); filter: none; }
html[data-interface="classic"] body.analysis-active .eval-current::before { background: #203c5b12; }
html[data-interface="classic"] body.analysis-active :is(.eval-current-label, .eval-hover-tip) {
  background: var(--panel);
  color: var(--accent);
  border-color: var(--line);
  border-radius: 4px;
  box-shadow: 0 2px 6px #302d2712;
}
html[data-interface="classic"] body.analysis-active .eval-hover-tip b { color: var(--text); }
html[data-interface="classic"] body.analysis-active .eval-hover-tip span { color: var(--muted); }
html[data-interface="classic"] body.analysis-active .eval-playhead { background: var(--accent); border-color: var(--panel); box-shadow: 0 0 0 2px #203c5b25; }
html[data-interface="classic"] body.analysis-active .eval-graph:hover .eval-playhead { box-shadow: 0 0 0 3px #203c5b25; }

/* Engine, coach and database keep their controls and information hierarchy. */
html[data-interface="classic"] body.analysis-active :is(.engine-panel, .engine-head > div, .engine-line, .engine-option, .free-analysis-panel, .free-analysis-result,
  .coach-card, .coach-ask, .coach-chip, .coach-lead, .coach-game-briefing, .coach-insight, .coach-opening-copy, .db-explorer, .opening-card) {
  background: var(--surface-inset);
  border-color: transparent;
  border-radius: 5px;
  box-shadow: none;
}
html[data-interface="classic"] body.analysis-active .engine-line.best { background: var(--accent-soft); border-color: transparent; }
html[data-interface="classic"] body.analysis-active :is(.engine-line b, .engine-line-pv, .engine-line.best .engine-line-pv, .free-analysis-head b, .free-analysis-result b, .free-analysis-summary) { color: var(--accent); }
html[data-interface="classic"] body.analysis-active :is(.engine-debug, .engine-debug b) { color: #775217; }
html[data-interface="classic"] body.analysis-active .engine-debug { background: #eee3cd; border-color: transparent; }
html[data-interface="classic"] body.analysis-active :is(.coach-card b, .coach-ask b, .coach-move-title > span:first-child, .coach-phase-card small, .diagnosis-facts b) { color: var(--text); }
html[data-interface="classic"] body.analysis-active :is(.coach-card p, .coach-chip p, .coach-opening-copy p, .coach-positive .coach-lead, .coach-diagnosis ul, .diagnosis-details ul, .opening-card #openingSummary) { color: var(--text); }
html[data-interface="classic"] body.analysis-active :is(.coach-details > summary, .coach-details > summary::before, .coach-opening-copy small, .coach-idea-note small, .coach-ai-loading, .opening-card h2, .opening-card h2 span) { color: var(--accent); }
html[data-interface="classic"] body.analysis-active :is(.coach-line-move, .coach-line-reset, .coach-learn-current, .coach-ai-trigger, .coach-intro button, .coach-save-note, .diagnosis-toggle) {
  background: var(--panel2);
  border-color: var(--line);
  color: var(--accent);
  border-radius: 5px;
  box-shadow: none;
}
html[data-interface="classic"] body.analysis-active :is(.coach-ai-trigger .btn-icon, .coach-save-note.saved) { color: var(--green); }
html[data-interface="classic"] body.analysis-active .coach-line-move.active { background: var(--accent); border-color: var(--accent); color: #fff; }
html[data-interface="classic"] body.analysis-active .coach-motif-tag { background: #eee0bf; border-color: transparent; border-radius: 4px; color: #765019; }
html[data-interface="classic"] body.analysis-active .coach-ai-error { color: var(--red); }
html[data-interface="classic"] body.analysis-active .move.active { background: var(--accent-soft); color: var(--accent); }
html[data-interface="classic"] body.analysis-active .move.good { color: var(--green); }
html[data-interface="classic"] body.analysis-active .move.mistake { color: var(--orange); }
html[data-interface="classic"] body.analysis-active .move.blunder { color: var(--red); }

/* Phase and continuation widgets are supplied by separate legacy sheets. */
html[data-interface="classic"] body.analysis-active :is(.game-phase-timeline, .game-phase-filter, .coach-details) { border-color: var(--line); }
html[data-interface="classic"] body.analysis-active :is(.game-phase-head > b, .game-phase-explanation p) { color: var(--text); }
html[data-interface="classic"] body.analysis-active :is(.game-phase-head > span, .game-phase-explanation > summary, .game-phase-explanation small, .game-phase-profile-scope, .game-phase-filter small, .game-phase-training-context) { color: var(--muted); }
html[data-interface="classic"] body.analysis-active :is(.game-phase-track button, .game-phase-track button small, .game-phase-timeline .game-theory-exit, .game-phase-timeline [data-game-phase-retry], .game-phase-board-link, .game-phase-filter, .game-phase-filter select, .game-phase-training-context button) {
  background: transparent;
  color: var(--accent);
  border-color: var(--line);
  box-shadow: none;
}
html[data-interface="classic"] body.analysis-active .game-phase-track button[aria-current="step"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); box-shadow: inset 0 -2px var(--accent); }
html[data-interface="classic"] body.analysis-active .game-phase-track button[aria-current="step"] small { color: var(--accent); }

/* Arrows continue to represent the engine's existing verified move sources.
 * Gold is the primary explanation; red retains its distinct error meaning. */
html[data-interface="classic"] body.analysis-active #arrowLayer .arrow-line:is(.best, .missed-best) { stroke: #d39a2d !important; filter: none !important; }
html[data-interface="classic"] body.analysis-active #arrowLayer .arrow-head:is(.best, .missed-best) { fill: #d39a2d !important; }
html[data-interface="classic"] body.analysis-active #arrowLayer .arrow-line:is(.alt1, .alt2) { stroke: #63819b !important; filter: none !important; }
html[data-interface="classic"] body.analysis-active #arrowLayer .arrow-head:is(.alt1, .alt2) { fill: #63819b !important; }
html[data-interface="classic"] body.analysis-active #arrowLayer .arrow-line.bad { stroke: #b95043 !important; filter: none !important; }
html[data-interface="classic"] body.analysis-active #arrowLayer .arrow-head.bad { fill: #b95043 !important; }

/* The shared appearance dialog remains legible wherever it is opened. */
html[data-interface="classic"] .appearance-dialog { background: var(--panel); color: var(--text); border-color: var(--line); box-shadow: 0 18px 65px #24334430; }
html[data-interface="classic"] .appearance-dialog::backdrop { background: #16263888; }
html[data-interface="classic"] .appearance-dialog :is(.appearance-header, .appearance-close) { background: transparent; color: var(--accent); border-color: var(--line); }
html[data-interface="classic"] .appearance-dialog :is(.appearance-header h2, legend) { color: var(--text); }
html[data-interface="classic"] .appearance-dialog :is(.appearance-eyebrow, .appearance-intro, .appearance-footer [role="status"]) { color: var(--muted); }
html[data-interface="classic"] .appearance-dialog .appearance-option { background: var(--surface-inset); color: var(--text); border-color: var(--line); }
html[data-interface="classic"] .appearance-dialog .appearance-option:hover { background: var(--panel2); border-color: var(--accent); }
html[data-interface="classic"] .appearance-dialog .appearance-option[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
html[data-interface="classic"] .appearance-dialog .appearance-footer { border-color: var(--line); }
html[data-interface="classic"] .appearance-dialog .appearance-done { color: #fff; background: var(--accent); }
html[data-interface="classic"] .appearance-dialog button:focus-visible { outline-color: var(--accent); }

/* Editorial hierarchy: keep the honest game-level verdict distinct from the
 * selected board position; typography must not imply a different chess claim. */
html[data-interface="classic"] body.analysis-active .summary-card > h2 {
  color: var(--text);
  font: 500 27px/1.25 'Source Serif 4', Georgia, serif;
  letter-spacing: -.025em;
}
html[data-interface="classic"] body.analysis-active :is(.summary-opening-label, .summary-opening-label em, #openingTag) {
  color: var(--muted);
  font: 400 12px/1.5 'DM Sans', system-ui, sans-serif;
  letter-spacing: 0;
}
html[data-interface="classic"] body.analysis-active .summary-opening-label {
  display: block;
  margin-top: 5px;
}
html[data-interface="classic"] body.analysis-active .classic-move-brief {
  order: -2;
  margin: 0 0 26px;
  padding: 7px 0 0;
  color: var(--text);
}
html[data-interface="classic"] body.analysis-active .classic-move-brief > small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
html[data-interface="classic"] body.analysis-active .classic-move-brief > h3 {
  margin: 12px 0 14px;
  color: var(--text);
  font: 500 34px/1.2 'Source Serif 4', Georgia, serif;
  letter-spacing: -.025em;
}
html[data-interface="classic"] body.analysis-active .classic-move-brief > p {
  max-width: 40ch;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}
html[data-interface="classic"] body.analysis-active .classic-move-brief > button {
  padding: 9px 0;
  margin-top: 12px;
  min-height: 44px;
  color: var(--accent);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-weight: 500;
}
html[data-interface="classic"] body.analysis-active .classic-move-brief > button:hover { text-decoration: underline; text-underline-offset: 4px; }
html[data-interface="classic"] body.analysis-active .summary-card:has(.classic-move-brief:not([hidden])) > h2 {
  margin-bottom: 14px;
  color: var(--muted);
  font: 400 15px/1.4 'DM Sans', system-ui, sans-serif;
  letter-spacing: 0;
}
html[data-interface="classic"] body.analysis-active .loss-report > b {
  color: var(--text);
  font: 500 27px/1.25 'Source Serif 4', Georgia, serif;
  letter-spacing: -.02em;
}
html[data-interface="classic"] body.analysis-active .loss-report > p {
  font-size: 14px;
  line-height: 1.6;
}
html[data-interface="classic"] body.analysis-active .match-result {
  color: var(--accent);
  background: var(--accent-soft);
  border: 0;
  border-radius: 3px;
  box-shadow: none;
}
html[data-interface="classic"] body.analysis-active .train-mistakes > div > b { color: var(--text); }
html[data-interface="classic"] body.analysis-active .train-mistakes button span { color: inherit; }
html[data-interface="classic"] body.analysis-active .train-mistakes .training-controls .tryVariation span { color: #fff; }
html[data-interface="classic"] body.analysis-active :is(.summary-section-toggle, .summary-section-toggle span, .summary-section-toggle b) { color: var(--accent); }
html[data-interface="classic"] body.analysis-active .summary-section-toggle { background: transparent; }

/* Notes read as a notebook section, not a nested status pill. */
html[data-interface="classic"] body.analysis-active .mistake-notes-panel {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
}
html[data-interface="classic"] body.analysis-active .mistake-notes-panel > summary,
html[data-interface="classic"] body.analysis-active .mistake-notes-panel > summary::after,
html[data-interface="classic"] body.analysis-active .mistake-notes-panel > summary span { color: var(--accent); }
html[data-interface="classic"] body.analysis-active .mistake-notes-panel > summary {
  padding: 12px 0;
  min-height: 44px;
  font-weight: 500;
}
html[data-interface="classic"] body.analysis-active .mistake-notes-panel > summary b {
  background: transparent;
  border: 0;
  color: var(--muted);
  border-radius: 0;
  font-weight: 400;
}
html[data-interface="classic"] body.analysis-active .mistake-note-item { background: var(--panel); border-color: var(--line); border-radius: 4px; }
html[data-interface="classic"] body.analysis-active .mistake-note-item span { color: var(--text) !important; }
html[data-interface="classic"] body.analysis-active .mistake-note-item b { color: var(--accent) !important; }
html[data-interface="classic"] body.analysis-active .mistake-note-item textarea { color: var(--text); background: var(--panel); border-color: var(--line); border-radius: 3px; }
html[data-interface="classic"] body.analysis-active .note-actions button { color: var(--accent); background: var(--accent-soft); border-color: transparent; border-radius: 4px; }
html[data-interface="classic"] body.analysis-active .note-save-state { color: var(--green) !important; }
html[data-interface="classic"] body.analysis-active :is(.result-category, .coach-lead, .coach-phase-card p, .coach-diagnosis b, .opening-summary-card > b) { color: var(--text); }
html[data-interface="classic"] body.analysis-active .coach-move-title > span:first-child {
  font: 500 25px/1.25 'Source Serif 4', Georgia, serif;
}
html[data-interface="classic"] body.analysis-active .coach-current > .coach-lead {
  padding: 12px 0;
  background: transparent;
  font-size: 15px;
  line-height: 1.65;
}
html[data-interface="classic"] body.analysis-active :is(.opening-summary-card > small, .opening-summary-detail p, .opening-ideas span) { color: var(--muted); }
html[data-interface="classic"] body.analysis-active .opening-summary-toggle { background: var(--panel2); color: var(--accent); border-color: transparent; }
html[data-interface="classic"] body.analysis-active :is(.coach-chip-icon, .phase-icon) { background: var(--accent-soft); color: var(--accent); border-color: transparent; box-shadow: none; }

@media (min-width: 901px) {
  /* The existing board-local controls already carry the complete navigation
   * and settings handlers. Reuse them at desktop widths; never clone controls
   * or relocate the chessboard. Their adjacent settings panel stays attached. */
  html[data-interface="classic"] body.analysis-active:not(.sandbox-analysis-active):not(.correction-focus) #mobileMoveNav {
    display: grid;
    grid-template-columns: repeat(5, minmax(44px, 1fr));
    gap: 7px;
    width: min(340px, 100%);
    margin: 12px 0 0 auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  html[data-interface="classic"] body.analysis-active:not(.sandbox-analysis-active):not(.correction-focus) #mobileMoveNav button {
    min-width: 44px;
    min-height: 44px;
    padding: 6px;
    font-size: 23px;
    line-height: 1;
  }
  html[data-interface="classic"] body.analysis-active #mobileMoveNav .settingsGear {
    width: 44px !important;
    min-height: 44px !important;
    height: 44px;
    justify-self: center;
    font-size: 16px !important;
  }
  html[data-interface="classic"] body.analysis-active:not(.sandbox-analysis-active):not(.correction-focus) .global-controls { display: none; }
  html[data-interface="classic"] body.analysis-active #mobileReviewSettings { margin-top: 12px; }
  html[data-interface="classic"] body.analysis-active .summary-desktop { display: flex; flex-direction: column; }
  html[data-interface="classic"] body.analysis-active .summary-desktop > .loss-report {
    order: -1;
    margin-top: 0;
    margin-bottom: 20px;
    padding: 20px 0;
    background: transparent;
    border: 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }
  html[data-interface="classic"] body.analysis-active .summary-desktop > .accuracy-grid > div { padding: 8px 0 14px; }
  html[data-interface="classic"] body.analysis-active .summary-desktop > .train-mistakes {
    background: transparent;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    padding: 18px 0 0;
  }
  html[data-interface="classic"] body.analysis-active .summary-desktop .category-counts .cat b { width: 23px; height: 23px; font-size: 11px; }
}
@media (max-width: 900px) {
  html[data-interface="classic"] body.analysis-active .mobile-review-strip .loss-report > b {
    font: 500 22px/1.3 'Source Serif 4', Georgia, serif;
    letter-spacing: -.015em;
  }
  html[data-interface="classic"] body.analysis-active .mobile-tabs-card { box-shadow: none; }
  html[data-interface="classic"] body.analysis-active .mobile-review-strip .loss-report > p { font-size: 14px; line-height: 1.6; }
}

/* A move gets the reading space; the complete game report stays one click away. */
html[data-interface="classic"] body.analysis-active .classic-game-overview { border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:14px 0;margin:12px 0; }
html[data-interface="classic"] body.analysis-active .classic-game-overview > summary { cursor:pointer;font-size:12px;color:var(--accent);min-height:32px;line-height:32px; }
html[data-interface="classic"] body.analysis-active .classic-game-overview[data-mode="game"] { border:0;padding:0;margin:0; }
html[data-interface="classic"] body.analysis-active .classic-game-overview[data-mode="game"] > summary { display:none; }
html[data-interface="classic"] body.analysis-active .classic-game-overview .accuracy-grid > div { padding:12px 0; }
/* Subtle grain adds warmth without changing square geometry or piece motion. */
html[data-interface="classic"] body.analysis-active[data-board-theme="classic"] #board .square-55d63 {
 background-image:url("assets/textures/walnut-grain.svg"),linear-gradient(90deg,#68412008,transparent 45%,#ffffff10)!important;
 background-size:240px 360px,100% 100%;
}
html[data-interface="classic"] body.analysis-active[data-board-theme="classic"] #board img[data-piece] { filter:drop-shadow(0 2px 1px #38251130); }
html[data-interface="classic"] body.analysis-active #moves .move-table-head { background:var(--panel);color:var(--muted);border-radius:0;border-bottom:1px solid var(--line);backdrop-filter:none; }
html[data-interface="classic"] body.analysis-active .engine-head .move-icon.ok { color:var(--green); }
html[data-interface="classic"] body.analysis-active .coach-chip .chip-icon { background:var(--accent-soft);color:var(--accent);border-color:transparent;box-shadow:none; }

/* Notebook A: a stable board and one paper reading surface. */
html[data-interface="classic"] body.analysis-active .side {
  background:var(--panel);border:0;border-left:1px solid var(--line);
  border-radius:0;padding:18px 24px;min-width:0;box-shadow:2px 2px 0 #cdbf9f;
}
html[data-interface="classic"] body.analysis-active .side .card { padding:16px 0;background:transparent;box-shadow:none;border:0;border-radius:0; }
html[data-interface="classic"] body.analysis-active .summary-card > h2 { display:none; }
html[data-interface="classic"] body.analysis-active .classic-move-brief { margin:0 0 18px;padding:0; }
html[data-interface="classic"] body.analysis-active .classic-move-brief > h3 { font-size:30px;margin:10px 0; }
html[data-interface="classic"] body.analysis-active .classic-move-brief > p { font-size:14px;line-height:1.65;max-width:44ch; }
html[data-interface="classic"] body.analysis-active .classic-move-brief > button {
  background:var(--accent);color:#fff;border:1px solid var(--accent);padding:10px 16px;border-radius:4px;min-height:44px;
}
html[data-interface="classic"] body.analysis-active .notebook-section { margin:0;border:0;border-top:1px solid var(--line); }
html[data-interface="classic"] body.analysis-active .notebook-section > summary { cursor:pointer;min-height:44px;padding:14px 0;font-size:12px;font-weight:600;color:var(--accent); }
html[data-interface="classic"] body.analysis-active .notebook-section > .loss-report { margin:0 0 14px;padding:16px; }
html[data-interface="classic"] body.analysis-active .loss-report > b { font-size:22px; }
html[data-interface="classic"] body.analysis-active .notebook-moves { border-top:1px solid var(--line);padding:10px 0 12px; }
html[data-interface="classic"] body.analysis-active .notebook-move-heading { display:flex;justify-content:space-between;align-items:center;font-size:12px; }
html[data-interface="classic"] body.analysis-active .notebook-move-heading button { font-size:12px;min-height:44px;background:transparent;border:0;color:var(--accent);padding:8px; }
html[data-interface="classic"] body.analysis-active .notebook-move-row { display:grid;grid-template-columns:28px 1fr 1fr;align-items:center;border-bottom:1px solid var(--line);gap:5px; }
html[data-interface="classic"] body.analysis-active .notebook-move-row small { color:var(--muted);font-size:12px; }
html[data-interface="classic"] body.analysis-active .notebook-move-row button { display:flex;align-items:center;justify-content:space-between;min-width:0;min-height:44px;padding:8px 10px;border:0;border-radius:3px;background:transparent;color:var(--text);font-size:14px; }
html[data-interface="classic"] body.analysis-active .notebook-move-row button:hover { background:var(--panel2); }
html[data-interface="classic"] body.analysis-active .notebook-move-row button[aria-current="step"] { background:var(--accent-soft);color:var(--accent);box-shadow:inset 3px 0 var(--accent);font-weight:700; }
html[data-interface="classic"] body.analysis-active .notebook-move-row .move-icon { width:20px;height:20px;font-size:10px; }
/* Fixed dark-theme colours must not leak into free analysis or its move list. */
html[data-interface="classic"] body.analysis-active :is(.free-analysis-panel,.free-analysis-result,.free-analysis-branch) { color:var(--text);background:var(--panel2);border-color:var(--line);box-shadow:none;border-radius:4px; }
html[data-interface="classic"] body.analysis-active :is(.free-analysis-panel,.free-analysis-branch,.engine-panel) button {
  color:var(--accent);background:var(--panel2);border:1px solid #a7977b;box-shadow:none;min-height:44px;
}
html[data-interface="classic"] body.analysis-active :is(.free-analysis-panel,.free-analysis-branch) :is(p,small,span) { color:var(--muted); }
html[data-interface="classic"] body.analysis-active :is(.free-analysis-panel,.free-analysis-branch) button :is(span,b) { color:inherit; }
html[data-interface="classic"] body.analysis-active #moves { max-height:440px;border:0;scrollbar-color:#b7aa91 var(--panel); }
html[data-interface="classic"] body.analysis-active #moves .move-row { border-bottom:1px solid var(--line);padding:3px 0;background:transparent; }
html[data-interface="classic"] body.analysis-active #moves .move { color:var(--text);border:0;border-radius:3px;background:transparent;min-height:44px;padding:8px 10px; }
html[data-interface="classic"] body.analysis-active #moves .move.active { background:var(--accent-soft);color:var(--accent);box-shadow:inset 3px 0 var(--accent); }
html[data-interface="classic"] body.analysis-active #moves .move > span { color:inherit; }
html[data-interface="classic"] body.analysis-active #moves .move-num { color:var(--muted); }
html[data-interface="classic"] body.analysis-active #mobileMoveNav { width:100%;margin:10px 0 0;gap:7px; }
html[data-interface="classic"] body.analysis-active #mobileMoveNav button { background:var(--panel2);color:var(--accent);border:1px solid #a7977b;opacity:1; }
html[data-interface="classic"] body.analysis-active #mobileMoveNav .nav-next { background:var(--accent);border-color:var(--accent);color:#fff; }
html[data-interface="classic"] body.analysis-active #mobileMoveNav .nav-prev::after { content:' Previous';font-size:13px; }
html[data-interface="classic"] body.analysis-active #mobileMoveNav .nav-next::before { content:'Next ';font-size:13px; }
html[data-interface="classic"] body.analysis-active #mobileMoveNav { grid-template-columns:44px 1fr 44px 1fr 44px; }
@media(min-width:901px) {
  html[data-interface="classic"] body[class].analysis-active main { grid-template-columns:minmax(0,1.1fr) minmax(340px,1fr)!important;gap:28px;padding:22px 28px;align-items:start; }
  html[data-interface="classic"] body[class].analysis-active .board-panel { padding:0;max-width:min(100%,calc(100svh - 210px));width:100%;justify-self:center; }
  html[data-interface="classic"] body.analysis-active .app > header { padding-top:14px;padding-bottom:14px;min-height:0; }
  html[data-interface="classic"] body.analysis-active .board-shell { width:100%; }
  html[data-interface="classic"] body.analysis-active .side { min-height:0; }
}
@media(max-width:900px) {
  html[data-interface="classic"] body.analysis-active .side { padding:12px 16px;margin-top:6px; }
  html[data-interface="classic"] body.analysis-active #mobileMoveNav { grid-template-columns:44px 1fr 44px 1fr 44px;gap:4px; }
  html[data-interface="classic"] body.analysis-active #mobileMoveNav .settingsGear { width:44px!important; }
  html[data-interface="classic"] body.analysis-active #mobileMoveNav :is(.nav-prev,.nav-next) { gap:3px;font-size:18px; }
  html[data-interface="classic"] body.analysis-active #mobileMoveNav .nav-prev::after,
  html[data-interface="classic"] body.analysis-active #mobileMoveNav .nav-next::before { font-size:11px; }
}

html[data-interface="classic"] body.analysis-active[data-board-theme="classic"] #board { outline:5px solid #795537;outline-offset:0;border-radius:2px; }

/* Match the specificity of the legacy desktop control rule. */
html[data-interface="classic"] body.analysis-active:not(.sandbox-analysis-active):not(.correction-focus) #mobileMoveNav {
  width:100%;margin:10px 0 0;grid-template-columns:44px 1fr 44px 1fr 44px;
}
html[data-interface="classic"] body.analysis-active #mobileMoveNav .settingsGear {
  background:var(--panel2)!important;border:1px solid #a7977b!important;
}
@media(max-width:900px) {
  html[data-interface="classic"] body.analysis-active #tab-summary .summary-desktop { display:flex!important;flex-direction:column; }
  html[data-interface="classic"] body.analysis-active #tab-summary .summary-mobile-accordion,
  html[data-interface="classic"] body.analysis-active :is(#mobileReviewStrip,#mobileReviewControls) { display:none!important; }
  html[data-interface="classic"] body.analysis-active #mobileBoardControls { margin:0;padding:0;min-height:0; }
  html[data-interface="classic"] body.analysis-active:not(.sandbox-analysis-active):not(.correction-focus) #mobileMoveNav { grid-template-columns:44px 1fr 44px 1fr 44px; }
}
@media(min-width:901px) and (max-width:1050px) {
  /* This width still uses the tall horizontal app header. Reserve that space
     as well as evaluation and navigation instead of pushing controls below it. */
  html[data-interface="classic"] body[class].analysis-active .board-panel { max-width:min(100%,max(260px,calc(100svh - 420px))); }
}

/* Retain category meaning without pale glyphs or neon effects on paper. */
html[data-interface="classic"] body.analysis-active .move-icon { box-shadow:none;border-radius:3px; }
html[data-interface="classic"] body.analysis-active .move-icon:is(.good,.ok) { background:#dedcc8;color:#42573b; }
html[data-interface="classic"] body.analysis-active .move-icon.top { background:#48673c;color:#fff; }
html[data-interface="classic"] body.analysis-active .move-icon:is(.beautiful,.brilliant) { background:#c8dce2;color:#203c5b; }
html[data-interface="classic"] body.analysis-active:is(.free-analysis-active,.correction-focus) .board-panel,
html[data-interface="classic"] body.analysis-active:is(.free-analysis-active,.correction-focus) .side .card { box-shadow:none!important;animation:none; }

/* Review cleanup: one level of detail, clear actions, and a compact phone rail. */
.review-nav-destination { display:none; }
html[data-interface="classic"] body.analysis-active .notebook-review-actions { display:flex;flex-wrap:wrap;gap:4px 16px;margin:0 0 12px; }
html[data-interface="classic"] body.analysis-active .notebook-review-actions button { min-height:44px;padding:8px 0;background:transparent;border:0;color:var(--accent);font-size:13px; }
html[data-interface="classic"] body.analysis-active .notebook-review-actions button:hover { text-decoration:underline;text-underline-offset:4px; }
html[data-interface="classic"] body.analysis-active .notebook-move-columns { display:grid;grid-template-columns:28px 1fr 1fr;gap:5px;padding:2px 0 6px;color:var(--muted);font-size:11px; }
html[data-interface="classic"] body.analysis-active .notebook-move-columns span:not(:first-child) { padding-left:10px; }
html[data-interface="classic"] body.analysis-active .notebook-category-guide { color:var(--muted);font-size:12px;line-height:1.5; }
html[data-interface="classic"] body.analysis-active dl.notebook-category-guide { display:grid;grid-template-columns:1fr 1fr;gap:8px 16px;padding-bottom:12px; }
html[data-interface="classic"] body.analysis-active .notebook-category-guide dt { font-weight:600;color:var(--text); }
html[data-interface="classic"] body.analysis-active .notebook-category-guide dd { margin:0; }
html[data-interface="classic"] body.analysis-active .notebook-explanation { margin:8px 0;color:var(--text);font-size:14px;line-height:1.6; }
html[data-interface="classic"] body.analysis-active .notebook-explanation summary { min-height:44px;padding:10px 0;color:var(--accent);cursor:pointer; }
html[data-interface="classic"] body.analysis-active .board-evaluation { position:relative;flex-wrap:wrap; }
html[data-interface="classic"] body.analysis-active .evaluation-help { position:relative;color:var(--accent);font-size:12px; }
html[data-interface="classic"] body.analysis-active .evaluation-help summary { display:grid;place-items:center;width:44px;min-height:44px;cursor:pointer;list-style:none;border-radius:4px; }
html[data-interface="classic"] body.analysis-active .evaluation-help summary::-webkit-details-marker { display:none; }
html[data-interface="classic"] body.analysis-active .evaluation-help summary:hover { background:var(--panel2); }
html[data-interface="classic"] body.analysis-active .evaluation-help p { position:absolute;right:0;bottom:40px;width:min(270px,70vw);padding:12px;background:var(--panel);color:var(--text);border:1px solid var(--line);border-radius:4px;box-shadow:0 3px 12px #302d2720;z-index:5;line-height:1.5; }
html[data-interface="classic"] body.analysis-active .board-evaluation-value { margin-left:auto; }
@media(max-width:900px) {
  html[data-interface="classic"] body[class].analysis-active .nav { min-height:52px;padding:3px 8px;gap:0; }
  html[data-interface="classic"] body.analysis-active .nav .mobile-app-nav { height:0;min-height:0;padding:0;border:0;margin:0;overflow:visible;opacity:1; }
  html[data-interface="classic"] body.analysis-active #mobileAppNav > [data-mobile-view] { display:none; }
  html[data-interface="classic"] body.analysis-active #mobileMoreSheet .review-nav-destination { display:block; }
  html[data-interface="classic"] body.analysis-active #mobileMoreSheet { background:var(--panel);border:1px solid var(--line);box-shadow:0 8px 24px #302d2720; }
  html[data-interface="classic"] body.analysis-active #mobileMoreSheet button { background:transparent;color:var(--accent);min-height:44px;border:0;box-shadow:none; }
  html[data-interface="classic"] body.analysis-active #mobileMoreSheet button:hover { background:var(--panel2); }
  html[data-interface="classic"] body[class].analysis-active .app > header { display:grid;grid-template-columns:minmax(0,1fr) 44px;align-items:center;gap:8px;padding:4px 12px;min-height:52px; }
  html[data-interface="classic"] body.analysis-active .app > header .top-title { grid-column:1;grid-row:1;min-width:0; }
  html[data-interface="classic"] body.analysis-active #backToGames { grid-column:2;grid-row:1;width:44px;min-height:44px;font-size:0;padding:0; }
  html[data-interface="classic"] body.analysis-active #backToGames::before { content:'←';font-size:22px; }
  html[data-interface="classic"] body.analysis-active .match-player .player-avatar-link { display:none; }
  html[data-interface="classic"] body.analysis-active .match-copy b { display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
  html[data-interface="classic"] body.analysis-active .match-copy { min-width:0; }
  html[data-interface="classic"] body.analysis-active main { padding:8px 12px 16px;gap:8px; }
  html[data-interface="classic"] body.analysis-active .board-panel { padding:8px 6px; }
  html[data-interface="classic"] body.analysis-active .mobile-tabs-card { padding:0;border:0;border-bottom:1px solid var(--line);border-radius:0; }
  html[data-interface="classic"] body.analysis-active .mobile-tabs-card button { min-height:44px; }
  html[data-interface="classic"] body.analysis-active .side { margin-top:0;padding:8px 16px; }
  html[data-interface="classic"] body.analysis-active .side .card { padding:8px 0; }
  html[data-interface="classic"] body.analysis-active .classic-move-brief { margin:0 0 6px; }
  html[data-interface="classic"] body.analysis-active .classic-move-brief > h3 { font-size:25px;margin:6px 0; }
  html[data-interface="classic"] body.analysis-active .classic-move-brief > p { font-size:13px;line-height:1.5;margin:6px 0; }
  html[data-interface="classic"] body.analysis-active .classic-move-brief > button { margin-top:6px; }
  html[data-interface="classic"] body.analysis-active .notebook-review-actions { gap:0 14px;margin-bottom:4px; }
  html[data-interface="classic"] body.analysis-active .evaluation-help { margin-left:4px; }
  html[data-interface="classic"] body.analysis-active .board-evaluation { gap:0 4px; }
  html[data-interface="classic"] body.analysis-active .board-evaluation-value > span { font-size:0; }
  html[data-interface="classic"] body.analysis-active .board-evaluation-value > span::after { content:'Evaluation';font-size:11px; }
}
html[data-interface="classic"] body.analysis-active .match-result { display:grid;justify-items:center;gap:2px; }
html[data-interface="classic"] body.analysis-active .match-outcome { font-size:10px;line-height:1.1;font-weight:400;white-space:nowrap; }
html[data-interface="classic"] body.analysis-active .category-counts { grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:4px; }
html[data-interface="classic"] body.analysis-active .category-counts .cat { min-height:44px;padding:8px; }
html[data-interface="classic"] body.analysis-active .category-counts .cat b { box-shadow:none;border-radius:3px; }
html[data-interface="classic"] body.analysis-active .category-counts :is(.brilliant,.beautiful) b { background:#c8dce2;color:#203c5b; }
html[data-interface="classic"] body.analysis-active .category-counts .top b { background:#48673c;color:#fff; }
html[data-interface="classic"] body.analysis-active .category-counts :is(.good,.ok) b { background:#dedcc8;color:#42573b; }
@media(max-width:900px) {
 html[data-interface="classic"] body.analysis-active .category-counts { grid-template-columns:repeat(2,minmax(0,1fr))!important; }
}
