/*
 * Race Guides - the Proform page's look, copied from its own source
 * (proformracing.com: src/views/RaceGuidesView.vue, components/RaceGuides/*,
 * assets/sass/tables.scss, the table/graphics cell components and
 * tailwind.config.js, read 29-09-2026). Everything is scoped under #race-guides
 * and every class is rg- prefixed, so nothing here can collide with a Tailwind
 * utility (CLAUDE.md: never name a modifier after a positional utility).
 *
 * Restyle stage 7 (13-10-2026): the page is in the shared theme (rm-theme.css),
 * with its look unchanged, and so gains the dark theme. Every colour reads a
 * --rm-* token, or one of the page tokens below where the shared set has no colour
 * within a shade. Each page token has a light value and a dark value (dark is
 * screen only, so print stays light). The Proform palette these rules used to spell
 * out, and the token each now reads: primary #06414F (text --rm-text, the teal bands
 * --rm-band), primary-75 #537c86 (--rm-primary-75), secondary #7a0704 (--rm-action),
 * tertiary #2db674 (--rm-tertiary), gold #fcc319 (--rm-top-bg), silver #808080,
 * bronze #CD7F32, zinc-200 #e4e4e7 (--rm-line, --rm-th-rule), zinc-300 #d4d4d8
 * (--rm-ctl-line), zinc-400 #a1a1aa (--rm-text-faint, --rm-rule-strong), stone-50
 * #fafaf9 (--rm-page, --rm-note-bg), stone-100 #f5f5f4 (--rm-zebra), highlight
 * #d5dee0 (--rm-hover), white (--rm-surface). Manrope, text-xsm 13px/16px.
 * The Race Guide Settings scales (--rg-tfs ... --rg-silk-h) are sizes, not colours.
 */
html[data-restyle] #race-guides {
    /* a block's heading bar while the block is shut */
    --rg-shut-bg: #537c86;
    /* green text: a column that matches today, a drop in class */
    --rg-good-text: #2db674;
    /* the double bar's centre line */
    --rg-axis: #000000;
    /* on the teal bands: the headline's divider, the race menu's meeting rule, a stats tab with nothing behind it */
    --rg-band-divider: #737373;
    --rg-band-rule: rgba(255, 255, 255, 0.45);
    --rg-band-na: #9fb3b8;
    --rg-band-pos: #86efac;
    --rg-band-neg: #fca5a5;
    /* the run-style bar: Led, Prominent, Held up, and the letter on each */
    --rg-pb-l: #04323d;
    --rg-on-pb-l: #ffffff;
    --rg-pb-p: #537c86;
    --rg-on-pb-p: #ffffff;
    --rg-pb-h: #a1a1aa;
    --rg-on-pb-h: #ffffff;
    /* the +POS / -NEG count's hover ring */
    --rg-pn-ring: rgba(0, 0, 0, 0.12);
    /* the form: course / distance letters, a winning run, the bookmaker letter in an SP move */
    --rg-hist: #d8b4fe;
    --rg-win: #60a5fa;
    --rg-mv-label: #71717a;
    /* the page number chosen / under the mouse */
    --rg-pg-on: #d4d4d8;
    /* the dialogs' backdrop */
    --rg-scrim: rgba(6, 65, 79, 0.45);
    /* tick boxes and radios: the browser's own in light */
    --rg-accent: auto;
    /* Important data changes markers (Race Guide Settings) */
    --rg-mk-headgear-bg: #fee2e2;
    --rg-mk-headgear: #991b1b;
    --rg-mk-travelled-bg: #dbeafe;
    --rg-mk-travelled: #1e40af;
    --rg-mk-returned-bg: #fef3c7;
    --rg-mk-returned: #92400e;
    --rg-mk-trainer-bg: #ede9fe;
    --rg-mk-trainer: #5b21b6;
    --rg-mk-gelded-bg: #dcfce7;
    --rg-mk-gelded: #166534;
    /* the result strip (race-guides-fast-result.js): Provisional, Fast result, the marks on the race pills */
    --rg-prov-bg: #fef3c7;
    --rg-prov-text: #92400e;
    --rg-prov-line: #d97706;
    --rg-fast-bg: #e6f0f2;
    --rg-fast-text: #06414F;
    --rg-fast-line: #06414F;
    --rg-dot-prov: #d97706;
    --rg-dot-ab: #71717a;
}
@media screen {
html[data-restyle][data-theme="dark"] #race-guides {
    --rg-shut-bg: #06414F;
    --rg-good-text: #6ccc9e;
    --rg-axis: rgba(255, 255, 255, 0.7);
    --rg-band-divider: #737373;
    --rg-band-rule: rgba(255, 255, 255, 0.45);
    --rg-band-na: #9fb3b8;
    --rg-band-pos: #86efac;
    --rg-band-neg: #fca5a5;
    --rg-pb-l: #ffffff;
    --rg-on-pb-l: #06414F;
    --rg-pb-p: #8fb4bd;
    --rg-on-pb-p: #06414F;
    --rg-pb-h: rgba(255, 255, 255, 0.3);
    --rg-on-pb-h: #ffffff;
    --rg-pn-ring: rgba(255, 255, 255, 0.35);
    --rg-hist: #d8b4fe;
    --rg-win: #93c5fd;
    --rg-mv-label: rgba(255, 255, 255, 0.6);
    --rg-pg-on: rgba(255, 255, 255, 0.2);
    --rg-scrim: rgba(0, 0, 0, 0.6);
    --rg-accent: #fcc319;
    --rg-mk-headgear-bg: rgba(255, 138, 128, 0.18);
    --rg-mk-headgear: #ff8a80;
    --rg-mk-travelled-bg: rgba(147, 197, 253, 0.18);
    --rg-mk-travelled: #93c5fd;
    --rg-mk-returned-bg: rgba(252, 195, 25, 0.16);
    --rg-mk-returned: #fcc319;
    --rg-mk-trainer-bg: rgba(196, 181, 253, 0.18);
    --rg-mk-trainer: #c4b5fd;
    --rg-mk-gelded-bg: rgba(45, 182, 116, 0.2);
    --rg-mk-gelded: #6ccc9e;
    --rg-prov-bg: rgba(252, 195, 25, 0.14);
    --rg-prov-text: #fcc319;
    --rg-prov-line: #fcc319;
    --rg-fast-bg: rgba(255, 255, 255, 0.1);
    --rg-fast-text: #ffffff;
    --rg-fast-line: rgba(255, 255, 255, 0.6);
    --rg-dot-prov: #d97706;
    --rg-dot-ab: #71717a;
}
}
#race-guides {
    font-family: 'Manrope', sans-serif;
    -webkit-font-smoothing: antialiased;
    color: var(--rm-text);
    padding: 20px;
    /* the full window width, as Proform's page (Simon, 13-10-2026; was capped at 1680px) */
    max-width: none;
    margin: 0;
    box-sizing: border-box;
    font-size: 14px;
    /* Race Guide Settings scales (Proform's table_fontsize-* / table_spacing-* /
       preferences_spacing-*): set from data-rg-font / data-rg-space below */
    --rg-tfs: 14px; --rg-tlh: 18px;
    --rg-td-pad: 8px 16px; --rg-th-pad: 12px 4px; --rg-dense-pad: 4px 8px;
    --rg-gap: 32px; --rg-head-pad: 20px; --rg-silk-w: 30px; --rg-silk-h: 22px;
}
/* Race Guide Font Size: Small 9px, Medium 11px, Large 14px (Proform's text-[9px] / text-[11px] / text-sm) */
#race-guides[data-rg-font="small"] { --rg-tfs: 9px; --rg-tlh: 12px; }
#race-guides[data-rg-font="medium"] { --rg-tfs: 11px; --rg-tlh: 15px; }
#race-guides[data-rg-font="large"] { --rg-tfs: 14px; --rg-tlh: 18px; }
/* Race Guide Spacing: cell padding, card gaps and headers, silk size */
#race-guides[data-rg-space="small"] { --rg-td-pad: 2px 4px; --rg-th-pad: 4px 4px; --rg-dense-pad: 2px 4px; --rg-gap: 8px; --rg-head-pad: 8px 12px; --rg-silk-w: 20px; --rg-silk-h: 15px; }
#race-guides[data-rg-space="medium"] { --rg-td-pad: 4px 6px; --rg-th-pad: 8px 4px; --rg-dense-pad: 3px 6px; --rg-gap: 16px; --rg-head-pad: 12px 16px; --rg-silk-w: 26px; --rg-silk-h: 20px; }
#race-guides[data-rg-space="large"] { --rg-td-pad: 8px 16px; --rg-th-pad: 12px 4px; --rg-dense-pad: 4px 8px; --rg-gap: 32px; --rg-head-pad: 20px; --rg-silk-w: 30px; --rg-silk-h: 22px; }
#race-guides *,#race-guides *::before, #race-guides *::after { box-sizing: border-box; font-family: inherit; }
#race-guides button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
#race-guides a { color: inherit; text-decoration: none; }
#race-guides a:hover { text-decoration: underline; }
#race-guides [hidden] { display: none !important; }
#race-guides input[type="checkbox"], #race-guides input[type="radio"] { accent-color: var(--rg-accent); }
#race-guides .rg-ico { width: 1em; height: 1em; display: inline-block; vertical-align: -0.125em; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* ---- admin banner (ours, not Proform's) ---- */
#race-guides .rg-msg { background: var(--rm-surface); border-radius: 8px; box-shadow: var(--rm-shadow); padding: 20px; margin-top: 8px; font-size: 13px; text-align: center; }

/* ---- date slider (RaceGuideDatePicker, the Bet Finder's copy) ---- */
#race-guides .rg-dates { background: var(--rm-page); margin-bottom: 0; }
#race-guides .rg-dates-inner { background: var(--rm-band); color: var(--rm-on-band); padding: 8px; border-radius: 8px 8px 0 0; box-shadow: inset var(--rm-band-edge); }
#race-guides .rg-dates-nav { display: flex; align-items: center; position: relative; }
#race-guides .rg-dates-nav::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 80px; z-index: 10; pointer-events: none; background: linear-gradient(to left, var(--rm-band), transparent); }
#race-guides .rg-cal { position: relative; font-size: 36px; line-height: 1; display: flex; }
#race-guides .rg-cal .rg-ico { stroke-width: 0.75; }
#race-guides .rg-cal input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
#race-guides .rg-vr { background: var(--rm-on-band); width: 1px; height: 40px; border: 0; margin: 0 20px; flex: none; }
#race-guides .rg-arrow { font-size: 20px; line-height: 1; flex: none; }
#race-guides .rg-arrow-prev { padding-right: 20px; }
#race-guides .rg-arrow-next { position: absolute; right: 0; z-index: 20; padding-left: 20px; }
#race-guides .rg-strip { display: flex; gap: 20px; overflow-x: auto; scrollbar-width: none; padding-right: 60px; flex: 1; min-width: 0; }
#race-guides .rg-strip::-webkit-scrollbar { display: none; }
#race-guides .rg-date { text-transform: uppercase; white-space: nowrap; font-weight: 200; font-size: 13px; line-height: 16px; cursor: pointer; }
#race-guides .rg-date.rg-on { font-weight: 700; }

/* ---- race picker (RaceGuideRacePicker) ---- */
#race-guides .rg-picker { background: var(--rm-band); color: var(--rm-on-band); padding: 16px; border-radius: 0 0 8px 8px; position: sticky; top: 0; z-index: 30; box-shadow: inset var(--rm-band-edge); }
#race-guides .rg-picker.rg-unpinned { position: static; }
#race-guides .rg-chips { display: flex; gap: 20px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 4px; }
#race-guides .rg-chip { flex: none; border: 1px solid var(--rm-on-band); border-radius: 8px; text-align: center; padding: 8px 20px; font-size: 13px; line-height: 16px; cursor: pointer; }
#race-guides .rg-chip:hover { background: var(--rm-on-band-hover); }
#race-guides .rg-chip span { display: block; }
#race-guides .rg-chip.rg-on { background: var(--rm-on-band); color: var(--rm-primary); font-weight: 700; }
#race-guides .rg-info { display: flex; justify-content: space-between; align-items: center; padding-top: 28px; gap: 16px; }
#race-guides .rg-steps { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
#race-guides .rg-steps .rg-step-next { justify-content: flex-end; text-align: right; }
#race-guides .rg-step { display: flex; align-items: center; flex-shrink: 0; font-size: 13px; line-height: 16px; text-align: left; }
#race-guides .rg-step.rg-off { opacity: .5; cursor: default; }
#race-guides .rg-step .rg-box { border: 1px solid var(--rm-on-band); border-radius: 6px; padding: 8px; font-size: 14px; line-height: 1; }
#race-guides .rg-step-prev .rg-box { margin-right: 16px; }
#race-guides .rg-step-next .rg-box { margin-left: 16px; }
#race-guides .rg-headline { display: flex; align-items: center; justify-content: center; gap: 36px; text-align: left; margin: 0 16px; }
#race-guides .rg-headline h1 { font-size: 36px; line-height: 40px; font-weight: 700; margin: 0; text-align: right; white-space: nowrap; }
#race-guides .rg-headline hr { background: var(--rg-band-divider); width: 1px; height: 64px; border: 0; margin: 0; }
#race-guides .rg-lines { font-size: 13px; line-height: 18px; }
#race-guides .rg-lines p { margin: 0; }
#race-guides .rg-short { display: none; }
#race-guides .rg-pin { position: absolute; top: 100%; right: 16px; background: var(--rm-band); border-radius: 0 0 8px 8px; padding: 2px 12px 4px; font-size: 13px; }

/* ---- cards (tables.scss .table-wrap / .table_header) ---- */
#race-guides .rg-card { background: var(--rm-surface); border-radius: 8px; box-shadow: var(--rm-shadow); margin-top: 8px; }
#race-guides .rg-card.rg-spaced { margin: var(--rg-gap) 0; }
#race-guides .rg-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: var(--rg-head-pad); font-weight: 700; border-bottom: 2px solid var(--rm-line); border-radius: 8px 8px 0 0; }
#race-guides .rg-card.rg-shut .rg-head { background: var(--rg-shut-bg); color: var(--rm-on-band); border-bottom: 0; border-radius: 8px; }
#race-guides .rg-card.rg-shut .rg-head .rg-action { color: var(--rm-on-band); }
#race-guides .rg-head h2 { font-size: 16px; line-height: 22px; margin: 0; flex-grow: 1; }
#race-guides .rg-head h2 .rg-up { text-transform: uppercase; }
#race-guides .rg-head h2 .rg-plain { font-weight: 700; text-transform: none; }
#race-guides .rg-action { color: var(--rm-action); text-transform: uppercase; font-size: 12px; font-weight: 500; }
#race-guides .rg-action[aria-disabled="true"] { color: var(--rm-text-faint); cursor: not-allowed; }
#race-guides .rg-chev { font-size: 16px; margin-left: 16px; }
#race-guides .rg-note { font-size: 12px; color: var(--rm-text-dim); padding: 8px 20px; background: var(--rm-note-bg); border-bottom: 1px solid var(--rm-line); }
#race-guides .rg-note b { color: var(--rm-text); }
/* a heading bar with a block behind it opens / shuts from anywhere on it */
#race-guides .rg-head.rg-head-tog { cursor: pointer; user-select: none; }
#race-guides .rg-head.rg-head-tog:hover .rg-chev { opacity: .7; }
/* the notes under the headings: hidden by the member (Race Guide Settings brings them back) */
#race-guides .rg-note-hide { font-size: 11px; color: var(--rm-primary-75); text-decoration: underline; margin-left: 6px; white-space: nowrap; }
#race-guides .rg-note-hide:hover { color: var(--rm-text); }
/* a combined column: the part it is sorted on, and the chooser */
#race-guides table.rg-t thead th.rg-multi { cursor: pointer; }
#race-guides table.rg-t thead th small.rg-sortby { color: var(--rm-primary-75); font-weight: 600; text-transform: none; }
#race-guides .rg-sortmenu { position: fixed; z-index: 90; background: var(--rm-surface); border: 1px solid var(--rm-ctl-line); border-radius: 6px; box-shadow: var(--rm-shadow); padding: 4px 0; min-width: 180px; font-size: 12px; }
#race-guides .rg-sm-title { padding: 4px 12px; font-size: 10px; text-transform: uppercase; color: var(--rm-text-faint); font-weight: 700; }
#race-guides .rg-sm-opt { display: flex; justify-content: space-between; gap: 12px; width: 100%; text-align: left; padding: 6px 12px !important; white-space: nowrap; }
#race-guides .rg-sm-opt:hover { background: var(--rm-ctl-hover) !important; }
#race-guides .rg-sm-opt.rg-on { font-weight: 700; color: var(--rm-text); }

/* ---- tables (.table-default) ---- */
#race-guides .rg-scroll { overflow-x: auto; }
#race-guides table.rg-t { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--rm-surface); border-radius: 0 0 8px 8px; user-select: none; }
#race-guides table.rg-t thead th { background: var(--rm-surface); text-align: left; padding: var(--rg-th-pad); font-size: var(--rg-tfs); line-height: var(--rg-tlh); font-weight: 700; border-top: 2px solid var(--rm-th-rule); border-bottom: 2px solid var(--rm-th-rule); white-space: nowrap; }
#race-guides table.rg-t thead tr.rg-grp th { border-top: 0; border-bottom: 0; padding: 8px 4px 0; text-align: center; font-size: 12px; text-transform: uppercase; }
#race-guides table.rg-t thead th[data-act="sort"] { cursor: pointer; }
#race-guides table.rg-t thead th.rg-sorted::after { content: " \25BE"; font-size: 10px; }
#race-guides table.rg-t thead th.rg-sorted.rg-asc::after { content: " \25B4"; }
#race-guides table.rg-t thead th small { display: block; font-size: 9px; font-weight: 500; line-height: 12px; }
#race-guides table.rg-t tbody td { padding: var(--rg-td-pad); font-size: var(--rg-tfs); line-height: var(--rg-tlh); position: relative; white-space: nowrap; }
#race-guides table.rg-t tbody tr:nth-child(odd) td { background: var(--rm-surface); }
#race-guides table.rg-t tbody tr:nth-child(even) td { background: var(--rm-zebra); }
#race-guides table.rg-t tbody tr.rg-hl td { background: var(--rm-hover); }
#race-guides table.rg-t tbody tr.rg-nr td { color: var(--rm-text-faint); text-decoration: line-through; }
#race-guides table.rg-t tbody tr.rg-click { cursor: pointer; }
#race-guides table.rg-t td.rg-c, #race-guides table.rg-t th.rg-c { text-align: center; }
#race-guides table.rg-t td.rg-wrap { white-space: normal; min-width: 180px; }
#race-guides table.rg-t .rg-gs { border-left: 1px solid var(--rm-rule-strong); }
#race-guides table.rg-t.rg-dense tbody td { padding: var(--rg-dense-pad); }
/* the three sticky line-up columns (select, #, horse), as on Proform */
#race-guides table.rg-lineup-t th:nth-child(-n+3), #race-guides table.rg-lineup-t td:nth-child(-n+3) { position: sticky; z-index: 2; }
#race-guides table.rg-lineup-t th:nth-child(1), #race-guides table.rg-lineup-t td:nth-child(1) { left: 0; width: 36px; min-width: 36px; padding-left: 12px; padding-right: 4px; }
#race-guides table.rg-lineup-t th:nth-child(2), #race-guides table.rg-lineup-t td:nth-child(2) { left: 36px; width: 64px; min-width: 64px; padding-left: 4px; padding-right: 4px; }
#race-guides table.rg-lineup-t th:nth-child(3), #race-guides table.rg-lineup-t td:nth-child(3) { left: 100px; }
#race-guides table.rg-t .rg-stick-end { box-shadow: inset -1px 0 var(--rm-rule-strong); }

/* ---- cell colours (ColouredCell) ---- */
#race-guides .rg-c-g5 { background: var(--rm-tint-strong) !important; }
#race-guides .rg-c-g2 { background: var(--rm-tint-good) !important; }
#race-guides .rg-c-o1 { background: var(--rm-tint-weak) !important; }
#race-guides .rg-c-r2 { background: var(--rm-tint-poor) !important; }
#race-guides .rg-gold { background: var(--rm-top-bg) !important; color: var(--rm-top-text); }
#race-guides .rg-silver { background: var(--rm-silver) !important; color: var(--rm-white); }
#race-guides .rg-bronze { background: var(--rm-bronze) !important; color: var(--rm-white); }
#race-guides .rg-neg { color: var(--rm-neg); }
#race-guides .rg-pos { color: var(--rm-pos); }
#race-guides .rg-posn, #race-guides .rg-negn { display: inline-block; min-width: 18px; padding: 0 4px; border-radius: 9px; font-weight: 700; color: var(--rm-white); }
#race-guides .rg-posn { background: var(--rm-tertiary); }
#race-guides .rg-negn { background: var(--rm-pill-warn-bg); }
#race-guides .rg-pn-link { cursor: pointer; }
#race-guides .rg-pn-link:hover { filter: brightness(1.15); box-shadow: 0 0 0 2px var(--rg-pn-ring); }
#race-guides .rg-spark { vertical-align: middle; overflow: visible; }
#race-guides .rg-spark polyline { fill: none; stroke: var(--rm-text); stroke-width: 1.5; stroke-linejoin: round; }
#race-guides .rg-spark .rg-spark-par { stroke: var(--rm-text-faint); stroke-width: .75; stroke-dasharray: 2 2; }
#race-guides .rg-link-btn { color: var(--rm-action); text-decoration: underline; font-weight: 600; }
#race-guides .rg-pos-t { color: var(--rg-band-pos); }
#race-guides .rg-neg-t { color: var(--rg-band-neg); }
#race-guides .rg-hg1 { color: var(--rm-neg); }
#race-guides .rg-histc { color: var(--rg-hist); }
#race-guides .rg-histbf { color: var(--rm-neg); }
#race-guides .rg-win { color: var(--rg-win); }
/* the Filtered row against the Benchmark row (Proform's bg-green-200 / bg-red-200) */
#race-guides table.rg-t tbody tr td.rg-bm-up { background: var(--rm-tint-good); }
#race-guides table.rg-t tbody tr td.rg-bm-down { background: var(--rm-tint-poor); }
#race-guides .rg-tick { color: var(--rg-good-text); font-weight: 700; }
#race-guides .rg-up-cls { color: var(--rm-action); }
#race-guides .rg-down-cls { color: var(--rg-good-text); }
#race-guides .rg-dim { color: var(--rm-text-faint); }
/* phase 3: the form lines' extras */
#race-guides .rg-tprb { white-space: nowrap; font-size: 11px; }
#race-guides .rg-tprb span { padding: 0 2px; border-radius: 2px; }
#race-guides .rg-moves { white-space: nowrap; font-size: 9px; }
#race-guides .rg-mv-p { font-size: 10px; color: var(--rg-mv-label); }
#race-guides .rg-moves > span[class^="rg-mv-"]:not(.rg-mv-p) { margin: 0 2px; }
#race-guides .rg-mv-in { color: var(--rm-pos); }
#race-guides .rg-mv-out { color: var(--rm-neg); }
#race-guides .rg-mv-held { color: var(--rm-text-faint); }
#race-guides .rg-post { white-space: nowrap; }
#race-guides .rg-silk { width: var(--rg-silk-w); height: var(--rg-silk-h); object-fit: contain; vertical-align: middle; transition: transform .15s; position: relative; z-index: 3; }
#race-guides .rg-silk:hover { transform: scale(2.5); }

/* ---- "not yet available" (ours, not Proform's) ---- */
#race-guides .rg-na-h { color: var(--rm-text-faint) !important; font-style: italic; }
#race-guides .rg-na { color: var(--rm-text-faint); font-size: 11px; font-style: italic; }
#race-guides .rg-na-card { border: 1px dashed var(--rm-rule); box-shadow: none; }
#race-guides .rg-na-card .rg-head { color: var(--rm-text-faint); border-bottom-style: dashed; }
#race-guides .rg-na-body { padding: 20px; font-size: 13px; color: var(--rm-text-dim); }

/* ---- graphics: dots, double bars, bars, pace ---- */
#race-guides .rg-dots { display: inline-flex; gap: 2px; vertical-align: middle; }
#race-guides .rg-dots i { width: 7px; height: 7px; display: inline-block; }
#race-guides .rg-dots i.rg-dot-c { border-radius: 50%; background: var(--rm-action); }
#race-guides .rg-dots i.rg-dot-s { background: var(--rm-tertiary); }
#race-guides .rg-dbar { width: 40px; height: 10px; position: relative; display: block; margin: 0 auto; }
#race-guides .rg-dbar::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--rg-axis); }
#race-guides .rg-dbar span { position: absolute; top: 1px; bottom: 1px; }
#race-guides .rg-dbar span.rg-good { left: 50%; background: var(--rm-tertiary); }
#race-guides .rg-dbar span.rg-bad { right: 50%; background: var(--rm-action); }
#race-guides .rg-hbar { width: 50px; height: 10px; display: block; }
#race-guides .rg-hbar span { display: block; height: 100%; }
#race-guides .rg-bar-win { background: var(--rm-chart-win); }
#race-guides .rg-bar-plc { background: var(--rm-chart-place); }
#race-guides .rg-bar-poor { background: var(--rm-chart-unplaced); }
#race-guides .rg-pacebar { display: flex; width: 120px; height: 13px; border-radius: 2px; overflow: hidden; }
#race-guides .rg-pacebar span { display: block; height: 100%; font-size: 9px; line-height: 13px; text-align: center; }
#race-guides .rg-pb-l { background: var(--rg-pb-l); color: var(--rg-on-pb-l); }
#race-guides .rg-pb-p { background: var(--rg-pb-p); color: var(--rg-on-pb-p); }
#race-guides .rg-pb-h { background: var(--rg-pb-h); color: var(--rg-on-pb-h); }

/* ---- stats navigation (StatsNavigation) ---- */
#race-guides .rg-statsnav { background: var(--rm-band); color: var(--rm-on-band); border-radius: 8px; padding: 24px; margin-top: 8px; position: relative; box-shadow: inset var(--rm-band-edge); }
#race-guides .rg-statsnav::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 80px; pointer-events: none; border-radius: 0 8px 8px 0; background: linear-gradient(to left, var(--rm-band), transparent); }
#race-guides .rg-sn-row { display: flex; gap: 20px; overflow-x: auto; scrollbar-width: none; padding-right: 60px; }
#race-guides .rg-sn-row::-webkit-scrollbar { display: none; }
#race-guides .rg-sn-grp { display: grid; flex: none; border-left: 1px solid var(--rm-on-band); padding-left: 16px; align-items: center; }
#race-guides .rg-sn-grp:first-child { border-left: 0; padding-left: 0; }
#race-guides .rg-sn-title { grid-column: 1 / -1; text-align: center; text-transform: uppercase; font-size: 13px; line-height: 16px; }
#race-guides .rg-sn { text-transform: uppercase; text-align: center; margin: 0 8px; display: flex; flex-direction: column; justify-content: center; font-size: 14px; line-height: 18px; font-weight: 400; }
#race-guides .rg-sn span { display: block; }
#race-guides .rg-sn.rg-on { font-weight: 700; }
#race-guides .rg-sn.rg-sn-na { color: var(--rg-band-na); }

/* ---- benchmark tabs, filters, detail ---- */
#race-guides .rg-tabs { list-style: none; display: flex; gap: 24px; margin: 0; padding: 8px 20px; border-bottom: 1px solid var(--rm-line); }
#race-guides .rg-tabs button { font-size: 13px; padding: 4px 0; border-bottom: 2px solid transparent; }
#race-guides .rg-tabs button.rg-on { border-bottom-color: var(--rm-tab-line); font-weight: 700; }
#race-guides .rg-detail { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 20px; list-style: none; margin: 0; font-weight: 700; font-size: 13px; }
#race-guides .rg-detail span { font-weight: 400; }
/* ---- the filter panel (RaceGuideFilter.vue: .selected_filters, .filter_tabs, .filters) ---- */
#race-guides .rg-filters { font-size: 13px; }
#race-guides .rg-fchips { list-style: none; margin: 0; padding: 12px 20px 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; line-height: 16px; }
#race-guides .rg-fchips b { font-weight: 700; }
#race-guides .rg-fchip { cursor: pointer; margin-right: 8px; }
#race-guides .rg-fchip i { font-style: normal; color: var(--rm-action); margin-left: 4px; font-size: 15px; line-height: 1; }
#race-guides .rg-ftabs { list-style: none; margin: 0; padding: 16px 20px; display: flex; gap: 8px; }
#race-guides .rg-ftabs button { font-size: 14px; border: 1px solid var(--rm-ctl-line); border-radius: 6px; padding: 8px 20px; text-align: center; }
#race-guides .rg-ftabs button.rg-on { background: var(--rm-sel-bg); color: var(--rm-sel-text); }
#race-guides .rg-fscroll { overflow-x: auto; scrollbar-width: thin; }
#race-guides .rg-fblocks { display: flex; background: var(--rm-note-bg); border-radius: 0 0 8px 8px; }
#race-guides .rg-fblk { font-size: 11px; flex: 1 0 auto; display: flex; flex-direction: column; }
#race-guides .rg-fblk.rg-fnarrow { flex-grow: 0; }
#race-guides .rg-fblk:nth-child(even) .rg-ffields { background: var(--rm-surface); }
#race-guides .rg-ftitle { background: var(--rm-surface); padding: 8px 20px; border-bottom: 2px solid var(--rm-line); font-weight: 700; white-space: nowrap; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
#race-guides .rg-fchev { font-style: normal; display: none; }
#race-guides .rg-ffields { padding: 20px; flex-grow: 1; }
#race-guides .rg-fgrid { display: grid; grid-auto-flow: column; grid-template-rows: repeat(5, auto); gap: 4px 12px; justify-content: start; }
#race-guides .rg-fgrid.rg-fgrid6 { grid-template-rows: repeat(6, auto); }
#race-guides .rg-ffields label { display: flex; align-items: center; gap: 6px; white-space: nowrap; font-weight: 400; cursor: pointer; }
#race-guides .rg-frow { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
#race-guides .rg-fcol { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
#race-guides .rg-finput { border: 1px solid var(--rm-ctl-line); border-radius: 4px; padding: 4px 6px; font-size: 11px; color: var(--rm-text); background: var(--rm-field); width: 90px; }
#race-guides .rg-finput.rg-fwide { width: 160px; }
#race-guides .rg-finput.rg-fnum { width: 67px; }
#race-guides .rg-fbtn { background: var(--rm-sel-bg) !important; color: var(--rm-sel-text) !important; border-radius: 4px !important; padding: 4px 10px !important; font-size: 11px; margin-top: 4px; }
#race-guides .rg-sf-label { font-size: 13px; font-weight: 400; }
#race-guides .rg-sf-select { border: 1px solid var(--rm-ctl-line); border-radius: 4px; padding: 4px; font-size: 13px; color: var(--rm-text); background: var(--rm-field); max-width: 220px; }
#race-guides .rg-sf-select:disabled { color: var(--rm-text-faint); cursor: not-allowed; }
#race-guides .rg-editcols { white-space: nowrap; }

/* ---- dialogs: Edit Columns, saved filters (ours, in Proform's colours) ---- */
#race-guides .rg-modal { position: fixed; inset: 0; background: var(--rg-scrim); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 60px 16px 16px; overflow-y: auto; }
#race-guides .rg-modal-box { background: var(--rm-surface); border-radius: 8px; box-shadow: var(--rm-shadow); width: 100%; max-width: 520px; font-size: 13px; }
#race-guides .rg-modal-box header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 2px solid var(--rm-line); }
#race-guides .rg-modal-box h3 { margin: 0; font-size: 16px; text-transform: uppercase; }
#race-guides .rg-modal-x { font-size: 22px; line-height: 1; }
#race-guides .rg-modal-body { padding: 12px 20px; max-height: 65vh; overflow-y: auto; }
#race-guides .rg-modal-body p { margin: 6px 0; }
#race-guides .rg-modal-box footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--rm-line); }
#race-guides .rg-modal-err { color: var(--rm-action); font-weight: 600; }
#race-guides .rg-mbtn { border: 1px solid var(--rm-ctl-line) !important; border-radius: 6px !important; padding: 5px 12px !important; font-size: 12px; white-space: nowrap; }
#race-guides .rg-mbtn.rg-mbtn-on { background: var(--rm-sel-bg) !important; color: var(--rm-sel-text) !important; border-color: var(--rm-sel-bg) !important; }
#race-guides .rg-mbtn.rg-mbtn-bad { color: var(--rm-action) !important; }
#race-guides .rg-mfield { display: flex; flex-direction: column; gap: 4px; font-weight: 700; margin: 8px 0; }
#race-guides .rg-mfield input, #race-guides .rg-sflist input[type="text"] { border: 1px solid var(--rm-ctl-line); border-radius: 4px; padding: 6px 8px; font-size: 13px; font-weight: 400; color: var(--rm-text); background: var(--rm-field); }
#race-guides .rg-mcheck { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
#race-guides .rg-colist, #race-guides .rg-sflist { list-style: none; margin: 8px 0; padding: 0; }
#race-guides .rg-colist li, #race-guides .rg-sflist li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 5px 4px; border-bottom: 1px solid var(--rm-zebra); }
#race-guides .rg-colist li label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
#race-guides .rg-colist li.rg-col-off label { color: var(--rm-text-faint); }
#race-guides .rg-col-mv { display: inline-flex; gap: 4px; }
#race-guides .rg-col-mv button { border: 1px solid var(--rm-ctl-line); border-radius: 4px; width: 26px; height: 24px; }
#race-guides .rg-col-mv button[disabled] { opacity: .3; cursor: default; }
#race-guides .rg-sflist li.rg-sf-cur { background: var(--rm-hover); }
#race-guides .rg-sf-acts { display: inline-flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
#race-guides .rg-sf-def { background: var(--rm-tertiary); color: var(--rm-white); border-radius: 9px; padding: 0 6px; font-size: 10px; font-weight: 700; }
#race-guides .rg-fhead-tools { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
#race-guides .rg-switch { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; cursor: pointer; }
#race-guides .rg-switch i { width: 30px; height: 16px; border-radius: 8px; background: var(--rm-switch-off); position: relative; display: inline-block; }
#race-guides .rg-switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--rm-switch-knob); transition: left .15s; }
#race-guides .rg-switch.rg-on i { background: var(--rm-switch-on); }
#race-guides .rg-switch.rg-on i::after { left: 16px; }
#race-guides .rg-pager { display: flex; justify-content: flex-start; flex-wrap: wrap; gap: 8px 24px; padding: 10px 20px; font-size: 12px; align-items: center; }
#race-guides .rg-pager button[disabled] { opacity: .35; cursor: default; }
#race-guides .rg-pg-res { font-weight: 700; }
#race-guides .rg-pg-btns { display: inline-flex; gap: 4px; align-items: center; }
#race-guides .rg-pg-n { min-width: 30px; height: 30px; padding: 0 8px; border: 0; border-radius: 4px; background: var(--rm-surface); color: var(--rm-text); font-size: 14px; cursor: pointer; }
#race-guides .rg-pg-n:not([disabled]):hover { background: var(--rg-pg-on); }
#race-guides .rg-pg-n.rg-on { background: var(--rg-pg-on); font-weight: 700; }
#race-guides .rg-pg-gap { padding: 0 2px; color: var(--rm-text-faint); }
#race-guides .rg-pg-per { display: inline-flex; gap: 8px; align-items: center; font-weight: 700; }
#race-guides .rg-pg-per select { border: 1px solid var(--rm-ctl-line); border-radius: 4px; padding: 4px; font-size: 13px; color: var(--rm-text); background: var(--rm-field); }
#race-guides .rg-empty { padding: 20px; font-size: 13px; text-align: center; color: var(--rm-text-dim); }
#race-guides .rg-loading { padding: 20px; text-align: center; font-size: 13px; }

/* ---- Race Guide Settings (the Proform panel): the cog, the dialog, the change markers ---- */
/* the race menu (Proform's hamburger): every race of a day by meeting */
#race-guides .rg-menubtn { flex: none; display: flex; font-size: 22px; line-height: 1; border: 1px solid var(--rm-on-band); border-radius: 6px; padding: 6px; margin-right: 16px; }
#race-guides .rg-menubtn:hover { background: var(--rm-on-band-hover); }
#race-guides .rg-menu-box { max-width: 1000px; background: var(--rm-band); color: var(--rm-on-band); box-shadow: inset var(--rm-band-edge), var(--rm-shadow); }
#race-guides .rg-menu-box header { border-bottom: 0; padding: 20px 28px 8px; }
#race-guides .rg-menu-box .rg-modal-body { padding: 0 28px 20px; max-height: 75vh; }
#race-guides .rg-menu-date { display: flex; align-items: center; gap: 10px; }
#race-guides .rg-menu-day { font-size: 26px; line-height: 1; padding: 0 6px !important; }
#race-guides .rg-menu-cal { position: relative; display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 17px; font-weight: 600; }
#race-guides .rg-menu-cal .rg-ico { font-size: 34px; stroke-width: 0.9; }
#race-guides .rg-menu-cal input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
#race-guides .rg-menu-mtg { padding: 18px 0; border-bottom: 1px solid var(--rg-band-rule); }
#race-guides .rg-menu-mtg h4 { margin: 0 0 14px; font-size: 16px; font-weight: 700; }
#race-guides .rg-menu-times { display: flex; flex-wrap: wrap; gap: 8px; }
#race-guides .rg-menu-race { border: 1px solid var(--rm-on-band) !important; border-radius: 4px !important; padding: 8px 14px !important; font-size: 13px; font-weight: 700; min-width: 64px; }
#race-guides .rg-menu-race:hover { background: var(--rm-on-band-hover) !important; }
#race-guides .rg-menu-race.rg-on { background: var(--rm-on-band) !important; color: var(--rm-primary) !important; }
#race-guides .rg-setbtn { font-size: 26px; line-height: 1; display: flex; margin-left: 16px; flex: none; }
#race-guides .rg-setbtn .rg-ico { stroke-width: 1.25; }
#race-guides .rg-set h4 { margin: 14px 0 6px; font-size: 13px; font-weight: 700; }
#race-guides .rg-set-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; cursor: pointer; }
#race-guides .rg-set-marks { padding-left: 4px; }
#race-guides .rg-set-opts { display: flex; flex-wrap: wrap; gap: 6px 18px; }
#race-guides .rg-set-opts label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
#race-guides .rg-mk { display: inline-block; white-space: nowrap; border-radius: 3px; padding: 0 4px; margin: 1px 3px 1px 0; font-size: 0.85em; font-weight: 600; line-height: 1.4; }
#race-guides .rg-mk-headgear { background: var(--rg-mk-headgear-bg); color: var(--rg-mk-headgear); }
#race-guides .rg-mk-travelled { background: var(--rg-mk-travelled-bg); color: var(--rg-mk-travelled); }
#race-guides .rg-mk-returned { background: var(--rg-mk-returned-bg); color: var(--rg-mk-returned); }
#race-guides .rg-mk-trainer { background: var(--rg-mk-trainer-bg); color: var(--rg-mk-trainer); }
#race-guides .rg-mk-gelded { background: var(--rg-mk-gelded-bg); color: var(--rg-mk-gelded); }
#race-guides .rg-mk-today { display: block; margin-bottom: 4px; }


/* ---- mobile ---- */
@media (max-width: 1023px) {
    #race-guides { padding: 8px; }
    #race-guides .rg-picker { position: static; }
    #race-guides .rg-pin { display: none; }
    #race-guides .rg-chips { display: none; }
    #race-guides .rg-info { padding-top: 0; }
    #race-guides .rg-long { display: none; }
    #race-guides .rg-short { display: inline; }
    #race-guides .rg-headline { flex-direction: column; gap: 4px; text-align: center; }
    #race-guides .rg-headline h1 { font-size: 22px; line-height: 28px; text-align: center; }
    #race-guides .rg-headline hr { display: none; }
    #race-guides .rg-lines { text-align: center; font-size: 12px; }
    /* two arrows a side, so each keeps a small label */
    #race-guides .rg-step .rg-word { font-size: 10px; line-height: 12px; }
    #race-guides .rg-step-prev .rg-box { margin-right: 6px; }
    #race-guides .rg-step-next .rg-box { margin-left: 6px; }
    #race-guides .rg-step .rg-box { padding: 6px; }
    #race-guides .rg-headline { margin: 0 4px; }
    #race-guides .rg-steps { gap: 6px; }
    #race-guides .rg-menubtn { margin-right: 10px; }
    #race-guides .rg-menu-box header { padding: 16px 16px 4px; }
    #race-guides .rg-menu-box .rg-modal-body { padding: 0 16px 16px; }
    /* a phone caps the chosen font size (Large reads as 11px) and the largest padding */ #race-guides table.rg-t thead th, #race-guides table.rg-t tbody td { font-size: min(var(--rg-tfs), 11px); line-height: min(var(--rg-tlh), 15px); }
    #race-guides[data-rg-space="large"] { --rg-td-pad: 4px 8px; --rg-gap: 16px; }
    #race-guides .rg-statsnav { padding: 16px 10px; border-radius: 0; }
    #race-guides .rg-detail { grid-template-columns: 1fr; }
    /* the filter panel on a phone: one block per row, each opened by its title (Proform's showMd) */
    #race-guides .rg-fblocks { display: block; }
    #race-guides .rg-fchev { display: inline; }
    #race-guides .rg-ftitle { cursor: pointer; }
    #race-guides .rg-ffields { display: none; }
    #race-guides .rg-ffields.rg-open { display: block; }
    #race-guides .rg-ftabs { padding: 12px; flex-wrap: wrap; }
    #race-guides .rg-ftabs li { flex: 1 1 0; }
    #race-guides .rg-ftabs button { width: 100%; padding: 8px; font-size: 12px; }
    #race-guides .rg-saved-tools { width: 100%; }
}
@media (max-width: 639px) {
    #race-guides table.rg-t thead th, #race-guides table.rg-t tbody td { font-size: min(var(--rg-tfs), 10px); line-height: min(var(--rg-tlh), 13px); }
    #race-guides .rg-head { padding: 10px 12px; }
}

/* ---- frozen leading columns (any table) and drag to scroll ---- */
#race-guides table.rg-t .rg-frz { position: sticky; z-index: 2; }
#race-guides table.rg-t .rg-frz-end { box-shadow: inset -1px 0 var(--rm-rule-strong); }
#race-guides .rg-can-drag { cursor: grab; }
#race-guides .rg-dragging, #race-guides .rg-dragging * { cursor: grabbing !important; user-select: none; }
