/* Blue/white sportsbook-inspired density. The BIL identity and result rules are ours. */
:root {--page-bg:#eef1f5;--surface:#fff;--surface-soft:#f8faff;--ink:#122343;--muted:#5b6a80;--muted-light:#6c7a90;--line:#d6dfed;--line-soft:#e5ebf3;--primary:#143c78;--primary-dark:#081b42;--primary-soft:#e8effc;--radius-lg:5px;--radius-md:4px;--shadow:none;--result-blue:#7dd3fc;--result-green:#86efac;--result-red:#f0353b;--volume-top:#e60012;--font-ui:Arial,Helvetica,"Noto Sans CJK SC","PingFang SC","Microsoft YaHei",sans-serif;font-family:var(--font-ui);}
html {min-width:0;}
body {font-family:var(--font-ui);font-size:13px;line-height:1.45;font-variant-numeric:tabular-nums lining-nums;}
button,input,select,textarea {font-family:inherit;font-size:13px;}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible {outline:2px solid #188fc5;outline-offset:3px;}
.app-header {height:58px;background:var(--primary-dark);box-shadow:none;}
.header-inner,.primary-nav-inner,.page-shell {width:calc(100% - 32px);max-width:1800px;}
.header-inner {justify-content:space-between;}
.brand-logo {display:block;flex-shrink:0;width:44px;height:44px;object-fit:contain;border-radius:4px;}
.product-brand .brand-logo {background:#fff;}
.login-card .login-logo {width:88px;height:88px;margin-bottom:12px;}
.app-header .brand-copy {display:flex;align-items:flex-end;gap:10px;white-space:nowrap;}
.brand-copy strong {font-size:18px;letter-spacing:1px;font-weight:700;}
.brand-copy small {font-size:11px;letter-spacing:.5px;color:#b8c9e5;}
.header-context {font-size:12px;gap:16px;}
.header-tagline {color:#b8c9e5;}
.primary-nav {top:58px;background:#102950;border-color:#284065;}
.primary-nav-inner {height:40px;gap:0;}
.primary-nav a {min-width:108px;margin:0;border:0;border-radius:0;background:transparent;box-shadow:none;color:#d3deef;font-size:14px;font-weight:600;}
.primary-nav a:hover,.primary-nav a:active {transform:none;box-shadow:none;background:#1c3967;color:#fff;}
.primary-nav a.active {transform:none;background:#fff;color:var(--primary-dark);border-top:3px solid #26bed6;box-shadow:none;}
.page-shell {padding:12px 0 18px;min-width:0;}
.toolbar-card,.research-filters,.panel-card,.comparison-panel,.research-result-card {border-radius:4px;box-shadow:none;}
.toolbar-card {padding:10px 12px;gap:14px;min-height:66px;flex-wrap:wrap;}
.date-field input {height:34px;min-height:34px;border-radius:3px;}
.date-field label,.toolbar-status span {font-size:12px;}
.quick-date,.filter-collapse,.export-excel,.research-action,.plan-button,.league-picker-trigger,.filter-choice,.league-picker-actions button {border-radius:3px;box-shadow:none;min-height:32px;font-size:13px;font-weight:600;transition:background .12s;}
.quick-date:hover,.quick-date:active,.filter-collapse:hover,.filter-collapse:active,.export-excel:hover:not(:disabled),.export-excel:active:not(:disabled) {transform:none;box-shadow:none;}
.primary-query,.research-action,.plan-button:not(.secondary) {background:var(--primary);color:#fff;border-color:var(--primary);}
.filter-choice.active,.quick-date.active {background:var(--primary-soft);color:var(--primary);box-shadow:none;transform:none;}
.data-freshness {flex-wrap:wrap;gap:4px 18px;font-size:11px;padding:7px 2px;}
.research-filters {margin-bottom:8px;align-items:center;}
/* Match/history filters: one compact controls row, with notes inside its card. */
.research-filter-panel .toolbar-card {display:block;min-height:0;padding:1px 10px;border-radius:4px 4px 0 0;}
.research-filter-panel .date-controls {display:flex;align-items:center;flex-wrap:wrap;gap:2px 14px;min-width:0;}
.research-filter-panel .date-field {display:flex;align-items:center;gap:6px;flex:0 1 auto;min-width:0;}
.research-filter-panel .date-field label {white-space:nowrap;}
.research-filter-panel .date-field input {width:140px;min-width:0;min-height:26px;height:26px;padding:2px 6px;}
.research-filter-panel .history-query-column {display:grid;align-self:start;gap:5px;min-width:0;}
.research-filter-panel .history-advanced-field {display:flex;align-items:flex-start;gap:6px;min-width:0;}
.research-filter-panel .history-advanced-field > label {min-width:max-content;padding-top:4px;color:var(--muted);font-size:12px;line-height:18px;white-space:nowrap;}
.research-filter-panel .team-filter-control {display:grid;gap:5px;min-width:0;}
.research-filter-panel .team-filter-inputs {display:grid;gap:4px;min-width:0;}
.research-filter-panel .team-filter-row {position:relative;display:grid;grid-template-columns:140px 26px;gap:4px;min-width:0;}
.research-filter-panel .team-filter-input,
.research-filter-panel #historyTimeRange,
.research-filter-panel .weekday-picker-trigger {width:140px;min-width:0;min-height:26px;height:26px;padding:2px 6px;border:1px solid #bfd0da;border-radius:3px;background:#fff;color:var(--ink);outline:none;}
.research-filter-panel .team-filter-input:focus,
.research-filter-panel #historyTimeRange:focus,
.research-filter-panel .weekday-picker-trigger:focus {border-color:var(--primary);box-shadow:0 0 0 2px rgba(36,127,174,.11);}
.research-filter-panel .team-filter-add,
.research-filter-panel .team-filter-remove {display:grid;width:26px;height:26px;place-items:center;padding:0;border:1px solid #b8cbd7;border-radius:3px;background:#f4f8fa;color:var(--primary-dark);cursor:pointer;font-size:18px;font-weight:700;line-height:1;}
.research-filter-panel .team-filter-remove {font-size:15px;}
.research-filter-panel .team-filter-add:hover,
.research-filter-panel .team-filter-remove:hover {border-color:var(--primary);background:var(--primary-soft);}
.research-filter-panel .team-filter-suggestions {position:absolute;top:29px;left:0;z-index:80;width:140px;max-height:190px;overflow-y:auto;border:1px solid #b8cbd7;border-radius:3px;background:#fff;box-shadow:0 8px 20px rgba(16,24,40,.16);}
.research-filter-panel .team-filter-suggestions[hidden] {display:none;}
.research-filter-panel .team-filter-suggestions button {display:block;width:100%;padding:6px 8px;border:0;border-bottom:1px solid var(--line-soft);background:#fff;color:var(--ink);cursor:pointer;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.research-filter-panel .team-filter-suggestions button:last-child {border-bottom:0;}
.research-filter-panel .team-filter-suggestions button:hover,
.research-filter-panel .team-filter-suggestions button:focus {background:var(--primary-soft);color:var(--primary-dark);outline:0;}
.research-filter-panel .simultaneous-filter {display:flex;align-items:center;gap:5px;min-height:22px;color:var(--primary-dark);cursor:pointer;font-size:12px;font-weight:600;white-space:nowrap;}
.research-filter-panel .simultaneous-filter[hidden] {display:none;}
.research-filter-panel .simultaneous-filter input {width:15px;height:15px;margin:0;accent-color:var(--primary);}
.research-filter-panel .history-weekday-filter[hidden] {display:none;}
.research-filter-panel .weekday-picker-wrap {position:relative;min-width:0;}
.research-filter-panel .weekday-picker-trigger {position:relative;padding-right:23px;cursor:pointer;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.research-filter-panel .weekday-picker-trigger::after {content:'▾';position:absolute;right:7px;top:2px;color:var(--muted);font-size:12px;line-height:20px;}
.research-filter-panel .weekday-picker {position:absolute;top:29px;left:0;z-index:90;width:170px;border:1px solid #b8cbd7;border-radius:3px;background:#fff;box-shadow:0 8px 20px rgba(16,24,40,.16);}
.research-filter-panel .weekday-picker[hidden] {display:none;}
.research-filter-panel .weekday-picker-options {display:grid;padding:4px 0;}
.research-filter-panel .weekday-picker-options label {display:flex;align-items:center;gap:7px;min-height:27px;padding:3px 9px;color:var(--ink);cursor:pointer;font-size:12px;}
.research-filter-panel .weekday-picker-options label:hover {background:var(--primary-soft);}
.research-filter-panel .weekday-picker-options input {width:15px;height:15px;margin:0;accent-color:var(--primary);}
.research-filter-panel .weekday-picker-actions {display:flex;justify-content:flex-end;gap:5px;padding:5px 7px;border-top:1px solid var(--line-soft);}
.research-filter-panel .weekday-picker-actions button {min-height:24px;padding:2px 8px;border:1px solid #b8cbd7;border-radius:3px;background:#f4f8fa;color:var(--primary-dark);cursor:pointer;font-size:12px;}
.history-analysis-button {min-height:28px;padding:4px 13px;border:1px solid #176f9f;border-radius:4px;background:#176f9f;color:#fff;cursor:pointer;font-size:12px;font-weight:700;}
.history-analysis-button:hover {background:#125d86;}
.history-analysis-button:disabled {cursor:not-allowed;opacity:.5;}
@media(min-width:761px) {
  body[data-page-mode="history"] {
    height:100dvh;min-height:0;display:flex;flex-direction:column;overflow:hidden;
  }
  body[data-page-mode="history"] > :is(.app-header,.primary-nav) {flex:none;}
  body[data-page-mode="history"] #research-content {
    display:flex;flex:1;min-height:0;flex-direction:column;padding-bottom:0;
  }
  body[data-page-mode="history"] #researchFilterPanel {flex:none;}
  body[data-page-mode="history"] #panel-schedule {
    display:flex;flex:1;min-height:0;flex-direction:column;
  }
  body[data-page-mode="history"] #panel-schedule > .matches-card {
    display:flex;flex:1;min-height:0;flex-direction:column;overflow:hidden;padding-bottom:0;
  }
  body[data-page-mode="history"] #panel-schedule > .matches-card > .section-heading {flex:none;}
  body[data-page-mode="history"] #matchList {
    flex:1;min-height:0;height:auto;border-bottom:0;border-radius:3px 3px 0 0;
  }
  body[data-page-mode="history"] .research-filter-panel .history-date-controls {
    display:grid;grid-template-columns:max-content max-content max-content max-content;
    align-items:start;justify-content:start;gap:5px 14px;width:100%;
  }
  body[data-page-mode="history"] .history-date-controls .history-query-column {display:contents;}
  body[data-page-mode="history"] .history-start-column .date-field {grid-column:1;grid-row:1;justify-self:start;}
  body[data-page-mode="history"] .history-end-column .date-field {grid-column:2;grid-row:1;justify-self:start;}
  body[data-page-mode="history"] .history-time-filter {grid-column:3;grid-row:1;justify-self:start;}
  body[data-page-mode="history"] .history-weekday-filter {grid-column:4;grid-row:1;justify-self:start;}
  body[data-page-mode="history"] .history-team-filter {grid-column:1;grid-row:2;justify-self:start;}
  body[data-page-mode="history"] .history-league-actions {grid-column:2 / 5;grid-row:2;display:flex;align-items:flex-start;justify-self:start;gap:8px;min-width:0;}
  body[data-page-mode="history"] .history-inline-league {align-self:start;}
  body[data-page-mode="history"] .history-query-action {flex:none;}
  body[data-page-mode="history"] .history-query-action #queryResearch {width:52px;padding-inline:6px;}
  body[data-page-mode="history"] .history-toolbar-status {align-self:center;margin-left:0;}
  body[data-page-mode="history"] #freshnessHelp {grid-column:4;grid-row:3;align-self:center;justify-self:end;}
  body[data-page-mode="history"] .match-title-actions > :is(#analyzeHistoryTeams,#exportResearchExcel,#toggleResearchFilters) {
    width:92px;height:32px;min-height:32px;padding:4px 8px;line-height:22px;
  }
}
@media(min-width:761px) and (max-width:999px) {
  body[data-page-mode="history"] .research-filter-panel .history-date-controls {grid-template-columns:minmax(0,1fr) minmax(0,1fr);}
  body[data-page-mode="history"] .history-start-column .date-field {grid-column:1;grid-row:1;}
  body[data-page-mode="history"] .history-end-column .date-field {grid-column:2;grid-row:1;}
  body[data-page-mode="history"] .history-time-filter {grid-column:1;grid-row:2;justify-self:start;}
  body[data-page-mode="history"] .history-weekday-filter {grid-column:2;grid-row:2;}
  body[data-page-mode="history"] .history-team-filter {grid-column:1;grid-row:3;}
  body[data-page-mode="history"] .history-league-actions {grid-column:2;grid-row:3;max-width:100%;flex-wrap:wrap;}
  body[data-page-mode="history"] #freshnessHelp {grid-column:2;grid-row:5;justify-self:start;}
}
.history-team-analysis-dialog {width:min(860px,calc(100vw - 32px));height:min(82dvh,760px);max-height:min(82dvh,760px);padding:0;overflow:hidden;}
.history-team-analysis-dialog[open] {display:flex;flex-direction:column;}
.history-team-analysis-dialog > .dialog-heading {position:sticky;top:0;z-index:2;flex:none;padding:14px 18px;border-bottom:1px solid var(--line);background:#fff;}
.history-team-analysis-content {display:grid;flex:1;min-height:0;gap:12px;max-height:none;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding:14px 18px 18px;}
.history-analysis-scope {margin:0;padding:9px 11px;border-radius:4px;background:#e7f2f8;color:#355467;font-size:12px;line-height:1.6;}
.history-analysis-period {padding:12px;border:1px solid var(--line);border-radius:4px;background:#fff;}
.history-analysis-period h3 {margin:0 0 9px;color:var(--primary-dark);font-size:16px;}
.history-analysis-team {padding:9px 0;border-top:1px solid var(--line-soft);}
.history-analysis-team:first-of-type {border-top:0;}
.history-analysis-team h4 {margin:0 0 5px;font-size:14px;}
.history-analysis-team p {margin:3px 0;color:var(--ink);font-size:13px;line-height:1.6;}
.history-analysis-team strong {color:var(--primary-dark);}
.history-analysis-patterns {margin:0 0 8px;padding:9px 10px;border-radius:4px;background:var(--primary-soft);font-size:13px;}
.history-analysis-patterns > strong {color:var(--primary-dark);}
.history-analysis-patterns p {margin:4px 0;line-height:1.55;}
.history-analysis-signal {font-weight:650;}
.history-analysis-highlights {padding:12px;border-left:4px solid var(--primary);border-radius:3px;background:#f4f8fa;}
.history-analysis-highlights h3 {margin:0 0 7px;font-size:15px;}
.history-analysis-highlights ol {margin:0;padding-left:22px;}
.history-analysis-highlights li {margin:5px 0;line-height:1.55;}
.history-analysis-league-highlights {display:grid;gap:10px;}
.history-analysis-league-conclusion {padding:9px 10px;border:1px solid var(--line);border-radius:4px;background:#fff;}
.history-analysis-league-conclusion h4 {margin:0 0 5px;color:var(--primary-dark);font-size:14px;}
.history-analysis-league-conclusion p {margin:0 0 5px;color:var(--ink);font-size:13px;line-height:1.55;}
.history-analysis-league-conclusion ul {margin:0;padding-left:20px;}
.history-analysis-league-conclusion li {margin:3px 0;}
.history-analysis-evidence-heading {margin:2px 0 -3px;color:var(--primary-dark);font-size:15px;}
.history-analysis-caution {margin:0;color:var(--muted);font-size:12px;line-height:1.55;}
.research-filter-panel .quick-date {min-height:26px;padding:2px 10px;line-height:20px;}
.research-filter-panel .toolbar-status {display:flex;align-items:center;flex-wrap:wrap;gap:2px 6px;width:auto;min-width:0;}
.research-filter-panel .toolbar-status strong {font-size:12px;overflow-wrap:anywhere;}
.research-filter-panel .data-freshness {display:flex;flex-wrap:wrap;gap:0 12px;padding:0;font-size:11px;line-height:14px;}
.research-filter-panel .data-freshness > span {min-width:0;overflow-wrap:anywhere;}
.research-filter-panel .research-filters {margin:0;padding:5px 10px;border-top:0;border-radius:0;}
.research-filter-panel + #panel-schedule {padding-top:0;}
.research-filter-panel:not([hidden]) + #panel-schedule > .matches-card {border-top:0;border-radius:0 0 4px 4px;}
@media(max-width:760px) {
  .research-filter-panel .date-controls {gap:4px 8px;}
  .research-filter-panel .date-field {flex:1 1 calc(50% - 4px);}
  .research-filter-panel .date-field input {width:0;flex:1 1 auto;}
  .research-filter-panel .toolbar-status {flex:1 1 210px;}
  .research-filter-panel .toolbar-card {padding:4px 8px;}
}
.league-picker {border-radius:4px;max-width:calc(100vw - 36px);left:0;}
.panel-card {padding:12px;}
.section-heading,.match-title-actions {align-items:center;gap:8px;}
.section-heading {margin-bottom:10px;flex-wrap:wrap;}
.section-heading h2,.match-title-actions h2 {font-size:16px;font-weight:700;}
.matches-card .section-heading > div {min-width:0;}
.match-title-actions .match-range-date {margin:0;text-align:left;max-width:100%;overflow-wrap:anywhere;}
.workspace-heading {min-height:0;align-items:center;margin:0 0 10px;gap:10px;}
.workspace-heading h1,.conclusions-shell h1 {font-size:20px;}
.workspace-heading .eyebrow {display:none;}
.workspace-heading p {font-size:12px;}
.match-list {min-height:0;height:var(--match-list-height,65dvh);max-height:none;overflow-y:auto;overflow-x:auto;gap:0;border:1px solid var(--line);border-radius:3px;}
.match-row,.with-predictions .match-row {grid-template-columns:48px 60px minmax(200px,2fr) minmax(108px,1fr) minmax(108px,1fr) minmax(330px,2.5fr);gap:4px;border:0;border-bottom:1px solid var(--line-soft);border-radius:0;min-height:56px;padding:7px 8px;background:#fff;font-size:13px;}
.with-predictions .match-row {grid-template-columns:44px 58px minmax(180px,2fr) minmax(104px,1fr) minmax(104px,1fr) minmax(295px,2.5fr) 52px;}
.match-row:hover {background:#f4f7fd;}
.match-row.header {min-height:34px;background:#e9eff9;color:#344b6f;font-size:12px;}
.match-day-title {top:34px;background:var(--primary-dark);color:#fff;padding:7px 10px;font-size:13px;}
.interval-section-title {padding:6px 10px;background:#edf2fa;color:var(--primary);border-bottom:1px solid var(--line);font-size:13px;}
.matchup-group {max-width:none;grid-template-columns:minmax(0,1fr) 32px minmax(0,1fr);gap:3px;}
.matchup-group > .match-team {font-size:14px;font-weight:600;white-space:nowrap;overflow-wrap:normal;line-height:1.4;min-width:0;overflow:visible;}
.matchup-group > .match-team:last-child {text-align:right;}
.team-label,.detail-team-name {display:block;min-width:0;white-space:nowrap;}
.matchup-group.expanded-names {grid-template-columns:minmax(0,1fr);}
.matchup-group.expanded-names > .match-team {text-align:center;}
.match-score {font-size:14px;font-weight:700;}
.match-odds {max-width:126px;grid-template-columns:repeat(3,minmax(0,1fr));gap:2px;}
.match-odds > span,.opening-choice {min-width:0;font-size:14px;font-weight:600;line-height:30px;padding:0 2px;border-radius:2px;background:#e8effc;color:#17396b;}
.opening-choice {border:1px solid #d5e0f7;}
.opening-odds .result-green,.opening-choice.selected-minimum {background:var(--result-green);color:#14532d;}
.opening-odds .result-blue {background:var(--result-blue);color:#0c4a6e;}
.opening-odds .result-red,.opening-choice.selected-other {background:var(--result-red);color:#fff;}
.final-odds .result-green,.detail-table td.result-green {background:var(--result-green);color:#14532d;}
.final-odds .result-blue,.detail-table td.result-blue {background:var(--result-blue);color:#0c4a6e;}
.final-odds .result-red,.detail-table td.result-red {background:var(--result-red);color:#fff;}
.opening-choice[aria-pressed=true] {outline:1px solid currentColor;outline-offset:-3px;}
.market-triplet {display:flex;flex-wrap:wrap;max-width:none;gap:4px;font-size:12px;}
.market-triplet > span {flex:1 1 calc(33.333% - 3px);min-width:max-content;overflow:visible;text-overflow:clip;white-space:nowrap;}
.market-total {font-size:13px;}
.market-total-top {background:var(--volume-top);border-radius:2px;padding:2px 5px;box-shadow:none;}
.market-detail-link {font-size:12px;margin-left:6px;}
.league-pill,.league-badge {font-size:11px;font-weight:600;line-height:18px;padding:2px 5px;min-width:40px;border-radius:2px;box-shadow:none;}
.league-badge.league-england,.league-england-red {background:var(--result-red);}
.game-card-grid {gap:8px;margin-bottom:10px;}
.game-card,body.sfc-mode .game-card {min-height:58px;padding:10px 12px;border-radius:4px;box-shadow:none;display:grid;grid-template-columns:auto 1fr;align-items:center;gap:3px 12px;}
.game-card span,.game-card strong {font-size:15px;font-weight:600;}
.game-card span {color:var(--result-red);}
.game-card small {grid-column:1 / -1;font-size:11px;}
.game-card.active {border-color:var(--primary);background:#edf3ff;box-shadow:inset 3px 0 var(--primary);}
.plan-match-header {top:98px;background:#e9eff9;font-size:12px;min-height:34px;}
.plan-match-header,.plan-match-row {--columns:30px minmax(116px,140px) minmax(0,1fr) minmax(0,1fr) 44px;}
.plan-match-row {font-size:13px;}
.panel-card.plan-builder {padding:0;}
.selection-cell {background:#e8effc;color:#143c78;padding:7px 8px;gap:5px;min-height:50px;}
.selection-cell:hover {background:#d8e5ff;}
.selection-cell:has(input:checked) {background:var(--primary-dark);color:#fff;box-shadow:inset 0 -3px #27bdd6;}
.selection-cell:has(input:checked) .cell-odds,.selection-cell:has(input:checked) .team-name {color:#fff;}
.selection-cell:has(input:focus-visible) {outline:2px solid #1292bd;outline-offset:-3px;}
.team-name {font-family:var(--font-ui);font-size:14px;font-weight:600;line-height:1.4;}
.cell-odds {font-family:var(--font-ui);font-size:14px;font-weight:600;}
.selection-cell.away .cell-team {text-align:right;justify-content:flex-end;}
.selection-cell.stacked-contents {grid-template-columns:minmax(0,1fr);gap:2px;}
.selection-cell.stacked-contents .cell-team {grid-column:1;grid-row:1;}
.selection-cell.stacked-contents .cell-odds {grid-column:1;grid-row:2;text-align:right;}
.match-meta > .match-code {grid-column:1;grid-row:1;}
.match-meta > .league-badge {grid-column:2;grid-row:1;}
.plan-match-row.jc .match-meta {grid-template-columns:minmax(0,1fr) auto;}
.plan-match-row.jc .match-meta > .match-time {grid-column:1 / -1;grid-row:2;}
.plan-match-row.sfc .match-meta {grid-template-columns:24px 44px minmax(0,1fr);gap:3px;}
.plan-match-row.sfc .match-meta > .match-time {grid-column:3;grid-row:1;font-size:11px;overflow:visible;white-space:nowrap;}
.plan-match-header.sfc,.plan-match-row.sfc {--columns:188px minmax(0,1fr);}
.plan-match-row.sfc,.plan-match-row.sfc .selection-cell {min-height:32px;}
.plan-match-row.sfc .selection-cell {padding:4px 7px;}
.plan-match-row.sfc .team-name,.plan-match-row.sfc .cell-odds {font-size:14px;}
.builder-title-line {flex-wrap:wrap;}
.builder-title-line select {max-width:100%;font-size:12px;}
.generate-bar {flex-wrap:wrap;}
.brand-readiness {background:#edf3fa;border-color:var(--line);color:#354a68;border-radius:4px;}
.comparison-heading {background:#edf2fa;padding:10px;}
.comparison-heading h3 {font-size:14px;}
.comparison-heading p {font-size:12px;}
.research-result-card {padding:12px;}
.team-brand-caption {font-size:11px;white-space:normal;}
.detail-card {border-radius:4px;box-shadow:none;}
.detail-content {display:grid;gap:12px;min-width:0;}
.match-hero h1 {display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:12px;font-size:24px;}
.match-hero h1 .detail-team-name:last-child {text-align:right;}
.detail-note {font-size:12px;color:var(--muted);}
.detail-brand-profile h3 {margin:0 0 6px;font-size:14px;}
.detail-brand-profile p {margin:6px 0;font-size:12px;color:var(--muted);}
.detail-brand-profile {padding:12px;border:1px solid var(--line);border-radius:3px;}
.table-scroll {min-width:0;}
.trajectory-time {flex-wrap:wrap;gap:4px 10px;white-space:normal;}
.trajectory-time > span {white-space:nowrap;}
.detail-meta {flex-wrap:wrap;overflow-wrap:anywhere;}
.fact strong {font-size:16px;font-variant-numeric:tabular-nums;}
.opening-market-grid .fact {background:#e8effc;border-radius:3px;}
.opening-market-grid .result-blue {background:var(--result-blue);}
.opening-market-grid .result-green {background:var(--result-green);}
.opening-market-grid .result-red {background:var(--result-red);color:#fff;}
.opening-market-grid .result-red :is(small,strong) {color:#fff;}
.page-footer {font-size:11px;min-width:0;flex-wrap:wrap;}
[hidden] {display:none!important;}
@media(max-width:1199px) {
  .plan-match-row.jc {--columns:28px 120px minmax(0,1fr) 40px;grid-template-columns:var(--columns);}
  .plan-match-header.jc {display:none;}
  .plan-match-row.jc>.market-grid {grid-column:3;}
  .plan-match-row.jc>.market-grid[data-market=spf] {grid-row:1;}
  .plan-match-row.jc>.market-grid[data-market=rqspf] {grid-row:2;}
  .plan-match-row.jc>.row-select,.plan-match-row.jc>.match-meta,.plan-match-row.jc>.row-tools {grid-row:1 / 3;}
  .plan-match-row.jc>.row-tools {grid-column:4;}
  .plan-match-row.jc>.market-grid::before {content:'胜平负';position:absolute;top:0;left:5px;font-size:10px;color:#5b6a80;z-index:1;}
  .plan-match-row.jc>.market-grid[data-market=rqspf]::before {content:'让球胜平负';}
  .plan-match-row.jc .selection-cell {padding-top:16px;min-height:51px;}
}
@media(max-width:760px) {
  .header-inner,.primary-nav-inner,.page-shell {width:calc(100% - 20px);}
  .primary-nav a {min-width:0;flex:1;padding:0 8px;}
  .primary-nav-inner {overflow:visible;}
  .header-tagline {display:none;}
  .header-context {margin-left:8px;}
  .toolbar-card {gap:8px;}
  .date-field {flex:1 1 calc(50% - 4px);min-width:130px;}
  .date-field input {width:100%;min-width:0;}
  .toolbar-status {width:100%;}
  .research-filters {gap:8px;padding:8px;}
  .league-picker-group.league-priority .league-picker-group-options {grid-template-columns:repeat(3,minmax(0,1fr));}
  .matches-card {padding:8px;}
  .game-card-grid {grid-template-columns:repeat(2,minmax(0,1fr));}
  .game-card,body.sfc-mode .game-card {grid-template-columns:1fr;padding:8px;gap:3px;}
  .game-card span,.game-card strong {font-size:13px;}
  .game-card small {font-size:11px;}
  .plan-match-row.jc {--columns:26px minmax(0,1fr) 38px;grid-template-columns:var(--columns);}
  .plan-match-row.jc>.row-select {grid-column:1;grid-row:1;}
  .plan-match-row.jc>.match-meta {grid-column:2;grid-row:1;grid-template-columns:auto auto 1fr;}
  .plan-match-row.jc>.match-meta .match-time {grid-column:3;grid-row:1;font-size:11px;}
  .plan-match-row.jc>.row-tools {grid-column:3;grid-row:1;}
  .plan-match-row.jc>.market-grid[data-market=spf] {grid-column:1 / -1;grid-row:2;}
  .plan-match-row.jc>.market-grid[data-market=rqspf] {grid-column:1 / -1;grid-row:3;}
  .plan-match-header.sfc,.plan-match-row.sfc {--columns:164px minmax(0,1fr);}
  .plan-match-row.sfc .match-meta {grid-template-columns:22px 40px minmax(0,1fr);}
  .plan-match-row.sfc .team-name,.plan-match-row.sfc .cell-odds {font-size:14px;}
  .plan-match-row.sfc .selection-cell {padding:4px;gap:3px;}
  .builder-title-line select {width:100%;}
  .research-result-card {padding:8px;}
  .dialog-heading,.dialog-actions {flex-wrap:wrap;}
  .detail-grid {grid-template-columns:minmax(0,1fr);}
  .fact-grid {grid-template-columns:repeat(2,minmax(0,1fr));}
  .detail-card {padding:12px;}
  .match-hero h1 {font-size:18px;gap:6px;}
  .opening-market-grid {grid-template-columns:repeat(3,minmax(0,1fr));}
  .detail-table {font-size:11px;min-width:0;}
  .detail-table th,.detail-table td {padding:5px 2px;white-space:normal;overflow-wrap:anywhere;}
  .detail-table thead {display:none;}
  .detail-table,.detail-table tbody {display:block;}
  .detail-table tr {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));border:1px solid var(--line);margin-bottom:8px;}
  .detail-table td {display:block;white-space:nowrap;}
  .detail-table td:first-child,.detail-table td:last-child {grid-column:1 / -1;background:var(--surface-soft);}
  .detail-table td::before {display:block;content:attr(data-label);font-size:10px;color:var(--muted);}
}
@media(max-width:540px) {
  .plan-match-header.sfc {display:grid;position:static;grid-template-columns:minmax(0,1fr);}
  .plan-match-header.sfc > .market-header {display:none!important;}
  .plan-match-row.sfc {display:grid;grid-template-columns:minmax(0,1fr);}
  .plan-match-row.sfc .match-meta {grid-template-columns:24px 46px 1fr;}
  .plan-match-row.sfc>.market-grid {grid-column:1;}
  .plan-match-row.sfc .selection-cell {min-height:42px;}
  .plan-match-row.sfc .team-name,.plan-match-row.sfc .cell-odds {font-size:14px;}
}

/* After time/league and a league-width spacer, four equal tracks per group: teams + odds on the left,
   total + trading shares on the right. Compact mode stacks within each half. */
.match-list,.conclusion-match-table {container-type:inline-size;overflow-x:hidden;}
.match-row,.with-predictions .match-row {grid-template-columns:36px 44px 44px repeat(8,minmax(0,1fr));gap:2px 4px;min-height:40px;padding:5px 6px;}
.with-predictions .match-row {grid-template-columns:36px 44px 44px repeat(8,minmax(0,1fr)) 44px;}
.match-row.header {display:grid;min-height:34px;}
.match-day-title {top:34px;}
.match-row > :is(.match-time,.match-league,.matchup-group,.match-odds,.match-market,.match-research) {grid-column:auto;grid-row:auto;}
.match-row > :nth-child(1) {grid-column:1;grid-row:1;}
.match-row > :nth-child(2) {grid-column:2;grid-row:1;}
.match-row > :nth-child(3) {grid-column:4 / 6;grid-row:1;}
.match-row > :nth-child(4) {grid-column:6;grid-row:1;}
.match-row > :nth-child(5) {grid-column:7;grid-row:1;}
.match-row > :nth-child(6) {grid-column:8 / 12;grid-row:1;}
.match-row > :nth-child(7) {grid-column:12;grid-row:1;}
.match-row .match-league {display:block;text-align:center;}
.match-row .matchup-group,.match-row .matchup-group.expanded-names {grid-template-columns:minmax(0,1fr) 26px minmax(0,1fr);gap:4px;max-width:none;}
.match-row .matchup-group > .match-team {display:flex;align-items:center;gap:2px;white-space:nowrap;overflow-wrap:normal;text-align:left;}
.match-row .team-label {flex:1 1 auto;min-width:0;white-space:nowrap;text-align:left;}
.match-row .matchup-group > .match-team:first-child {justify-content:flex-end;text-align:right;}
.match-row .matchup-group > .match-team:last-child {justify-content:flex-start;text-align:left;}
.match-row .matchup-group > .match-team:first-child .team-label {text-align:right;transform-origin:right center;}
.match-row .matchup-group > .match-team:last-child .team-label {text-align:left;transform-origin:left center;}
.match-row .match-score {text-align:center;}
.match-row .matchup-header > :first-child,.match-row .matchup-header > :last-child {text-align:left;}
.match-row .team-brand-caption {flex:0 1 auto;min-width:0;white-space:nowrap;font-size:9px;}
.match-row .match-odds {max-width:none;gap:1px;grid-template-columns:repeat(3,minmax(0,1fr));}
.match-row > .match-odds::before {display:none;}
.match-row .match-odds > :is(span,button) {min-height:26px;line-height:26px;font-size:13px;}
.match-row .match-market {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,3fr);align-items:center;gap:5px;}
.match-row .market-total {display:block;box-sizing:border-box;min-width:0;width:100%;max-width:100%;padding-inline:5px;margin:0;white-space:nowrap;text-align:left;}
.match-row .market-triplet {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:2px;flex:1 1 0;min-width:0;max-width:none;font-size:11px;}
.match-row .market-triplet > span {min-width:0;white-space:nowrap;overflow:visible;text-overflow:clip;text-align:left;}
.match-row .market-volume-share-row b {margin-right:2px;}
.match-row .market-total :is(.market-detail-link,.market-lottery,.match-data-health) {font-size:inherit;}
.match-row .market-detail-link {margin-left:3px;padding:1px 3px;}
.match-row .market-total {font-size:12px;}
.match-row .match-research {white-space:nowrap;}
.conclusion-match-table .match-row:not(.header) {min-height:40px;}
@container (max-width:1100px) {
  .match-row,.with-predictions .match-row {--odds-label-width:36px;--score-half:13px;grid-template-columns:32px 38px 38px repeat(8,minmax(0,1fr));grid-template-rows:auto auto;gap:3px 2px;padding:4px;min-height:0;}
  .with-predictions .match-row {grid-template-columns:32px 38px 38px repeat(8,minmax(0,1fr)) 28px;}
  .match-row.header {display:none;}
  .match-day-title {top:0;}
  .match-row > .match-time {grid-column:1;grid-row:1;}
  .match-row > .match-league {grid-column:2;grid-row:1;}
  .match-row > .matchup-group {grid-column:4 / 8;grid-row:1;position:relative;grid-template-columns:minmax(0,1fr) 26px minmax(0,1fr);column-gap:2px;}
  .match-row .matchup-group > .match-team {box-sizing:border-box;padding:0;}
  .match-row .match-score {position:static;width:auto;transform:none;}
  .match-row > .match-odds.opening-odds {grid-column:4 / 6;grid-row:2;}
  .match-row > .match-odds:not(.opening-odds) {grid-column:6 / 8;grid-row:2;}
  .match-row > .match-market {display:contents;}
  .match-row .market-total {grid-column:8 / 12;grid-row:1;text-align:center;}
  .match-row .market-triplet {grid-column:8 / 12;grid-row:2;align-self:center;}
  .match-row .match-odds {grid-template-columns:var(--odds-label-width) repeat(3,minmax(0,1fr));align-items:center;}
  .match-row > .match-odds::before {display:block;content:attr(data-label);grid-column:auto;font-size:9px;line-height:1.2;padding-right:2px;color:var(--muted);}
  .match-row .match-odds > :is(span,button) {font-size:12px;min-height:24px;line-height:24px;padding:0 1px;}
  .match-row .matchup-group > .match-team {font-size:13px;}
  .match-row .league-pill {min-width:0;width:100%;padding:1px 2px;font-size:10px;}
  .match-row .match-time,.match-row .match-league {font-size:11px;}
  .with-predictions .match-row > .match-research {grid-column:12;grid-row:1 / 3;}
  .match-row .prediction-label {max-width:100%;font-size:10px;padding:2px;}
}
@container (max-width:520px) {
  .match-row,.with-predictions .match-row {--odds-label-width:8px;--score-half:7px;grid-template-columns:26px 32px 32px repeat(8,minmax(0,1fr));column-gap:1px;}
  .with-predictions .match-row {grid-template-columns:26px 32px 32px repeat(8,minmax(0,1fr)) 24px;}
  .match-row > .matchup-group {grid-template-columns:minmax(0,1fr) 16px minmax(0,1fr);column-gap:1px;}
  .match-row .market-triplet {font-size:10px;gap:1px;}
  .match-row > .match-odds.opening-odds::before {content:'初';}
  .match-row > .match-odds:not(.opening-odds)::before {content:'即';}
  .match-row > .match-odds[data-label='必发终赔']::before {content:'终';}
  .match-row > .match-odds[data-label='竞彩SP']::before {content:'SP';}
  .match-row > .match-odds::before {font-size:8px;padding-right:0;}
  .match-row .market-total {font-size:10px;padding-inline:2px;}
  .match-row .market-total-top {padding:1px 2px;}
  .match-row .market-detail-link {margin-left:1px;padding:1px;}
  .match-row .match-data-health {min-width:12px;min-height:18px;margin-left:1px;padding:0;}
  .match-row .market-volume-share-row b {margin-right:1px;}
}

/* Compact query context and read-only brand explanation. */
.matches-card > .section-heading > div {width:100%;min-width:0;}
.match-title-actions {flex-wrap:wrap;}
.match-range-summary {display:grid;grid-template-rows:16px 16px;height:32px;min-width:0;max-width:100%;flex:1 1 260px;text-align:left;color:var(--muted);}
.match-range-summary > * {margin:0!important;font-size:11px;line-height:16px;white-space:nowrap;font-weight:600;}
.match-context-actions {display:flex;align-items:center;gap:8px;flex:1 1 270px;min-width:0;}
.match-context-actions .match-range-summary {flex:1 1 0;}
#clearOpeningSelections {height:32px;min-height:32px;padding-block:0;flex:none;}
.primary-nav-inner > a {white-space:nowrap;}
@media (max-width:600px) {.primary-nav-inner > a {padding-inline:9px;font-size:13px;min-width:0;}}
.research-history-filter {display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:12px 0;}
.research-history-filter label {display:flex;align-items:center;gap:6px;font-size:13px;}
.research-history-filter input {min-height:32px;max-width:150px;border:1px solid var(--line);border-radius:3px;padding:3px 6px;}
.research-day-group {border-top:1px solid var(--line);padding:8px 0;}
.research-day-group summary {cursor:pointer;font-weight:600;font-size:14px;}
.brand-suggestion-panel textarea {display:block;width:100%;max-width:100%;box-sizing:border-box;margin:8px 0;resize:vertical;padding:10px;font:inherit;border:1px solid var(--line);border-radius:3px;}
.brand-suggestion-panel p {overflow-wrap:anywhere;}

/* JC: explicit market positions also apply when a play is unavailable. */
.plan-match-header.jc,.plan-match-row.jc {--columns:30px 230px minmax(0,1fr) minmax(0,1fr) 88px;}
.plan-match-row.jc .match-meta {grid-template-columns:minmax(0,1fr) auto;gap:3px 6px;padding:4px 6px;min-width:0;}
.match-meta > .league-pill {grid-column:2;grid-row:1;justify-self:start;}
.plan-match-row.sfc .league-pill {min-width:0;padding:1px 2px;}
.plan-match-row.jc .match-meta > .match-code {grid-column:1;grid-row:1;white-space:nowrap;}
.plan-match-row.jc .match-meta > .match-time {grid-column:1 / -1;grid-row:2;white-space:nowrap;text-align:left;font-size:10px;}
.plan-match-row.jc .row-tools {padding:4px;}
.plan-match-row.jc .anchor-label {gap:8px;min-height:44px;cursor:pointer;}
.plan-match-row.jc .anchor-label input {width:26px;height:26px;margin:0;cursor:pointer;}
.market-grid.unavailable {display:grid;place-items:center;}
.market-grid.unavailable::after {content:none;}
.market-grid.unavailable > span {grid-column:1 / -1;font-size:11px;color:#657786;white-space:nowrap;padding-top:12px;}
.selection-cell.no-team {display:flex;justify-content:center;gap:8px;}
@media (max-width:1199px) and (min-width:601px) {
  .plan-match-row.jc {--columns:28px 222px minmax(0,1fr) 80px;grid-template-columns:var(--columns);}
  .plan-match-header.jc {display:none;}
  .plan-match-row.jc > .market-grid {grid-column:3;}
  .plan-match-row.jc > .market-grid[data-market=spf] {grid-row:1;}
  .plan-match-row.jc > .market-grid[data-market=rqspf] {grid-row:2;}
  .plan-match-row.jc > .row-select,.plan-match-row.jc > .match-meta,.plan-match-row.jc > .row-tools {grid-row:1 / 3;}
  .plan-match-row.jc > .row-tools {grid-column:4;}
}
@media (max-width:600px) {
  .plan-match-row.jc {--columns:26px minmax(0,1fr) 76px;grid-template-columns:var(--columns);}
  .plan-match-row.jc > .match-meta {grid-column:2;grid-row:1;}
  .plan-match-row.jc > .row-tools {grid-column:3;grid-row:1;}
  .plan-match-row.jc > .market-grid[data-market=spf] {grid-column:1 / -1;grid-row:2;}
  .plan-match-row.jc > .market-grid[data-market=rqspf] {grid-column:1 / -1;grid-row:3;}
}
