:root{--theme-surface:#fff;--theme-subtle:#f1f4ed;--theme-border:#cbd1c7}
.theme-toggle{display:inline-grid;place-items:center;flex:none;width:40px;height:40px;min-height:40px;padding:0;border:1px solid var(--theme-border);border-radius:50%;background:var(--theme-surface);color:var(--cream,var(--ink,#0e0f0c));cursor:pointer;vertical-align:middle}
.theme-toggle:hover{background:var(--theme-subtle);transform:none}
#login form,#gate form{position:relative}
.theme-login{justify-self:end;margin-bottom:-8px}
.header .nav{gap:20px}.header .nav .theme-toggle{color:var(--ink)}
html[data-theme=dark]{color-scheme:dark;--bg:#151914;--panel:#22281f;--cream:#f0f4eb;--muted:#b7c1af;--line:#47533f;--body:#d5ddce;--ink:#f0f4eb;--sage:#20271d;--white:#22281f;--theme-surface:#22281f;--theme-subtle:#2c3526;--theme-border:#47533f;background:#151914;color:#f0f4eb}
html[data-theme=dark] body{background:var(--bg);color:var(--cream)}
html[data-theme=dark] :is(.card,.tbl,header,dialog .head,#login form,#gate form,#pwDlg,#topupDlg,.app,.composer,.demo,.plan,details,.secondary,.nav-cta){background:var(--theme-surface);color:var(--cream)}
html[data-theme=dark] :is(input,textarea,select,.box,.group,.msg.user,.msg.sys,#newChat,#slash,.chip,.preview,.setup-note,.topup-plan,.demo-question,.demo-composer){background-color:var(--theme-subtle);color:var(--cream);border-color:var(--line)}
html[data-theme=dark] :is(.group button,.sugg button,.md pre,.md code){background:var(--theme-surface);color:var(--cream);border-color:var(--line)}
html[data-theme=dark] :is(#side,#gate,#login),html[data-theme=dark] :is(.hero,.header,.visitor-section,.pricing-section,.closing){background:var(--sage);color:var(--cream)}
html[data-theme=dark] .box textarea{background:transparent;color:var(--cream)}
html[data-theme=dark] :is(button.ghost,.btn){background:var(--theme-surface);color:var(--cream);border-color:var(--line)}
html[data-theme=dark] :is(button.cta,button.accent,#send){background:var(--accent,var(--lime,#9fe870));color:#0e0f0c;border-color:transparent}
html[data-theme=dark] :is(th,td,.demo-head,.task-row,#side .top,#side .foot){border-color:var(--line)}
html[data-theme=dark] table :is(th:first-child,td:first-child){background:var(--theme-surface)}
html[data-theme=dark] :is(.muted,.fine,.group p,.hello-intro,.demo-sub,.demo-disclaimer,.demo-label,.hero-note,.stage-caption,.old-price,.price-caption,.plan-fine,.plan-top span,.task-row>span:first-child,.demo-head div>span){color:var(--muted)}
html[data-theme=dark] :is(.privacy-note,#promo,#codeRow){background:#2a4021;color:#dbf0cc}
html[data-theme=dark] :is(.privacy-note p,#promo a,.preview a,.pos,.sugg button::before,.statcards b){color:#b8ec9b}
html[data-theme=dark] .banner{background:#423818;color:#ffe6a3}
html[data-theme=dark] .banner.crit{background:#422126;color:#ffc2c5}
html[data-theme=dark] :is(.err,.cerr>p){color:#ff9ca2}
html[data-theme=dark] .group button:hover,html[data-theme=dark] button:hover{background-color:#35452c}
html[data-theme=dark] :is(.primary:hover,button.cta:hover),html[data-theme=dark] #send:hover{background:#cdffad;color:#0e0f0c}
html[data-theme=dark] .demo-choices button{background:#343e2d;color:var(--cream)}
html[data-theme=dark] .demo-choices button[aria-pressed=true]{background:#9fe870;color:#163300}
html[data-theme=dark] a,html[data-theme=dark] .ai-symbol,html[data-theme=dark] #slash li b,html[data-theme=dark] #cmd{color:#b8ec9b}
html[data-theme=dark] :is(.header a,.footer a,.button.secondary){color:var(--cream)}
html[data-theme=dark] .button.primary{background:var(--lime,#9fe870);color:#163300;border-color:transparent}
html[data-theme=dark] .meter{background:#45533a}
html[data-theme=dark] #convos li[aria-current=true]{background:#37432d}
html[data-theme=dark] .plate.ini{color:#0e0f0c}
html[data-theme=dark] img[src^="/logo-ink.svg"]{filter:brightness(0) invert(1)}
html[data-theme=dark] .md pre code.hljs{color:#e0edda}
html[data-theme=dark] .steps .n{color:#b8ec9b}
html[data-theme=dark] .theme-toggle{background:var(--theme-surface);color:var(--cream)}
@media(max-width:767px){.header .nav{gap:10px}.header .nav img{width:128px}.header .nav .nav-cta{padding:10px 12px;gap:8px}.header .theme-toggle{width:36px;height:36px;min-height:36px}.header .nav{flex-wrap:wrap}#app>header .wrap>.theme-toggle{margin-left:auto}}
@media print{html[data-theme=dark],html[data-theme=dark] body{background:white;color:black}.theme-toggle{display:none!important}}
html[data-theme=dark] select{background-image:none;appearance:auto;padding-right:12px}
html[data-theme=dark] .model-scroll-controls input{accent-color:#9fe870}

html[data-theme=dark] .cafe-mark{background:#9fe870;color:#163300}
html[data-theme=dark] header{border-color:var(--line)}
@media(max-width:380px){.header .nav{gap:8px}.header .nav img{width:110px}.header .nav .nav-cta{font-size:11px;padding:10px;gap:6px}.header .theme-toggle{width:32px;height:32px;min-height:32px}}
/* A fixed square hit area, unaffected by the chat header's generic button padding. */
.app main>header .theme-toggle{padding:0;aspect-ratio:1;width:38px;height:38px;min-width:38px;min-height:38px;border-radius:50%;flex:0 0 38px}
/* Landing inversion: dark-green emphasis blocks in light mode become white in dark mode.
   Scoped by body ID to outrank shared app selectors without changing the app themes. */
html[data-theme=dark] #landing :is(.hero,.header,.visitor-section,.pricing-section,.closing){background:#20271d;color:#f0f4eb;border:0}
html[data-theme=dark] #landing :is(.statement,.credit-calculator){
  color-scheme:light;background:#fff;color:#0e0f0c;border:0;
  --ink:#0e0f0c;--cream:#0e0f0c;--muted:#535b4d;--line:#cbd1c7;--lime:#163300;
}
html[data-theme=dark] #landing .statement :is(p,h2){color:#0e0f0c}
html[data-theme=dark] #landing .statement .statement-note{color:#535b4d}
html[data-theme=dark] #landing .credit-calculator :is(h3,p,label,output,.calculation,.range-labels){color:#0e0f0c}
html[data-theme=dark] #landing .credit-calculator :is(.kicker,.range-labels,.calculator-note,.calculation-formula){color:#535b4d}
html[data-theme=dark] #landing .calculator-control output{color:#163300}
html[data-theme=dark] #landing .calculator-control input{background:transparent;color:#163300;accent-color:#163300;border:0}
/* Keep the demo and pricing cards legible as distinct containers, not the same fill as their section. */
html[data-theme=dark] #landing :is(.demo,.plan,.visitor-workspace){background:#34422d;color:#f0f4eb;border:1px solid #79876e}
html[data-theme=dark] #landing :is(.demo-question,.demo-composer){background:#20271d;color:#f0f4eb}
html[data-theme=dark] #landing .demo-choices button{background:#20271d;color:#f0f4eb}
html[data-theme=dark] #landing .demo-choices button[aria-pressed=true]{background:#9fe870;color:#163300}
html[data-theme=dark] #landing .includes li::before{color:#b8ec9b}
html[data-theme=dark] #landing :is(.nav-cta,.button.secondary){background:#fff;color:#0e0f0c;border:1px solid #fff}
html[data-theme=dark] #landing :is(.nav-cta,.button.secondary):hover{background:#e8ebe6;color:#0e0f0c}
html[data-theme=dark] #landing .closing :is(h2,p,.kicker){color:#f0f4eb}
html[data-theme=dark] #landing .closing .button.primary{background:#9fe870;color:#163300}
html[data-theme=dark] #landing .calc-figure span{color:#535b4d}
html[data-theme=dark] #landing .calc-figure:first-child strong{color:#163300}
