/* theme-light.css — a softer light mode (Matt, Sep 27: "make light mode a little easier on the eyes").
   Loaded last so it settles the light tokens that styles.css, redesign.css and cockpit.css each set.
   Warm paper instead of bright white on blue-grey: less glare, same readable text (all text colors
   stay at 5:1 contrast or better on the panels, for a 60–70 audience). */
body[data-theme="light"] {
  --bg:          #ece8e1;
  --bg-raised:   #e6e1d9;
  --surface:     #f7f5f0;
  --surface-2:   #f1eee7;
  --surface-3:   #e7e2d9;
  --surface-4:   #d8d1c5;
  --border:        rgba(58, 48, 30, 0.10);
  --border-hover:  rgba(58, 48, 30, 0.20);
  --text:   #23262c;
  --text-2: #444955;
  --text-3: #5a606c;
  --text-4: #757b87;
  --green: #147a55; --green-bg: rgba(20, 122, 85, 0.11);
  --red:   #b93a32; --red-bg:   rgba(185, 58, 50, 0.10);
  --shadow-sm: 0 1px 2px rgba(58, 48, 30, 0.06);
  --shadow-md: 0 10px 30px rgba(58, 48, 30, 0.09);
  --shadow-lg: 0 24px 60px rgba(58, 48, 30, 0.13);
  --fx-panel-shadow: 0 1px 2px rgba(58, 48, 30, .05), 0 10px 28px -12px rgba(58, 48, 30, .14);
  --fx-shadow: 0 1px 2px rgba(58, 48, 30, .05), 0 8px 24px -12px rgba(58, 48, 30, .12);
  color-scheme: light;
}
/* the dark theme's purple/green glow reads as a smudge on paper */
body[data-theme="light"] { background: var(--bg) !important; }
/* Portfolio-style panels sit a step lighter than the page, like paper on a desk */
body[data-theme="light"] #viewPortfolio { --pv-surface: var(--surface); }
/* the summary row inside the Portfolio panel carried its own shadow — one panel, not a box in a box */
#viewPortfolio .pv-sum { box-shadow: none !important; background: none !important; }
/* every in-page panel (--fx-panel, used by Calendar, Trades, Risk mix, the pop-outs) is the same paper as Portfolio's */
body[data-theme="light"] { --fx-panel: var(--surface); }

/* QA Sep 27: light-mode colors for figures that were drawn in the dark theme's bright tones on paper
   (amber yields 1.53:1, Browse yields 1.57, the Equity tag 1.12, the status bar's "(late)" 1.43). Every
   one below is 4.5:1 or better on the page, the panels and the raised strips (#e6e1d9). */
body[data-theme="light"] {
  --green: #0e6545;  --green-bright: #0e6545;   /* 5.4:1 on #e6e1d9 */
  --red:   #9a2e27;  --red-bright:   #9a2e27;   /* 5.8:1 */
  --yellow: #7f5400;                            /* 5.1:1: yields, "(late)", score badges */
}
body[data-theme="light"] .yld-yellow,
body[data-theme="light"] .browse-table__yld { color: var(--yellow); }
body[data-theme="light"] .fund-kind--income { color: #0e6545; background: rgba(14, 101, 69, .08); border-color: rgba(14, 101, 69, .22); }
body[data-theme="light"] .fund-kind--equity { color: #7f5400; background: rgba(127, 84, 0, .08); border-color: rgba(127, 84, 0, .22); }
body[data-theme="light"] .fund-kind--reit   { color: #1e4f8f; background: rgba(30, 79, 143, .08); border-color: rgba(30, 79, 143, .22); }
body[data-theme="light"] .watch-pill--risk.r2 { color: #3f6212; }
body[data-theme="light"] .watch-pill--risk.r4 { color: #9a3412; }
body[data-theme="light"] .watch-pill--risk.r6 { color: #86198f; }
body[data-theme="light"] .watch-pill--risk.r7 { color: #7a1f1a; }
body[data-theme="light"] .lg { color: var(--text-3); }            /* Projection legend, was 3.48 */
/* The side rail scopes a dark palette ("permanently dark rail") but its background follows the page, so
   in light mode the "cef." logo and the icons were near-white on paper (1.15:1). Give it the light palette. */
body[data-theme="light"] .sidenav {
  --text: #23262c; --text-2: #444955; --text-3: #5a606c; --text-4: #757b87;
  --border: rgba(58, 48, 30, 0.10); --border-hover: rgba(58, 48, 30, 0.20);
  --surface-2: rgba(58, 48, 30, 0.05); --surface-3: rgba(58, 48, 30, 0.09);
  border-right-color: rgba(58, 48, 30, 0.10);
}
body[data-theme="light"] .sidenav .logo,
body[data-theme="light"] .logo { color: var(--text) !important; }
body[data-theme="light"] .user-menu__avatar { background: var(--accent); color: #fff; box-shadow: 0 0 0 1px rgba(58, 48, 30, .18); }

/* Par fixes Sep 27: every amber primary button in light mode is drawn like the Research "Analyze" button in
   the dark theme and like Portfolio's light-mode actions already are — solid var(--accent-fill) with var(--on-accent-fill) text,
   8.6:1 — instead of white/dark text on the light theme's deep amber #9a6b00 (3.8–3.9:1 with dark text).
   Focus rings keep var(--accent) (#9a6b00), which stands out on paper. */
body[data-theme="light"] :is(.btn--primary, .cpdet__btn--p, .cpdet__btn--hero, .rmsu-btn--primary, .trk__import, .trk__rescue__btn,
  .alx__btn--primary, .cal-btn--done, .cpalert__add, .nfy__btn, .lockwrap__cta, .port-upload-btn--primary, .pb-btn--primary, .tl-btn--primary, .rkg-save) {
  background-color: var(--accent-fill) !important; border-color: var(--accent-fill) !important; color: var(--on-accent-fill) !important;
}
body[data-theme="light"] :is(.btn--primary, .cpdet__btn--p, .cpdet__btn--hero, .rmsu-btn--primary, .trk__import, .trk__rescue__btn,
  .alx__btn--primary, .cal-btn--done, .cpalert__add, .nfy__btn, .lockwrap__cta, .port-upload-btn--primary, .pb-btn--primary, .tl-btn--primary, .rkg-save) :is(svg, span, b) {
  color: inherit;
}
/* Strict review W19 (Sep 27): the quiet grey carried real content at 3.1–3.9:1 on paper (the Universe's
   dates 3.48, the fund page's labels 3.9, "Clear" 3.48). --text-4 is now #555b66: 5.59 page · 5.25 raised
   strip · 6.27 panel · 5.89 surface-2 · 5.29 surface-3 · 4.50 surface-4. The side rail's own scope too.
   One red and one green, as text and as the bright variant: #9a2e27 (5.8–6.9:1) and #0e6545 (5.4–6.5:1). */
body[data-theme="light"], body[data-theme="light"] .sidenav { --text-4: #555b66; }
body[data-theme="light"] { --red: #9a2e27; --red-bright: #9a2e27; --green: #0e6545; --green-bright: #0e6545; }
/* the last light-mode misses from the W19 sweep: the detail pane's amber Yield tile (label 3.84, figure 4.08 on #d2c9b5),
   the Filters count (dark ink on the deep light accent, 3.93) and the Equity tag on a tinted Screener row (4.41) */
body[data-theme="light"] .cpkv--y .cpkv__l { color: var(--text-2); }                 /* 5.48:1 */
body[data-theme="light"] .cpkv--y .cpkv__v--y { color: #5f3d00; }                   /* 5.92:1 */
body[data-theme="light"] .cpfilters__count { background: var(--accent-fill); color: var(--on-accent-fill); }  /* 8.61:1 */
body[data-theme="light"] .fund-kind--equity { color: #6e4700; }                     /* 5.46:1 on #dad2c4, 6.71 on the page */
/* light mode: the Portfolio section's panes sat on drop shadows and read as floating cards; a hairline edge only, as in dark */
body[data-theme="light"] :is(#viewPortfolio, #viewTradelog, #viewIncome) :is(.pb-pane, .cpane, .income-card, .portfolio-empty) { box-shadow: none !important; }
/* Research's active sub-tab (Lookup / Compare / Browse / Watchlist) was the deep accent #9a6b00, 3.84:1 on its #ece8e1
   tab; the light theme's text amber is 5.50:1 there */
body[data-theme="light"] .research-subtab.is-active { color: var(--accent-soft); }
