:root {
  --bg: #f3f0e8;
  --ink: #17211b;
  --muted: #3e4a42;
  --line: #ddd6c8;
  --card: #fffdf8;
  --lime: #d6f25c;
  --lime-ink: #142200;
  --cloud: #0b6e99;
  --focus: #0b6e99;
  --bad: #8d2b2b;
  --good: #17693a;
  --code: #10241c;
  --code-ink: #e5f6df;
  --shadow: 0 1px 0 rgba(23, 33, 27, 0.04);
  --sans: "Segoe UI", "Liberation Sans", "Noto Sans", sans-serif;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101411;
    --ink: #e7f0e6;
    --muted: #b7c4bb;
    --line: #2c3830;
    --card: #18201b;
    --cloud: #9ad7f7;
    --focus: #9ad7f7;
    --bad: #ffb4b0;
    --good: #9ee6b8;
    --code: #0c1c16;
    --code-ink: #dff6d6;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100%;
  background-color: var(--bg);
  background-image: radial-gradient(ellipse at top left, color-mix(in srgb, var(--lime) 22%, transparent), transparent 46%);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  border-top: 6px solid var(--lime);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

::selection { background: var(--lime); color: var(--lime-ink); }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 5;
  background: var(--lime);
  color: var(--lime-ink);
  padding: 8px 12px;
  border-radius: 8px;
}
.skip:focus { top: 12px; }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

a { color: var(--cloud); text-underline-offset: 3px; overflow-wrap: anywhere; }
a:hover { text-decoration-thickness: 2px; }
p, li, td, code { overflow-wrap: anywhere; }

.wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 80px;
}

.mast {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 28px 32px;
  align-items: start;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}
.facts li {
  margin: 0;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--card) 80%, transparent);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.02em; }

h1 {
  margin: 0;
  max-width: 11em;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 0.98;
}

.lede {
  max-width: 38em;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.row, .filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.row { margin-top: 18px; }

.filters {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 28px 0 18px;
  padding: 10px 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
}

button, .btn, input, textarea {
  font: inherit;
  color: inherit;
}

button, .btn {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  padding: 8px 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
}
button:hover, .btn:hover { border-color: var(--ink); }
button:disabled { opacity: 0.55; cursor: default; }

.btn.primary, .chip[aria-pressed="true"] {
  background: var(--lime);
  color: var(--lime-ink);
  border-color: transparent;
  font-weight: 650;
}

.file { position: relative; display: inline-flex; align-items: center; }
.file input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 12px; }
.card h2 {
  margin: 0;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hint, .progress-note, .empty, .cwd, footer, .step-kicker {
  color: var(--muted);
}
.hint, .progress-note { margin: 8px 0 12px; font-size: 0.92rem; }

.bar {
  height: 10px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--ink) 10%, transparent);
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--lime);
}

.progress-label {
  margin: 10px 0 0;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 1.35rem;
}

#jump { width: 100%; margin-top: 12px; }

.field { display: block; }
input[type="text"], textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  padding: 10px 12px;
}
textarea { min-height: 88px; resize: vertical; }

#id-out { min-height: 3.2em; margin: 10px 0 0; font-size: 0.95rem; }
#id-out.is-good { color: var(--good); }
#id-out.is-bad { color: var(--bad); }
#id-out strong { color: var(--ink); font-weight: 700; }
.safe-id {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}
.file:focus-within,
.btn.primary:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

#notice {
  min-height: 1.4em;
  margin: 8px 0 0;
  font-size: 0.92rem;
}

.phase { margin: 0 0 28px; }
.phase > h2 { margin: 0 0 6px; font-size: clamp(1.6rem, 3vw, 2rem); }
.phase-lede { margin: 0 0 14px; color: var(--muted); max-width: 42em; }

.step {
  margin: 0 0 12px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.step.is-next { border-color: var(--lime); box-shadow: inset 3px 0 0 var(--lime); }
.step.is-done { background: color-mix(in srgb, var(--lime) 12%, var(--card)); }

.step-top { display: flex; gap: 10px; align-items: flex-start; }
.step h3 { margin: 0; font-size: 1.35rem; line-height: 1.2; }
.step-kicker {
  margin: 0 0 2px;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.step.is-next .step-kicker::after { content: " · next"; color: var(--ink); }
.step-body { margin: 10px 0 0 54px; }
.step-body p { margin: 0 0 10px; }
.step-body ol { margin: 0 0 10px; padding-left: 1.2rem; }
.step-body li + li { margin-top: 4px; }

.tick {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
}
.tick input {
  appearance: none;
  width: 22px;
  height: 22px;
  margin: 0;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}
.tick input:checked {
  border-color: var(--lime-ink);
  background-color: var(--lime);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M3 8.5 6.2 12 13 4' fill='none' stroke='%23142200' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px;
}

.cwd {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 0.82rem;
}
.cwd span {
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  padding: 2px 8px;
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.code { position: relative; margin: 0 0 12px; max-width: 100%; }
.copy {
  position: absolute;
  top: 8px;
  right: 8px;
  min-height: 32px;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--lime);
  color: var(--lime-ink);
  border: 0;
  font-size: 0.82rem;
  font-weight: 700;
}
pre {
  margin: 0;
  padding: 14px 84px 14px 14px;
  overflow: auto;
  border-radius: 12px;
  background: var(--code);
  color: var(--code-ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
code { font-family: var(--mono); font-size: 0.86rem; }

.tools h2 { margin: 0 0 8px; font-size: clamp(1.6rem, 3vw, 2rem); }
.tool-block { margin: 0 0 22px; }
.tool-block h3 { margin: 0 0 8px; font-size: 1.25rem; }

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
}
th, td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: anywhere;
}
th { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
td:first-child, th:first-child { font-family: var(--mono); font-size: 0.86rem; }

.faults { list-style: none; margin: 12px 0 0; padding: 0; }
.fault {
  margin: 0 0 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}
.fault h3 { margin: 0 0 4px; font-family: var(--mono); font-size: 0.95rem; }
.fault p { margin: 0; }
.fault.is-hit { border-color: var(--lime); box-shadow: inset 3px 0 0 var(--lime); }

footer {
  margin-top: 12px;
  font-size: 0.92rem;
}
footer p { margin: 0 0 8px; max-width: 46em; }

@media (max-width: 800px) {
  .wrap { width: min(100% - 28px, 1120px); padding-top: 22px; }
  .mast { grid-template-columns: 1fr; }
  .step-body { margin-left: 0; }
  h1 { max-width: none; }
  .copy { position: static; display: inline-flex; margin: 0 0 8px; }
  pre { padding: 12px; }
  .code { display: flex; flex-direction: column; }
}

@media (max-width: 375px) {
  body { font-size: 16px; }
  .facts li { letter-spacing: 0.03em; }
}
