@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/space-grotesk-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/space-grotesk-600.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/space-grotesk-700.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Cormorant Garamond";
  src: url("fonts/cormorant-garamond-600-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Outfit";
  src: url("fonts/outfit-500.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --background: hsl(233 33% 4%);
  --foreground: hsl(48 25% 97%);
  --card: hsl(235 25% 8%);
  --card-raised: hsl(235 22% 11%);
  --muted: hsl(235 12% 16%);
  --text-secondary: hsl(240 8% 68%);
  --border: hsl(235 12% 22%);
  --gold: hsl(43 55% 58%);
  --gold-light: hsl(43 65% 72%);
  --gold-deep: hsl(43 45% 38%);
  --success: hsl(146 40% 61%);
  --success-bg: hsl(146 35% 12%);
  --danger: hsl(7 78% 67%);
  --danger-bg: hsl(7 52% 13%);
  --focus: hsl(43 75% 70%);
  --radius: 0.5rem;
  --page: min(1180px, calc(100% - 2rem));
  --reading: min(1040px, calc(100% - 2rem));
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

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

html { scroll-behavior: smooth; }

body {
  min-width: 0;
  margin: 0;
  color: var(--foreground);
  background:
    radial-gradient(circle at 84% 8%, hsl(43 55% 58% / 8%), transparent 25rem),
    linear-gradient(hsl(43 55% 58% / 4%) 1px, transparent 1px) 0 0 / 64px 64px,
    linear-gradient(90deg, hsl(43 55% 58% / 4%) 1px, transparent 1px) 0 0 / 64px 64px,
    var(--background);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; }
button { touch-action: manipulation; }
a { color: var(--gold-light); text-underline-offset: 0.22em; }
a:hover { color: var(--foreground); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

::selection { color: var(--background); background: var(--gold-light); }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  min-height: 44px;
  padding: 0.6rem 1rem;
  color: var(--background);
  background: var(--gold-light);
  transform: translateY(-180%);
}

.skip-link:focus { transform: translateY(0); }

.masthead {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: var(--page);
  min-height: 78px;
  margin: 0 auto;
  border-bottom: 1px solid hsl(43 55% 58% / 22%);
}

.wordmark {
  display: inline-flex;
  gap: 0.8rem;
  align-items: center;
  min-height: 44px;
  color: var(--foreground);
  text-decoration: none;
}

.wordmark-mark, .footer-brand span {
  display: grid;
  place-items: center;
  width: 2.55rem;
  height: 2.55rem;
  border: 1px solid hsl(43 55% 58% / 55%);
  color: var(--gold);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.25rem;
  font-style: italic;
  font-weight: 600;
  line-height: 1;
}

.wordmark-copy { display: grid; line-height: 1.15; }
.wordmark-copy strong { font-size: 0.95rem; letter-spacing: -0.02em; }
.wordmark-copy small { margin-top: 0.24rem; color: var(--text-secondary); font-family: "Outfit", sans-serif; font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; }

.header-actions, .language-switch { display: flex; gap: 0.4rem; align-items: center; }
.repo-link { min-height: 44px; padding: 0.55rem 0.8rem; font-size: 0.84rem; }

.language-button {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
  font-family: "Outfit", sans-serif;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
}

.language-button:hover { color: var(--foreground); border-color: var(--border); }
.language-button.is-active { color: var(--background); border-color: var(--gold); background: var(--gold); }

main, footer { width: var(--reading); margin-inline: auto; }

.hero { padding: clamp(2rem, 4vw, 3.2rem) 0 clamp(1.5rem, 2.6vw, 2.2rem); }

.eyebrow, .step-kicker, .truth-label {
  margin: 0 0 0.75rem;
  color: var(--gold-light);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1rem;
  font-style: italic;
  font-weight: 600;
  letter-spacing: 0.055em;
}

h1, h2, h3, legend { line-height: 1.08; text-wrap: balance; }

h1 {
  max-width: 970px;
  margin: 0;
  font-size: clamp(3.6rem, 9.5vw, 6.7rem);
  font-weight: 600;
  letter-spacing: -0.065em;
}

.hero-copy {
  max-width: 800px;
  margin: 1.2rem 0 0;
  color: hsl(48 25% 97% / 84%);
  font-size: clamp(1.12rem, 2.2vw, 1.42rem);
  line-height: 1.58;
}

.manifesto-panel {
  min-width: 0;
  margin-top: clamp(2rem, 4vw, 3rem);
  padding: clamp(1.15rem, 2.5vw, 1.7rem);
  border: 1px solid hsl(43 55% 58% / 30%);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, hsl(43 55% 58% / 6%), transparent 58%),
    hsl(235 25% 7% / 94%);
}

.manifesto-topline { display: flex; gap: 1rem; align-items: center; justify-content: space-between; margin-bottom: 0.35rem; }
.manifesto-topline .eyebrow { margin: 0; }
.manifesto-heading { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: clamp(1.2rem, 4vw, 3.2rem); align-items: end; }
.manifesto-heading h2 { max-width: 620px; margin: 0; font-size: clamp(2.15rem, 4.4vw, 3.65rem); font-weight: 600; letter-spacing: -0.045em; }
.manifesto-intro { max-width: 670px; margin: 0; color: hsl(48 25% 97% / 82%); font-size: clamp(0.98rem, 1.7vw, 1.12rem); line-height: 1.58; }

.manifesto-rows { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-top: clamp(1.2rem, 2.5vw, 1.8rem); border: 1px solid var(--border); background: var(--border); }
.manifesto-rows details { min-width: 0; background: hsl(235 25% 8% / 94%); }
.manifesto-rows summary { display: grid; grid-template-columns: 1.7rem minmax(0, 1fr) auto; gap: 0.55rem; align-items: start; min-height: 72px; padding: 0.85rem; cursor: pointer; list-style: none; }
.manifesto-rows summary::-webkit-details-marker { display: none; }
.manifesto-rows summary > span { padding-top: 0.12rem; color: var(--gold); font-family: "Outfit", sans-serif; font-size: 0.7rem; letter-spacing: 0.1em; }
.manifesto-rows summary strong { font-size: clamp(0.94rem, 1.55vw, 1.06rem); line-height: 1.32; }
.manifesto-heading h2, .manifesto-rows summary strong { overflow-wrap: break-word; }
.details-icon::before { content: "+"; color: var(--gold); font-family: "Outfit", sans-serif; font-weight: 500; }
.manifesto-rows details[open] .details-icon::before { content: "−"; }
.manifesto-rows details > p { margin: 0; padding: 0 0.85rem 0.9rem 3.1rem; color: var(--text-secondary); font-size: 0.82rem; line-height: 1.5; }
.manifesto-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 0.82rem; font-weight: 600; }

.step-rail {
  position: sticky;
  z-index: 20;
  top: 0;
  margin: 0 calc(50% - 50vw) 2rem;
  padding-inline: max(1rem, calc((100vw - 1040px) / 2));
  border-block: 1px solid hsl(43 55% 58% / 20%);
  background: hsl(233 33% 4% / 90%);
  backdrop-filter: blur(18px) saturate(140%);
}

.step-rail ol {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
}

.step-rail li {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  min-height: 58px;
  padding-inline: 1rem;
  color: var(--text-secondary);
  border-right: 1px solid var(--border);
  font-size: 0.9rem;
}

.step-rail li:last-child { border-right: 0; }
.step-rail li > span:first-child { display: grid; flex: 0 0 1.8rem; place-items: center; width: 1.8rem; height: 1.8rem; border: 1px solid currentColor; border-radius: 50%; font-family: "Outfit", sans-serif; font-size: 0.7rem; }
.step-rail li.is-current { color: var(--foreground); font-weight: 600; }
.step-rail li.is-current > span:first-child { color: var(--background); border-color: var(--gold); background: var(--gold); }
.step-rail li.is-done { color: var(--success); }

.work-step, .boundary-note {
  position: relative;
  margin: 2rem 0 5rem;
  padding: clamp(1.35rem, 4vw, 3.2rem);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: hsl(235 25% 8% / 96%);
  box-shadow: 0 28px 80px hsl(233 33% 2% / 45%);
}

.work-step::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  border-radius: var(--radius) 0 0 var(--radius);
  background: linear-gradient(to bottom, transparent, var(--gold) 18%, hsl(43 55% 58% / 18%) 82%, transparent);
  content: "";
}

.step-heading {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
  padding-bottom: 1.6rem;
  border-bottom: 1px solid var(--border);
}

.step-number { color: var(--gold); font-family: "Outfit", sans-serif; font-size: 0.76rem; letter-spacing: 0.1em; }
.step-heading h2 { max-width: 850px; margin: 0; font-size: clamp(2.1rem, 5vw, 4rem); font-weight: 600; letter-spacing: -0.045em; }

.reader-thought {
  max-width: 850px;
  margin: 1.8rem 0 2.2rem;
  padding-left: 1.15rem;
  border-left: 2px solid var(--gold);
  color: hsl(48 25% 97% / 78%);
  font-size: 1.02rem;
}

.field-stack { display: grid; gap: 0.48rem; margin-block: 1.3rem; }
label { font-weight: 600; }
.field-help { margin: 0; color: var(--text-secondary); font-size: 0.92rem; }

textarea, input {
  width: 100%;
  border: 1px solid hsl(235 12% 31%);
  border-radius: calc(var(--radius) - 0.15rem);
  color: var(--foreground);
  background: hsl(233 30% 5%);
}

textarea { min-height: 7rem; padding: 1rem; line-height: 1.58; resize: vertical; }
input { min-height: 48px; padding: 0.7rem 0.85rem; }
textarea:hover, input:hover { border-color: hsl(43 55% 58% / 55%); }
textarea:focus, input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px hsl(43 55% 58% / 13%); }

.field-error { min-height: 1.5rem; margin: 0.2rem 0 0; color: var(--danger); font-weight: 600; }

.optional-values, .advanced-route {
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: hsl(235 12% 13% / 60%);
}

.optional-values { padding: 1rem; }
summary { cursor: pointer; }
.optional-values summary { min-height: 44px; padding: 0.55rem 0; font-weight: 600; }
.optional-values label { display: block; margin: 1rem 0 0.45rem; }

.primary-action, .secondary-action, .danger-action {
  min-height: 48px;
  padding: 0.75rem 1.15rem;
  border: 1px solid;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 700;
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.primary-action { color: var(--background); border-color: var(--gold); background: var(--gold); }
.primary-action:hover { color: var(--background); background: var(--gold-light); transform: translateY(-1px); }
.secondary-action { color: var(--foreground); border-color: var(--border); background: var(--muted); }
.secondary-action:hover { border-color: var(--gold); background: hsl(43 55% 58% / 10%); }
.danger-action { color: var(--danger); border-color: hsl(7 78% 67% / 60%); background: transparent; }
.danger-action:hover, .danger-action.is-armed { color: var(--foreground); background: var(--danger-bg); }
.action-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-top: 1.5rem; }

.prompt-explainer {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 1px;
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  background: var(--border);
}

.prompt-explainer > div { min-width: 0; padding: 1.35rem; background: var(--card-raised); }
.prompt-explainer p { margin: 0; color: var(--text-secondary); }
.prompt-explainer .truth-label { margin-bottom: 0.5rem; color: var(--gold-light); }

.protected-sheet h3 { margin: 0 0 0.8rem; font-size: 1rem; }
.protected-sheet ul { display: grid; gap: 0.45rem; margin: 0; padding: 0; list-style: none; }
.protected-sheet li { display: grid; grid-template-columns: minmax(5rem, auto) 1fr; gap: 0.7rem; align-items: baseline; overflow-wrap: anywhere; }
.value-type { color: var(--gold); font-family: "Outfit", sans-serif; font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; }

#prepared-prompt { margin-top: 0.5rem; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 0.82rem; background: hsl(233 33% 3%); }

.writer-choice {
  min-width: 0;
  margin: 2.4rem 0 1.25rem;
  padding: clamp(1.1rem, 3vw, 1.8rem);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: hsl(233 30% 5% / 82%);
}

.writer-choice h3 { max-width: 760px; margin: 0; font-size: clamp(1.65rem, 3.5vw, 2.45rem); letter-spacing: -0.03em; }
.writer-choice-intro { max-width: 760px; margin: 0.8rem 0 0; color: var(--text-secondary); }
.writer-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1.4rem; }
.writer-card { min-width: 0; padding: clamp(1rem, 2.4vw, 1.35rem); border: 1px solid var(--border); border-radius: var(--radius); background: var(--card-raised); overflow-wrap: anywhere; }
.writer-card-local { border-color: hsl(43 55% 58% / 44%); background: linear-gradient(135deg, hsl(43 55% 58% / 7%), transparent 72%), var(--card-raised); }
.writer-card-label { margin: 0; color: var(--gold); font-family: "Outfit", sans-serif; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; }
.writer-card h4 { margin: 0.5rem 0 0; font-size: 1.22rem; }
.writer-card > p:not(.writer-card-label) { margin: 0.75rem 0 0; color: var(--text-secondary); font-size: 0.92rem; }
.writer-card .writer-card-next { color: var(--foreground); font-weight: 600; }
.writer-card a { display: inline-flex; min-height: 44px; align-items: center; margin-top: 0.8rem; font-weight: 600; }

.handoff {
  margin: 1.25rem 0 2.5rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid hsl(43 55% 58% / 42%);
  border-radius: var(--radius);
  background:
    linear-gradient(120deg, hsl(43 55% 58% / 10%), transparent 55%),
    var(--card-raised);
}

.handoff h3 { margin: 0; font-size: clamp(1.5rem, 3vw, 2.2rem); }
.handoff ol { display: grid; gap: 0.65rem; margin: 1.25rem 0; padding-left: 1.35rem; }
.model-boundary { margin: 1.25rem 0 0; padding-top: 1.1rem; border-top: 1px solid var(--border); color: var(--text-secondary); font-size: 0.9rem; }

.advanced-route > summary {
  display: grid;
  min-height: 64px;
  padding: 1rem 1.2rem;
  list-style-position: inside;
}

.advanced-route > summary span { font-weight: 700; }
.advanced-route > summary small { margin: 0.35rem 0 0 1.25rem; color: var(--text-secondary); font-size: 0.85rem; }
.advanced-body { padding: 0 1.2rem 1.3rem; border-top: 1px solid var(--border); }
.advanced-body > p { max-width: 760px; color: var(--text-secondary); }

.envelope-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.envelope { min-width: 0; margin: 0; padding: 1.15rem; border: 1px solid var(--border); border-radius: var(--radius); }
.envelope legend { padding: 0.2rem 0.65rem; color: var(--gold-light); font-size: 1rem; font-weight: 600; }

.candidate-field { margin-top: 2.8rem; padding-top: 2rem; border-top: 1px solid var(--border); }

.results-step { border-color: hsl(43 55% 58% / 32%); }
.verdict { margin: 1.5rem 0; padding: 1rem 1.2rem; border: 1px solid; border-radius: var(--radius); font-weight: 700; }
.verdict-good { color: hsl(146 55% 78%); border-color: hsl(146 40% 61% / 55%); background: var(--success-bg); }
.verdict-review { color: hsl(7 85% 82%); border-color: hsl(7 78% 67% / 55%); background: var(--danger-bg); }

.restored-draft {
  margin: 1.5rem 0;
  padding: clamp(1rem, 2.5vw, 1.4rem);
  border: 1px solid hsl(43 55% 58% / 35%);
  border-radius: var(--radius);
  background: var(--card-raised);
}

.restored-draft-heading { display: flex; gap: 1rem; align-items: start; justify-content: space-between; }
.restored-draft-heading .truth-label { margin-bottom: 0.35rem; }
.restored-draft-heading h3 { margin: 0; font-size: clamp(1.25rem, 2.5vw, 1.7rem); }
.restored-draft > .field-help { max-width: 760px; margin: 0.85rem 0; }
#restored-draft { min-height: 13rem; background: hsl(233 30% 5%); }

.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; border: 1px solid var(--border); background: var(--border); }
.result-card { min-width: 0; padding: 1.2rem; background: var(--card-raised); }
.result-card h3 { min-height: 2.5em; margin: 0; font-size: 0.92rem; line-height: 1.35; }
.result-card strong { display: block; margin-block: 0.55rem; color: var(--foreground); font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 600; letter-spacing: -0.05em; }
.result-card p { margin: 0; color: var(--text-secondary); font-size: 0.88rem; }
.result-review { box-shadow: inset 0 3px 0 var(--danger); }
.result-good { box-shadow: inset 0 3px 0 var(--success); }

.next-edits { margin-top: 1.5rem; padding: 1.25rem; border: 1px solid var(--border); border-radius: var(--radius); }
.next-edits h3 { margin: 0 0 0.8rem; font-size: 1.25rem; }
.next-edits ul { margin: 0; padding-left: 1.25rem; }
.next-edits li + li { margin-top: 0.55rem; }

.boundary-note {
  overflow: hidden;
  border-color: hsl(43 55% 58% / 28%);
  background:
    radial-gradient(circle at 92% 15%, hsl(43 55% 58% / 11%), transparent 19rem),
    var(--card);
}

.boundary-note h2 { max-width: 850px; margin: 0; font-size: clamp(2.2rem, 5vw, 4.2rem); font-weight: 600; letter-spacing: -0.045em; }
.boundary-note > p:last-child { max-width: 750px; margin: 1.25rem 0 0; color: var(--text-secondary); font-size: 1.02rem; }

footer { display: grid; grid-template-columns: auto 1fr; gap: 1.2rem; align-items: center; padding: 1rem 0 4rem; color: var(--text-secondary); }
.footer-brand { display: flex; gap: 0.65rem; align-items: center; color: var(--foreground); }
.footer-brand span { width: 2rem; height: 2rem; font-size: 1rem; }
footer p { margin: 0; font-size: 0.88rem; }
footer a { display: inline-flex; align-items: center; min-height: 44px; }

.toast {
  position: fixed;
  z-index: 60;
  right: 1rem;
  bottom: 1rem;
  max-width: min(26rem, calc(100% - 2rem));
  padding: 0.9rem 1.1rem;
  border: 1px solid hsl(43 55% 58% / 45%);
  border-radius: var(--radius);
  color: var(--foreground);
  background: var(--card-raised);
  box-shadow: 0 18px 50px hsl(233 33% 2% / 65%);
  opacity: 0;
  transform: translateY(1rem);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.toast.is-visible { opacity: 1; transform: translateY(0); }
[hidden] { display: none !important; }

@media (min-width: 1000px) {
  .hero { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(2rem, 4vw, 3.2rem); align-items: start; padding: 2rem 0 1rem; }
  .hero-lead { min-width: 0; }
  .hero h1 { font-size: clamp(3.65rem, 5.25vw, 4.45rem); }
  .hero-copy { font-size: clamp(1rem, 1.55vw, 1.16rem); line-height: 1.52; }
  .manifesto-panel { margin-top: 0; padding: clamp(1.05rem, 1.7vw, 1.35rem); }
  .manifesto-heading { grid-template-columns: 1fr; }
  .manifesto-heading h2 { font-size: clamp(1.95rem, 2.65vw, 2.35rem); }
  .manifesto-intro { margin-top: 0.6rem; font-size: 0.84rem; line-height: 1.43; }
  .manifesto-rows { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .manifesto-rows { margin-top: 1rem; }
  .manifesto-rows summary { grid-template-columns: 1fr auto; min-height: 82px; padding: 0.68rem; }
  .manifesto-rows summary > span:first-child { grid-column: 1; }
  .manifesto-rows summary strong { grid-column: 1 / -1; font-size: 0.84rem; line-height: 1.25; }
  .manifesto-rows summary .details-icon { grid-column: 2; grid-row: 1; }
  .manifesto-rows details > p { padding-left: 0.85rem; }
}

@media (max-width: 860px) {
  .manifesto-heading { grid-template-columns: 1fr; gap: 0.7rem; }
  .manifesto-rows { grid-template-columns: 1fr; }
  .prompt-explainer, .envelope-layout, .writer-choice-grid { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  :root { --page: min(100% - 1.1rem, 1180px); --reading: min(100% - 1.1rem, 1040px); }
  .masthead { min-height: 68px; }
  .repo-link { display: none; }
  .wordmark-copy strong { font-size: 0.86rem; }
  .hero { padding-top: 2.6rem; }
  h1 { font-size: clamp(3.2rem, 17vw, 5rem); }
  .step-rail { padding-inline: 0.55rem; }
  .step-rail li { justify-content: center; min-width: 0; padding-inline: 0.25rem; font-size: 0.72rem; line-height: 1.15; }
  .step-rail li > span:first-child { flex-basis: 1.55rem; width: 1.55rem; height: 1.55rem; }
  .work-step, .boundary-note { padding: 1.15rem; }
  .step-heading { grid-template-columns: 1fr; gap: 0.35rem; }
  .action-row > button { flex: 1 1 100%; }
  .restored-draft-heading { align-items: stretch; flex-direction: column; }
  .restored-draft-heading button { width: 100%; }
  .result-grid { grid-template-columns: 1fr; }
  .protected-sheet li { grid-template-columns: 1fr; gap: 0.1rem; }
  .advanced-route > summary small { margin-left: 0; }
  footer { grid-template-columns: 1fr; }
}

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

@media print {
  :root { color-scheme: light; }
  .masthead, .step-rail, button, .toast, footer { display: none !important; }
  body { color: #111; background: #fff; }
  main { width: 100%; }
  .work-step, .boundary-note { color: #111; border: 1px solid #aaa; background: #fff; box-shadow: none; break-inside: avoid; }
  textarea, input { color: #111; background: #fff; }
}
