:root {
  --surface: #FFFDF8;
  --surface-2: #F5EFE4;
  --canvas: #F2EADD;
  --ink: #182531;
  --ink-soft: #5A6470;
  --border: #D9CCB7;
  --border-strong: #C2B195;
  --highlight: #E9BC6D;
  --navy: #162533;
  --ok: #15803D;
  --warn: #D97706;
  font-family: "Hanken Grotesk", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  font-size: 18px;
  color: var(--ink);
  background: var(--canvas);
  line-height: 1.65;
}
* { box-sizing: border-box; }
body { margin: 0; overflow-wrap: anywhere; }
header, footer { width: min(100%, 50rem); margin: 0 auto; padding: 1rem 1.5rem; }
header a { font-weight: 750; text-decoration: none; letter-spacing: -.02em; }
footer { font-size: .9rem; }
a { color: var(--navy); text-underline-offset: .2em; }
header a, footer a { display: inline-flex; align-items: center; min-height: 44px; }
main { max-width: 50rem; margin: 0 auto; padding: clamp(1.25rem, 5vw, 3rem); background: var(--surface); border: 1px solid var(--border); }
h1, h2, legend { color: var(--navy); line-height: 1.22; text-wrap: pretty; }
h1 { font-size: clamp(1.9rem, 5vw, 2.65rem); letter-spacing: -.035em; margin: 0 0 1rem; }
h2 { font-size: 1.4rem; letter-spacing: -.02em; margin: 2rem 0 1rem; }
p { margin: .65rem 0 1rem; white-space: pre-line; }
.lead { font-size: 1.1rem; margin-bottom: 1.75rem; }
form > label { display: block; font-weight: 650; margin-top: 1.3rem; }
input[type="text"], textarea { display: block; width: 100%; min-height: 48px; padding: .7rem .85rem; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 4px; }
textarea { min-height: 10rem; resize: vertical; line-height: 1.65; }
#story { min-height: 16rem; }
#code { max-width: 18rem; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--navy); width: 24px; height: 24px; flex: 0 0 24px; margin: .2rem 0; }
.checkbox { display: flex; align-items: flex-start; gap: .85rem; font-weight: 400; min-height: 44px; cursor: pointer; font-size: .9rem; }
.hint, .source, .draft-label { color: var(--ink-soft); font-size: .9rem; }
.hint { margin-top: .45rem; }
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .7rem 1.1rem; border: 1px solid var(--border-strong); border-radius: 4px; color: var(--navy); background: var(--surface-2); font: inherit; font-weight: 650; line-height: 1.35; text-align: center; text-decoration: none; cursor: pointer; }
form > button { margin-top: 1.5rem; }
.primary { background: var(--highlight); border-color: var(--border-strong); }
button:hover, .button:hover { border-color: var(--navy); }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 4px; }
.message { padding: 1rem; border-left: 4px solid var(--warn); background: var(--surface-2); }
.confirmation { color: var(--ok); }
.focus { padding: .1rem 1.25rem; border-left: 4px solid var(--highlight); margin-bottom: 2rem; }
.focus h2 { margin-top: 1rem; }
.decision { margin: 2rem 0; padding: 1rem 1.2rem 1.2rem; border: 1px solid var(--border-strong); border-radius: 4px; min-width: 0; }
legend { float: left; width: 100%; max-width: 100%; padding: 0; margin: 0 0 .85rem; font-size: 1.3rem; font-weight: 700; }
.decision > legend + p { clear: both; }
.option { display: flex; align-items: flex-start; gap: .8rem; padding: 1rem; margin: .7rem 0; border: 1px solid var(--border); border-radius: 4px; min-height: 68px; cursor: pointer; }
.option:has(input:checked) { background: var(--surface-2); border: 2px solid var(--navy); padding: calc(1rem - 1px); box-shadow: inset 5px 0 var(--highlight); }
.example { display: block; margin-top: .3rem; font-size: .95rem; }
.other-option > label.hint { display: block; }
.other-option > input { margin-bottom: 1rem; }
.source { padding-left: 1rem; border-left: 2px solid var(--border); }
.small-action { margin-top: 1.5rem; }
.small-action button { font-size: .9rem; }
.statements { padding-left: 2rem; }
.statements li { padding-left: .5rem; margin: 1rem 0; white-space: pre-line; }
.statements li::marker { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: .85em; color: var(--ink-soft); }
.working { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; color: var(--ink-soft); }
.working output { font-variant-numeric: tabular-nums; }
.pulse { width: .55rem; height: .55rem; border-radius: 50%; background: var(--navy); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }
.rules { padding-left: 1.6rem; }
.rules > li { padding-left: .4rem; margin-bottom: 2rem; }
.rules p { margin: .45rem 0; }
.rules > li > :last-child { margin-bottom: 0; }
.rule-text { font-weight: 650; }
.waiting { border-left: 4px solid var(--warn); padding-left: 1.25rem; }
.check { padding: 1rem 1.2rem; border: 1px solid var(--border); margin: 1rem 0; }
.check h3 { margin: 0 0 .85rem; font-size: 1.05rem; line-height: 1.4; }
.check h3 .hint { font-weight: 400; }
dl { margin: 0; }
dl > div { display: grid; grid-template-columns: 4rem minmax(0, 1fr); gap: .7rem; margin: .5rem 0; }
dt { font-weight: 700; }
dd { margin: 0; white-space: pre-line; }
summary { min-height: 44px; padding: .5rem 0; cursor: pointer; font-weight: 650; }
details { margin-top: 2rem; border-top: 1px solid var(--border); }
.draft-label { margin-top: 1.5rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-top: 1.75rem; }
.actions form, .actions button { margin: 0; }
.actions > a:not(.button) { display: inline-flex; align-items: center; min-height: 44px; }
@media (max-width: 420px) {
  header, footer { padding: .65rem 1rem; }
  main { border-left: 0; border-right: 0; }
  .decision { padding: .75rem; }
  .option { padding: .8rem; }
  .option:has(input:checked) { padding: calc(.8rem - 1px); }
  .actions > .button, .actions > button, form > .primary { width: 100%; }
}
@media print {
  @page { margin: 14mm; }
  :root { font-size: 10.5pt; line-height: 1.35; color: #000; background: #fff; }
  body, main { color: #000; background: #fff; }
  main { max-width: none; padding: 0; margin: 0; border: 0; }
  header, footer, .actions, form, button, .pulse { display: none !important; }
  h1 { font-size: 22pt; margin-bottom: .5rem; }
  h2 { font-size: 14pt; margin: 1.1rem 0 .5rem; break-after: avoid; }
  .check h3 { break-after: avoid; }
  p { margin: .4rem 0; }
  .lead { font-size: 12pt; margin-bottom: 1rem; }
  .source, .hint, .draft-label, a { color: #000; }
  .check, .decision, .rules > li, .waiting li { break-inside: avoid; }
  .check { margin: .5rem 0; padding: .6rem; }
  .rules > li { margin-bottom: .8rem; }
  .rules p { margin: .3rem 0; }
  .waiting { border-color: #000; }
  details:not([open]) { display: none; }
}
