/* Crown-inspired customer UI: calm charcoal surfaces and aligned market rows. */
:root {
  color-scheme: dark;
  --bg: #171918;
  --panel: #1d201f;
  --panel2: #242725;
  --line: #292d2a;
  --text: #dedfd9;
  --muted: #a0a39b;
  --teal: #b99b67;
  --red: #e57863;
  --green: #8ba88f;
  --gold: #c6a66d;
  --shadow: none;
}

html[data-theme="night"] {
  --bg: #090a09;
  --panel: #151716;
  --panel2: #1d201e;
  --line: #1d201e;
  --text: #e4e5df;
  --muted: #a4a69e;
  --shadow: none;
}

html, body { min-height: 100%; background: var(--bg); color: var(--text); }
body { background-image: none; }
html[data-theme="night"] body { background: var(--bg); color: var(--text); }
.app-shell { width: 100%; max-width: none; margin-inline: auto; }

/* The narrow bronze navigation band echoes Crown's restrained page header. */
.topbar {
  position: relative;
  margin: -22px calc(-1 * clamp(20px, 3vw, 42px)) 12px;
  padding: 13px clamp(20px, 3vw, 42px);
  border-bottom: 1px solid #4b3d2d;
  background: linear-gradient(100deg, #30271f, #382e24 62%, #302820);
}
.topbar::before { display: none; }
.brand h1 { color: #e8dfcf; font-weight: 750; letter-spacing: 0; }
.brand p { color: #b9b1a4; }
.brand-mark { width: 40px; height: 40px; border-radius: 7px; border-color: #705a3e; box-shadow: none; }
.icon-button, .install-button, .top-actions .license-action {
  border: 1px solid #574835;
  border-radius: 4px;
  background: #342c23;
  color: #d1bd91;
  box-shadow: none;
}
.top-actions .theme-toggle { color: #d8bd7d; }
html[data-theme="night"] .topbar { background: linear-gradient(100deg, #29231d, #30271f 62%, #29231d); }
html[data-theme="night"] .top-actions .icon-button:not(.license-action) { background: #302820; border-color: #574835; }

.summary-bar {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: #b8bab2;
  box-shadow: none;
}
.connection.ok { color: #a3b7a1; }
.connection.ok i { background: #8ba88f; box-shadow: none; }
.summary-status-row .summary-sporttery-nav,
.notify-button,
.summary-controls-row .yesterday-button {
  border: 1px solid #554831;
  border-radius: 4px;
  background: #29251e;
  color: #d6c28e;
  box-shadow: none;
}
.settings-pills .pill { border-color: #3d423d; border-radius: 4px; background: #242725; color: #b6b9b0; }
html[data-theme="night"] .summary-bar,
html[data-theme="night"] .workspace-toolbar,
html[data-theme="night"] .settings-pills .pill { background: #151716; border-color: #2e322f; }

.tabs {
  position: static;
  gap: 5px;
  padding: 3px 0 7px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
.tab-group {
  gap: 3px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.tabs .tab-group-primary {
  padding: 2px;
  border: 1px solid rgba(132, 157, 131, .42);
  border-radius: 6px;
  background: rgba(28, 37, 29, .38);
}
.tab-group .tab {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #a4a79f;
  font-weight: 650;
}
.tab-group .tab b { color: #c2c4bc; font-weight: 650; }
.tab-group .tab.active, html[data-theme="night"] .tab-group .tab.active {
  border-color: #806941;
  background: #443721;
  color: #e5cf9a;
}
.tab-group .tab.active b { color: #ead9b3; }

.workspace-toolbar {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  box-shadow: none;
}
.toolbar-options > .segmented button,
.filter-strip button {
  border: 1px solid #3a3f3b;
  border-radius: 4px;
  background: #242725;
  color: #b2b5ac;
  box-shadow: none;
}
.toolbar-options > .segmented button.active,
.filter-strip button.active {
  border-color: #806941;
  background: #443721;
  color: #e5cf9a;
}
.toolbar-options > .sort-controls button.simulation-toggle,
.toolbar-options > .sort-controls button.simulation-toggle.active {
  border-color: #66563a;
  background: #2c271f;
  color: #d5c08a;
  box-shadow: none;
}
.filter-strip { gap: 6px; margin-bottom: 5px !important; border: 0 !important; }
.aligned-filter-strip { border: 0 !important; }
.filter-strip b { color: #a4a79f; }
.filter-strip button { min-height: 31px; padding: 5px 8px; }
.early-caution { color: #d77a68; }
.hint, .section-caption { color: #969a92; }

.cards { gap: 8px; }
.match-card, .bet-card, .empty {
  border: 1px solid #222522;
  border-radius: 4px;
  background: var(--panel);
  box-shadow: none;
}
.match-card[open], .match-card.open { border-color: #3c3326; }
.match-head { padding: 10px 12px 9px; background: #1e211f; }
.match-card[open] > .match-head { background: #222523; }
.headline { color: #a1a49c; font-size: 11px; }
.teams { margin: 5px 0 3px; color: #dedfd9; font-size: 16px; font-weight: 700; }
.compact { color: #969a92; font-size: 11px; font-weight: 500; }
.status-pill { border-radius: 3px; border-color: #4a504b; color: #bdc0b7; background: #282c29; font-weight: 650; }
.status-pill.good { border-color: #536c57; background: #29332a; color: #a9bba4; }
.status-pill.registered { border-color: #80554e; background: #392b28; color: #dca196; }
.status-pill.live { border-color: #755046; background: #352a26; color: #d7a287; }
.status-pill.goal-reminder-reviewed { border-color: #754744; background: #302120; color: #d4a29b; }
.status-pill.warn, .status-pill.halftime { border-color: #6b5939; background: #302a20; color: #d6be87; }
.match-content { padding: 4px 10px 8px; border-top: 1px solid #1d201e; background: #1b1e1c; }
html[data-theme="night"] .match-card,
html[data-theme="night"] .bet-card,
html[data-theme="night"] .empty { border-color: #1d201e; background: #151716; }
html[data-theme="night"] .match-card[open] > .match-head { background: #1c1f1d; }
html[data-theme="night"] .match-content { background: #111312; border-color: #191c1a; }

/* Keep market labels and prices in fixed columns, with odds as the only bright figures. */
.market-row {
  grid-template-columns: minmax(110px, 1.15fr) repeat(5, minmax(70px, 1fr));
  gap: 4px;
  margin: 6px 0;
  padding: 9px 7px;
  border: 1px solid #222522;
  border-radius: 5px;
  background: #111312;
}
.market-row.eligible { box-shadow: none; background: #151816; }
.market-row.goal-reminder-target-market { border-color: #80554e; background: #211b1a; scroll-margin-block: 34vh; }
.market-row.goal-reminder-target-pulse { outline: 1px solid #a16a5f; outline-offset: 2px; }
.market-name { color: #cbcfc6; font-size: 12px; font-weight: 700; }
.market-name small { color: #92968e; font-size: 10px; }
.quote { padding: 2px 4px; }
.quote label { color: #8f938a; font-size: 10px; }
.quote strong { color: #c7c9c0; font-size: 12px; font-weight: 650; }
.market-row .quote:nth-child(2) strong,
.market-row .quote:nth-child(3) strong { color: #e57863; font-size: 14px; font-weight: 750; }
.market-row.handicap-market {
  grid-template-columns: minmax(115px, 1.15fr) repeat(2, minmax(0, 1fr));
}
.handicap-market .market-name { color: #d0c5a9; }
.handicap-market .quote strong { color: #e57863; }
.market-row .market-extra { color: #92968e; }
.market-action { padding-top: 3px; }
.market-row .register-button {
  min-width: 150px;
  min-height: 34px;
  border: 1px solid #75613d;
  border-radius: 4px;
  background: #393121;
  color: #dfc88f;
  font-size: 11px;
  font-weight: 700;
  box-shadow: none;
}
.market-row .register-button.force-register { border-color: #80554e; background: #392b28; color: #dca196; }
.market-action-note { color: #9eae98; font-size: 11px; font-weight: 650; }
.market-action-note.registered { color: #c9988f; }
.handicap-register-button {
  border-color: #75613d;
  border-radius: 3px;
  background: #302a20;
  color: #dbc58f;
  font-size: 10px;
}
.handicap-register-button:disabled { border-color: #444843; background: #242725; color: #82867e; }
.odds-movement.rise { color: #f25445; }
.odds-movement.fall { color: #91a88f; }
.bet-match-meta .bet-league-name { color: #a69664; }
.review-timeline-item.goal.cancelled { border-left-color: #75655c; color: #b5aaa0; }
.review-timeline-item.goal.cancelled time { color: #b3a39a; }
.goal-history-item.cancelled { border-color: #514641; background: #211b1a; }
.goal-history-item.cancelled b { color: #c0a49a; text-decoration: line-through; }

.bet-summary-stat, .metric, .outcome, .handicap-position, .handicap-opportunity {
  border-color: #343a35;
  border-radius: 4px;
  background: #232624;
  box-shadow: none;
}
.bet-summary-stat strong, .handicap-position b { color: #dedfd9; }
.bet-summary-label, .bet-sub { color: #a0a39b; }
.bet-summary-entry, .bet-summary-current { border-color: #3b403b; background: #242725; }
.current-quote, .record-live-market, .bet-review-timeline, .hedge-entry-summary {
  border-color: #343a35;
  border-radius: 4px;
  background: #202321;
}
.record-live-market.is-selected { border-color: #8b744c; background: #302a20; box-shadow: inset 3px 0 #8b744c; }
.record-live-market.is-original { border-color: #8b744c; background: #302a20; color: #e1d1a8; box-shadow: inset 3px 0 #b99b67; }
.record-live-market.is-ceiling { border-color: #c45c58; background: #392421; box-shadow: inset 3px 0 #c45c58; }
.record-live-market-odds b, .record-live-market-hedge b, .record-live-market-floor b { color: #e57863; }
.record-live-market-floor.pnl-negative b { color: #91a88f !important; }
.record-live-market-floor.pnl-positive b { color: #e57863 !important; }
.profit-line.pnl-positive, .settlement-line.pnl-positive { color: #e57863 !important; }
.profit-line.pnl-negative, .settlement-line.pnl-negative { color: #91a88f !important; }
.record-live-markets { border-color: #303431; background: #191c1a; }
.record-live-market-line { color: #d8d9d1; }
.rank.original, .rank.ceiling { border-color: #806941; background: #393121; color: #dfc88f; }
.rank.best { border-color: #80554e; background: #392b28; color: #dca196; }
.rank.worst { border-color: #536c57; background: #29332a; color: #a9bba4; }
.handicap-bet-card { border-color: #44473f; }
.handicap-opportunity.safe { border-color: #536c57; background: #252d26; color: #bbc8b8; }
.handicap-opportunity strong, .handicap-opportunity.safe strong { color: #d6be87; }
.sporttery-match-panel { border-color: #3b423a; border-radius: 4px; background: #202421; }
.sporttery-panel-head { color: #c6c1a9; }
.sporttery-market-group { border-color: #343a35; }
.sporttery-odd-chip { border-color: #3b423a; border-radius: 3px; background: #252825; color: #c0c3ba; }
.sporttery-odd-chip b { color: #dfc88f; }
.strategy-comparison { border-color: #51452f; border-radius: 4px; background: #24211b; }
.strategy-comparison > header { color: #d6be87; }
.strategy-allocation, .strategy-result { border-color: #3b403b; border-radius: 4px; background: #222523; }
.strategy-allocation b { color: #dfdfd6; }
.strategy-preferred { color: #a4b19b; }
.dialog { border-color: #484238; border-radius: 7px; background: #202321; box-shadow: 0 18px 60px #0009; }
.dialog::backdrop { background: #080909c9; backdrop-filter: blur(2px); }
.dialog-card h2 { color: #e0dfd6; }
.dialog-card p, .dialog-card small { color: #a0a39b; }
.field span { color: #c2c0b4; }
.field input, .field select { border-color: #444842; border-radius: 4px; background: #171a18; color: #e0e1da; }
.field input:focus, .field select:focus { border-color: #8b744c; box-shadow: 0 0 0 2px #8b744c26; }
.primary-button, .action-button:not(.secondary):not(.danger):not(.ceiling-action) {
  border: 1px solid #78633f;
  border-radius: 4px;
  background: #403625;
  color: #e6d19c;
  box-shadow: none;
}
.action-button.secondary { border-color: #454a44; border-radius: 4px; background: #292d2a; color: #d0d2ca; }
.action-button.danger { border-color: #76514a; border-radius: 4px; background: #392b28; color: #dca196; }
.bet-card.target-profit-hit { border-color: #80554e; background: #292321; box-shadow: none; }
.bet-card.target-profit-hit > .bet-summary { background: #302724; }
.bet-card.strong-profit-hit { border-color: #75613d; background: #29261f; box-shadow: none; }
.toast-notice { border-color: #536c57; border-radius: 4px; background: #252d26; color: #c2cebd; box-shadow: none; }
.empty { color: #a0a39b; }
footer { color: #858a82; }

@media (max-width: 699px) {
  .topbar {
    position: fixed;
    inset: 0 0 auto;
    z-index: 100;
    height: calc(env(safe-area-inset-top, 0px) + 58px);
    margin: 0;
    padding: calc(env(safe-area-inset-top, 0px) + 4px) max(10px, env(safe-area-inset-right, 0px)) 3px max(10px, env(safe-area-inset-left, 0px));
    border: 0;
    border-bottom: 1px solid #4b3d2d;
    background: #30281f;
  }
  html[data-theme="night"] .topbar { background: #29231d; }
  .brand-mark { width: 36px; height: 36px; }
  .top-actions { gap: 4px; }
  .tabs { gap: 5px; padding-bottom: 6px; }
  .tab-group { gap: 2px; }
  .tab-group .tab { min-height: 36px; padding-inline: 3px; font-size: 11px; }
  .workspace-toolbar { padding: 8px; }
  .toolbar-options { gap: 5px; }
  .toolbar-options > .segmented button { min-height: 34px; padding-inline: 6px; }
  .market-row { border-radius: 0; }
  .market-row.handicap-market { grid-template-columns:minmax(90px,1fr) repeat(2,minmax(0,1fr)); }
  .market-row .register-button { min-width: 0; }
  .bet-summary-stat, .metric, .outcome { border-radius: 4px; }
}

@media (max-width: 380px) {
  .topbar { padding-left: max(8px, env(safe-area-inset-left, 0px)); padding-right: max(8px, env(safe-area-inset-right, 0px)); }
  .summary-bar { border-radius: 4px; }
  .tab-group .tab { font-size: 9px; }
  .market-row.handicap-market { grid-template-columns:minmax(78px,1fr) repeat(2,minmax(0,1fr)); }
}

@media (min-width: 700px) {
  .topbar { margin-left: -22px; margin-right: -22px; }
}

/* Keep mobile controls on deliberate rows and restore the translucent pinned header. */
@media (max-width: 699px) {
  .topbar {
    background: transparent;
    border-bottom-color: rgba(185, 155, 103, .18);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .topbar::before {
    display: block;
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    background: linear-gradient(180deg, rgba(23, 25, 24, .58), rgba(23, 25, 24, .42) 78%, rgba(23, 25, 24, .24));
    -webkit-backdrop-filter: blur(12px) saturate(118%);
    backdrop-filter: blur(12px) saturate(118%);
    pointer-events: none;
  }
  html[data-theme="night"] .topbar::before {
    background: linear-gradient(180deg, rgba(9, 10, 9, .58), rgba(9, 10, 9, .42) 78%, rgba(9, 10, 9, .24));
  }

  .summary-status-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 4px 7px;
  }
  .summary-status-row .connection { grid-column: 1; grid-row: 1; min-width: 0; }
  .summary-status-row #updatedAt {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: 9px;
    line-height: 1.3;
    color: var(--muted);
  }
  .summary-status-row .summary-sporttery-nav { grid-column: 2; grid-row: 1; }

  .summary-controls-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    min-width: 0;
  }
  .summary-controls-row .settings-pills {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    width: 100%;
    min-width: 0;
  }
  .summary-controls-row .pill {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
  }
  .summary-controls-row .notify-control {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    min-width: 0;
  }
  .summary-controls-row .yesterday-button,
  .summary-controls-row .notify-button {
    width: 100%;
    min-width: 0;
    margin: 0;
    padding-inline: 5px;
    text-align: center;
    white-space: nowrap;
  }

  .aligned-filter-strip {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
  }
  .aligned-filter-strip > b {
    flex: 0 0 auto;
    width: auto;
    white-space: nowrap;
  }
  .aligned-filter-strip button {
    flex: 0 0 auto;
    min-width: max-content;
    white-space: nowrap;
    padding-inline: 6px;
  }

  .market-row:not(.handicap-market) {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px 3px;
    min-width: 0;
  }
  .market-row:not(.handicap-market) > .market-name,
  .market-row:not(.handicap-market) > .market-action {
    grid-column: 1 / -1;
    min-width: 0;
    width: 100%;
  }
  .market-row:not(.handicap-market) > .market-name { overflow-wrap: anywhere; }
  .market-row:not(.handicap-market) > .quote { min-width: 0; overflow: hidden; }
  .market-row:not(.handicap-market) > .quote label {
    min-height: 1.25em;
    font-size: 9px;
    line-height: 1.25;
    white-space: normal;
  }
  .market-row:not(.handicap-market) > .quote strong { font-size: 14px; }
  .market-row:not(.handicap-market) > .market-action { padding-top: 0; }
  .market-row:not(.handicap-market) .register-button {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    margin-top: 2px;
    padding: 6px 5px;
    font-size: 12px;
    line-height: 1.2;
    white-space: normal;
  }
}

/* Match Crown's clearer, bolder odds hierarchy while keeping supporting figures calm. */
.market-name small { font-size: 11px; }
.market-row .quote label { font-size: 11px; }
.market-row .quote strong {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.market-row .quote:nth-child(2) strong,
.market-row .quote:nth-child(3) strong,
.market-row.handicap-market .quote strong {
  color: #db7a68;
  font-size: 16px;
  font-weight: 850;
}

@media (max-width: 380px) {
  .market-row .quote:nth-child(2) strong,
  .market-row .quote:nth-child(3) strong,
  .market-row.handicap-market .quote strong { font-size: 15px; }
}

/* Restore the pinned mobile header as translucent glass and keep compact controls on one line. */
.button-label-compact { display: none; }
@media (max-width: 699px) {
  .topbar {
    background: rgba(23, 25, 24, .065);
    border-bottom: 1px solid rgba(185, 155, 103, .08);
    -webkit-backdrop-filter: blur(1px) saturate(105%);
    backdrop-filter: blur(1px) saturate(105%);
  }
  .topbar::before { display: none; }
  html[data-theme="night"] .topbar { background: rgba(9, 10, 9, .04); }

  .summary-controls-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 4px;
  }
  .summary-controls-row .settings-pills,
  .summary-controls-row .notify-control {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    width: auto;
    min-width: 0;
    margin: 0;
  }
  .summary-controls-row .settings-pills { grid-column: 1; grid-row: 1; }
  .summary-controls-row .notify-control { grid-column: 2; grid-row: 1; }
  .summary-controls-row .pill,
  .summary-controls-row .yesterday-button,
  .summary-controls-row .notify-button {
    width: 100%;
    min-width: 0;
    min-height: 31px;
    margin: 0;
    padding: 4px 2px;
    overflow: hidden;
    font-size: clamp(8px, 2.5vw, 9.5px);
    line-height: 1.1;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .summary-controls-row .button-label-full { display: none; }
  .summary-controls-row .button-label-compact { display: inline; }
  .summary-controls-row .yesterday-pnl-value { margin-left: 1px; }

  .aligned-filter-strip[aria-label="最大抽水"],
  .aligned-filter-strip[aria-label="早球风险"] {
    display: grid;
    grid-template-columns: 48px repeat(5, minmax(0, 1fr));
    align-items: center;
    gap: 3px;
    width: 100%;
    min-width: 0;
    overflow: visible;
  }
  .aligned-filter-strip[aria-label="最大抽水"] > b,
  .aligned-filter-strip[aria-label="早球风险"] > b {
    width: auto;
    min-width: 0;
    margin: 0;
    font-size: 9px;
    white-space: nowrap;
  }
  .aligned-filter-strip[aria-label="最大抽水"] button,
  .aligned-filter-strip[aria-label="早球风险"] button {
    width: 100%;
    min-width: 0;
    min-height: 30px;
    padding: 4px 1px;
    font-size: clamp(8px, 2.35vw, 9px);
    line-height: 1.1;
    text-align: center;
    white-space: nowrap;
  }
}

@media (max-width: 359px) {
  .aligned-filter-strip[aria-label="最大抽水"],
  .aligned-filter-strip[aria-label="早球风险"] {
    grid-template-columns: 44px repeat(5, minmax(0, 1fr));
    gap: 2px;
  }
  .aligned-filter-strip[aria-label="最大抽水"] button,
  .aligned-filter-strip[aria-label="早球风险"] button {
    padding-inline: 0;
    font-size: 8px;
    letter-spacing: -.25px;
  }
}

.summary-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.bet-summary-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}
.bet-summary-actions button,
.ceiling-banner-actions button {
  min-height: 30px;
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid #78633f;
  border-radius: 4px;
  background: #403625;
  color: #e6d19c;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
  white-space: normal;
}
.bet-summary-actions .summary-reminder-dismiss,
.ceiling-banner-actions .ceiling-banner-dismiss {
  border-color: #76514a;
  background: #392b28;
  color: #e0b8ae;
}
.ceiling-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ceiling-banner-copy { min-width: 0; flex: 1 1 auto; }
.ceiling-banner-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
@media (max-width: 699px) {
  .summary-status { align-items: flex-start; text-align: left; }
  .bet-summary-actions { justify-content: flex-start; }
  .ceiling-banner { align-items: stretch; flex-direction: column; }
  .ceiling-banner-actions { justify-content: flex-start; }
}

.relay-simulation-toolbar {
  display: grid;
  grid-template-columns: max-content max-content minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: 10px 0 12px;
  padding: 9px 10px;
  border: 1px solid #383d38;
  border-radius: 4px;
  background: #202321;
}
.relay-simulation-toolbar .action-button { min-height: 36px; padding: 0 11px; white-space: nowrap; }
.relay-simulation-toolbar .relay-simulation-enabled { border-color: #5c735c; background: #293329; color: #b9cbb4; }
.relay-simulation-toolbar > span { min-width: 0; color: #a0a39b; font-size: 11px; line-height: 1.4; }
.relay-simulation-toolbar #relaySimulationRecordCount { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 5px; border-radius: 9px; background: #393d38; color: #ddd9c8; font-size: 10px; }
.relay-simulation-results-card { width: min(760px, 96vw); }
.relay-simulation-results-list { display: grid; gap: 8px; max-height: min(68vh, 680px); overflow: auto; }
.relay-simulation-record { display: grid; gap: 7px; padding: 10px; border: 1px solid #383d38; border-radius: 4px; background: #1b1e1c; }
.relay-simulation-record > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 9px; }
.relay-simulation-record > header > div { min-width: 0; }
.relay-simulation-record > header strong { color: #e0e1da; font-size: 14px; }
.relay-simulation-record > header strong span { color: #9d8970; }
.relay-simulation-record > header small { display: block; margin-top: 3px; color: #8d928a; font-size: 10px; }
.relay-simulation-state { flex: none; color: #d5c394; font-size: 11px; font-weight: 700; text-align: right; }
.relay-simulation-state.risk-exceeded { color: #c79489; }
.relay-simulation-state.settled { color: #aab8a4; }
.relay-simulation-leg { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 8px; align-items: start; padding-top: 6px; border-top: 1px solid #2d322e; font-size: 11px; }
.relay-simulation-leg > b { color: #d6be87; }
.relay-simulation-leg > span { color: #b2b5ac; line-height: 1.45; overflow-wrap: anywhere; }
.relay-simulation-settlement { padding-top: 6px; border-top: 1px solid #2d322e; font-size: 12px; font-weight: 750; }
.relay-simulation-settlement.pnl-positive { color: #d7907f; }
.relay-simulation-settlement.pnl-negative { color: #9caf98; }
@media (max-width: 699px) {
  .relay-simulation-toolbar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; padding: 8px; }
  .relay-simulation-toolbar .action-button { min-width: 0; padding-inline: 5px; font-size: 11px; }
  .relay-simulation-toolbar > span { grid-column: 1 / -1; }
  .relay-simulation-record { padding: 8px; }
  .relay-simulation-record > header strong { font-size: 12px; }
  .relay-simulation-leg { grid-template-columns: 78px minmax(0, 1fr); gap: 5px; font-size: 10px; }
  .relay-simulation-state { max-width: 45%; font-size: 10px; }
}

.live-position-stake {
  display: block;
  margin-top: 2px;
  color: #b4aa91;
  font-size: 8px;
  font-weight: 500;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.market-row .live-position-quote .live-position-value { display: block; font-size: 13px; }
.market-row .live-position-quote .live-position-value.is-positive { color: #68c692; }
.market-row .live-position-quote .live-position-value.is-negative { color: #e57863; }
.market-row .live-position-quote .live-position-value.is-zero { color: #c7c9c0; }

/* Calm two-column match cards: keep the match grouping, remove repeated inner rules. */
#prematchList.cards,
#betsList.cards,
#profitableList.cards,
#liveList.cards,
#recommendedList.cards,
#hedgedList.cards,
#unhedgedList.cards,
#settledList.cards {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 10px !important;
}
@media (min-width: 700px) {
  #prematchList.cards,
  #betsList.cards,
  #profitableList.cards,
  #liveList.cards,
  #recommendedList.cards,
  #hedgedList.cards,
  #unhedgedList.cards,
  #settledList.cards {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    column-gap: 14px !important;
    row-gap: 10px !important;
  }
}
.cards > .match-card,
.cards > .bet-card {
  overflow: visible !important;
  border: 1px solid #292d2a !important;
  border-radius: 5px !important;
  background: #151716 !important;
  box-shadow: none !important;
}
.cards > .bet-card.target-profit-hit { border-color: #49322e !important; }
.cards > .bet-card.strong-profit-hit { border-color: #49402f !important; }
.match-head { padding: 12px 10px 10px !important; background: transparent !important; }
.match-card[open] > .match-head { background: transparent !important; }
.match-content { padding: 8px 10px 12px !important; border-top: 0 !important; background: transparent !important; }
.market-row {
  margin: 0 !important;
  padding: 8px 4px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}
.market-row.eligible { background: rgba(185, 155, 103, .035) !important; }
.bet-card { padding: 0 !important; }
.bet-summary { padding: 13px 8px 14px !important; }
.bet-summary-stats {
  display: flex !important;
  flex-wrap: wrap;
  gap: 4px 20px !important;
  padding: 8px 18px 0 0;
  border-top: 0;
}
.bet-summary-stat {
  flex: 1 1 300px;
  min-width: 0;
  padding: 3px 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.bet-summary-entry, .bet-summary-current { border: 0 !important; background: transparent !important; }
.bet-summary-label { color: #92968e !important; }
.bet-summary-stat strong { color: #dedfd9 !important; font-size: 16px !important; font-weight: 700 !important; }
.bet-details { padding: 8px 8px 12px !important; border-top: 0 !important; }
.bet-summary-stat, .metric, .outcome, .handicap-position, .handicap-opportunity,
.current-quote, .bet-review-timeline, .hedge-entry-summary, .record-live-markets,
.sporttery-match-panel, .strategy-comparison, .strategy-allocation, .strategy-result {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.bet-grid { display: flex !important; flex-wrap: wrap; gap: 0 18px !important; }
.metric { flex: 1 1 220px; padding: 8px 0 !important; border-bottom: 0 !important; }
.outcome-list { grid-template-columns: minmax(0, 1fr) !important; gap: 0 !important; }
.outcome { padding: 7px 1px !important; border-bottom: 0 !important; }
.record-live-markets { margin-inline: 0 !important; padding: 8px 0 !important; border-block: 0 !important; }
.record-live-market-list { gap: 6px !important; }
.record-live-market {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.record-live-market.is-selected { border-left: 3px solid #8b744c !important; background: rgba(139, 116, 76, .08) !important; }
.record-live-market.is-original { border-left: 3px solid #8b744c !important; background: rgba(139, 116, 76, .08) !important; }
.record-live-market.is-ceiling { border-left: 3px solid #c45c58 !important; background: rgba(196, 92, 88, .08) !important; }
.hedge-entry-list { gap: 6px !important; }
.hedge-entry-summary { padding: 8px 0 !important; border-bottom: 0 !important; }
.bet-review-timeline { padding: 8px 0 !important; border-block: 0 !important; }
.summary-bar, .workspace-toolbar {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.summary-bar { border-bottom: 0 !important; }
.tab-group { padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; }
.tab-group .tab.active { border-color: transparent !important; border-bottom: 2px solid #806941 !important; border-radius: 0 !important; background: transparent !important; }
.toolbar-options > .segmented button {
  border-color: transparent !important;
  border-radius: 0 !important;
  background: transparent !important;
}
.toolbar-options > .segmented button.active {
  border-color: transparent !important;
  border-bottom: 2px solid #806941 !important;
  background: transparent !important;
}
html[data-theme="night"] .cards > .match-card,
html[data-theme="night"] .cards > .bet-card { border-color: #242724 !important; background: #111312 !important; }
html[data-theme="night"] .cards > .bet-card.target-profit-hit { border-color: #49322e !important; }
html[data-theme="night"] .cards > .bet-card.strong-profit-hit { border-color: #49402f !important; }

/* Minimal separators: use spacing and contrast before drawing rules. */
.topbar { border-bottom: 0 !important; }
.tabs { border: 0 !important; padding-bottom: 0 !important; }
.tabs .tab-group-primary { border: 0 !important; background: transparent !important; }
.tab-group .tab.active {
  border: 0 !important;
  border-bottom: 0 !important;
  border-radius: 4px !important;
  background: rgba(128, 105, 65, .12) !important;
}
.toolbar-options > .segmented button.active {
  border: 0 !important;
  border-bottom: 0 !important;
  border-radius: 4px !important;
  background: rgba(128, 105, 65, .12) !important;
}
.cards > .match-card,
.cards > .bet-card { border-color: #151715 !important; }
.cards > .bet-card.target-profit-hit { border-color: #211917 !important; }
.cards > .bet-card.strong-profit-hit { border-color: #211f17 !important; }
html[data-theme="night"] .cards > .match-card,
html[data-theme="night"] .cards > .bet-card { border-color: #111311 !important; }
html[data-theme="night"] .cards > .bet-card.target-profit-hit { border-color: #1b1514 !important; }
html[data-theme="night"] .cards > .bet-card.strong-profit-hit { border-color: #1b1a14 !important; }

/* Recommended event cards: keep the two-column layout, remove the enclosing frames. */
#recommendedList > .match-card {
  border: 1px solid #151715 !important;
  border-radius: 4px !important;
  background: transparent !important;
  box-shadow: none !important;
}
html[data-theme="night"] #recommendedList > .match-card {
  border-color: #111311 !important;
}

.customer-recommendation-panel{margin:10px 0;padding:10px 11px;border:1px solid #69523a;border-radius:8px;background:linear-gradient(140deg,#211c17,#151b1d);color:#dfd8c9;font-size:12px;line-height:1.5}
.customer-recommendation-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;color:#b8b1a2;font-size:11px;font-weight:750}
.customer-recommendation-heading b{color:#f0d392;font-size:13px}
.customer-recommendation-cross-match{display:flex;align-items:center;flex-wrap:wrap;gap:5px 7px;margin:7px 0;padding:7px 8px;border:1px solid rgba(72,143,119,.38);border-radius:7px;background:rgba(12,42,34,.42)}
.customer-recommendation-cross-match>span:not(.coexisting-card-badge){color:#c5d6d0;font-size:10px;line-height:1.4}
.customer-recommendation-cross-match>small{display:inline!important;margin:0!important;color:#91c8ad!important;font-size:9px!important}
.customer-recommendation-panel p{margin:6px 0;color:#eee8da;font-weight:700}
.customer-recommendation-panel small{display:block;margin-top:5px;color:#9eabb0;font-size:10px;line-height:1.45}
@media(max-width:480px){.customer-recommendation-panel{padding:9px;font-size:11px}.customer-recommendation-heading b{font-size:12px}}

/* Keep Sporttery data inside each matching match card; hide the redundant global strip. */
#coexistingFilter{display:none!important}

/* Compact, quieter bet comparisons; keep +/- signs and existing actions. */
:is(#betsList, #liveList) .record-live-market-odds b,
:is(#betsList, #liveList) .record-live-market-hedge b {
  color: #e0e1d8;
}
:is(#betsList, #liveList) .record-live-market-floor.pnl-positive,
:is(#betsList, #liveList) .record-live-market-floor.pnl-positive b,
:is(#betsList, #liveList) .record-live-market-results .pnl-positive,
:is(#betsList, #liveList) .record-live-market-results .pnl-positive b {
  color: #d8b4a6 !important;
}
:is(#betsList, #liveList) .record-live-market-floor.pnl-negative,
:is(#betsList, #liveList) .record-live-market-floor.pnl-negative b,
:is(#betsList, #liveList) .record-live-market-results .pnl-negative,
:is(#betsList, #liveList) .record-live-market-results .pnl-negative b {
  color: #a9bbae !important;
}
#betsList .summary-profit.pnl-positive { color: #d8b4a6 !important; }
#betsList .summary-profit.pnl-negative { color: #a9bbae !important; }
:is(#betsList, #liveList) .record-live-market .rank {
  border-color: #514f43;
  background: #252622;
  color: #c6c6ba;
}
:is(#betsList, #liveList) .record-live-market .rank.original,
:is(#betsList, #liveList) .record-live-market .rank.best {
  border-color: #6a5b3f;
  background: #2d2a22;
  color: #d7c69c;
}
:is(#betsList, #liveList) .market-no-safe-hedge {
  border: 1px solid #6a5845;
  background: #29241e;
  color: #e3d0b7;
  box-shadow: none;
  font-size: 14px;
}
#betsList .bet-details .action-button.danger {
  border-color: #65564e;
  background: #302a27;
  color: #dfc2b8;
}

@media (max-width: 699px) {
  #betsList .bet-summary { padding: 9px 9px 10px !important; gap: 4px 8px; }
  #betsList .bet-summary-main { gap: 4px; }
  #betsList .bet-title-line .teams { font-size: 14px; }
  #betsList .bet-match-meta, #betsList .summary-status { font-size: 10.5px; }
  #betsList .summary-profit { font-size: 16px; }
  #betsList .bet-summary-stats {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    gap: 2px !important;
    padding: 3px 16px 0 0;
  }
  #betsList .bet-summary-stat {
    display: grid;
    grid-template-columns: minmax(68px, 88px) minmax(0, 1fr);
    align-items: baseline;
    gap: 5px;
    padding: 1px 0 !important;
  }
  #betsList .bet-summary-label { font-size: 10.5px; }
  #betsList .bet-summary-stat strong {
    width: auto;
    font-size: 12.5px !important;
    line-height: 1.35;
    text-align: left;
    overflow-wrap: anywhere;
  }
  #betsList .bet-details { padding: 4px 9px 10px !important; }
  :is(#betsList, #liveList) .record-live-markets { padding: 5px 0 !important; }
  :is(#betsList, #liveList) .record-live-markets h3 { font-size: 12px; line-height: 1.35; }
  :is(#betsList, #liveList) .record-live-markets > p { margin-bottom: 5px; font-size: 10.5px; }
  :is(#betsList, #liveList) .record-live-market-list { gap: 2px !important; }
  :is(#betsList, #liveList) .record-live-market {
    grid-template-columns: minmax(0, 1fr) minmax(50px, .62fr) minmax(50px, .62fr);
    grid-template-areas: 'line over under' 'tags metrics metrics' 'results results results';
    gap: 4px 7px;
    padding: 7px 5px !important;
    font-size: 12px;
    line-height: 1.3;
  }
  :is(#betsList, #liveList) .record-live-market-line { grid-area: line; font-size: 13px; }
  :is(#betsList, #liveList) .record-live-market-odds:nth-child(2) { grid-area: over; }
  :is(#betsList, #liveList) .record-live-market-odds:nth-child(3) { grid-area: under; }
  :is(#betsList, #liveList) .record-live-market-odds { font-size: 11px; }
  :is(#betsList, #liveList) .record-live-market-odds b { font-size: 13px; }
  :is(#betsList, #liveList) .record-live-market-tags {
    grid-area: tags;
    gap: 3px;
    min-width: 0;
    white-space: normal;
  }
  :is(#betsList, #liveList) .record-live-market .rank { padding: 2px 5px; font-size: 10px; }
  :is(#betsList, #liveList) .record-live-market-metrics {
    grid-area: metrics;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 3px 8px;
    min-width: 0;
    font-size: 11px;
  }
  :is(#betsList, #liveList) .record-live-market-hedge,
  :is(#betsList, #liveList) .record-live-market-floor { font-size: 11px; white-space: normal; }
  :is(#betsList, #liveList) .record-live-market-hedge b,
  :is(#betsList, #liveList) .record-live-market-floor b { font-size: 12px; overflow-wrap: anywhere; }
  :is(#betsList, #liveList) .record-live-market-results { grid-area: results; }
  :is(#betsList, #liveList) .record-live-market-results .outcome-inline { gap: 3px 5px; padding: 0; font-size: 10.5px; }
  :is(#betsList, #liveList) .record-live-market-results .outcome-inline-item { gap: 3px; }
  :is(#betsList, #liveList) .record-live-market-results .outcome-inline-item b { font-size: 12px; }
  :is(#betsList, #liveList) .record-live-market.original-unavailable { display: flex; flex-wrap: wrap; gap: 5px 8px; }
  #betsList .bet-details > .action-row { gap: 6px; }
  #betsList .bet-details > .action-row .action-button { flex: 1 1 0; min-width: 0; min-height: 44px; padding-inline: 6px; font-size: 12px; }
}

/* Live relay: show the current best hedge while the fixture is collapsed. */
#liveList .live-collapsed-hedge-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 8px;
  margin-top: 6px;
  min-width: 0;
}
#liveList .match-card[open] > .match-head .live-collapsed-hedge-summary { display: none; }
#liveList .live-hedge-chip {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 6px;
  max-width: 100%;
  padding: 3px 7px;
  border: 1px solid #514d3f;
  border-radius: 4px;
  background: #22231f;
  color: #c1c4b9;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}
#liveList .live-hedge-chip b { font-size: 13px; font-weight: 800; }
#liveList .live-hedge-chip.is-positive b { color: #e0b8a8; }
#liveList .live-hedge-chip.is-negative b { color: #a9bdaf; }
#liveList .live-hedge-chip.is-zero b, #liveList .live-hedge-chip.is-waiting b { color: #c5c9be; }
#liveList .live-hedge-chip small { color: #e0c49c; font-size: 10px; font-weight: 700; }
@media (max-width: 699px) {
  #liveList .live-collapsed-hedge-summary { gap: 4px 6px; margin-top: 5px; }
  #liveList .live-hedge-chip { padding: 3px 6px; font-size: 10.5px; }
  #liveList .live-hedge-chip b { font-size: 12px; }
}

/* Keep the hedge summary under the live status without adding a full row. */
#liveList .match-card.live-match:not([open]) > .match-head .match-identity-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr) fit-content(46%);
}
#liveList .match-card.live-match:not([open]) > .match-head .match-identity-copy > .headline {
  grid-column: 1 / -1;
  grid-row: 1;
  min-width: 0;
}
#liveList .match-card.live-match:not([open]) > .match-head .match-identity-copy > .teams {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  overflow-wrap: anywhere;
}
#liveList .match-card.live-match:not([open]) > .match-head .match-identity-copy > .compact {
  grid-column: 1;
  grid-row: 3;
  min-width: 0;
  overflow-wrap: anywhere;
}
#liveList .match-card.live-match:not([open]) > .match-head .match-identity-copy > .live-collapsed-hedge-summary {
  grid-column: 2;
  grid-row: 2 / span 2;
  align-self: start;
  justify-self: end;
  justify-content: flex-end;
  align-content: flex-start;
  max-width: 46vw;
  max-width: min(46vw, 330px);
  margin: 2px 0 0 8px;
}

/* Integer push remains distinct, using the standard comparison layout. */
.outcome-inline.integer-outcomes .outcome-inline-item.integer-push,
.outcome-inline.integer-outcomes .outcome-inline-item.integer-push b {
  color: #efd07a !important;
}
.alert-banner .integer-alert-highlight { color: #ffd76a; font-weight: 900; }
.record-live-market-results .integer-outcomes .outcome-inline-item {
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
  white-space: normal;
}
.record-live-market-results .integer-outcomes .outcome-inline-item b {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Automatic reviews use the same match layout as live relay cards. */
#recommendedList .auto-review-filters {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 6px;
  width: 100%;
  min-width: 0;
  padding-bottom: 3px;
  overflow-x: auto;
}
#recommendedList .auto-review-filters .auto-review-filter {
  flex: 1 0 auto;
  width: auto;
  min-width: max-content;
  min-height: 38px;
  margin: 0;
  padding: 7px 10px;
  white-space: nowrap;
}
#recommendedList .auto-review-card .match-identity { width: 100%; }
#recommendedList .auto-review-card .match-identity-copy { min-width: 0; width: 100%; }
#recommendedList .auto-review-summary-item { flex: 1 1 100%; min-width: 0; }
#recommendedList .auto-review-signal { flex-wrap: wrap; }
#recommendedList .auto-review-signal b.is-win { color: #e0b8a8; }
#recommendedList .auto-review-signal b.is-loss { color: #a9bdaf; }
#recommendedList .auto-review-signal b.is-push { color: #efd07a; }
/* A concise observed-odds signal in the collapsed live fixture heading. */
#liveList .match-card.live-match:not([open]) .market-movement-summary-slot {
  display: flex !important; flex: 1 1 auto; justify-content: center; min-width: 0; text-align: center;
}
#liveList .match-card.live-match[open] .live-odds-signal { display: none; }
#liveList .live-odds-signal { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; line-height: 1.3; font-weight: 800; white-space: nowrap; }
#liveList .live-odds-signal.is-abnormal { color: #ce8585; }
#liveList .live-odds-signal.is-normal { color: #c8ad70; }
#liveList .live-odds-signal.is-observing { color: #adb4ae; }
#liveList .live-odds-under { color: #d6d7cd; font-size: 11px; font-weight: 700; }
#liveList .live-odds-under.below-plan { color: #c9ab7c; }
#liveList .live-odds-under.space-qualified, #liveList .live-space-result.space-qualified, #liveList .live-space-inline.space-qualified { color: #c8ad70; }
#liveList .live-odds-under.space-unqualified, #liveList .live-space-result.space-unqualified, #liveList .live-space-inline.space-unqualified { color: #ce8585; }
#liveList .live-odds-under.space-unknown, #liveList .live-space-result.space-unknown, #liveList .live-space-inline.space-unknown { color: #adb4ae; }
#liveList .live-space-inline { display: block; margin-top: 3px; font-weight: 700; }
#liveList .live-space-result { display: block; font-size: 13px; }
#liveList .live-odds-signal small { font-size: 10px; font-weight: 700; }
@media (max-width: 600px) {
  #liveList .match-card.live-match:not([open]) .headline { flex-wrap: wrap; }
  #liveList .match-card.live-match:not([open]) .market-movement-summary-slot { flex: 1 1 90px; }
  #liveList .live-odds-signal { font-size: 11px; }
  #liveList .live-odds-under { font-size: 10px; }
}
@media (max-width: 600px) {
  #recommendedList .auto-review-filters { gap: 3px; }
  #recommendedList .auto-review-filters .auto-review-filter {
    padding: 7px 5px;
    font-size: 11px;
  }
}
