:root {
  --red: #C3002F;
  --red-dark: #9A0025;
  --black: #000000;
  --ink: #111111;
  --gray: #3A3D44;
  --muted: #6B6F76;
  --line: #D8D5D5;
  --surface: #F4F4F4;
  --white: #FFFFFF;
  --amber-bg: #FFF1D6;
  --amber-ink: #7A4B00;
  --display: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --radius: 4px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--white); color: var(--ink); font: 16px/1.55 var(--body);
}
img { max-width: 100%; display: block; }
a { color: inherit; }
[hidden] { display: none !important; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 16px; background: var(--white); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-height: 44px; }
.brand img { height: 56px; width: auto; }
.brand-name {
  font-family: var(--display); font-stretch: 125%; font-weight: 800;
  text-transform: uppercase; letter-spacing: .02em; font-size: 15px;
}
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-link {
  font: 600 14px/1 var(--body); color: var(--gray); text-decoration: none;
  background: none; border: 0; cursor: pointer; padding: 14px 0;
}
.topbar-link:hover { color: var(--red); }
.topbar-tag {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  background: var(--black); color: var(--white); padding: 3px 8px; border-radius: 2px;
}

/* Type */
.eyebrow {
  margin: 0 0 12px; color: var(--red);
  font: 700 12px/1.2 var(--display); font-stretch: 125%; letter-spacing: .08em; text-transform: uppercase;
}
.display {
  margin: 0 0 16px; font-family: var(--display); font-stretch: 125%; font-weight: 900;
  text-transform: uppercase; line-height: 1.05; letter-spacing: -.01em; font-size: clamp(28px, 6vw, 48px);
  overflow-wrap: anywhere;
}
.display--sm { font-size: clamp(20px, 3.5vw, 28px); margin: 0; }
.lede { margin: 0 0 24px; font-size: 18px; color: var(--gray); max-width: 60ch; }
.hint { margin: 8px 0 0; font-size: 14px; color: var(--muted); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px; border-radius: var(--radius); border: 2px solid transparent;
  font: 700 15px/1 var(--display); font-stretch: 112%; letter-spacing: .04em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.btn--primary { background: var(--red); color: var(--white); }
.btn--primary:hover { background: var(--red-dark); }
.btn--primary:disabled { opacity: .6; cursor: progress; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--white); }
.btn--lg { min-height: 56px; padding: 0 32px; font-size: 16px; }
.link {
  background: none; border: 0; color: var(--red); font: 700 14px/1 var(--body);
  cursor: pointer; padding: 8px; min-height: 44px; flex-shrink: 0;
}
:is(.btn, .input, .link, .tab, .sub-item, .brand, .topbar-link):focus-visible {
  outline: 3px solid var(--red); outline-offset: 2px;
}

/* Progress */
.progress { height: 4px; background: var(--surface); overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--red); transition: width .3s ease; }

/* Landing */
.landing { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: 40px 16px 64px; }
.hero { margin-bottom: 32px; }
.progress-card {
  margin-bottom: 32px; padding: 16px 20px;
  border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: var(--radius);
}
.progress-card-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; font-weight: 600; }
.progress-card-top strong { font-family: var(--display); font-stretch: 125%; font-size: 20px; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .cards { grid-template-columns: 1fr 1fr; } }
.card {
  display: flex; flex-direction: column; gap: 8px; padding: 24px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--white);
}
.card--done { background: var(--surface); }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card-num { font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: 28px; color: var(--red); }
.status {
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; background: var(--surface); color: var(--gray);
}
.status--progress { background: var(--amber-bg); color: var(--amber-ink); }
.status--done { background: var(--black); color: var(--white); }
.card-title {
  margin: 4px 0 0; font-family: var(--display); font-stretch: 125%; font-weight: 800;
  text-transform: uppercase; font-size: 20px; line-height: 1.15;
}
.card-blurb { margin: 0; color: var(--gray); flex: 1; }
.card .btn { align-self: flex-start; }
.meta { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 4px 0 12px; padding: 0; font-size: 14px; color: var(--muted); }
.meta-due { color: var(--ink); font-weight: 600; }
.meta-anon { color: var(--red); font-weight: 700; }
.site-footer { padding: 24px 16px; text-align: center; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }

/* Form stage */
.stage { flex: 1; display: flex; justify-content: center; padding: 48px 16px 24px; }
.stage-inner { width: 100%; max-width: 680px; }
.stage-nav { width: 100%; max-width: 712px; margin: 0 auto; padding: 12px 16px 24px; }
.prompt {
  display: block; margin: 0 0 20px; font-family: var(--display); font-stretch: 112%; font-weight: 800;
  font-size: clamp(22px, 4.5vw, 32px); line-height: 1.2; overflow-wrap: anywhere;
}
.optional { font-family: var(--body); font-weight: 400; font-size: 16px; color: var(--muted); }
.input {
  width: 100%; padding: 12px 0; border: 0; border-bottom: 2px solid var(--line); border-radius: 0;
  background: transparent; color: var(--ink); font: inherit; font-size: 20px; transition: border-color .15s;
}
.input:focus { outline: none; border-bottom-color: var(--red); }
.input[aria-invalid='true'] { border-bottom-color: var(--red); }
input[type='date'].input { -webkit-appearance: none; appearance: none; min-height: 52px; }
textarea.input { resize: vertical; min-height: 120px; line-height: 1.5; field-sizing: content; }
.error { margin: 8px 0 0; min-height: 1.4em; color: var(--red); font-size: 14px; font-weight: 600; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin-top: 24px; }
.kbd-hint { font-size: 13px; color: var(--muted); }
@media (hover: none) { .kbd-hint { display: none; } }
.notice { margin: 0 0 24px; padding: 14px 16px; background: var(--surface); border-left: 4px solid var(--red); }
.prompt + .guidance { margin: -8px 0 12px; }
.example { margin: 0 0 16px; }
.example summary {
  display: inline-flex; align-items: center; min-height: 44px; cursor: pointer;
  color: var(--red); font-weight: 700; font-size: 14px;
}
.example p {
  margin: 4px 0 0; padding: 12px 16px; background: var(--surface); border-left: 3px solid var(--line);
  color: var(--gray); white-space: pre-wrap;
}
.area-grid { display: grid; gap: 8px 24px; }
@media (min-width: 640px) {
  .area-grid { grid-template-columns: 1fr 1fr; }
  .area-grid .field:first-child { grid-column: 1 / -1; }
}
.field-label {
  display: block; margin-top: 8px; font-size: 13px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--gray);
}
.field .input { font-size: 18px; }
.review-list { list-style: none; margin: 0 0 8px; padding: 0; border-top: 1px solid var(--line); }
.review-item { display: flex; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.review-item > div { min-width: 0; }
.review-label { margin: 0 0 4px; font-weight: 700; }
.review-value { margin: 0; white-space: pre-wrap; color: var(--gray); overflow-wrap: anywhere; }
.muted { color: var(--muted); font-style: italic; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.enter-forward { animation: in-up .35s ease both; }
.enter-back { animation: in-down .35s ease both; }
@keyframes in-up { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes in-down { from { opacity: 0; transform: translateY(-24px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Admin */
.admin { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 32px 16px 64px; }
.login { max-width: 400px; margin: 48px auto; }
.login .btn { margin-top: 16px; width: 100%; }
.tabs { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.tab {
  min-height: 44px; padding: 12px 8px; background: none; border: 0; border-bottom: 3px solid transparent;
  font: 700 14px/1 var(--body); color: var(--gray); white-space: nowrap; cursor: pointer;
}
.tab[aria-selected='true'] { color: var(--ink); border-bottom-color: var(--red); }
.tab-count { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: var(--surface); font-size: 12px; }
.admin-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.admin-grid { display: grid; gap: 24px; }
@media (min-width: 900px) { .admin-grid { grid-template-columns: 300px minmax(0, 1fr); } }
.sub-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); max-height: 70vh; overflow: auto; }
.sub-item {
  display: block; width: 100%; padding: 12px 16px; text-align: left; cursor: pointer;
  background: none; border: 0; border-bottom: 1px solid var(--line); font: inherit; color: inherit;
}
.sub-item[aria-current='true'] { background: var(--surface); box-shadow: inset 4px 0 0 var(--red); }
.sub-item small { display: block; color: var(--muted); }
.sub-detail { min-width: 0; }
.sub-meta { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.qa { margin: 0; }
.qa dt { margin-top: 20px; font-weight: 700; }
.qa dd { margin: 6px 0 0; white-space: pre-wrap; color: var(--gray); overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; }
.plan-table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 14px; }
.plan-table th, .plan-table td { padding: 8px 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; white-space: pre-wrap; }
.plan-table thead th { background: var(--black); color: var(--white); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.plan-section th { background: var(--surface); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.empty { padding: 24px 16px; color: var(--muted); }
