:root {
  color-scheme: light;
  --canvas: #ffffff;
  --ink: #18232d;
  --muted: #546573;
  --line: #dbe4ec;
  --accent: #246482;
  --accent-hover: #194d67;
  --on-accent: #ffffff;
  --surface: #f4f8fc;
  --control-hover: #eaf3fa;
  --field-line: #788994;
  --focus: #2c738f;
  --selected-bg: #e1f1fa;
  --selected-ink: #173f58;
  --issued-bg: #eaf5fc;
  --status-bg: #eaf5fc;
  --status-ink: #285570;
  --stopped-bg: #f8ecea;
  --stopped-ink: #963d35;
  --waiting-bg: #f0f3f7;
  --error: #a02d25;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--canvas);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #0f1b2a;
  --ink: #edf7ff;
  --muted: #a9bfd0;
  --line: #344c62;
  --accent: #8fd3f4;
  --accent-hover: #b2e3fc;
  --on-accent: #10283b;
  --surface: #17293b;
  --control-hover: #253d52;
  --field-line: #7a94aa;
  --focus: #8fd3f4;
  --selected-bg: #234b66;
  --selected-ink: #d8efff;
  --issued-bg: #1b354b;
  --status-bg: #234b66;
  --status-ink: #b8e4fc;
  --stopped-bg: #352323;
  --stopped-ink: #f4a49a;
  --waiting-bg: #1a2e3f;
  --error: #f4a49a;
}
/* Preserve OS dark mode when JavaScript is unavailable. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --canvas: #0f1b2a; --ink: #edf7ff; --muted: #a9bfd0;
    --line: #344c62; --accent: #8fd3f4; --accent-hover: #b2e3fc;
    --on-accent: #10283b; --surface: #17293b; --control-hover: #253d52;
    --field-line: #7a94aa; --focus: #8fd3f4;
    --selected-bg: #234b66; --selected-ink: #d8efff;
    --issued-bg: #1b354b; --status-bg: #234b66; --status-ink: #b8e4fc;
    --stopped-bg: #352323; --stopped-ink: #f4a49a;
    --waiting-bg: #1a2e3f; --error: #f4a49a;
  }
}
* { box-sizing: border-box; scrollbar-color: var(--field-line) var(--surface); scrollbar-width: thin; }
body { margin: 0; }
::selection { background: var(--selected-bg); color: var(--selected-ink); }
input, textarea { caret-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
a { text-underline-offset: .2em; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 3px;
}
.theme-control { display: grid; gap: 8px; min-width: 150px; }
.theme-control label { color: var(--muted); font-size: .8rem; font-weight: 550; margin: 0; }
.theme-control select {
  min-height: 44px; width: 100%; border: 1px solid var(--field-line);
  border-radius: 10px; padding: 8px 12px;
  background: var(--canvas); color: var(--ink); cursor: pointer;
}
.theme-control select:hover { background: var(--control-hover); }
time, .status, .url { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
