/* Light theme — the same Nebula design as the dark one, in daylight colours:
   a pale blue sky instead of a night one, navy text instead of starlight, and
   the same transparent bars, plain-text menus and bordered cards. The
   starfield stays too: index.html paints it as blue ink on the light sky.

   Every page defines the same colour tokens for the dark look; this file
   redefines them when <html data-theme="light"> is set (by shared/prefs.js).
   Only colours change here — shapes and effects belong to the pages. Load it
   after the page's own <style> so it wins. */

:root[data-theme="light"]{
  color-scheme:light;
  /* Clean daylight, not the night theme inverted: a calm neutral page,
     true-white cards, hairlines that whisper, and the crest's blue and gold
     doing the identity work. Inputs sit on a light well, never a muddy
     sunken slab. */
  --void:#f4f5f8;
  --depth:#eaedf2;
  --panel:#ffffff;
  --panel-2:#f7f8fb;
  --line:#e2e5ec;
  --nebula:#02528a;
  --nebula-soft:#1b659f;
  --starlight:#17223f;
  --dust:#505b74;
  --dust-dim:#747e95;
  --live:#0e7a4f;
  --warn:#8f1537;
  --good:#0e7a4f;
  --caution:#9a6700;
  --bad:#8f1537;
  --gold:#a97f12;
  --prev:#aab3c7;
  --grid:#e6e9ef;
  --heat-0:#eaedf2;
  --heat-1:#cfdcec;
  --heat-2:#8fb4d4;
  --heat-3:#3d7fae;
  --heat-4:#02528a;
}

/* The daylight sky, for the pages that have no starfield canvas of their own. */
:root[data-theme="light"] body{
  background:
    radial-gradient(ellipse 70% 55% at 50% 0%, rgba(2,82,138,.04), transparent 70%) fixed,
    radial-gradient(ellipse 50% 40% at 90% 110%, rgba(169,127,18,.04), transparent 70%) fixed,
    linear-gradient(180deg, #f6f7f9 0%, #eef0f4 100%) fixed;
}

/* Text on the solid blue of a primary button stays white. */
:root[data-theme="light"] .primary-btn,
:root[data-theme="light"] .btn.primary,
:root[data-theme="light"] .seg button[aria-pressed="true"],
:root[data-theme="light"] .composer button,
:root[data-theme="light"] .chat-input-row button:not(.attach-btn),
:root[data-theme="light"] .admin-login-card button:not(.account-close):not(.pref-tile):not(.pw-eye):not(.pw-info),
:root[data-theme="light"] .msg.user .bubble,
:root[data-theme="light"] .pref-switch span.is-on,
:root[data-theme="light"] .bubble-btn:not(.oc-chat){
  color:#ffffff;
}

/* Bars that were painted with a literal translucent night colour. */
:root[data-theme="light"] .topbar,
:root[data-theme="light"] .toolbar,
:root[data-theme="light"] .chat-head,
:root[data-theme="light"] .dock{
  background:rgba(250,250,252,.92);
}
:root[data-theme="light"] .nav.is-scrolled{ background:rgba(250,250,252,.88); }

/* The hero's twinkle layer and the grain are drawn for a night sky; on the
   daylight one they would be invisible noise. */
:root[data-theme="light"] #sky,
:root[data-theme="light"] .grain{ display:none; }

/* The identity band: in daylight the bar at the top of every page turns
   the crest's deep navy, with the gold rule under it — an official header
   over calm white content, instead of a page that is grey all the way up.
   Everything inside the band flips to light-on-navy. */
:root[data-theme="light"] .topbar,
:root[data-theme="light"] .chat-head,
:root[data-theme="light"] .nav.is-scrolled,
:root[data-theme="light"] .nav{
  background:#063c69;
}
:root[data-theme="light"] .topbar{ border-bottom:0; }
:root[data-theme="light"] .topbar header .brand-name,
:root[data-theme="light"] .topbar header .mono,
:root[data-theme="light"] .nav .brand-name,
:root[data-theme="light"] .nav-meta,
:root[data-theme="light"] .chat-head .who,
:root[data-theme="light"] .chat-head .who b,
:root[data-theme="light"] .chat-head .status,
:root[data-theme="light"] .chat-head .link-btn,
:root[data-theme="light"] .chat-head .signout{
  color:#e8eef6;
}
:root[data-theme="light"] .topbar header .back,
:root[data-theme="light"] .nav .account-trigger,
:root[data-theme="light"] .nav-cta{
  color:#e8eef6; border-color:rgba(232,238,246,.35);
}
:root[data-theme="light"] .brand-sub{ color:#d9ab27; }
/* The tab trays keep their white card look and now float on the navy band. */
:root[data-theme="light"] .topbar .tabs button{ color:#3d4a63; }
:root[data-theme="light"] .topbar .tabs button[aria-selected="true"]{ color:#fff; }
:root[data-theme="light"] .topbar .tab-group{ color:#1b659f; }

/* The cards that carry a whole task float on a soft shadow instead of a
   hairline — one elevation voice, and the page behind stays calm. */
:root[data-theme="light"] .signin-card,
:root[data-theme="light"] .admin-login-card{
  border-color:transparent;
  box-shadow:0 1px 2px rgba(23,35,63,.05), 0 12px 32px rgba(23,35,63,.08);
}
/* Selection and focus speak the crest's blue. */
:root[data-theme="light"] ::selection{ background:rgba(2,82,138,.18); }

/* Modal backdrops: the same dimming, in a navy tint. */
/* The scrim belongs to a modal laid over the page — not to the sign-in
   screen, which uses the same class and must hide what is behind it. In the
   dark theme both were near-black so nobody saw the difference; in the light
   theme the dashboard showed straight through the sign-in card. */
:root[data-theme="light"] .admin-login-overlay.is-scrim{ background:rgba(19,26,62,.3); }

/* A report embedded in the Dashboard shows the page behind it. */
:root[data-theme="light"].embed body,
:root[data-theme="light"].embed .toolbar{ background:transparent; }

/* ---------- both themes ---------- */
/* The active menu item is a filled crest-blue pill (index.html), so its
   text is white in both themes — the old text-only rule painted it dark
   navy on the blue pill in daylight, unreadable. */
.nav-links button[aria-selected="true"]{
  border-color:transparent;
  color:#fff;
  font-weight:600;
}
