/* Shared Tournament palette. Paint properties only; no layout or typography changes. */
:root[data-theme="tournament"],
:root[data-theme="tournament"] body {
  --paper: #0c0e10 !important;
  --bg: #0c0e10 !important;
  --bg-elev: #14181c !important;
  --surface: #14181c !important;
  --surface-soft: #1a1f24 !important;
  --panel: #14181c !important;
  --panel-2: #1a1f24 !important;
  --ink: #eef1f3 !important;
  --text: #eef1f3 !important;
  --text-muted: #aab2b9 !important;
  --text-faint: #737d86 !important;
  --muted: #aab2b9 !important;
  --faint: #737d86 !important;
  --line: #30373e !important;
  --line-soft: #30373e !important;
  --premium-bg: #0c0e10 !important;
  --premium-elev: #14181c !important;
  --premium-panel: #14181c !important;
  --premium-panel-2: #1a1f24 !important;
  --premium-border: #30373e !important;
  --fable-bg: #0c0e10 !important;
  --fable-surface: #14181c !important;
  --fable-surface-2: #1a1f24 !important;
  --fable-panel-bg: #14181c !important;
  --fable-inset-bg: #1a1f24 !important;
  --fable-tabbar-bg: #14181c !important;
  --fable-control-hover: #242b32 !important;
  --fable-track: #1a1f24 !important;
  --fable-text: #eef1f3 !important;
  --fable-muted: #aab2b9 !important;
  --fable-faint: #737d86 !important;
  --fable-line: #30373e !important;
  --fable-line-strong: #46515b !important;
  --fable-rail-bg: #1a1f24 !important;
  --settings-control: #1a1f24 !important;
  --spg-bg: #0c0e10 !important;
  --spg-panel: #14181c !important;
  --spg-ink: #eef1f3 !important;
  --spg-ink-soft: #aab2b9 !important;
  --spg-line: #30373e !important;
  background-color: #0c0e10 !important;
  color: #eef1f3 !important;
}

:root[data-theme="tournament"] body,
:root[data-theme="tournament"] .account-main,
:root[data-theme="tournament"] .support-main {
  background-image: none !important;
}

:root[data-theme="tournament"] .support-main {
  --support-ground: #0c0e10 !important;
  --support-card: #14181c !important;
  --support-card-2: #1a1f24 !important;
  --support-field: #1a1f24 !important;
  --support-line: #30373e !important;
  --support-line-2: #46515b !important;
  --support-text: #eef1f3 !important;
  --support-soft: #c5ccd2 !important;
  --support-muted: #aab2b9 !important;
  background-color: #0c0e10 !important;
  color: #eef1f3 !important;
}

/* The dashboard's cream surfaces have direct color declarations. */
:root[data-theme="tournament"] .dashboard-page :is(
  .pilot-dashboard-header, .editorial-toolbar, .editorial-metrics > article,
  .editorial-analytics, .pilot-repertoire, .editorial-archive, .editorial-account-card,
  .editorial-account-panel, .editorial-repertoire, .landing-results, .landing-rating
) {
  background-color: #14181c !important;
  background-image: none !important;
  border-color: #30373e !important;
  color: #eef1f3 !important;
}

:root[data-theme="tournament"] .dashboard-page .dashboard-banner-shade {
  background-image: linear-gradient(90deg, #14181cf2 0%, #14181cce 25%, #14181c66 43%, transparent 64%) !important;
}

:root[data-theme="tournament"] .dashboard-page :is(
  .pilot-dashboard-header h1, .pilot-dashboard-header p, .editorial-metrics strong,
  .editorial-metric-value, .editorial-analytics h2, .editorial-analytics h3,
  .editorial-modes button, .editorial-tabs button, .landing-opening-name b,
  .landing-opening-rate, .landing-opening-row, .atelier-view-switch button,
  .atelier-side-switch button, .pilot-repertoire h2, .pilot-repertoire h3,
  .pilot-repertoire h4, .opening-stage-title, .landing-results-body,
  .editorial-archive th, .editorial-archive td, .editorial-archive h2
) { color: #eef1f3 !important; }

:root[data-theme="tournament"] .dashboard-page :is(
  .editorial-metrics small, .editorial-metric-label, .editorial-metric-foot,
  .editorial-analytics .chart-labels, .editorial-analytics .chart-y-axis,
  .pilot-repertoire figcaption, .landing-opening-name small, .editorial-archive small
) { color: #aab2b9 !important; }

:root[data-theme="tournament"] .dashboard-page :is(
  .editorial-toolbar select, .editorial-analytics select, .editorial-modes,
  .atelier-view-switch, .atelier-side-switch, .landing-opening-row,
  .atelier-practice, .editorial-archive input, .editorial-archive select
) {
  background-color: #1a1f24 !important;
  background-image: none !important;
  border-color: #30373e !important;
  color: #eef1f3 !important;
}

:root[data-theme="tournament"] .dashboard-page :is(
  .editorial-tabs [aria-selected="true"], .editorial-modes [aria-pressed="true"],
  .atelier-view-switch [aria-selected="true"], .atelier-side-switch [aria-pressed="true"]
) {
  background-color: #233b31 !important;
  border-color: #3f7e60 !important;
  color: #b6e3cb !important;
}

:root[data-theme="tournament"] .settings-page :is(.account-main, .settings-toolbar) {
  background-color: #0c0e10 !important;
  color: #eef1f3 !important;
}

:root[data-theme="tournament"] .settings-page :is(
  .fable-settings-card, .settings-appearance-preview
) {
  background-color: #14181c !important;
  border-color: #30373e !important;
  color: #eef1f3 !important;
}

:root[data-theme="tournament"] .settings-page .settings-preview-window {
  background-color: #1a1f24 !important;
  border-color: #30373e !important;
  color: #eef1f3 !important;
}

:root[data-theme="tournament"] .sparring-page :is(
  .spg-settings-col, .spg-opponent-art, .spg-opening-picker, .spg-create-actions
) {
  background-color: #14181c !important;
  background-image: none !important;
  border-color: #30373e !important;
}

:root[data-theme="tournament"] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea) {
  background-color: #1a1f24 !important;
  border-color: #30373e !important;
  color: #eef1f3 !important;
}

:root[data-theme="tournament"] :is(input, textarea)::placeholder {
  color: #737d86 !important;
}

:root[data-theme="tournament"] :is(.games-table, .editorial-archive table) :is(th, td) {
  border-color: #30373e !important;
}

:root[data-theme="tournament"] :is(.games-table, .editorial-archive table) th {
  background-color: #1a1f24 !important;
  color: #aab2b9 !important;
}

:root[data-theme="tournament"] :is(.games-table, .editorial-archive table) td {
  background-color: #14181c !important;
  color: #eef1f3 !important;
}

/* No board, square, piece, photo, font, size, gap or positioning rules. */

:root[data-theme="tournament"] :is(h1,h2,h3,h4) {
  color: #eef1f3 !important;
}

:root[data-theme="tournament"] .dashboard-page :is(h1 em,#dataTitle span) {
  color: #74d09f !important;
}

:root[data-theme="tournament"] .dashboard-page #chartLine {
  stroke: #74d09f !important;
}

:root[data-theme="tournament"] .dashboard-page .editorial-analytics dl :is(strong,b) {
  color: #eef1f3 !important;
}

/* This illustration retains its cream dial, so its labels retain dark ink. */
:root[data-theme="tournament"] .dashboard-page .editorial-analytics .landing-gauge-center :is(strong,span,small) {
  color: #20372b !important;
}

:root[data-theme="tournament"] .dashboard-page .editorial-analytics :is(span,small,dt,dd),
:root[data-theme="tournament"] .dashboard-page .editorial-metrics :is(small,.editorial-metric-label),
:root[data-theme="tournament"] .dashboard-page :is(.chart-y-axis,.chart-labels,.chart-growth,.editorial-chart-note) {
  color: #aab2b9 !important;
}

:root[data-theme="tournament"] .results-wrap :is(.panel,.card,.error,.notice,.r-panel,.r-card,.primary-grid,.status),
:root[data-theme="tournament"] .results-wrap :is(.results-summary,.summary-grid) {
  background-color: #14181c !important;
  background-image: none !important;
  border-color: #30373e !important;
  color: #eef1f3 !important;
}

:root[data-theme="tournament"] .results-wrap :is(h1,h2,h3,h4,p,th,td,label) {
  color: #eef1f3 !important;
}

:root[data-theme="tournament"] .results-wrap :is(small,.muted,.subtitle) {
  color: #aab2b9 !important;
}

/* Shared Classic palette. Paint properties only; no layout or typography changes. */
:root[data-theme="classic"],
:root[data-theme="classic"] body {
  --paper: #f6f4ef !important;
  --bg: #f6f4ef !important;
  --bg-elev: #ffffff !important;
  --surface: #ffffff !important;
  --surface-soft: #eceae4 !important;
  --panel: #ffffff !important;
  --panel-2: #eceae4 !important;
  --ink: #171b20 !important;
  --text: #171b20 !important;
  --text-muted: #59616b !important;
  --text-faint: #7a838e !important;
  --muted: #59616b !important;
  --faint: #7a838e !important;
  --line: rgba(29,36,43,.12) !important;
  --line-soft: rgba(29,36,43,.12) !important;
  --premium-bg: #f6f4ef !important;
  --premium-elev: #ffffff !important;
  --premium-panel: #ffffff !important;
  --premium-panel-2: #eceae4 !important;
  --premium-border: rgba(29,36,43,.12) !important;
  --fable-bg: #f6f4ef !important;
  --fable-surface: #ffffff !important;
  --fable-surface-2: #eceae4 !important;
  --fable-panel-bg: #ffffff !important;
  --fable-inset-bg: #eceae4 !important;
  --fable-tabbar-bg: #ffffff !important;
  --fable-control-hover: #e1ded6 !important;
  --fable-track: #eceae4 !important;
  --fable-text: #171b20 !important;
  --fable-muted: #59616b !important;
  --fable-faint: #7a838e !important;
  --fable-line: rgba(29,36,43,.12) !important;
  --fable-line-strong: rgba(29,36,43,.2) !important;
  --fable-rail-bg: #ebe8e1 !important;
  --settings-control: #eceae4 !important;
  --spg-bg: #f6f4ef !important;
  --spg-panel: #ffffff !important;
  --spg-ink: #171b20 !important;
  --spg-ink-soft: #59616b !important;
  --spg-line: rgba(29,36,43,.12) !important;
  background-color: #f6f4ef !important;
  color: #171b20 !important;
}

:root[data-theme="classic"] body,
:root[data-theme="classic"] .account-main,
:root[data-theme="classic"] .support-main {
  background-image: none !important;
}

:root[data-theme="classic"] .support-main {
  --support-ground: #f6f4ef !important;
  --support-card: #ffffff !important;
  --support-card-2: #eceae4 !important;
  --support-field: #eceae4 !important;
  --support-line: rgba(29,36,43,.12) !important;
  --support-line-2: rgba(29,36,43,.2) !important;
  --support-text: #171b20 !important;
  --support-soft: #37424d !important;
  --support-muted: #59616b !important;
  background-color: #f6f4ef !important;
  color: #171b20 !important;
}

/* The dashboard's cream surfaces have direct color declarations. */
:root[data-theme="classic"] .dashboard-page :is(
  .pilot-dashboard-header, .editorial-toolbar, .editorial-metrics > article,
  .editorial-analytics, .pilot-repertoire, .editorial-archive, .editorial-account-card,
  .editorial-account-panel, .editorial-repertoire, .landing-results, .landing-rating
) {
  background-color: #ffffff !important;
  background-image: none !important;
  border-color: rgba(29,36,43,.12) !important;
  color: #171b20 !important;
}

:root[data-theme="classic"] .dashboard-page .dashboard-banner-shade {
  background-image: linear-gradient(90deg, #fffffff2 0%, #ffffffce 25%, #ffffff66 43%, transparent 64%) !important;
}

:root[data-theme="classic"] .dashboard-page :is(
  .pilot-dashboard-header h1, .pilot-dashboard-header p, .editorial-metrics strong,
  .editorial-metric-value, .editorial-analytics h2, .editorial-analytics h3,
  .editorial-modes button, .editorial-tabs button, .landing-opening-name b,
  .landing-opening-rate, .landing-opening-row, .atelier-view-switch button,
  .atelier-side-switch button, .pilot-repertoire h2, .pilot-repertoire h3,
  .pilot-repertoire h4, .opening-stage-title, .landing-results-body,
  .editorial-archive th, .editorial-archive td, .editorial-archive h2
) { color: #171b20 !important; }

:root[data-theme="classic"] .dashboard-page :is(
  .editorial-metrics small, .editorial-metric-label, .editorial-metric-foot,
  .editorial-analytics .chart-labels, .editorial-analytics .chart-y-axis,
  .pilot-repertoire figcaption, .landing-opening-name small, .editorial-archive small
) { color: #59616b !important; }

:root[data-theme="classic"] .dashboard-page :is(
  .editorial-toolbar select, .editorial-analytics select, .editorial-modes,
  .atelier-view-switch, .atelier-side-switch, .landing-opening-row,
  .atelier-practice, .editorial-archive input, .editorial-archive select
) {
  background-color: #eceae4 !important;
  background-image: none !important;
  border-color: rgba(29,36,43,.12) !important;
  color: #171b20 !important;
}

:root[data-theme="classic"] .dashboard-page :is(
  .editorial-tabs [aria-selected="true"], .editorial-modes [aria-pressed="true"],
  .atelier-view-switch [aria-selected="true"], .atelier-side-switch [aria-pressed="true"]
) {
  background-color: #e3eee8 !important;
  border-color: #168a65 !important;
  color: #126548 !important;
}

:root[data-theme="classic"] .settings-page :is(.account-main, .settings-toolbar) {
  background-color: #f6f4ef !important;
  color: #171b20 !important;
}

:root[data-theme="classic"] .settings-page :is(
  .fable-settings-card, .settings-appearance-preview
) {
  background-color: #ffffff !important;
  border-color: rgba(29,36,43,.12) !important;
  color: #171b20 !important;
}

:root[data-theme="classic"] .settings-page .settings-preview-window {
  background-color: #eceae4 !important;
  border-color: rgba(29,36,43,.12) !important;
  color: #171b20 !important;
}

:root[data-theme="classic"] .sparring-page :is(
  .spg-settings-col, .spg-opponent-art, .spg-opening-picker, .spg-create-actions
) {
  background-color: #ffffff !important;
  background-image: none !important;
  border-color: rgba(29,36,43,.12) !important;
}

:root[data-theme="classic"] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea) {
  background-color: #eceae4 !important;
  border-color: rgba(29,36,43,.12) !important;
  color: #171b20 !important;
}

:root[data-theme="classic"] :is(input, textarea)::placeholder {
  color: #7a838e !important;
}

:root[data-theme="classic"] :is(.games-table, .editorial-archive table) :is(th, td) {
  border-color: rgba(29,36,43,.12) !important;
}

:root[data-theme="classic"] :is(.games-table, .editorial-archive table) th {
  background-color: #eceae4 !important;
  color: #59616b !important;
}

:root[data-theme="classic"] :is(.games-table, .editorial-archive table) td {
  background-color: #ffffff !important;
  color: #171b20 !important;
}

/* No board, square, piece, photo, font, size, gap or positioning rules. */

:root[data-theme="classic"] :is(h1,h2,h3,h4) {
  color: #171b20 !important;
}

:root[data-theme="classic"] .dashboard-page :is(h1 em,#dataTitle span) {
  color: #168a65 !important;
}

:root[data-theme="classic"] .dashboard-page #chartLine {
  stroke: #168a65 !important;
}

:root[data-theme="classic"] .dashboard-page .editorial-analytics dl :is(strong,b) {
  color: #171b20 !important;
}

/* This illustration retains its cream dial, so its labels retain dark ink. */
:root[data-theme="classic"] .dashboard-page .editorial-analytics .landing-gauge-center :is(strong,span,small) {
  color: #20372b !important;
}

:root[data-theme="classic"] .dashboard-page .editorial-analytics :is(span,small,dt,dd),
:root[data-theme="classic"] .dashboard-page .editorial-metrics :is(small,.editorial-metric-label),
:root[data-theme="classic"] .dashboard-page :is(.chart-y-axis,.chart-labels,.chart-growth,.editorial-chart-note) {
  color: #59616b !important;
}

:root[data-theme="classic"] .results-wrap :is(.panel,.card,.error,.notice,.r-panel,.r-card,.primary-grid,.status),
:root[data-theme="classic"] .results-wrap :is(.results-summary,.summary-grid) {
  background-color: #ffffff !important;
  background-image: none !important;
  border-color: rgba(29,36,43,.12) !important;
  color: #171b20 !important;
}

:root[data-theme="classic"] .results-wrap :is(h1,h2,h3,h4,p,th,td,label) {
  color: #171b20 !important;
}

:root[data-theme="classic"] .results-wrap :is(small,.muted,.subtitle) {
  color: #59616b !important;
}

/* Shared Midnight palette. Paint properties only; no layout or typography changes. */
:root[data-theme="midnight"],
:root[data-theme="midnight"] body {
  --paper: #1c1f23 !important;
  --bg: #1c1f23 !important;
  --bg-elev: #26292f !important;
  --surface: #26292f !important;
  --surface-soft: #2c3037 !important;
  --panel: #26292f !important;
  --panel-2: #2c3037 !important;
  --ink: #e9ebee !important;
  --text: #e9ebee !important;
  --text-muted: #a7adb5 !important;
  --text-faint: #777f89 !important;
  --muted: #a7adb5 !important;
  --faint: #777f89 !important;
  --line: #3b4149 !important;
  --line-soft: #3b4149 !important;
  --premium-bg: #1c1f23 !important;
  --premium-elev: #26292f !important;
  --premium-panel: #26292f !important;
  --premium-panel-2: #2c3037 !important;
  --premium-border: #3b4149 !important;
  --fable-bg: #1c1f23 !important;
  --fable-surface: #26292f !important;
  --fable-surface-2: #2c3037 !important;
  --fable-panel-bg: #26292f !important;
  --fable-inset-bg: #2c3037 !important;
  --fable-tabbar-bg: #26292f !important;
  --fable-control-hover: #353c46 !important;
  --fable-track: #2c3037 !important;
  --fable-text: #e9ebee !important;
  --fable-muted: #a7adb5 !important;
  --fable-faint: #777f89 !important;
  --fable-line: #3b4149 !important;
  --fable-line-strong: #4f5966 !important;
  --fable-rail-bg: #2c3037 !important;
  --settings-control: #2c3037 !important;
  --spg-bg: #1c1f23 !important;
  --spg-panel: #26292f !important;
  --spg-ink: #e9ebee !important;
  --spg-ink-soft: #a7adb5 !important;
  --spg-line: #3b4149 !important;
  background-color: #1c1f23 !important;
  color: #e9ebee !important;
}

:root[data-theme="midnight"] body,
:root[data-theme="midnight"] .account-main,
:root[data-theme="midnight"] .support-main {
  background-image: none !important;
}

:root[data-theme="midnight"] .support-main {
  --support-ground: #1c1f23 !important;
  --support-card: #26292f !important;
  --support-card-2: #2c3037 !important;
  --support-field: #2c3037 !important;
  --support-line: #3b4149 !important;
  --support-line-2: #4f5966 !important;
  --support-text: #e9ebee !important;
  --support-soft: #c9ced6 !important;
  --support-muted: #a7adb5 !important;
  background-color: #1c1f23 !important;
  color: #e9ebee !important;
}

/* The dashboard's cream surfaces have direct color declarations. */
:root[data-theme="midnight"] .dashboard-page :is(
  .pilot-dashboard-header, .editorial-toolbar, .editorial-metrics > article,
  .editorial-analytics, .pilot-repertoire, .editorial-archive, .editorial-account-card,
  .editorial-account-panel, .editorial-repertoire, .landing-results, .landing-rating
) {
  background-color: #26292f !important;
  background-image: none !important;
  border-color: #3b4149 !important;
  color: #e9ebee !important;
}

:root[data-theme="midnight"] .dashboard-page .dashboard-banner-shade {
  background-image: linear-gradient(90deg, #26292ff2 0%, #26292fce 25%, #26292f66 43%, transparent 64%) !important;
}

:root[data-theme="midnight"] .dashboard-page :is(
  .pilot-dashboard-header h1, .pilot-dashboard-header p, .editorial-metrics strong,
  .editorial-metric-value, .editorial-analytics h2, .editorial-analytics h3,
  .editorial-modes button, .editorial-tabs button, .landing-opening-name b,
  .landing-opening-rate, .landing-opening-row, .atelier-view-switch button,
  .atelier-side-switch button, .pilot-repertoire h2, .pilot-repertoire h3,
  .pilot-repertoire h4, .opening-stage-title, .landing-results-body,
  .editorial-archive th, .editorial-archive td, .editorial-archive h2
) { color: #e9ebee !important; }

:root[data-theme="midnight"] .dashboard-page :is(
  .editorial-metrics small, .editorial-metric-label, .editorial-metric-foot,
  .editorial-analytics .chart-labels, .editorial-analytics .chart-y-axis,
  .pilot-repertoire figcaption, .landing-opening-name small, .editorial-archive small
) { color: #a7adb5 !important; }

:root[data-theme="midnight"] .dashboard-page :is(
  .editorial-toolbar select, .editorial-analytics select, .editorial-modes,
  .atelier-view-switch, .atelier-side-switch, .landing-opening-row,
  .atelier-practice, .editorial-archive input, .editorial-archive select
) {
  background-color: #2c3037 !important;
  background-image: none !important;
  border-color: #3b4149 !important;
  color: #e9ebee !important;
}

:root[data-theme="midnight"] .dashboard-page :is(
  .editorial-tabs [aria-selected="true"], .editorial-modes [aria-pressed="true"],
  .atelier-view-switch [aria-selected="true"], .atelier-side-switch [aria-pressed="true"]
) {
  background-color: #303c4a !important;
  border-color: #7c9cc4 !important;
  color: #a8c1df !important;
}

:root[data-theme="midnight"] .settings-page :is(.account-main, .settings-toolbar) {
  background-color: #1c1f23 !important;
  color: #e9ebee !important;
}

:root[data-theme="midnight"] .settings-page :is(
  .fable-settings-card, .settings-appearance-preview
) {
  background-color: #26292f !important;
  border-color: #3b4149 !important;
  color: #e9ebee !important;
}

:root[data-theme="midnight"] .settings-page .settings-preview-window {
  background-color: #2c3037 !important;
  border-color: #3b4149 !important;
  color: #e9ebee !important;
}

:root[data-theme="midnight"] .sparring-page :is(
  .spg-settings-col, .spg-opponent-art, .spg-opening-picker, .spg-create-actions
) {
  background-color: #26292f !important;
  background-image: none !important;
  border-color: #3b4149 !important;
}

:root[data-theme="midnight"] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea) {
  background-color: #2c3037 !important;
  border-color: #3b4149 !important;
  color: #e9ebee !important;
}

:root[data-theme="midnight"] :is(input, textarea)::placeholder {
  color: #777f89 !important;
}

:root[data-theme="midnight"] :is(.games-table, .editorial-archive table) :is(th, td) {
  border-color: #3b4149 !important;
}

:root[data-theme="midnight"] :is(.games-table, .editorial-archive table) th {
  background-color: #2c3037 !important;
  color: #a7adb5 !important;
}

:root[data-theme="midnight"] :is(.games-table, .editorial-archive table) td {
  background-color: #26292f !important;
  color: #e9ebee !important;
}

/* No board, square, piece, photo, font, size, gap or positioning rules. */

:root[data-theme="midnight"] :is(h1,h2,h3,h4) {
  color: #e9ebee !important;
}

:root[data-theme="midnight"] .dashboard-page :is(h1 em,#dataTitle span) {
  color: #7c9cc4 !important;
}

:root[data-theme="midnight"] .dashboard-page #chartLine {
  stroke: #7c9cc4 !important;
}

:root[data-theme="midnight"] .dashboard-page .editorial-analytics dl :is(strong,b) {
  color: #e9ebee !important;
}

/* This illustration retains its cream dial, so its labels retain dark ink. */
:root[data-theme="midnight"] .dashboard-page .editorial-analytics .landing-gauge-center :is(strong,span,small) {
  color: #20372b !important;
}

:root[data-theme="midnight"] .dashboard-page .editorial-analytics :is(span,small,dt,dd),
:root[data-theme="midnight"] .dashboard-page .editorial-metrics :is(small,.editorial-metric-label),
:root[data-theme="midnight"] .dashboard-page :is(.chart-y-axis,.chart-labels,.chart-growth,.editorial-chart-note) {
  color: #a7adb5 !important;
}

:root[data-theme="midnight"] .results-wrap :is(.panel,.card,.error,.notice,.r-panel,.r-card,.primary-grid,.status),
:root[data-theme="midnight"] .results-wrap :is(.results-summary,.summary-grid) {
  background-color: #26292f !important;
  background-image: none !important;
  border-color: #3b4149 !important;
  color: #e9ebee !important;
}

:root[data-theme="midnight"] .results-wrap :is(h1,h2,h3,h4,p,th,td,label) {
  color: #e9ebee !important;
}

:root[data-theme="midnight"] .results-wrap :is(small,.muted,.subtitle) {
  color: #a7adb5 !important;
}

/* Shared Emerald palette. Paint properties only; no layout or typography changes. */
:root[data-theme="emerald"],
:root[data-theme="emerald"] body {
  --paper: #262522 !important;
  --bg: #262522 !important;
  --bg-elev: #312e2b !important;
  --surface: #312e2b !important;
  --surface-soft: #3a3734 !important;
  --panel: #312e2b !important;
  --panel-2: #3a3734 !important;
  --ink: #f3f3f3 !important;
  --text: #f3f3f3 !important;
  --text-muted: #b8b6b3 !important;
  --text-faint: #8a8783 !important;
  --muted: #b8b6b3 !important;
  --faint: #8a8783 !important;
  --line: #55514d !important;
  --line-soft: #55514d !important;
  --premium-bg: #262522 !important;
  --premium-elev: #312e2b !important;
  --premium-panel: #312e2b !important;
  --premium-panel-2: #3a3734 !important;
  --premium-border: #55514d !important;
  --fable-bg: #262522 !important;
  --fable-surface: #312e2b !important;
  --fable-surface-2: #3a3734 !important;
  --fable-panel-bg: #312e2b !important;
  --fable-inset-bg: #3a3734 !important;
  --fable-tabbar-bg: #312e2b !important;
  --fable-control-hover: #46433f !important;
  --fable-track: #3a3734 !important;
  --fable-text: #f3f3f3 !important;
  --fable-muted: #b8b6b3 !important;
  --fable-faint: #8a8783 !important;
  --fable-line: #55514d !important;
  --fable-line-strong: #6c665f !important;
  --fable-rail-bg: #3a3734 !important;
  --settings-control: #3a3734 !important;
  --spg-bg: #262522 !important;
  --spg-panel: #312e2b !important;
  --spg-ink: #f3f3f3 !important;
  --spg-ink-soft: #b8b6b3 !important;
  --spg-line: #55514d !important;
  background-color: #262522 !important;
  color: #f3f3f3 !important;
}

:root[data-theme="emerald"] body,
:root[data-theme="emerald"] .account-main,
:root[data-theme="emerald"] .support-main {
  background-image: none !important;
}

:root[data-theme="emerald"] .support-main {
  --support-ground: #262522 !important;
  --support-card: #312e2b !important;
  --support-card-2: #3a3734 !important;
  --support-field: #3a3734 !important;
  --support-line: #55514d !important;
  --support-line-2: #6c665f !important;
  --support-text: #f3f3f3 !important;
  --support-soft: #d4d0ca !important;
  --support-muted: #b8b6b3 !important;
  background-color: #262522 !important;
  color: #f3f3f3 !important;
}

/* The dashboard's cream surfaces have direct color declarations. */
:root[data-theme="emerald"] .dashboard-page :is(
  .pilot-dashboard-header, .editorial-toolbar, .editorial-metrics > article,
  .editorial-analytics, .pilot-repertoire, .editorial-archive, .editorial-account-card,
  .editorial-account-panel, .editorial-repertoire, .landing-results, .landing-rating
) {
  background-color: #312e2b !important;
  background-image: none !important;
  border-color: #55514d !important;
  color: #f3f3f3 !important;
}

:root[data-theme="emerald"] .dashboard-page .dashboard-banner-shade {
  background-image: linear-gradient(90deg, #312e2bf2 0%, #312e2bce 25%, #312e2b66 43%, transparent 64%) !important;
}

:root[data-theme="emerald"] .dashboard-page :is(
  .pilot-dashboard-header h1, .pilot-dashboard-header p, .editorial-metrics strong,
  .editorial-metric-value, .editorial-analytics h2, .editorial-analytics h3,
  .editorial-modes button, .editorial-tabs button, .landing-opening-name b,
  .landing-opening-rate, .landing-opening-row, .atelier-view-switch button,
  .atelier-side-switch button, .pilot-repertoire h2, .pilot-repertoire h3,
  .pilot-repertoire h4, .opening-stage-title, .landing-results-body,
  .editorial-archive th, .editorial-archive td, .editorial-archive h2
) { color: #f3f3f3 !important; }

:root[data-theme="emerald"] .dashboard-page :is(
  .editorial-metrics small, .editorial-metric-label, .editorial-metric-foot,
  .editorial-analytics .chart-labels, .editorial-analytics .chart-y-axis,
  .pilot-repertoire figcaption, .landing-opening-name small, .editorial-archive small
) { color: #b8b6b3 !important; }

:root[data-theme="emerald"] .dashboard-page :is(
  .editorial-toolbar select, .editorial-analytics select, .editorial-modes,
  .atelier-view-switch, .atelier-side-switch, .landing-opening-row,
  .atelier-practice, .editorial-archive input, .editorial-archive select
) {
  background-color: #3a3734 !important;
  background-image: none !important;
  border-color: #55514d !important;
  color: #f3f3f3 !important;
}

:root[data-theme="emerald"] .dashboard-page :is(
  .editorial-tabs [aria-selected="true"], .editorial-modes [aria-pressed="true"],
  .atelier-view-switch [aria-selected="true"], .atelier-side-switch [aria-pressed="true"]
) {
  background-color: #35412c !important;
  border-color: #81b64c !important;
  color: #9bcf64 !important;
}

:root[data-theme="emerald"] .settings-page :is(.account-main, .settings-toolbar) {
  background-color: #262522 !important;
  color: #f3f3f3 !important;
}

:root[data-theme="emerald"] .settings-page :is(
  .fable-settings-card, .settings-appearance-preview
) {
  background-color: #312e2b !important;
  border-color: #55514d !important;
  color: #f3f3f3 !important;
}

:root[data-theme="emerald"] .settings-page .settings-preview-window {
  background-color: #3a3734 !important;
  border-color: #55514d !important;
  color: #f3f3f3 !important;
}

:root[data-theme="emerald"] .sparring-page :is(
  .spg-settings-col, .spg-opponent-art, .spg-opening-picker, .spg-create-actions
) {
  background-color: #312e2b !important;
  background-image: none !important;
  border-color: #55514d !important;
}

:root[data-theme="emerald"] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea) {
  background-color: #3a3734 !important;
  border-color: #55514d !important;
  color: #f3f3f3 !important;
}

:root[data-theme="emerald"] :is(input, textarea)::placeholder {
  color: #8a8783 !important;
}

:root[data-theme="emerald"] :is(.games-table, .editorial-archive table) :is(th, td) {
  border-color: #55514d !important;
}

:root[data-theme="emerald"] :is(.games-table, .editorial-archive table) th {
  background-color: #3a3734 !important;
  color: #b8b6b3 !important;
}

:root[data-theme="emerald"] :is(.games-table, .editorial-archive table) td {
  background-color: #312e2b !important;
  color: #f3f3f3 !important;
}

/* No board, square, piece, photo, font, size, gap or positioning rules. */

:root[data-theme="emerald"] :is(h1,h2,h3,h4) {
  color: #f3f3f3 !important;
}

:root[data-theme="emerald"] .dashboard-page :is(h1 em,#dataTitle span) {
  color: #81b64c !important;
}

:root[data-theme="emerald"] .dashboard-page #chartLine {
  stroke: #81b64c !important;
}

:root[data-theme="emerald"] .dashboard-page .editorial-analytics dl :is(strong,b) {
  color: #f3f3f3 !important;
}

/* This illustration retains its cream dial, so its labels retain dark ink. */
:root[data-theme="emerald"] .dashboard-page .editorial-analytics .landing-gauge-center :is(strong,span,small) {
  color: #20372b !important;
}

:root[data-theme="emerald"] .dashboard-page .editorial-analytics :is(span,small,dt,dd),
:root[data-theme="emerald"] .dashboard-page .editorial-metrics :is(small,.editorial-metric-label),
:root[data-theme="emerald"] .dashboard-page :is(.chart-y-axis,.chart-labels,.chart-growth,.editorial-chart-note) {
  color: #b8b6b3 !important;
}

:root[data-theme="emerald"] .results-wrap :is(.panel,.card,.error,.notice,.r-panel,.r-card,.primary-grid,.status),
:root[data-theme="emerald"] .results-wrap :is(.results-summary,.summary-grid) {
  background-color: #312e2b !important;
  background-image: none !important;
  border-color: #55514d !important;
  color: #f3f3f3 !important;
}

:root[data-theme="emerald"] .results-wrap :is(h1,h2,h3,h4,p,th,td,label) {
  color: #f3f3f3 !important;
}

:root[data-theme="emerald"] .results-wrap :is(small,.muted,.subtitle) {
  color: #b8b6b3 !important;
}

/* Shared Paper palette. Paint properties only; no layout or typography changes. */
:root[data-theme="paper"],
:root[data-theme="paper"] body {
  --paper: #efe5d2 !important;
  --bg: #efe5d2 !important;
  --bg-elev: #fffaf0 !important;
  --surface: #fffaf0 !important;
  --surface-soft: #f4ead8 !important;
  --panel: #fffaf0 !important;
  --panel-2: #f4ead8 !important;
  --ink: #2b211b !important;
  --text: #2b211b !important;
  --text-muted: #6f6258 !important;
  --text-faint: #8a7d70 !important;
  --muted: #6f6258 !important;
  --faint: #8a7d70 !important;
  --line: #cbbda7 !important;
  --line-soft: #cbbda7 !important;
  --premium-bg: #efe5d2 !important;
  --premium-elev: #fffaf0 !important;
  --premium-panel: #fffaf0 !important;
  --premium-panel-2: #f4ead8 !important;
  --premium-border: #cbbda7 !important;
  --fable-bg: #efe5d2 !important;
  --fable-surface: #fffaf0 !important;
  --fable-surface-2: #f4ead8 !important;
  --fable-panel-bg: #fffaf0 !important;
  --fable-inset-bg: #f4ead8 !important;
  --fable-tabbar-bg: #fffaf0 !important;
  --fable-control-hover: #e9dcc4 !important;
  --fable-track: #f4ead8 !important;
  --fable-text: #2b211b !important;
  --fable-muted: #6f6258 !important;
  --fable-faint: #8a7d70 !important;
  --fable-line: #cbbda7 !important;
  --fable-line-strong: #ad977f !important;
  --fable-rail-bg: #f4ead8 !important;
  --settings-control: #f4ead8 !important;
  --spg-bg: #efe5d2 !important;
  --spg-panel: #fffaf0 !important;
  --spg-ink: #2b211b !important;
  --spg-ink-soft: #6f6258 !important;
  --spg-line: #cbbda7 !important;
  background-color: #efe5d2 !important;
  color: #2b211b !important;
}

:root[data-theme="paper"] body,
:root[data-theme="paper"] .account-main,
:root[data-theme="paper"] .support-main {
  background-image: none !important;
}

:root[data-theme="paper"] .support-main {
  --support-ground: #efe5d2 !important;
  --support-card: #fffaf0 !important;
  --support-card-2: #f4ead8 !important;
  --support-field: #f4ead8 !important;
  --support-line: #cbbda7 !important;
  --support-line-2: #ad977f !important;
  --support-text: #2b211b !important;
  --support-soft: #574539 !important;
  --support-muted: #6f6258 !important;
  background-color: #efe5d2 !important;
  color: #2b211b !important;
}

/* The dashboard's cream surfaces have direct color declarations. */
:root[data-theme="paper"] .dashboard-page :is(
  .pilot-dashboard-header, .editorial-toolbar, .editorial-metrics > article,
  .editorial-analytics, .pilot-repertoire, .editorial-archive, .editorial-account-card,
  .editorial-account-panel, .editorial-repertoire, .landing-results, .landing-rating
) {
  background-color: #fffaf0 !important;
  background-image: none !important;
  border-color: #cbbda7 !important;
  color: #2b211b !important;
}

:root[data-theme="paper"] .dashboard-page .dashboard-banner-shade {
  background-image: linear-gradient(90deg, #fffaf0f2 0%, #fffaf0ce 25%, #fffaf066 43%, transparent 64%) !important;
}

:root[data-theme="paper"] .dashboard-page :is(
  .pilot-dashboard-header h1, .pilot-dashboard-header p, .editorial-metrics strong,
  .editorial-metric-value, .editorial-analytics h2, .editorial-analytics h3,
  .editorial-modes button, .editorial-tabs button, .landing-opening-name b,
  .landing-opening-rate, .landing-opening-row, .atelier-view-switch button,
  .atelier-side-switch button, .pilot-repertoire h2, .pilot-repertoire h3,
  .pilot-repertoire h4, .opening-stage-title, .landing-results-body,
  .editorial-archive th, .editorial-archive td, .editorial-archive h2
) { color: #2b211b !important; }

:root[data-theme="paper"] .dashboard-page :is(
  .editorial-metrics small, .editorial-metric-label, .editorial-metric-foot,
  .editorial-analytics .chart-labels, .editorial-analytics .chart-y-axis,
  .pilot-repertoire figcaption, .landing-opening-name small, .editorial-archive small
) { color: #6f6258 !important; }

:root[data-theme="paper"] .dashboard-page :is(
  .editorial-toolbar select, .editorial-analytics select, .editorial-modes,
  .atelier-view-switch, .atelier-side-switch, .landing-opening-row,
  .atelier-practice, .editorial-archive input, .editorial-archive select
) {
  background-color: #f4ead8 !important;
  background-image: none !important;
  border-color: #cbbda7 !important;
  color: #2b211b !important;
}

:root[data-theme="paper"] .dashboard-page :is(
  .editorial-tabs [aria-selected="true"], .editorial-modes [aria-pressed="true"],
  .atelier-view-switch [aria-selected="true"], .atelier-side-switch [aria-pressed="true"]
) {
  background-color: #e9dcc4 !important;
  border-color: #8b4f2f !important;
  color: #6f3820 !important;
}

:root[data-theme="paper"] .settings-page :is(.account-main, .settings-toolbar) {
  background-color: #efe5d2 !important;
  color: #2b211b !important;
}

:root[data-theme="paper"] .settings-page :is(
  .fable-settings-card, .settings-appearance-preview
) {
  background-color: #fffaf0 !important;
  border-color: #cbbda7 !important;
  color: #2b211b !important;
}

:root[data-theme="paper"] .settings-page .settings-preview-window {
  background-color: #f4ead8 !important;
  border-color: #cbbda7 !important;
  color: #2b211b !important;
}

:root[data-theme="paper"] .sparring-page :is(
  .spg-settings-col, .spg-opponent-art, .spg-opening-picker, .spg-create-actions
) {
  background-color: #fffaf0 !important;
  background-image: none !important;
  border-color: #cbbda7 !important;
}

:root[data-theme="paper"] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea) {
  background-color: #f4ead8 !important;
  border-color: #cbbda7 !important;
  color: #2b211b !important;
}

:root[data-theme="paper"] :is(input, textarea)::placeholder {
  color: #8a7d70 !important;
}

:root[data-theme="paper"] :is(.games-table, .editorial-archive table) :is(th, td) {
  border-color: #cbbda7 !important;
}

:root[data-theme="paper"] :is(.games-table, .editorial-archive table) th {
  background-color: #f4ead8 !important;
  color: #6f6258 !important;
}

:root[data-theme="paper"] :is(.games-table, .editorial-archive table) td {
  background-color: #fffaf0 !important;
  color: #2b211b !important;
}

/* No board, square, piece, photo, font, size, gap or positioning rules. */

:root[data-theme="paper"] :is(h1,h2,h3,h4) {
  color: #2b211b !important;
}

:root[data-theme="paper"] .dashboard-page :is(h1 em,#dataTitle span) {
  color: #8b4f2f !important;
}

:root[data-theme="paper"] .dashboard-page #chartLine {
  stroke: #8b4f2f !important;
}

:root[data-theme="paper"] .dashboard-page .editorial-analytics dl :is(strong,b) {
  color: #2b211b !important;
}

/* This illustration retains its cream dial, so its labels retain dark ink. */
:root[data-theme="paper"] .dashboard-page .editorial-analytics .landing-gauge-center :is(strong,span,small) {
  color: #20372b !important;
}

:root[data-theme="paper"] .dashboard-page .editorial-analytics :is(span,small,dt,dd),
:root[data-theme="paper"] .dashboard-page .editorial-metrics :is(small,.editorial-metric-label),
:root[data-theme="paper"] .dashboard-page :is(.chart-y-axis,.chart-labels,.chart-growth,.editorial-chart-note) {
  color: #6f6258 !important;
}

:root[data-theme="paper"] .results-wrap :is(.panel,.card,.error,.notice,.r-panel,.r-card,.primary-grid,.status),
:root[data-theme="paper"] .results-wrap :is(.results-summary,.summary-grid) {
  background-color: #fffaf0 !important;
  background-image: none !important;
  border-color: #cbbda7 !important;
  color: #2b211b !important;
}

:root[data-theme="paper"] .results-wrap :is(h1,h2,h3,h4,p,th,td,label) {
  color: #2b211b !important;
}

:root[data-theme="paper"] .results-wrap :is(small,.muted,.subtitle) {
  color: #6f6258 !important;
}
