/* Dark is the default; an explicit browser preference enables light mode. */
:root {
  color-scheme: dark;
  --ink: #e6edf8;
  --muted: #afbdd1;
  --blue: #8cb4ff;
  --cream: #0c1422;
  --line: #34445c;
  --mint: #203f37;
  --white: #142035;
  --shadow: 0 12px 35px #00000016;
  --surface: #142035;
  --header: #101b2c;
  --input: #0f1a2b;
  --input-border: #465873;
  --hover: #203451;
  --hover-border: #6688bb;
  --active: #203655;
  --soft: #1a293f;
  --primary: #2864e8;
  --primary-hover: #2056cc;
  --intro: #111e33;
  --auth: #0c1422;
  --danger: #ffacb5;
  --error-bg: #3a202b;
  --error-border: #7b4456;
  --toast-bg: #deebff;
  --toast-text: #10274a;
  --save-bg: #142035f5;
}

button, .button, .panel, .idea-card, dialog { background: var(--surface); }
button:hover, .button:hover { background: var(--hover); border-color: var(--hover-border); }
button.primary, .button.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
button.primary:hover, .button.primary:hover { background: var(--primary-hover); }
button.danger { color: var(--danger); }
.topbar { background: var(--header); }
.topbar nav button[aria-current], .steps>button[aria-current] { background: var(--active); }
input, textarea, select { background: var(--input); border-color: var(--input-border); }
input:focus, textarea:focus, select:focus { background: var(--surface); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .85; }
.empty, pre, .steps>button b { background: var(--soft); }
.steps>button[aria-current] b { background: var(--primary); }
.savebar { background: var(--save-bg); border-color: var(--line); }
.note { background: var(--active); }
blockquote { border-color: var(--hover-border); }
.error { background: var(--error-bg); border-color: var(--error-border); color: var(--danger); }
.toast { background: var(--toast-bg); color: var(--toast-text); }
.auth-intro { background: var(--intro); }
.auth-panel { background: var(--auth); }
.header-actions { display: flex; align-items: center; gap: 12px; }
.theme-toggle { white-space: nowrap; flex-shrink: 0; }
.theme-toggle [data-theme-icon] { font-size: 20px; line-height: 1; }
.auth-theme { position: absolute; top: 24px; right: 24px; }
@media(max-width:620px) {
  .header-actions { gap: 8px; }
  .header-actions .theme-toggle { padding: 8px 10px; min-width: 44px; }
  .header-actions [data-theme-label] { display: none; }
  .auth-theme { top: 18px; right: 24px; }
  .steps>button b, .steps>button[aria-current] b { background: transparent; }
}
