/* LIGHT MODE
   Scoped to html[data-theme="light"]. Delete this file (and its <link>) to restore today's site.
   Colors, borders, and shadows only. No layout. */

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f8fb;
  --bg-alt: #ffffff;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #475569;
  --accent: #22d3ee;
  --accent-2: #2563eb;
  --orange: #c2410c;
  --pos: #15803d;
  --neg: #b91c1c;
  --card: #ffffff;
  --card2: #f8fafc;
  --line: #e2e8f0;
  --txt: #0f172a;
  --mut: #475569;
  --green: #15803d;
  --red: #b91c1c;
  --cyan: #22d3ee;
}

html[data-theme="light"] body {
  background: var(--bg);
  color: var(--text);
}

/* ---- surfaces that were hard-coded navy ---- */
html[data-theme="light"] .header {
  background: rgba(255, 255, 255, 0.92);
  border-bottom-color: #e2e8f0;
}
html[data-theme="light"] .hero {
  background: radial-gradient(ellipse at 50% 0%, rgba(34, 211, 238, 0.14), transparent 60%);
}
html[data-theme="light"] .article,
html[data-theme="light"] .principle,
html[data-theme="light"] .weights-pre,
html[data-theme="light"] .ytd-table,
html[data-theme="light"] .sleeve-btn,
html[data-theme="light"] .tracker-visual {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #334155;
}
html[data-theme="light"] .principles-banner,
html[data-theme="light"] .phil-card,
html[data-theme="light"] .ytd-head,
html[data-theme="light"] .xrp {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #0f172a;
}
html[data-theme="light"] .phil-card {
  background: #ffffff;
  border-left-color: #22d3ee;
}
html[data-theme="light"] .banner {
  background: #ffffff;
  border-color: #e2e8f0;
}
html[data-theme="light"] .ytd-row {
  border-bottom-color: #e2e8f0;
}
html[data-theme="light"] .ytd-head {
  background: #f1f5f9;
  color: #475569;
}
html[data-theme="light"] .weights,
html[data-theme="light"] .banner-brand,
html[data-theme="light"] .xrp strong {
  color: #0f172a;
}
html[data-theme="light"] .xrp p,
html[data-theme="light"] .article p,
html[data-theme="light"] .principle p,
html[data-theme="light"] .xnote,
html[data-theme="light"] .xnote a {
  color: #475569;
}

/* Cyan as small text — darkened. Fills and buttons stay #22d3ee. */
html[data-theme="light"] .eyebrow,
html[data-theme="light"] .brand-text span,
html[data-theme="light"] .principle .num,
html[data-theme="light"] .group-label,
html[data-theme="light"] .tag,
html[data-theme="light"] .article-date,
html[data-theme="light"] .article-link,
html[data-theme="light"] .as-of,
html[data-theme="light"] .pulse-link,
html[data-theme="light"] .footer a,
html[data-theme="light"] .metric span:last-child,
html[data-theme="light"] .read-toggle,
html[data-theme="light"] .copy-btn,
html[data-theme="light"] .pdf-link,
html[data-theme="light"] .month-close-btn,
html[data-theme="light"] .download-pdf,
html[data-theme="light"] .close-modal,
html[data-theme="light"] .modal-date,
html[data-theme="light"] .bc-cl,
html[data-theme="light"] .xsub a,
html[data-theme="light"] .rc-go,
html[data-theme="light"] #articles .article-date,
html[data-theme="light"] .header nav a.is-active,
html[data-theme="light"] .mnav-menu > a.is-active,
html[data-theme="light"] .mnav-menu > a:hover,
html[data-theme="light"] .bench-btn.active,
html[data-theme="light"] .cmp-beta,
html[data-theme="light"] .wrap a {
  color: #0e7490;
}
html[data-theme="light"] .read-toggle,
html[data-theme="light"] .copy-btn,
html[data-theme="light"] .pdf-link,
html[data-theme="light"] .month-close-btn,
html[data-theme="light"] .download-pdf,
html[data-theme="light"] .close-modal {
  border-color: #0e7490;
  background: transparent;
}
html[data-theme="light"] .read-toggle:hover,
html[data-theme="light"] .copy-btn:hover,
html[data-theme="light"] .pdf-link:hover,
html[data-theme="light"] .month-close-btn:hover,
html[data-theme="light"] .download-pdf:hover,
html[data-theme="light"] .close-modal:hover,
html[data-theme="light"] .sleeve-btn.active,
html[data-theme="light"] .pill button.on,
html[data-theme="light"] .pv .bench-btn.on,
html[data-theme="light"] .bc-rg button.on,
html[data-theme="light"] .back-to-top,
html[data-theme="light"] .cta {
  background: #22d3ee;
  color: #041016;
  border-color: #22d3ee;
}
html[data-theme="light"] .tag {
  background: rgba(8, 145, 178, 0.1);
}
html[data-theme="light"] .sleeve-btn {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #334155;
}
html[data-theme="light"] .sleeve-btn:hover {
  border-color: #22d3ee;
  color: #0f172a;
}
html[data-theme="light"] .bench-btn {
  border-color: #e2e8f0;
  color: #475569;
  background: #ffffff;
}
/* Selected benchmark (homepage hero only): bolder outline, slightly lighter.
   Dark mode untouched — this rule is light-only and scoped to .bench-selector,
   so the Live/Month-end mode toggle and vehicle toggle keep the 1px border. */
html[data-theme="light"] .bench-selector .bench-btn.active {
  border-width: 2px;
  border-color: #67e8f9;
}
html[data-theme="light"] .tracker-visual,
html[data-theme="light"] .chart-wrap {
  background: #ffffff;
}

/* Gains and losses — darkened only for contrast on white */
html[data-theme="light"] .pos,
html[data-theme="light"] .up,
html[data-theme="light"] .hdr-chg.up,
html[data-theme="light"] .btc-live-chg.up,
html[data-theme="light"] .pv .pos,
html[data-theme="light"] .pf-sub .up,
html[data-theme="light"] .pf-tbl .up,
html[data-theme="light"] .pulse-chg .up {
  color: #15803d;
}
html[data-theme="light"] .neg,
html[data-theme="light"] .down,
html[data-theme="light"] .hdr-chg.down,
html[data-theme="light"] .btc-live-chg.down,
html[data-theme="light"] .pv .neg,
html[data-theme="light"] .pf-sub .down,
html[data-theme="light"] .pulse-chg .down {
  color: #b91c1c;
}
html[data-theme="light"] .btc-live-dot,
html[data-theme="light"] .lp-dot {
  background: #15803d;
  box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.18);
}

/* Article modal */
html[data-theme="light"] .article-modal,
html[data-theme="light"] .article-modal--x {
  background: #ffffff;
  color: #0f172a;
}
html[data-theme="light"] .modal-body,
html[data-theme="light"] .modal-body p,
html[data-theme="light"] .modal-body p:first-of-type,
html[data-theme="light"] .article-modal--x .modal-body,
html[data-theme="light"] .article-modal--x .modal-body strong {
  color: #1e293b;
}
html[data-theme="light"] .modal-header {
  border-bottom-color: #e2e8f0;
}
html[data-theme="light"] .modal-close {
  color: #475569;
}
html[data-theme="light"] .modal-close:hover {
  color: #0f172a;
}

/* Phone menu, BTC chart, rules popup */
html[data-theme="light"] .mnav-menu {
  background: rgba(255, 255, 255, 0.98);
  border-bottom-color: #e2e8f0;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}
html[data-theme="light"] .mnav-menu > a {
  color: #334155;
  border-bottom-color: #e2e8f0;
}
html[data-theme="light"] .mnav-btn {
  border-color: #e2e8f0;
  color: #0f172a;
}
html[data-theme="light"] .mnav-btn[aria-expanded="true"] {
  border-color: #22d3ee;
  color: #0e7490;
}
html[data-theme="light"] .bc-w,
html[data-theme="light"] .prd-card,
html[data-theme="light"] .prd-x,
html[data-theme="light"] .slv-pop {
  background: #ffffff;
  color: #0f172a;
  border-color: #e2e8f0;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
}
html[data-theme="light"] .bc-dim,
html[data-theme="light"] .prd-dim,
html[data-theme="light"] .ind-modal {
  background: rgba(15, 23, 42, 0.4);
}
html[data-theme="light"] .bc-grab,
html[data-theme="light"] .prx-grab {
  background: #cbd5e1;
}
html[data-theme="light"] .bc-rr,
html[data-theme="light"] .bc-nt,
html[data-theme="light"] .bc-rg button,
html[data-theme="light"] .lp-lab,
html[data-theme="light"] .lp-cv,
html[data-theme="light"] .bc-k,
html[data-theme="light"] .bc-rg-hint {
  color: #475569;
}
html[data-theme="light"] .bc-x,
html[data-theme="light"] .prd-x,
html[data-theme="light"] .slv-pop .slv-x {
  color: #334155;
  background: #f8fafc;
  border-color: #e2e8f0;
}
html[data-theme="light"] .bc-rg button {
  border-color: #e2e8f0;
  background: #ffffff;
}
html[data-theme="light"] .bc-sc button.on {
  background: rgba(14, 116, 144, 0.1) !important;
  color: #0e7490 !important;
}
html[data-theme="light"] .hdr-tick {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #0f172a;
}
html[data-theme="light"] .hdr-tick:hover,
html[data-theme="light"] .hdr-tick[aria-expanded="true"] {
  border-color: #22d3ee;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.2);
}

/* Follow pill */
html[data-theme="light"] .xfab,
html[data-theme="light"] .xpill {
  background: #ffffff;
  box-shadow: 0 0 0 1px #e2e8f0, 0 8px 24px rgba(15, 23, 42, 0.08);
}
html[data-theme="light"] .xf-x {
  box-shadow: 0 6px 24px rgba(34, 211, 238, 0.28), 0 0 0 3px #ffffff;
}
html[data-theme="light"] .footer .small {
  opacity: 1;
  color: #475569;
}
html[data-theme="light"] .stat-label,
html[data-theme="light"] .bench-label,
html[data-theme="light"] .rc-b,
html[data-theme="light"] .rc-s {
  color: #475569;
}
html[data-theme="light"] .control select,
html[data-theme="light"] .control input,
html[data-theme="light"] .pv input,
html[data-theme="light"] .pv select,
html[data-theme="light"] input,
html[data-theme="light"] select {
  background: #ffffff;
  color: #0f172a;
  border-color: #e2e8f0;
}
html[data-theme="light"] .pvx-rm {
  color: #334155;
  border-color: #e2e8f0;
  background: #ffffff;
}
html[data-theme="light"] .bar-wrap {
  background: #e2e8f0;
}

/* Screener */
html[data-theme="light"] .btc-pill-row .hdr-tick,
html[data-theme="light"] .ind-dialog,
html[data-theme="light"] .note-pill,
html[data-theme="light"] #ind-info-pill,
html[data-theme="light"] #ind-pill {
  background: #ffffff;
  color: #0f172a;
  border-color: #e2e8f0;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.1);
}
html[data-theme="light"] #ind-canvas {
  background: #ffffff;
}
html[data-theme="light"] .controls input,
html[data-theme="light"] .btn,
html[data-theme="light"] .cmp-tab,
html[data-theme="light"] .cmp-chip {
  background: #ffffff;
  color: #0f172a;
  border-color: #e2e8f0;
}
html[data-theme="light"] .btn.active,
html[data-theme="light"] .cmp-tab.is-on {
  background: #22d3ee;
  color: #041016;
  border-color: #22d3ee;
}
html[data-theme="light"] .cmp-chip.is-on {
  color: #0f172a;
}
html[data-theme="light"] .cmp-tip,
html[data-theme="light"] .cmp-stat,
html[data-theme="light"] .cmp-row button {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #0f172a;
}
html[data-theme="light"] .note-btn,
html[data-theme="light"] .ind-info-btn,
html[data-theme="light"] details.more > summary .more-btn {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}
html[data-theme="light"] .bar {
  background: #e2e8f0;
}
html[data-theme="light"] .meta {
  border-top-color: #e2e8f0;
}
html[data-theme="light"] .day-pill.flat {
  background: #e2e8f0;
  color: #0f172a;
}
html[data-theme="light"] .flat {
  color: #0f172a;
}
html[data-theme="light"] .cmp-tile {
  border-color: #e2e8f0;
  color: #0f172a;
}
html[data-theme="light"] .cmp-tile .cmp-ret.up,
html[data-theme="light"] .cmp-tile .cmp-ret.down,
html[data-theme="light"] .cmp-tile .cmp-ret.flat {
  color: #0f172a;
}
html[data-theme="light"] .chart-card {
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}
html[data-theme="light"] .card:hover,
html[data-theme="light"] .tile:hover {
  border-color: #0891b2;
}

/* ---- theme link (footer) ----
   Unscoped rules here only touch the new theme-link elements. */
.ps-theme-link .ps-to-dark { display: none; }
/* Monthly recaps: Home / All-recaps fabs are position:fixed;bottom:18px (~40px tall).
   Keep the theme link above them so it stays tappable (esp. at 390px).
   Scoped to recap pages only (body.ps-recap) — other pages get no extra spacing. */
body.ps-recap .ps-theme-link {
  position: relative;
  z-index: 51;
  margin-bottom: 4.75rem;
  padding-bottom: 0.25rem;
}

html[data-theme="light"] .ps-theme-link .ps-to-light { display: none; }
html[data-theme="light"] .ps-theme-link .ps-to-dark { display: inline; }
/* pages without a footer: theme link visible in either theme —
   "Light version" in dark, "Back to dark" in light */
.ps-theme-alt { display: block; text-align: center; margin: 24px 0 40px; font-size: 13px; }
.ps-theme-alt .ps-to-dark { display: none; }
html[data-theme="light"] .ps-theme-alt .ps-to-light { display: none; }
html[data-theme="light"] .ps-theme-alt .ps-to-dark { display: inline; }
html[data-theme="light"] .ps-theme-link a,
html[data-theme="light"] .ps-theme-alt a { color: #0e7490; }

/* ---- logos: the owl artwork stays exactly as shipped, sitting on its own
   dark navy tile in light mode (no recolouring, no redraw). ---- */
html[data-theme="light"] .logo,
html[data-theme="light"] .footer-logo { background: #06162d; box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.18); }
html[data-theme="light"] .top-owl,
html[data-theme="light"] .xf-owl { background: #0d1220; }

/* ---- floating theme pill (always visible; sits beside Top when Top exists) ----
   Matches .back-to-top (cyan pill, same padding/radius/font/shadow/z-index).
   Top was moved to bottom-left by xfollow.css; the pill takes that left slot
   and Top is shifted right by --ps-theme-pill-slot (set in theme-pill.js).
   The pill is always visible. Top still appears only after scrollY > 400
   (s3.js), fading in beside the pill so the slot does not jump. */
.ps-theme-pill {
  position: fixed;
  left: calc(1.5rem + env(safe-area-inset-left, 0px));
  bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  z-index: 50;
  background: #22d3ee;
  color: #070b18;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
}
.ps-theme-pill:hover { background: #67e8f9; }
.ps-theme-pill:focus-visible {
  outline: 2px solid #22d3ee;
  outline-offset: 3px;
}
@media (max-width: 760px) {
  .ps-theme-pill {
    left: calc(8px + env(safe-area-inset-left, 0px));
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }
}
/* Shift Top right of the always-visible theme pill (index only has Top). */
.back-to-top {
  left: calc(1.5rem + env(safe-area-inset-left, 0px) + var(--ps-theme-pill-slot, 5rem)) !important;
}
@media (max-width: 760px) {
  .back-to-top {
    left: calc(8px + env(safe-area-inset-left, 0px) + var(--ps-theme-pill-slot, 5rem)) !important;
  }
}
html[data-theme="light"] .ps-theme-pill {
  background: #22d3ee;
  color: #041016;
}
html[data-theme="light"] .ps-theme-pill:hover { background: #67e8f9; }
