/* BenchMarcus's light theme. Dark is the original look and stays the default; this sheet loads last and applies
   only under <html data-pf-theme="light">, which app-theme.js sets from the header's switch (via the bridge).

   How it works:
   1. Retoken. The three token sets (peer-finder.css :root, shell.css --pf-c-*, components.css .pf-pal-default) get
      light values, which carries most of the page.
   2. Patch the colours the other sheets hard-code (dark translucent panels, glows, navy text on cyan, the strip
      chart's SVG attributes). Each rule repeats the original selector under the prefix, so it always outranks it;
      where that would also outrank a modifier of the same property, the modifier is restated after it.
   3. The canvas maps (Finding, Reading) read their colours from the --pf-map-* tokens
      (shared/starfield.js), so they go light with the page and follow the switch live. The page-wide starfield is
      hidden.

   Light accents are darker versions of the dark ones, chosen for at least 4.5:1 as text on white: teal #2F588C for
   cyan, blue #2F6DB5, red #B42318, violet #6D44C0. Yellow splits in two: #F5C400 as a fill (navy text on it), and
   --pf-ink-you #7A5800 wherever yellow was text. Leaflet's pins and popups sit on map tiles, so they're unchanged. */

:root{color-scheme:dark}
html[data-pf-theme="light"]{
  color-scheme:light;
  --bg:#F4F7FB;--bg2:#FFFFFF;--card:#FFFFFF;--card2:#EEF3F9;
  --line:rgba(11,32,57,.12);--line2:rgba(11,32,57,.22);
  --fg:#0B2039;--dim:#3E5674;--dim2:#566E8C;
  --blue:#2F6DB5;--cyan:#2F588C;--yellow:#F5C400;--violet:#6D44C0;--red:#B42318;
  --pf-c-bg:#F4F7FB;--pf-c-bg2:#FFFFFF;--pf-c-card:#FFFFFF;--pf-c-card2:#EEF3F9;
  --pf-c-line:rgba(11,32,57,.12);--pf-c-line2:rgba(11,32,57,.22);
  --pf-c-fg:#0B2039;--pf-c-dim:#3E5674;--pf-c-dim2:#566E8C;
  --pf-c-blue:#2F6DB5;--pf-c-cyan:#2F588C;--pf-c-yellow:#F5C400;--pf-c-violet:#6D44C0;--pf-c-red:#B42318;
  --pf-ink-you:#7A5800;
  /* The canvas maps' colours (shared/starfield.js NIGHT), as r,g,b. Yellow is a deeper amber so it holds on white. */
  --pf-map-star:47,109,181;--pf-map-gold:214,160,0;--pf-map-land:47,109,181;--pf-map-coast:47,109,181;
  --pf-map-blue:47,109,181;--pf-map-cyan:52,95,151;--pf-map-yellow:214,160,0;--pf-map-quiet:107,129,158;
}
/* On the root too: a pf- component outside a palette root (the anchor line's "Change company", say) would otherwise
   use its stylesheet's dark fallback colour on a white page. */
html[data-pf-theme="light"],html[data-pf-theme="light"] .pf-pal-default{
  --pf-bg:#F4F7FB;--pf-card:#FFFFFF;--pf-card2:#EEF3F9;--pf-fg:#0B2039;--pf-dim:#3E5674;--pf-line:rgba(11,32,57,.22);
  --pf-act:#2F588C;--pf-act-fg:#FFFFFF;--pf-you:#F5C400;--pf-good:#2F588C;--pf-warn:#7A5800;--pf-bad:#B42318;
}
html[data-pf-theme="light"] .pd{--good:#2F588C;--bad:#B42318;--filed:#23784A}

/* Focus rings: yellow on white is too faint, so they go navy. */
html[data-pf-theme="light"] :focus-visible,
html[data-pf-theme="light"] .pd-table tr.is-you:focus,
html[data-pf-theme="light"] .pf-area-modes:focus{outline-color:#0B2039}

/* Yellow that was text */
html[data-pf-theme="light"] :is(
  .word i,.pf-word i,.pf-shellbar-msg,.finding-you,.finding-row[data-kind="read"] .finding-state,
  table.list .flag,.cmp-peer--you .cmp-peer-name,.cmp-peer-you,.wt-checks .warn .wt-mark,
  .pd-stat.is-accent .pd-stat-big,.pd-levers tr.is-trail th .pd-co-name,.pd-ladder-pos b
){color:var(--pf-ink-you)}
html[data-pf-theme="light"] table.list tr.me .co b::after{color:var(--pf-ink-you)}
html[data-pf-theme="light"] .pf-view-default{color:var(--pf-ink-you);border-color:var(--pf-ink-you)}

/* Text on a cyan fill: navy on teal is too dark, so white. Text on a yellow fill stays navy. */
html[data-pf-theme="light"] :is(
  .pf-view-btn[aria-pressed="true"],.viewbar .btn-o[aria-pressed="true"],.wt-toggle button[aria-pressed=true]
){color:#FFFFFF}
html[data-pf-theme="light"] :is(.pd-came,.pd-you){color:#0B2039}

/* Panels that were translucent navy */
html[data-pf-theme="light"] :is(.pd-stat,.pd-card,.pd-prize,.pd-next,.pd-box,.pd-tablewrap,.finding-panel,.pd-cp-card,.finding-wait,.pd-hist-co){background:var(--card)}
html[data-pf-theme="light"] .pd-hist-co.is-current{border-color:rgba(47,88,140,.45)}
html[data-pf-theme="light"] .pd-nav-link--history[aria-current="page"]{color:#FFFFFF}
html[data-pf-theme="light"] .pd-nav-menu{background:#FFFFFF;box-shadow:0 12px 30px rgba(11,32,57,.18)}
/* The finding screen's progress (app-finding.css) */
html[data-pf-theme="light"] .finding-bar{background:rgba(11,32,57,.10)}
html[data-pf-theme="light"] .finding-step[data-state="active"] .finding-step-mark{border-color:rgba(47,88,140,.22);border-top-color:var(--cyan)}
html[data-pf-theme="light"].pf-reduce-motion .finding-step[data-state="active"] .finding-step-mark{border-color:var(--cyan)}
html[data-pf-theme="light"] .pd-prize.is-top{border-color:rgba(47,88,140,.4);background:rgba(47,88,140,.06)}
html[data-pf-theme="light"] .pd-group th{background:var(--card2)}
html[data-pf-theme="light"] code{background:var(--card2)}
html[data-pf-theme="light"] .nav{background:rgba(255,255,255,.96);border-bottom-color:rgba(47,88,140,.35)}

/* "You" rows and yellow call-outs: a faint yellow vanishes on white, so a firmer amber. */
html[data-pf-theme="light"] :is(
  table.list tr.me td,.pf-me td,.pd-table tr.is-you th,.pd-table tr.is-you td,.wt-bar.me
){background:rgba(245,196,0,.14)}
html[data-pf-theme="light"] :is(.pd-banner,.banner,.pf-strip){background:rgba(245,196,0,.10)}
html[data-pf-theme="light"] :is(.banner,.pf-strip,.pd-stat.is-accent,.pd-card.is-came){border-color:rgba(176,134,0,.5)}
html[data-pf-theme="light"] .pd-card.is-came{box-shadow:0 0 0 1px rgba(176,134,0,.25) inset}
html[data-pf-theme="light"] .notice{background:rgba(245,196,0,.12);border-bottom-color:rgba(176,134,0,.5)}
html[data-pf-theme="light"] .pf-strip.is-done{border-color:rgba(47,88,140,.45);background:rgba(47,88,140,.07)}

/* Glows and shadows, lighter */
html[data-pf-theme="light"] .btn:hover{box-shadow:0 10px 26px rgba(176,134,0,.25)}
html[data-pf-theme="light"] :is(.home-search .pf-cs-list,.pf-sf-panel,.pf-about){box-shadow:0 14px 34px rgba(11,32,57,.16)}
html[data-pf-theme="light"] .pd-track-dot.is-you{box-shadow:0 0 0 4px rgba(245,196,0,.3)}

/* Bars, tracks and medians */
html[data-pf-theme="light"] :is(.wt-step,.wt-fill){background:rgba(47,109,181,.8)}
html[data-pf-theme="light"] .wt-track{background:rgba(11,32,57,.07)}
html[data-pf-theme="light"] .wt-med{border-left-color:rgba(11,32,57,.5)}
html[data-pf-theme="light"] .wt-bars.has-median .wt-track::after{border-left-color:rgba(11,32,57,.55)}
html[data-pf-theme="light"] .pd-track-dot:not(.is-you){background:rgba(62,86,116,.45)}

/* The compare screen's strip chart (peer-finder.js stripSVG and its legend) colours SVG attributes, which any CSS
   rule outranks. */
html[data-pf-theme="light"] :is(#strips,#chartLegend) [stroke="rgba(126,168,214,.35)"]{stroke:rgba(11,32,57,.25)}
html[data-pf-theme="light"] :is(#strips,#chartLegend) [fill="rgba(121,180,245,.13)"]{fill:rgba(47,109,181,.12)}
html[data-pf-theme="light"] :is(#strips,#chartLegend) [stroke^="rgba(243,247,252"]{stroke:rgba(11,32,57,.55)}
html[data-pf-theme="light"] :is(#strips,#chartLegend) [stroke="#FFF55B"]{stroke:#B08600}
html[data-pf-theme="light"] :is(#strips,#chartLegend) [fill="#FFF55B"]{fill:#F5C400;stroke:#8A6A00;stroke-width:1}
html[data-pf-theme="light"] :is(#strips,#chartLegend) [stroke="#79B4F5"]{stroke:#2F6DB5}
html[data-pf-theme="light"] :is(#strips,#chartLegend) [fill="#79B4F5"]{fill:#2F6DB5}
html[data-pf-theme="light"] :is(#strips,#chartLegend) [fill="#0F2A47"]{fill:#FFFFFF}
html[data-pf-theme="light"] #strips text[fill="#8AA4C4"]{fill:#566E8C}

/* Analysis animations (progress.css). Every state of a set is restated, as the base rule here outranks the
   original modifiers. */
html[data-pf-theme="light"] .pf-spin{border-color:rgba(176,134,0,.3);border-top-color:#B08600}
html[data-pf-theme="light"] .pf-t--wait{background:rgba(62,86,116,.18)}
html[data-pf-theme="light"] .pf-t--run{background:#F5C400}
html[data-pf-theme="light"] :is(.pf-t--done,.pf-t--stored){background:#345F97}
html[data-pf-theme="light"] .pf-t--partial{background:linear-gradient(135deg,#345F97 50%,#7C55D0 50%)}
html[data-pf-theme="light"] .pf-t--failed{border-color:#B42318}
html[data-pf-theme="light"] .pf-sheet.is-under{box-shadow:0 0 0 2px #B08600}
html[data-pf-theme="light"].pf-reduce-motion .pf-sheet.is-under{box-shadow:0 0 0 3px #B08600}
@media (prefers-reduced-motion:reduce){html[data-pf-theme="light"] .pf-sheet.is-under{box-shadow:0 0 0 3px #B08600}}
html[data-pf-theme="light"] .pf-glass-lens{fill:rgba(47,109,181,.14);stroke:#B08600}
html[data-pf-theme="light"] .pf-glass-handle{stroke:#B08600}
html[data-pf-theme="light"] .pf-ts-dot{background:#345F97}
html[data-pf-theme="light"] .pf-ts--miss .pf-ts-dot{background:#6B819E}
html[data-pf-theme="light"] .pf-ts--bad .pf-ts-dot{background:#B42318}
html[data-pf-theme="light"] .pf-ts--won .pf-ts-dot{background:transparent;border-color:#B08600}
html[data-pf-theme="light"] .pf-sweep path{fill:rgba(47,88,140,.14)}
html[data-pf-theme="light"] .pf-radar .pf-you{fill:#F5C400}
html[data-pf-theme="light"] .pf-blip{stroke:#6B819E}
html[data-pf-theme="light"] .pf-blip--run{fill:#F5C400;stroke:#B08600}
html[data-pf-theme="light"] :is(.pf-blip--done,.pf-blip--stored){fill:#345F97;stroke:#345F97}
html[data-pf-theme="light"] .pf-blip--partial{fill:rgba(52,95,151,.5);stroke:#345F97}
html[data-pf-theme="light"] .pf-blip--none{stroke:#6B819E}
html[data-pf-theme="light"] .pf-blip--failed{stroke:#B42318}
html[data-pf-theme="light"] .pf-ping{stroke:#345F97}

/* Leaflet maps: a light ground behind the tiles while they load. */
html[data-pf-theme="light"] :is(.pf-map,.pf-results-map .leaflet-container,.pf-area .leaflet-container){background:#E3E9F1}

/* The Finding screen's map sits straight on the page, as it does in dark. Its canvas takes its colours from the
   --pf-map-* tokens above; the name labels are restated here. */
html[data-pf-theme="light"] .vb-star-label{background:#FFFFFF;box-shadow:0 6px 18px rgba(11,32,57,.12)}
html[data-pf-theme="light"] .vb-star-label{border-color:rgba(176,134,0,.55);color:var(--pf-ink-you)}
html[data-pf-theme="light"] .vb-page-stars{display:none}
