/* ==========================================================================
   Artisan Tempeh — the order page and the thanks page (public/css/order.css)
   "The stall counter". Builds on site.css: its tokens, .batik-* layers, .notice-panel, .choice, .stepper, .chip,
   .badge, .tampah-wrap, .leaf-bed, .phrase. Only the apron palette, nothing under 1rem, and motion only inside
   prefers-reduced-motion: no-preference (last section).

   CLASS INDEX
   Order page
     .order-mast        — first block of <main>: the masthead beside the shop sign (sand band, parang).
                          .order-mast-top = .order-intro (phrase, h1, lede) + .order-mast-art (tampah on a banana
                          leaf with a price tag, desktop only); then .banner and the rules sign (.notice-panel)
     .banner            — dismissible paper strip (resume / price update); data-type="error" = chocolate edge
     .banner-dismiss    — 44px round close button
     .order-page        — second block: bone band with ceplok; holds .order-layout
     .order-layout      — form | receipt grid: one column, form + 24rem aside from 64em
     .order-aside       — sticky (64em and up) wrapper of the receipt
     .order-step        — one numbered step, a paper card with a kawung strip along its top. .step-head holds the
                          .step-num (site.css kawung numeral) and .step-title (h2 + .step-lead)
     .order-step.is-open — step 1: no card of its own, the head is a paper plaque and the products lie on the batik
     .product-bed       — the .leaf-bed under the product cards
     .product           — product card (rendered by order.js): lurik selvedge, .product-media (bone, kawung frame,
                          holds the .tampah-wrap), .product-head (h3, .product-size, .product-desc, .product-tags)
     .bundle-list       — rows of .bundle: .bundle-main (.bundle-label + badge, .bundle-price, .bundle-per) and a
                          .stepper with 48px buttons; .bundle.is-selected = olive ring
     .choice-big        — the two large pickup / delivery cards · .choice-spots — the pickup locations
     .sub-panel         — inset cream panel inside a step (pickup spots, delivery fields); .sub-panel-title
     .fee-line          — live delivery fee; .is-free olive, .is-pending muted
     .field-short / .field-medium — narrower controls (postal code; date, promo code)
     .date-chips        — weekend one-tap chips under the date field; .chips-label
     .field-group       — the contact fields, set off by a dotted rule
     .inline-note       — soft sand note (cap message, weekday note, free-delivery progress, delivery tip)
     .counter           — right-aligned character counter
     .ack               — the acknowledgement card; .ack-list stacks the four rules
     .turnstile-wrap    — reserved box for the Turnstile widget
     .consent / .small-print — the lines around the submit button
     .form-error        — form-level error (role=alert): chocolate, never red
     .order-submit      — the submit button; aria-disabled keeps it clickable so a try shows the inline error
     .receipt           — the paper receipt: lurik top edge, torn bottom edge. Used by .order-summary (order page)
                          and .summary-card (thanks page). Inside: .summary-lines (.summary-line, -label, -amount),
                          .summary-empty, .summary-totals (<dl>, .summary-total = the large total), .summary-note,
                          .summary-meta (thanks), .receipt-phrase
     .mobile-bar        — docked olive bar below 64em: .mobile-bar-total + a cream button; .is-hidden slides it away
     body.has-mobile-bar — lifts the toast region above the bar below 64em (no bottom padding: the bar hides at the footer)
   Thanks page
     .thanks (#thanks)  — the wrapper thanks.js reads; data-state = loading | pending | paid | processing | expired |
                          closed | neutral. It is the first child of <main> but only a wrapper: the masthead inside
                          it takes over the shell's clearance (see THANKS below)
     .thanks-mast       — the masthead beside the sign (cream, kawung): .thanks-copy + .thanks-art
     .thanks-phrase     — "Matur nuwun · thank you" (not shown for an expired or cancelled checkout)
     .progress          — calm bar while the payment is confirmed
     .order-number-wrap — olive board with the order number very large (.order-number) and the copy button
     .thanks-email      — the "we emailed you" line on a paper chip
     .thanks-actions    — button row
     .thanks-body       — second block, paid state only (bone, mega mendung): .thanks-grid = receipt (.summary-card),
                          .next-steps (kawung numerals), .fresh-bed (leaf bed) > .fresh-compact
   ========================================================================== */

/* --------------------------------------------------------------------------
   Masthead (first block of <main>, beside the shop sign on desktop)
   -------------------------------------------------------------------------- */
.order-mast { --pad-top: clamp(2rem, 4vw, 3rem); padding-bottom: clamp(2.5rem, 5vw, 4rem); overflow: clip; }
.order-mast-top { display: grid; gap: var(--s5) clamp(2rem, 4vw, 3.5rem); align-items: center; }
.order-intro { position: relative; z-index: 1; min-width: 0; }
.order-intro .phrase { margin-bottom: 0.5rem; }
.order-intro h1 { margin-bottom: 0.35em; font-size: clamp(2.5rem, 1.7rem + 2.6vw, 3.875rem); }
.order-intro .lede { margin: 0; max-width: 36em; }
.order-mast .notice-panel { margin-block: var(--s5) 0; }
.order-mast-art { display: none; }
@media (min-width: 64em) {
  .order-mast-top { grid-template-columns: minmax(0, 1fr) auto; }
  .order-mast-art { display: block; position: relative; width: clamp(12.5rem, 17vw, 17rem); margin: 0 2rem 1rem 0; }
  .order-mast-art .tampah-wrap { position: relative; z-index: 1; }
  .order-mast-art .price-tag { position: absolute; z-index: 3; right: -2rem; bottom: -1rem; rotate: -5deg; }
  .order-mast-art .price-tag-price { font-size: clamp(1.75rem, 1.2rem + 1.2vw, 2.375rem); }
  .order-mast-leaf { position: absolute; z-index: 0; left: -24%; top: 16%; width: 150%; max-width: none; height: auto; color: var(--olive); --leaf-2: var(--olive-deep); rotate: -16deg; pointer-events: none; }
}

.banner {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  margin-block: var(--s5) 0;
  padding: 0.75rem 0.75rem 0.75rem calc(10px + 1.1rem);
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  border: 1.5px solid var(--line);
  border-radius: var(--cut-2);
  box-shadow: var(--shadow-sm);
  --focus-color: var(--olive);
}
.banner::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 10px; background: var(--lurik-v); }
.banner[data-type='error'] { border-color: var(--choc); box-shadow: inset 0 0 0 1px var(--choc), var(--shadow-sm); }
.banner[data-type='error']::before { background: var(--choc); }
.banner p { flex: 1 1 auto; align-self: center; margin: 0; font-weight: 700; }
.banner-dismiss {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--olive-deep);
  font-size: 1.75rem;
  line-height: 1;
}
.banner-dismiss:hover { background: var(--olive-wash); }

/* --------------------------------------------------------------------------
   The counter: form + receipt
   -------------------------------------------------------------------------- */
.order-page { padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(3rem, 7vw, 5.5rem); overflow: clip; }
.order-layout { display: grid; gap: clamp(2rem, 5vw, 3rem); align-items: start; }
.order-form { display: grid; gap: clamp(1.75rem, 4vw, 2.5rem); min-width: 0; }
.order-form > * { min-width: 0; }
.order-aside { min-width: 0; }
@media (min-width: 64em) {
  .order-layout { grid-template-columns: minmax(0, 1fr) minmax(20rem, 24rem); gap: clamp(2rem, 3.5vw, 3rem); }
  .order-aside { position: sticky; top: calc(var(--chrome-h) + 1rem); }
}

/* A step: paper card, kawung strip along the top, numbered head */
.order-step {
  position: relative;
  overflow: hidden;
  padding: calc(10px + clamp(1.1rem, 3.5vw, 1.9rem)) clamp(1rem, 3.5vw, 2rem) clamp(1.25rem, 3.5vw, 2rem);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--cut);
  box-shadow: var(--shadow-md);
}
.order-step::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 10px; background: var(--olive) var(--kawung-strip); background-size: 24px 24px; }
.step-head { display: flex; align-items: center; gap: 0.9rem; margin-bottom: var(--s5); padding-bottom: var(--s4); border-bottom: 2px dotted var(--sand-deep); }
.step-head .step-num { flex: 0 0 auto; }
.step-title { min-width: 0; }
.step-head h2 { margin: 0; font-size: clamp(1.75rem, 1.45rem + 1.3vw, 2.375rem); }
.step-lead { margin: 0.3rem 0 0; color: var(--ink-2); font-size: var(--fs-small); line-height: 1.45; }

/* Step 1 has no card of its own: its head is a paper plaque and the product cards lie on the leaf */
.order-step.is-open { overflow: visible; padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; }
.order-step.is-open::before { content: none; }
.order-step.is-open .step-head {
  position: relative;
  z-index: 2;
  margin-bottom: var(--s5);
  padding: 0.9rem clamp(1rem, 3.5vw, 1.5rem);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--cut-2);
  box-shadow: var(--shadow-sm);
}

/* --------------------------------------------------------------------------
   Step 1 — the products
   -------------------------------------------------------------------------- */
/* From tablets up the leaves lie across the gap between the two cards and show at both ends (on phones site.css runs them down the stack) */
@media (min-width: 48em) { .product-bed .leaf-bed-leaf { left: -15%; top: 50%; width: 130%; translate: 0 -50%; rotate: -7deg; } }
#products { display: grid; gap: clamp(2rem, 5vw, 3.25rem); }
#products:focus-visible { outline-offset: 6px; }
.products-loading { margin: 0; font-weight: 700; }
#products > .field-error { margin: 0; padding: 0.8rem 1rem; background: var(--paper); border: 2px solid var(--choc); border-radius: var(--cut-2); box-shadow: var(--shadow-sm); }
.product {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* long badges and steppers never widen the card past its column */
  gap: var(--s4);
  padding: clamp(0.75rem, 3vw, 1.5rem);
  padding-left: calc(10px + clamp(0.75rem, 3vw, 1.5rem));
  overflow: hidden;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--cut);
  box-shadow: var(--shadow-md);
}
.product::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 10px; background: var(--lurik-v); }
.product:focus-visible { outline-offset: -4px; }
.product-media {
  display: grid;
  place-items: center;
  margin: 0;
  padding: 1.5rem 1.25rem;
  background: radial-gradient(60% 55% at 50% 58%, rgb(74 91 60 / 0.16), transparent 70%), var(--bone);
  border-radius: var(--cut-2);
}
.product-media .tampah-wrap { width: min(100%, 14rem); }
.product-head { min-width: 0; }
.product-head h3 { margin: 0 0 0.2em; font-size: clamp(1.625rem, 1.4rem + 1vw, 2.125rem); }
.product-size { margin: 0; font-size: var(--fs-xs); font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--olive-deep); }
.product-desc { margin: var(--s2) 0 var(--s3); color: var(--ink-2); }
@media (min-width: 36em) {
  .product { grid-template-columns: 13.5rem minmax(0, 1fr); align-items: center; column-gap: var(--s5); }
  .product-media { padding: 1.25rem 1rem; }
  .bundle-list, .product-cap { grid-column: 1 / -1; }
}

.bundle-list { display: grid; gap: 0.6rem; margin: 0; }
.bundle {
  display: flex;
  flex-wrap: wrap; /* on narrow phones the stepper drops under the label instead of overflowing */
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 0.75rem;
  padding: 0.75rem 0.7rem 0.75rem 0.95rem;
  background: var(--cream);
  border: 1.5px dashed var(--sand-deep);
  border-radius: var(--cut-2);
}
.bundle.is-selected { border-style: solid; border-color: var(--olive); background: var(--olive-wash); box-shadow: inset 0 0 0 1px var(--olive); }
.bundle-main { display: grid; gap: 0.1rem; flex: 1 1 7rem; min-width: 7rem; } /* narrower than this and the stepper drops to its own line */
.bundle-label { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.6rem; font-size: 1.25rem; font-weight: 800; line-height: 1.25; color: var(--ink); }
.bundle-label .badge { white-space: normal; text-align: left; line-height: 1.3; }
.bundle-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.45rem; font-family: var(--font-display); font-size: 1.75rem; line-height: 1.15; color: var(--choc); font-variant-numeric: tabular-nums; }
.bundle-per { font-family: var(--font-body); font-size: var(--fs-xs); font-weight: 700; color: var(--ink-2); }
.bundle .stepper { flex: 0 0 auto; margin-left: auto; border-width: 2px; border-color: var(--olive); }
.bundle .stepper button { width: 48px; min-height: 48px; font-size: 1.75rem; font-weight: 700; }
.bundle .stepper-value { min-width: 3rem; font-size: 1.3125rem; border-inline: 1.5px solid var(--line); }

.inline-note {
  margin: var(--s3) 0 0;
  padding: 0.7rem 1rem;
  background: var(--sand-wash);
  border-left: 5px solid var(--sand-deep);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  color: var(--ink);
  font-size: var(--fs-small);
  font-weight: 600;
  line-height: 1.5;
}
.inline-note a { font-weight: 800; }

/* --------------------------------------------------------------------------
   Step 2 — pickup or delivery
   -------------------------------------------------------------------------- */
.choice-group > .field-error { grid-column: 1 / -1; }
.choice-big { margin-bottom: 0; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.choice-big .choice-body { justify-content: center; gap: 0.3rem; min-height: 6.5rem; padding: 1.2rem 1.2rem 1.2rem 3.4rem; border-width: 2px; border-radius: var(--cut-2); }
.choice-big .choice-body::before { left: 1.15rem; top: 1.45rem; width: 1.5rem; height: 1.5rem; }
.choice-big .choice-body::after { left: calc(1.15rem + 6px); top: calc(1.45rem + 6px); width: calc(1.5rem - 12px); height: calc(1.5rem - 12px); }
.choice-big .choice-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.5rem, 1.3rem + 0.8vw, 1.875rem); line-height: 1.15; color: var(--ink); }
.choice-big .choice-meta, .choice-spots .choice-meta { font-size: var(--fs-small); line-height: 1.4; }
.choice-spots { margin-bottom: 0; }
.choice-spots > legend { margin-bottom: var(--s3); font-family: var(--font-display); font-weight: 400; font-size: 1.375rem; color: var(--olive-deep); }
.choice-spots .choice-body { padding-block: 1.05rem; border-radius: var(--cut-2); }
.choice-spots .choice-title { font-size: 1.1875rem; line-height: 1.25; }

.sub-panel { margin-top: var(--s4); padding: clamp(1rem, 3vw, 1.5rem); background: var(--cream); border: 1.5px dashed var(--sand-deep); border-radius: var(--cut-2); }
.sub-panel > :last-child { margin-bottom: 0; }
.sub-panel-title { margin: 0 0 var(--s4); font-family: var(--font-display); font-size: 1.375rem; line-height: 1.2; color: var(--olive-deep); }
.fee-line { margin: 0; font-family: var(--font-display); font-size: 1.375rem; line-height: 1.3; color: var(--choc); font-variant-numeric: tabular-nums; }
.fee-line.is-free { color: var(--olive-deep); }
.fee-line.is-pending { font-family: var(--font-body); font-size: var(--fs-body); font-weight: 600; color: var(--ink-2); }
.field-short input:not([type='checkbox']):not([type='radio']) { max-width: 12rem; }
.field-medium input:not([type='checkbox']):not([type='radio']) { max-width: 18rem; }

/* --------------------------------------------------------------------------
   Step 3 — when and who
   -------------------------------------------------------------------------- */
.date-chips { margin-top: var(--s2); }
.chips-label { margin: 0 0 var(--s2); font-size: var(--fs-small); font-weight: 800; color: var(--ink); }
.field-group { margin-top: var(--s5); padding-top: var(--s5); border-top: 2px dotted var(--sand-deep); }
.field-group > .field:last-child, .order-step > .field:last-child { margin-bottom: 0; }
.order-step .field-row { align-items: start; }
.order-step .field-row + .hint { margin: var(--s2) 0 var(--s5); }   /* the delivery-fee hint under City / Province */
/* Province is always Alberta: shown, not editable */
.field input[readonly] { background: var(--bone); color: var(--ink-2); cursor: default; }
.counter { text-align: right; font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   Step 4 — review and pay
   -------------------------------------------------------------------------- */
.ack { margin-bottom: var(--s5); }
.ack .choice-body { gap: 0.6rem; padding: 1.1rem 1.1rem 1.2rem 3.3rem; border-width: 2px; border-radius: var(--cut-2); }
.ack .choice-body::before { left: 1.1rem; top: 1.25rem; width: 1.5rem; height: 1.5rem; }
.ack .choice-body::after { left: calc(1.1rem + 6px); top: calc(1.25rem + 6px); width: calc(1.5rem - 12px); height: calc(1.5rem - 12px); }
.ack .choice-title { font-family: var(--font-display); font-weight: 400; font-size: 1.5rem; line-height: 1.2; }
.ack-list { display: grid; gap: 0.5rem; font-size: var(--fs-small); line-height: 1.45; color: var(--ink); }
.ack-list > span { position: relative; display: block; padding-left: 1.15rem; }
.ack-list > span::before { content: ''; position: absolute; left: 0; top: 0.55em; width: 8px; height: 8px; border-radius: 50%; background: var(--olive); }
.ack .field-error { margin-top: var(--s3); }
.turnstile-wrap { margin-block: var(--s5); min-height: 65px; }
.turnstile-wrap:empty { min-height: 0; margin: 0; }
.consent { margin-bottom: var(--s4); font-size: var(--fs-small); color: var(--ink-2); }
.form-error {
  margin: 0 0 var(--s4);
  padding: 0.85rem 1rem;
  background: var(--choc-wash);
  border: 2px solid var(--choc);
  border-radius: var(--cut-2);
  color: var(--choc-deep);
  font-weight: 800;
}
.form-error:empty { display: none; }
.form-error a { color: var(--choc-deep); }
.order-submit { white-space: normal; text-wrap: balance; }
.order-submit[aria-disabled='true'] { opacity: 0.72; pointer-events: auto; cursor: not-allowed; }
.order-submit[aria-disabled='true']:hover { transform: none; }
.small-print { margin: var(--s3) 0 0; font-size: var(--fs-xs); color: var(--ink-2); text-align: center; }

/* --------------------------------------------------------------------------
   The receipt (order page aside + thanks page summary)
   -------------------------------------------------------------------------- */
.receipt {
  position: relative;
  margin-bottom: 12px; /* the torn edge hangs below the box */
  padding: calc(16px + 1.4rem) clamp(1.1rem, 3vw, 1.6rem) 1.5rem;
  background: var(--paper);
  color: var(--ink);
  border-inline: 1.5px solid var(--line);
  filter: drop-shadow(0 1px 0 rgb(51 32 26 / 0.08)) drop-shadow(0 12px 16px rgb(51 32 26 / 0.2));
}
.receipt::before { content: ''; position: absolute; left: -1.5px; right: -1.5px; top: 0; height: 16px; background: var(--lurik-h); }
.receipt::after {
  content: '';
  position: absolute;
  left: -1.5px;
  right: -1.5px;
  top: 100%;
  height: 12px;
  background:
    linear-gradient(135deg, var(--paper) 50%, transparent 50%) 0 0 / 18px 12px repeat-x,
    linear-gradient(225deg, var(--paper) 50%, transparent 50%) 0 0 / 18px 12px repeat-x;
}
.receipt h2 { margin-bottom: var(--s4); font-size: clamp(1.75rem, 1.5rem + 0.8vw, 2.125rem); }
.summary-lines { display: grid; gap: 0; margin: 0 0 var(--s3); }
.summary-line { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); padding-block: 0.55rem; border-bottom: 1.5px dotted var(--sand-deep); }
.summary-line-label { min-width: 0; }
.summary-line-label strong { font-variant-numeric: tabular-nums; }
.phone-masked { white-space: nowrap; } /* "***-***-1238" never splits across lines */
.summary-line-amount { flex: 0 0 auto; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.summary-empty { margin: 0 0 var(--s4); padding: 0.8rem 1rem; background: var(--cream); border: 1.5px dashed var(--sand-deep); border-radius: var(--cut-2); color: var(--ink-2); }
.summary-totals { display: grid; gap: 0.4rem; margin: 0; }
.summary-totals > div { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); }
.summary-totals dt { min-width: 0; color: var(--ink-2); }
.summary-totals dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.summary-totals .summary-total { margin-top: 0.5rem; padding-top: 0.7rem; border-top: 2px solid var(--choc); }
.summary-totals .summary-total dt { font-size: 1.25rem; font-weight: 800; color: var(--ink); }
.summary-totals .summary-total dd { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.25rem, 1.9rem + 1.4vw, 2.875rem); line-height: 1; color: var(--olive-deep); }
.summary-note { margin: var(--s4) 0 0; padding-top: var(--s3); border-top: 1.5px dashed var(--sand-deep); font-size: var(--fs-small); color: var(--ink-2); }
.receipt-phrase { margin-top: var(--s3); text-align: center; font-size: 1.375rem; }
.summary-meta { display: grid; gap: 0.3rem; margin: var(--s4) 0 0; padding: var(--s3) 0 0; border-top: 1.5px dashed var(--sand-deep); list-style: none; font-size: var(--fs-small); color: var(--ink-2); }
.summary-meta strong { color: var(--ink); font-weight: 800; }

/* --------------------------------------------------------------------------
   The docked total (below 64em)
   -------------------------------------------------------------------------- */
.mobile-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding: calc(8px + 0.55rem) 1rem calc(0.6rem + env(safe-area-inset-bottom, 0px));
  background: var(--olive);
  color: var(--cream);
  box-shadow: 0 -8px 20px rgb(51 32 26 / 0.3);
  --focus-color: var(--sand);
}
.mobile-bar::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 8px; background: var(--lurik-h); }
.mobile-bar.is-hidden { transform: translateY(120%); visibility: hidden; }
.mobile-bar-total { display: grid; min-width: 0; line-height: 1.1; }
.mobile-bar-total small { font-size: var(--fs-xs); font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--bone); }
.mobile-bar-total strong { font-family: var(--font-display); font-weight: 400; font-size: 1.75rem; color: var(--cream); font-variant-numeric: tabular-nums; }
.mobile-bar .btn { flex: 0 0 auto; background: var(--cream); border-color: var(--cream); color: var(--olive-deep); box-shadow: 0 3px 0 var(--olive-deep); }
.mobile-bar .btn:hover { background: var(--sand); border-color: var(--sand); color: var(--choc-deep); }
body.has-mobile-bar .toast-region { bottom: calc(6rem + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 64em) {
  .mobile-bar { display: none; }
  body.has-mobile-bar .toast-region { bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); }
}

/* --------------------------------------------------------------------------
   THANKS
   #thanks wraps everything thanks.js reads, so it has to be the first child of <main>. The real first block is
   the masthead inside it: the wrapper drops the shell's clearance and the masthead takes it over (the same
   formulas as site.css section 14), with .beside-sign on its container.
   -------------------------------------------------------------------------- */
#thanks { padding-top: 0; min-height: 0; }
.thanks-mast { --pad-top: clamp(2rem, 4vw, 3rem); padding-block: max(var(--pad-top), var(--brand-clear)) clamp(2.5rem, 6vw, 4.5rem); overflow: clip; }
@media (min-width: 64em) {
  .has-sign .thanks-mast { min-height: calc(var(--sign-reach) + var(--brand-gap)); }
}
.thanks-mast-grid { display: grid; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.thanks-copy { position: relative; z-index: 1; min-width: 0; }
.thanks-phrase { margin-bottom: 0.6rem; }
#thanks[data-state='expired'] .thanks-phrase, #thanks[data-state='closed'] .thanks-phrase { display: none; }
.thanks-copy .eyebrow { display: block; margin-bottom: var(--s2); }
.thanks-copy h1 { max-width: 20ch; margin-bottom: 0.4em; font-size: clamp(2.25rem, 1.6rem + 2.8vw, 3.75rem); }
.thanks-copy .lede { max-width: 34em; margin: 0; color: var(--ink); }
.thanks-art { position: relative; justify-self: center; width: min(70%, 15rem); margin: 0.5rem 0 1.5rem; }
.thanks-art .tampah-wrap { position: relative; z-index: 1; }
.thanks-art .patch { position: absolute; z-index: 3; right: -2.25rem; bottom: -1.5rem; width: 124px; min-height: 124px; font-size: 1.0625rem; rotate: 9deg; }
.thanks-leaf { position: absolute; z-index: 0; left: -20%; top: 16%; width: 142%; max-width: none; height: auto; color: var(--olive); --leaf-2: var(--olive-deep); rotate: -16deg; pointer-events: none; }
@media (min-width: 48em) {
  .thanks-mast-grid { grid-template-columns: minmax(0, 1fr) auto; }
  .thanks-art { width: clamp(13rem, 19vw, 18rem); margin: 0 2.5rem 1.5rem 0; }
}

.progress {
  position: relative;
  max-width: 30rem;
  height: 14px;
  margin-block: var(--s5);
  overflow: hidden;
  background: var(--paper);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-pill);
}
.progress::after { content: ''; position: absolute; inset: 0 auto 0 0; width: 40%; border-radius: var(--r-pill); background: var(--olive) var(--kawung-strip); background-size: 24px 24px; }

/* The order number: an olive board, like the rules sign */
.order-number-wrap {
  position: relative;
  isolation: isolate;
  margin-block: var(--s5);
  padding: clamp(1.5rem, 4vw, 2.25rem) clamp(1.5rem, 4vw, 2.5rem);
  background: var(--olive);
  color: var(--cream);
  border-radius: var(--cut);
  box-shadow: var(--shadow-md);
}
.order-number-wrap::before { content: ''; position: absolute; inset: 0; z-index: 0; border-radius: inherit; background: var(--megamendung-light); opacity: 0.14; pointer-events: none; }
.order-number-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  padding: 12px;
  background: var(--ceplok-light);
  opacity: 0.5;
  pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
.order-number-wrap > * { position: relative; z-index: 1; }
/* The number is sized from the board it sits on (12.5cqi keeps AT-2026-0042 on one line at every width) */
.order-number-row { container-type: inline-size; }
.order-number-wrap .eyebrow { display: block; margin-bottom: var(--s1); color: var(--sand); }
.order-number-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s4) var(--s5); }
.order-number-wrap .order-number { min-width: 0; margin: 0; font-size: clamp(2.5rem, 1rem + 4vw, 4rem); font-size: clamp(2.5rem, 12.5cqi, 5.5rem); line-height: 1; color: var(--cream); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.thanks-email { display: table; margin: 0 0 var(--s4); padding: 0.65rem 1rem; background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--cut-2); box-shadow: var(--shadow-sm); font-weight: 700; overflow-wrap: anywhere; }
.thanks-actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s5); }
.thanks-actions .btn-secondary:not(:hover) { background: var(--paper); }

/* Second block: only once the order is paid */
.thanks-body { padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(3rem, 7vw, 5rem); overflow: clip; }
#thanks:not([data-state='paid']) > .thanks-body, #thanks:not([data-state='paid']) > .hem { display: none; }
#thanks[data-state='paid'] + .leaf-divider { --leaf-bg: var(--bone); }
.thanks-grid { display: grid; gap: clamp(1.75rem, 4vw, 2.5rem); align-items: start; }
.thanks-grid > * { min-width: 0; }
@media (min-width: 60em) {
  .thanks-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .thanks-grid > .fresh-bed { grid-column: 1 / -1; }
  .thanks-grid:not(:has(> .summary-card:not([hidden]))) > .next-steps { grid-column: 1 / -1; }
}
.next-steps {
  position: relative;
  overflow: hidden;
  padding: calc(10px + clamp(1.25rem, 3vw, 2rem)) clamp(1.1rem, 3vw, 2rem) clamp(1.25rem, 3vw, 2rem);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--cut);
  box-shadow: var(--shadow-md);
}
.next-steps::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 10px; background: var(--olive) var(--kawung-strip); background-size: 24px 24px; }
.next-steps h2 { margin-bottom: var(--s5); font-size: clamp(1.75rem, 1.5rem + 1vw, 2.25rem); }
.next-steps ol { display: grid; gap: var(--s4); margin: 0; padding: 0; list-style: none; counter-reset: next; }
.next-steps li { display: grid; grid-template-columns: 3.25rem minmax(0, 1fr); gap: var(--s3); align-items: center; counter-increment: next; }
.next-steps li::before {
  content: counter(next);
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background: var(--olive) var(--kawung-light);
  background-size: 28px 28px;
  box-shadow: 0 2px 0 var(--olive-deep), inset 0 0 0 40px rgb(74 91 60 / 0.72);
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1;
}
.next-steps li p { margin: 0; }
.next-tip { margin-top: var(--s5); }
.fresh-bed { margin-top: clamp(1.5rem, 4vw, 2.5rem); }
.thanks .fresh-compact {
  position: relative;
  overflow: hidden;
  margin: 0;
  padding: clamp(1.25rem, 3vw, 2rem);
  padding-left: calc(10px + clamp(1.25rem, 3vw, 2rem));
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--cut);
  box-shadow: var(--shadow-md);
}
.thanks .fresh-compact::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 10px; background: var(--lurik-v); }
.thanks .fresh-compact h2 { margin-bottom: var(--s3); font-size: clamp(1.75rem, 1.5rem + 1vw, 2.25rem); color: var(--olive-deep); }
.thanks .fresh-compact ul { display: grid; gap: 0.5rem; margin: 0 0 var(--s4); padding-left: 1.2rem; }
.thanks .fresh-compact li { margin: 0; }
.thanks .fresh-compact li::marker { color: var(--olive); }

/* --------------------------------------------------------------------------
   Motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .mobile-bar { transition: transform 0.35s var(--ease-out), visibility 0.35s; }
  .bundle { transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; }
  .progress::after { animation: progress-slide 1.6s ease-in-out infinite; }
}
@keyframes progress-slide { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

@media print {
  .mobile-bar, .turnstile-wrap, .banner-dismiss, .order-mast-art, .thanks-art { display: none !important; }
  .receipt { filter: none; }
}
