
:root {
  --bg: #f6f7f9; --surface: #ffffff; --text: #16191f; --muted: #555d6b; --border: #d5d9e0;
  --accent: #1f4fd1; --accent-text: #ffffff; --focus: #1f4fd1;
  --danger-bg: #fdecec; --danger: #a4161a; --warn-bg: #fff4d6; --warn: #7a4b00;
  --ok-bg: #e7f6ec; --ok: #12632f; --info-bg: #e9effd; --info: #1d3f9e;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317; --surface: #1b1e24; --text: #eceff4; --muted: #a7afbd; --border: #343a45;
    --accent: #8fb0ff; --accent-text: #0d1220; --focus: #8fb0ff;
    --danger-bg: #3a1618; --danger: #ffb3b5; --warn-bg: #3a2c0c; --warn: #ffd88a;
    --ok-bg: #12301d; --ok: #9fe2b3; --info-bg: #172443; --info: #b9cbff;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: var(--surface); padding: 8px 12px; z-index: 10; }
header.top { background: var(--surface); border-bottom: 1px solid var(--border); }
.top-inner { max-width: 1080px; margin: 0 auto; padding: 12px 20px; display: flex; gap: 12px;
  align-items: center; justify-content: space-between; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.who { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: .9rem; flex-wrap: wrap; }
main { max-width: 1080px; margin: 0 auto; padding: 24px 20px 64px; }
main.narrow { max-width: 440px; padding-top: 48px; }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 8px; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
h3 { font-size: 1rem; margin: 0 0 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 20px; margin-bottom: 16px; }
.banner { border-radius: 8px; padding: 12px 14px; margin-bottom: 16px; border: 1px solid transparent; }
.banner.err { background: var(--danger-bg); color: var(--danger); border-color: currentColor; }
.banner.ok { background: var(--ok-bg); color: var(--ok); border-color: currentColor; }
.banner.info { background: var(--info-bg); color: var(--info); border-color: currentColor; }
.banner.warn { background: var(--warn-bg); color: var(--warn); border-color: currentColor; }
label { display: block; font-weight: 600; margin: 14px 0 6px; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: .9rem; margin-top: 2px; }
input[type=text], input[type=password], input[type=email], input[type=date], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
textarea { min-height: 140px; resize: vertical; }
.pw { display: flex; gap: 8px; }
.pw input { flex: 1; }
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  padding: 10px 18px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text); text-decoration: none; }
button.secondary, .button.secondary { background: transparent; color: var(--accent); }
button.link { background: none; border: none; color: var(--accent); padding: 0 4px; min-height: auto; text-decoration: underline; }
button:disabled { opacity: .55; cursor: not-allowed; }
.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 18px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0 24px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.stat .n { font-size: 1.8rem; font-weight: 700; line-height: 1.1; }
.stat .l { color: var(--muted); font-size: .9rem; }
.stat.alert { border-color: var(--danger); }
.list { list-style: none; margin: 0; padding: 0; }
.row { display: grid; grid-template-columns: 1.1fr 2fr 1.3fr 1.2fr; gap: 12px; align-items: center;
  padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; }
.row a.ref { font-weight: 700; }
.row .sub { color: var(--muted); font-size: .9rem; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .85rem; font-weight: 600; border: 1px solid currentColor; }
.pill.danger { background: var(--danger-bg); color: var(--danger); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.neutral { color: var(--muted); }
.steps { counter-reset: step; }
.step h2 { display: flex; gap: 10px; align-items: center; }
.step h2::before { counter-increment: step; content: counter(step); display: inline-flex; width: 28px; height: 28px;
  border-radius: 50%; align-items: center; justify-content: center; font-size: .9rem; border: 2px solid var(--accent); color: var(--accent); }
.step.done h2::before { content: "\2713"; background: var(--accent); color: var(--accent-text); }
.facts { width: 100%; border-collapse: collapse; }
.facts th, .facts td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.facts th { font-weight: 600; }
.quote { border-left: 3px solid var(--border); padding: 4px 12px; color: var(--muted); font-style: italic; margin: 0; white-space: pre-wrap; }
.choice { display: block; border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin-bottom: 8px; font-weight: 400; cursor: pointer; }
.choice input { margin-right: 8px; transform: scale(1.2); }
.choice strong { font-weight: 700; }
.choice.inline { display: inline-flex; align-items: center; min-width: 96px; margin-right: 8px; }
fieldset.question { border: 0; border-top: 1px solid var(--border); padding: 12px 0 4px; margin: 0; }
fieldset.question legend { font-weight: 600; padding: 0; margin-bottom: 8px; float: left; width: 100%; }
fieldset.question legend + * { clear: both; }
.banner .note { margin: 8px 0 0; font-size: .9rem; }
.choice.disabled { opacity: .6; cursor: not-allowed; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 5px; transform: scale(1.2); }
.meaning { background: var(--info-bg); color: var(--info); border-radius: 8px; padding: 12px 14px; margin-top: 12px; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }
details summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.audit { width: 100%; border-collapse: collapse; font-size: .9rem; }
.audit th, .audit td { text-align: left; padding: 8px; border-bottom: 1px solid var(--border); }
code { font-family: ui-monospace, Consolas, monospace; font-size: .85em; }
footer.foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 24px; }
.empty { text-align: center; padding: 40px 20px; }
.actions.head { justify-content: space-between; margin-top: 0; }
dl.kv.spaced { margin-top: 12px; }
.scroll { overflow-x: auto; }
fieldset.plain { border: 0; padding: 0; margin: 0; }
legend.legend { margin-bottom: 8px; padding: 0; }
ol.path { margin: 8px 0 0; }
ul.req { margin: 6px 0 0; padding-left: 20px; color: var(--muted); font-size: .9rem; }
@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .row { grid-template-columns: 1fr; gap: 4px; }
  dl.kv { grid-template-columns: 1fr; }
  dl.kv dd { margin-bottom: 8px; }
  .audit .hash { display: none; }
  h1 { font-size: 1.35rem; }
}
