:root {
  --bg: #f7f7f4;
  --surface: #ffffff;
  --text: #1f2421;
  --muted: #5b635e;
  --line: #d8dcd7;
  --accent: #1d6b57;
  --warn: #8a4b00;
  --error: #a32020;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15191a;
    --surface: #1e2425;
    --text: #e9ece9;
    --muted: #a7b0ab;
    --line: #343c3b;
    --accent: #6fd0b5;
    --warn: #eeb46b;
    --error: #ff9a9a;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  line-height: 1.7;
}
a { color: var(--accent); }
.top, main, footer { max-width: 880px; margin: 0 auto; padding: 0 16px; }
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; padding-top: 12px; }
.brand { margin: 0; font-weight: 700; }
nav { display: flex; gap: 16px; }
nav a[aria-current] { color: var(--text); font-weight: 700; text-decoration: none; }
h1 { margin: 24px 0 8px; font-size: clamp(1.5rem, 5vw, 2.1rem); line-height: 1.3; }
.lead { margin-top: 0; color: var(--muted); }
fieldset { min-width: 0; margin: 0 0 16px; padding: 12px 16px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px 16px; }
legend { padding: 0 6px; font-weight: 700; }
.tag { font-size: .8rem; font-weight: 400; color: var(--warn); }
label { display: grid; gap: 2px; font-size: .9rem; color: var(--muted); }
input, select { width: 100%; min-height: 40px; padding: 6px 8px; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; }
input:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.card { padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.card h3 { margin: 0; font-size: .85rem; font-weight: 400; color: var(--muted); }
.card p { margin: 2px 0; font-size: 1.25rem; font-weight: 700; }
.card small { color: var(--muted); }
.note { color: var(--warn); }
.error { color: var(--error); font-weight: 700; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--surface); font-variant-numeric: tabular-nums; }
th, td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th[scope="row"], thead th:first-child { text-align: left; }
.caveat { margin-top: 24px; }
footer { margin: 32px auto; color: var(--muted); font-size: .85rem; }
.placeholder { padding: 10px 14px; border: 1px dashed var(--warn); border-radius: 8px; color: var(--warn); }
[hidden] { display: none !important; }
