/* Opt-in theme shared by 04 and login. Other screens are unchanged. */
html[data-studio-theme-scope] {
  color-scheme:light;
  --studio-bg:#f6f5f2; --studio-surface:#ffffff; --studio-input:#ffffff;
  --studio-text:#222222; --studio-muted:#6b6b6b; --studio-border:#8a8580;
  --studio-accent:#5b4636; --studio-accent-text:#ffffff;
  --studio-danger-bg:#fdecea; --studio-danger-text:#b3261e;
  --studio-info-bg:#eef6f0; --studio-info-text:#1f7a4d;
  --studio-warning-bg:#fff5df; --studio-warning-text:#765117;
  --studio-disabled-bg:#e5e1da; --studio-disabled-text:#514b45;
  --studio-focus:#005fcc;
  --studio-focus-gap:#fff;
}
.studio-theme-toggle {
  background:transparent; color:inherit; border:1px solid currentColor;
  border-radius:8px; min-height:44px; padding:8px 12px; font:inherit; cursor:pointer;
}
html[data-studio-theme-scope][data-studio-theme] :is(button,a,input,textarea,select,summary):focus-visible {
  outline:3px solid var(--studio-focus); outline-offset:3px;
  box-shadow:0 0 0 2px var(--studio-focus-gap);
}
html[data-studio-theme-scope][data-studio-theme="dark"] {
  color-scheme:dark;
  --studio-bg:#181a1d; --studio-surface:#23272b; --studio-input:#1d2125;
  --studio-text:#e6e8eb; --studio-muted:#b6bec8; --studio-border:#84909c;
  --studio-accent:#b9cce5; --studio-accent-text:#172131;
  --studio-danger-bg:#3b2428; --studio-danger-text:#ffb4ab;
  --studio-info-bg:#20352b; --studio-info-text:#a9dfb9;
  --studio-warning-bg:#3c321d; --studio-warning-text:#f0d28b;
  --studio-disabled-bg:#32383e; --studio-disabled-text:#b8c0c8;
  --studio-focus:#89bfff; --studio-focus-gap:#181a1d;
  --bg:var(--studio-bg); --card:var(--studio-surface); --ink:var(--studio-text);
  --sub:var(--studio-muted); --muted:var(--studio-muted); --line:var(--studio-border);
  --paper:var(--studio-bg); --green:var(--studio-accent); --accent:var(--studio-accent);
  --ok:var(--studio-info-text); --wait:var(--studio-warning-text); --amber:var(--studio-warning-text); --ng:var(--studio-danger-text);
  background:var(--studio-bg);
}
html[data-studio-theme-scope][data-studio-theme="dark"] body {
  background:var(--studio-bg); color:var(--studio-text);
}
html[data-studio-theme-scope][data-studio-theme="dark"] :is(header,nav,.card,.empty) {
  background:var(--studio-surface); color:var(--studio-text);
}
html[data-studio-theme-scope][data-studio-theme="dark"] :is(button.b,button.secondary,.studio-theme-toggle) {
  background:var(--studio-input); color:var(--studio-text); border-color:var(--studio-border);
}
html[data-studio-theme-scope][data-studio-theme="dark"] :is(input:not([type="checkbox"]):not([type="radio"]),textarea,select) {
  background:var(--studio-input); color:var(--studio-text); border-color:var(--studio-border);
}
html[data-studio-theme-scope][data-studio-theme="dark"] :is(input,textarea)::placeholder { color:var(--studio-muted); opacity:1; }
html[data-studio-theme-scope][data-studio-theme="dark"] :is(input[type="checkbox"],input[type="radio"]) { accent-color:var(--studio-accent); }
html[data-studio-theme-scope][data-studio-theme="dark"] :is(.caption-fact-panel,.caption-evidence,.caption-practice-action,pre.preview,#livePreviewText) {
  background:var(--studio-input); color:var(--studio-text);
}
html[data-studio-theme-scope][data-studio-theme="dark"] .alert { background:var(--studio-danger-bg); color:var(--studio-danger-text); }
html[data-studio-theme-scope][data-studio-theme="dark"] .info { background:var(--studio-info-bg); color:var(--studio-info-text); }
html[data-studio-theme-scope][data-studio-theme="dark"] .warning { background:var(--studio-warning-bg); color:var(--studio-warning-text); border-color:var(--studio-warning-text); }
html[data-studio-theme-scope][data-studio-theme="dark"] .badge.fake { background:var(--studio-warning-bg); color:var(--studio-warning-text); }
html[data-studio-theme-scope][data-studio-theme="dark"] #form-error { color:var(--studio-danger-text); }
html[data-studio-theme-scope="login"][data-studio-theme="dark"] #content form > p { color:var(--studio-danger-text); }
html[data-studio-theme-scope][data-studio-theme="dark"] :is(a,.pos) { color:var(--studio-accent); }
html[data-studio-theme-scope][data-studio-theme="dark"] :is(button.b.primary,[data-primary]) {
  background:var(--studio-accent); color:var(--studio-accent-text); border-color:var(--studio-accent);
}
html[data-studio-theme-scope="login"][data-studio-theme="dark"] #content form button[type="submit"] {
  background:var(--studio-accent); color:var(--studio-accent-text); border-color:var(--studio-accent);
}
html[data-studio-theme-scope][data-studio-theme="dark"] :is(button.b:disabled,button.b.caption-main:disabled,button:disabled,input:disabled,textarea:disabled,select:disabled) {
  opacity:1; background:var(--studio-disabled-bg); color:var(--studio-disabled-text); border-color:var(--studio-border);
}
@media print { .studio-theme-toggle { display:none; } }
