/* Shared by every page: colour tokens for the light and dark themes, and the
   base controls. The theme follows the system unless the toggle (theme.js)
   has set data-theme on <html>. */
:root {
  color-scheme: light;
  --bg: #f3f5f2;
  --surface: #fcfcfb;
  --surface-2: #eef1ed;
  --ink: #121715;
  --ink-2: #4c5652;
  --muted: #7a8480;
  --line: #dfe4df;
  --grid: #e9ece8;
  --accent: #1d4d45;
  --accent-ink: #ffffff;
  --good: #0ca30c; --good-ink: #0a6b0a;
  --warn: #fab219; --warn-ink: #8a5a00;
  --bad: #d03b3b;  --bad-ink: #b02a2a;
  --c1: #2a78d6; --c2: #eb6834; --c3: #1baf7a; --c4: #eda100;
  --c5: #e87ba4; --c6: #008300; --c7: #4a3aa7; --c8: #e34948;
  --ghost: #b8c0bc;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --sans: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #101312; --surface: #1a1d1c; --surface-2: #232826;
    --ink: #f1f4f2; --ink-2: #bcc5c1; --muted: #8b9591;
    --line: #2e3432; --grid: #262b29;
    --accent: #7fcdbd; --accent-ink: #0d1f1b;
    --good-ink: #5fd35f; --warn-ink: #fab219; --bad-ink: #f07a7a;
    --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500;
    --c5: #d55181; --c6: #008300; --c7: #9085e9; --c8: #e66767;
    --ghost: #4d5552;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101312; --surface: #1a1d1c; --surface-2: #232826;
  --ink: #f1f4f2; --ink-2: #bcc5c1; --muted: #8b9591;
  --line: #2e3432; --grid: #262b29;
  --accent: #7fcdbd; --accent-ink: #0d1f1b;
  --good-ink: #5fd35f; --warn-ink: #fab219; --bad-ink: #f07a7a;
  --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500;
  --c5: #d55181; --c6: #008300; --c7: #9085e9; --c8: #e66767;
  --ghost: #4d5552;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 400 14px/1.5 var(--sans); }

select, input, button { font: inherit; color: inherit; }
select, input {
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 10px; min-height: 36px; color: var(--ink);
}
select:focus-visible, input:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 8px; padding: 7px 14px; min-height: 36px; cursor: pointer; font-weight: 500;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger-armed { border-color: var(--bad); color: var(--bad-ink); }
.btn.small { min-height: 30px; padding: 3px 10px; font-size: 13px; }
.btn svg { width: 16px; height: 16px; flex: none; }

.notice {
  display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between;
  background: var(--surface-2); border: 1px dashed var(--line); border-radius: 10px; padding: 10px 14px; color: var(--ink-2);
}
.notice strong { color: var(--ink); }
.notice.error { border: 1px solid var(--bad); color: var(--bad-ink); border-style: solid; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
