/* ==========================================================================
   Punters News — dark theme. Same tokens, redefined.
   Dark is the site default; .light is opt-in via the masthead toggle.
   ========================================================================== */

:root[data-theme="dark"]{
  --green:#0D3B2E;
  --green-700:#071A14;
  --green-300:#3F9B7C;
  --gold:#D4B55F;
  --gold-600:#E0C87F;
  --gold-100:rgba(212,181,95,.14);

  --bg:#121212;
  --bg-alt:#1A1A1E;
  --bg-sunk:#232329;
  --surface:#1A1A2E;
  --surface-2:#1F1F35;

  --text:#E8E8E4;
  --text-2:#BFC2C7;
  --muted:#8E949E;
  --line:#2C2C38;
  --line-strong:#3A3A48;

  --link:#E0C87F;
  --link-hover:#F0DFA8;
  --win:#3DD17E;
  --error:#F87171;

  --shadow:0 1px 2px rgba(0,0,0,.5),0 10px 26px -14px rgba(0,0,0,.8);
  --shadow-lg:0 2px 6px rgba(0,0,0,.6),0 28px 52px -26px rgba(0,0,0,.9);
}

:root[data-theme="dark"] body{background:var(--bg);color:var(--text)}
:root[data-theme="dark"] .masthead{background:#0A2A20;box-shadow:0 1px 0 rgba(255,255,255,.06),0 10px 30px -18px #000}
:root[data-theme="dark"] .searchbar{background:#061710}
:root[data-theme="dark"] .drawer{background:#061710}
:root[data-theme="dark"] .card__title a{color:var(--text)}
:root[data-theme="dark"] table.data thead th{background:#0A2A20;color:#EDEDE6}
:root[data-theme="dark"] table.data tbody tr:nth-child(even){background:#1E1E33}
:root[data-theme="dark"] table.data tbody tr:hover{background:rgba(212,181,95,.1)}
:root[data-theme="dark"] .tag{background:var(--green-300);color:#06160F}
:root[data-theme="dark"] .tag--analysis,:root[data-theme="dark"] .tag--opinion{background:#44557A;color:#fff}
:root[data-theme="dark"] .tag--interview{background:#7A5A3E;color:#fff}
:root[data-theme="dark"] .tag--industry{background:#4C545F;color:#fff}
:root[data-theme="dark"] .tag--welfare{background:#2E8A62;color:#06160F}
:root[data-theme="dark"] .tag--feature,:root[data-theme="dark"] .tag--tips{background:var(--gold);color:#17170F}
:root[data-theme="dark"] .badge--g2{background:#A9AEB8;color:#15151A}
:root[data-theme="dark"] .badge--g3{background:#C08A58;color:#15151A}
:root[data-theme="dark"] .badge--listed{background:#6E747E;color:#fff}
:root[data-theme="dark"] .badge--plain{background:#2A2A34;color:var(--text-2)}
:root[data-theme="dark"] .going--firm{background:rgba(253,230,138,.16);color:#F3D98A}
:root[data-theme="dark"] .going--good{background:rgba(61,209,126,.14);color:#6FDCA2}
:root[data-theme="dark"] .going--soft{background:rgba(129,164,230,.16);color:#9DBAF0}
:root[data-theme="dark"] .going--heavy{background:rgba(190,160,130,.16);color:#D3B795}
:root[data-theme="dark"] .going--synth{background:rgba(170,150,220,.16);color:#C2B2EA}
:root[data-theme="dark"] .formpill{background:#2A2A34;color:var(--text-2)}
:root[data-theme="dark"] .formpill.is-win{background:var(--green-300);color:#06160F}
:root[data-theme="dark"] .pick__rank{background:var(--green-300);color:#06160F}
:root[data-theme="dark"] .pick--rough .pick__rank{background:#4C545F;color:#fff}
:root[data-theme="dark"] .tipbox{background:linear-gradient(135deg,rgba(212,181,95,.1),transparent 70%),var(--surface);border-color:rgba(212,181,95,.38)}
:root[data-theme="dark"] .formnote.is-ok{background:rgba(61,209,126,.12);color:#79E0AC;border-color:rgba(61,209,126,.3)}
:root[data-theme="dark"] .formnote.is-bad{background:rgba(248,113,113,.12);color:#F8A8A8;border-color:rgba(248,113,113,.3)}
:root[data-theme="dark"] .btn--gold{background:var(--gold);color:#17170F}
:root[data-theme="dark"] .btn--gold:hover{background:var(--gold-600);color:#17170F}
:root[data-theme="dark"] .btn--green{background:var(--green-300);color:#06160F}
:root[data-theme="dark"] .btn--green:hover{background:#51B392;color:#06160F}
:root[data-theme="dark"] .cta-strip{background:linear-gradient(135deg,#0A2A20,#13133A)}
:root[data-theme="dark"] .crumbs{background:#17171C;border-bottom-color:var(--line)}
:root[data-theme="dark"] .foot{background:#07120E}
:root[data-theme="dark"] .hero::after{background:linear-gradient(180deg,rgba(4,10,8,.6) 0%,rgba(4,10,8,.78) 45%,rgba(4,10,8,.96) 100%)}
:root[data-theme="dark"] .prose .pullquote{color:var(--gold-600)}
:root[data-theme="dark"] .tabs a.is-active,:root[data-theme="dark"] .tabs button.is-active{color:var(--gold)}
:root[data-theme="dark"] .sechead{border-bottom-color:var(--green-300)}
:root[data-theme="dark"] .aside__h{border-bottom-color:var(--green-300)}
:root[data-theme="dark"] img{filter:brightness(.96) contrast(1.02)}

/* horses/index.php — .hcell is layout only (no colour tokens), so dark needs no override. */

/* people/index.php — the portrait ring needs a touch more contrast on the dark surface. */
:root[data-theme="dark"] .whocell img{border-color:var(--line-strong)}

/* racecourses/_course.php — .statgrid--track is type size and track count only. Both
   its surfaces are the shared .statgrid ones, --surface for a cell and --line for the
   1px gap and the border, and both are redefined above, so dark needs no override. */

/* calendar/index.php — a run fixture needs a touch more light on the dark surface. */
:root[data-theme="dark"] .daystrip.is-run{opacity:.68}
:root[data-theme="dark"] .ranlabel{background:var(--bg-sunk)}

/* fashion/index.php — the flagged next date has to beat the dark zebra stripe. */
:root[data-theme="dark"] table.data tbody tr.is-next{background:var(--gold-100)}

/* about.php + policy pages — the anchored desk card needs a warmer ring on dark. */
:root[data-theme="dark"] .deskcard:target{border-color:var(--gold-600)}

/* search.js — the autocomplete cursor (.suggest a.is-sel) is built from --bg-sunk
   and a rail in --link, both redefined above, so dark needs no override: the rail
   comes out at 9.48:1 on the row fill here against 10.62:1 in light. */
