/* Stulian Race Club — shared shell + components.
   One look for every code; the code colour is only a small accent (--rl-accent). */

:root {
  --rl-bg: #0D1117;
  --rl-panel: #161B22;
  --rl-soft: #1F2630;
  --rl-sub: #11161D;
  --rl-line: rgba(199, 206, 217, .09);
  --rl-line-strong: rgba(199, 206, 217, .16);
  --rl-text: #C7CED9;
  --rl-muted: rgba(199, 206, 217, .68);
  --rl-faint: rgba(199, 206, 217, .46);
  --rl-white: #F3F5F8;
  --rl-teal: #00C2A8;
  --rl-orange: #FF7A18;
  --rl-good: #22C55E;
  --rl-bad: #FF4D4F;
  --rl-warn: #F59E0B;
  --rl-accent: #00C2A8;
  --rl-radius: 8px;
  --rl-radius-lg: 10px;
  --rl-max: 80rem;
}
body[data-code="horses"] { --rl-accent: #FF7A18; }
body[data-code="afl"] { --rl-accent: #F87171; }
body[data-code="nrl"] { --rl-accent: #34D399; }

/* ── Shell ─────────────────────────────────────────────────────────── */
.rl-header { background: var(--rl-panel); border-bottom: 1px solid var(--rl-soft); }
.rl-wrap { max-width: var(--rl-max); margin: 0 auto; padding: 0 12px; min-width: 0; }
@media (min-width: 640px) { .rl-wrap { padding: 0 16px; } }
@media (min-width: 1024px) { .rl-wrap { padding: 0 24px; } }

.rl-bar { display: flex; align-items: center; gap: 14px; height: 52px; min-width: 0; }
.rl-brand { display: inline-flex; align-items: baseline; gap: 6px; font-size: 16px; font-weight: 650; color: var(--rl-white); letter-spacing: -.01em; white-space: nowrap; }
.rl-brand span { font-weight: 400; color: var(--rl-muted); font-size: 14px; }

.rl-codes { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--rl-soft); border-radius: var(--rl-radius); background: var(--rl-bg); }
.rl-code { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 5px 11px; border-radius: 6px; font-size: 12.5px; font-weight: 600; color: var(--rl-faint); white-space: nowrap; transition: color .12s, background .12s; }
.rl-code::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--rl-teal)); opacity: .35; flex: none; }
.rl-code:hover { color: var(--rl-white); }
.rl-code.is-active { background: var(--rl-soft); color: var(--rl-white); }
.rl-code.is-active::before { opacity: 1; }

.rl-utils { display: flex; align-items: center; gap: 6px; margin-left: auto; min-width: 0; }
.rl-util { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--rl-muted); border: 1px solid transparent; white-space: nowrap; transition: color .12s, background .12s, border-color .12s; }
.rl-util:hover, .rl-dd:focus-within > .rl-util, .rl-dd:hover > .rl-util { color: var(--rl-white); background: var(--rl-soft); }
.rl-util.is-boxed { border-color: var(--rl-soft); background: var(--rl-bg); }
.rl-util.is-active { color: var(--rl-white); border-color: var(--rl-line-strong); }
.rl-util svg { flex: none; }
.rl-avatar { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--rl-soft); color: var(--rl-white); font-size: 11.5px; font-weight: 700; letter-spacing: .02em; }

/* Section tabs (row 2) */
.rl-nav { display: flex; align-items: stretch; gap: 2px; height: 44px; margin: 0 -10px; }
.rl-tab { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 100%; padding: 0 12px; font-size: 13.5px; font-weight: 550; color: var(--rl-muted); border-bottom: 2px solid transparent; white-space: nowrap; transition: color .12s; }
.rl-tab:hover, .rl-dd:hover > .rl-tab, .rl-dd:focus-within > .rl-tab { color: var(--rl-white); }
.rl-tab.is-active { color: var(--rl-white); border-bottom-color: var(--rl-accent); }
.rl-tab .rl-caret { width: 11px; height: 11px; opacity: .55; }
.rl-count { display: inline-flex; align-items: center; justify-content: center; min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: rgba(255, 122, 24, .16); color: #FFB37A; font-size: 10.5px; font-weight: 700; line-height: 1; }

/* Dropdowns */
.rl-dd { position: relative; display: flex; align-items: stretch; }
.rl-dd-menu { display: none; position: absolute; top: 100%; left: 0; z-index: 70; min-width: 270px; max-width: 340px; padding: 6px; margin-top: 4px; background: var(--rl-panel); border: 1px solid var(--rl-line-strong); border-radius: var(--rl-radius-lg); box-shadow: 0 12px 32px rgba(0, 0, 0, .45); }
.rl-dd-menu.is-right { left: auto; right: 0; }
.rl-dd-menu::before { content: ''; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
.rl-dd:hover > .rl-dd-menu, .rl-dd:focus-within > .rl-dd-menu { display: block; }
.rl-dd-group { padding: 8px 10px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--rl-faint); }
.rl-dd-sep { height: 1px; margin: 5px 6px; background: var(--rl-line); }
.rl-dd-item { display: block; width: 100%; text-align: left; padding: 7px 10px; border-radius: 6px; color: var(--rl-text); }
.rl-dd-item:hover { background: var(--rl-soft); color: var(--rl-white); }
.rl-dd-item.is-active { background: var(--rl-soft); color: var(--rl-white); box-shadow: inset 2px 0 0 var(--rl-accent); }
.rl-dd-item.is-disabled { opacity: .5; cursor: default; }
.rl-dd-item.is-disabled:hover { background: none; }
.rl-dd-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.rl-dd-hint { display: block; margin-top: 1px; font-size: 11.5px; color: var(--rl-faint); line-height: 1.35; }
.rl-dd-wide { min-width: 520px; max-width: 560px; display: none; grid-template-columns: 1fr 1fr; column-gap: 4px; }
.rl-dd:hover > .rl-dd-wide, .rl-dd:focus-within > .rl-dd-wide { display: grid; }
.rl-dd-wide > .rl-dd-col { min-width: 0; }

/* Sub-section tabs (row 3) */
.rl-subnav { background: var(--rl-sub); border-bottom: 1px solid var(--rl-soft); }
.rl-subnav-row { display: flex; align-items: center; gap: 2px; min-height: 42px; overflow-x: auto; -ms-overflow-style: none; scrollbar-width: none; }
.rl-subnav-row::-webkit-scrollbar { display: none; }
.rl-subnav-label { flex: none; margin-right: 8px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--rl-faint); }
.rl-subnav-sep { flex: none; width: 1px; height: 18px; margin: 0 8px; background: var(--rl-line-strong); }
.rl-subtab { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 6px; font-size: 12.5px; font-weight: 550; color: var(--rl-muted); white-space: nowrap; transition: color .12s, background .12s; }
.rl-subtab:hover { color: var(--rl-white); background: rgba(31, 38, 48, .7); }
.rl-subtab.is-active { color: var(--rl-white); background: var(--rl-soft); }
.rl-subtab.is-group { font-weight: 650; }
.rl-subtab.is-disabled { opacity: .45; pointer-events: none; }

/* Main + footer */
.rl-main { max-width: var(--rl-max); margin: 0 auto; width: 100%; min-width: 0; padding: 20px 12px 8px; overflow-x: hidden; }
@media (min-width: 640px) { .rl-main { padding: 24px 16px 8px; } }
@media (min-width: 1024px) { .rl-main { padding: 24px 24px 8px; } }
.rl-footer { max-width: var(--rl-max); margin: 40px auto 0; padding: 20px 24px 28px; border-top: 1px solid var(--rl-soft); display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between; font-size: 12px; color: var(--rl-faint); }
.rl-footer a:hover { color: var(--rl-white); }
.rl-flash { margin-bottom: 16px; padding: 10px 14px; border-radius: var(--rl-radius); border: 1px solid; font-size: 13.5px; }
.rl-flash.is-good { border-color: rgba(0, 194, 168, .35); background: rgba(0, 194, 168, .07); color: #5EE3D0; }
.rl-flash.is-bad { border-color: rgba(255, 77, 79, .35); background: rgba(255, 77, 79, .07); color: #FF8A8B; }

/* Mobile drawer */
.rl-drawer-section { border-top: 1px solid var(--rl-line); padding-top: 6px; margin-top: 6px; }
.rl-drawer-link { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 8px; font-size: 15px; font-weight: 550; color: var(--rl-text); text-align: left; }
.rl-drawer-link:hover { background: var(--rl-soft); color: var(--rl-white); }
.rl-drawer-link.is-active { color: var(--rl-white); background: var(--rl-soft); box-shadow: inset 3px 0 0 var(--rl-accent); }
.rl-drawer-sub { margin: 2px 0 6px 14px; padding-left: 10px; border-left: 1px solid var(--rl-line-strong); }
.rl-drawer-sub a, .rl-drawer-sub button { display: block; width: 100%; text-align: left; padding: 7px 10px; border-radius: 6px; font-size: 14px; color: var(--rl-muted); }
.rl-drawer-sub a.is-active { color: var(--rl-white); font-weight: 600; }
.rl-drawer-sub .rl-dd-group { padding-left: 10px; }

/* Anchor targets on long single-page dashboards (AFL / NRL). */
[id^="sec-"] { scroll-margin-top: 16px; }

/* ── Page header ───────────────────────────────────────────────────── */
.ui-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--rl-line); }
.ui-page-head-main { min-width: 0; flex: 1 1 420px; }
.ui-eyebrow { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--rl-faint); }
.ui-eyebrow::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--rl-accent); flex: none; }
.ui-eyebrow .sep { opacity: .5; }
.ui-title { margin-top: 6px; font-size: 24px; line-height: 1.2; font-weight: 650; letter-spacing: -.015em; color: var(--rl-white); }
.ui-purpose { margin-top: 5px; max-width: 72ch; font-size: 13.5px; line-height: 1.55; color: var(--rl-muted); }
.ui-page-meta { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 12px; color: var(--rl-faint); }
.ui-page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ui-page-actions form { margin: 0; }
@media (max-width: 639.98px) {
  .ui-page-head { margin-bottom: 14px; padding-bottom: 12px; }
  .ui-title { font-size: 21px; }
}

/* ── Components ────────────────────────────────────────────────────── */
.ui-card { background: var(--rl-panel); border: 1px solid var(--rl-soft); border-radius: var(--rl-radius-lg); min-width: 0; }
.ui-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--rl-line); }
.ui-card-title { font-size: 13.5px; font-weight: 650; color: var(--rl-white); }
.ui-card-sub { font-size: 12px; color: var(--rl-faint); }
.ui-card-body { padding: 14px 16px; }

.ui-section { margin-top: 24px; }
.ui-section-title { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--rl-muted); }
.ui-section-title a { margin-left: auto; font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--rl-teal); }

.ui-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.ui-stat { background: var(--rl-panel); border: 1px solid var(--rl-soft); border-radius: var(--rl-radius); padding: 10px 12px; min-width: 0; }
.ui-stat-label { display: flex; align-items: center; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--rl-faint); }
.ui-stat-value { margin-top: 4px; font-size: 20px; line-height: 1.2; font-weight: 650; color: var(--rl-white); font-variant-numeric: tabular-nums; }
.ui-stat-meta { margin-top: 2px; font-size: 11.5px; color: var(--rl-faint); }

.ui-table-wrap { overflow-x: auto; background: var(--rl-panel); border: 1px solid var(--rl-soft); border-radius: var(--rl-radius-lg); }
.ui-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ui-table th { padding: 9px 12px; text-align: left; font-size: 11px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--rl-faint); border-bottom: 1px solid var(--rl-line-strong); white-space: nowrap; }
.ui-table td { padding: 9px 12px; border-bottom: 1px solid var(--rl-line); color: var(--rl-text); vertical-align: middle; }
.ui-table tbody tr:last-child td { border-bottom: 0; }
.ui-table tbody tr:hover td { background: rgba(255, 255, 255, .018); }
.ui-table .num { text-align: right; font-variant-numeric: tabular-nums; }

.ui-badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 4px; border: 1px solid var(--rl-line-strong); font-size: 11px; font-weight: 600; line-height: 1.6; color: var(--rl-muted); white-space: nowrap; }
.ui-badge.is-good { color: #4ADE80; border-color: rgba(34, 197, 94, .3); background: rgba(34, 197, 94, .08); }
.ui-badge.is-bad { color: #FF7B7C; border-color: rgba(255, 77, 79, .3); background: rgba(255, 77, 79, .08); }
.ui-badge.is-warn { color: #FBBF24; border-color: rgba(245, 158, 11, .3); background: rgba(245, 158, 11, .08); }
.ui-badge.is-info { color: #2DD4BF; border-color: rgba(0, 194, 168, .3); background: rgba(0, 194, 168, .08); }
.ui-badge.is-muted { color: var(--rl-faint); }

.ui-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 7px; border: 1px solid var(--rl-line-strong); background: var(--rl-soft); color: var(--rl-white); font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: border-color .12s, background .12s, filter .12s; }
.ui-btn:hover { border-color: rgba(199, 206, 217, .32); }
.ui-btn:disabled { opacity: .5; cursor: not-allowed; }
.ui-btn-primary { background: var(--rl-teal); border-color: var(--rl-teal); color: #04231F; }
.ui-btn-primary:hover { filter: brightness(1.08); border-color: var(--rl-teal); }
.ui-btn-danger { background: transparent; border-color: rgba(255, 77, 79, .45); color: #FF7B7C; }
.ui-btn-danger:hover { background: rgba(255, 77, 79, .08); border-color: rgba(255, 77, 79, .6); }
.ui-btn-ghost { background: transparent; border-color: transparent; color: var(--rl-muted); }
.ui-btn-ghost:hover { color: var(--rl-white); background: var(--rl-soft); border-color: transparent; }
.ui-btn-sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 6px; }

.ui-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rl-line-strong); overflow-x: auto; scrollbar-width: none; }
.ui-tab { flex: none; padding: 8px 12px; margin-bottom: -1px; border-bottom: 2px solid transparent; font-size: 13px; font-weight: 550; color: var(--rl-muted); white-space: nowrap; }
.ui-tab:hover { color: var(--rl-white); }
.ui-tab.is-active { color: var(--rl-white); border-bottom-color: var(--rl-accent); }

.ui-segment { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; border: 1px solid var(--rl-soft); border-radius: var(--rl-radius); background: var(--rl-bg); }
.ui-seg { padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--rl-muted); white-space: nowrap; }
.ui-seg:hover { color: var(--rl-white); }
.ui-seg.is-active { background: var(--rl-soft); color: var(--rl-white); }

.ui-empty { padding: 28px 16px; text-align: center; border: 1px dashed var(--rl-line-strong); border-radius: var(--rl-radius-lg); }
.ui-empty-title { font-size: 14px; font-weight: 650; color: var(--rl-white); }
.ui-empty-text { margin: 4px auto 0; max-width: 56ch; font-size: 13px; color: var(--rl-muted); }
.ui-empty-actions { margin-top: 12px; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }

.ui-note { padding: 10px 14px; border-radius: var(--rl-radius); border: 1px solid var(--rl-soft); background: var(--rl-panel); font-size: 13px; line-height: 1.55; color: var(--rl-muted); }
.ui-note strong { color: var(--rl-white); font-weight: 600; }
.ui-note.is-warn { border-color: rgba(245, 158, 11, .3); }
.ui-note.is-info { border-color: rgba(0, 194, 168, .28); }

.ui-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 13px; }
.ui-dl dt { color: var(--rl-faint); }
.ui-dl dd { color: var(--rl-white); }

/* Glossary term with its "?" bubble */
.ui-term { display: inline-flex; align-items: center; white-space: nowrap; }

/* ── Calm down legacy page markup (presentation only) ──────────────── */
.rl-main [class*="shadow-[0_0_"] { box-shadow: none !important; }
.rl-main .animate-ping { display: none !important; }
.rl-main .pointer-events-none.absolute.inset-x-0.top-0.h-px { display: none !important; }
.rl-drawer-sub .is-disabled { display: block; padding: 7px 10px; font-size: 14px; color: var(--rl-faint); }

/* Toolbar under the page header (search / filters moved out of legacy headers) */
.ui-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -4px 0 16px; }
.ui-toolbar > form { margin: 0; min-width: 0; }
.ui-toolbar > form.flex { flex: 1 1 320px; max-width: 520px; }

/* Legacy page headers not yet on the page_header partial: same flat look */
.rl-main header[class*="bg-gradient-to-b"][class*="via-greys-panel"] {
  background: none !important; border: 0 !important; border-bottom: 1px solid var(--rl-line) !important;
  border-radius: 0 !important; padding: 0 0 14px !important; margin-bottom: 16px; min-height: 0 !important; box-shadow: none !important;
}
.rl-main header[class*="bg-gradient-to-b"][class*="via-greys-panel"] > .pointer-events-none.absolute { display: none; }
.rl-main header[class*="bg-gradient-to-b"][class*="via-greys-panel"] h1 { font-size: 22px; line-height: 1.25; font-weight: 650; letter-spacing: -0.01em; }
@media (max-width: 640px) {
  .rl-main header[class*="bg-gradient-to-b"][class*="via-greys-panel"] { padding: 0 4px 12px !important; }
}

/* Shell breakpoints must not depend on Tailwind CDN style order (it loses when a page prints output before <html>) */
@media (min-width: 1024px) { .rl-header .lg\:hidden, #mobile-nav.lg\:hidden { display: none !important; } }
@media (max-width: 1023.98px) { .rl-header .hidden.lg\:flex { display: none !important; } }

/* ---------- Quick Picks (/quick-picks) ---------- */
.rl-qp-bolt, .qp-e, .qp-emo, .qp-emo-lg { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; font-style: normal; }
.rl-qp-bolt { font-size: 13px; line-height: 1; }
.rl-header .rl-qp-link { display: none; }
@media (min-width: 1024px) { .rl-header .rl-qp-link { display: inline-flex; } }
.rl-qp-fab { display: none; }
@media (max-width: 1023.98px) {
  .rl-qp-fab {
    position: fixed; z-index: 45; right: calc(14px + env(safe-area-inset-right)); bottom: calc(14px + env(safe-area-inset-bottom));
    display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%;
    background: var(--rl-panel); border: 1px solid rgba(0, 194, 168, .45); box-shadow: 0 4px 14px rgba(0, 0, 0, .45);
  }
  .rl-qp-fab:active { background: var(--rl-soft); }
  .rl-qp-fab .rl-qp-bolt { font-size: 16px; }
  /* Room below the last row / footer so the floating bolt never covers it. */
  body:has(.rl-qp-fab) .rl-footer { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
}

/* Cup Day: every Flemington race (/melbourne-cup/races). Sits above the Quick Picks bolt on phones. */
.rl-mc-fab {
  position: fixed; z-index: 45; right: calc(14px + env(safe-area-inset-right)); bottom: calc(14px + env(safe-area-inset-bottom));
  display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%;
  background: var(--rl-panel); border: 1px solid rgba(252, 211, 77, .6); box-shadow: 0 4px 14px rgba(0, 0, 0, .45);
  color: #FCD34D; font-size: 12px; font-weight: 800; letter-spacing: .02em; text-decoration: none;
}
.rl-mc-fab:active { background: var(--rl-soft); }
.rl-mc-fab .rl-mc-horse { font-size: 19px; line-height: 1; }
@media (max-width: 1023.98px) {
  .rl-mc-fab:not(.is-alone) { bottom: calc(60px + env(safe-area-inset-bottom)); }
  body:has(.rl-mc-fab:not(.is-alone)) .rl-footer { padding-bottom: calc(130px + env(safe-area-inset-bottom)); }
}

.qp-page { max-width: 760px; margin: 0 auto; }
.qp-top { padding: 0 0 12px; }
.qp-title { font-size: 22px; line-height: 1.2; font-weight: 650; letter-spacing: -.01em; color: var(--rl-white); }
.qp-subtitle { margin-top: 3px; font-size: 13px; color: var(--rl-muted); }

.qp-bar { position: sticky; top: 0; z-index: 40; padding: 9px 0 10px; background: var(--rl-bg); border-bottom: 1px solid var(--rl-line-strong); }
.qp-bar-sum { font-size: 13px; line-height: 1.4; color: var(--rl-text); }
.qp-bar-sum b { color: var(--rl-white); font-weight: 650; }
.qp-chips { display: flex; align-items: center; gap: 6px; margin-top: 8px; overflow-x: auto; scrollbar-width: none; }
.qp-chips::-webkit-scrollbar { display: none; }
.qp-chip { flex: none; padding: 5px 12px; border: 1px solid var(--rl-soft); border-radius: 999px; background: var(--rl-panel); font-size: 12.5px; font-weight: 600; color: var(--rl-muted); white-space: nowrap; }
.qp-chip:hover { color: var(--rl-white); }
.qp-chip.is-on { color: var(--rl-white); background: var(--rl-soft); border-color: var(--rl-line-strong); box-shadow: inset 0 -2px 0 var(--rl-accent); }
.qp-chip-sep { flex: none; width: 1px; height: 18px; margin: 0 2px; background: var(--rl-line-strong); }

.qp-earlier { display: block; width: 100%; margin-top: 12px; padding: 10px; border: 1px dashed var(--rl-line-strong); border-radius: 8px; background: transparent; font-size: 13px; font-weight: 600; color: var(--rl-muted); cursor: pointer; }
.qp-earlier:hover { color: var(--rl-white); border-color: var(--rl-faint); }
.qp-earlier:disabled { cursor: default; opacity: .7; }

.qp-day { margin-top: 14px; }
.qp-day-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 4px 2px 7px; font-size: 12px; color: var(--rl-faint); }
.qp-day-title { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--rl-muted); }
.qp-day-tally { margin-left: auto; color: var(--rl-muted); }
.qp-list { list-style: none; margin: 0; padding: 0; background: var(--rl-panel); border: 1px solid var(--rl-soft); border-radius: var(--rl-radius-lg); overflow: hidden; }
.qp-empty { padding: 18px 14px; background: var(--rl-panel); border: 1px solid var(--rl-soft); border-radius: var(--rl-radius-lg); font-size: 13px; color: var(--rl-muted); }

.qp-row { position: relative; border-top: 1px solid var(--rl-line); }
.qp-row:first-child { border-top: 0; }
.qp-tap { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px 9px 14px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.qp-tap:hover { background: rgba(31, 38, 48, .45); }
.qp-tap:focus-visible { outline: 2px solid var(--rl-accent); outline-offset: -2px; }
.qp-main, .qp-name, .qp-meta, .qp-meta2 { display: block; }
.qp-chev { flex: none; width: 8px; height: 8px; margin: 0 2px 4px 0; border-right: 1.5px solid var(--rl-faint); border-bottom: 1.5px solid var(--rl-faint); transform: rotate(45deg); transition: transform .18s ease, margin .18s ease; }
.qp-row.is-open .qp-chev { transform: rotate(-135deg); margin: 4px 2px 0 0; }
.qp-row.is-won, .qp-row.is-placed { box-shadow: inset 3px 0 0 var(--rl-good); }
.qp-row.is-lost { box-shadow: inset 3px 0 0 var(--rl-bad); }
.qp-row.is-pending { box-shadow: inset 3px 0 0 var(--rl-line-strong); }
.qp-row.is-skip .qp-emo { opacity: .5; }
.qp-emo { flex: none; width: 26px; font-size: 19px; line-height: 1; text-align: center; }
.qp-main { flex: 1 1 auto; min-width: 0; }
.qp-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 650; color: var(--rl-white); }
.qp-name a:hover, .qp-name-lg a:hover { text-decoration: underline; text-underline-offset: 2px; }
.qp-no { margin-left: 2px; font-size: 11.5px; font-weight: 500; color: var(--rl-faint); }
.qp-meta, .qp-meta2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qp-meta { margin-top: 1px; font-size: 12px; color: var(--rl-muted); }
.qp-meta b { font-weight: 600; color: var(--rl-text); }
.qp-meta2 { font-size: 11.5px; color: var(--rl-faint); }
.qp-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; }
.qp-sub { font-size: 11px; color: var(--rl-faint); white-space: nowrap; }
.qp-fin-line { font-size: 12px; font-weight: 650; color: var(--rl-text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.qp-badge { padding: 3px 7px; border-radius: 5px; font-size: 11px; font-weight: 750; letter-spacing: .03em; white-space: nowrap; }
.qp-badge.is-won, .qp-badge.is-placed { color: #4ADE80; background: rgba(34, 197, 94, .13); }
.qp-badge.is-lost { color: #FF7375; background: rgba(255, 77, 79, .13); }
.qp-badge.is-pending { color: var(--rl-muted); background: var(--rl-soft); font-weight: 600; letter-spacing: 0; }
.qp-badge.is-skipped { color: var(--rl-faint); background: transparent; border: 1px solid var(--rl-line-strong); font-weight: 600; letter-spacing: 0; }
.qp-meta.qp-skip-line, .qp-meta.qp-wrap { white-space: normal; }
.qp-skip-line { font-style: italic; }
.qp-row.is-skip .qp-main { opacity: .72; }
.qp-row.is-void .qp-emo, .qp-row.is-void .qp-main { opacity: .5; }
.qp-row.is-void .qp-name { text-decoration: line-through; text-decoration-color: var(--rl-faint); }
.qp-badge.is-void { color: var(--rl-faint); background: var(--rl-soft); font-weight: 600; letter-spacing: 0; }
.qp-chances { margin-top: 6px; font-size: 13px; color: var(--rl-muted); }
.qp-chances b { color: var(--rl-white); }
.qp-cd { font-size: 13px; font-weight: 650; color: var(--rl-white); font-variant-numeric: tabular-nums; white-space: nowrap; }
.qp-cd.is-soon { color: var(--rl-warn); }
.qp-row.is-jumped .qp-compact { opacity: .6; }

.qp-top5 { display: none; padding: 2px 12px 12px 14px; background: var(--rl-sub); border-top: 1px solid var(--rl-line); }
.qp-row.is-open .qp-top5, .qp-row.is-next .qp-top5 { display: block; animation: qp-drop .18s ease-out; }
.qp-row.is-next .qp-top5 { padding: 0 16px 16px 18px; background: transparent; border-top: 0; }
@keyframes qp-drop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .qp-row .qp-top5 { animation: none; } .qp-chev { transition: none; } }
.qp-call { padding-top: 9px; font-size: 12.5px; line-height: 1.5; color: var(--rl-muted); }
.qp-call b { color: var(--rl-white); }
.qp-verdict { color: var(--rl-text); }
.qp-verdict.is-landed { color: #4ADE80; font-weight: 600; }
.qp-verdict.is-lost { color: #FF7375; font-weight: 600; }
.qp-t5-head { margin: 10px 0 2px; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--rl-faint); }
.qp-t5 { list-style: none; margin: 0; padding: 0; font-variant-numeric: tabular-nums; }
.qp-t5-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--rl-line); }
.qp-t5-row:first-child { border-top: 0; }
.qp-t5-rank { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--rl-soft); font-size: 11px; font-weight: 700; color: var(--rl-text); }
.qp-t5-row.is-tip .qp-t5-rank { background: var(--rl-accent); color: var(--rl-bg); }
.qp-t5-main { flex: 1 1 auto; min-width: 0; }
.qp-t5-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; color: var(--rl-white); }
.qp-t5-ch { display: block; font-size: 11.5px; color: var(--rl-muted); }
.qp-t5-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; text-align: right; }
.qp-t5-price { font-size: 13px; font-weight: 650; color: var(--rl-white); }
.qp-fin { padding: 1px 6px; border-radius: 4px; font-size: 12px; font-weight: 650; color: var(--rl-faint); white-space: nowrap; }
.qp-t5-row.f-won .qp-fin { color: #4ADE80; background: rgba(34, 197, 94, .14); }
.qp-t5-row.f-placed .qp-fin { color: var(--rl-teal); background: rgba(0, 194, 168, .12); }
.qp-t5-row.f-out .qp-t5-name { color: var(--rl-text); }
.qp-t5-link { display: inline-block; margin-top: 8px; font-size: 12.5px; font-weight: 600; color: var(--rl-teal); }
.qp-t5-link:hover { text-decoration: underline; text-underline-offset: 2px; }

.qp-full { display: none; padding: 14px 16px 16px 18px; }
.qp-row.is-next { background: #1A212A; box-shadow: inset 3px 0 0 var(--rl-accent); }
.qp-row.is-next .qp-compact { display: none; }
.qp-row.is-next .qp-full { display: block; }
.qp-full-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 12.5px; color: var(--rl-muted); }
.qp-next-tag { padding: 3px 7px; border-radius: 4px; background: var(--rl-accent); color: var(--rl-bg); font-size: 10.5px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.qp-full-clock { margin-top: 8px; font-size: 13px; color: var(--rl-muted); }
.qp-full-clock .qp-cd { font-size: 20px; }
.qp-full-level { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.qp-emo-lg { flex: none; font-size: 40px; line-height: 1; }
.qp-level { font-size: 18px; font-weight: 700; line-height: 1.25; color: var(--rl-white); }
.qp-row.t-good .qp-level { color: #4ADE80; }
.qp-row.t-teal .qp-level { color: var(--rl-teal); }
.qp-row.t-warn .qp-level { color: var(--rl-warn); }
.qp-row.t-bad .qp-level { color: #FF7375; }
.qp-wink { font-size: 12px; font-weight: 500; color: var(--rl-faint); }
.qp-line { margin-top: 2px; font-size: 13px; color: var(--rl-muted); }
.qp-name-lg { margin-top: 14px; font-size: 20px; font-weight: 700; line-height: 1.25; color: var(--rl-white); overflow-wrap: anywhere; }
.qp-advice { margin-top: 3px; font-size: 14.5px; font-weight: 600; color: var(--rl-text); }
.qp-prices { margin-top: 8px; font-size: 13px; color: var(--rl-muted); }
.qp-prices b { color: var(--rl-white); }
.qp-hint, .qp-note { margin-top: 6px; font-size: 12px; line-height: 1.45; color: var(--rl-faint); }
.qp-hint b { color: var(--rl-text); }
.qp-meta2.qp-ntd { margin-top: 1px; white-space: normal; font-weight: 600; color: var(--rl-warn); }
.qp-ntd-box { margin-top: 10px; padding: 7px 10px; border-left: 3px solid var(--rl-warn); border-radius: 4px; background: rgba(245, 158, 11, .1); font-size: 12.5px; line-height: 1.45; font-weight: 600; color: var(--rl-warn); }

.qp-how { margin-top: 18px; background: var(--rl-panel); border: 1px solid var(--rl-soft); border-radius: var(--rl-radius-lg); }
.qp-how summary { padding: 12px 14px; font-size: 13.5px; font-weight: 600; color: var(--rl-white); cursor: pointer; }
.qp-how-body { padding: 0 14px 14px; font-size: 12.5px; line-height: 1.5; color: var(--rl-muted); }
.qp-how-code { margin-top: 12px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--rl-faint); }
.qp-how-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--rl-line); }
.qp-how-row .qp-e { font-size: 20px; text-align: center; }
.qp-how-row b { color: var(--rl-white); }
.qp-how-rate { font-size: 12px; text-align: right; white-space: nowrap; }

/* Sticky bar needs clip, not hidden, on the page's scroll ancestors. */
/* Phones: full-bleed rows like a native app — no outer gutter, square edges, safe-area padding. */
html:has(.qp-page), body:has(.qp-page), .rl-main:has(.qp-page) { overflow-x: clip; }
@media (max-width: 639.98px) {
  .rl-main:has(.qp-page) { padding: 0; }
  .qp-page { --qp-l: max(14px, env(safe-area-inset-left)); --qp-r: max(12px, env(safe-area-inset-right)); }
  .qp-top { padding: 14px var(--qp-r) 10px var(--qp-l); }
  .qp-bar { padding-left: var(--qp-l); padding-right: var(--qp-r); }
  .qp-chips { margin-left: calc(-1 * var(--qp-l)); margin-right: calc(-1 * var(--qp-r)); padding: 0 var(--qp-r) 0 var(--qp-l); }
  .qp-earlier { margin: 0; padding: 12px var(--qp-r) 12px var(--qp-l); border: 0; border-bottom: 1px solid var(--rl-line); border-radius: 0; }
  .qp-day { margin-top: 0; }
  .qp-day-head { padding: 14px var(--qp-r) 7px var(--qp-l); }
  .qp-list, .qp-empty, .qp-how { border-left: 0; border-right: 0; border-radius: 0; }
  .qp-tap, .qp-top5 { padding-left: var(--qp-l); padding-right: var(--qp-r); }
  .qp-row.is-next .qp-top5 { padding: 0 var(--qp-r) 16px calc(var(--qp-l) + 2px); }
  .qp-full { padding: 14px var(--qp-r) 16px calc(var(--qp-l) + 2px); }
  .qp-empty, .qp-how summary { padding-left: var(--qp-l); padding-right: var(--qp-r); }
  .qp-how-body { padding: 0 var(--qp-r) calc(14px + env(safe-area-inset-bottom)) var(--qp-l); }
  .qp-how { margin-top: 0; border-top: 0; }
  body:has(.qp-page) .rl-footer { margin-top: 0; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
}

/* All races today, horses + greyhounds (opens the /race-day pop-out with both ticked). Bottom row, left of the round buttons.
   Horse and dog icons: Font Awesome Free (CC BY 4.0, fontawesome.com/license/free) */
.rl-both-fab {
  position: fixed; z-index: 45; right: calc(60px + env(safe-area-inset-right)); bottom: calc(14px + env(safe-area-inset-bottom));
  display: flex; align-items: center; justify-content: center; gap: 1px; width: 38px; height: 38px; border-radius: 50%;
  background: var(--rl-panel); border: 1px solid rgba(252, 211, 77, .6); box-shadow: 0 4px 14px rgba(0, 0, 0, .45); text-decoration: none;
}
.rl-both-fab:active { background: var(--rl-soft); }
.rl-both-fab .rl-ico { display: block; width: 14px; height: 14px; -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
.rl-both-fab .rl-ico-horse { --ico: url("data:image/svg+xml;utf8,<svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 512 512%27><path d=%27M0 464L0 316.9C0 208.5 68.3 111.8 170.5 75.6L340.2 15.5c21.4-7.6 43.8 8.3 43.8 30.9 0 11-5.5 21.2-14.6 27.3L336 96c48.1 0 91.2 29.8 108.1 74.9l48.6 129.5c11.8 31.4 4.1 66.8-19.6 90.5-16 16-37.8 25.1-60.5 25.1l-3.4 0c-26.1 0-50.9-11.6-67.6-31.7l-32.3-38.7c-11.7 4.1-24.2 6.4-37.3 6.4l-.1 0c-6.3 0-12.5-.5-18.6-1.5-3.6-.6-7.2-1.4-10.7-2.3l0 0c-28.9-7.8-53.1-26.8-67.8-52.2-4.4-7.7-14.2-10.3-21.9-5.8s-10.3 14.2-5.8 21.9c24 41.5 68.3 70 119.3 71.9l47.2 70.8c4 6.1 6.2 13.2 6.2 20.4 0 20.3-16.5 36.8-36.8 36.8L48 512c-26.5 0-48-21.5-48-48zM328 224a24 24 0 1 0 0-48 24 24 0 1 0 0 48z%27/></svg>"); background: #FCD34D; }
.rl-both-fab .rl-ico-dog { --ico: url("data:image/svg+xml;utf8,<svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 576 512%27><path d=%27M32 112c16.6 0 30.2 12.6 31.8 28.7l.3 6.6C65.8 163.4 79.4 176 96 176l179.1 0 140.9 60.4 0 243.6c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-131.3C296 361 268.8 368 240 368s-56-7-80-19.3L160 480c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-245.6c-37.3-13.2-64-48.6-64-90.4 0-17.7 14.3-32 32-32zM355.8-32c7.7 0 14.9 3.6 19.6 9.8L392 0 444.1 0c12.7 0 24.9 5.1 33.9 14.1L496 32 552 32c13.3 0 24 10.7 24 24l0 24c0 44.2-35.8 80-80 80l-64 0-7 28-124.7-53.4 31.6-147.2C334.3-23.9 344.2-32 355.8-32zM448 44a20 20 0 1 0 0 40 20 20 0 1 0 0-40z%27/></svg>"); background: #7DD3FC; }
body.pop-open .rl-both-fab { display: none; }
