/* =========================================================================
   ProofPlan — editorial decision desk
   Design system: warm paper + ink + electric indigo, Fraunces / Inter / Plex Mono
   ========================================================================= */

:root {
  /* paper + ink */
  --paper: #f3efe6;
  --paper-2: #efe9dd;
  --surface: #fbf9f3;
  --card: #fffefb;
  --ink: #17150f;
  --ink-2: #423d33;
  --muted: #7a7264;
  --faint: #a59c8b;
  --line: rgba(23, 21, 15, 0.13);
  --line-soft: rgba(23, 21, 15, 0.08);

  /* accents */
  --indigo: #2f2ad8;
  --indigo-ink: #1f1aa8;
  --indigo-wash: rgba(47, 42, 216, 0.08);
  --coral: #ed4f1c;
  --coral-wash: rgba(237, 79, 28, 0.1);
  --green: #137a4f;
  --green-wash: rgba(19, 122, 79, 0.1);
  --amber: #b8721a;

  /* type */
  --font-display: "Fraunces", "Hoefler Text", Georgia, "Times New Roman", serif;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", "Menlo", "Consolas", monospace;

  /* shape */
  --r-lg: 18px;
  --r-md: 13px;
  --r-sm: 9px;
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 18px 40px -28px rgba(23, 21, 15, 0.4);
  --shadow-pop: 0 28px 60px -30px rgba(23, 21, 15, 0.55);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --maxw: 1240px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(120% 80% at 100% -10%, rgba(47, 42, 216, 0.05), transparent 60%),
    radial-gradient(90% 60% at -10% 0%, rgba(237, 79, 28, 0.05), transparent 55%),
    repeating-linear-gradient(0deg, transparent 0 31px, var(--line-soft) 31px 32px);
  background-attachment: fixed, fixed, scroll;
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: "ss01", "cv05";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; line-height: 1.05; }
p { margin: 0; }
em { font-style: italic; }

.sprite { position: absolute; }
.ico { width: 1.05em; height: 1.05em; flex: none; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

.kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.7rem;
}
.kicker-accent { color: var(--indigo-ink); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5em;
  font-family: var(--font-ui); font-weight: 550; font-size: 0.9rem;
  padding: 0.62em 1.05em; border-radius: 999px; border: 1.5px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform 0.18s var(--ease), background 0.18s var(--ease), border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: var(--indigo); box-shadow: 0 10px 24px -12px var(--indigo); transform: translateY(-1px); }
.btn-line { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-line:hover { border-color: var(--ink); background: var(--surface); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: transparent; padding: 0.5em 0.8em; }
.btn-ghost:hover { background: rgba(23, 21, 15, 0.06); color: var(--ink); }
.btn-mini { font-size: 0.78rem; padding: 0.35em 0.85em; background: var(--ink); color: var(--paper); }
.btn-mini:hover { background: var(--indigo); }

.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none;
  border-radius: 50%; border: 1.5px solid var(--line); background: var(--card); color: var(--ink-2);
  cursor: pointer; transition: all 0.18s var(--ease);
}
.icon-btn:hover { border-color: var(--ink); color: var(--ink); transform: rotate(90deg); }
.icon-btn .ico { width: 18px; height: 18px; }

.pill {
  display: inline-flex; align-items: center; gap: 0.45em;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.04em;
  padding: 0.4em 0.8em; border-radius: 999px; border: 1px solid var(--line);
  color: var(--green); background: var(--green-wash);
}
.pill .ico { width: 14px; height: 14px; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0.7rem clamp(1rem, 4vw, 2.2rem);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.wordmark { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink); }
.wordmark-mark { color: var(--indigo); font-size: 1.3rem; line-height: 1; transform: translateY(1px); }
.wordmark-text { font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; line-height: 0.95; letter-spacing: -0.02em; }
.wordmark-text small { display: block; font-family: var(--font-mono); font-weight: 500; font-size: 0.56rem; letter-spacing: 0.32em; color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 0.5rem; }

/* ---------- hero ---------- */
.hero { padding: clamp(2.4rem, 6vw, 4.6rem) clamp(1rem, 4vw, 2.2rem) clamp(1.6rem, 3vw, 2.4rem); }
.hero-inner { max-width: var(--maxw); margin: 0 auto; }
.hero-title {
  font-size: clamp(2.3rem, 6.4vw, 4.6rem);
  letter-spacing: -0.035em; max-width: 17ch;
}
.hero-title em { color: var(--indigo); font-style: italic; }
.hero-sub {
  margin-top: 1.5rem; max-width: 60ch; font-size: clamp(1.02rem, 1.7vw, 1.22rem);
  color: var(--ink-2); line-height: 1.62;
}
.hero-sub strong { color: var(--ink); font-weight: 600; }
.scenario-strip {
  margin-top: 2rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.55rem;
}
.scenario-label { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-right: 0.3rem; }
.chip {
  font-family: var(--font-ui); font-size: 0.88rem; font-weight: 500;
  padding: 0.5em 1em; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--card); color: var(--ink-2); cursor: pointer;
  transition: all 0.18s var(--ease);
}
.chip:hover { border-color: var(--indigo); color: var(--indigo-ink); background: var(--indigo-wash); transform: translateY(-2px); }
.chip:active { transform: translateY(0); }

/* ---------- workbench layout ---------- */
.workbench {
  max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2.2rem);
  display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: clamp(1.4rem, 3vw, 2.6rem);
  align-items: start;
}

/* ---------- builder ---------- */
.builder { min-width: 0; }
.step { display: grid; grid-template-columns: 44px 1fr; gap: 1rem; padding: clamp(1.2rem, 2.4vw, 1.7rem) 0; border-top: 1.5px solid var(--line); }
.step:first-child { border-top: none; padding-top: 0; }
.step-rail { display: flex; justify-content: center; }
.step-num {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  font-family: var(--font-mono); font-weight: 600; font-size: 1rem;
  background: var(--ink); color: var(--paper);
  position: sticky; top: 80px;
}
.step-body { min-width: 0; }
.step-head { margin-bottom: 1.1rem; }
.step-head.with-action { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.step-head h2 { font-size: clamp(1.4rem, 2.6vw, 1.85rem); }
.step-head p { margin-top: 0.4rem; color: var(--muted); font-size: 0.94rem; max-width: 52ch; }
.cite { color: var(--indigo-ink); text-decoration: none; border-bottom: 1px dotted currentColor; font-weight: 500; white-space: nowrap; }
.cite:hover { color: var(--coral); }

/* fields */
.field { display: flex; flex-direction: column; gap: 0.38rem; min-width: 0; }
.field-label { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.field-label em { color: var(--faint); font-style: normal; text-transform: none; letter-spacing: 0; }
.field + .field { margin-top: 0.85rem; }
input, textarea, select {
  width: 100%; font-family: var(--font-ui); font-size: 0.98rem; color: var(--ink);
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r-md);
  padding: 0.66em 0.8em; transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease), background 0.16s var(--ease);
}
textarea { resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--indigo);
  box-shadow: 0 0 0 4px var(--indigo-wash);
}
select { appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a7264' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.7em center; padding-right: 2.1em;
}
.field-row { display: grid; gap: 0.7rem; margin-top: 0.85rem; }
.field-row.four { grid-template-columns: repeat(4, 1fr); }

.scale-legend {
  display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; margin-bottom: 0.9rem;
  font-size: 0.74rem; color: var(--muted);
}
.scale-legend b { color: var(--ink-2); font-weight: 600; }

/* option rows */
.option-list { display: flex; flex-direction: column; gap: 0.8rem; }
.option-row {
  position: relative; background: var(--card); border: 1.5px solid var(--line);
  border-radius: var(--r-md); padding: 0.9rem 0.95rem 0.95rem;
  display: grid; gap: 0.7rem; box-shadow: var(--shadow-card);
  animation: pop-in 0.32s var(--ease) both;
}
.option-row:focus-within { border-color: var(--indigo); }
.option-top { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; align-items: start; }
.option-name { font-weight: 600; font-size: 1rem; }
.option-evidence-wrap { position: relative; }
.option-evidence { font-size: 0.9rem; padding-right: 5.6em; }
.evidence-tag {
  position: absolute; right: 0.6em; top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.08em; pointer-events: none;
  padding: 0.2em 0.5em; border-radius: 5px;
}
.evidence-tag.weak { color: var(--coral); background: var(--coral-wash); }
.evidence-tag.ok { color: var(--green); background: var(--green-wash); }
.score-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.tiny-field { display: flex; flex-direction: column; gap: 0.22rem; }
.tiny-field span { font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.tiny-field select { padding: 0.42em 0.5em; font-size: 0.9rem; text-align: center; padding-right: 1.5em; background-position: right 0.4em center; }
.remove-option, .remove-obstacle { width: 30px; height: 30px; border-radius: 8px; }
.remove-option .ico, .remove-obstacle .ico { width: 15px; height: 15px; }
.remove-option:hover, .remove-obstacle:hover { transform: none; border-color: var(--coral); color: var(--coral); }

/* obstacle rows */
.obstacle-list { display: flex; flex-direction: column; gap: 0.7rem; }
.obstacle-row {
  display: grid; grid-template-columns: 1fr 1fr auto; gap: 0.6rem; align-items: end;
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r-md);
  padding: 0.8rem 0.85rem; box-shadow: var(--shadow-card);
  animation: pop-in 0.32s var(--ease) both;
}
.obstacle-row:focus-within { border-color: var(--indigo); }
.obstacle-row .tiny-field span b { color: var(--coral); }

.builder-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.6rem; padding-top: 1.4rem; border-top: 1.5px solid var(--line); }

@keyframes pop-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- receipt ---------- */
.receipt-rail { min-width: 0; }
.receipt-sticky { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 1rem; }

.receipt {
  position: relative; background: var(--card);
  filter: drop-shadow(0 26px 44px rgba(23, 21, 15, 0.22));
  font-family: var(--font-mono);
}
.receipt-perf { height: 12px; background: var(--card); }
.receipt-perf.top {
  -webkit-mask: radial-gradient(7px at 50% 0, transparent 98%, #000) repeat-x 0 0 / 16px 12px;
          mask: radial-gradient(7px at 50% 0, transparent 98%, #000) repeat-x 0 0 / 16px 12px;
}
.receipt-perf.bottom {
  -webkit-mask: radial-gradient(7px at 50% 12px, transparent 98%, #000) repeat-x 0 0 / 16px 12px;
          mask: radial-gradient(7px at 50% 12px, transparent 98%, #000) repeat-x 0 0 / 16px 12px;
}
.receipt-inner { padding: 0.2rem 1.4rem 0.4rem; border-left: 1.5px dashed var(--line); border-right: 1.5px dashed var(--line); }
.receipt-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 0.8rem 0 0.7rem; border-bottom: 2px solid var(--ink); }
.receipt-brand { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1; }
.receipt-sub { font-size: 0.62rem; letter-spacing: 0.34em; color: var(--muted); margin-top: 2px; }
.receipt-fit { text-align: right; line-height: 0.9; }
.receipt-fit-num { font-family: var(--font-display); font-size: 2.1rem; font-weight: 600; color: var(--indigo); font-variant-numeric: tabular-nums; }
.receipt-fit-label { display: block; font-size: 0.56rem; letter-spacing: 0.3em; color: var(--muted); }

.receipt-stamp {
  margin: 1rem auto 0.4rem; width: max-content; max-width: 100%;
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.12em;
  color: var(--coral); border: 2.5px solid var(--coral); border-radius: 7px;
  padding: 0.3em 0.8em; transform: rotate(-3deg);
  opacity: 0.92; transition: color 0.2s, border-color 0.2s;
}
.receipt-stamp[data-state="empty"] { color: var(--faint); border-color: var(--faint); }
.receipt-stamp[data-state="go"] { color: var(--green); border-color: var(--green); animation: stamp 0.4s var(--ease); }
.receipt-stamp[data-state="caution"] { color: var(--amber); border-color: var(--amber); animation: stamp 0.4s var(--ease); }
@keyframes stamp { 0% { transform: rotate(-3deg) scale(1.6); opacity: 0; } 60% { transform: rotate(-3deg) scale(0.92); opacity: 1; } 100% { transform: rotate(-3deg) scale(1); } }

.receipt-lines { margin: 0.6rem 0 0; display: flex; flex-direction: column; gap: 0.55rem; }
.receipt-line { display: grid; grid-template-columns: 1fr; gap: 0.1rem; }
.receipt-line dt { font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.receipt-line dd { margin: 0; font-size: 0.86rem; line-height: 1.45; color: var(--ink); }
.receipt-choice { font-family: var(--font-display); font-size: 1.12rem !important; font-weight: 600; line-height: 1.2; color: var(--ink); }
.receipt-door { font-weight: 600; }
.receipt-door.go { color: var(--green); }
.receipt-door.caution { color: var(--amber); }
.door-advice { display: block; margin-top: 3px; font-size: 0.74rem; font-weight: 400; line-height: 1.45; color: var(--muted); letter-spacing: 0; }
.receipt-rule { height: 0; border-top: 1.5px dashed var(--line); margin: 0.2rem 0; }

.receipt-meters { display: grid; gap: 0.55rem; margin-top: 1rem; padding-top: 0.9rem; border-top: 2px solid var(--ink); }
.meter-top { display: flex; justify-content: space-between; font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.meter-top b { color: var(--ink); font-variant-numeric: tabular-nums; }
.meter-track { display: block; height: 6px; border-radius: 999px; background: var(--paper-2); overflow: hidden; margin-top: 3px; }
.meter-track i { display: block; height: 100%; border-radius: 999px; background: var(--indigo); transition: width 0.6s var(--ease); }
.meter-track.risk i { background: var(--coral); }

.receipt-foot { display: flex; justify-content: space-between; gap: 0.5rem; margin-top: 0.9rem; padding: 0.7rem 0 0.9rem; font-size: 0.58rem; letter-spacing: 0.06em; color: var(--faint); border-top: 1.5px dashed var(--line); }
.receipt-foot-tag { overflow: hidden; white-space: nowrap; max-width: 42%; opacity: 0.6; }

.receipt-export { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r-md); padding: 0.8rem; box-shadow: var(--shadow-card); }
.receipt-export-head { display: flex; align-items: center; justify-content: space-between; font-family: var(--font-mono); font-size: 0.74rem; color: var(--muted); margin-bottom: 0.6rem; }
.receipt-export img { width: 100%; border-radius: var(--r-sm); border: 1px solid var(--line); display: block; }

/* ---------- proof board ---------- */
.section-head { max-width: var(--maxw); margin: clamp(3rem, 6vw, 5rem) auto 1.6rem; padding: 0 clamp(1rem, 4vw, 2.2rem); }
.section-head h2 { font-size: clamp(1.7rem, 3.6vw, 2.7rem); letter-spacing: -0.025em; max-width: 22ch; }

.proofboard, .planboard, .archive, .evidence { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2.2rem); }
.proof-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }

.column-title { display: flex; align-items: center; gap: 0.5rem; font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 0.9rem; }
.column-title .ico { width: 16px; height: 16px; color: var(--indigo); }
.muted-tag { font-family: var(--font-ui); text-transform: none; letter-spacing: 0; color: var(--faint); font-size: 0.74rem; font-weight: 400; }

.matrix-card, .ranked-card, .checks-card { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r-lg); padding: 1.2rem; box-shadow: var(--shadow-card); }
.matrix-card figcaption { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.7rem; }
.matrix-hint { font-size: 0.76rem; color: var(--faint); }
.matrix-wrap { width: 100%; }
#scoreCanvas { width: 100%; height: auto; display: block; }

.ranked-list { display: flex; flex-direction: column; gap: 0.55rem; }
.ranked-item { display: grid; grid-template-columns: auto 1fr auto; gap: 0.7rem; align-items: center; padding: 0.7rem 0.2rem; border-bottom: 1px solid var(--line-soft); animation: pop-in 0.3s var(--ease) both; }
.ranked-item:last-child { border-bottom: none; }
.rank-badge { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; font-family: var(--font-mono); font-weight: 600; font-size: 0.8rem; color: var(--paper); }
.ranked-main { min-width: 0; }
.ranked-main strong { display: block; font-size: 0.95rem; font-weight: 600; }
.ranked-bar { height: 5px; border-radius: 999px; background: var(--paper-2); margin-top: 0.4rem; overflow: hidden; }
.ranked-bar i { display: block; height: 100%; border-radius: 999px; transition: width 0.6s var(--ease); }
.ranked-score { font-family: var(--font-mono); font-weight: 600; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.ranked-tags { display: flex; gap: 0.3rem; margin-top: 0.3rem; flex-wrap: wrap; }
.mini-tag { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.05em; text-transform: uppercase; padding: 0.15em 0.45em; border-radius: 4px; background: var(--paper-2); color: var(--muted); }
.mini-tag.win { background: var(--indigo-wash); color: var(--indigo-ink); }

.scoring-note { margin-top: 1rem; border-top: 1px dashed var(--line); padding-top: 0.8rem; }
.scoring-note summary { cursor: pointer; font-size: 0.82rem; font-weight: 600; color: var(--indigo-ink); list-style: none; }
.scoring-note summary::-webkit-details-marker { display: none; }
.scoring-note summary::before { content: "+ "; font-family: var(--font-mono); }
.scoring-note[open] summary::before { content: "– "; }
.scoring-note p { margin-top: 0.6rem; font-size: 0.86rem; color: var(--muted); line-height: 1.6; }
.scoring-note b { color: var(--ink-2); }

.checks-card { margin-top: 1.2rem; }
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.7rem; }
.check-item { padding: 0.8rem 0.9rem; border-radius: var(--r-md); border-left: 3px solid var(--line); background: var(--surface); animation: pop-in 0.3s var(--ease) both; }
.check-item strong { display: block; font-size: 0.9rem; margin-bottom: 0.2rem; }
.check-item p { font-size: 0.82rem; color: var(--muted); line-height: 1.5; }
.check-item.blocker { border-left-color: var(--coral); background: var(--coral-wash); }
.check-item.warning { border-left-color: var(--amber); }
.check-item.ready { border-left-color: var(--green); background: var(--green-wash); }

/* ---------- plan board ---------- */
.planboard { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin-top: 1.2rem; }
.plan-col { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r-lg); padding: 1.2rem; box-shadow: var(--shadow-card); }
.today-plan { list-style: none; counter-reset: step; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.today-plan li { counter-increment: step; display: grid; grid-template-columns: auto 1fr; gap: 0.7rem; align-items: start; font-size: 0.92rem; line-height: 1.5; animation: pop-in 0.3s var(--ease) both; }
.today-plan li::before { content: counter(step); display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--ink); color: var(--paper); font-family: var(--font-mono); font-size: 0.76rem; font-weight: 600; }
.today-plan li:first-child::before { background: var(--indigo); }

.fallback-plan { display: flex; flex-direction: column; gap: 0.6rem; }
.fallback-item { padding: 0.75rem 0.85rem; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line-soft); animation: pop-in 0.3s var(--ease) both; }
.fallback-item strong { display: block; font-size: 0.88rem; color: var(--coral); }
.fallback-item strong::before { content: "IF "; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; }
.fallback-item p { margin-top: 0.25rem; font-size: 0.88rem; color: var(--ink-2); }
.fallback-item p::before { content: "THEN "; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; color: var(--green); }

/* ---------- archive ---------- */
.archive { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin-top: 1.2rem; }
.archive-col { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r-lg); padding: 1.2rem; box-shadow: var(--shadow-card); }
.archive-head { display: flex; align-items: center; justify-content: space-between; }
.archive-head .column-title { margin-bottom: 0; }
.saved-list { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.9rem; max-height: 240px; overflow-y: auto; }
.saved-item { display: grid; grid-template-columns: 1fr auto; gap: 0.6rem; align-items: center; padding: 0.6rem 0.7rem; border-radius: var(--r-sm); border: 1px solid var(--line-soft); background: var(--surface); }
.saved-item strong { font-size: 0.88rem; font-weight: 600; display: block; }
.saved-item p { font-family: var(--font-mono); font-size: 0.66rem; color: var(--faint); margin-top: 1px; }
.load-saved { font-size: 0.76rem; padding: 0.35em 0.8em; border-radius: 8px; border: 1.5px solid var(--line); background: var(--card); cursor: pointer; font-weight: 600; transition: all 0.16s var(--ease); }
.load-saved:hover { border-color: var(--ink); }
.archive-col textarea { margin-top: 0.9rem; font-family: var(--font-mono); font-size: 0.78rem; line-height: 1.55; background: var(--surface); }

.empty-state { font-size: 0.85rem; color: var(--faint); padding: 1rem; text-align: center; border: 1px dashed var(--line); border-radius: var(--r-md); }

/* ---------- evidence ---------- */
.evidence { margin-bottom: 4rem; }
.evidence-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.evidence-card { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r-lg); padding: 1.3rem; box-shadow: var(--shadow-card); position: relative; overflow: hidden; }
.evidence-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: linear-gradient(var(--indigo), var(--coral)); }
.evidence-card h3 { font-size: 1.12rem; margin-bottom: 0.5rem; padding-left: 0.4rem; }
.evidence-card p { font-size: 0.88rem; color: var(--ink-2); line-height: 1.6; padding-left: 0.4rem; }
.evidence-src { display: block; margin-top: 0.8rem; padding-left: 0.4rem; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.04em; color: var(--faint); }

/* ---------- footer ---------- */
.site-foot { max-width: var(--maxw); margin: 0 auto; padding: 2.2rem clamp(1rem, 4vw, 2.2rem) 3rem; border-top: 1.5px solid var(--line); }
.site-foot p { font-size: 0.92rem; }
.site-foot strong { font-family: var(--font-display); }
.site-foot .muted { color: var(--muted); margin-top: 0.4rem; font-size: 0.84rem; }
.site-foot code { font-family: var(--font-mono); font-size: 0.82em; background: var(--surface); padding: 0.1em 0.4em; border-radius: 5px; border: 1px solid var(--line-soft); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(12px);
  background: var(--ink); color: var(--paper); font-size: 0.88rem; font-weight: 500;
  padding: 0.7em 1.2em; border-radius: 999px; box-shadow: var(--shadow-pop); z-index: 80;
  opacity: 0; transition: opacity 0.25s var(--ease), transform 0.25s var(--ease); pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- responsive ---------- */
@media (max-width: 940px) {
  .workbench { grid-template-columns: 1fr; }
  .receipt-rail { order: -1; }
  .receipt-sticky { position: static; }
  .proof-grid { grid-template-columns: 1fr; }
  .planboard, .archive { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  body { font-size: 15px; }
  .topbar-inner { flex-wrap: wrap; row-gap: 0.4rem; }
  .pill { display: none; }
  .wordmark-text small { display: none; }
  .topbar-actions { gap: 0.35rem; }
  .topbar-actions .btn-ghost { padding: 0.45em 0.65em; font-size: 0.84rem; }
  .field-row.four { grid-template-columns: 1fr 1fr; }
  .score-grid { grid-template-columns: repeat(2, 1fr); }
  .obstacle-row { grid-template-columns: 1fr; }
  .obstacle-row .remove-obstacle { justify-self: end; margin-top: -2.4rem; }
  .step { grid-template-columns: 32px 1fr; gap: 0.7rem; }
  .step-num { width: 32px; height: 32px; font-size: 0.9rem; }
  .hero-title { font-size: clamp(2rem, 9vw, 2.8rem); }
  .receipt-inner { padding-left: 1rem; padding-right: 1rem; }
  .check-list { grid-template-columns: 1fr; }
}
