/* Shared design tokens for every Mira page. Light by default, dark when the OS
   asks for it, and a manual override via <html data-theme="light|dark">. */
:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #eceef2;
  --hover: rgba(20, 30, 50, .06);
  --line: #e1e4ea;
  --line-strong: #cfd4dd;
  --text: #15181d;
  --text-2: #3d4450;
  --muted: #646d7b;
  --accent: #2f6fde;
  --accent-strong: #1f58bd;
  --accent-soft: rgba(47, 111, 222, .12);
  --on-accent: #ffffff;
  --accent-2: #8a4fd8;
  --warn: #c76a00;
  --warn-soft: rgba(199, 106, 0, .14);
  --warn-strong: #9a5200;
  --on-warn: #ffffff;
  --ok: #1f9d57;
  --ok-soft: rgba(31, 157, 87, .13);
  --ok-strong: #167a43;
  --danger: #c93a32;
  --link: #1f58bd;
  --code-bg: #eef0f4;
  --user-bubble: #dfe9fb;
  --mira: #6c5ce7;
  --shadow: 0 1px 2px rgba(15, 20, 30, .06), 0 4px 14px rgba(15, 20, 30, .05);
  --shadow-lg: 0 10px 40px rgba(15, 20, 30, .18);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f1217;
    --surface: #171b22;
    --surface-2: #12151b;
    --hover: rgba(255, 255, 255, .06);
    --line: #232934;
    --line-strong: #2f3644;
    --text: #e8eaed;
    --text-2: #c3c8d0;
    --muted: #949ba6;
    --accent: #8ab4f8;
    --accent-strong: #a8c7fa;
    --accent-soft: rgba(138, 180, 248, .14);
    --on-accent: #0b0d11;
    --accent-2: #c9a3ff;
    --warn: #f0a24a;
    --warn-soft: rgba(240, 162, 74, .16);
    --warn-strong: #f5b871;
    --on-warn: #1a1206;
    --ok: #57c98a;
    --ok-soft: rgba(87, 201, 138, .15);
    --ok-strong: #7ee0a8;
    --danger: #f28b82;
    --link: #a8c7fa;
    --code-bg: #1e232c;
    --user-bubble: #23324d;
    --mira: #7b6cf0;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, .55);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1217;
  --surface: #171b22;
  --surface-2: #12151b;
  --hover: rgba(255, 255, 255, .06);
  --line: #232934;
  --line-strong: #2f3644;
  --text: #e8eaed;
  --text-2: #c3c8d0;
  --muted: #949ba6;
  --accent: #8ab4f8;
  --accent-strong: #a8c7fa;
  --accent-soft: rgba(138, 180, 248, .14);
  --on-accent: #0b0d11;
  --accent-2: #c9a3ff;
  --warn: #f0a24a;
  --warn-soft: rgba(240, 162, 74, .16);
  --warn-strong: #f5b871;
  --on-warn: #1a1206;
  --ok: #57c98a;
  --ok-soft: rgba(87, 201, 138, .15);
  --ok-strong: #7ee0a8;
  --danger: #f28b82;
  --link: #a8c7fa;
  --code-bg: #1e232c;
  --user-bubble: #23324d;
  --mira: #7b6cf0;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ic { display: inline-block; flex: 0 0 auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
