/* Light (static/theme_mode.js, docs/LIGHT_MODE.md): the signed-in app and the pages on the way in, on a pale ground
   with the same calm, flat surfaces as Graphite. Loaded last, after graphite_theme.css (and public.css), and only ever
   applies under html[data-theme=light], so dark is untouched. Every text colour here is at least 4.5:1 on every light
   surface (white, #f7f7f8, #efeff1 and #e8e8eb). The accent is a deep petrol blue, kept apart from the gain green, and
   gains, losses, warnings and unknowns still carry a sign or words as well. */
:root[data-theme=light],:root.graphite[data-theme=light]{
 color-scheme:light;
 --bg:#f7f7f8;--bg-deep:#efeff1;--surface:#ffffff;--surface-2:#f2f2f4;--surface-3:#e8e8eb;
 --line:#e2e2e6;--line-soft:#ececef;--line-strong:#cdcdd3;
 --text:#16161a;--text-2:#3b3b42;--muted:#63636b;
 --gold:#0a6480;--gold-strong:#095a74;--gold-ink:#074a60;--gold-wash:rgba(10,100,128,.08);--gold-line:rgba(10,100,128,.34);--on-gold:#ffffff;
 --forest:#f2f2f4;--forest-deep:#ffffff;--forest-line:#cdcdd3;
 --neon-cyan:#0a6480;--neon-violet:#5b45b8;
 --gain:#16784a;--loss:#b4362c;--warn:#93520a;--unknown:#63636b;--info:#2b5a94;
 --gain-ink:#0f5f39;--loss-ink:#962a22;--warn-ink:#7a4408;--info-ink:#204a7c;
 /* Up and down on Today's own pieces: in dark a sky blue and an orange, here a deeper blue and a burnt orange, kept
    apart from the petrol accent and from the gain and loss colours, and always with a sign or words beside them. */
 --rise:#1d4ed8;--fall:#a33c0a;
}
/* The switch: a sun in the header; its menu of three choices below it. */
.theme-switch{position:relative;display:inline-flex;flex:none}
#theme-toggle svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.theme-menu{position:absolute;top:calc(100% + 6px);right:0;z-index:95;display:grid;min-width:168px;padding:6px;border:1px solid var(--line-strong);border-radius:12px;background:var(--surface);box-shadow:0 18px 50px rgba(0,0,0,.28)}
.theme-menu[hidden]{display:none}
.theme-menu.to-right{right:auto;left:0}
/* On the research pages' bar the switch sits at the end, beside the eye. */
.page-bar>.theme-switch{margin-left:auto}
.page-bar>.theme-switch~#discreet-toggle{margin-left:8px!important}
.theme-menu button{display:flex;align-items:center;gap:10px;min-height:44px!important;margin:0!important;padding:0 12px!important;border:0!important;border-radius:8px!important;background:transparent!important;color:var(--text)!important;font:500 14px/1 var(--font);text-align:left;cursor:pointer}
.theme-menu button::before{content:"";width:16px;flex:none;text-align:center;color:var(--gold)}
.theme-menu button[aria-checked=true]::before{content:"✓"}
.theme-menu button:hover,.theme-menu button:focus-visible{background:var(--surface-2)!important}
.theme-menu button:focus-visible{outline:2px solid var(--gold);outline-offset:-2px}
:root[data-theme=light] .theme-menu{box-shadow:0 18px 50px rgba(22,22,26,.14)}

/* ---------- graphite_theme.css's own colours ---------- */
:root[data-theme=light] ::selection{background:rgba(10,100,128,.18)}
:root[data-theme=light] .lg-grid path{stroke:rgba(22,22,26,.09)}
:root[data-theme=light] .bottom-nav{background:rgba(247,247,248,.92)!important}
:root[data-theme=light] .sheet-backdrop{background:rgba(22,22,26,.32)}
:root[data-theme=light] .brand-mark{background:var(--text)!important}
:root[data-theme=light] .brand-mark::after{color:var(--bg)!important}
@media(min-width:1100px){
 :root[data-theme=light] .app-header{background:rgba(247,247,248,.86)!important}
 /* The screens' bar lies over the header here: clear, so the two don't stack into a lighter band. */
 :root[data-theme=light] .bottom-nav{background:transparent!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
 :root[data-theme=light] .is-sheet.is-open{box-shadow:-30px 0 70px rgba(22,22,26,.12)!important}
}

/* ---------- theme.css's own colours (the app's older base, under Graphite) ---------- */
:root[data-theme=light] body{background:var(--bg)!important}
:root[data-theme=light] #delete-account-button{border-color:rgba(180,54,44,.32)!important}
:root[data-theme=light] #delete-account-button:hover{background-color:rgba(180,54,44,.07)!important}
:root[data-theme=light] .daily-actions button:first-child:hover,:root[data-theme=light] .simple-input button:hover,:root[data-theme=light] #priority-refresh:hover{background:var(--gold-strong)!important}
:root[data-theme=light] input:not([type=range]):not([type=checkbox]):not([type=radio]),:root[data-theme=light] select,:root[data-theme=light] textarea{background:var(--surface)!important;border-color:var(--line-strong)!important;color-scheme:light}
:root[data-theme=light] input::placeholder{color:var(--muted)!important}
:root[data-theme=light] .badge-green,:root[data-theme=light] .live-pill.live-up{background:rgba(22,120,74,.08)!important;border-color:rgba(22,120,74,.3)}
:root[data-theme=light] .badge-yellow,:root[data-theme=light] .total-incomplete{background:rgba(147,82,10,.08)!important;border-color:rgba(147,82,10,.32)}
:root[data-theme=light] .badge-red,:root[data-theme=light] .live-pill.live-down{background:rgba(180,54,44,.07)!important;border-color:rgba(180,54,44,.3)}
:root[data-theme=light] .badge-blue{background:rgba(43,90,148,.07)!important;border-color:rgba(43,90,148,.25)}
:root[data-theme=light] .hero .daily-actions button:not(:first-child){background:var(--surface)!important;border-color:var(--line-strong)!important}
:root[data-theme=light] .first-run{background:var(--surface-2)!important}
:root[data-theme=light] .research-priority{background:var(--surface)!important}
:root[data-theme=light] #research-chart svg polygon{fill:rgba(10,100,128,.12)!important}
:root[data-theme=light] .onboarding-shell{background:rgba(22,22,26,.35)!important}
:root[data-theme=light] .onboarding-panel{box-shadow:0 30px 80px rgba(22,22,26,.16)!important}
:root[data-theme=light] .entry-research{border-color:var(--line-strong)}
:root[data-theme=light] #entry-decision[data-decision="BUY"]{color:var(--gain-ink)}
:root[data-theme=light] #performance-chart[data-mode="coil"]{background:radial-gradient(ellipse at 50% 78%,rgba(10,100,128,.06),transparent 62%)}
/* The mix's tones: a light set, in the same order, each still apart from its neighbours. */
:root[data-theme=light] .tone-0{background:#0a6480}:root[data-theme=light] .tone-1{background:#6f8fa0}:root[data-theme=light] .tone-2{background:#b9cdd6}
:root[data-theme=light] .tone-3{background:#4b4f5c}:root[data-theme=light] .tone-4{background:#9a9aa3}:root[data-theme=light] .tone-5{background:#2a2a30}

/* ---------- Today's own pieces (step 2) ---------- */
/* Up and down: the day's change under the balance, the holdings table, the money strip and the market screen. */
:root[data-theme=light] .hero-day[data-direction=up] .hero-day-figure,:root[data-theme=light] .today-table .td-change[data-direction=up],:root[data-theme=light] .money-strip .money-strip-figure[data-direction=up],
:root[data-theme=light] .market-screen [data-direction=up]{color:var(--rise)}
:root[data-theme=light] .hero-day[data-direction=down] .hero-day-figure,:root[data-theme=light] .today-table .td-change[data-direction=down],:root[data-theme=light] .money-strip .money-strip-figure[data-direction=down],
:root[data-theme=light] .market-screen [data-direction=down]{color:var(--fall)}
:root[data-theme=light] .hero-mix-by{background:var(--surface-2)}
/* The live graph. */
:root[data-theme=light] .lg-top button[aria-pressed=true]{background:var(--gold-wash);color:var(--gold-ink)}
:root[data-theme=light] .lg-point{fill:var(--surface);stroke:var(--gold)}
:root[data-theme=light] .live-graph :focus-visible{outline-color:var(--gold)}
:root[data-theme=light] .lg-gaps text{fill:var(--muted);opacity:1}
/* The balance board, full screen. Its faint light stays decoration. */
:root[data-theme=light] .board-shell::before{background:radial-gradient(62% 46% at 50% 50%,rgba(10,100,128,.05),transparent 72%)}
:root[data-theme=light] .board-pill[data-direction=up]{background:rgba(22,120,74,.08);border-color:rgba(22,120,74,.3)}
:root[data-theme=light] .board-pill[data-direction=down]{background:rgba(180,54,44,.07);border-color:rgba(180,54,44,.3)}
:root[data-theme=light] .board-incomplete,:root[data-theme=light] .sounding-chip.depth-dry,:root[data-theme=light] .sounding-warnings li{background:rgba(147,82,10,.08);border-color:rgba(147,82,10,.32)}
/* The ledger, a holding's detail and the command palette. */
:root[data-theme=light] #holdings-list .holding-line:hover{background:rgba(22,22,26,.03)!important}
:root[data-theme=light] .holding-detail,:root[data-theme=light] .command-palette{box-shadow:0 30px 90px rgba(22,22,26,.18)}
:root[data-theme=light] .holding-detail::backdrop,:root[data-theme=light] .command-palette::backdrop{background:rgba(22,22,26,.32)}
/* The market screen's week of dots and its two marks. */
:root[data-theme=light] .market-dots i{background:var(--line-strong)}
:root[data-theme=light] .market-dots i[data-way=up]{background:var(--rise)}
:root[data-theme=light] .market-dots i[data-way=down]{background:var(--fall)}
:root[data-theme=light] .market-dots i[data-way=none]{background:transparent;box-shadow:inset 0 0 0 1px var(--line-strong)}
:root[data-theme=light] .market-mark[data-coin=bitcoin]{color:#8a5a00}
:root[data-theme=light] .market-mark[data-coin=solana]{color:#6d28d9}

/* ---------- Night pictures (step 3) ---------- */
/* The holdings picture on Today and the wallet look-up, the money tree and the screen saver are night scenes, painted for
   a dark sky. In light they keep it (Today's picture as a window, below): Graphite's dark colours are set again inside each, so their own words and buttons
   read as they do in dark. The holding detail under the picture and the emblem stay on the dark too. The story's saved picture draws its own dark card, and the value coil redraws in light. */
:root[data-theme=light] :is(.portfolio-orb-stage,.look-stage,.tiles-detail,.emblem-stage,.look-emblem-stage,#money-tree-dialog,#portfolio-ambient){
 color-scheme:dark;color:var(--text);--accent:#7debe8;--border:#1f1f1f;--panel:#0f0f0f;
 --bg:#0a0a0a;--bg-deep:#070707;--surface:#0f0f0f;--surface-2:#161616;--surface-3:#1c1c1c;
 --line:#1f1f1f;--line-soft:#1a1a1a;--line-strong:#2e2e2e;--text:#ededed;--text-2:#c2c2c2;--muted:#8f8f8f;
 --gold:#7debe8;--gold-strong:#b1f5f0;--gold-ink:#c9faf5;--gold-wash:rgba(125,235,232,.08);--gold-line:rgba(125,235,232,.3);--on-gold:#0a0a0a;
 --forest:#161616;--forest-deep:#0f0f0f;--forest-line:#2e2e2e;--neon-cyan:#7debe8;--neon-violet:#b7a0ff;
 --gain:#8fd0a8;--loss:#ec8f86;--warn:#e9a862;--unknown:#a7a196;--info:#a9c1de;
 --gain-ink:#cdebd8;--loss-ink:#f8d0ca;--warn-ink:#f6d8b0;--info-ink:#dce7f4;--rise:#7dd3fc;--fall:#fdba74;
}
:root[data-theme=light] :is(.look-stage,.emblem-stage,.look-emblem-stage){border-radius:var(--radius);overflow:hidden;
 background:radial-gradient(ellipse,rgba(183,160,255,.07),transparent 65%),#0a0a0a}
/* Today's holdings picture in light (Seb, 20 November 2026): a window onto the night, set into the white card. Turning
   the picture into its own negative (#581) muddied the coins' colours and turned the Bitcoin sun into a dark disc, so the
   picture keeps its real night colours and the window is made to look meant: a deep ink-blue sky with two slow,
   faint auroras, a glass edge that catches the light, and a soft shadow with a little of the night's colour in it. The three buttons that sit on its corner
   take the night's glass with it. The screen saver, which fills the screen, stays night as before. */
:root[data-theme=light] #portfolio-orb .portfolio-orb-stage{
 /* The sky, under the canvas, painted once: a lift of light towards the upper left and a vignette that deepens to the
    edges. The edge is glass: a hairline that catches the light at the top left and bottom right and fades between,
    drawn as a border-box gradient behind a clear border. The stage is its own stacking context, so the auroras below
    sit over the sky and under the canvas, and it clips them to its rounded corners. */
 position:relative;isolation:isolate;overflow:hidden;border:1px solid transparent;border-radius:20px;
 background:
  radial-gradient(80% 70% at 32% 40%,rgba(70,110,170,.30),transparent 70%) padding-box,
  radial-gradient(140% 120% at 50% 45%,#0f1a2b 0%,#0b1322 58%,#060b14 100%) padding-box,
  linear-gradient(135deg,rgba(125,235,232,.55),rgba(183,160,255,.18) 30%,rgba(255,255,255,.04) 55%,rgba(183,160,255,.22) 80%,rgba(125,235,232,.45)) border-box;
 box-shadow:inset 0 1px 0 rgba(255,255,255,.09),inset 0 -40px 60px -40px rgba(0,0,0,.55),
  0 1px 2px rgba(8,30,52,.12),0 18px 40px -22px rgba(10,60,90,.55),0 30px 60px -40px rgba(91,69,184,.35)}
/* Two faint auroras in the night's own cyan and violet, low left and high right, on a layer a little larger than the
   window. It drifts by transform only, so the browser moves it without repainting the sky. It stops when the picture's
   Pause button is pressed (portfolio_orb.js sets data-paused) and never moves with reduced motion. */
:root[data-theme=light] #portfolio-orb .portfolio-orb-stage::before{
 content:"";position:absolute;inset:-12%;z-index:-1;pointer-events:none;will-change:transform;
 background:
  radial-gradient(42% 40% at 18% 88%,rgba(70,214,222,.34),rgba(70,214,222,.08) 50%,transparent 76%),
  radial-gradient(40% 38% at 86% 12%,rgba(160,120,255,.36),rgba(160,120,255,.08) 52%,transparent 78%);
 animation:orb-window-aurora 26s ease-in-out infinite alternate}
@keyframes orb-window-aurora{from{transform:translate3d(-3%,2%,0)}to{transform:translate3d(3%,-2%,0)}}
:root[data-theme=light] #portfolio-orb[data-paused=true] .portfolio-orb-stage::before{animation-play-state:paused}
@media(prefers-reduced-motion:reduce){:root[data-theme=light] #portfolio-orb .portfolio-orb-stage::before{animation:none}}
/* Form controls inside a night picture are drawn dark (the light rule above sets color-scheme:light on every field). */
:root[data-theme=light] :is(#money-tree-dialog,#portfolio-ambient,.tiles-detail) :is(input,select,textarea){color-scheme:dark}
/* The screen saver keeps its own pale ink. */
:root[data-theme=light] #portfolio-ambient{color:#eff5fc}
/* Review's next consideration: its words were a fixed pale ink over a card that is light in light. */
:root[data-theme=light] #review-priority p{color:var(--text-2)}
/* The picture's view switch sits on the card, not the sky; on a phone its round buttons sit on the sky. */
:root[data-theme=light] .tiles-modes{background:var(--surface-2)}
/* On a phone the picture's three buttons sit over the window's corner but outside it: they are the night's glass, with
   pale ink, as in dark. */
@media(max-width:600px){:root[data-theme=light] #tab-overview .portfolio-orb-actions button{color:#e6edf5!important;background:rgba(14,24,38,.62)!important;border-color:rgba(255,255,255,.16)!important}}

/* ---------- The pages on the way in (public.css, class="graphite") ---------- */
:root.graphite[data-theme=light] body{background:var(--bg)}
:root.graphite[data-theme=light] ::selection{background:rgba(10,100,128,.18)}
