/* My bets — docs/design/my-bets-2026-09-17.md, with the build reviews in
 * docs/design/my-bets-evidence/review-pass1-fable.md and review-pass2-fable.md.
 *
 * One dense row per bet: 64 px on a desk; on a phone a 104 px card, 152 px with
 * Edit/Cancel, 168 px at most with one status line under the buttons. Only
 * existing tokens are used, plus --negative and --focus, which the base defines
 * and a brand overrides only where the contrast script says it must. Colour
 * never speaks alone: every status, side and sign is also a word. Every class
 * here is scoped to .mybets so nothing reaches the event page's tickets (R36).
 */

.mybets { padding-bottom: 40px; --mybets-news: 0px; --mybets-sticky: calc(var(--mybets-news) + var(--header)); word-spacing: .05em; }
/* The news ticker pushes the sticky masthead down by its own height. */
#app > .tenant-news:not([hidden]) ~ .main .mybets { --mybets-news: 32px; }
/* An author `display` beats the UA's [hidden]; inside this page it never may. */
.mybets [hidden] { display: none !important; }
/* Said to a screen reader, not shown: the base has no such utility yet. */
.mybets .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.mybets .is-narrow { display: none; }
.mybets .is-positive { color: var(--positive); }
.mybets .is-negative { color: var(--negative); }
.mybets .is-dim { color: var(--dim); }
.mybets :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ── heading (R6) ─────────────────────────────────────────────────────────── */
.mybets-head { display: flex; align-items: center; gap: 16px; padding: 26px 0 18px; }
.mybets-head h1 { font-size: 34px; margin-right: auto; }
.mybets-updated { font-size: 12px; font-weight: 600; color: var(--dim); font-variant-numeric: tabular-nums; }
.mybets-refresh { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 12px; font-weight: 650; }
.mybets-refresh .icon { width: 16px; height: 16px; }
.mybets-refresh:hover { border-color: var(--border); }
.mybets-refresh.is-busy .icon { animation: mybets-spin 1s linear infinite; }
@keyframes mybets-spin { to { transform: rotate(360deg); } }
.mybets-statement { font-size: 13px; font-weight: 600; min-height: 40px; }
.mybets-statement .icon { width: 16px; height: 16px; }

/* ── summary strip (§4; R1, R14, R22, R23) ────────────────────────────────── */
.mybets-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.mybets-tiles.is-busy { opacity: .6; }
.mybets-tile { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 3px; min-height: 88px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-align: left; overflow: hidden; min-width: 0; }
button.mybets-tile { cursor: pointer; transition: border-color .15s, background .15s; }
button.mybets-tile:hover { border-color: var(--border); background: var(--surface-2); }
.mybets-tile.has-rail:before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand); }
.mybets-tile-label { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.mybets-tile-value { font-family: var(--display); font-size: 22px; line-height: 1.1; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.mybets-tile-value .mybets-none { color: var(--dim); }
.mybets-tile-sub { font-size: 11px; font-weight: 600; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* "n unmatched" is a fact, not an alarm: ink, never the brand colour (R22). */
.mybets-tile-sub.is-strong { color: var(--text); }
.mybets-tiles.is-skeleton .mybets-tile > * { visibility: hidden; }
.mybets-tiles.is-skeleton .mybets-tile { background: var(--surface-2); }

/* ── controls (§2; R5, R7, R15, R18, R34) ─────────────────────────────────── */
.mybets-bar-primary { display: flex; align-items: center; gap: 12px; padding-top: 14px; background: var(--bg); }
.mybets-count { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--dim); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mybets-count[hidden] + .mybets-search-toggle, .mybets-count[hidden] ~ .mybets-seg-type { margin-left: auto; }
.mybets-search-toggle { display: none; }
.mybets-seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--sunken); border-radius: 8px; flex-shrink: 0; }
.mybets-seg > button { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; padding: 0 14px; border: 1px solid transparent; border-radius: 6px; font-size: 12px; font-weight: 650; color: var(--dim); white-space: nowrap; transition: background .15s, color .15s; }
/* 32 px of paint, 40 px of target: the same trick the chips use. */
.mybets-seg > button:before { content: ''; position: absolute; left: 0; right: 0; top: -4px; bottom: -4px; }
.mybets-seg > button:hover { color: var(--text); }
.mybets-seg > button.is-active { background: var(--surface); border-color: var(--line); color: var(--text); }
.mybets-seg-count { font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--dim); }
.mybets-seg > button.is-active .mybets-seg-count { color: var(--accent-ink, var(--text)); }

.mybets-bar { display: flex; flex-direction: column; gap: 8px; padding: 8px 0 12px; background: var(--bg); }
.mybets-bar.is-collapsed { display: none; }
.mybets-bar-filters { display: flex; align-items: center; gap: 12px; min-width: 0; }

/* A chip row owns its fades; they never scroll with the chips (R5). */
.mybets-scroller { position: relative; min-width: 0; }
.mybets-chips { display: flex; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; padding: 4px 0; }
.mybets-chips::-webkit-scrollbar { display: none; }
.mybets-fade { position: absolute; top: 0; bottom: 0; width: 24px; pointer-events: none; display: none; align-items: center; color: var(--dim); font-size: 14px; font-style: normal; }
.mybets-fade.is-start { left: 0; background: linear-gradient(90deg, var(--bg), transparent); }
.mybets-fade.is-end { right: 0; justify-content: flex-end; background: linear-gradient(270deg, var(--bg) 40%, transparent); }
.mybets-fade i { font-style: normal; line-height: 1; }
.mybets-scroller[data-start="false"] .mybets-fade.is-start, .mybets-scroller[data-end="false"] .mybets-fade.is-end { display: flex; }

.mybets-chip { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--dim); white-space: nowrap; scroll-snap-align: start; flex-shrink: 0; transition: background .15s, color .15s, border-color .15s; }
/* The visual chip stays 32 px; the touch target is 40 px. */
.mybets-chip:before { content: ''; position: absolute; left: 0; right: 0; top: -4px; bottom: -4px; }
.mybets-chip:hover { border-color: var(--border); color: var(--text); }
.mybets-chip.is-active { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.mybets-chip-clear { font-size: 13px; line-height: 1; font-style: normal; }

/* A native select cannot carry a pseudo-element, so its 40 px box is a
   transparent 4 px border round a 32 px painted field (R15). */
.mybets-select { height: 40px; min-width: 132px; padding: 0 28px 0 10px; border: 4px solid transparent; border-radius: 12px; background-color: var(--surface-2); background-clip: padding-box; box-shadow: inset 0 0 0 1px var(--line); color: var(--text); font-size: 12px; font-weight: 600; appearance: none; flex-shrink: 0;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 15px) 14px, calc(100% - 10px) 14px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.mybets .mybets-select:focus-visible { outline-offset: -2px; }
.mybets-type-select { display: none; }

/* Search sits at the end of the filter row on a desk (R18). */
.mybets-search { position: relative; display: flex; align-items: center; gap: 8px; width: 320px; height: 40px; margin-left: auto; padding: 0 0 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); flex-shrink: 0; }
.mybets-search > .icon { width: 16px; height: 16px; color: var(--dim); flex-shrink: 0; }
.mybets-search input { flex: 1; min-width: 0; height: 38px; border: 0; background: none; font-size: 14px; color: var(--text); }
.mybets-search input::placeholder { color: var(--dim); opacity: 1; }
.mybets-search input::-webkit-search-cancel-button { display: none; }
/* One ring, round the whole control, never a box round the bare input (R4). */
.mybets .mybets-search input:focus-visible, .mybets .mybets-search input:focus { outline: none; }
.mybets-search:focus-within { border-color: var(--border); outline: 2px solid var(--focus); outline-offset: 2px; }
.mybets-search-clear { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 38px; color: var(--dim); flex-shrink: 0; }
.mybets-search-clear .icon { width: 15px; height: 15px; }

.mybets-alert { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; margin-bottom: 10px; background: var(--surface-2); border: 1px solid var(--line); border-left: 3px solid var(--negative); border-radius: 8px; font-size: 13px; }
.mybets-period-note { font-size: 12px; font-weight: 600; color: var(--dim); padding: 2px 0 6px; }

/* ── list, day and event headers (§3) ─────────────────────────────────────── */
.mybets-list { outline: none; }
.mybets-list.is-busy { opacity: .6; }
.mybets-day + .mybets-day { margin-top: 18px; }
.mybets-day-head { position: sticky; top: var(--mybets-sticky); z-index: 8; height: 24px; display: flex; align-items: center; font-family: var(--font); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); background: var(--bg); }
.mybets-event { margin-top: 8px; }
.mybets-event-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 32px; padding: 0 2px; }
.mybets-event-name { font-size: 12px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mybets-event-name b { color: var(--dim); font-weight: 700; letter-spacing: .04em; }
.mybets-event-name a:hover { text-decoration: underline; }
.mybets-event-meta { font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mybets-event-rows { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }

/* ── one bet row ──────────────────────────────────────────────────────────── */
.bet-row { background: var(--surface); }
.bet-row + .bet-row { border-top: 1px solid var(--line); }
/* toggle · actions · chevron. Every row reserves the same action width, so stake,
   profit and result line up down the list, and the chevron is always last (R10). */
.bet-main { display: grid; grid-template-columns: minmax(0, 1fr) var(--bet-actions-w, 0px) 24px; align-items: stretch; }
.mybets-list.has-actions { --bet-actions-w: 196px; }
.bet-main:hover, .bet-main:focus-within { background: var(--surface-2); }
.bet-toggle { display: grid; grid-template-columns: 4px 56px minmax(0, 1fr) 88px 96px 140px 160px 56px; column-gap: 12px; align-items: center; min-height: 64px; padding: 0 12px; text-align: left; }
.mybets .bet-toggle:focus-visible { outline-offset: -2px; }
.bet-rail { align-self: stretch; width: 4px; margin: 10px 0; border-radius: 2px; background: var(--back); }
.side-lay .bet-rail { background: var(--lay); }
.bet-side { display: inline-flex; align-items: center; justify-content: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11px; font-weight: 700; letter-spacing: .04em; background: var(--back); color: var(--back-ink); }
.side-lay .bet-side { background: var(--lay); color: var(--lay-ink); }
.bet-selection { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.bet-selection strong { font-size: 15px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bet-selection small { font-size: 11px; font-weight: 600; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Prices line up on their decimal points, like every other money column (R9). */
.bet-price { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; text-align: right; }
.bet-price b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }
.bet-price small { font-size: 10px; font-weight: 600; color: var(--dim); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bet-stake { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; color: var(--text); }
.bet-risk { display: flex; flex-direction: column; gap: 1px; text-align: right; }
.bet-risk small { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.bet-risk b { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }
/* A void or cancelled bet never stood: no hypothetical profit (R12). */
.bet-risk.is-empty b { color: var(--dim); }
.bet-result { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.bet-time { font-size: 12px; font-weight: 600; color: var(--dim); font-variant-numeric: tabular-nums; text-align: right; }
.bet-inline-note, .bet-money-line { display: none; }
.bet-chevron { display: flex; align-items: center; justify-content: center; color: var(--dim); cursor: pointer; }
.bet-chevron.is-inline { display: none; }
.bet-chevron .icon { width: 16px; height: 16px; transform: rotate(90deg); transition: transform .15s; }
/* The state shows under reduced motion too; only the turn is removed (R30). */
.bet-toggle[aria-expanded="true"] .bet-chevron .icon, .bet-toggle[aria-expanded="true"] ~ .bet-chevron .icon { transform: rotate(270deg); }

.bet-pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--text); white-space: nowrap; }
/* The accent where the brand has a legible one; ink where red would read as
   "rejected" (wynlive sets --unmatched-ink) — R22. */
.bet-pill.is-unmatched { background: transparent; border: 1px solid var(--unmatched-ink, var(--brand)); color: var(--unmatched-ink, var(--accent-ink, var(--text))); }
.bet-live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--live); flex-shrink: 0; }
.bet-note { font-size: 10px; font-weight: 600; color: var(--dim); white-space: nowrap; }
.bet-outcome { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }
.bet-outcome.is-positive { color: var(--positive); }
.bet-outcome.is-negative { color: var(--negative); }
.bet-outcome.is-dim { color: var(--dim); }
.bet-outcome.is-cashout { color: var(--accent-ink, var(--text)); }
.bet-outcome.is-cashout b { font-weight: 600; }
.bet-glyph { display: inline-flex; font-style: normal; }
.bet-glyph .icon { width: 13px; height: 13px; stroke-width: 2.4; }

.bet-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px 8px; min-width: 0; }
/* The reason a disabled Edit gives when tapped (S6): a line under the buttons,
   present only while it has something to say. */
.bet-disabled-note { flex-basis: 100%; font-size: 12px; font-weight: 600; line-height: 16px; color: var(--dim); text-align: right; white-space: nowrap; }
.bet-disabled-note:empty { display: none; }
.bet-action { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--text); font-size: 12px; font-weight: 600; white-space: nowrap; transition: background .15s, border-color .15s; }
.bet-action:hover:not(.is-disabled) { border-color: var(--border); background: var(--surface-2); }
/* A disabled Edit must never look like the Edit beside it (R21). */
.bet-action.is-disabled { background: transparent; border-color: color-mix(in srgb, var(--line) 50%, transparent); color: var(--dim); cursor: not-allowed; }
.bet-action.is-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.bet-action.is-primary:hover { background: var(--brand-hot, var(--brand)); border-color: var(--brand-hot, var(--brand)); }
.bet-quote { display: flex; flex-direction: column; align-items: stretch; min-width: 0; }
.bet-quote-amount { font-variant-numeric: tabular-nums; font-weight: 700; }
/* The delta says in words what its colour says (R27); one 14 px line (R25). */
.bet-quote-delta { margin-top: 2px; font-size: 11px; font-weight: 600; line-height: 14px; font-variant-numeric: tabular-nums; text-align: center; white-space: nowrap; }
.bet-quote-delta.is-positive { color: var(--positive); }
.bet-quote-delta.is-negative { color: var(--negative); }
/* Every refusal, one string, one line (R8, R26). */
.bet-quote-note { font-size: 12px; font-weight: 600; color: var(--dim); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── detail panel (§3; R11, R26, R30) ─────────────────────────────────────── */
.bet-detail { background: var(--surface-2); border-top: 1px solid var(--line); padding: 12px 16px; }
.bet-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 360px)); column-gap: 48px; row-gap: 6px; }
.bet-detail-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; max-width: 360px; font-size: 12px; }
.bet-detail-row > span { color: var(--dim); white-space: nowrap; }
.bet-detail-row > strong { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.bet-copy { min-height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 11px; font-weight: 600; color: var(--dim); }
.bet-copy:hover { border-color: var(--border); color: var(--text); }
.bet-detail-note { font-size: 12px; color: var(--dim); margin-top: 8px; }
.bet-detail-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.bet-detail-foot .text-link { min-height: 40px; }
.bet-detail-copied { font-size: 11px; font-weight: 600; color: var(--positive); }

/* ── accumulators (§6; R32, R33) ──────────────────────────────────────────── */
.mybets .multi-ticket { max-width: 560px; padding: 16px; margin-top: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.mybets .multi-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; min-height: 32px; font-size: 13px; }
.mybets .multi-head > strong { font-weight: 600; }
.mybets .multi-time { margin-left: auto; font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
.mybets .multi-leg { display: grid; grid-template-columns: 16px minmax(0, 1fr) 72px; gap: 10px; align-items: center; min-height: 44px; border-top: 1px solid var(--line); }
.mybets .multi-leg .bet-glyph { color: var(--text); }
.mybets .multi-leg .bet-glyph.is-dot { justify-content: center; }
.mybets .multi-leg-name { display: block; min-width: 0; font-size: 14px; font-weight: 600; line-height: 1.35; }
.mybets .multi-leg-name b { font-variant-numeric: tabular-nums; font-weight: 600; }
.mybets .multi-leg-name small { display: block; font-size: 11px; font-weight: 500; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mybets .multi-leg-status { font-size: 11px; font-weight: 600; color: var(--dim); text-align: right; }
.mybets .multi-leg-status small { display: block; font-size: 11px; font-weight: 500; line-height: 1.25; color: var(--dim); }
.mybets .multi-note { margin: 10px 0 0; font-size: 12px; font-weight: 500; line-height: 1.4; color: var(--dim); }
.mybets .multi-foot { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.mybets .multi-foot span { display: block; font-size: 10px; font-weight: 700; letter-spacing: .06em; color: var(--dim); }
.mybets .multi-foot strong { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ── states (§8) ──────────────────────────────────────────────────────────── */
.mybets-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 120px; padding: 24px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; text-align: center; }
.mybets-empty p { font-size: 13px; color: var(--dim); }
.mybets-skeleton { display: flex; flex-direction: column; gap: 1px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.mybets-skeleton-row { display: block; height: 64px; background: var(--surface-2); animation: mybets-shimmer 1.2s ease-in-out infinite; }
@keyframes mybets-shimmer { 50% { opacity: .55; } }
.mybets-foot { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 20px 0 8px; }
.mybets-foot-note { font-size: 12px; color: var(--dim); text-align: center; }
.mybets-foot-note .text-link { min-height: 0; }
.mybets-foot-note.is-error { color: var(--negative); }
.mybets-foot-count { font-size: 12px; color: var(--dim); text-align: center; }
.mybets-more { min-height: 40px; min-width: 180px; }

/* The My bets nav entry counts what is riding (§9). */
.nav-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--brand); color: var(--brand-ink); font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mobile-nav .nav-count, .rail nav .nav-count { position: absolute; transform: translate(14px, -12px); }
.rail nav > a, .mobile-nav > a { position: relative; }

/* ── narrow desks ─────────────────────────────────────────────────────────── */
@media (max-width: 1180px) and (min-width: 761px) {
  .mybets-bar-filters { flex-wrap: wrap; }
  .mybets-search { width: 100%; margin-left: 0; }
}

/* ── phone ────────────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .mybets { --mybets-sticky: calc(var(--mybets-news) + var(--header) + 46px); }
  .mybets .is-wide { display: none; }
  .mybets .is-narrow { display: inline; }

  /* Title row: the heading, an icon-only refresh and "Statement →"; the time
     under the title (R6). */
  .mybets-head { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: 'title refresh link' 'updated updated updated'; align-items: center; column-gap: 8px; row-gap: 0; padding: 2px 0 6px; }
  .mybets-head h1 { grid-area: title; font-size: 27px; margin: 0; }
  .mybets-updated { grid-area: updated; line-height: 16px; }
  .mybets-refresh { grid-area: refresh; width: 40px; height: 40px; padding: 0; }
  .mybets-refresh-label { display: none; }
  .mybets-statement { grid-area: link; gap: 4px; }

  /* Tiles: 72 px (R7); the long sub-line has a short form (R14). */
  .mybets-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .mybets-tile { min-height: 72px; padding: 8px 12px; gap: 1px; }
  .mybets-tile-label, .mybets-tile-sub { line-height: 14px; }
  .mybets-tile-value { font-size: 20px; line-height: 24px; }

  /* The sticky row: view, the live counter, and search behind a magnifier (R7). */
  .mybets-bar-primary { position: sticky; top: var(--mybets-sticky); z-index: 12; min-height: 48px; margin: 0 -12px; padding: 4px 12px; gap: 8px; }
  .mybets-seg-view > button { padding: 0 10px; }
  .mybets-seg-type { display: none; }
  .mybets-search-toggle { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 8px; color: var(--text); flex-shrink: 0; }
  .mybets-search-toggle .icon { width: 18px; height: 18px; }
  .mybets-search-toggle.is-active { background: var(--sunken); }
  .mybets-count[hidden] + .mybets-search-toggle { margin-left: auto; }

  .mybets-bar { margin: 0 -12px; padding: 0 12px 4px; gap: 4px; }
  /* Two selects share a line, 50/50; the period chips get the full width below
     (two selects and four chips do not fit 358 px side by side). */
  .mybets-bar-filters { flex-wrap: wrap; gap: 0 8px; }
  .mybets-type-select { display: block; }
  .mybets-select { min-width: 0; flex: 0 1 calc(50% - 4px); }
  .mybets-bar-filters .mybets-scroller { flex: 1 1 100%; }
  .mybets-search { display: none; width: 100%; margin-left: 0; flex-basis: 100%; }
  .mybets-search.is-open { display: flex; }
  /* On a collapsed view the type select joins the view control's row (S2). */
  .mybets-bar-primary .mybets-type-select { flex: 0 0 auto; min-width: 132px; margin-left: auto; margin-right: -4px; }

  .mybets-day-head { top: calc(var(--mybets-sticky) + 48px); }
  .mybets-event { margin-top: 4px; }
  .mybets-event-head { flex-direction: column; align-items: stretch; gap: 0; min-height: 0; padding-bottom: 4px; }
  /* One line of name, full name in the title (R31). */
  .mybets-event-name { white-space: nowrap; }
  .mybets-event-meta { line-height: 16px; }
  .mybets-event-rows { border: 0; border-radius: 0; background: none; overflow: visible; display: flex; flex-direction: column; gap: 8px; }

  /* A row becomes a card: 104 px, 152 px with Edit/Cancel, 168 px with one
     status line under the button (R25). The rail becomes the left border. */
  .bet-row { border: 1px solid var(--line); border-left: 4px solid var(--back); border-radius: 8px; overflow: hidden; }
  .side-lay.bet-row { border-left-color: var(--lay); }
  .bet-row + .bet-row { border-top: 1px solid var(--line); }
  .bet-main { grid-template-columns: minmax(0, 1fr); }
  .mybets-list.has-actions { --bet-actions-w: auto; }
  .bet-toggle {
    grid-template-columns: minmax(44px, max-content) minmax(0, 1fr) auto auto;
    grid-template-areas:
      'side  name    name   price'
      'side  market  note   chev'
      'money money   result time';
    row-gap: 4px; column-gap: 8px; min-height: 102px; padding: 10px 12px; align-content: center; line-height: 1.25;
  }
  .bet-rail { display: none; }
  .bet-side { grid-area: side; align-self: start; justify-self: start; }
  .bet-selection { display: contents; }
  .bet-selection strong { grid-area: name; }
  .bet-selection small { grid-area: market; }
  .bet-price { grid-area: price; }
  .bet-chevron.is-inline { display: flex; grid-area: chev; justify-self: end; }
  .bet-chevron.is-column { display: none; }
  .bet-inline-note { display: block; grid-area: note; justify-self: end; font-size: 12px; font-weight: 600; color: var(--dim); white-space: nowrap; }
  /* "₹1,000 · Profit ₹1,500" is one text node on a phone (R13); the desktop
     cells it replaces are hidden, so it is read once. */
  .bet-stake, .bet-risk { display: none; }
  .bet-money-line { display: block; grid-area: money; font-size: 12px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bet-result { grid-area: result; }
  .bet-note { font-size: 11px; line-height: 14px; }
  .bet-outcome { font-size: 12px; }
  .bet-time { grid-area: time; align-self: center; }
  .bet-actions { display: flex; flex-wrap: wrap; gap: 4px 8px; padding: 0 12px 8px; justify-content: stretch; }
  .bet-actions > .bet-action, .bet-actions > .bet-quote { flex: 1 1 0; }
  .bet-actions:not(:has(.bet-action)) { display: none; }
  .bet-disabled-note { text-align: left; }
  .bet-action { min-height: 40px; width: 100%; }
  .bet-quote-delta { line-height: 14px; margin-top: 2px; }
  .bet-detail-grid { grid-template-columns: minmax(0, 1fr); }
  .bet-detail-row { max-width: none; }
  .bet-copy { min-height: 40px; }
  .mybets .multi-ticket { max-width: none; }
  .mybets-more { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .mybets *, .mybets *:before, .mybets *:after { transition-duration: 0s !important; animation-duration: 0s !important; animation-iteration-count: 1 !important; }
  .mybets-refresh.is-busy .icon { animation: none; }
}
.reduce-motion .mybets *, .reduce-motion .mybets *:before { transition-duration: 0s !important; animation: none !important; }
