/* The full-screen chart (/markets/chart, templates/markets/chart.html).
   A whole-window grid: the top bar over the drawing rail, the stage
   (legend, chart, range bar), the tool panel and its icon rail. Colours
   are Terminal Light tokens, so the light theme follows. */
html:has(> body.mc-page), body.mc-page { height: 100%; margin: 0; background: var(--tl-page); color: var(--tl-ink); }
body.mc-page { --si-chart-load-bg: var(--tl-page); }   /* the full chart sits on the page, not a card */
body.mc-page { font-family: var(--tl-font); -webkit-font-smoothing: antialiased; font-feature-settings: 'tnum', 'cv11'; overflow: hidden; }
/* Resets at zero specificity, so every component rule below wins. */
:where(.mc-page) :where(button, input) { font: inherit; color: inherit; margin: 0; }
:where(.mc-page) :where(button) { cursor: pointer; background: none; border: 0; padding: 0; }
:where(.mc-page) :where(a) { color: inherit; text-decoration: none; }
.mc-page :is(a, button, input):focus-visible { outline: none; box-shadow: var(--tl-focus-ring); }
/* The Markets page's chart (.mc-embed) sits under Pico: its resets carry one
   class, enough to beat Pico's [type=button] and still lose to every rule below. */
.mc-embed :where(button) { margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; width: auto; box-shadow: none; cursor: pointer; }
.mc-embed :where(a) { color: inherit; text-decoration: none; }
.mc-embed :is(a, button, input):focus-visible { outline: none; box-shadow: var(--tl-focus-ring); }
.mc-embed :is(.mc-input, .mc-props-q) { width: auto !important; margin: 0 !important; box-shadow: none !important; font: inherit !important; color: var(--tl-ink) !important; }
.mc-embed .mc-input { height: 100% !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; font-size: 16px !important; }
/* The search field is the whole header: no focus ring (components.css rings every input in a tl- card). */
.mc-embed .mc-input:focus-visible { box-shadow: none !important; }
.mc-embed .mc-kbd { background: none; box-shadow: none; }
/* The card is its own stacking context (z-index 1), so the cards after it painted
   over the open search. While it is open the card rises over them and the top bar. */
.mc-embed:has(> .mc-dialog:not([hidden])) { z-index: 60; }
/* Pico makes every [role=group] a full-width input group; the chart's groups are its segments. */
.mc-embed [role="group"] { width: auto; margin: 0; box-shadow: none; vertical-align: baseline; }
.mc-embed [role="group"] > * { flex: none; margin: 0; box-shadow: none; }
.mc-embed .mc-props-q { height: 32px !important; padding: 0 10px !important; border: 1px solid var(--tl-line-10) !important; background: var(--tl-control) !important; font-size: 13px !important; }
.mc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.mc {
  height: 100vh; display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto 46px;
  grid-template-rows: 34px 48px minmax(0, 1fr);
}
.mc.is-panel-closed { grid-template-columns: 46px minmax(0, 1fr) 0 46px; }

/* ---- Tabs: the open charts, above the top bar ---- */
.mc-tabs { grid-row: 1; grid-column: 1 / -1; display: flex; align-items: stretch; min-width: 0; background: var(--tl-fill-03); border-bottom: 1px solid var(--tl-line-07); }
.mc-tab-list { display: flex; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.mc-tab-list::-webkit-scrollbar { display: none; }
/* A tab is as wide as its name and price (a very long one stops at 420px). */
.mc-tab { position: relative; display: flex; align-items: center; flex: none; max-width: 420px; border-right: 1px solid var(--tl-line-07); color: var(--tl-ink-60); }
.mc-tab.is-on { background: var(--tl-page); color: var(--tl-ink); box-shadow: inset 0 -2px 0 var(--tl-ink); }
.mc-tab:not(.is-on):hover { background: var(--tl-fill-05); color: var(--tl-ink); }
.mc-tab-main { display: flex; align-items: center; gap: 7px; flex: 1; min-width: 0; height: 100%; padding: 0 8px 0 12px; white-space: nowrap; font-size: 12.5px; font-weight: 600; }
.mc-tab-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-tab-px { margin-left: 4px; font-size: 11.5px; font-weight: 550; font-variant-numeric: tabular-nums; color: var(--tl-ink-60); }
.mc-tab-px.mc-up { color: var(--tl-up); }
.mc-tab-px.mc-down { color: var(--tl-down); }
.mc-tab-x { display: grid; place-items: center; width: 22px; height: 22px; margin-right: 6px; flex: none; border-radius: 5px; color: var(--tl-ink-50); }
.mc-tab-x:hover { background: var(--tl-fill-07); color: var(--tl-ink); }
.mc-tab-new { display: grid; place-items: center; width: 34px; flex: none; color: var(--tl-ink-60); }
.mc-tab-new:hover { background: var(--tl-fill-05); color: var(--tl-ink); }

/* ---- Top bar ---- */
.mc-top {
  grid-row: 2; grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 10px;
  border-bottom: 1px solid var(--tl-line-07); min-width: 0; overflow-x: auto; scrollbar-width: none;
}
.mc-top::-webkit-scrollbar { display: none; }
.mc-home { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: var(--tl-r-btn); }
.mc-home img { border-radius: 6px; }
.mc-sym {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; flex: none;
  max-width: 340px; border-radius: var(--tl-r-btn); background: var(--tl-fill-05); font-size: 13.5px; font-weight: 600;
}
.mc-sym span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-sym svg { color: var(--tl-ink-50); flex: none; }
.mc-sym:hover { background: var(--tl-fill-07); }
/* A game page's chart names its game, nothing to pick. */
.mc-sym:disabled { color: inherit; background: none; padding-left: 0; cursor: default; }
.mc-seg { display: inline-flex; gap: 2px; padding: 2px; border-radius: var(--tl-r-chip); background: var(--tl-fill-05); flex: none; }
.mc-seg button {
  height: 26px; padding: 0 9px; border-radius: var(--tl-r-seg-in); font-size: 12.5px; font-weight: 550;
  color: var(--tl-ink-60); white-space: nowrap; display: inline-flex; align-items: center; gap: 5px;
}
.mc-seg button:hover { color: var(--tl-ink); }
.mc-seg button { display: inline-flex; align-items: center; gap: 6px; }
.mc-seg button img { border-radius: 3px; flex: none; }
.mc-seg button[aria-pressed="true"] { background: var(--tl-control); color: var(--tl-ink); box-shadow: var(--tl-seg-on-shadow); }
.mc-seg button:disabled { opacity: .4; cursor: default; }
.mc-seg.mc-flat { background: transparent; padding: 0; }
.mc-seg.mc-flat button[aria-pressed="true"] { background: var(--tl-fill-07); box-shadow: none; }
.mc-sep { width: 1px; height: 22px; background: var(--tl-line-10); flex: none; margin: 0 2px; }
.mc-grow { flex: 1 1 0; min-width: 8px; }
.mc-status { font-family: var(--tl-mono); font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--tl-ink-50); white-space: nowrap; }
.mc-icon { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: var(--tl-r-btn); color: var(--tl-ink-60); }
.mc-icon:hover { background: var(--tl-fill-05); color: var(--tl-ink); }
.mc [hidden] { display: none !important; }

/* ---- Drawing rail ---- */
.mc-tools { grid-row: 3; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0; border-right: 1px solid var(--tl-line-07); }
.mc-tool { width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--tl-r-btn); color: var(--tl-ink-60); }
.mc-tool:hover { background: var(--tl-fill-05); color: var(--tl-ink); }
.mc-tool[aria-pressed="true"] { background: var(--tl-fill-07); color: var(--tl-ink); }
.mc-tools-sep { width: 22px; height: 1px; background: var(--tl-line-10); margin: 4px 0; }

/* ---- Stage ---- */
.mc-stage { grid-row: 3; position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.mc-chart { flex: 1 1 0; min-height: 0; position: relative; }
.mc-chart.is-placing { cursor: crosshair; }
/* A flag's label or a line under the pointer can be dragged (and clicked to edit). */
.mc-chart.is-grab-x, .mc-chart.is-grab-x * { cursor: ew-resize !important; }
.mc-chart.is-grab-y, .mc-chart.is-grab-y * { cursor: ns-resize !important; }
/* The flag and line editor, beside where it was clicked. */
.mc-note-edit { position: absolute; z-index: 6; width: 250px; padding: 10px; display: flex; flex-direction: column; gap: 8px;
  border-radius: var(--tl-r-card); border: 1px solid var(--tl-line-10); background: var(--tl-page); box-shadow: var(--tl-float-shadow); }
.mc-note-edit[hidden] { display: none; }
.mc-note-edit input { width: 100%; height: 32px !important; margin: 0 !important; padding: 0 10px !important; border-radius: var(--tl-r-btn) !important;
  border: 1px solid var(--tl-line-10) !important; background: var(--tl-fill-03) !important; color: var(--tl-ink) !important; font-size: 13px !important; outline: none; box-shadow: none !important; }
.mc-note-edit input:focus { border-color: var(--tl-ink-45) !important; }
.mc-note-acts { display: flex; align-items: center; gap: 6px; }
.mc-note-acts .mc-chip[hidden] { display: none; }
.mc-note-acts .mc-chip.is-on { background: var(--tl-ink); color: var(--tl-page); border-color: transparent !important; }
.mc-legend {
  position: absolute; z-index: 3; top: 8px; left: 12px; right: 80px; pointer-events: none;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 13px;
}
.mc-legend-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mc-legend-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-legend-meta .mc-logo { margin-right: 4px; vertical-align: -2px; }
.mc-legend-name { font-size: 15px; font-weight: 650; letter-spacing: -.2px; white-space: nowrap; }
/* The title is the side switch. */
.mc-flip { pointer-events: auto; display: inline-flex; align-items: center; gap: 8px; margin: -3px 0 -3px -6px; padding: 3px 8px 3px 6px; border-radius: var(--tl-r-btn); }
.mc-flip svg { color: var(--tl-ink-45); }
.mc-flip:hover { background: var(--tl-fill-06); }
.mc-flip:hover svg { color: var(--tl-ink); }
.mc-legend-meta { color: var(--tl-ink-60); }
.mc-legend-ohlc { display: flex; align-items: baseline; gap: 8px; flex: none; font-variant-numeric: tabular-nums; color: var(--tl-ink-60); white-space: nowrap; }
.mc-legend-ohlc b { font-weight: 550; color: var(--tl-ink); }
.mc-up { color: var(--tl-up) !important; }
.mc-down { color: var(--tl-down) !important; }
.mc-empty {
  position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; text-align: center; padding: 24px;
  color: var(--tl-ink-60); font-size: 14px; line-height: 1.5;
}
.mc-empty b { display: block; color: var(--tl-ink); font-size: 16px; font-weight: 650; margin-bottom: 4px; }
.mc-bottom { height: 36px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 12px; border-top: 1px solid var(--tl-line-07); }
.mc-note { font-size: 12px; color: var(--tl-ink-50); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mc-clock { font-family: var(--tl-mono); font-size: 11px; color: var(--tl-ink-50); white-space: nowrap; }

/* ---- Tool panel + rail ---- */
.mc-panel { grid-row: 3; width: 320px; border-left: 1px solid var(--tl-line-07); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.mc.is-panel-closed .mc-panel { display: none; }
.mc-panel > section { display: flex; flex-direction: column; min-height: 0; flex: 1 1 0; }
.mc-panel-head { height: 42px; flex: none; display: flex; align-items: center; padding: 0 14px; border-bottom: 1px solid var(--tl-line-06); }
.mc-panel-head h2 { margin: 0; font-size: 13.5px; font-weight: 650; }
.mc-watch, .mc-details { overflow-y: auto; flex: 1 1 0; min-height: 0; }
.mc-watch-label { font-family: var(--tl-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--tl-ink-50); padding: 14px 16px 6px; }
.mc-watch-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; width: 100%; text-align: left;
  padding: 12px 16px; border-bottom: 1px solid var(--tl-line-05); font-size: 14px;
}
.mc-watch-row:hover { background: var(--tl-fill-03); }
.mc-watch-row[aria-current="true"] { background: var(--tl-fill-06); box-shadow: inset 2px 0 0 var(--tl-ink); }
.mc-watch-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; }
.mc-watch-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* A game: its two teams, one a line with its logo, the time under them. */
.mc-watch-teams { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mc-watch-team { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 600; }
.mc-watch-rec { flex: none; font-size: 11.5px; font-weight: 500; color: var(--tl-ink-45); font-variant-numeric: tabular-nums; }
.mc-watch-pts { flex: none; margin-left: auto; padding-left: 10px; font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }
/* A finished game's loser reads dimmer, as on Scores. */
.mc-watch-team.is-loser { color: var(--tl-ink-50); font-weight: 500; }
.mc-watch-team.is-loser .mc-logo { opacity: .6; }
.mc-watch-row:has(.mc-watch-teams) .mc-watch-sub { padding-left: 30px; }
.mc-watch-sub { grid-column: 1 / -1; margin-top: 4px; font-size: 12px; color: var(--tl-ink-50); }
.mc-watch-tag { font-family: var(--tl-mono); font-size: 10px; letter-spacing: .05em; color: var(--tl-ink-50); align-self: start; padding-top: 3px; }
.mc-details { padding: 14px; display: flex; flex-direction: column; gap: 14px; font-size: 13px; }
/* Order book and Trades: price ladders, numbers right-aligned. */
.mc-tape { flex: 1 1 0; min-height: 0; overflow-y: auto; padding: 6px 10px 14px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.mc-tape-sub { font-size: 12px; color: var(--tl-ink-45); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-tape-empty, .mc-tape-note { margin: 12px 4px 0; color: var(--tl-ink-45); font-size: 12px; line-height: 1.45; }
.mc-ob-head, .mc-ob-row, .mc-tr-head, .mc-tr-row { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center; gap: 8px; height: 24px; padding: 0 6px; }
.mc-tr-head, .mc-tr-row { grid-template-columns: 1.25fr 1.2fr .8fr 1fr; }
.mc-ob-head, .mc-tr-head { color: var(--tl-ink-45); font-size: 11px; }
.mc-ob-head > :not(:first-child), .mc-ob-row > :not(:first-child), .mc-tr-head > :nth-child(n+3), .mc-tr-row > :nth-child(n+3) { text-align: right; }
.mc-ob-row { position: relative; }
.mc-ob-row > span { position: relative; }
.mc-ob-row > i { position: absolute; right: 0; top: 2px; bottom: 2px; border-radius: 2px; opacity: .14; }
.mc-ob-row.is-ask > i { background: var(--tl-down); }
.mc-ob-row.is-bid > i { background: var(--tl-up); }
.mc-ob-row.is-ask > span:first-child { color: var(--tl-down); }
.mc-ob-row.is-bid > span:first-child { color: var(--tl-up); }
.mc-ob-mid { display: flex; justify-content: space-between; margin: 4px 0; padding: 6px; border-block: 1px solid var(--tl-line-07); color: var(--tl-ink-60); font-size: 12px; }
.mc-tr-row > * { white-space: nowrap; }
.mc-tr-row > :nth-child(2) { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.mc-tr-row { border-radius: 4px; }
.mc-tr-row.is-new { animation: mc-tr-new 1.4s ease-out; }
@keyframes mc-tr-new { from { background: var(--tl-fill-06); } }
@media (prefers-reduced-motion: reduce) { .mc-tr-row.is-new { animation: none; } }
.mc-details h3 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -.2px; }
.mc-details p { margin: 0; color: var(--tl-ink-60); line-height: 1.5; }
.mc-dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; }
.mc-dl dt { color: var(--tl-ink-50); }
.mc-dl dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

/* ---- Strategy Builder: its rule in the panel (strategy-builder.css cards, made flat) ---- */
.mc[data-open-panel="builder"] .mc-panel { width: 384px; }
.mc-chip { height: 26px; padding: 0 10px; border-radius: var(--tl-r-chip); font-size: 12px; font-weight: 600; color: var(--tl-ink-60); border: 1px solid var(--tl-line-10) !important; }
.mc-chip:hover { color: var(--tl-ink); }
.mc-chip[aria-pressed="true"] { background: var(--tl-fill-07); color: var(--tl-ink); border-color: transparent !important; }
.mc-sb.sb { display: flex; flex-direction: column; gap: 10px; padding: 12px; overflow-y: auto; flex: 1 1 0; min-height: 0; }
.mc-sb .sb-rule { position: static; gap: 10px; }
.mc-sb .tl-card { box-shadow: none; }
.mc-sb .tl-card-head { padding: 10px 14px 9px; }
.mc-sb .tl-card-title { font-size: 13.5px; }
.mc-sb .sb-card-body { padding: 10px 12px 12px; gap: 9px; }
.mc-sb .sb-row { grid-template-columns: 70px minmax(0, 1fr); gap: 8px; }
.mc-sb .sb-head { padding: 12px 14px; }
.mc-sb .sb-sentence { font-size: 14px; }
.mc-sb .sb-save { margin-top: 10px; padding-top: 10px; }
.mc-sb .sb-name { flex-basis: 100%; max-width: none; }
.mc-sb-list { border: 1px solid var(--tl-line-07); border-radius: var(--tl-r-card); background: var(--tl-card-body); }
.mc-sb-list summary { padding: 9px 14px; font-size: 12.5px; font-weight: 650; color: var(--tl-ink-70); cursor: pointer; list-style-position: inside; }
.mc-sb-list summary:hover { color: var(--tl-ink); }
.mc-sb-list > div { padding: 0 6px 6px; }
.mc-sb .sb-preset, .mc-sb .sb-mine { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; padding: 7px 8px;
  border-radius: var(--tl-r-btn); font-size: 13px; text-align: left; color: var(--tl-ink-70); }
.mc-sb .sb-preset:hover, .mc-sb .sb-mine:hover { background: var(--tl-fill-05); color: var(--tl-ink); }
.mc-sb .sb-mine.is-on { background: var(--tl-fill-07); color: var(--tl-ink); }

/* ---- The Backtest drawer under the chart ---- */
/* ---- Game panel under the chart: scoreboard, scoring, team stats, leaders ---- */
.mc-info { display: flex; flex-direction: column; height: 280px; flex: none; min-height: 0; border-top: 1px solid var(--tl-line-07); }
.mc-info[hidden] { display: none; }
.mc-info-body { flex: 1 1 0; min-height: 0; overflow: hidden; }
.mc-info-body > .mc-tape-empty { margin: 14px; }
.mc-info-grid { height: 100%; display: grid; grid-template-columns: minmax(270px, 1.1fr) minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 1fr); }
.mc-info-col { min-width: 0; min-height: 0; overflow-y: auto; padding: 12px 14px; border-left: 1px solid var(--tl-line-06); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.mc-info-col:first-child { border-left: 0; }
.mc-info-col h3 { margin: 0 0 8px; font-size: 11px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; color: var(--tl-ink-45); }
.mc-info-col .mc-logo { flex: none; }
/* The score by period. */
.mc-ls { width: 100%; border-collapse: collapse; }
.mc-ls th, .mc-ls td { padding: 4px 4px; text-align: center; font-weight: 450; color: var(--tl-ink-60); }
.mc-ls thead th { font-size: 11px; color: var(--tl-ink-45); }
.mc-ls tbody th { text-align: left; white-space: nowrap; }
.mc-ls tbody th > * { vertical-align: middle; }
.mc-ls tbody th b { margin: 0 6px; font-size: 14px; font-weight: 650; color: var(--tl-ink); }
.mc-ls tbody th span { font-size: 11.5px; color: var(--tl-ink-45); }
.mc-ls .mc-ls-t { font-size: 17px; font-weight: 700; color: var(--tl-ink); }
.mc-ball { display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; background: var(--tl-live); }
.mc-sit { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 7px 10px; border-radius: var(--tl-r-btn); background: var(--tl-fill-05); }
.mc-sit b { font-weight: 650; }
.mc-sit span { margin-left: auto; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .4px; color: var(--tl-down); }
.mc-sit.is-red { background: color-mix(in srgb, var(--tl-down) 12%, transparent); }
.mc-info-last { margin: 10px 0 0; line-height: 1.45; color: var(--tl-ink-60); }
.mc-info-last span { display: block; margin-bottom: 2px; font-size: 11px; color: var(--tl-ink-45); }
/* Scoring plays, newest first. */
.mc-info-plays { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 9px; }
.mc-info-plays li { display: grid; grid-template-columns: 52px 16px minmax(0, 1fr) auto; gap: 8px; align-items: start; line-height: 1.4; }
.mc-info-when, .mc-info-sc { color: var(--tl-ink-45); white-space: nowrap; }
.mc-info-sc { font-weight: 600; color: var(--tl-ink); }
.mc-info-text { color: var(--tl-ink-60); }
.mc-info-text b { color: var(--tl-ink); font-weight: 650; }
.mc-info-text i { font-style: normal; color: var(--tl-ink-45); }
/* The play-by-play: its filters stay in view over the list. */
.mc-info-pbp { padding-top: 0; }
.mc-pbp-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding: 10px 0 8px; margin-bottom: 4px; background: var(--tl-page); }
.mc-pbp-head h3 { margin: 0; }
.mc-pbp-filter button { height: 24px; padding: 0 8px; font-size: 11.5px; }
.mc-pbp-filter button span { color: var(--tl-ink-45); font-weight: 500; }
.mc-info-plays li.is-score .mc-info-text b { color: var(--tl-up); }
.mc-info-plays li.is-mark { position: relative; margin: -4px -6px; padding: 4px 6px; border-radius: var(--tl-r-btn); cursor: pointer; }
.mc-info-plays li.is-mark:hover { background: var(--tl-fill-05); }
.mc-info-plays li.is-on { background: var(--tl-fill-07); }
/* A marked score: a straight bar down its left edge (an inset shadow would follow the rounded corners). */
.mc-info-plays li.is-on::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 2px; border-radius: 1px; background: var(--tl-ink); }
/* Team stats side by side. */
.mc-info-stats { width: 100%; border-collapse: collapse; }
.mc-info-stats th, .mc-info-stats td { padding: 4px 2px; }
.mc-info-stats thead th { font-size: 11.5px; font-weight: 650; white-space: nowrap; }
.mc-info-stats thead th:first-child, .mc-info-stats td:first-child { text-align: left; }
.mc-info-stats thead th:last-child, .mc-info-stats td:last-child { text-align: right; }
.mc-info-stats thead .mc-logo { vertical-align: -3px; margin: 0 5px; }
.mc-info-stats tbody th { font-weight: 450; color: var(--tl-ink-45); text-align: center; font-size: 11.5px; }
.mc-info-stats td { font-weight: 550; white-space: nowrap; }
/* Each team's leader in a category. */
.mc-lead + .mc-lead { margin-top: 10px; }
.mc-lead h4 { margin: 0 0 4px; font-size: 11.5px; font-weight: 450; color: var(--tl-ink-45); }
.mc-lead > div { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.mc-lead > div > span { display: flex; flex-direction: column; min-width: 0; color: var(--tl-ink-60); font-size: 12px; }
.mc-lead b { color: var(--tl-ink); font-weight: 600; }
@media (max-width: 1100px) { .mc-info-grid { grid-template-columns: minmax(260px, 1fr) minmax(0, 1fr); overflow-y: auto; } .mc-info-col { overflow: visible; border-top: 1px solid var(--tl-line-06); } }
.mc-tester.sb { display: flex; flex-direction: column; height: 300px; flex: none; min-height: 0; border-top: 1px solid var(--tl-line-07); }
.mc-tester.is-min { height: auto; }
.mc-tester.is-min > :not(.mc-tester-head) { display: none; }
.mc-tester.is-min [data-mc-tester-min] svg { transform: rotate(180deg); }
.mc-tester-head { height: 40px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 6px 0 14px; border-bottom: 1px solid var(--tl-line-06); }
.mc-tester-head h2 { margin: 0; font-size: 13.5px; font-weight: 650; }
.mc-tester-head .mc-icon { width: 28px; height: 28px; }
.mc-tester-sub { font-size: 12px; color: var(--tl-ink-50); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-tester .sb-error { margin: 8px 14px 0; }
.mc-tester-body { flex: 1 1 0; min-height: 0; overflow: auto; }
.mc-tester-results:not([hidden]) { display: grid; grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); gap: 12px; padding: 12px 14px; }
.mc-tester .sb-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; align-content: start; }
.mc-tester .sb-kpi { padding: 9px 11px; box-shadow: none; }
.mc-tester .sb-kpi-v { font-size: 17px; }
.mc-tester-curve { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.mc-tester .sb-chart { flex: 1 1 0; height: auto; min-height: 140px; margin: 0; }
.mc-tester .sb-coverage { padding: 6px 0 0; font-size: 11.5px; }
.mc-tester table.tl-table { font-size: 12.5px; }
.mc-tester table.tl-table :is(th, td) { padding: 6px 10px; }
.mc-tester table.tl-table :is(th, td):first-child { padding-left: 14px; }
.mc-tester table.tl-table thead th { position: sticky; top: 0; z-index: 1; background: var(--tl-page); font-size: 11.5px; color: var(--tl-ink-50); font-weight: 600; }
.mc-tester tr.sb-bet:hover td { background: var(--tl-fill-03); }
.mc-tester tr.sb-bet.is-on td { background: var(--tl-fill-06); }
.mc-tester tr.sb-bet.is-on td:first-child { box-shadow: inset 2px 0 0 var(--tl-ink); }
.mc-tester-label { padding: 10px 14px 4px; font-family: var(--tl-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--tl-ink-50); }
.mc-tester .sb-live-kpis { padding: 4px 14px; }
.mc-tester .sb-live .sb-coverage { padding: 4px 14px 0; }
.mc-tester-hint { margin: 0; padding: 8px 14px 12px; font-size: 11.5px; color: var(--tl-ink-50); }
.mc-btn {
  display: inline-flex; align-items: center; justify-content: center; height: 36px; padding: 0 14px; align-self: flex-start;
  border-radius: var(--tl-r-btn); background: var(--tl-ink); color: var(--tl-on-ink) !important; font-size: 13px; font-weight: 650;
}
.mc-btn:hover { background: var(--tl-ink-hover); }
.mc-rail { grid-row: 3; grid-column: 4; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0; border-left: 1px solid var(--tl-line-07); }
.mc-rail button { width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--tl-r-btn); color: var(--tl-ink-60); }
.mc-rail button:hover { background: var(--tl-fill-05); color: var(--tl-ink); }
.mc-rail button[aria-pressed="true"] { background: var(--tl-fill-07); color: var(--tl-ink); }

/* ---- Search ---- */
.mc-dialog { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .45); display: flex; justify-content: center; padding-top: 12vh; }
.mc-dialog-box {
  width: min(560px, calc(100vw - 32px)); max-height: 66vh; display: flex; flex-direction: column;
  background: var(--tl-page); border: 1px solid var(--tl-line-10); border-radius: var(--tl-r-card); box-shadow: var(--tl-float-shadow); overflow: hidden;
}
.mc-search-head { display: flex; align-items: center; gap: 12px; height: 58px; flex: none; padding: 0 16px; border-bottom: 1px solid var(--tl-line-07); color: var(--tl-ink-50); }
.mc-input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; padding: 0; font-size: 16px; color: var(--tl-ink); outline: none; }
.mc-page .mc-input:focus-visible { box-shadow: none; }
.mc-input::-webkit-search-cancel-button { display: none; }
.mc-input::placeholder { color: var(--tl-ink-45); }
.mc-kbd { flex: none; padding: 2px 6px; border: 1px solid var(--tl-line-10); border-radius: 5px; font: 500 10.5px var(--tl-mono); color: var(--tl-ink-50); }
.mc-search-bar { display: flex; align-items: center; gap: 10px; flex: none; padding: 10px 16px; border-bottom: 1px solid var(--tl-line-06); }
.mc-results { overflow-y: auto; }
.mc-results .mc-watch-row:focus-visible { box-shadow: inset 0 0 0 2px var(--tl-ink); }
.mc-results-empty { padding: 18px 16px; color: var(--tl-ink-50); font-size: 13px; }

/* ---- Locked ---- */
.mc-sb-lock { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 18px 16px; }
.mc-lock-k { font-family: var(--tl-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--tl-ink-50); }
.mc-sb-lock p { margin: 0; font-size: 13px; color: var(--tl-ink-60); line-height: 1.55; }

/* ---- Small screens: the panel floats over the chart ---- */
@media (max-width: 900px) {
  .mc { grid-template-columns: 0 minmax(0, 1fr) 0 46px; }
  .mc-tools { display: none; }
  .mc-panel { position: fixed; z-index: 20; top: 82px; right: 46px; bottom: 0; width: min(300px, calc(100vw - 46px)); background: var(--tl-page); box-shadow: var(--tl-float-shadow); }
  .mc[data-open-panel="builder"] .mc-panel { width: min(384px, calc(100vw - 46px)); }
  .mc-tester.sb { height: 46vh; }
  .mc-tester-results:not([hidden]) { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .mc * { transition: none !important; } }

/* ---- Logos ---- */
.mc-logo { display: inline-block; flex: none; object-fit: contain; }
img.mc-logo[loading] { background: none; } /* lazy-load.css fills lazy images with a dark placeholder */
.mc-logo.is-none { border-radius: 50%; background: var(--tl-fill-07); }
.mc-pair { display: inline-flex; align-items: center; flex: none; }
.mc-pair:empty { display: none; }
.mc-pair > .mc-logo + .mc-logo { margin-left: -4px; }
.mc-details-teams { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.mc-details-team { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; }
.mc-details-team b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-details-at { display: none; }

/* ---- Props: a game's in Details, a prop's lines ---- */
.mc-props { display: flex; flex-direction: column; gap: 8px; margin: 4px -14px 0; padding: 14px 14px 0; border-top: 1px solid var(--tl-line-06); }
.mc-props-head { display: flex; align-items: baseline; gap: 8px; }
.mc-props-head h4 { margin: 0; font-size: 13.5px; font-weight: 650; }
.mc-props-n { font-size: 12px; color: var(--tl-ink-50); }
.mc-props-q { height: 32px; padding: 0 10px; border: 1px solid var(--tl-line-10); border-radius: var(--tl-r-btn); background: var(--tl-control); font-size: 13px; outline: none; }
.mc-props-q:focus { border-color: var(--tl-ink-45); }
.mc-props-list { display: flex; flex-direction: column; margin: 0 -14px; }
.mc-prop { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 14px; border-bottom: 1px solid var(--tl-line-05); text-align: left; }
.mc-prop:hover { background: var(--tl-fill-03); }
.mc-prop.is-on { background: var(--tl-fill-06); box-shadow: inset 2px 0 0 var(--tl-ink); }
.mc-prop-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.mc-prop-text b { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-prop-text span { font-size: 12px; color: var(--tl-ink-50); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-prop-px { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mc-prop-ex { display: inline-flex; gap: 3px; }
.mc-prop-ex .mc-logo { border-radius: 3px; }
.mc-props-more { margin: 8px 14px 0; height: 32px; border: 1px solid var(--tl-line-10) !important; border-radius: var(--tl-r-btn); font-size: 12.5px; font-weight: 600; color: var(--tl-ink-70); }
.mc-props-more:hover { color: var(--tl-ink); }
.mc-props-empty { margin: 0; padding: 8px 14px; font-size: 12.5px; color: var(--tl-ink-50); }
.mc-prop-game { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 1px solid var(--tl-line-07) !important; border-radius: var(--tl-r-btn); text-align: left; font-weight: 600; }
.mc-prop-game:hover { background: var(--tl-fill-03); }
.mc-prop-game span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-prop-game-k { font-family: var(--tl-mono); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: var(--tl-ink-50); }

/* ---- The Markets page's chart (markets/_chart_embed.html): the chart and
   its games and Details, read-only, in a card ---- */
.mc-embed { display: grid; grid-template-columns: minmax(0, 1fr) auto 46px; grid-template-rows: 48px 580px; padding: 0; overflow: hidden; }
.mc-embed > .mc-top { grid-row: 1; grid-column: 1 / -1; padding: 0 10px; }
.mc-embed > .mc-stage { grid-row: 2; grid-column: 1; }
.mc-embed > .mc-panel { grid-row: 2; grid-column: 2; }
.mc-embed.is-panel-closed > .mc-panel { display: none; }
.mc-embed > .mc-rail { grid-row: 2; grid-column: 3; justify-content: flex-start; } /* Pico spreads a nav's children */
.mc-embed [data-panel="props"] .mc-props { margin-top: 0; padding-top: 0; border-top: 0; }
.mc-embed :is([data-panel="props"], [data-panel="bets"]) .mc-panel-head { gap: 8px; }
/* On the Markets page a picked row's fill is its highlight: no edge mark. */
.mc-embed :is(.mc-watch-row[aria-current="true"], .mc-prop.is-on) { box-shadow: none; }
/* Its filter is the site's search box (components.css .tl-search, the top bar's fill); the input inside carries no box of its own. */
.mc-embed .mc-props-search { width: auto; height: 32px; margin: 0; }
.mc-embed .mc-props-search:focus-within { border-color: var(--tl-line-20); }
.mc-embed .mc-props-search .mc-props-q { flex: 1; min-width: 0; height: 100% !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; }
.mc-embed .mc-props-search .mc-props-q::-webkit-search-cancel-button { display: none; }
/* The strategies strip over it (markets/_strategies_strip.html): a tile is the
   strategy's name and market over its record, its PnL and two weeks' change right. */
/* A tile is as wide as its full name: names never clip. */
.mc-stile { min-width: 250px; }
.mc-stile-name b { overflow: visible; text-overflow: clip; white-space: nowrap; }
.mc-stile-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mc-stile-name { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13.5px; }
.mc-stile-name b { font-weight: 600; }
.mc-stile-sub, .mc-stile-px span { font-size: 11.5px; color: var(--tl-ink-50); white-space: nowrap; }
.mc-stile-px { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-variant-numeric: tabular-nums; }
.mc-stile-px b { font-size: 14px; font-weight: 650; }
.mc-stile-px .is-pos, .mc-stile-sub .is-pos { color: var(--tl-up); }
.mc-stile-px .is-neg, .mc-stile-sub .is-neg { color: var(--tl-down); }
.mc-stile-sub b { font-weight: 550; color: var(--tl-ink-60); }
.mc-stile-lock { color: var(--tl-ink-50); font-weight: 600; }
/* The strategies chart (markets/_strategy_chart.html): its account in the top
   bar (the legend, less the name the search button already shows) and its Bets. */
.mc-toplegend { display: flex; align-items: center; min-width: 0; font-size: 12.5px; }
.mc-toplegend .mc-legend-top { display: none; }
.mc-bet { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--tl-line-05); }
.mc-bet-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.mc-bet-text b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-bet-text b > .mc-logo, .mc-bet-text b > .mc-pair { margin-right: 6px; vertical-align: -3px; }
.mc-bet-text b > .mc-pair { display: inline-flex; }
/* A strategy chart's bet card, by the hovered dot (markets-chart.js betTip). */
.mc-tip {
  position: absolute; z-index: 6; pointer-events: none; min-width: 180px; max-width: 260px; padding: 9px 11px;
  display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--tl-ink-60);
  background: var(--tl-page); border: 1px solid var(--tl-line-10); border-radius: var(--tl-r-card); box-shadow: var(--tl-float-shadow);
}
.mc-tip[hidden] { display: none; }
.mc-tip-pick { display: flex; align-items: center; gap: 7px; min-width: 0; }
.mc-tip-pick b { font-size: 13px; font-weight: 600; color: var(--tl-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-tip-game { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-tip-res { display: flex; align-items: baseline; gap: 8px; font-variant-numeric: tabular-nums; }
.mc-tip-res b { font-weight: 650; color: var(--tl-ink); }
.mc-tip-res b.mc-up { color: var(--tl-up); }
.mc-tip-res b.mc-down { color: var(--tl-down); }
.mc-tip-hint { margin-top: 2px; font-size: 11px; color: var(--tl-ink-50); }
.mc-bet-text span, .mc-bet-px span { font-size: 11.5px; color: var(--tl-ink-50); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-bet-px { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; font-variant-numeric: tabular-nums; }
.mc-bet-px b { font-size: 13px; font-weight: 600; }
/* The Markets page's strategies chart sits on its strip of strategies
   (markets/_strategies_strip.html), as close as the games strip to its chart. */
.mc-embed[data-mc-mode="strategies"]:has(+ .mk-mkt) { margin-bottom: 0; }
/* The exchange switch in the top bar (markets-chart.js exSelect): the charted
   exchange, a menu of both placed on the page under it (the bar scrolls sideways). */
.mc-exsel { flex: none; }
.mc-exsel:empty { display: none; }
.mc-exsel i { width: 12px; height: 3px; border-radius: 2px; flex: none; }
.mc-exsel img { border-radius: 3px; }
.mc-exsel-btn {
  height: 28px; padding: 0 8px 0 9px; border-radius: var(--tl-r-chip); display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 550; color: var(--tl-ink); background: var(--tl-fill-05); white-space: nowrap;
}
.mc-exsel-btn:hover, .mc-exsel-btn[aria-expanded="true"] { background: var(--tl-fill-07); }
.mc-exsel-btn svg { color: var(--tl-ink-50); }
.mc-exsel-menu {
  position: fixed; z-index: 60; width: 220px; padding: 4px; display: flex; flex-direction: column; gap: 2px;
  background: var(--tl-page); border: 1px solid var(--tl-line-10); border-radius: var(--tl-r-card); box-shadow: var(--tl-float-shadow);
}
.mc-exsel-menu[hidden] { display: none; }
.mc-exsel-menu button { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: var(--tl-r-seg-in); text-align: left; color: var(--tl-ink); font-size: 13px; }
.mc-exsel-menu button:hover:not(:disabled), .mc-exsel-menu button[aria-checked="true"] { background: var(--tl-fill-05); }
.mc-exsel-menu button:disabled { opacity: .45; cursor: default; }
.mc-exsel-menu span { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.mc-exsel-menu b { font-weight: 600; }
.mc-exsel-menu small { font-size: 11.5px; color: var(--tl-ink-50); }
.mc-set { display: flex; flex-direction: column; gap: 8px; }
.mc-set.is-row { flex-direction: row; align-items: center; justify-content: space-between; }
.mc-set-k { font-size: 12px; color: var(--tl-ink-60); }
.mc-set-seg { display: flex; }
.mc-embed .mc-set-seg > button { flex: 1 1 0; min-width: 0; justify-content: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-switch { position: relative; width: 34px; height: 20px; flex: none; border-radius: 999px; background: var(--tl-fill-07); box-shadow: inset 0 0 0 1px var(--tl-line-10); transition: background .15s; }
.mc-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--tl-ink-60); transition: transform .15s, background .15s; }
.mc-switch[aria-pressed="true"] { background: var(--tl-ink); }
.mc-switch[aria-pressed="true"]::after { transform: translateX(14px); background: var(--tl-page); }
.mc-full { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; flex: none; border-radius: var(--tl-r-btn); color: var(--tl-ink-60) !important; font-size: 12.5px; font-weight: 550; white-space: nowrap; }
.mc-full:hover { background: var(--tl-fill-05); color: var(--tl-ink) !important; }
/* A game on now: the Live tag, when the chart last read its prices, and Refresh. */
.mc-live { display: inline-flex; align-items: center; gap: 8px; flex: none; margin-right: 4px; font-size: 12px; color: var(--tl-ink-45); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mc-live[hidden] { display: none; }
.mc-live-tag { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; background: color-mix(in srgb, var(--tl-live) 14%, transparent); color: var(--tl-live); font-size: 11px; font-weight: 650; letter-spacing: .4px; text-transform: uppercase; }
.mc-live-tag .tl-dot { animation: mc-live-pulse 1.6s ease-in-out infinite; }
@keyframes mc-live-pulse { 50% { opacity: .3; } }
.mc-live-btn { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: var(--tl-r-btn); color: var(--tl-ink-60); }
.mc-live-btn:hover { background: var(--tl-fill-05); color: var(--tl-ink); }
.mc-live-btn.is-busy svg { animation: mc-live-spin .8s linear infinite; }
@keyframes mc-live-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .mc-live-tag .tl-dot, .mc-live-btn.is-busy svg { animation: none; } }
@media (max-width: 640px) { .mc-live-at { display: none; } }
@media (max-width: 900px) {
  .mc-embed { grid-template-columns: minmax(0, 1fr) 46px; grid-template-rows: 48px 380px auto; }
  .mc-embed > .mc-rail { grid-column: 2; }
  .mc-embed > .mc-panel { position: static; grid-row: 3; grid-column: 1 / -1; width: auto; box-shadow: none; border-left: 0; border-top: 1px solid var(--tl-line-07); }
  /* Under the chart the panel has no height to share: each part scrolls in its own. */
  .mc-embed > .mc-panel > section { flex: none; }
  .mc-embed :is(.mc-watch, .mc-details) { flex: none; max-height: 440px; }
  .mc-embed > .mc-top { overflow-x: auto; }
}

/* Novig, greyed and not selectable until it has a live stream (2026-10-31):
   its name in Details, its logo on props and the games strip, and a prop only
   Novig lists. */
.mc-off { opacity: .38; }
.mc-prop.is-off { cursor: default; }
.mc-prop.is-off .mc-prop-text, .mc-prop.is-off .mc-prop-px { opacity: .5; }
