:root {
  --ink: #1a241c;
  --ink-soft: #3e4a41;
  --muted: #5f6961;
  --paper: #f4efe6;
  --paper-2: #fffaf3;
  --wash: #e8f0ea;
  --line: #d8d0c3;
  --moss: #1c6a49;
  --moss-dark: #124632;
  --moss-soft: #dcebe3;
  --copper: #b85c28;
  --copper-ink: #9e4a1e;
  --copper-soft: #f3e0d4;
  --bad: #8c2f2f;
  --bad-soft: #f6e4e2;
  --ok: #1c6a49;
  --shadow: 0 18px 40px -24px rgba(26, 36, 28, 0.35);
  --radius: 18px;
  --sans: "Segoe UI", "Source Sans 3", ui-sans-serif, system-ui, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;
  font-family: var(--serif);
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 10% -10%, var(--wash), transparent 60%),
    radial-gradient(900px 400px at 100% 0%, var(--copper-soft), transparent 50%),
    var(--paper);
  color: var(--ink);
}

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--ink);
  color: white;
  padding: 8px 12px;
  z-index: 20;
}
.skip:focus { top: 12px; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 650;
  letter-spacing: 0.04em;
  font-family: var(--sans);
}
.mark {
  width: 22px;
  height: 22px;
  border: 2px solid var(--moss);
  border-radius: 50%;
  border-right-color: transparent;
  position: relative;
}
.mark::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 3px;
  border: 4px solid transparent;
  border-left-color: var(--moss);
}
.topbar-note {
  margin: 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.82rem;
}

main { max-width: 1040px; margin: 0 auto; padding: 8px 24px 72px; }

.hero { padding: 48px 0 16px; max-width: 38rem; }
.eyebrow {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--moss);
  font-family: var(--sans);
  font-weight: 650;
}
h1, h2, h3 { font-weight: 600; line-height: 1.15; }
#hero-title { font-size: clamp(2.2rem, 6vw, 3.6rem); margin: 0 0 16px; }
.pitch { font-size: 1.2rem; color: var(--ink-soft); margin: 0 0 24px; }
.hero-actions, .actions, .add-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.hero-meta, .lede, .hint { color: var(--muted); font-family: var(--sans); font-size: 0.92rem; }
.hero-meta { margin: 18px 0 0; max-width: 36rem; }

button, .btn {
  font-family: var(--sans);
  font-size: 0.95rem;
  background: var(--moss);
  color: white;
  border: 0;
  padding: 11px 18px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  border-radius: 999px;
}
button:hover, .btn:hover { background: var(--moss-dark); }
button.ghost, a.btn.ghost, .btn.ghost {
  background: transparent;
  color: var(--moss-dark);
  border: 1px solid var(--moss);
}
button.ghost:hover, a.btn.ghost:hover { background: var(--moss-soft); }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid var(--copper);
  outline-offset: 2px;
}

.how {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 0;
  margin: 28px 0 36px;
}
.how li {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  font-family: var(--sans);
  font-size: 0.95rem;
}
.how strong { display: block; font-family: var(--serif); font-size: 1.1rem; margin-bottom: 4px; }

.stepper { margin: 16px 0 20px; padding: 4px 0; }
.stepper ol { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; font-family: var(--sans); font-size: 0.85rem; }
.stepper li { color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stepper li span {
  width: 1.5rem; height: 1.5rem; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); font-size: 0.75rem;
}
.stepper li.is-on { color: var(--ink); font-weight: 650; }
.stepper li.is-on span { background: var(--moss); color: white; border-color: var(--moss); }
.stepper li.is-done span { background: var(--moss-soft); border-color: var(--moss); color: var(--moss-dark); }

.panel {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 24px 24px 28px;
  margin: 0 0 18px;
  box-shadow: var(--shadow);
}
.panel h2 { margin: 0 0 8px; font-size: 1.45rem; }
.quiet { background: transparent; box-shadow: none; }

.pickup {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 16px;
  margin: 16px 0;
  font-family: var(--sans);
}
.pickup legend { padding: 0 6px; font-weight: 650; }
.pickup label { display: block; margin: 6px 0; }

.consent-grid, .hold-grid, .shop-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.consent-card, .hold-card, .shop-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100%;
}
.consent-card.is-on { border-color: var(--moss); background: var(--moss-soft); }
.consent-card.is-off { opacity: 0.72; }
.consent-card header, .shop-card header { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.consent-card h3, .shop-card h3, .hold-card h3 { margin: 0; font-size: 1.15rem; }
.role, .badge {
  font-family: var(--sans);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: white;
  border-radius: 999px;
  padding: 3px 8px;
  border: 1px solid var(--line);
}
.origin, .hint { font-family: var(--sans); font-size: 0.8rem; color: var(--muted); word-break: break-all; }
.consent-actions { display: flex; gap: 8px; margin-top: auto; }
.consent-actions button { padding: 7px 12px; font-size: 0.85rem; }
.consent-actions button[aria-pressed="false"] {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line);
}

.add-shop { margin: 18px 0 8px; }
.add-shop label { display: block; font-family: var(--sans); font-weight: 650; margin-bottom: 8px; }
.add-row input {
  flex: 1;
  min-width: 16rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
}

#error-banner {
  background: var(--bad-soft);
  color: var(--bad);
  border-radius: 12px;
  padding: 12px 16px;
  font-family: var(--sans);
}

.totals {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: stretch;
  margin: 18px 0 20px;
}
.pkg {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
}
.pkg p { margin: 0; font-family: var(--sans); font-size: 0.85rem; color: var(--muted); }
.pkg strong { display: block; font-size: clamp(2rem, 5vw, 3rem); margin: 4px 0; }
.pkg-before { opacity: 0.86; }
.pkg-after { border-color: var(--moss); background: var(--moss-soft); }
.totals-arrow { display: flex; align-items: center; color: var(--moss); font-size: 1.6rem; }
.flag { font-family: var(--sans); font-size: 0.88rem; font-weight: 650; margin-top: 4px !important; }
.flag.ok { color: var(--ok); }
.flag.bad { color: var(--bad); }

.shop-card .price { font-size: 1.7rem; margin: 0; }
.shop-card s { color: var(--muted); font-size: 1rem; margin-right: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; list-style: none; }
.chips li {
  font-family: var(--sans);
  font-size: 0.75rem;
  background: var(--copper-soft);
  color: #6a3212;
  border-radius: 999px;
  padding: 3px 8px;
}

.rounds {
  list-style: none;
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 8px 0 16px;
}
.rounds li {
  font-family: var(--sans);
  background: var(--paper);
  border-left: 3px solid var(--moss);
  padding: 10px 14px;
  border-radius: 0 12px 12px 0;
}
.rounds li.is-new { animation: rise 0.45s ease both; }

.inspector-wrap { font-family: var(--sans); }
.inspector-wrap summary { cursor: pointer; color: var(--moss-dark); }
pre.inspector {
  background: #1a241c;
  color: #f4efe6;
  padding: 14px;
  overflow: auto;
  font-size: 0.78rem;
  max-height: 280px;
  border-radius: 12px;
}

.hold-card p { margin: 0; font-family: var(--sans); font-size: 0.9rem; }
.hold-card label { display: block; font-family: var(--sans); font-size: 0.85rem; margin-top: 8px; }
.hold-card input[type="text"] {
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
}
.hold-card.is-done { border-color: var(--moss); background: var(--moss-soft); }

.receipt {
  font-family: var(--sans);
  display: grid;
  gap: 10px;
}
.receipt dl { display: grid; grid-template-columns: 10rem 1fr; gap: 6px 12px; margin: 0; }
.receipt dt { color: var(--muted); }
.receipt dd { margin: 0; word-break: break-all; }
.watermark {
  font-family: var(--sans);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--copper-ink);
  background: var(--copper-soft);
  display: inline-block;
  padding: 6px 10px;
  border-radius: 8px;
}
.hash { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.8rem; }

#assistant { margin-top: 28px; }
#assistant-box { margin-top: 10px; }
.site-foot { max-width: 1040px; margin: 0 auto; padding: 8px 24px 48px; color: var(--muted); font-family: var(--sans); font-size: 0.9rem; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.shop-card, .pkg-after { animation: rise 0.5s ease both; }

@media (max-width: 720px) {
  .topbar, main, .site-foot { padding-left: 16px; padding-right: 16px; }
  .how, .totals { grid-template-columns: 1fr; }
  .totals-arrow { display: none; }
  .hero { padding-top: 28px; }
  #hero-title { font-size: 2.1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .shop-card, .pkg-after, .rounds li.is-new { animation: none; }
}
