/* ==========================================================================
   UGLY BAKES — the Ugly Shelf board (shelf.css)
   Extends /css/theme.css. Components specific to the board, the map, the ledger and
   the bakery tools live here. Same tokens, same wonk, no inline styles.
   ========================================================================== */

/* ---------- Hero variants ---------- */
.hero--network .hero-sub {
  max-width: 34rem;
}

.audience-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: var(--space-2);
}

.audience-row a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  font-weight: 800;
  font-size: var(--text-sm);
  text-decoration: none;
  color: var(--color-text);
  background: var(--color-surface);
  border: 2px solid var(--color-ink);
  border-radius: var(--wonk-2);
  padding: 0.4rem 0.9rem;
  box-shadow: var(--shadow-card);
  transition: background 0.15s ease, transform 0.15s ease;
}


.audience-row svg {
  width: 1.1rem;
  height: 1.1rem;
}

/* ---------- Steps (how it works) ---------- */
.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
  counter-reset: step;
}

.step {
  position: relative;
  background: var(--color-surface);
  border: var(--border-ink);
  border-radius: var(--radius);
  padding: var(--space-3);
  padding-top: var(--space-4);
  box-shadow: var(--shadow-card);
}

.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: -1rem;
  inset-inline-start: 1rem;
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.2rem;
  color: var(--white);
  background: var(--pink-dark);
  border: var(--border-ink);
  border-radius: var(--wonk-3);
  rotate: -6deg;
}

.step h3 {
  font-size: var(--text-lg);
  margin-bottom: 0.35rem;
}

.step p {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin: 0;
}

.step svg {
  width: 2.6rem;
  height: 2.6rem;
  margin-bottom: 0.6rem;
}

/* ---------- The ladder (three rungs) ---------- */
.ladder {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  align-items: stretch;
}

.rung {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: var(--border-ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.rung:nth-child(1) {
  rotate: -0.5deg;
}

.rung:nth-child(3) {
  rotate: 0.5deg;
}

.rung-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg-subtle);
  border-bottom: var(--border-ink);
}

.rung--pack .rung-head {
  background: var(--color-highlight-soft);
}

.rung--buy .rung-head {
  background: var(--color-accent-soft);
}

.rung-num {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--text-xl);
  color: var(--color-accent-strong);
}

.rung-body {
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1;
}

.rung-body h3 {
  font-size: var(--text-xl);
  margin: 0;
}

.rung-body .who {
  font-weight: 800;
  color: var(--color-eyebrow);
  font-size: var(--text-sm);
  margin: 0;
}

.rung-body .checklist {
  margin: 0;
}

.rung-body .checklist li {
  font-size: var(--text-sm);
}

.rung-foot {
  margin-top: auto;
  padding: var(--space-2) var(--space-3);
  border-top: 2px dashed var(--cream-3);
  display: grid;
  gap: 0.3rem;
  font-size: var(--text-sm);
}

.rung-foot strong {
  font-family: var(--font-display);
  font-size: var(--text-lg);
}

.rung-foot span {
  color: var(--color-text-muted);
  font-weight: 700;
}

/* ---------- Tariff table ---------- */
.table-wrap {
  overflow-x: auto;
  background: var(--color-surface);
  border: var(--border-ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.tariff {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.tariff th,
.tariff td {
  text-align: start;
  padding: 0.75rem 1rem;
  border-bottom: 1.5px solid var(--cream-3);
  vertical-align: top;
}

.tariff th {
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: var(--text-xs);
  background: var(--color-bg-subtle);
}

.tariff tr:last-child td {
  border-bottom: 0;
}

.tariff td strong {
  font-family: var(--font-display);
  font-size: var(--text-md);
  white-space: nowrap;
}

.tariff .tier {
  display: inline-block;
  font-size: var(--text-2xs);
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border: 2px solid var(--color-ink);
  border-radius: var(--wonk-3);
  background: var(--mint-soft);
  color: var(--cocoa);
  margin-inline-end: 0.4rem;
}

.tariff .tier--kitchen {
  background: var(--color-highlight-soft);
}

.table-note {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: var(--space-2) 0 0;
}

/* ---------- Callouts ---------- */
.notice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-2);
  align-items: start;
  background: var(--color-bg-subtle);
  border: var(--border-ink);
  border-radius: var(--radius);
  padding: var(--space-3);
  box-shadow: var(--shadow-card);
  max-width: 44rem;
  margin-inline: auto;
}

.notice svg {
  width: 2.2rem;
  height: 2.2rem;
  flex: none;
}

.notice h3 {
  font-size: var(--text-lg);
  margin-bottom: 0.3rem;
}

.notice p {
  margin: 0;
  color: var(--color-text-muted);
}

.notice--pink {
  background: var(--color-accent-soft);
}

.notice--mint {
  background: var(--color-success-soft);
}

/* ---------- Rescue counter ---------- */
.counter-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-3);
  max-width: 50rem;
  margin-inline: auto;
}

.counter {
  background: var(--color-surface);
  border: var(--border-ink);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-pop);
  text-align: center;
}

.counter:nth-child(1) {
  rotate: -0.8deg;
}

.counter:nth-child(2) {
  rotate: 0.8deg;
}

.counter-number {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 60, "WONK" 1;
  font-weight: 900;
  font-size: clamp(2.2rem, 1.4rem + 3.5vw, 4rem);
  line-height: 1;
  color: var(--color-accent);
}

.counter--mint .counter-number {
  color: var(--mint);
}

.counter-label {
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: var(--text-xs);
  margin-top: 0.5rem;
}

.counter-sub {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin: 0.4rem 0 0;
}

/* ---------- Map ---------- */
.map-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: var(--space-4);
  align-items: start;
}

.map-card {
  background: var(--color-surface);
  border: var(--border-ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: var(--space-2);
  position: sticky;
  top: calc(var(--nav-height) + var(--space-2));
}

.map-card svg {
  width: 100%;
  height: auto;
}

.pin {
  cursor: pointer;
  transition: transform 0.15s ease;
  transform-box: fill-box;
  transform-origin: 50% 100%;
}


.pin text {
  font-family: var(--font-body);
  font-weight: 900;
  font-size: 11px;
  fill: var(--cocoa);
  pointer-events: none;
}

.pin--hub text {
  fill: var(--white);
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.2rem;
  font-size: var(--text-xs);
  font-weight: 800;
  padding: 0.6rem 0.4rem 0;
}

.map-legend span::before {
  content: "";
  display: inline-block;
  width: 0.8rem;
  height: 0.8rem;
  border: 2px solid var(--color-ink);
  border-radius: 50%;
  margin-inline-end: 0.35rem;
  vertical-align: -0.1rem;
  background: var(--mint-soft);
}

.map-legend .lg-pack::before {
  background: var(--butter);
}

.map-legend .lg-hub::before {
  background: var(--pink-dark);
}

.map-legend .lg-host::before {
  background: var(--cream-3);
  border-radius: 20%;
}

.place-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.place {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: center;
  background: var(--color-surface);
  border: var(--border-ink);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s ease, background 0.15s ease;
}


.place-num {
  /* fixed pastel chips: the ink stays dark in both schemes */
  color: var(--cocoa);
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 900;
  border: 2px solid var(--color-ink);
  border-radius: var(--wonk-3);
  background: var(--mint-soft);
}

.place--pack .place-num {
  background: var(--butter);
}

.place--hub .place-num {
  background: var(--pink-dark);
  color: var(--white);
}

.place--host .place-num {
  background: var(--cream-3);
  border-radius: 30%;
}

.place h3 {
  font-family: var(--font-body);
  font-variation-settings: normal;
  font-weight: 800;
  font-size: var(--text-md);
  margin: 0;
}

.place p {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.place .badge {
  font-size: var(--text-2xs);
  padding: 0.15rem 0.5rem;
}

.place-detail {
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg-subtle);
  border: 2px dashed var(--color-ink);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  min-height: 3.2rem;
}

.place-detail strong {
  display: block;
  margin-bottom: 0.2rem;
}

/* ---------- Guardrails / promise ---------- */
.promise {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

.promise .card h3 {
  font-size: var(--text-lg);
}

/* ---------- Box sizes ---------- */
.sizes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

.size {
  position: relative;
  text-align: center;
  background: var(--color-surface);
  border: var(--border-ink);
  border-radius: var(--radius);
  padding: var(--space-3);
  box-shadow: var(--shadow-card);
}

.size--featured {
  background: var(--color-accent-soft);
  box-shadow: var(--shadow-pop);
  transform: translateY(-6px);
}

.size h3 {
  font-size: var(--text-xl);
  margin-bottom: 0.2rem;
}

.size .size-price {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.8rem, 1.2rem + 2vw, 2.6rem);
  line-height: 1;
  color: var(--color-accent-strong);
}

.size .size-value {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: 700;
  margin: 0.3rem 0 var(--space-2);
}

.size .size-value s {
  text-decoration-thickness: 2px;
}

.size ul {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-2);
  display: grid;
  gap: 0.35rem;
  font-size: var(--text-sm);
  font-weight: 700;
}

.size .badge {
  position: absolute;
  top: -0.9rem;
  inset-inline-start: 50%;
  translate: -50% 0;
  rotate: -3deg;
}

/* ---------- Bake-at-home card ---------- */
.revive {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
}

.revive li {
  list-style: none;
  background: var(--color-surface);
  border: 2px solid var(--color-ink);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  font-size: var(--text-sm);
}

.revive li strong {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-md);
  margin-bottom: 0.2rem;
}

.revive {
  padding: 0;
  margin: 0;
}

/* ---------- Crate figure ---------- */
.crate-figure {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-4);
  align-items: center;
}

.crate-figure > svg {
  width: 100%;
  max-width: 26rem;
  margin-inline: auto;
}

.crate-figure figcaption h3 {
  font-size: var(--text-xl);
}

.crate-figure figcaption p {
  color: var(--color-text-muted);
}

.crate-figure .checklist li {
  font-size: var(--text-sm);
}

/* ---------- Timeline (a bakery's day) ---------- */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
  position: relative;
}

.timeline li {
  background: var(--color-surface);
  border: var(--border-ink);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  font-size: var(--text-sm);
}

.timeline time {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--text-lg);
  color: var(--color-accent-strong);
  margin-bottom: 0.2rem;
}

.timeline li p {
  margin: 0;
  color: var(--color-text-muted);
}

.timeline li strong {
  display: block;
  margin-bottom: 0.15rem;
}

/* ---------- Compare (shelf vs box) ---------- */
.compare th:first-child,
.compare td:first-child {
  font-weight: 800;
  width: 28%;
}

/* ---------- Calculator ---------- */
.calc {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-4);
  align-items: center;
  background: var(--color-surface);
  border: var(--border-ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  padding: var(--space-4);
}

.calc label {
  display: block;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.calc input[type="range"] {
  width: 100%;
  /* native track is ~16px tall: below the 24px pointer-target floor */
  min-height: 2.75rem;
  font-size: 1rem;
  accent-color: var(--color-accent-strong);
  background: transparent;
  margin-bottom: var(--space-2);
  touch-action: pan-y;
}

.calc input[type="range"]:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

.calc .calc-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
  font-weight: 700;
}

.calc-out {
  text-align: center;
  background: var(--color-bg-subtle);
  border: 2px dashed var(--cocoa);
  border-radius: var(--radius);
  padding: var(--space-3);
}

.calc-out .big {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 60, "WONK" 1;
  font-weight: 900;
  font-size: clamp(2rem, 1.2rem + 3vw, 3.4rem);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--color-accent-strong);
}

.calc-out .sub {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: var(--text-xs);
  margin: 0.4rem 0 0.8rem;
}

.calc-out p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0;
}

.calc-out .honest {
  margin-top: 0.8rem;
  font-weight: 800;
  color: var(--color-eyebrow);
}

/* ---------- Two-column prose with aside ---------- */
.duo {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: var(--space-4);
  align-items: start;
}

.duo .prose {
  margin: 0;
  max-width: none;
  font-size: var(--text-md);
}

.duo .prose h2 {
  margin-top: 0;
}

/* ---------- Demo forms (client-side only) ---------- */
.form-card.is-done .demo-form {
  display: none;
}

.form-card .form-intro {
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.field select {
  -webkit-appearance: none;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--color-text) 50%),
    linear-gradient(135deg, var(--color-text) 50%, transparent 50%);
  background-position: calc(100% - 1.1rem) 1.2rem, calc(100% - 0.7rem) 1.2rem;
  background-size: 0.4rem 0.4rem, 0.4rem 0.4rem;
  background-repeat: no-repeat;
  padding-inline-end: 2.2rem;
}

.check-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.check-group input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.check-group label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  font-weight: 800;
  font-size: var(--text-sm);
  background: var(--color-surface);
  color: var(--color-text);
  border: 2px solid var(--color-ink);
  border-radius: var(--wonk-2);
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}


.check-group input:checked + label {
  background: var(--color-band);
  color: var(--color-on-band);
}

.check-group input:focus-visible + label {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

/* ---------- Range (second-life) ---------- */
.product-meta {
  flex-wrap: wrap;
  gap: 0.25rem 0.8rem;
}

.badge--butter {
  background: var(--butter);
}

.range-note {
  text-align: center;
  color: var(--color-text-muted);
  max-width: 40rem;
  margin: var(--space-3) auto 0;
  font-size: var(--text-sm);
}

/* ---------- Voices for three audiences ---------- */
.quote .role {
  display: inline-block;
  font-size: var(--text-2xs);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-eyebrow);
}

/* ---------- Responsive ---------- */
@media (max-width: 64rem) {
  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .timeline,
  .revive {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 52rem) {
  .ladder,
  .promise,
  .sizes,
  .map-wrap,
  .calc,
  .duo,
  .crate-figure {
    grid-template-columns: minmax(0, 1fr);
  }

  .ladder,
  .promise {
    max-width: 34rem;
    margin-inline: auto;
  }

  .rung:nth-child(1),
  .rung:nth-child(3) {
    rotate: 0deg;
  }

  .size--featured {
    transform: none;
  }

  .map-card {
    position: static;
  }

  .counter-grid {
    grid-template-columns: minmax(0, 1fr);
    max-width: 26rem;
  }

  .counter:nth-child(1),
  .counter:nth-child(2) {
    rotate: 0deg;
  }
}

@media (max-width: 38rem) {
  .steps,
  .timeline,
  .revive {
    grid-template-columns: minmax(0, 1fr);
  }

  .step {
    padding-top: var(--space-3);
    padding-inline-start: 4rem;
  }

  .step::before {
    top: 1rem;
    inset-inline-start: 1rem;
  }

  .step svg {
    display: none;
  }

  .audience-row {
    justify-content: center;
  }

  .place {
    grid-template-columns: 2rem minmax(0, 1fr);
  }

  .place .badge {
    grid-column: 2;
    justify-self: start;
  }

  .calc {
    padding: var(--space-3);
  }
}

/* =====================================================================
   v4 — Ugly Shelf model (in-shop shelf, board, ledger)
   ===================================================================== */

/* ----- Shelf board ----- */
.board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}
.shelf-card {
  background: var(--color-surface);
  border: var(--border-ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
}
.shelf-card:nth-child(3n + 2) {
  rotate: -0.4deg;
}
.shelf-card[data-status="gone"] {
  background: var(--color-bg-subtle);
  box-shadow: none;
}
.shelf-card[data-status="gone"] h3 {
  text-decoration: line-through;
  text-decoration-color: var(--color-accent);
  text-decoration-thickness: 3px;
}
.shelf-card h3 {
  margin: 0;
  font-size: var(--text-lg);
}
.shelf-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.shelf-plus {
  font-size: var(--text-xs);
  font-weight: 800;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
}
.shelf-where {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: 700;
}
.shelf-items {
  list-style: none;
  margin: 0.2rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.shelf-items li {
  font-size: var(--text-xs);
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  color: var(--cocoa);
  border: 2px solid var(--cocoa);
  border-radius: 999px;
  background: var(--butter-soft);
}
.shelf-card[data-status="gone"] .shelf-items li {
  background: transparent;
  border-style: dashed;
  color: var(--color-text-muted);
}
.shelf-price {
  margin: auto 0 0;
  padding-top: 0.5rem;
  border-top: 2px dashed var(--color-ink);
  font-size: var(--text-sm);
  font-weight: 800;
  color: var(--color-accent-strong);
}
.shelf-card.is-hidden {
  display: none;
}
.badge--gone {
  background: var(--color-bg-subtle);
  color: var(--color-text-muted);
  border-style: dashed;
}
.board-empty {
  text-align: center;
  font-weight: 800;
  color: var(--color-text-muted);
  padding: var(--space-4);
}

/* ----- Hero: let the long pink phrase wrap once the grid stacks -----
   The theme keeps .hero h1 .squiggle on one line down to 24rem, which suits a
   short phrase. This hero's is a full sentence, so it must wrap sooner. */
@media (max-width: 52rem) {
  .hero--network h1 .squiggle {
    white-space: normal;
  }
}

/* ----- Notice without an icon ----- */
.notice--stack {
  display: block;
}
.notice--stack p + p {
  margin-top: 0.75rem;
}

/* ----- Filters ----- */
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: var(--space-3);
}
.filter-btn {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: var(--text-sm);
  padding: 0.45rem 0.9rem;
  border: var(--border-ink);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--color-ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.filter-btn[aria-pressed="true"],
.filter-btn.is-active {
  background: var(--color-band);
  color: var(--color-on-band);
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--color-ink);
}
.filter-btn:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}
.filter-count {
  margin-inline-start: auto;
  font-size: var(--text-sm);
  font-weight: 800;
  color: var(--color-text-muted);
}

/* ----- Map: shelf status pins ----- */
.map-legend .lg-later::before {
  background: var(--butter);
}
.map-legend .lg-gone::before {
  background: var(--color-bg-subtle);
  border-style: dashed;
}
.place--later .place-num {
  background: var(--butter);
}
.place--gone .place-num {
  background: var(--color-bg-subtle);
  border-style: dashed;
  color: var(--color-text-muted);
}
.place--gone h3 {
  color: var(--color-text-muted);
}
.pin--gone {
  opacity: 0.7;
}
.pin--gone text {
  fill: var(--cocoa-soft);
}

/* ----- Counters: third colour ----- */
.counter-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: none;
}
.counter--butter .counter-number {
  color: var(--color-text);
}
.counter--butter {
  background: var(--color-highlight-soft);
}
.counter-grid--three .counter:nth-child(3) {
  rotate: 0.6deg;
}

/* ----- Steps: five up ----- */
.steps--five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

/* ----- Fit / doesn't fit ----- */
.fit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-3);
}
.fit {
  background: var(--color-surface);
  border: var(--border-ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  padding: var(--space-4);
}
.fit--no {
  border-radius: var(--radius);
  background: var(--color-bg-subtle);
}
.fit h3 {
  margin: 0.75rem 0 0.5rem;
}
.fit .checklist {
  margin-top: var(--space-2);
}
.fit-alt {
  margin: var(--space-3) 0 0;
  padding: var(--space-2) var(--space-3);
  border-inline-start: 5px solid var(--color-accent);
  background: var(--color-surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: var(--text-sm);
}

/* ----- Plans ----- */
.sizes--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 54rem;
  margin-inline: auto;
}
.size-price span {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 800;
  color: var(--color-text-muted);
}

/* ----- Form: span labels for groups ----- */
.field .label {
  display: block;
  font-weight: 800;
  font-size: var(--text-sm);
  margin-bottom: 0.4rem;
}

/* ----- Ledger table + badge ----- */
.ledger td:first-child {
  font-weight: 800;
  white-space: nowrap;
}
.badge-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: var(--space-4);
  align-items: center;
}
.ledger-badge {
  margin: 0;
  text-align: center;
}
.ledger-badge > svg {
  width: min(100%, 20rem);
  height: auto;
  filter: drop-shadow(6px 6px 0 var(--cocoa));
  rotate: -2deg;
}
.ledger-badge figcaption {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.copyline {
  margin: var(--space-2) 0;
  padding: var(--space-3);
  background: var(--color-surface);
  border: var(--border-ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  font-family: var(--font-display);
  font-size: var(--text-md);
}
.copyline p {
  margin: 0;
}

/* ----- Responsive ----- */
@media (max-width: 64rem) {
  .board,
  .steps--five {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .steps--five .step:last-child {
    grid-column: span 2;
  }
  .counter-grid--three {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .counter-grid--three .counter:nth-child(3) {
    grid-column: span 2;
    max-width: 26rem;
    margin-inline: auto;
  }
}
@media (max-width: 52rem) {
  .fit-grid,
  .sizes--two,
  .badge-row {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 38rem) {
  .board,
  .steps--five {
    grid-template-columns: minmax(0, 1fr);
  }
  .steps--five .step:last-child {
    grid-column: auto;
  }
  .counter-grid--three,
  .counter-grid--three .counter:nth-child(3) {
    grid-template-columns: minmax(0, 1fr);
    grid-column: auto;
  }
  .filter-count {
    margin-inline-start: 0;
    width: 100%;
  }
}

/* =====================================================================
   v8 — the shelf board becomes photo-led (see bdplan/16)
   ===================================================================== */

/* ----- The baker's photo, framed by us, not by them ----- */
.shelf-photo {
  position: relative;
  margin: 0 0 0.75rem;
  border: var(--border-ink);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-bg-subtle);
  line-height: 0;
}
.shelf-photo > svg {
  width: 100%;
  height: auto;
  display: block;
}
.shelf-photo figcaption {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  line-height: 1.3;
  font-size: var(--text-xs);
  font-weight: 800;
  color: var(--white);
  background: var(--ink-veil-82);
  padding: 0.35rem 0.6rem;
}
.shelf-card[data-status="gone"] .shelf-photo {
  filter: saturate(0.5) opacity(0.85);
}

/* The badge word: proud, one word, ours not theirs */
.lane {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  font-family: var(--font-display);
  font-variation-settings: "WONK" 1;
  font-weight: 900;
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.15rem 0.55rem;
  border: 2.5px solid var(--color-ink);
  border-radius: 999px;
  background: var(--butter);
  color: var(--cocoa);
}
.lane--yesterday {
  background: var(--color-success-soft);
}

.lane--yesterday,
.lane--today {
  color: var(--color-text);
}

/* Two lanes, two prices — the discount is not one number any more */
.shelf-lanes {
  display: grid;
  gap: 0.5rem;
  margin: auto 0 0;
  padding-top: 0.6rem;
  border-top: 2px dashed var(--color-ink);
}
.shelf-lane {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.2rem 0.5rem;
  font-size: var(--text-sm);
}

.shelf-lane > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.shelf-lane .lane-price {
  flex: none;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--color-accent-hover);
  white-space: nowrap;
}
.shelf-note {
  margin: 0.15rem 0 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-style: italic;
}

/* ----- The phone flow mock ----- */
.phone-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
  align-items: start;
}
.phone {
  background: var(--cocoa);
  border: var(--border-ink);
  border-radius: 1.6rem;
  padding: 0.5rem;
  box-shadow: var(--shadow-pop);
}
.phone-screen {
  /* a picture of a phone, so it keeps paper colours in both schemes */
  background: var(--art-cream);
  color: var(--cocoa);
  border-radius: 1.15rem;
  padding: 0.85rem 0.75rem 1rem;
  min-height: 15rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.phone-step {
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pink-dark);
}
.phone-screen h3 {
  font-size: var(--text-md);
  margin: 0;
  line-height: 1.2;
}
.phone-screen p {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--cocoa-soft);
}
.phone-screen > svg {
  width: 100%;
  height: auto;
  border: 2.5px solid var(--cocoa);
  border-radius: 0.6rem;
}
.chip-row {
  display: flex;
  flex-wrap: wrap;
  min-width: 0;
  gap: 0.3rem;
}
.chip {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border: 2px solid var(--cocoa);
  border-radius: 999px;
  background: var(--white);
  color: var(--cocoa);
}
.chip.is-on {
  background: var(--pink-dark);
  color: var(--white);
}
.phone-caption {
  margin-top: 0.6rem;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.phone-time {
  display: inline-block;
  margin-top: 0.3rem;
  font-weight: 800;
  color: var(--cocoa);
  font-size: var(--text-xs);
}

/* ----- Evidence callout ----- */
.evidence {
  border-inline-start: 5px solid var(--mint);
  background: var(--color-surface);
  border-start-start-radius: 0;
  border-end-start-radius: 0;
  border-start-end-radius: var(--radius-sm);
  border-end-end-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  margin: var(--space-3) 0 0;
  font-size: var(--text-sm);
}
.evidence p {
  margin: 0;
}
.evidence cite {
  display: block;
  margin-top: 0.35rem;
  font-style: normal;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

@media (max-width: 64rem) {
  .phone-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 38rem) {
  .phone-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ----- Grouped radio/checkbox questions need a real fieldset ----- */
.check-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.check-fieldset > legend {
  display: block;
  padding: 0;
  font-weight: 800;
  font-size: var(--text-sm);
  margin-bottom: 0.4rem;
}


/* ---------- Pointer-gated hover states ----------
   Coarse pointers would otherwise keep a tapped control stuck in :hover. */
@media (hover: hover) and (pointer: fine) {
  .audience-row a:hover {
    background: var(--color-highlight-soft);
    transform: rotate(-1.5deg);
  }

  .pin:hover {
    transform: scale(1.18);
  }

  .place:hover {
    background: var(--color-highlight-soft);
    transform: translateX(3px) rotate(-0.4deg);
  }

  .check-group label:hover {
    background: var(--color-highlight-soft);
    transform: rotate(-1.5deg);
  }

  .filter-btn:hover {
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 var(--color-ink);
  }
}

/* Selected states stay outside the hover query: they are data, not pointer. */
.pin.is-active {
  transform: scale(1.18);
}

.place.is-active {
  background: var(--color-highlight-soft);
  transform: translateX(3px) rotate(-0.4deg);
}

@media (prefers-reduced-motion: reduce) {
  .pin:hover,
  .place:hover,
  .filter-btn:hover,
  .audience-row a:hover,
  .check-group label:hover {
    transform: none;
  }
}

/* The phone mock is a drawing of a screen: every colour inside it is pinned to
   the paper palette so it survives dark mode unchanged. */
.phone-screen .lane-price,
.phone-screen .shelf-price {
  color: var(--pink-deep);
}

.phone-screen .lane,
.phone-screen .shelf-lane span,
.phone-screen strong,
.phone-screen h3 {
  color: var(--cocoa);
}

/* =====================================================================
   v16 — the board goes live: time-aware statuses, actions, passport,
   wall of gone, nudge, city vote, the trial and the story-card maker.
   ===================================================================== */

/* ----- Status-driven card looks (JS sets data-status from the clock) ----- */
.shelf-card[data-status="done"],
.shelf-card[data-status="off"] {
  background: var(--color-bg-subtle);
  box-shadow: none;
}
.shelf-card[data-status="later"] .shelf-photo,
.shelf-card[data-status="off"] .shelf-photo {
  filter: saturate(0.6) opacity(0.75);
}
.shelf-card[data-status="done"] .shelf-photo {
  filter: saturate(0.5) opacity(0.8);
}
.shelf-card[data-status="gone"] .shelf-photo::after {
  content: "ALL GONE";
  position: absolute;
  inset-inline-start: 50%;
  top: 44%;
  translate: -50% -50%;
  rotate: -9deg;
  padding: 0.25rem 1rem;
  font-family: var(--font-display);
  font-variation-settings: "WONK" 1;
  font-weight: 900;
  font-size: clamp(1.4rem, 1rem + 2vw, 2rem);
  letter-spacing: 0.04em;
  color: var(--pink);
  background: var(--cream);
  border: 4px solid var(--pink);
  border-radius: 0.6rem;
  line-height: 1.2;
  pointer-events: none;
}
.shelf-card.is-linked {
  outline: 4px solid var(--color-focus);
  outline-offset: 4px;
}

/* ----- Card actions ----- */
.shelf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}
.icon-btn {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: var(--text-xs);
  min-height: 2.25rem;
  padding: 0.3rem 0.7rem;
  border: 2px solid var(--color-ink);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--color-ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.icon-btn[aria-pressed="true"] {
  background: var(--color-accent-soft);
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--color-ink);
}
.icon-btn--stamp[aria-pressed="true"] {
  background: var(--color-success-soft);
}
.icon-btn:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

/* ----- Toast ----- */
.toast {
  position: fixed;
  inset-inline-start: 50%;
  bottom: calc(1rem + var(--safe-bottom));
  translate: -50% 1rem;
  z-index: 60;
  max-width: min(92vw, 30rem);
  margin: 0;
  padding: 0.6rem 1rem;
  font-size: var(--text-sm);
  font-weight: 800;
  color: var(--color-on-band);
  background: var(--color-band);
  border: 2px solid var(--color-on-band);
  border-radius: 999px;
  box-shadow: var(--shadow-pop);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, translate 0.2s ease;
}
.toast.is-visible {
  opacity: 1;
  translate: -50% 0;
}
body.has-order-bar .toast {
  bottom: calc(5.5rem + var(--safe-bottom));
}

/* ----- The live line under the hero, and the clock label ----- */
.live-line {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: var(--text-sm);
}
.live-line::before {
  content: "";
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--color-success);
  border: 2px solid var(--color-ink);
  flex: none;
}
:root[data-board-state="before"] .live-line::before {
  background: var(--color-highlight);
}
:root[data-board-state="after"] .live-line::before {
  background: var(--color-bg-subtle);
}
:root[data-board-state="live"] .live-line::before {
  animation: pulse 1.6s ease-in-out infinite;
}

/* ----- Nudge (email capture) card ----- */
.nudge {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: var(--space-3);
  align-items: center;
  background: var(--color-highlight-soft);
  color: var(--cocoa);
  border: var(--border-ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  padding: var(--space-3) var(--space-4);
  margin-top: var(--space-4);
}
.nudge h3 {
  color: var(--cocoa);
  font-size: var(--text-xl);
  margin: 0 0 0.3rem;
}
.nudge p {
  color: var(--cocoa);
  margin: 0;
  font-size: var(--text-sm);
}
.nudge .subscribe-form {
  margin: 0;
}
.nudge .subscribe-form input[type="email"] {
  background: var(--white);
  color: var(--cocoa);
  border-color: var(--cocoa);
}
.nudge .subscribe-note {
  color: var(--cocoa);
}
.nudge .subscribe-form.is-done [data-after-success] {
  margin-top: 0.6rem;
}

/* ----- City vote ----- */
.subscribe-form--city {
  display: grid;
  gap: var(--space-2);
}
.subscribe-form--city .check-group label {
  font-size: var(--text-xs);
}
.subscribe-form--city .field {
  margin: 0;
}
.subscribe-form--city .field input[type="email"],
.subscribe-form--city .field input[type="text"] {
  width: 100%;
}
.subscribe-form--city .row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}
.subscribe-form--city .subscribe-note {
  margin: 0;
}

/* ----- Wall of gone + passport ----- */
.gone-wall {
  background: var(--color-surface);
  border: var(--border-ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: var(--space-3);
}
.gone-wall h3 {
  margin: 0 0 0.6rem;
  font-size: var(--text-xl);
}
.gone-wall ol {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  display: grid;
  gap: 0.35rem;
  font-size: var(--text-sm);
}
.gone-wall ol strong {
  display: inline-block;
  min-width: 4.5rem;
  font-family: var(--font-display);
  font-size: var(--text-md);
  color: var(--color-accent-strong);
  font-variant-numeric: tabular-nums;
}
.gone-wall ol:empty + p {
  margin-top: 0;
}
.gone-wall p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.passport {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: 0.75rem;
}
.passport li {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0.75rem;
  background: var(--color-surface);
  border: 2px dashed var(--color-ink);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 800;
}
.passport li span[data-when] {
  color: var(--color-text-muted);
  font-weight: 700;
}
.passport li::before {
  content: "";
  position: absolute;
  inset-inline-end: 0.6rem;
  top: 0.6rem;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  border: 3px solid var(--color-ink);
  opacity: 0.18;
}
.passport li.is-stamped {
  border-style: solid;
  background: var(--color-success-soft);
  color: var(--cocoa);
}
.passport li.is-stamped span[data-when] {
  color: var(--cocoa-soft);
}
.passport li.is-stamped::before {
  opacity: 1;
  border-color: var(--pink-dark);
  background: var(--pink-soft);
  rotate: -12deg;
}
.passport li.is-stamped::after {
  content: "✓";
  position: absolute;
  inset-inline-end: 1.2rem;
  top: 1.05rem;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.3rem;
  color: var(--pink-dark);
  rotate: -12deg;
}
.passport-progress {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  margin: var(--space-2) 0 0;
  font-weight: 800;
}
.passport-progress strong {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-accent-strong);
}
.btn--small {
  min-height: 2.5rem;
  padding: 0.4rem 0.9rem;
  font-size: var(--text-sm);
}
.passport-done {
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-highlight-soft);
  color: var(--cocoa);
  border: var(--border-ink);
  border-radius: var(--radius-sm);
  font-weight: 800;
}

/* ----- The forty-second trial ----- */
.trial {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: var(--space-4);
  align-items: start;
}
.trial .phone {
  max-width: 22rem;
  margin-inline: auto;
}
.trial .phone-screen {
  min-height: 24rem;
}
.trial-screen[hidden] {
  display: none;
}
.trial-screen {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
}
.trial-screen .btn {
  margin-top: auto;
  align-self: flex-start;
}
.trial-screen > svg {
  width: 100%;
  height: auto;
  border: 2.5px solid var(--cocoa);
  border-radius: 0.6rem;
}
.trial-hud {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  font-size: var(--text-xs);
  font-weight: 800;
  color: var(--cocoa-soft);
}
.trial-hud [data-trial-timer] {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--pink-dark);
  font-variant-numeric: tabular-nums;
}
.trial-aside .checklist li {
  font-size: var(--text-sm);
}
.trial-result {
  margin: var(--space-2) 0 0;
  font-weight: 800;
}
.trial-best {
  margin: 0.3rem 0 0;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.phone-screen .shutter {
  align-self: center;
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 50%;
  border: 4px solid var(--cocoa);
  background: var(--white);
  box-shadow: inset 0 0 0 4px var(--cream);
  cursor: pointer;
  margin-top: auto;
}
.phone-screen .shutter:focus-visible {
  outline: 3px solid var(--burnt);
  outline-offset: 3px;
}
.phone-screen .btn {
  min-height: 2.5rem;
  font-size: var(--text-sm);
}

/* ----- Story-card maker ----- */
.maker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-4);
  align-items: start;
}
.maker-form {
  display: grid;
  gap: var(--space-2);
}
.maker-form .field {
  margin: 0;
}
.maker-form .field input,
.maker-form .field select {
  width: 100%;
}
.maker-form .field[hidden] {
  display: none;
}
.maker-preview {
  background: var(--color-surface);
  border: var(--border-ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  padding: var(--space-2);
  text-align: center;
}
.maker-preview canvas {
  width: min(100%, 22rem);
  height: auto;
  border: 2px solid var(--color-ink);
  border-radius: var(--radius-sm);
  background: var(--cream);
}
.maker-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-top: var(--space-2);
}
.maker-note {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin: 0.6rem 0 0;
}

/* ----- Map pins: colour by status through CSS, not inline fills ----- */
.pin path {
  fill: var(--art-mint-soft);
}
.pin--later path {
  fill: var(--art-butter);
}
.pin--gone path {
  fill: var(--art-cream-2);
}

/* ----- Calculator currency picker ----- */
.calc-currency {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 800;
}
.calc-currency select {
  font: inherit;
  font-weight: 800;
  min-height: 2.5rem;
  padding: 0.3rem 0.6rem;
  border: 2px solid var(--color-ink);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
}

/* ----- Evening-shelf note chip ----- */
.shelf-mode {
  display: inline-block;
  font-size: var(--text-2xs);
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border: 2px solid var(--color-ink);
  border-radius: var(--wonk-3);
  background: var(--color-highlight-soft);
  color: var(--cocoa);
}

@media (max-width: 52rem) {
  .nudge,
  .trial,
  .maker {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (hover: hover) and (pointer: fine) {
  .icon-btn:hover {
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0 var(--color-ink);
  }
}
@media (prefers-reduced-motion: reduce) {
  .icon-btn:hover {
    transform: none;
  }
  :root[data-board-state="live"] .live-line::before {
    animation: none;
  }
}

.shelf-lane--terms {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ==========================================================================
   v17 - counters and voices off the "three equal cards" grid
   Counters: one lead figure with two supporting tiles stacked beside it.
   Voices: one unboxed pull-quote, two short quotes under a single rule.
   ========================================================================== */
.counter-grid--lead {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  max-width: none;
  gap: var(--space-3);
}
.counter-grid--lead .counter {
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.counter-grid--lead .counter:first-child {
  grid-row: span 2;
  background: var(--color-accent-soft);
  padding: var(--space-4);
  rotate: -0.5deg;
}
.counter-grid--lead .counter:first-child .counter-number {
  font-size: clamp(3.4rem, 2rem + 6vw, 7rem);
  /* plain accent is 2.9:1 on accent-soft; strong/hover clear 3:1 large-text in each theme */
  color: var(--color-accent-strong);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .counter-grid--lead .counter:first-child .counter-number {
    color: var(--color-accent-hover);
  }
}
.counter-grid--lead .counter:first-child .counter-label {
  font-size: var(--text-sm);
}
.counter-grid--lead .counter:first-child .counter-sub {
  font-size: 1rem;
  max-width: 32ch;
}
.counter-grid--lead .counter:not(:first-child) .counter-number {
  font-size: clamp(2rem, 1.4rem + 2vw, 3rem);
}
.counter-grid--lead .counter:nth-child(2) {
  rotate: 0.6deg;
}
.counter-grid--lead .counter:nth-child(3) {
  rotate: -0.3deg;
}
.counter-grid--lead .counter-number {
  overflow-wrap: anywhere;
}

.voices {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: var(--space-5);
  row-gap: var(--space-4);
  margin: 0;
}
.voice {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.voice blockquote {
  margin: 0;
}
.voice p {
  margin: 0;
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 60, "WONK" 1;
  font-size: var(--text-lg);
  line-height: 1.4;
  max-width: 40ch;
}
.voice figcaption {
  font-weight: 800;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.voice--lead {
  grid-column: 1 / -1;
  padding-bottom: var(--space-4);
  border-bottom: var(--border-ink);
}
.voice--lead p {
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1.2;
  max-width: 30ch;
}
.voice--lead p::first-letter {
  color: var(--color-accent);
}
.voice--lead figcaption {
  font-size: 1rem;
  color: var(--color-text);
}

@media (max-width: 52rem) {
  .counter-grid--lead {
    grid-template-columns: minmax(0, 1fr);
    max-width: 30rem;
  }
  .counter-grid--lead .counter:first-child {
    grid-row: auto;
    padding: var(--space-3) var(--space-4);
  }
  .counter-grid--lead .counter {
    rotate: 0deg;
  }
  .voices {
    grid-template-columns: minmax(0, 1fr);
    row-gap: var(--space-3);
  }
  .voice--lead {
    padding-bottom: var(--space-3);
  }
  .voice--lead p {
    font-size: var(--text-xl);
  }
}

/* ==========================================================================
   v18 - one hero language across the site
   Inner pages get the home page's split: copy left, a real panel right
   (live tally on Today, the card a bakery gets on For bakeries, the month's
   numbers on the Ledger). Panels read tokens only, so dark mode follows.
   ========================================================================== */
.page-hero--split {
  text-align: start;
  padding-block: var(--space-5);
}
.page-hero--split > .container {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: var(--space-5);
  align-items: center;
}
.page-hero--split h1 {
  max-width: 14ch;
}
.page-hero--split p.lead {
  margin-inline: 0;
  max-width: 34rem;
}
/* theme.css styles every .page-hero p (large, muted, centred); undo that for
   everything in the split hero except the lead */
.page-hero--split p:not(.lead) {
  font-size: var(--text-sm);
  max-width: none;
  margin-inline: 0;
}
.page-hero--split .eyebrow {
  font-size: var(--text-xs);
  color: var(--color-eyebrow);
}
.page-hero--split .panel-title {
  font-size: var(--text-md);
  color: var(--color-text);
}
.page-hero--split .shelf-where {
  color: var(--color-text-muted);
}
.page-hero--split + .section {
  padding-top: var(--space-5);
}
.page-hero--split .hero-ctas {
  margin-top: var(--space-3);
  margin-bottom: 0;
}

.hero-panel {
  background: var(--color-surface);
  border: var(--border-ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  padding: var(--space-4);
  rotate: 0.8deg;
}
.hero-panel--mint {
  background: var(--color-success-soft);
}
.hero-panel--butter {
  background: var(--color-highlight-soft);
}
.panel-title {
  font-weight: 900;
  font-size: var(--text-md);
  margin: 0 0 var(--space-2);
}
.panel-foot {
  margin: var(--space-3) 0 0;
  padding-top: var(--space-2);
  border-top: 2px dashed var(--color-ink);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.panel-foot strong {
  color: var(--color-text);
}

.snap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr));
  gap: var(--space-2) var(--space-3);
  margin: 0;
}
.snap > div {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 0.2rem;
}
.snap dt {
  font-weight: 800;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.snap dd {
  margin: 0;
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 60, "WONK" 1;
  font-weight: 900;
  font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2.1rem);
  line-height: 1;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.snap .snap-lead {
  grid-column: 1 / -1;
}
.snap .snap-lead dd {
  font-size: clamp(3.6rem, 2.4rem + 5vw, 6.5rem);
}

.hero-panel-wrap {
  position: relative;
  padding: var(--space-3) var(--space-2);
}
.shelf-card--preview {
  max-width: 24rem;
  margin-inline: auto;
  rotate: 1deg;
}
.hero-panel-wrap .sticker {
  z-index: 1;
}

/* ----- Charter: one lead promise, four more; not the "five steps" grid ----- */
.charter {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-3);
}
.charter-item {
  grid-column: span 2;
  background: var(--color-surface);
  border: var(--border-ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: var(--space-3);
}
.charter-item:nth-child(2) {
  grid-column: span 4;
}
.charter-item--lead {
  grid-column: span 2;
  grid-row: span 1;
  background: var(--color-accent-soft);
}
.charter-item h3 {
  font-size: var(--text-xl);
  margin-bottom: 0.4rem;
}
.charter-item--lead h3 {
  font-size: clamp(2.4rem, 1.6rem + 3vw, 3.6rem);
  line-height: 1;
}
.charter-item p {
  margin: 0;
  color: var(--color-text-muted);
}
.charter-item:nth-child(odd) {
  rotate: -0.4deg;
}
.charter-item:nth-child(even) {
  rotate: 0.4deg;
}

@media (max-width: 52rem) {
  .page-hero--split {
    text-align: center;
  }
  .page-hero--split > .container {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-4);
  }
  .page-hero--split h1,
  .page-hero--split p.lead {
    margin-inline: auto;
  }
  .page-hero--split .hero-ctas {
    justify-content: center;
  }
  .page-hero--split {
    padding-block: var(--space-4);
  }
  .page-hero--split + .section {
    padding-top: var(--space-4);
  }
  .hero-panel-wrap {
    text-align: start;
  }
  .hero-panel {
    max-width: 28rem;
    margin-inline: auto;
    width: 100%;
    text-align: start;
    rotate: 0deg;
    padding: var(--space-3);
  }
  .charter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .charter-item,
  .charter-item:nth-child(2),
  .charter-item--lead {
    grid-column: span 1;
  }
  .charter-item--lead {
    grid-column: 1 / -1;
  }
}
@media (max-width: 38rem) {
  .charter {
    grid-template-columns: minmax(0, 1fr);
  }
  .charter-item {
    rotate: 0deg;
  }
}

/* ----- Board: the ninth cell is an open invitation, not a gap ----- */
.board-invite {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-3);
  border: 3px dashed var(--color-ink);
  border-radius: var(--radius);
  background: var(--color-accent-soft);
  rotate: 0.6deg;
}
.board-invite h3 {
  font-size: var(--text-xl);
  margin: 0;
}
.board-invite p {
  margin: 0;
  color: var(--color-text-muted);
}
.board-invite-num {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 60, "WONK" 1;
  font-weight: 900;
  font-size: clamp(4rem, 3rem + 4vw, 6.5rem);
  line-height: 0.9;
  color: var(--color-accent-strong);
}
.board-invite .board-invite-num {
  color: var(--color-accent-strong);
}
.board-invite-alt {
  font-size: var(--text-sm);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .board-invite .board-invite-num {
    color: var(--color-accent-hover);
  }
}
@media (max-width: 64rem) {
  .board-invite {
    grid-column: 1 / -1;
  }
}
@media (max-width: 38rem) {
  .board-invite {
    rotate: 0deg;
  }
}

/* ----- For bakeries: sign-up is a split, pitch left, form right ----- */
.signup-split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: var(--space-5);
  align-items: start;
}
.signup-split .form-card {
  max-width: none;
  margin: 0;
}
.signup-aside h2 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-3);
}
.next-steps {
  list-style: none;
  margin: 0 0 var(--space-3);
  padding: 0;
  counter-reset: next;
  display: grid;
  gap: var(--space-2);
}
.next-steps li {
  counter-increment: next;
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr);
  column-gap: var(--space-2);
  align-items: start;
}
.next-steps li::before {
  content: counter(next);
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--text-lg);
  background: var(--color-highlight);
  color: var(--cocoa);
  border: var(--border-ink);
  border-radius: var(--wonk-1);
}
.next-steps strong {
  font-size: var(--text-lg);
}
.next-steps span {
  color: var(--color-text-muted);
}
.signup-note {
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
@media (min-width: 52.01rem) {
  .signup-aside {
    position: sticky;
    top: calc(var(--nav-height) + var(--space-3));
  }
}
@media (max-width: 52rem) {
  .signup-split {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-4);
  }
}

/* ----- Kit: give the crate drawing the room it needs ----- */
@media (min-width: 52.01rem) {
  .crate-figure {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  }
  .crate-figure > svg {
    max-width: 36rem;
  }
}

/* ==========================================================================
   v19 - For bakeries, "Five things a bin can't": a hero + four bento.
   The lead tile carries the one number bakers remember (40 seconds) and
   hands off to the stopwatch trial; the four supporting tiles are short,
   tinted, and tilt the brand's way. Not the charter's 2+3, not the steps.
   ========================================================================== */
.perks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(0, auto);
  gap: var(--space-3);
}
.perk {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: var(--color-surface);
  border: var(--border-ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: var(--space-3);
  transition: translate var(--duration-3) var(--ease-out), box-shadow var(--duration-3) var(--ease-out);
}
.perk h3 {
  font-size: var(--text-lg);
  margin: 0;
}
.perk p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
/* the drawings keep paper colours in both themes, so they sit on a paper plate */
.perk > svg {
  width: 3.4rem;
  height: 3.4rem;
  flex: none;
  padding: 0.45rem;
  background: var(--color-surface-art);
  border: 2px solid var(--color-ink);
  border-radius: var(--wonk-2);
}
.perk:nth-child(2) { rotate: 0.7deg; }
.perk:nth-child(3) { rotate: -0.5deg; }
.perk:nth-child(4) { rotate: -0.6deg; }
.perk:nth-child(5) { rotate: 0.5deg; }
.perk--mint { background: var(--color-success-soft); }
.perk--butter { background: var(--color-highlight-soft); }

.perk--lead {
  grid-column: span 2;
  grid-row: span 2;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--color-accent-soft);
  box-shadow: var(--shadow-pop);
  rotate: -0.8deg;
}
.perk--lead h3 {
  font-size: var(--text-2xl);
  line-height: 1.1;
}
.perk--lead p {
  font-size: var(--text-lg);
  max-width: 34ch;
}
.perk--lead .btn {
  align-self: flex-start;
  margin-top: var(--space-1);
}
.perk .perk-figure {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 60, "WONK" 1;
  font-weight: 900;
  font-size: clamp(5rem, 3rem + 7vw, 9rem);
  line-height: 0.85;
  color: var(--color-accent-strong);
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}
.perk-figure span {
  font-size: 0.3em;
  font-weight: 800;
  color: var(--color-text);
}
.perk .perk-figure-label {
  font-weight: 800;
  font-size: var(--text-sm);
  color: var(--color-text);
  margin-top: -0.4rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .perk .perk-figure {
    color: var(--color-accent-hover);
  }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .perk:hover {
    translate: 0 -4px;
    box-shadow: var(--shadow-pop);
  }
}

@media (max-width: 64rem) {
  .perks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .perk--lead {
    grid-row: auto;
  }
}
@media (max-width: 38rem) {
  .perks {
    grid-template-columns: minmax(0, 1fr);
  }
  .perk--lead {
    grid-column: auto;
    padding: var(--space-3);
  }
  .perk,
  .perk--lead {
    rotate: 0deg;
  }
}
/* Tablet: the lead tile spans the row, so set figure beside the words */
@media (max-width: 64rem) and (min-width: 38.01rem) {
  .perk--lead {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "fig  head"
      "lab  body"
      ".    cta";
    column-gap: var(--space-4);
    row-gap: var(--space-2);
    align-items: start;
  }
  .perk--lead .perk-figure { grid-area: fig; }
  .perk--lead .perk-figure-label { grid-area: lab; margin-top: 0; }
  .perk--lead h3 { grid-area: head; }
  .perk--lead > p:not([class]) { grid-area: body; }
  .perk--lead .btn { grid-area: cta; justify-self: start; }
}
