/* BLACK light theme ("ivory and gold"). Dark is the default; html[data-theme="light"] switches.
 * Loaded last so it can restyle the few surfaces that use fixed dark colours. */
html[data-theme="light"]{
  color-scheme:light;
  --bg:#faf8f3;
  --bg-2:#ffffff;
  --surface:rgba(30,24,10,.03);
  --surface-2:rgba(30,24,10,.06);
  --line:rgba(30,24,10,.12);
  --line-gold:rgba(154,116,20,.38);
  --text:#1d1b17;
  --muted:#5d584e;
  --dim:#7f786b;
  --gold:#8a6510;
  --gold-hi:#a77a12;
  --gold-lo:#6f520d;
  --gold-grad:linear-gradient(135deg,#f3dc8e 0%,#e0bd5c 45%,#c79a32 100%);
  --ok:#1f7a4d;
  --warn:#9a5a00;
  --shadow:0 18px 50px rgba(60,45,10,.14);
}
html[data-theme="light"] body{background:var(--bg)}
html[data-theme="light"] body::before{opacity:.45}
html[data-theme="light"] .gold-text{background:linear-gradient(135deg,#a77a12 0%,#8a6510 50%,#5f450a 100%);-webkit-background-clip:text;background-clip:text}
html[data-theme="light"] ::selection{background:rgba(199,154,50,.3)}

/* shell */
html[data-theme="light"] .rail{background:#f3efe6}
@media(max-width:860px){html[data-theme="light"] .rail{background:#f3efe6}}
html[data-theme="light"] .scrim.open{background:rgba(40,30,10,.35)}
html[data-theme="light"] .history button,
html[data-theme="light"] .quick button{color:var(--muted)}
html[data-theme="light"] .quick button{background:#fff}
html[data-theme="light"] .composer .box{background:#fff;box-shadow:0 0 0 6px rgba(199,154,50,.06),var(--shadow)}

/* answers */
html[data-theme="light"] .answer{background:linear-gradient(180deg,rgba(199,154,50,.07),#fff)}
html[data-theme="light"] .answer .body,
html[data-theme="light"] .cands .c h3,
html[data-theme="light"] .tbl td{color:var(--text)}
html[data-theme="light"] .answer .body code{background:rgba(30,24,10,.07)}
html[data-theme="light"] .answer .body pre{background:#f6f3ec}
html[data-theme="light"] .cands .c,
html[data-theme="light"] .att-prev td{color:var(--muted)}
html[data-theme="light"] .cands .c{background:#fbfaf6}
html[data-theme="light"] .kpi{background:linear-gradient(135deg,#fffaf0,#fff)}
html[data-theme="light"] .att-prev th{background:#f6f1e4}
html[data-theme="light"] .chart,
html[data-theme="light"] .rambo,
html[data-theme="light"] .cand-view{background:#fbfaf6}
html[data-theme="light"] .chart line{stroke:rgba(30,24,10,.15)}
html[data-theme="light"] .chart text{fill:var(--muted)}
html[data-theme="light"] .eng{background:#fff}
html[data-theme="light"] .error,
html[data-theme="light"] .att.err,
html[data-theme="light"] .eng.failed .st,
html[data-theme="light"] #cal-msg.err,
html[data-theme="light"] .down{color:#b3261e!important}
html[data-theme="light"] .eng.failed .dot,
html[data-theme="light"] .rag.r{background:#c0392b}

/* workspace */
html[data-theme="light"] .ws{background:#fff}
html[data-theme="light"] .ws-cover{background:radial-gradient(120% 90% at 100% 100%,rgba(199,154,50,.16),transparent 55%),linear-gradient(135deg,#fffdf7,#f7f2e6)}
html[data-theme="light"] .ws-tabs button{background:transparent}
html[data-theme="light"] .spend{background:rgba(30,24,10,.22)}
html[data-theme="light"] .alloc{background:rgba(30,24,10,.08)}
html[data-theme="light"] .alloc em{background:#1d1b17}
html[data-theme="light"] .ws-chart i{background:linear-gradient(180deg,rgba(167,122,18,.8),rgba(167,122,18,.25))}
html[data-theme="light"] .ws-spark polygon{fill:rgba(167,122,18,.12)}
html[data-theme="light"] .ws-name-ask input{background:#fff}

/* viewer, calendar, sign-in */
html[data-theme="light"] .bv-scrim{background:rgba(40,30,10,.35)}
html[data-theme="light"] .bv-card,
html[data-theme="light"] .to-latest{background:#fff}
html[data-theme="light"] .bv-tap:hover{box-shadow:0 8px 22px rgba(60,45,10,.12)}
html[data-theme="light"] .modal,
html[data-theme="light"] .cal-panel{background:linear-gradient(180deg,#fffdf7,#f6f1e4)}
html[data-theme="light"] .modal-backdrop,
html[data-theme="light"] .cal-drawer{background:rgba(40,30,10,.35)}
html[data-theme="light"] .perks li{color:var(--muted)}
html[data-theme="light"] .si-form input,
html[data-theme="light"] .cal-set input,
html[data-theme="light"] .cal-form input,
html[data-theme="light"] .cal-form select,
html[data-theme="light"] .cal-form textarea{background:#fff}
html[data-theme="light"] .cal-ev{background:#fff}

/* theme switch in the top bar */
.theme-btn{display:inline-flex;align-items:center;gap:6px;height:34px;padding:0 12px;border-radius:999px;border:1px solid var(--line);color:var(--muted);font-size:13px;background:transparent}
.theme-btn:hover{border-color:var(--line-gold);color:var(--gold)}
.theme-btn svg{flex:none}
@media(max-width:520px){.theme-btn .lbl{display:none}.theme-btn{padding:0;width:34px;justify-content:center}}
