:root {
  color-scheme: light;
  font-family: "Segoe UI", Inter, Arial, sans-serif;
  font-synthesis: none;
  background: #f5f8fc;
  color: #1d2b3f;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.shell { width: min(1520px, calc(100% - 48px)); margin: 0 auto; padding: 20px 0 28px; }
.page-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 14px; }
.page-heading { min-width: 0; }
.eyebrow { display: flex; align-items: center; gap: 9px; color: #5b6f8b; font-size: 11px; font-weight: 750; letter-spacing: .12em; }
.brand-mark { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: #245fc9; color: white; font-size: 15px; letter-spacing: 0; }
.eyebrow-divider { color: #bac7da; font-size: 15px; }
.header-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 6px 10px; border: 1px solid #dfe7f2; border-radius: 9px; background: #fff; color: #51657f; font-size: 12px; font-weight: 650; white-space: nowrap; }
.theme-toggle:hover { background: #edf3fc; border-color: #a9bedc; }
.theme-toggle:focus-visible { outline: 2px solid #4b82df; outline-offset: 3px; }
.theme-icon { width: 17px; height: 17px; flex: 0 0 17px; }
.theme-toggle-track { display: inline-block; width: 28px; height: 16px; flex: 0 0 28px; border-radius: 99px; padding: 2px; background: #c8d5e7; }
.theme-toggle-track::after { content: ''; display: block; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #30446125; transition: transform .15s; }
.theme-toggle[aria-checked="true"] .theme-toggle-track { background: #6f9ef2; }
.theme-toggle[aria-checked="true"] .theme-toggle-track::after { transform: translateX(12px); }

.live-panel { display: flex; align-items: center; gap: 9px; min-height: 36px; padding: 4px 5px 4px 13px; border: 1px solid #dfe7f2; border-radius: 9px; background: #fff; color: #51657f; font-size: 12px; white-space: nowrap; box-shadow: 0 2px 8px #1e417008; }
.connection-dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; }
.connection-dot.ready { background: #16b364; box-shadow: 0 0 0 3px #dff8ea; }
.connection-dot.loading { background: #edab32; box-shadow: 0 0 0 3px #fff3da; }
.connection-dot.error { background: #d94848; box-shadow: 0 0 0 3px #ffe7e7; }
.panel-separator { width: 1px; height: 14px; background: #dce5f0; margin: 0 3px; }
.refresh-button { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: #edf3fc; color: #2c64c5; font-size: 21px; line-height: 1; }
.refresh-button:hover { background: #dfeafa; }
.refresh-button:disabled { opacity: .6; cursor: wait; }

.filters-card { padding: 14px 16px; border: 1px solid #dce5f0; border-radius: 12px; background: #fff; box-shadow: 0 5px 22px #24456a08; }
.filter-grid { display: grid; grid-template-columns: minmax(120px, .75fr) minmax(190px, 1.5fr) minmax(140px, .9fr) minmax(130px, .85fr) minmax(160px, 1.1fr); gap: 12px; align-items: end; }
.field, .sort-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field > span, .sort-field > span, .window-caption { color: #66768a; font-size: 11px; line-height: 1; text-transform: uppercase; letter-spacing: .065em; font-weight: 800; }
.field input, .field select, .sort-field select { width: 100%; height: 36px; padding: 0 12px; border: 1px solid #dce4ee; border-radius: 7px; outline: none; color: #26354a; background: #fff; font-size: 13px; }
.field input:focus, .field select:focus, .sort-field select:focus { border-color: #4b82df; box-shadow: 0 0 0 3px #dceafd; }
.field input::placeholder { color: #a1adba; }
#dateFilter { cursor: pointer; }
.window-picker { display: flex; align-items: center; gap: 10px; }
.window-caption { white-space: nowrap; }
.segment { display: inline-flex; height: 36px; padding: 2px; border: 1px solid #dce5f0; border-radius: 8px; background: #f2f5fa; }
.segment button { padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: #546781; font-size: 12px; font-weight: 750; text-transform: uppercase; }
.segment button.active { background: #2864ce; color: #fff; box-shadow: 0 2px 6px #2864ce38; }

.error-banner { margin: 16px 0 0; padding: 12px 15px; border: 1px solid #ffd3cf; border-radius: 8px; background: #fff0ee; color: #9a312c; font-size: 13px; }
.potential-notice { margin: 16px 0 0; padding: 12px 15px; border: 1px solid #d7e5fc; border-radius: 8px; background: #eff5ff; color: #345779; font-size: 13px; line-height: 1.5; }
.results-section { margin-top: 16px; }
.results-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.results-info { flex: 1 1 220px; min-width: 0; }
.results-count { color: #34455e; font-size: 14px; font-weight: 700; }
.results-note { margin-top: 5px; color: #7d8ba0; font-size: 12px; }
.fact-summary { flex: 0 1 625px; min-width: 540px; font-variant-numeric: tabular-nums; }
.fact-summary-grid { display: grid; grid-template-columns: .8fr .9fr 1.85fr 2fr; gap: 8px; }
.summary-card { display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 9px 10px; border: 1px solid #dce5f0; border-radius: 9px; background: #fff; }
.summary-caption { color: #66768a; font-size: 10px; font-weight: 750; }
.summary-value { color: #28579b; font-size: 21px; line-height: 1.1; }
.summary-card.success .summary-value { color: #166534; }
.summary-card.failure .summary-value { color: #991b1b; }
.summary-card.share { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; }
.summary-share-metric { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.summary-mood { align-self: center; width: 32px; font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; font-size: 30px; line-height: 1; }
.summary-share-value { display: flex; flex-wrap: wrap; align-items: baseline; gap: 7px; }
.summary-share-value > span { color: #6d7d93; font-size: 11px; white-space: nowrap; }
.summary-note { margin-top: 5px; color: #7d8ba0; font-size: 11px; }
.trend { min-width: 0; gap: 2px; }
.trend-caption, .trend-range { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.trend-status, .trend-range { color: #7d8ba0; font-size: 9px; white-space: nowrap; }
.trend-chart { display: block; width: 100%; height: 37px; overflow: visible; }
.trend-grid { stroke: #e6edf7; stroke-width: 1; stroke-dasharray: 3 3; }
.trend-line { fill: none; stroke: #2e68cf; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.trend-point { fill: #fff; stroke: #2e68cf; stroke-width: 1.6; }
.trend-point.selected { fill: #2e68cf; stroke-width: 2; }
.trend-value { fill: #4b6280; font-size: 9px; text-anchor: middle; pointer-events: none; }
.trend-empty { fill: #8795a9; font-size: 11px; text-anchor: middle; }
.sort-field { flex: 0 0 170px; }
.sort-field select { height: 34px; background: #fff; }

.stake-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-bottom: 10px; padding: 10px 12px; border: 1px solid #dce5f0; border-radius: 9px; background: #fff; font-size: 12px; color: #65768c; }
.budget-field { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.budget-field select { height: 32px; width: 105px; padding: 0 8px; border: 1px solid #dce4ee; border-radius: 7px; color: #26354a; background: #fff; cursor: pointer; }
.stake-switch { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 32px; cursor: pointer; color: #405874; font-weight: 700; }
.stake-switch input { position: absolute; width: 42px; height: 24px; margin: 0; opacity: 0; cursor: pointer; }
.switch-track { width: 42px; height: 24px; border-radius: 99px; background: #c8d5e7; padding: 3px; }
.switch-track::after { content: ''; display: block; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #30446125; transition: transform .15s; }
.stake-switch input:checked + .switch-track { background: #2864ce; }
.stake-switch input:checked + .switch-track::after { transform: translateX(18px); }
.stake-switch input:focus-visible + .switch-track { outline: 2px solid #4b82df; outline-offset: 3px; }
.view-switches { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding-left: 18px; border-left: 1px solid #dce5f0; }
.view-switches .stake-switch { white-space: nowrap; }
.view-switches .switch-track { flex: 0 0 42px; }
@media (max-width: 600px) {
  .view-switches { width: 100%; padding: 8px 0 0; border-left: 0; border-top: 1px solid #dce5f0; }
}
:root[data-theme="dark"] .view-switches { border-color: var(--dark-border); }
.stake-win-total { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px 16px; margin-left: auto; text-align: right; font-variant-numeric: tabular-nums; }
.stake-win-total strong { color: #16814d; font-size: 15px; }
.stake-result-item { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.stake-settled-totals { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px 16px; }
.stake-settled-totals[hidden] { display: none; }
.stake-settled-loss strong { color: #28579b; }

.table-frame { border: 1px solid #dce5f0; border-radius: 11px; background: #fff; box-shadow: 0 5px 22px #24456a08; }
/* v9: одна вертикальная прокрутка страницы, без отдельного скролла таблицы. */
.table-scroll { min-height: 280px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.bets-table { min-width: 0; table-layout: fixed; font-size: clamp(11px, .95vw, 12.5px); }
.bets-table .col-fixture { width: 5%; }
.bets-table .col-match { width: 20%; }
.bets-table .col-signal, .bets-table .col-lineup { width: 5%; }
.bets-table .col-bookmaker, .bets-table .col-fact { width: 6%; }
.bets-table .col-market { width: 8%; }
.bets-table .col-profit { width: 9%; }
.bets-table .col-direction, .bets-table .col-potential, .bets-table .col-stake { width: 7%; }
.bets-table .col-line, .bets-table .col-odd, .bets-table .col-delta { width: 5%; }
.bets-table thead th { min-width: 0; font-size: clamp(8px, .75vw, 10px); letter-spacing: .02em; white-space: normal; }
.bets-table th.match-column { min-width: 0; }
.bets-table tbody td { min-width: 0; padding: 7px clamp(3px, .5vw, 9px); white-space: normal; overflow-wrap: anywhere; }
.bets-table td.fixture { font-size: inherit; }
.bets-table .signal-badges { flex-wrap: wrap; }
thead th { position: sticky; top: 0; z-index: 2; height: 42px; padding: 0 12px; border-bottom: 1px solid #dce5f0; background: #f7f9fc; color: #65768c; font-size: 10px; font-weight: 800; letter-spacing: .045em; text-align: left; text-transform: uppercase; white-space: nowrap; }
thead th.match-column { min-width: 300px; }
thead th.number, td.number { text-align: center; }
thead th.center, td.center { text-align: center; }
thead th[data-sort] { padding: 0; }
.column-sort { display: flex; align-items: center; justify-content: flex-start; gap: 3px; width: 100%; height: 100%; min-height: 42px; padding: 4px clamp(3px, .5vw, 9px); border: 0; background: transparent; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; white-space: normal; text-align: inherit; }
.sort-label { min-width: 0; overflow-wrap: anywhere; }
thead th.number .column-sort, thead th.center .column-sort { justify-content: center; }
.column-sort:hover { background: #2864ce12; }
.column-sort:focus-visible { outline: 2px solid #4b82df; outline-offset: -2px; }
.sort-arrow { flex: 0 0 9px; color: #2864ce; font-size: 12px; }
.sort-arrow:empty { display: none; }
thead th[aria-sort="ascending"] .column-sort, thead th[aria-sort="descending"] .column-sort { color: #2864ce; }
tbody td { height: 43px; padding: 6px 12px; border-bottom: 1px solid #e9edf3; color: #2b394e; background: #fff; white-space: nowrap; }
tbody tr:hover td:not(.delta) { background: #f7faff; }
tbody tr:last-child td { border-bottom: 0; }
td.fixture { color: #60718a; font-size: 12px; }
td.match-cell { min-width: 300px; font-weight: 600; color: #29384d; }
td.market-cell { color: #45566e; }
td.bookmaker-cell { color: #405874; font-weight: 600; }
td.lineup-status { font-size: 17px; }
td.potential { font-weight: 700; }
td.fact { font-weight: 700; }
td.win-profit { min-width: 115px; font-weight: 700; color: #8996a8; }
td.win-profit.assigned { color: #16814d; }
td.stake { min-width: 105px; font-weight: 700; color: #8996a8; }
td.stake.assigned { color: #28579b; background: #f0f5ff; }
.direction, .fact-badge { display: inline-block; padding: 3px 8px; border-radius: 99px; font-size: 11px; font-weight: 750; }
.fact-badge { font-size: inherit; }
.direction.over { background: #e7f0ff; color: #2660b5; }
.direction.under { background: #fff0e5; color: #a45b25; }
.fact-badge.won { background: #dcfce7; color: #166534; }
.fact-badge.lost { background: #fee2e2; color: #991b1b; }
.fact-badge.neutral, .fact-badge.pending { background: #f7f9fc; color: #65768c; }
td.delta { min-width: 95px; font-weight: 750; }
td.delta.positive { background: #eafaf3; color: #16814d; }
td.delta.negative { background: #fff0f2; color: #b74a57; }
td.delta.neutral { background: #f7f9fc; color: #65768c; }
td.delta.missing { color: #9ca9ba; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 270px; color: #7c8ca1; font-size: 13px; }
.empty-state strong { color: #40516a; font-size: 15px; }
.empty-symbol { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 5px; border-radius: 50%; background: #eff4fb; color: #5c79a7; font-size: 25px; }

@media (max-width: 1080px) {
  .page-header { flex-wrap: wrap; gap: 12px; }
  .header-actions { margin-left: auto; }
  .filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .results-info { flex-basis: 100%; }
  .fact-summary { flex: 1 1 625px; }
  .window-picker { gap: 7px; }
  .window-caption { font-size: 10px; }
}
/* На узких экранах строки становятся карточками: ни одно поле не скрывается. */
@media (max-width: 1000px) {
  .bets-table, .bets-table thead, .bets-table tbody { display: block; width: 100%; }
  .bets-table colgroup { display: none; }
  .bets-table thead { position: sticky; top: 0; z-index: 2; background: #f7f9fc; }
  .bets-table thead tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 4px; }
  .bets-table thead th { display: block; position: static; height: auto; border: 0; font-size: 10px; }
  .bets-table .column-sort { justify-content: center; min-height: 34px; border-radius: 5px; }
  .bets-table tbody tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 8px solid #eef3fa; }
  .bets-table tbody td { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; height: auto; min-height: 57px; padding: 8px; text-align: center; font-size: 12px; }
  .bets-table tbody td::before { content: attr(data-label); font-size: 9px; font-weight: 650; color: #65768c; line-height: 1.2; }
  .bets-table td.match-cell { order: -1; grid-column: 1 / -1; align-items: flex-start; text-align: left; }
  .bets-table td.lineup-status { font-size: 17px; }
}
@media (max-width: 760px) {
  .shell { width: calc(100% - 32px); }
  .page-header { flex-wrap: wrap; gap: 10px; }
  .live-panel { margin-left: auto; }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.signal-column { min-width: 64px; }
.signal-badges { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px; }
.signal-badge, .signal-inactive { cursor: pointer; border-radius: 7px; min-width: 30px; min-height: 30px; padding: 3px 6px; }
.signal-badge { font-size: 20px; line-height: 1; border: 1px solid #e6c864; background: #fff6cc; }
.signal-badge:hover, .signal-badge:focus-visible { background: #ffed99; outline: 2px solid #ab8300; }
.signal-inactive { background: transparent; color: #8490a4; border: 1px solid transparent; }
.signal-inactive:hover, .signal-inactive:focus-visible { border-color: #c5cfdf; background: #f0f4fa; }
.signal-overlay { position: fixed; inset: 0; z-index: 1000; background: rgb(17 30 49 / 48%); padding: 3vh 3vw; display: flex; align-items: center; justify-content: center; }
.signal-overlay[hidden] { display: none; }
.signal-dialog { max-width: 900px; width: 100%; max-height: 90vh; overflow: auto; padding: 22px; background: #fff; border-radius: 14px; box-shadow: 0 12px 45px #152b4a55; }
.signal-dialog-header { display: flex; align-items: center; gap: 20px; justify-content: space-between; }
.signal-dialog h2 { font-size: 19px; margin: 0; }
.signal-dialog-header button { cursor: pointer; font-size: 19px; background: #eff3fa; border: 0; border-radius: 6px; padding: 8px 13px; }
.signal-dialog p { margin: 12px 0; line-height: 1.5; }
.signal-verdict { font-weight: 700; }
.signal-match-title { color: #295a94; }
.signal-warning { color: #697a92; font-size: 12px; }
.signal-sample-wrap { overflow-x: auto; max-height: 42vh; }
.signal-sample-wrap table { width: 100%; min-width: 550px; }
.signal-sample-wrap td, .signal-sample-wrap th { padding: 8px; font-size: 12px; white-space: normal; }
@media (max-width: 600px) {
  .shell { width: calc(100% - 22px); padding-top: 18px; }
  .page-header { margin-bottom: 18px; }
  .header-actions { width: 100%; justify-content: flex-start; }
  .live-panel { width: 100%; margin-left: 0; justify-content: space-between; }
  .filters-card { padding: 15px; }
  .filter-grid { grid-template-columns: 1fr; gap: 12px; }
  .window-picker { margin-left: auto; }
  .results-bar { align-items: start; flex-direction: column; }
  .results-info { flex: none; width: 100%; }
  .fact-summary { flex: none; width: 100%; min-width: 0; }
  .fact-summary-grid { grid-template-columns: 1fr 1fr; }
  .summary-card { padding: 9px; }
  .sort-field { flex: none; width: 100%; }
  .bets-table thead tr { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Тёмная палитра меняет только оформление; классы исходов и данные общие. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --dark-surface: #182230;
  --dark-raised: #202d3f;
  --dark-hover: #24334a;
  --dark-border: #34445c;
  --dark-text: #e1e9f5;
  --dark-muted: #a3b3c9;
  --dark-blue: #94bcff;
  --dark-green: #84e3ad;
  --dark-red: #ffb0b7;
  background: #101722;
  color: var(--dark-text);
}
:root[data-theme="dark"] .eyebrow { color: #b2c3dd; }
:root[data-theme="dark"] .eyebrow-divider { color: #697c99; }
:root[data-theme="dark"] .brand-mark { background: #326ace; }
:root[data-theme="dark"] .live-panel,
:root[data-theme="dark"] .filters-card,
:root[data-theme="dark"] .summary-card,
:root[data-theme="dark"] .stake-bar,
:root[data-theme="dark"] .table-frame,
:root[data-theme="dark"] .theme-toggle { background: var(--dark-surface); border-color: var(--dark-border); color: var(--dark-muted); box-shadow: none; }
:root[data-theme="dark"] .theme-toggle:hover { background: var(--dark-raised); border-color: #7190b9; }
:root[data-theme="dark"] .theme-toggle[aria-checked="true"] { color: var(--dark-text); }
:root[data-theme="dark"] .theme-toggle:focus-visible { outline-color: var(--dark-blue); }
:root[data-theme="dark"] .connection-dot.ready { box-shadow: 0 0 0 3px #173d31; }
:root[data-theme="dark"] .connection-dot.loading { box-shadow: 0 0 0 3px #463b20; }
:root[data-theme="dark"] .connection-dot.error { box-shadow: 0 0 0 3px #422931; }
:root[data-theme="dark"] .panel-separator { background: var(--dark-border); }
:root[data-theme="dark"] .refresh-button { background: #253955; color: var(--dark-blue); }
:root[data-theme="dark"] .refresh-button:hover { background: #30486a; }
:root[data-theme="dark"] .field > span,
:root[data-theme="dark"] .sort-field > span,
:root[data-theme="dark"] .window-caption,
:root[data-theme="dark"] .summary-caption { color: var(--dark-muted); }
:root[data-theme="dark"] .field input,
:root[data-theme="dark"] .field select,
:root[data-theme="dark"] .sort-field select,
:root[data-theme="dark"] .budget-field select { background: #131d2b; color: var(--dark-text); border-color: var(--dark-border); }
:root[data-theme="dark"] .field input:focus,
:root[data-theme="dark"] .field select:focus,
:root[data-theme="dark"] .sort-field select:focus { border-color: #89b1f9; box-shadow: 0 0 0 3px #2d4468; }
:root[data-theme="dark"] .field input::placeholder { color: #8b9eb9; }
:root[data-theme="dark"] .segment { background: #131d2b; border-color: var(--dark-border); }
:root[data-theme="dark"] .segment button { color: #b2c3dd; }
:root[data-theme="dark"] .segment button.active { background: #2d62b9; color: #fff; box-shadow: none; }
:root[data-theme="dark"] .error-banner { background: #42272c; border-color: #83515a; color: #ffc2c7; }
:root[data-theme="dark"] .potential-notice { background: #192f45; border-color: #3f5d7b; color: #bfdaef; }
:root[data-theme="dark"] .results-count,
:root[data-theme="dark"] .empty-state strong { color: var(--dark-text); }
:root[data-theme="dark"] .results-note,
:root[data-theme="dark"] .summary-note,
:root[data-theme="dark"] .summary-share-value > span,
:root[data-theme="dark"] .trend-status,
:root[data-theme="dark"] .trend-range,
:root[data-theme="dark"] .empty-state,
:root[data-theme="dark"] .signal-warning { color: var(--dark-muted); }
:root[data-theme="dark"] .summary-value { color: var(--dark-blue); }
:root[data-theme="dark"] .summary-card.success .summary-value,
:root[data-theme="dark"] .stake-win-total strong { color: var(--dark-green); }
:root[data-theme="dark"] .stake-settled-loss strong { color: var(--dark-blue); }
:root[data-theme="dark"] .summary-card.failure .summary-value { color: var(--dark-red); }
:root[data-theme="dark"] .trend-grid { stroke: var(--dark-border); }
:root[data-theme="dark"] .trend-line { stroke: var(--dark-blue); }
:root[data-theme="dark"] .trend-point { fill: var(--dark-surface); stroke: var(--dark-blue); }
:root[data-theme="dark"] .trend-point.selected { fill: var(--dark-blue); }
:root[data-theme="dark"] .trend-value,
:root[data-theme="dark"] .trend-empty { fill: var(--dark-muted); }
:root[data-theme="dark"] .stake-switch { color: #c1cfe3; }
:root[data-theme="dark"] .switch-track { background: #526581; }
:root[data-theme="dark"] .stake-switch input:checked + .switch-track { background: #326ace; }
:root[data-theme="dark"] thead th { background: var(--dark-raised); color: #b4c4db; border-color: var(--dark-border); }
:root[data-theme="dark"] .bets-table thead { background: var(--dark-raised); }
:root[data-theme="dark"] .bets-table tbody tr { border-color: var(--dark-border); }
:root[data-theme="dark"] .bets-table tbody td::before { color: var(--dark-muted); }
:root[data-theme="dark"] .sort-arrow,
:root[data-theme="dark"] thead th[aria-sort="ascending"] .column-sort,
:root[data-theme="dark"] thead th[aria-sort="descending"] .column-sort { color: var(--dark-blue); }
:root[data-theme="dark"] .column-sort:hover { background: #6f9ef21a; }
:root[data-theme="dark"] tbody td { background: var(--dark-surface); color: #d3deee; border-color: #2a394e; }
:root[data-theme="dark"] tbody tr:hover td:not(.delta) { background: var(--dark-hover); }
:root[data-theme="dark"] td.fixture { color: var(--dark-muted); }
:root[data-theme="dark"] td.match-cell { color: var(--dark-text); }
:root[data-theme="dark"] td.market-cell,
:root[data-theme="dark"] td.bookmaker-cell { color: #bdcce1; }
:root[data-theme="dark"] td.win-profit,
:root[data-theme="dark"] td.stake,
:root[data-theme="dark"] td.delta.missing { color: #93a4be; }
:root[data-theme="dark"] td.win-profit.assigned { color: var(--dark-green); }
:root[data-theme="dark"] td.stake.assigned { color: var(--dark-blue); background: #1b304d; }
:root[data-theme="dark"] .direction.over { background: #223958; color: #b3d0ff; }
:root[data-theme="dark"] .direction.under { background: #443327; color: #f2c49e; }
:root[data-theme="dark"] .fact-badge.won { background: #173d31; color: var(--dark-green); }
:root[data-theme="dark"] .fact-badge.lost { background: #422931; color: var(--dark-red); }
:root[data-theme="dark"] .fact-badge.neutral,
:root[data-theme="dark"] .fact-badge.pending,
:root[data-theme="dark"] td.delta.neutral { background: var(--dark-raised); color: var(--dark-muted); }
:root[data-theme="dark"] td.delta.positive { background: #17362b; color: var(--dark-green); }
:root[data-theme="dark"] td.delta.negative { background: #47262d; color: #ffadbb; }
:root[data-theme="dark"] .empty-symbol { background: #253955; color: var(--dark-blue); }
:root[data-theme="dark"] .signal-badge { background: #443b1d; border-color: #8c793d; }
:root[data-theme="dark"] .signal-badge:hover,
:root[data-theme="dark"] .signal-badge:focus-visible { background: #5d4d21; outline-color: #ead080; }
:root[data-theme="dark"] .signal-inactive { color: var(--dark-muted); }
:root[data-theme="dark"] .signal-inactive:hover,
:root[data-theme="dark"] .signal-inactive:focus-visible { border-color: #7190b9; background: var(--dark-raised); }
:root[data-theme="dark"] .signal-overlay { background: rgb(0 5 13 / 72%); }
:root[data-theme="dark"] .signal-dialog { background: var(--dark-surface); color: var(--dark-text); box-shadow: 0 12px 45px #0008; }
:root[data-theme="dark"] .signal-dialog-header button { background: var(--dark-raised); color: var(--dark-text); }
:root[data-theme="dark"] .signal-match-title { color: var(--dark-blue); }
@media (prefers-reduced-motion: reduce) {
  .theme-toggle-track::after, .switch-track::after { transition: none; }
}
/* Local UI/line-selection release; the numeric potential model remains v8. */
.version-badge{display:inline-block;margin-left:6px;padding:2px 6px;border:1px solid currentColor;border-radius:5px;font-size:10px;line-height:1.2;opacity:.8}

/* Локальный мобильный прототип v9 для тестовой модели v1.2. */
.filters-disclosure > summary { padding: 0 0 12px; cursor: pointer; font-size: 13px; font-weight: 700; }
@media (max-width: 760px) {
  .shell { width: calc(100% - 24px); padding-top: 12px; }
  .eyebrow { flex-wrap: wrap; gap: 6px; font-size: 10px; letter-spacing: .06em; }
  .page-header { gap: 12px; }
  .window-picker { width: 100%; justify-content: space-between; margin: 0; }
  .segment { height: 44px; }
  .segment button { min-width: 88px; }
  .header-actions { width: 100%; margin: 0; }
  .live-panel { flex: 1; width: auto; min-width: 0; padding-left: 10px; gap: 6px; flex-wrap: wrap; }
  .theme-toggle { width: 44px; padding: 6px; }
  .theme-toggle-track { display: none; }
  .refresh-button, .theme-toggle { min-width: 44px; min-height: 44px; }
  .filters-card { padding: 0 12px; }
  .filters-disclosure > summary { display: list-item; padding: 14px 0; min-height: 48px; cursor: pointer; font-size: 14px; font-weight: 700; }
  .filters-disclosure > summary:focus-visible { outline: 2px solid #4b82df; outline-offset: 2px; }
  .filters-disclosure[open] > summary { margin-bottom: 12px; border-bottom: 1px solid #dce5f0; }
  .filters-disclosure > form { padding-bottom: 14px; }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 10px; }
  .match-field, .search-field { grid-column: 1 / -1; }
  .field input, .field select, .sort-field select { height: 44px; font-size: 16px; padding: 0 8px; }
  .results-bar { gap: 14px; }
  .results-count { line-height: 1.5; }
  .results-note, .summary-note { line-height: 1.5; }
  .stake-bar { gap: 10px; padding: 12px; }
  .budget-field { width: 100%; justify-content: space-between; }
  .budget-field select { height: 44px; font-size: 16px; }
  .stake-switch { min-height: 44px; }
  .view-switches { width: 100%; display: grid; grid-template-columns: 1fr; padding: 8px 0 0; border-left: 0; border-top: 1px solid #dce5f0; gap: 0; }
  .stake-win-total, .stake-settled-totals { width: 100%; justify-content: space-between; text-align: left; margin: 0; }
  .table-frame { border: 0; background: transparent; box-shadow: none; }
  .bets-table thead { position: static; border: 1px solid #dce5f0; border-radius: 10px; margin-bottom: 12px; }
  .bets-table thead tr { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bets-table .column-sort { min-height: 44px; }
  .bets-table tbody { display: grid; gap: 12px; }
  .bets-table tbody tr { border: 1px solid #dce5f0; border-radius: 12px; background: #fff; padding: 4px; }
  .bets-table tbody td { min-width: 0; min-height: 62px; padding: 9px 5px; font-size: 13px; }
  .bets-table tbody td::before { font-size: 10px; }
  .bets-table td.match-cell { font-size: 16px; line-height: 1.4; padding: 12px 8px; min-width: 0; }
  .bets-table td.match-cell::before { display: none; }
  .bets-table td.market-cell { grid-column: span 2; }
  .bets-table td.potential, .bets-table td.delta { font-size: 16px; }
  .signal-badge, .signal-inactive { min-width: 44px; min-height: 44px; }
  .signal-dialog { padding: 14px; }
  :root[data-theme="dark"] .table-frame { background: transparent; }
  :root[data-theme="dark"] .filters-disclosure[open] > summary,
  :root[data-theme="dark"] .bets-table thead,
  :root[data-theme="dark"] .bets-table tbody tr { border-color: var(--dark-border); }
  :root[data-theme="dark"] .bets-table tbody tr { background: var(--dark-surface); }
}

/* Model navigation is private to the v1.2 document, not the stable stylesheet. */
.model-navigation { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; font-size:12px; }
.model-navigation a { padding:7px 10px; border-radius:7px; text-decoration:none; color:#28579b; font-weight:700; }
.model-navigation a.active { background:#2864ce; color:#fff; }
.model-source { margin-top:8px; font-size:11px; color:#65768c; }
:root[data-theme="dark"] .model-navigation a:not(.active), :root[data-theme="dark"] .model-source { color:var(--dark-blue); }
