:root {
  --paper: #f4f0e6;
  --ink: #1c2430;
  --green: #1e4d3a;
  --green-2: #16382b;
  --line: #e2dacb;
  --gold: #8a6a32;
  --miss: #8d3b32;
  --hit: #1f6b45;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.5 "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
}
.top, footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
}
.top { background: var(--green); color: #f6f3ec; }
.brand { color: inherit; text-decoration: none; font-weight: 700; letter-spacing: 0.01em; }
.brand span { font-weight: 500; opacity: 0.85; }
nav { display: flex; gap: 1rem; align-items: center; }
nav a, button.link { color: #f6f3ec; }
button.link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-decoration: underline; }
main { width: min(1080px, calc(100% - 2rem)); margin: 1.5rem auto 2rem; flex: 1; }
footer { color: #5c6570; justify-content: center; border-top: 1px solid var(--line); }
.card {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.25rem 1.35rem 1.4rem;
}
.wide { overflow: hidden; }
.layout { display: grid; grid-template-columns: 1fr 240px; gap: 1rem; align-items: start; }
.slim h2 { margin-top: 0; font-size: 1rem; }
h1 { font-size: 1.8rem; line-height: 1.2; margin: 0.2rem 0 0.6rem; }
.eyebrow { margin: 0; color: var(--gold); font-variant: small-caps; letter-spacing: 0.06em; }
.lead { margin-top: 0; }
label, fieldset { display: block; margin: 0.9rem 0; }
legend { font-weight: 700; padding: 0; }
input {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid #cfc6b6;
  border-radius: 8px;
  font: inherit;
  background: white;
}
.hint { display: block; margin-top: 0.3rem; color: #5c6570; font-size: 0.92rem; }
button, .button {
  display: inline-block;
  background: var(--green);
  color: #f6f3ec;
  border: 0;
  border-radius: 8px;
  padding: 0.6rem 0.95rem;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
button.ghost { background: transparent; color: var(--green-2); border: 1px solid #cfc6b6; }
.choices { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.member-row { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; margin-bottom: 0.45rem; }
.member-row input { margin-top: 0; }
.error { background: #fdeceb; color: var(--miss); padding: 0.55rem 0.7rem; border-radius: 8px; }
ol.code {
  list-style: none;
  counter-reset: line;
  margin: 1rem 0;
  padding: 0.75rem 0;
  background: #0d1117;
  color: #e6edf3;
  border-radius: 10px;
  overflow-x: auto;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.92rem;
  line-height: 1.55;
}
.tok-kw { color: #ff7b72; }
.tok-str { color: #a5d6ff; }
.tok-num { color: #d2a8ff; }
.tok-cmt { color: #8b949e; }
ol.code li {
  counter-increment: line;
  display: grid;
  grid-template-columns: 2.6rem 1fr;
  padding-right: 1rem;
}
ol.code li::before {
  content: counter(line);
  color: #9aa4b2;
  text-align: right;
  padding-right: 0.75rem;
}
ol.code code { white-space: pre; }
ol.code li.hit { background: rgba(63, 185, 80, 0.28); }
ol.code li.missed { background: rgba(248, 81, 73, 0.28); }
ol.code li.fixed { background: rgba(63, 185, 80, 0.22); box-shadow: inset 3px 0 #3fb950; }
h2 { font-size: 1.15rem; margin: 1.2rem 0 0.2rem; }
.points { font-size: 1.6rem; margin: 0.2rem 0; color: var(--green); }
.result { margin-top: 0.5rem; }
details { margin-top: 1rem; }
ol.nav { list-style: none; padding: 0; margin: 0; }
ol.nav a {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
ol.nav a[aria-current="page"] { font-weight: 700; color: var(--green); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.55rem 0.4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase; color: #5c6570; }
form.inline { margin: 0; }
@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
}
