:root {
  --paper: #f6f3ec; --card: #fffdf8; --ink: #1c1b19; --muted: #6b665c; --line: #e0d9cb;
  --accent: #c2410c; --accent-ink: #ffffff; --gone: #b8b1a3; --focus: #1d4ed8;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141311; --card: #1d1b18; --ink: #f1ece1; --muted: #a39c8e; --line: #36322b;
    --accent: #ff7a3d; --accent-ink: #1a0e06; --gone: #5a554c; --focus: #93c5fd;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }
.top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 18px 0 0; }
.mark { font-weight: 800; letter-spacing: 0.02em; text-transform: uppercase; font-size: 15px; }
.mark b { color: var(--accent); }
.tag { color: var(--muted); font-size: 13px; }
h1 { font-size: clamp(30px, 7vw, 46px); line-height: 1.05; letter-spacing: -0.02em; margin: 34px 0 12px; font-weight: 800; text-wrap: balance; }
h2 { font-size: 22px; line-height: 1.2; letter-spacing: -0.01em; margin: 44px 0 10px; }
p { margin: 0 0 14px; }
.lead { font-size: 19px; color: var(--muted); max-width: 60ch; }
a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 3px; }

form { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin: 26px 0 0; }
fieldset { border: 0; padding: 0; margin: 0 0 20px; min-width: 0; }
legend { font-weight: 700; padding: 0; margin-bottom: 8px; }
.row { display: grid; gap: 10px; }
.dob { grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.8fr) minmax(0, 1fr); }
.term { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin: 10px 0 0 30px; }
label.small { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
select, input[type="text"] {
  width: 100%; height: 48px; padding: 0 12px; font: inherit; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
}
select:disabled, input:disabled { opacity: 0.45; }
.choice { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.choice input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }
button {
  width: 100%; height: 52px; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 700; font-size: 18px;
}
button:hover { filter: brightness(1.07); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.private { color: var(--muted); font-size: 14px; margin: 12px 0 0; text-align: center; }
#err { color: var(--accent); font-weight: 600; margin: 12px 0 0; }
#err:empty { display: none; }

#out { margin: 22px 0 0; border: 2px solid var(--ink); border-radius: 14px; padding: 22px 20px; background: var(--card); }
#out h2 { margin: 0; font-size: clamp(26px, 6vw, 36px); line-height: 1.1; letter-spacing: -0.02em; }
#out .sub { font-size: 19px; margin: 6px 0 0; color: var(--muted); }
.chips { list-style: none; padding: 0; margin: 20px 0 6px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.chips li { border: 1px solid var(--ink); border-radius: 8px; padding: 7px 4px; text-align: center; font-size: 13px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.chips li span { display: block; font-weight: 700; font-size: 15px; }
.chips .gone { border-color: var(--gone); color: var(--gone); text-decoration: line-through; }
.chips .past { border-style: dashed; color: var(--muted); }
.chips .open { background: var(--ink); color: var(--paper); }
.key { font-size: 13px; color: var(--muted); margin: 0 0 4px; }
.key:empty { display: none; }
dl { margin: 16px 0 0; }
dt { font-weight: 700; margin-top: 14px; }
dd { margin: 2px 0 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

ul.plain { padding-left: 20px; margin: 0 0 14px; }
ul.plain li { margin-bottom: 8px; }
footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 20px 0 40px; color: var(--muted); font-size: 14px; }
footer p { margin: 0; }

.menu, .foot { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.menu { padding: 12px 0 0; font-size: 15px; }
.foot { margin: 0 0 12px; }
.menu a, .foot a { color: var(--muted); text-decoration: none; padding: 4px 0; }
.menu a:hover, .foot a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); }
.menu a[aria-current="page"], .foot a[aria-current="page"] {
  color: var(--ink); font-weight: 700; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px;
}

.guide h1 { margin-top: 28px; }
.go { font-weight: 600; margin: 18px 0 18px; }
.table-wrap { overflow-x: auto; margin: 0 0 14px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); }
th { font-weight: 700; }
code { font-size: 0.9em; }
@media (min-width: 600px) {
  .chips { grid-template-columns: repeat(10, minmax(0, 1fr)); }
  .chips li span { font-size: 14px; }
}
@media (max-width: 420px) {
  .term { margin-left: 0; }
}
