/* Explicit user preference. Existing light colors remain unchanged. */
.r13-theme-toggle[hidden]{display:none!important}
.r13-theme-toggle{flex:none;display:inline-grid;place-items:center;width:44px;height:44px;padding:0;border:1px solid var(--line2,var(--r13-control,#778f79));border-radius:10px;background:var(--card,var(--r13-panel,#fff));color:var(--ink,var(--r13-ink,#18281e));cursor:pointer}
.r13-theme-toggle svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
.r13-theme-toggle .r13-theme-sun,[data-r13-palette="dark"] .r13-theme-toggle .r13-theme-moon{display:none}
[data-r13-palette="dark"] .r13-theme-toggle .r13-theme-sun{display:block}
.r13-theme-toggle:hover{border-color:var(--accent,var(--r13-link,#286532))}
.r13-theme-toggle:focus-visible{outline:2px solid var(--accent,var(--r13-link,#286532));outline-offset:2px}
html[data-r13-palette="dark"]{
  color-scheme:dark;background:#101713;--r13-bg:#101713;--r13-panel:#19241e;--r13-panel2:#233329;--r13-ink:#ecf4ee;
  --r13-muted:#baccc0;--r13-line:#384b40;--r13-control:#718c7d;--r13-link:#9fdfaf;--r13-on-cta:#18281e;
  --r13-pressed:#294438;--r13-hover:#2a4033;--r13-focus-dark:#b7efc6;
  --r13-warn-bg:#372b16;--r13-warn:#ffd18a;--r13-error-bg:#402522;--r13-error:#ffb4ac;
}
html[data-r13-palette="dark"][data-r13-theme-page="home"] body.v2{color-scheme:dark}
html[data-r13-palette="dark"][data-r13-theme-page="home"] :is(.v2-header,.v2-mobile-cta){background:rgba(25,36,30,.97);border-color:var(--r13-line)}
html[data-r13-palette="dark"][data-r13-theme-page="home"] .v2-hero{background:radial-gradient(ellipse at 75% 12%,#243b2b 0,transparent 60%)}
html[data-r13-palette="dark"][data-r13-theme-page="home"] :is(.v2-strip,.v2-section.alt,.v2-free-banner,.v2-team,.v2-table th,.v2-callout,.v2-footer,.v2-price.featured){background:var(--r13-panel2);border-color:var(--r13-line)}
html[data-r13-palette="dark"][data-r13-theme-page="home"] :is(.v2-strip .wrap,.v2-free-banner p,.v2-team p,.v2-team-points span,.v2-price ul){color:var(--r13-muted)}
html[data-r13-palette="dark"][data-r13-theme-page="home"] :is(.v2-guide,.v2-team-points div,.v2-demo,body.v2 .icon){border-color:var(--r13-line)}
html[data-r13-palette="dark"][data-r13-theme-page="home"] :is(.v2-demo-tabs button[aria-selected="true"],.v2-demo-prompt){background:var(--r13-pressed);color:var(--r13-ink);border-color:var(--r13-control)}
html[data-r13-palette="dark"][data-r13-theme-page="home"] .v2-demo-answer{background:var(--r13-panel2);color:var(--r13-ink)}
html[data-r13-palette="dark"][data-r13-theme-page="home"] :is(.v2-task:hover,body.v2 .btn:not(.btn-primary):hover){background:var(--r13-hover);border-color:var(--r13-link)}
html[data-r13-palette="dark"][data-r13-theme-page="home"] :is(body.v2 .btn-primary,.v2-price-badge,.skip-link,.v2 .sup-form button){color:var(--r13-on-cta)}
html[data-r13-palette="dark"][data-r13-theme-page="home"] .r13-home-tools{
  --r13-paper:#19241e;--r13-ink:#ecf4ee;--r13-muted:#baccc0;--r13-edge:#384b40;--r13-accent:#9fdfaf;
  --r13-wash:#233329;--r13-accent-bg:#2b593d;--r13-on:#fff;--r13-focus:#b7efc6;--r13-example:#141e18
}
html[data-r13-palette="dark"][data-r13-theme-page="home"] .r13-home-tools.r13-plum{
  --r13-paper:#261f30;--r13-ink:#f6effe;--r13-muted:#dbcbe9;--r13-edge:#544563;
  --r13-accent:#e0c3fb;--r13-wash:#372846;--r13-accent-bg:#6639a1;--r13-focus:#e0c3fb
}
html[data-r13-palette="dark"][data-r13-theme-page="home"] .v2 .sup{border-color:var(--r13-control)}
html[data-r13-palette="dark"][data-r13-theme-page="home"] .v2 .sup .m{background:var(--r13-panel2)}
html[data-r13-palette="dark"][data-r13-theme-page="home"] .v2 .sup .m.u{background:var(--r13-pressed)}
html[data-r13-palette="dark"][data-r13-theme-page="home"] .sup select{background:var(--r13-panel);color:var(--r13-ink);border:1px solid var(--r13-control);border-radius:8px}
html[data-r13-palette="dark"][data-r13-theme-page="home"] .sup .support-error{color:var(--r13-error)}
html[data-r13-palette="dark"][data-r13-theme-page="home"] .sup a:not(.btn){color:var(--r13-link)}
html[data-r13-palette="dark"] #ck-banner{color-scheme:light}

/* Chat uses its existing variables for ordinary surfaces, with explicit overrides for
   legacy hard-coded light surfaces. No changes to modal/guest state, IDs or actions. */
html[data-r13-palette="dark"][data-r13-theme-page="chat"]{
  --bg:var(--r13-bg);--card:var(--r13-panel);--card2:var(--r13-panel2);--side:#151f19;
  --line:var(--r13-line);--line2:var(--r13-control);--ink:var(--r13-ink);--ink2:var(--r13-muted);
  --mute:var(--r13-muted);--accent:var(--r13-link);--accent2:var(--r13-focus-dark);--ok:var(--r13-link);--bad:var(--r13-error)
}
html[data-r13-palette="dark"][data-r13-theme-page="chat"] :is(.d:hover,.side-f a.up:hover,.sync-action:hover,.task:hover,.btn-o:active:not(:disabled)){background:var(--r13-hover)}
html[data-r13-palette="dark"][data-r13-theme-page="chat"] :is(.m.u,.ib.on,button.file:hover){background:var(--r13-pressed);border-color:var(--r13-line)}
html[data-r13-palette="dark"][data-r13-theme-page="chat"] .counter:not(.low,.out){background:var(--card2)}
html[data-r13-palette="dark"][data-r13-theme-page="chat"] .counter.low,html[data-r13-palette="dark"][data-r13-theme-page="chat"] .counter.low b{background:var(--r13-warn-bg);color:var(--r13-warn)}
html[data-r13-palette="dark"][data-r13-theme-page="chat"] .counter.out{background:var(--r13-error-bg);color:var(--r13-error)}
html[data-r13-palette="dark"][data-r13-theme-page="chat"] :is(.file button:hover,.dialog-delete:hover){background:var(--r13-error-bg);color:var(--r13-error)}
html[data-r13-palette="dark"][data-r13-theme-page="chat"] :is(.wall,.side-scrim){background:rgba(4,10,6,.68)}
html[data-r13-palette="dark"][data-r13-theme-page="chat"] :is(#rolePicker,#rolePickerButton,#rolePicker button,#role,#model,#role option,#model option){
  color-scheme:dark;background:var(--card);color:var(--ink);border-color:var(--line2)
}
html[data-r13-palette="dark"][data-r13-theme-page="chat"] #roleChoices button[aria-current="true"]{background:var(--r13-pressed);border-color:var(--r13-control)}
html[data-r13-palette="dark"][data-r13-theme-page="chat"] :is(#rolePicker button,#rolePickerButton):focus-visible{outline-color:var(--accent)}
html[data-r13-palette="dark"][data-r13-theme-page="chat"] :is(.btn-p,.send,.newbtn):not(:disabled){color:var(--r13-on-cta)}
html[data-r13-palette="dark"][data-r13-theme-page="chat"] :is(button,input,select,textarea):disabled,
html[data-r13-palette="dark"][data-r13-theme-page="chat"] #loginBox input:not([type="checkbox"]):disabled{
  color:var(--mute)!important;background:#25332b!important;border-color:var(--line);box-shadow:none
}
html[data-r13-palette="dark"][data-r13-theme-page="chat"] :is(.comp .box:focus-within,#loginBox input:not([type="checkbox"]):focus){box-shadow:0 0 0 3px #9fdfaf33}
html[data-r13-palette="dark"][data-r13-theme-page="chat"] ::selection{background:#bbecaa;color:#18281e}

@media(max-width:430px){
  html[data-r13-theme-page="home"] .v2-header .wrap{gap:7px;padding-inline:12px}
  html[data-r13-theme-page="home"] .v2-head-actions{gap:5px}
  html[data-r13-theme-page="home"] .v2-head-actions .btn{max-width:125px;text-align:center}
  html[data-r13-theme-page="chat"] .top #rolePickerButton{max-width:calc(100vw - 164px)}
}

/* Shared, opt-in tokens for the approved Review13 surfaces. */
html[data-r13-theme-page]:not([data-r13-palette="dark"]){
 --r13-ui-bg:#f7f9f6;--r13-ui-panel:#fff;--r13-ui-ink:#18281e;--r13-ui-muted:#435b4c;
 --r13-ui-border:#c5d4c8;--r13-ui-link:#235d38;--r13-ui-action:#286343;--r13-ui-action-ink:#fff
}
html[data-r13-theme-page][data-r13-palette="dark"]{
 --r13-ui-bg:#101713;--r13-ui-panel:#19241e;--r13-ui-ink:#ecf4ee;--r13-ui-muted:#baccc0;
 --r13-ui-border:#607a68;--r13-ui-link:#9fdfaf;--r13-ui-action:#9fdfaf;--r13-ui-action-ink:#18281e
}
html[data-r13-theme-page]{--r13-ui-radius:12px;--r13-ui-space:12px}
.r13-theme-choice-label{display:inline-flex;flex-wrap:wrap;align-items:center;gap:6px;font-size:.85rem;color:var(--r13-ui-muted,#435b4c)}
.r13-theme-choice{box-sizing:border-box;font:inherit;min-height:44px;max-width:100%;border:1px solid var(--r13-ui-border,#c5d4c8);border-radius:var(--r13-ui-radius,12px);padding:6px;background:var(--r13-ui-panel,#fff);color:var(--r13-ui-ink,#18281e)}
.r13-theme-choice:focus-visible{outline:2px solid var(--r13-ui-link,#235d38);outline-offset:2px}
.r13-theme-choice-label .r13-ui-label{font-size:.8rem;color:var(--r13-ui-muted,#435b4c)}
