/* Soft Charcoal: color-only overrides for the five authenticated Member pages.
 * Keep existing layout, typography, icons, handlers and light mode unchanged.
 * Receipt export installs its own stylesheet; no export palette is changed here. */
html body:not(.light-theme).member-authenticated:has(:is(.app-shell-home, .app-shell-game, .app-shell-resultcheck, .app-shell-liveboard-report, .saved-results-board)) {
    --sc-page: #202225;
    --sc-sidebar: #1C1E21;
    --sc-section: #24272B;
    --sc-card: #292C30;
    --sc-inset: #303439;
    --sc-input: #24272B;
    --sc-line: #3A3E43;
    --sc-open-surface: #16553B;
    --sc-open-line: #35AA70;
    --sc-open-ink: #F1F3F2;
    --sc-open-secondary: #BCDCCB;
    --sc-open-value: #F0FFF8;
    --sc-open-status: #35ED94;
    --sc-open-divider: #26845F;
    --sc-closed-ink: #9CA3AD;
    --sc-closed-value: #CDD2D8;
    --sc-closed-dot: #BCC3CC;
    --sc-ink: #F1F3F5;
    --sc-secondary: #A6B0BB;
    --sc-muted: #778391;
    --sc-white: #FFFFFF;
    --sc-red: #D94A4A;
    --sc-red-hover: #EB5C5C;
    --sc-red-soft: #382326;
    --sc-green: #35ED94;
    --sc-green-soft: #16553B;
    --sc-green-line: #35AA70;
    --sc-gold: #E5B14B;
    --sc-gold-soft: #382F20;
    --sc-blue: #4B91D1;
    --sc-blue-soft: #1D3042;
    --member-market-paper: var(--sc-page);
    --member-market-surface: var(--sc-card);
    --member-market-surface-muted: var(--sc-inset);
    --member-market-ink: var(--sc-ink);
    --member-market-ink-soft: var(--sc-secondary);
    --member-market-muted: var(--sc-muted);
    --member-market-rule: var(--sc-line);
    --member-market-rule-strong: var(--sc-line);
    --member-market-shadow: none;
    --member-market-shadow-hover: none;
    --member-market-green: var(--sc-red);
    --member-market-green-deep: var(--sc-red);
    --member-market-green-dark: var(--sc-red-hover);
    --member-market-green-soft: var(--sc-red-soft);
    --member-market-blue: var(--sc-blue);
    --member-market-red: var(--sc-red);
    background-color: var(--sc-page) !important;
    color: var(--sc-ink);
}
html body:not(.light-theme).member-authenticated #app,
html body:not(.light-theme).member-authenticated #main-content,
html body:not(.light-theme).member-authenticated #main-content > :is(.app-shell-home, .app-shell-game, .app-shell-resultcheck, .app-shell-liveboard-report, .saved-results-board) {
    background: var(--sc-page) !important;
    color: var(--sc-ink) !important;
}

/* Shared sidebar: the original logo, SVGs, spacing and hit areas are retained. */
html body:not(.light-theme).member-authenticated #member-sidebar {
    --rail-surface: var(--sc-sidebar);
    --rail-deep: var(--sc-sidebar);
    --rail-raised: var(--sc-inset);
    --rail-edge: var(--sc-line);
    --rail-ink: var(--sc-ink);
    --rail-muted: var(--sc-secondary);
    --rail-accent: var(--sc-red);
    --rail-accent-deep: var(--sc-red);
    --rail-accent-ink: var(--sc-white);
    --rail-selected-ink: var(--sc-red-hover);
    --rail-selected: var(--sc-red-soft);
    --rail-selected-end: var(--sc-red-soft);
    --rail-focus: var(--sc-red-hover);
    --rail-glow: transparent;
    background: var(--sc-sidebar) !important;
    border-color: var(--sc-line) !important;
}
html body:not(.light-theme).member-authenticated #member-sidebar .member-sidebar__avatar { background: var(--sc-inset) !important; color: var(--sc-ink) !important; }
html body:not(.light-theme).member-authenticated #member-sidebar .member-sidebar__online { background: var(--sc-green) !important; }

/* Existing page palettes: change only their color tokens. */
html body:not(.light-theme).member-authenticated #main-content .app-shell-home {
    --mc-surface: var(--sc-card);
    --mc-line: var(--sc-line);
    --mc-ink: var(--sc-ink);
    --mc-muted: var(--sc-secondary);
    --mc-accent: var(--sc-red);
    --mc-accent-soft: var(--sc-inset);
    --mc-on-accent: var(--sc-white);
    --dashboard-blue-deep: var(--sc-ink);
    --dashboard-blue: var(--sc-red);
    --dashboard-blue-bright: var(--sc-red-hover);
    --dashboard-blue-soft: var(--sc-red-soft);
    --dashboard-blue-soft-2: var(--sc-section);
    --dashboard-blue-rule: var(--sc-line);
    --dashboard-white: var(--sc-white);
    --dashboard-ink: var(--sc-ink);
    --dashboard-muted: var(--sc-secondary);
    --dashboard-panel-rule: var(--sc-line);
    --dashboard-input-rule: var(--sc-line);
    --dashboard-summary-surface: var(--sc-card);
    --dashboard-control-ink: var(--sc-ink);
    --dashboard-control-muted: var(--sc-secondary);
    --dashboard-control-rule: var(--sc-line);
    --dashboard-control-surface: var(--sc-card);
    --dashboard-control-wash: var(--sc-input);
    --dashboard-nav-muted: var(--sc-secondary);
    --dashboard-nav-gradient: var(--sc-card);
    --dashboard-navy-gradient: var(--sc-card);
    --dashboard-control-shadow: none;
    --topbar-control-surface: var(--sc-card);
    --topbar-control-surface-hover: var(--sc-inset);
    --topbar-control-rule: var(--sc-line);
    --topbar-control-rule-hover: var(--sc-red);
    --topbar-control-ink: var(--sc-ink);
    --topbar-control-muted: var(--sc-secondary);
    --topbar-active-ink: var(--sc-white);
    --topbar-danger: var(--sc-red);
    --topbar-danger-surface: var(--sc-red-soft);
    --topbar-focus: var(--sc-red-hover);
}
html body:not(.light-theme).member-authenticated #main-content .app-shell-home .home-market-tools .home-market-tools__main {
    --market-tool-surface: var(--sc-section);
    --market-tool-wash: var(--sc-input);
    --market-tool-ink: var(--sc-ink);
    --market-tool-muted: var(--sc-secondary);
    --market-tool-rule: var(--sc-line);
    --market-tool-green: var(--sc-red);
    --market-tool-green-top: var(--sc-red-hover);
    --market-tool-icon-green: var(--sc-secondary);
    --market-tool-heading-green: var(--sc-ink);
    --market-tool-action-ink: var(--sc-white);
    --market-tool-focus: var(--sc-red-hover);
    --market-tool-pink: var(--sc-red);
    --market-tool-pink-soft: var(--sc-red-soft);
    --market-tool-blue: var(--sc-secondary);
    --market-tool-blue-soft: var(--sc-inset);
    --market-tool-purple: var(--sc-secondary);
    --market-tool-purple-soft: var(--sc-inset);
    --market-tool-green-soft: var(--sc-inset);
}
html body:not(.light-theme).member-authenticated #main-content .app-shell-resultcheck.resultcheck-compact {
    --result-surface: var(--sc-card);
    --result-heading: var(--sc-inset);
    --result-line: var(--sc-line);
    --result-ink: var(--sc-ink);
    --result-muted: var(--sc-secondary);
    --result-winner: var(--sc-green-soft);
    --result-winner-hover: var(--sc-green-soft);
    --result-hover: var(--sc-inset);
    --result-link: var(--sc-blue);
    --result-sales: var(--sc-ink);
    --result-discount: var(--sc-secondary);
    --result-net: var(--sc-white);
    --result-pending: var(--sc-gold);
    --result-button: var(--sc-blue-soft);
    --result-button-line: var(--sc-line);
    --result-focus: var(--sc-red-hover);
}
html body:not(.light-theme).member-authenticated #main-content .app-shell-liveboard-report.liveboard-ledger {
    --ledger-page: var(--sc-page);
    --ledger-surface: var(--sc-card);
    --ledger-heading: var(--sc-inset);
    --ledger-line: var(--sc-line);
    --ledger-ink: var(--sc-ink);
    --ledger-muted: var(--sc-secondary);
    --ledger-winner: var(--sc-green-soft);
    --ledger-winner-hover: var(--sc-green-soft);
    --ledger-hover: var(--sc-inset);
    --ledger-link: var(--sc-blue);
    --ledger-sales: var(--sc-ink);
    --ledger-discount: var(--sc-secondary);
    --ledger-net: var(--sc-white);
    --ledger-pending: var(--sc-gold);
    --ledger-focus: var(--sc-red-hover);
    --ledger-positive: var(--sc-green);
    --ledger-negative: var(--sc-red-hover);
    --ledger-negative-soft: var(--sc-red-soft);
    --ledger-pending-soft: var(--sc-gold-soft);
    --ledger-button: var(--sc-blue-soft);
    --ledger-button-line: var(--sc-line);
    --ledger-accent: var(--sc-red);
    --ledger-accent-ink: var(--sc-white);
}
html body:not(.light-theme).member-authenticated #main-content .saved-results-board {
    --results-surface: var(--sc-card);
    --results-canvas: var(--sc-page);
    --results-heading: var(--sc-inset);
    --results-line: var(--sc-line);
    --results-ink: var(--sc-ink);
    --results-muted: var(--sc-secondary);
    --results-canvas-muted: var(--sc-muted);
    --results-primary: var(--sc-red);
    --results-primary-ink: var(--sc-white);
    --results-bottom: var(--sc-blue);
    --results-focus: var(--sc-red-hover);
    --results-soft: var(--sc-blue-soft);
    --results-input-line: var(--sc-line);
    --results-error: var(--sc-red-hover);
}
html body:not(.light-theme).member-authenticated #betting-workspace,
html body:not(.light-theme).member-authenticated #betting-workspace .quick-bet-left {
    --bet-page: var(--sc-page);
    --bet-paper: var(--sc-card);
    --bet-soft: var(--sc-inset);
    --bet-line: var(--sc-line);
    --bet-ink: var(--sc-ink);
    --bet-muted: var(--sc-secondary);
    --bet-blue: var(--sc-blue);
    --bet-blue-soft: var(--sc-section);
    --bet-blue-line: var(--sc-line);
    --bet-action: #8FC8A0;
    --bet-white: var(--sc-white);
    --bet-green: var(--sc-green);
    --bet-green-soft: var(--sc-green-soft);
    --bet-red: var(--sc-red-hover);
    --bet-red-soft: var(--sc-red-soft);
    --bet-danger-action: var(--sc-red);
    --bet-warning: var(--sc-inset);
    --bet-warning-ink: var(--sc-ink);
    --entry-family-action: var(--bet-action);
    --lottery-family-action: var(--bet-action);
}

/* Neutral surfaces / text from legacy utility classes, scoped to these pages. */
html body:not(.light-theme).member-authenticated #main-content :is(.app-shell-home, .app-shell-game, .app-shell-resultcheck, .app-shell-liveboard-report, .saved-results-board) :is(.text-white, .text-gray-100, .text-gray-200, .text-gray-800, .text-gray-900) { color: var(--sc-ink) !important; }
html body:not(.light-theme).member-authenticated #main-content :is(.app-shell-home, .app-shell-game, .app-shell-resultcheck, .app-shell-liveboard-report, .saved-results-board) :is(.text-gray-300, .text-gray-400, .text-gray-500, .text-gray-600, .text-gray-700) { color: var(--sc-secondary) !important; }
html body:not(.light-theme).member-authenticated #main-content :is(.app-shell-home, .app-shell-game, .app-shell-resultcheck, .app-shell-liveboard-report, .saved-results-board) :is(input, select, textarea) {
    background-color: var(--sc-input) !important;
    color: var(--sc-ink) !important;
    border-color: var(--sc-line) !important;
    color-scheme: dark;
}
html body:not(.light-theme).member-authenticated #main-content :is(.app-shell-home, .app-shell-game, .app-shell-resultcheck, .app-shell-liveboard-report, .saved-results-board) input::placeholder { color: var(--sc-muted) !important; }

/* Remove inherited glass and raised panel effects without changing their geometry. */
html body:not(.light-theme).member-authenticated #main-content :is(.app-shell-home, .app-shell-game, .app-shell-resultcheck, .app-shell-liveboard-report, .saved-results-board) :is(.app-topbar, .home-credit-card, .home-market-quick-row, .number-entry-card, .pending-panel, .cart-item, .cart-item__numbers, .quick-bet-options, .hhlott-section, .result-market-card, .liveboard-filter-card, .liveboard-section-header, .liveboard-date-panel, .liveboard-stat-card, .liveboard-list-card, .liveboard-list-header, input, select, textarea) {
    box-shadow: none !important;
    backdrop-filter: none !important;
}
html body:not(.light-theme).member-authenticated #main-content .app-shell-home .home-market-quick-row { background: var(--sc-section) !important; border-color: var(--sc-line) !important; }
html body:not(.light-theme).member-authenticated #main-content #betting-workspace #tabs-area .pending-panel,
html body:not(.light-theme).member-authenticated #main-content #betting-workspace #local-list .cart-item { box-shadow: none !important; }

/* Market and common navigation. Red means an action/selection, never a win. */
html body:not(.light-theme).member-authenticated #main-content .app-shell-home :is(.home-topbar, .home-market-tools, .home-market-tabs) { background: var(--sc-section) !important; border-color: var(--sc-line) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-home :is(.home-credit-card, .market-card) { background: var(--sc-card) !important; border-color: var(--sc-line) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-home :is(.home-credit-card span, #member-header-credit) { color: var(--sc-ink) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-home :is(.home-market-tab, .home-market-chip, .layout-toggle-btn, .home-action-button) { color: var(--sc-secondary) !important; border-color: var(--sc-line) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-home :is(.home-market-tab.is-active, .layout-toggle-btn.is-active, .home-market-sort) { background: var(--sc-red) !important; color: var(--sc-white) !important; border-color: var(--sc-red) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-home .home-market-chip.is-active { color: var(--sc-red-hover) !important; border-color: var(--sc-red) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-home .home-market-chip.is-active::after { background-color: var(--sc-red) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-home .home-action-button.is-success { background: var(--sc-card) !important; color: var(--sc-secondary) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-home .home-action-button.is-danger { background: var(--sc-red-soft) !important; color: var(--sc-red-hover) !important; }
/* Market state colors are independent of action and success colors. No card-wide dimming. */
html body:not(.light-theme).member-authenticated #main-content .app-shell-home .stock-card {
    background: var(--sc-card) !important;
    border-color: var(--sc-line) !important;
    color: var(--sc-closed-ink) !important;
    box-shadow: none !important;
    text-shadow: none !important;
    opacity: 1 !important;
    filter: none !important;
    backdrop-filter: none !important;
}
html body:not(.light-theme).member-authenticated #main-content .app-shell-home .stock-card__glow { background: none !important; box-shadow: none !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-home .stock-card :is(h3, .stock-card__draw-date, .stock-card__draw-time, .stock-card__detail-label, .stock-card__detail-value, .stock-card__status-prefix, .stock-card__status-value, .stock-card__timer-value, .stock-card__status-text, .stock-card__status-dot) { opacity: 1 !important; text-shadow: none !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-home .stock-card__bottom { border-color: var(--sc-line) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-home .stock-card-closed :is(h3, .stock-card__draw-date, .stock-card__detail-label, .stock-card__status-prefix) { color: var(--sc-closed-ink) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-home .stock-card-closed :is(.stock-card__draw-time, .stock-card__detail-value, .stock-card__timer-value, .stock-card__status-value, .stock-card__status-text) { color: var(--sc-closed-value) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-home .stock-card .stock-card__detail-row:last-child::after,
html body:not(.light-theme).member-authenticated #main-content .app-shell-home .stock-card .stock-card__status-dot { background: var(--sc-closed-dot) !important; box-shadow: none !important; opacity: 1 !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-home .stock-card-open { background: var(--sc-open-surface) !important; border-color: var(--sc-open-line) !important; color: var(--sc-open-secondary) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-home .stock-card-open h3 { color: var(--sc-open-ink) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-home .stock-card-open .stock-card__bottom { border-color: var(--sc-open-divider) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-home .stock-card-open :is(.stock-card__draw-date, .stock-card__draw-time, .stock-card__detail-label, .stock-card__detail-value, .stock-card__status-prefix, .stock-card__status-text, .stock-card__status-value) { color: var(--sc-open-secondary) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-home .stock-card-open .stock-card__timer-value { color: var(--sc-open-status) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-home .stock-card-open :is(.stock-card__draw-time, .stock-card__detail-value) { color: var(--sc-open-value) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-home .stock-card-open .stock-card__detail-row:last-child::after,
html body:not(.light-theme).member-authenticated #main-content .app-shell-home .stock-card-open .stock-card__status-dot { background: var(--sc-open-status) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-home :is(.home-market-help__content, .home-market-showcase) { background-color: var(--sc-card) !important; color: var(--sc-secondary) !important; border-color: var(--sc-line) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-home .home-market-summary .is-open span::before { background-color: var(--sc-muted) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-home .home-market-summary .is-closing span::before { background-color: var(--sc-gold) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-home :is(.layout-toggle-container, .home-theme-toggle) { background: var(--sc-card) !important; border-color: var(--sc-line) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-home :is(#home-time, .stock-group__eyebrow) { color: var(--sc-muted) !important; }

/* Reports retain their exact existing rows, columns, controls and SVGs. */
html body:not(.light-theme).member-authenticated #main-content .app-shell-resultcheck .result-row.is-winner :is(.result-cell-index, .result-cell-date, .result-cell-discount),
html body:not(.light-theme).member-authenticated #main-content .app-shell-liveboard-report .liveboard-row.is-won :is(.ledger-date, .ledger-round, .ledger-discount) { color: var(--sc-open-secondary) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-resultcheck .result-market-card:has(.result-row.is-winner),
html body:not(.light-theme).member-authenticated #main-content .app-shell-liveboard-report .liveboard-market-card:has(.liveboard-row.is-won),
html body:not(.light-theme).member-authenticated #main-content .app-shell-liveboard-report .liveboard-stat-card.is-outcome.is-profit { border-color: var(--sc-line) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-resultcheck :is(.resultcheck-day-button.is-active, .result-check-action) { background: var(--sc-red) !important; color: var(--sc-white) !important; border-color: var(--sc-red) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-resultcheck :is(.auto-result-action.is-preview, .result-row-action.is-primary) { background: var(--sc-blue-soft) !important; color: var(--sc-blue) !important; border-color: var(--sc-line) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-resultcheck :is(.result-status-text.is-waiting, .result-auto-status) { background: var(--sc-gold-soft) !important; color: var(--sc-gold) !important; border-color: var(--sc-line) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-resultcheck .result-auto-status:is(.text-green-200, .text-emerald-200) { background: var(--sc-green-soft) !important; color: var(--sc-green) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-resultcheck .result-auto-status.text-blue-200 { background: var(--sc-blue-soft) !important; color: var(--sc-blue) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-resultcheck .result-auto-status.text-red-200 { background: var(--sc-red-soft) !important; color: var(--sc-red-hover) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-resultcheck .result-status-text.is-won { color: var(--sc-green) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-resultcheck .result-row-action.is-danger { background: var(--sc-red-soft) !important; color: var(--sc-red-hover) !important; border-color: var(--sc-line) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-resultcheck .result-copy-action { background: var(--sc-blue-soft) !important; color: var(--sc-blue) !important; border-color: var(--sc-line) !important; }
html body:not(.light-theme).member-authenticated #main-content :is(.resultcheck-topbar, .liveboard-report-topbar, .saved-results-header) { background: var(--sc-section) !important; border-color: var(--sc-line) !important; }
html body:not(.light-theme).member-authenticated #main-content :is(.liveboard-filter-card, .liveboard-filter-body, .liveboard-section-header, .saved-results-filters) { background: var(--sc-section) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-liveboard-report .layout-toggle-container { background: var(--sc-card) !important; border-color: var(--sc-line) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-liveboard-report .layout-toggle-btn { color: var(--sc-secondary) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-liveboard-report .layout-toggle-btn.is-active { background: var(--sc-red) !important; color: var(--sc-white) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-liveboard-report .liveboard-summary > div > span:nth-child(2) { color: var(--sc-white) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-liveboard-report .liveboard-summary-outcome.is-loss { background: var(--sc-red-soft) !important; border-color: var(--sc-line) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-liveboard-report .liveboard-summary-outcome.is-loss :is(span:nth-child(2), small) { color: var(--sc-red-hover) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-liveboard-report .liveboard-summary-outcome.is-profit { background: var(--sc-green-soft) !important; border-color: var(--sc-line) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-liveboard-report .liveboard-summary-outcome.is-profit :is(span:nth-child(2), small) { color: var(--sc-green) !important; }

/* Result review controls: neutral secondary actions; winning rows retain their green stripe. */
html body:not(.light-theme).member-authenticated #main-content .app-shell-liveboard-report.liveboard-ledger .liveboard-row-action.is-primary { background: #343B39 !important; color: #F1F7F3 !important; border-color: #454E49 !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-liveboard-report.liveboard-ledger .liveboard-ledger-table tfoot .ledger-outcome { color: var(--sc-white) !important; }
@media (hover: hover) {
    html body:not(.light-theme).member-authenticated #main-content .app-shell-liveboard-report.liveboard-ledger .liveboard-row-action.is-primary:hover:not(:disabled) { background: #46504B !important; }
}

html body:not(.light-theme).member-authenticated #main-content .app-shell-resultcheck.resultcheck-compact {
    --review-secondary: #343B39;
    --review-secondary-line: #454E49;
    --review-copy: #3C4446;
    --review-copy-ink: #CBD5D8;
    --review-green: #31694D;
    --review-green-hover: #3E7B5B;
    --review-white: #F1F7F3;
}
html body:not(.light-theme).member-authenticated #main-content .app-shell-resultcheck.resultcheck-compact .resultcheck-day-button:not(.is-active),
html body:not(.light-theme).member-authenticated #main-content .app-shell-resultcheck.resultcheck-compact .result-row-action.is-primary { background: var(--review-secondary) !important; color: var(--review-white) !important; border-color: var(--review-secondary-line) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-resultcheck.resultcheck-compact .auto-result-action.is-preview { background: var(--review-green) !important; color: var(--review-white) !important; border-color: var(--review-green-hover) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-resultcheck.resultcheck-compact .result-copy-action { background: var(--review-copy) !important; color: var(--review-copy-ink) !important; border-color: var(--review-secondary-line) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-resultcheck.resultcheck-compact .result-table tfoot .result-cell-outcome { color: var(--sc-white) !important; }
@media (hover: hover) {
    html body:not(.light-theme).member-authenticated #main-content .app-shell-resultcheck.resultcheck-compact :is(.resultcheck-day-button:not(.is-active), .result-row-action.is-primary, .result-copy-action):hover:not(:disabled) { background: #46504B !important; }
    html body:not(.light-theme).member-authenticated #main-content .app-shell-resultcheck.resultcheck-compact .auto-result-action.is-preview:hover:not(:disabled) { background: var(--review-green-hover) !important; }
}

/* Betting workbench, live receipt and market strip. */
html body:not(.light-theme).member-authenticated #betting-workspace :is(.quick-bet-header, #tabs-area.quick-bet-entry, .restricted-panel, .history-panel, #game-footer, .summary-panel__card, .quick-bet-list) { background: var(--sc-card) !important; border-color: var(--sc-line) !important; }
html body:not(.light-theme).member-authenticated #betting-workspace .quick-bet-shell { background-color: transparent !important; }
html body:not(.light-theme).member-authenticated #betting-workspace :is(.hhlott-market-badge, .hhlott-number-chip, .hhlott-number-category__title) { color: var(--sc-secondary) !important; }
html body:not(.light-theme).member-authenticated #betting-workspace :is(#btn-ok, .quick-bet-add, #btn-save-firebase, .game-tabs button.bg-blue-600, .game-shell__back) { background: var(--bet-action) !important; color: var(--game-action-ink) !important; border-color: var(--bet-action) !important; }
html body:not(.light-theme).member-authenticated #betting-workspace #btn-capture { background: var(--sc-inset) !important; color: var(--sc-secondary) !important; border-color: var(--sc-line) !important; }
html body:not(.light-theme).member-authenticated #betting-workspace #game-timer { color: var(--sc-gold) !important; }
html body:not(.light-theme).member-authenticated #betting-workspace .summary-panel__countdown { color: var(--sc-gold) !important; }
html body:not(.light-theme).member-authenticated .app-shell-game :is(.market-shortcuts, .market-shortcuts__track, .market-shortcuts__item, .market-shortcuts__header) { background-color: var(--sc-section) !important; color: var(--sc-secondary) !important; border-color: var(--sc-line) !important; }
html body:not(.light-theme).member-authenticated #main-content #betting-workspace #tabs-area :is(#num-input, #price-top, #price-bottom, #price-tod) { background: var(--sc-input) !important; color: var(--sc-ink) !important; border-color: var(--sc-line) !important; }
html body:not(.light-theme).member-authenticated #main-content #betting-workspace #bill-capture-content:not(.is-capturing-slip) :is(#owner-name-input, #btn-capture-slip) { background: var(--sc-input) !important; border-color: var(--sc-line) !important; }
html body:not(.light-theme).member-authenticated #main-content #betting-workspace #bill-capture-content:not(.is-capturing-slip) #btn-capture { background: var(--sc-inset) !important; color: var(--sc-secondary) !important; border-color: var(--sc-line) !important; }
html body:not(.light-theme).member-authenticated #main-content #betting-workspace #bill-capture-content:not(.is-capturing-slip) :is(#game-timer, .summary-panel__countdown) { color: var(--sc-gold) !important; }
html body:not(.light-theme).member-authenticated #main-content #betting-workspace #bill-capture-content:not(.is-capturing-slip) .cart-item__delete { background: var(--sc-red-soft) !important; color: var(--sc-red-hover) !important; border-color: var(--sc-line) !important; }
html body:not(.light-theme).member-authenticated #betting-workspace .market-shortcuts { --shortcut-accent: var(--sc-gold); --shortcut-tint: var(--sc-gold-soft); }
html body:not(.light-theme).member-authenticated #betting-workspace .game-shell__market-status.is-open { color: var(--sc-blue) !important; background: var(--sc-blue-soft) !important; }
html body:not(.light-theme).member-authenticated #main-content #betting-workspace #tabs-area :is(.game-tabs button.bg-blue-600, #btn-ok, .quick-bet-add) { background: var(--bet-action) !important; color: var(--game-action-ink) !important; }
html body:not(.light-theme).member-authenticated #main-content #betting-workspace #tabs-area button[onclick="toggleReverse()"] { background: var(--sc-inset) !important; color: var(--sc-ink) !important; border-color: var(--sc-line) !important; }
html body:not(.light-theme).member-authenticated #main-content #betting-workspace #tabs-area button[onclick="toggleReverse()"].bg-yellow-600 { background: var(--bet-action) !important; color: var(--game-action-ink) !important; }
html body:not(.light-theme).member-authenticated #main-content #betting-workspace #tabs-area button[onclick="toggleVinDoubles()"].bg-purple-600 { background: var(--bet-action) !important; color: var(--game-action-ink) !important; border-color: var(--bet-action) !important; }
html body:not(.light-theme).member-authenticated #main-content #betting-workspace #bill-capture-content:not(.is-capturing-slip) #local-list .cart-item { background: var(--sc-inset) !important; border-color: var(--sc-line) !important; }
html body:not(.light-theme).member-authenticated #main-content #betting-workspace #bill-capture-content:not(.is-capturing-slip) #local-list :is(.cart-item__meta, .cart-item__numbers, .cart-item > div:nth-child(2)) { background: transparent !important; border-color: var(--sc-line) !important; }
html body:not(.light-theme).member-authenticated #main-content #betting-workspace #bill-capture-content:not(.is-capturing-slip) #local-list :is(.cart-item__meta > *, .cart-item__numbers span) { color: var(--sc-ink) !important; }
html body:not(.light-theme).member-authenticated #main-content #betting-workspace #game-footer :is(.summary-panel__market p, .summary-panel__market h2, .summary-panel__totals strong) { color: var(--sc-white) !important; }
html body:not(.light-theme).member-authenticated #main-content #betting-workspace #game-footer .summary-panel__market time { color: var(--sc-muted) !important; }
html body:not(.light-theme).member-authenticated #main-content #betting-workspace #game-footer .summary-panel__icon { background: var(--sc-inset) !important; border-color: var(--sc-line) !important; }
html body:not(.light-theme).member-authenticated #main-content #betting-workspace .restricted-panel .hhlott-number-chip { background: transparent !important; color: var(--sc-ink) !important; border-color: var(--sc-line) !important; }
html body:not(.light-theme).member-authenticated #main-content #betting-workspace :is(.quick-bet-options__heading, .history-panel__heading) :is(h2, span, select) { color: var(--sc-ink) !important; }
html body:not(.light-theme).member-authenticated #main-content #betting-workspace .quick-bet-thank-you { background: var(--sc-inset) !important; color: var(--sc-secondary) !important; border-color: var(--sc-line) !important; }
html body:not(.light-theme).member-authenticated #betting-workspace #hhlott-sync-status .text-green-400 { color: var(--sc-green) !important; }
html body:not(.light-theme).member-authenticated.mode-mobile #member-sidebar .member-sidebar__link { color: var(--sc-secondary) !important; }
html body:not(.light-theme).member-authenticated.mode-mobile #member-sidebar .member-sidebar__link.is-active { background: var(--sc-red) !important; color: var(--sc-white) !important; border-color: var(--sc-red) !important; }
html body:not(.light-theme).member-authenticated.mode-mobile #main-content .app-shell-home .home-market-chip.is-active { color: var(--sc-white) !important; }

/* Focus/hover colors only; keep all existing disabled and loading behavior. */
html body:not(.light-theme).member-authenticated #main-content :is(.app-shell-home, .app-shell-game, .app-shell-resultcheck, .app-shell-liveboard-report, .saved-results-board) :is(button, input, select, textarea):focus-visible { outline-color: var(--sc-red-hover) !important; }
@media (hover: hover) {
    html body:not(.light-theme).member-authenticated #main-content .app-shell-home .stock-card:hover { box-shadow: none !important; }
    html body:not(.light-theme).member-authenticated #main-content .app-shell-home .stock-card-open:hover { background: var(--sc-open-surface) !important; border-color: var(--sc-open-line) !important; }
    html body:not(.light-theme).member-authenticated #main-content :is(.home-market-sort, .home-market-tab.is-active, .liveboard-search-action, .result-check-action, .resultcheck-day-button.is-active, .saved-results-board button.is-active, #btn-ok, .quick-bet-add, #btn-save-firebase):hover:not(:disabled) { background: var(--sc-red-hover) !important; }
}

/* Charcoal and soft mint belong only to betting; layout remains shared with light mode. */
html body:not(.light-theme).member-authenticated:has(.app-shell-game) { --sc-page: #202020; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-game {
    --sc-section: #242424;
    --sc-card: #282828;
    --sc-inset: #303030;
    --sc-input: #2D2D2D;
    --sc-line: #383838;
    --sc-ink: #F4F4F4;
    --sc-secondary: #C1C1C1;
    --sc-muted: #999999;
    --sc-blue: #94C9A4;
    --sc-blue-soft: #303030;
    --sc-green: #8FC8A0;
    --sc-green-soft: #303030;
    --sc-gold: #C1C1C1;
    --game-action-ink: #15281B;
    --game-action-hover: #A1D6B1;
}
html body:not(.light-theme).member-authenticated #main-content #betting-workspace :is(.quick-bet-header, #tabs-area.quick-bet-entry, #game-footer, .summary-panel__card, .quick-bet-thank-you) { background: transparent !important; border-color: transparent !important; }
html body:not(.light-theme).member-authenticated #main-content #betting-workspace #bill-capture-content:not(.is-capturing-slip) #local-list .cart-item { background: var(--sc-card) !important; }
html body:not(.light-theme).member-authenticated #main-content #betting-workspace #bill-capture-content:not(.is-capturing-slip) #local-list .cart-item > div.cart-item__meta { background: transparent !important; border-color: transparent !important; }
html body:not(.light-theme).member-authenticated #main-content #betting-workspace #bill-capture-content:not(.is-capturing-slip) #local-list .cart-item__meta > :is(span, div:last-child) { color: var(--bet-action) !important; }
html body:not(.light-theme).member-authenticated #main-content #betting-workspace #bill-capture-content:not(.is-capturing-slip) #local-list .cart-item__meta > div:nth-child(3) { color: var(--sc-secondary) !important; }
html body:not(.light-theme).member-authenticated #main-content #betting-workspace .game-shell__back { background: var(--sc-inset) !important; color: var(--sc-white) !important; border-color: transparent !important; }
html body:not(.light-theme).member-authenticated #main-content #betting-workspace #bill-capture-content:not(.is-capturing-slip) #btn-save-firebase { color: var(--game-action-ink) !important; }
/* Thin inset frames keep existing box sizes and the summary below visually open. */
html body:not(.light-theme).member-authenticated #app #main-content #betting-workspace .quick-bet-header,
html body:not(.light-theme).member-authenticated #app #main-content #betting-workspace #tabs-area.quick-bet-entry,
html body:not(.light-theme).member-authenticated #app #main-content #betting-workspace #bill-capture-content:not(.is-capturing-slip) .quick-bet-list {
    border-color: transparent !important;
    outline: 1px solid #444444 !important;
    outline-offset: -1px !important;
    border-radius: 12px !important;
    box-shadow: none !important;
}
html body:not(.light-theme).member-authenticated #app #main-content #betting-workspace .quick-bet-thank-you {
    border-color: transparent !important;
    outline: 1px solid #444444 !important;
    outline-offset: -1px !important;
    border-radius: 8px !important;
}
html body:not(.light-theme).member-authenticated #app #main-content #betting-workspace #bill-capture-content:not(.is-capturing-slip) #game-footer {
    box-shadow: none !important;
}
html body:not(.light-theme).member-authenticated #app #main-content #betting-workspace #tabs-area button.quick-bet-add:disabled { background: var(--sc-inset) !important; color: var(--sc-muted) !important; border-color: var(--sc-inset) !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-game :is(button, input, select, textarea):focus-visible { outline-color: var(--sc-blue) !important; }
@media (hover: hover) {
    html body:not(.light-theme).member-authenticated #main-content #betting-workspace :is(#btn-ok, .quick-bet-add, #btn-save-firebase, .game-shell__back):hover:not(:disabled) { background: var(--game-action-hover) !important; border-color: var(--game-action-hover) !important; }
    html body:not(.light-theme).member-authenticated #main-content #betting-workspace #tabs-area :is(#btn-ok, .quick-bet-add):hover:not(:disabled) { background: var(--game-action-hover) !important; }
}

/* Market reference: emerald cards, mint timers and clear flag/name/time hierarchy. */
html body:not(.light-theme).member-authenticated:has(.app-shell-home) { --sc-page: #202423; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-home {
    --sc-open-surface: #155539;
    --sc-open-line: transparent;
    --sc-open-divider: transparent;
    --sc-open-ink: #F6FAF7;
    --sc-open-secondary: #DDEBE4;
    --sc-open-value: #F6FAF7;
    --sc-open-status: #8AF2BC;
    --sc-closed-ink: #CDD2D8;
    --sc-closed-value: #E2E6EC;
    --sc-closed-dot: #BCC3CC;
}
html body:not(.light-theme).member-authenticated #main-content .app-shell-home #home-grid .stock-card {
    border-color: transparent !important;
    border-radius: 12px !important;
    transform: none !important;
}
html body:not(.light-theme).member-authenticated #main-content .app-shell-home #home-grid .stock-card-closed { background: #2C3032 !important; }
html body:not(.light-theme).member-authenticated #main-content .app-shell-home #home-grid .stock-card__bottom { border-color: transparent !important; }
@media (min-width: 60.01rem) {
    html body:not(.light-theme).member-authenticated.mode-desktop #main-content .app-shell-home #home-grid {
        container-type: inline-size;
        display: grid !important;
        gap: 29px !important;
        padding: 40px 18px 32px 22px !important;
    }
    html body:not(.light-theme).member-authenticated.mode-desktop #main-content .app-shell-home #home-grid .stock-group { margin: 0 !important; padding: 0 !important; border: 0 !important; }
    html body:not(.light-theme).member-authenticated.mode-desktop #main-content .app-shell-home #home-grid .stock-group__header {
        min-height: 28px !important;
        height: 28px !important;
        border: 0 !important;
        margin: 0 0 12px !important;
        padding: 0 8px 0 4px !important;
        align-items: center !important;
    }
    html body:not(.light-theme).member-authenticated.mode-desktop #main-content .app-shell-home #home-grid .stock-group__title {
        font-family: "Noto Sans Thai", sans-serif !important;
        font-size: clamp(16px, 1.61cqw, 20px) !important;
        font-weight: 700 !important;
        line-height: 28px !important;
        color: #F4F5F4 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        text-shadow: none !important;
    }
    html body:not(.light-theme).member-authenticated.mode-desktop #main-content .app-shell-home #home-grid .stock-group__count { font-size: clamp(12px, 1.29cqw, 16px) !important; line-height: 24px !important; font-weight: 400 !important; color: #CDD2D8 !important; }
    html body:not(.light-theme).member-authenticated.mode-desktop #main-content .app-shell-home #home-grid .group-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: clamp(8px, 1.05cqw, 13px) 12px !important; }
    html body:not(.light-theme).member-authenticated.mode-desktop #main-content .app-shell-home #home-grid .stock-card {
        min-height: clamp(148px, 14.1cqw, 175px) !important;
        padding: clamp(10px, 1.45cqw, 18px) clamp(10px, 1.45cqw, 18px) 14px !important;
    }
    html body:not(.light-theme).member-authenticated.mode-desktop #main-content .app-shell-home #home-grid .stock-group:has(.stock-card__timer-value[id^="timer-vip_"]) .stock-card { min-height: clamp(140px, 12.9cqw, 160px) !important; }
    html body:not(.light-theme).member-authenticated.mode-desktop #main-content .app-shell-home #home-grid .stock-card__top {
        grid-template-columns: clamp(34px, 4.35cqw, 54px) minmax(0, 1fr) !important;
        gap: clamp(7px, 1.13cqw, 14px) !important;
        min-height: 48px !important;
    }
    html body:not(.light-theme).member-authenticated.mode-desktop #main-content .app-shell-home #home-grid :is(.stock-card__flag-wrap, .stock-card__flag) { width: clamp(34px, 4.35cqw, 54px) !important; height: clamp(24px, 3.06cqw, 38px) !important; border-radius: 3px !important; }
    html body:not(.light-theme).member-authenticated.mode-desktop #main-content .app-shell-home #home-grid .stock-card__identity { column-gap: 8px !important; row-gap: 0 !important; }
    html body:not(.light-theme).member-authenticated.mode-desktop #main-content .app-shell-home #home-grid .stock-card h3 {
        font-family: "Noto Sans Thai", sans-serif !important;
        font-size: clamp(12px, 1.61cqw, 20px) !important;
        font-weight: 700 !important;
        line-height: 1.4 !important;
        letter-spacing: 0 !important;
    }
    html body:not(.light-theme).member-authenticated.mode-desktop #main-content .app-shell-home #home-grid :is(.stock-card__draw-date, .stock-card__draw-time, .stock-card__detail-label, .stock-card__detail-value, .stock-card__status-value, .stock-card__status-prefix, .stock-card__timer-value) {
        font-family: "Noto Sans Thai", sans-serif !important;
        font-size: clamp(10px, 1.13cqw, 14px) !important;
        line-height: 20px !important;
    }
    html body:not(.light-theme).member-authenticated.mode-desktop #main-content .app-shell-home #home-grid :is(.stock-card__draw-date, .stock-card__detail-label, .stock-card__status-prefix) { font-weight: 400 !important; }
    html body:not(.light-theme).member-authenticated.mode-desktop #main-content .app-shell-home #home-grid :is(.stock-card__draw-time, .stock-card__detail-value, .stock-card__timer-value) { font-weight: 600 !important; }
    html body:not(.light-theme).member-authenticated.mode-desktop #main-content .app-shell-home #home-grid .stock-card__bottom { min-height: 0 !important; padding-top: 0 !important; border-top-width: 0 !important; gap: 7px !important; }
    html body:not(.light-theme).member-authenticated.mode-desktop #main-content .app-shell-home #home-grid .stock-card__detail-row { gap: 8px !important; min-height: 20px !important; line-height: 20px !important; }
    html body:not(.light-theme).member-authenticated.mode-desktop #main-content .app-shell-home #home-grid .stock-card__detail-row:last-child::after { width: 12px !important; height: 12px !important; inset-inline-start: 0; top: 50%; transform: translateY(-50%); }
    html body:not(.light-theme).member-authenticated.mode-desktop #main-content .app-shell-home #home-grid .stock-card__detail-row:last-child .stock-card__detail-label { padding-inline-start: 22px !important; }
}
