:root {
  color-scheme: light;
  --bg: #f7f8f5;
  --surface: #ffffff;
  --surface-2: #eef2ee;
  --text: #172622;
  --text-2: #43534d;
  --border: #d6ddd8;
  --border-strong: #6b7b74;
  --accent: #155d4b;
  --accent-ink: #ffffff;
  --accent-soft: #e1eee8;
  --ok: #1a5e3a;
  --ok-soft: #e3f2e8;
  --ng: #962b25;
  --ng-soft: #f8e5e3;
  --warn: #7a5300;
  --warn-soft: #fbf1dc;
  --focus: #0b63ce;
  --shadow: 0 16px 40px #1726220d;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  --body: system-ui, -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111c19;
  --surface: #172521;
  --surface-2: #1e2e29;
  --text: #f4f6ef;
  --text-2: #b9c6c0;
  --border: #2f403a;
  --border-strong: #7a8e86;
  --accent: #6ccfae;
  --accent-ink: #0d1a16;
  --accent-soft: #1d3a31;
  --ok: #7ad69c;
  --ok-soft: #173a2a;
  --ng: #ff8f85;
  --ng-soft: #3f201e;
  --warn: #e8c26a;
  --warn-soft: #3a2e10;
  --focus: #8ab8ff;
  --shadow: 0 16px 40px #060c0a66;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) { color-scheme: dark; }
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-inline-size: 0; }
body { margin: 0; background: var(--bg); color: var(--text); font: 1rem/1.7 var(--body); }
main { width: min(100% - 48px, 760px); min-height: 56vh; margin: 0 auto; padding: 48px 0 64px; }
section, article, details, .row, .field, .stack { min-inline-size: 0; }
h1, h2, h3, p, figure, dl, ol, ul { margin: 0; }
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 750; letter-spacing: -.045em; line-height: 1.24; }
h2 { font-size: clamp(1.25rem, 2.6vw, 1.55rem); line-height: 1.4; letter-spacing: -.025em; }
h3 { font-size: 1.0625rem; line-height: 1.45; }
p, dd, .question, .choice, .status, td { overflow-wrap: anywhere; }
a { color: var(--accent); text-underline-offset: .22em; }
button, input, textarea, select { font: inherit; color: inherit; }
button, input, select, textarea { min-height: 44px; }
button { border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); cursor: pointer; }
button:disabled { cursor: default; opacity: .62; }
button:hover:not(:disabled) { background: var(--surface-2); }
button, .choice, .unit-link { transition: background-color .14s ease, border-color .14s ease, transform .14s ease; }
button:active:not(:disabled) { transform: translateY(1px); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
input, textarea, select { width: 100%; min-inline-size: 0; border: 1px solid var(--border-strong); border-radius: 8px; padding: 8px 12px; background: var(--surface); }
input::placeholder, textarea::placeholder { color: var(--text-2); opacity: 1; }
textarea { min-height: 104px; resize: vertical; }
input[type="checkbox"] { width: 20px; min-height: 20px; accent-color: var(--accent); padding: 0; }
svg { display: block; max-width: 100%; }
.topbar { background: var(--surface); }
.topbar-inner, .tabs, .site-footer { width: min(100% - 48px, 1008px); margin: auto; }
.topbar-inner { height: 80px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.brand, .header-actions, .row { display: flex; align-items: center; }
.brand { gap: 12px; white-space: nowrap; }
.brand-mark { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 12px; background: var(--accent); color: var(--accent-ink); }
.brand svg, .header-actions svg, .tabs svg, .unit-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.brand-title { font-weight: 760; font-size: 1.0625rem; line-height: 1.25; letter-spacing: .015em; }
.brand-sub { color: var(--text-2); font-size: .8125rem; margin-top: 3px; line-height: 1.35; }
.unofficial { align-self: center; background: var(--surface-2); color: var(--text-2); border-radius: 6px; padding: 3px 8px; font-size: .75rem; font-weight: 650; }
.header-actions { gap: 4px; }
.icon-button { display: grid; width: 44px; place-items: center; padding: 0; border-color: transparent; background: transparent; color: var(--text-2); }
.icon-button[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
.nav { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 760px; }
.tabs button { display: flex; justify-content: center; align-items: center; gap: 8px; min-width: 0; min-height: 56px; padding: 8px 4px; border: 0; border-radius: 0; border-bottom: 3px solid transparent; border-top: 3px solid transparent; background: transparent; font-weight: 670; color: var(--text-2); white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.tabs svg { width: 19px; height: 19px; }
.site-footer { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--border); padding: 24px 0 32px; color: var(--text-2); font-size: .8125rem; }
.skip { position: absolute; left: 16px; top: 16px; transform: translateY(-180%); background: var(--surface); z-index: 4; padding: 8px 16px; }
.skip:focus { transform: none; }
.stack { display: grid; gap: 16px; }
.stack-sm { gap: 8px; }
.stack-lg { gap: 24px; }
.row { gap: 8px; flex-wrap: wrap; }
.row-spread { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.page-head { display: grid; gap: 8px; margin-bottom: 24px; }
.page-head p, .muted, .caption, .source, .field-note { color: var(--text-2); }
.caption, .field-note { font-size: .875rem; }
.source { font-size: .8125rem; }
.mono, kbd, .metric-value { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.card { border: 1px solid var(--border); background: var(--surface); border-radius: 16px; padding: 24px; }
.hero { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 32px; box-shadow: var(--shadow); }
.hero-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(144px, 216px); align-items: center; gap: 24px; }
.hero h1 { margin: 8px 0 12px; }
.hero-art { width: 100%; height: auto; color: var(--accent); }
.eyebrow { color: var(--accent); font-weight: 700; font-size: .875rem; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--border); padding-top: 16px; margin: 24px 0 16px; }
.metric { padding: 0 16px; border-inline-start: 1px solid var(--border); }
.metric:first-child { padding-inline-start: 0; border: 0; }
.metric-value { display: inline-block; font-size: clamp(1.6rem, 4vw, 2.15rem); line-height: 1.25; font-weight: 700; letter-spacing: -.035em; }
.metric-label { font-size: .875rem; color: var(--text-2); padding-inline-start: 6px; }
.conditions { display: grid; gap: 4px; padding: 12px 16px; background: var(--surface-2); color: var(--text-2); border-radius: 8px; font-size: .875rem; }
.hero-actions { margin-top: 16px; }
.topic-grid, .unit-grid, .split { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.topic-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.topic { padding: 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.topic h3 { margin-bottom: 4px; }
.button, .actions a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 16px; border-radius: 10px; white-space: normal; text-align: center; font-weight: 670; }
.actions a { border: 1px solid var(--border-strong); text-decoration: none; background: var(--surface); }
.button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.button.primary:hover:not(:disabled) { background: var(--accent); box-shadow: inset 0 0 0 2px var(--accent-ink); }
.button.subtle { border-color: transparent; color: var(--accent); }
.button[aria-pressed="true"], .choice[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.pill { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); font-size: .8125rem; font-weight: 670; }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.ng { background: var(--ng-soft); color: var(--ng); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.unit-link { display: grid; align-items: start; grid-template-columns: 36px minmax(0, 1fr); text-align: left; gap: 8px; padding: 12px; }
.unit-link strong, .unit-link small { display: block; }
.unit-link small { color: var(--text-2); font-size: .8125rem; }
.unit-icon { display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); width: 32px; height: 32px; border-radius: 8px; }
.unit-icon svg { width: 17px; height: 17px; }
.question-card { display: grid; gap: 16px; }
.question { font-size: clamp(1.05rem, 2.6vw, 1.2rem); font-weight: 700; }
.question-count { font-family: var(--mono); font-weight: 700; }
.timer { color: var(--text); background: var(--surface); border: 1px solid var(--border); font: 700 1rem/1.5 var(--mono); border-radius: 8px; padding: 4px 12px; }
.timer.warn { color: var(--warn); background: var(--warn-soft); }
.meter { width: 100%; height: 8px; overflow: hidden; color: var(--accent); display: block; }
.meter rect:first-child { fill: var(--surface-2); }
.meter rect:last-child { fill: currentColor; }
.choice-group { display: grid; gap: 8px; }
.choice-group.compact { display: flex; flex-wrap: wrap; }
.choice { display: flex; min-width: 0; align-items: center; text-align: start; gap: 10px; padding: 8px 12px; }
.choice .letter { min-width: 24px; text-align: center; border-radius: 5px; background: var(--surface-2); font: .875rem/1.6 var(--mono); }
.choice[aria-pressed="true"] .letter { background: var(--accent); color: var(--accent-ink); }
.compact .choice { min-width: 44px; justify-content: center; }
.fields { display: grid; gap: 12px; }
.fields.paired { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { display: grid; gap: 4px; align-content: start; }
.field > label, .field-name { font-weight: 650; font-size: .875rem; }
.jumps { display: flex; flex-wrap: wrap; gap: 8px; }
.jump { min-width: 44px; padding: 4px; font-family: var(--mono); }
.jump[data-done="true"] { background: var(--accent-soft); color: var(--accent); }
.jump[aria-current="step"] { border: 2px solid var(--accent); }
.status { border-radius: 10px; background: var(--surface-2); color: var(--text); padding: 12px 16px; }
.status.ok { background: var(--ok-soft); color: var(--ok); }
.status.ng { background: var(--ng-soft); color: var(--ng); }
.status.warn { background: var(--warn-soft); color: var(--warn); }
.status strong { display: block; margin-bottom: 4px; }
.status a { color: inherit; }
.steps { padding-inline-start: 24px; display: grid; gap: 6px; }
.bits { display: flex; flex-wrap: wrap; column-gap: 8px; row-gap: 4px; font: 700 clamp(.75rem, 2.55vw, 1rem)/1.8 var(--mono); font-variant-numeric: tabular-nums; }
.bits span { display: inline-flex; padding: 0 3px; border-radius: 4px; background: var(--surface-2); white-space: nowrap; }
.bits b { color: var(--accent); background: var(--accent-soft); }
.diagram-wrap { border-radius: 12px; background: var(--surface-2); padding: 8px; }
.diagram-wrap svg { width: min(100%, 456px); height: auto; margin: 0 auto; }
.graph-edge { stroke: var(--border-strong); stroke-width: 2.2; }
.graph-node { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1.7; }
.graph-node.active { fill: var(--accent); stroke: var(--accent); }
.graph-node.target, .graph-node.complete { fill: var(--accent-soft); stroke: var(--accent); }
.graph-text { fill: var(--text); font: 700 16px var(--mono); dominant-baseline: central; text-anchor: middle; }
.graph-text.inverted { fill: var(--accent-ink); }
.edge-label { paint-order: stroke fill; stroke: var(--surface-2); stroke-width: 6px; }
.graph-caption { margin-top: 4px; text-align: center; }
.ntp-arrow { stroke: var(--accent); fill: none; stroke-width: 2.3; }
.ntp-line { stroke: var(--border-strong); stroke-dasharray: 4 4; }
.tls-steps { display: grid; gap: 8px; padding: 0; list-style: none; }
.tls-step { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 8px; align-items: start; padding: 8px 12px; border-radius: 8px; background: var(--surface-2); }
.tls-step.handshake { background: var(--accent-soft); }
.tls-dot { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); }
.result-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.score { font: 750 clamp(2.75rem, 8vw, 4rem)/1.1 var(--mono); letter-spacing: -.08em; }
.grade-tag { display: grid; width: 64px; height: 64px; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); border-radius: 16px; font: 750 2rem var(--mono); }
.skill-row { display: grid; grid-template-columns: minmax(0, 1fr) 3rem; gap: 4px 12px; align-items: center; }
.skill-row .meter { grid-column: 1 / -1; }
.skill-count { text-align: right; }
.table-wrap { max-width: 100%; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { padding: 8px 12px; text-align: start; border-bottom: 1px solid var(--border); }
th { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
tr.is-me { background: var(--accent-soft); color: var(--text); font-weight: 670; }
.short-name { max-width: 12ch; }
details.disclosure { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
details.disclosure > summary { padding: 12px 16px; min-height: 44px; cursor: pointer; font-weight: 670; }
details.disclosure > .details-body { padding: 0 16px 16px; }
dl.notes { display: grid; gap: 8px; }
.notes div { padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.notes div:last-child { border: 0; padding-bottom: 0; }
dt { font-weight: 700; }
dd { margin: 0; color: var(--text-2); }
.check-item { display: flex; gap: 10px; min-height: 44px; align-items: center; }
.check-item input { flex: none; }
dialog { width: min(100% - 32px, 480px); max-height: calc(100% - 32px); overflow: auto; padding: 24px; border: 1px solid var(--border-strong); border-radius: 16px; box-shadow: var(--shadow); background: var(--surface); color: var(--text); }
dialog::backdrop { background: #0d1a168c; }
kbd { display: inline-block; padding: 0 5px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; white-space: nowrap; }
.toast { position: fixed; right: 16px; bottom: 16px; width: min(100% - 32px, 340px); padding: 12px 16px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); z-index: 4; }
#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }
.sr-only { clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; position: absolute; white-space: nowrap; }
:root[data-motion="reduced"] *, :root[data-motion="reduced"] *::before, :root[data-motion="reduced"] *::after { transition: none !important; animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media (max-width: 560px) {
  main { width: calc(100% - 32px); padding: 32px 0 48px; }
  .topbar-inner, .tabs, .site-footer { width: calc(100% - 32px); }
  .topbar-inner { width: calc(100% - 16px); height: 64px; gap: 4px; }
  .brand { gap: 8px; }
  .brand-mark { width: 32px; height: 32px; border-radius: 8px; }
  .brand-mark svg { width: 19px; height: 19px; }
  .brand-title { font-size: .9375rem; }
  .brand-sub { font-size: .75rem; }
  .unofficial { align-self: flex-start; padding: 0 4px; font-size: .6875rem; }
  .header-actions { gap: 0; }
  .header-actions svg { width: 19px; height: 19px; }
  .tabs { width: 100%; }
  .tabs button { min-height: 56px; flex-direction: column; gap: 2px; font-size: .8125rem; }
  .tabs svg { width: 16px; height: 16px; }
  .hero { padding: 20px; border-radius: 16px; }
  .hero-top { grid-template-columns: 1fr; gap: 0; }
  .hero-art { display: none; }
  .card { padding: 16px; }
  .metrics { margin: 16px 0; }
  .metric-label { display: block; padding-inline-start: 0; white-space: nowrap; }
  .topic-grid { grid-template-columns: 1fr; }
  .topic { padding: 12px 16px; }
  .site-footer { flex-direction: column; gap: 0; }
  .table-wrap th, .table-wrap td { padding-inline: 8px; }
}
@media (max-width: 420px) {
  .fields.paired { grid-template-columns: 1fr; }
}
@media (max-width: 360px) {
  .unofficial { display: none; }
  .split, .unit-grid { grid-template-columns: 1fr; }
  .metric { padding-inline: 8px; }
}
@media print {
  body { background: white; color: black; }
  .topbar, .nav, .site-footer, button, #fx, dialog, #toast, .skip { display: none !important; }
  main { width: 100%; margin: 0; padding: 0; }
  .card { break-inside: avoid; }
}
