:root {
  color-scheme: light dark;
  --bg: #f5f7fa;
  --panel: #fff;
  --text: #182638;
  --muted: #43546b;
  --accent: #164c99;
  --border: #65748a;
  --focus: #905000;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.6 system-ui, sans-serif;
}
header, main, footer, #notice { max-width: 960px; margin: auto; padding: 16px; }
header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
nav { display: flex; flex-wrap: wrap; gap: 8px; }
a { color: var(--accent); display: inline-block; padding: 10px 8px; min-height: 44px; }
h1, h2 { line-height: 1.3; }
form, article, section {
  background: var(--panel);
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 16px;
}
label { display: block; margin: 12px 0 4px; }
input, select, textarea, button {
  font: inherit;
  min-height: 44px;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px;
}
input, select, textarea { width: 100%; background: var(--panel); color: var(--text); }
textarea { min-height: 140px; }
button { background: var(--accent); color: #fff; cursor: pointer; margin: 8px 8px 8px 0; }
button:disabled { opacity: .65; cursor: wait; }
input[type=checkbox] { width: 44px; vertical-align: middle; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; }
p, li, output { overflow-wrap: anywhere; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
footer { color: var(--muted); }
[hidden] { display: none !important; }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101925;
    --panel: #192638;
    --text: #f3f6fc;
    --muted: #bccce1;
    --accent: #a8ceff;
    --border: #91a1b8;
    --focus: #ffd090;
  }
  button { color: #101925; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; animation: none; transition: none; }
}
