/* The light theme (Package J). Dark is the default and is untouched: every rule here is under html[data-theme="light"]
   (set before the first paint by public/theme.js). The palette is re-pointed through the page's own variables
   (--navy-*, --fg, --muted, --border, --label, --teal, --gold …), and the surfaces that index.html paints with literal
   dark rgba() values (header, tray, menus, cards, metrics, drawers, the dialog) get a light surface here.
   Themed: the main page, its header, menus, cards, metrics, drawers and dialog, the Playbook, help cards, the tour,
   the offline banner. Package Q: every full page, dialog and panel of the other modules too — the light tokens below
   apply to whatever a module attaches to <body> (a full page is a <section>, a dialog a <dialog>, a panel an <aside>
   or a <div>), and each module stylesheet carries a generated light block for the literal colours it paints
   (tools/light-theme.mjs; activity.css keeps its hand-tuned one). Left for Codex: company-intake.css,
   orchestration.css and sandbox-studio.css (Codex's own pages keep their dark palette until Codex themes them).
   The animated avatar and the canvas background keep their look (dimmed below). */
/* The light tokens apply to the surfaces themed here (the scope below), not to :root: dark stays the default. */
html[data-theme="light"]{color-scheme:light}
html[data-theme="light"] :is(.app,#trail,#tenders,#memory,#modal,#gate,#toast,#jb-undo,#secure-nudge,#playbook,#jb-hc,#jb-tour,#jb-offline,#jb-help,body>section,body>dialog,body>aside,body>div,body>form):not(.company-intake,.orchestration,.sandbox-studio,#company-intake,#orchestration){
  --navy-deep:#F3F6FA; --navy-base:#FFFFFF; --navy-light:#E9EEF5; --navy-brand:#0C3C74;
  --teal:#0B8C7C; --teal-brand:#0A8F75; --teal-dim:#0A7A6C;
  --gold:#A67C1A; --gold-dim:#8A6512;
  --fg:#0F172A; --muted:#4F5B70; --border:#CDD6E3; --label:#45566A;
  --red:#C62828; --amber:#B45309;
  --jb-surface:rgba(255,255,255,.92); --jb-surface-2:rgba(255,255,255,.97); --jb-shadow:0 10px 30px rgba(15,23,42,.12);
  color:var(--fg);
}
html[data-theme="light"] body{background:#F3F6FA}

/* background: the grid and glow stay, much lighter; the dark vignette goes */
html[data-theme="light"] .bg .grid{opacity:.55;filter:saturate(.6)}
html[data-theme="light"] .bg .glow{opacity:.45}
html[data-theme="light"] .bg .vignette{background:radial-gradient(ellipse at 50% 50%,transparent 60%,rgba(203,213,225,.55) 100%)}
html[data-theme="light"] .bg canvas{opacity:.35}

/* header and the document tray */
html[data-theme="light"] .app > header{background:linear-gradient(180deg,rgba(255,255,255,.96),rgba(243,246,250,.9))}
html[data-theme="light"] .tray{background:rgba(255,255,255,.75)}
html[data-theme="light"] .filechip,html[data-theme="light"] .dchip{background:var(--jb-surface)}
html[data-theme="light"] .brand .by{filter:invert(.82) hue-rotate(180deg)}
html[data-theme="light"] .tokens{background:linear-gradient(135deg,rgba(212,167,44,.18),rgba(166,124,26,.08));box-shadow:none}
html[data-theme="light"] .tokens .val,html[data-theme="light"] .tokens .top{color:#7A5A0C}

/* every surface index.html paints with a literal dark rgba(): a light surface instead (same selectors, higher specificity) */
html[data-theme="light"] .tray-menu,
html[data-theme="light"] .umenu,
html[data-theme="light"] .lmenu,
html[data-theme="light"] .sendmenu,
html[data-theme="light"] .opt,
html[data-theme="light"] .numin input,
html[data-theme="light"] .digest .box,
html[data-theme="light"] .trailbtn,
html[data-theme="light"] .trail,
html[data-theme="light"] .tenders,
html[data-theme="light"] .memory,
html[data-theme="light"] .titem,
html[data-theme="light"] .mitem,
html[data-theme="light"] .medit select,
html[data-theme="light"] .medit input,
html[data-theme="light"] .need-row,
html[data-theme="light"] .modal .box,
html[data-theme="light"] .modal .kv,
html[data-theme="light"] .modal textarea,
html[data-theme="light"] .modal input.txt,
html[data-theme="light"] .amend-row,
html[data-theme="light"] .amend-change,
html[data-theme="light"] .toast,
html[data-theme="light"] .jb-undo,
html[data-theme="light"] .models,
html[data-theme="light"] .gbox,
html[data-theme="light"] .gbox .txt,
html[data-theme="light"] .ubtn,
html[data-theme="light"] .lbtn,
html[data-theme="light"] .sysbtn,
html[data-theme="light"] .set-status,
html[data-theme="light"] .pack,
html[data-theme="light"] .method,
html[data-theme="light"] .secure-nudge,
html[data-theme="light"] .clar-q,
html[data-theme="light"] .clar-edit,
html[data-theme="light"] .clar-status select{background:var(--jb-surface-2)}
html[data-theme="light"] .tray-menu,
html[data-theme="light"] .umenu,
html[data-theme="light"] .lmenu,
html[data-theme="light"] .sendmenu,
html[data-theme="light"] .modal .box,
html[data-theme="light"] .toast,
html[data-theme="light"] .secure-nudge,
html[data-theme="light"] .gbox{box-shadow:var(--jb-shadow)}
html[data-theme="light"] .umenu button .k.due{color:#92400E}
html[data-theme="light"] .gbox .mgl .btn.mgl-open{background:var(--navy-light)}
html[data-theme="light"] .gbox .gexpired{color:#92400E;background:rgba(180,83,9,.08);border-color:rgba(180,83,9,.35)}   /* BAC-422: the session-expired banner, readable on white */

/* question cards, the metrics strip, the drop zone, the dialogs' backdrops */
html[data-theme="light"] .card{background:linear-gradient(160deg,rgba(255,255,255,.97),rgba(246,248,251,.94));box-shadow:0 10px 30px rgba(15,23,42,.12),inset 0 1px 0 rgba(255,255,255,.6)}
html[data-theme="light"] .card .from.mem{background:rgba(12,60,116,.08);color:#0C3C74}
html[data-theme="light"] .card.imp-critical .ico{color:#B91C1C}
html[data-theme="light"] .metrics{background:linear-gradient(180deg,rgba(255,255,255,.96),rgba(246,248,251,.92))}
html[data-theme="light"] .meter .bars i{background:rgba(15,23,42,.1)}
html[data-theme="light"] .intro .dz{background:rgba(255,255,255,.55)}
html[data-theme="light"] .reco .chip.lean{color:#7A5A0C}
html[data-theme="light"] .reco .chip.nobid{color:#B91C1C}
html[data-theme="light"] .m .tick.down{color:#B91C1C}
html[data-theme="light"] .modal{background:rgba(15,23,42,.35)}
html[data-theme="light"] .gate{background:rgba(226,232,240,.75)}
html[data-theme="light"] .toast{color:var(--fg)}

/* the new pages: they use the variables already; only shadows soften */
html[data-theme="light"] .jb-hc-btn,html[data-theme="light"] .jb-hc-card,html[data-theme="light"] .jb-offline{box-shadow:var(--jb-shadow)}
html[data-theme="light"] .jb-tour-card{box-shadow:0 18px 50px rgba(15,23,42,.25)}
html[data-theme="light"] .jb-tour-ring{box-shadow:0 0 0 3px var(--teal),0 0 0 9999px rgba(15,23,42,.38)}
html[data-theme="light"] .jb-tour-row .jb-tour-nav.is-primary{color:#fff}

/* the card panel around Network's card form (index.html .nipanel): a light surface; the frame's own sheet is white in both themes */
html[data-theme="light"] .nipanel{background:#F7F9FC}
html[data-theme="light"] .nicard:focus-within,html[data-theme="light"] .nicard.is-focus{box-shadow:0 0 0 3px rgba(11,140,124,.25)}
/* white on --teal-dim #0A7A6C is 5.2:1 (white on --teal #0B8C7C was 4.15:1, under the 4.5:1 a 10px label needs) */
html[data-theme="light"] .pack.test .tag{color:#FFFFFF;background:var(--teal-dim)}
/* the top-up dialog's gold figures (the pack sizes, the summary's total) in the darker gold the balance uses on white */
html[data-theme="light"] .pack .pt,html[data-theme="light"] .paysum b{color:#7A5A0C}
