:root {
  --ivory: #f6efe2;
  --paper: #fffaf1;
  --ink: #2a2118;
  --muted: #7a6a55;
  --line: #e4d6bd;
  --gold: #b48a3c;
  --gold-soft: #f3e6c8;
  --teal: #0e5a57;
  --teal-2: #13716d;
  --teal-soft: #e3f0ee;
  --wa: #1f9d55;
  --serif: 'Cormorant Garamond', Garamond, Georgia, serif;
  --sans: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 15px/1.4 var(--sans);
  color: var(--ink);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
h2, h3 { margin: 0; }

/* the whole app is exactly one screen: tray on top, list scrolls inside, bar at the bottom */
.app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }

/* ---------- header + stepper ---------- */
.top {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; background: var(--paper); border-bottom: 1px solid var(--line);
}
.brand img { height: 34px; display: block; }
.stepper { display: flex; flex: 1; justify-content: space-between; max-width: 520px; margin-left: auto; }
.stepper button {
  border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11px; color: var(--muted); padding: 2px 4px; min-width: 44px;
}
.stepper b {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; border: 1.5px solid var(--line); background: #fff; color: var(--muted);
}
.stepper .done b { background: var(--gold-soft); border-color: var(--gold); color: var(--gold); }
.stepper .on { color: var(--teal); font-weight: 600; }
.stepper .on b { background: var(--teal); border-color: var(--teal); color: #fff; }
.stepper button:disabled { opacity: .45; }

/* ---------- stage ---------- */
.cfg { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.stage {
  flex: none; height: 44vh; height: 44dvh; display: flex; flex-direction: column;
  padding: 10px 12px 4px;
  background: radial-gradient(ellipse at 50% 40%, #fffaf0 0%, #efe3cc 100%);
  border-bottom: 1px solid var(--line);
}
body[data-step="box"] .stage, body[data-step="review"] .stage { height: 34vh; height: 34dvh; }
.stage-fit { flex: 1; min-height: 0; display: grid; place-items: center; }
.tray-wrap { position: relative; filter: drop-shadow(0 10px 16px rgba(80, 52, 10, .3)); }
.tray-wrap canvas { width: 100%; height: 100%; display: block; }
.tray-cover {
  position: absolute; inset: 0; border-radius: 10px; background: rgba(246, 239, 226, .55);
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.tray-cover.on { opacity: 1; }
.guide { flex: none; margin: 6px 0 2px; text-align: center; font-size: 13px; color: var(--muted); min-height: 18px; }
.brandline { flex: none; display: block; text-align: center; font-size: 11px; color: var(--muted); opacity: .8; text-decoration: none; margin: 0 0 2px; }
.brandline:hover { text-decoration: underline; }
/* no long-press "save image" / drag-out of the tray */
#tray { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }
.box-view img { -webkit-touch-callout: none; -webkit-user-drag: none; pointer-events: none; }
.stolen { position: fixed; inset: 0; display: grid; place-items: center; background: #f6efe2; color: #2a2118; font: 600 20px/1.5 Georgia, serif; text-align: center; padding: 24px; }

/* numbered compartments */
.badges { position: absolute; inset: 0; pointer-events: none; }
.badge {
  position: absolute; transform: translate(-50%, -50%); pointer-events: auto;
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff;
  background: rgba(14, 90, 87, .92); color: #fff; font-weight: 700; font-size: 14px;
  display: grid; place-items: center; padding: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
  transition: transform .15s, background .15s;
}
.badge.full { width: 22px; height: 22px; font-size: 11px; background: rgba(255, 255, 255, .88); color: var(--teal); border-color: var(--teal); }
.badge.on { background: #fff; color: var(--teal); border-color: var(--teal); width: 34px; height: 34px; font-size: 16px; }
.badge.on::after {
  content: ''; position: absolute; inset: -7px; border-radius: 50%; border: 3px solid #fff;
  animation: pulse 1.3s ease-out infinite;
}
@keyframes pulse { from { transform: scale(.8); opacity: 1; } to { transform: scale(1.7); opacity: 0; } }

/* ---------- panel ---------- */
.panel { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; background: var(--paper); }
.step-body { padding: 14px 14px 24px; max-width: 640px; margin: 0 auto; }
.step-body h2 { font-family: var(--serif); font-size: 26px; line-height: 1.1; }
.sub { margin: 4px 0 12px; color: var(--muted); font-size: 13.5px; }
.mini { margin: 6px 0; color: var(--muted); font-size: 12.5px; }

.cards { display: grid; gap: 10px; }
.card {
  text-align: left; border: 1.5px solid var(--line); background: #fff; border-radius: 14px;
  padding: 12px 14px; display: grid; gap: 3px; transition: border-color .15s, box-shadow .15s;
}
.card.on { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(14, 90, 87, .14); background: #fbfffe; }
.card-top { display: flex; align-items: center; gap: 8px; }
.card-top b { font-size: 17px; }
.card.on .card-top b::after { content: ' ✓'; color: var(--teal); }
.card p { margin: 0; font-size: 14px; }
.card small { color: var(--muted); font-size: 12px; }
.tag {
  font-size: 11px; font-weight: 600; letter-spacing: .03em; padding: 2px 8px; border-radius: 99px;
  background: var(--gold-soft); color: #7a5a1c;
}

/* fill step */
.slot-head .head-logo { height: 26px; width: auto; margin-left: auto; flex: none; pointer-events: none; }
.slot-head .link + .head-logo { margin-left: 8px; }
.slot-head {
  display: flex; align-items: center; gap: 10px; position: sticky; top: -14px; z-index: 2;
  background: var(--paper); margin: -14px -14px 6px; padding: 12px 14px 10px; border-bottom: 1px solid var(--line);
}
.slot-head .num {
  flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--teal); color: #fff;
  display: grid; place-items: center; font-weight: 700;
}
.slot-head b { display: block; font-size: 15px; }
.slot-head small { color: var(--muted); font-size: 12.5px; }
.slot-head .link { margin-left: auto; border: 0; background: none; color: var(--teal); font-weight: 600; text-decoration: underline; }
.done-note { background: var(--teal-soft); color: var(--teal); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; font-weight: 500; }
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 99px; overflow: hidden; margin: 6px 0; }
.seg button { border: 0; background: #fff; padding: 7px 14px; font-size: 13.5px; }
.seg button.on { background: var(--teal); color: #fff; }
.check { display: flex; align-items: center; gap: 6px; font-size: 14px; margin: 6px 0; }
.check input { width: 18px; height: 18px; accent-color: var(--teal); }

.group h3 {
  font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold);
  margin: 14px 0 4px; font-family: var(--sans);
}
.item {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left;
  border: 0; border-bottom: 1px solid #f0e6d3; background: none; padding: 11px 2px;
}
.item .ic { display: none; flex: none; }
.thumb { display: block; width: 40px; height: 40px; border-radius: 10px; background: #b48a3c center / cover no-repeat; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.item .tx { flex: 1; min-width: 0; }
.item .tx b { display: block; font-size: 15px; font-weight: 600; }
.item .tx small { display: block; color: var(--muted); font-size: 12.5px; }
.item .pr { flex: none; text-align: right; }
.item .pr b { display: block; font-size: 15px; }
.item .pr small { color: var(--muted); font-size: 12px; }
.item.on { background: var(--teal-soft); border-radius: 10px; padding-left: 10px; padding-right: 10px; }
.item.on .tx b::after { content: '  ✓'; color: var(--teal); }
.item:active { background: #f4ecdc; }

.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.ghost {
  border: 1.5px solid var(--line); background: #fff; border-radius: 99px; padding: 9px 16px; font-size: 14px; font-weight: 500;
}

/* review */
.lines { width: 100%; border-collapse: collapse; margin: 6px 0 10px; }
.lines td { padding: 8px 0; border-bottom: 1px solid #f0e6d3; }
.lines .g { color: var(--muted); text-align: right; padding-right: 14px; white-space: nowrap; }
.lines .p { text-align: right; font-weight: 600; white-space: nowrap; }
.totals { display: grid; gap: 6px; background: var(--ivory); border-radius: 12px; padding: 12px 14px; }
.totals div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.totals b { white-space: nowrap; text-align: right; }
.totals .big { font-family: var(--serif); font-size: 28px; color: var(--teal); }

/* ---------- bottom bar ---------- */
.bar {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -6px 18px rgba(80, 52, 10, .08);
}
.bar-price { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bar-price b { font-family: var(--serif); font-size: 26px; line-height: 1; color: var(--teal); transition: transform .2s; }
.bar-price b.bump { transform: scale(1.08); }
.bar-price span { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-nav { display: flex; gap: 8px; }
.bar-nav .back { width: 46px; height: 46px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; font-size: 24px; line-height: 1; }
.bar-nav .next {
  height: 46px; padding: 0 20px; border-radius: 99px; border: 0; background: var(--teal); color: #fff;
  font-weight: 600; font-size: 15px; white-space: nowrap;
}
body[data-step="review"] .bar-nav .next { background: var(--wa); }
.bar-nav .next:disabled { background: #cfc4b0; color: #fff; }

/* live price under the tray (phone) */
.live { flex: none; text-align: center; margin-top: 8px; }
.live b { display: block; font-family: var(--serif); font-size: 30px; line-height: 1; color: var(--teal); transition: transform .2s; }
.live b.bump { transform: scale(1.1); }
.live span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.live .lv-slot { color: var(--teal); font-weight: 600; }
.live .lv-slot:empty { display: none; }

/* ---------- phone: tray + live price on the left, list on the right. No scrolling back and forth ---------- */
@media (max-width: 899px) {
  .cfg { flex-direction: row; }
  .stage, body[data-step="box"] .stage, body[data-step="review"] .stage {
    width: 44%; height: auto; flex: none; padding: 10px 6px 8px;
    border-bottom: 0; border-right: 1px solid var(--line); overflow-y: auto;
  }
  .stage-fit { flex: none; height: auto; display: flex; justify-content: center; }
  .tray-wrap { filter: drop-shadow(0 6px 10px rgba(80, 52, 10, .3)); }
  .guide { font-size: 11.5px; margin-top: 8px; line-height: 1.35; }
  .bar-price { display: none; }
  .bar-nav { flex: 1; }
  .bar-nav .next { flex: 1; }
  .step-body { padding: 10px 10px 20px; }
  .step-body h2 { font-size: 21px; }
  .sub { font-size: 12px; margin-bottom: 10px; }
  .cards { gap: 8px; }
  .card { padding: 9px 10px; border-radius: 12px; }
  .card-top { flex-wrap: wrap; gap: 4px 6px; }
  .card-top b { font-size: 15px; }
  .card p { font-size: 12.5px; line-height: 1.3; }
  .card small { font-size: 11px; }
  .tag { font-size: 10px; padding: 1px 6px; }
  .slot-head .head-logo { height: 26px; width: auto; margin-left: auto; flex: none; pointer-events: none; }
.slot-head .link + .head-logo { margin-left: 8px; }
.slot-head { top: -10px; margin: -10px -10px 4px; padding: 8px 10px; gap: 8px; }
  .slot-head .num { width: 28px; height: 28px; font-size: 14px; }
  .slot-head b { font-size: 13.5px; }
  .slot-head small { font-size: 11px; line-height: 1.25; display: block; }
  .slot-head .link { font-size: 12.5px; }
  .done-note { font-size: 12.5px; padding: 8px 10px; }
  .group h3 { margin: 10px 0 2px; font-size: 10.5px; }
  .item { padding: 9px 0; gap: 6px; align-items: flex-start; }
  .item .tx b { font-size: 14px; line-height: 1.2; }
  .item .tx small { font-size: 11px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .item .pr b { font-size: 14px; }
  .item .pr small { font-size: 10.5px; }
  .item.on { padding-left: 6px; padding-right: 6px; }
  .seg button { padding: 6px 10px; font-size: 12.5px; }
  .ghost { padding: 7px 12px; font-size: 13px; }
  .lines td { font-size: 13px; }
  .totals .big { font-size: 24px; }
  .badge { width: 20px; height: 20px; font-size: 11px; border-width: 1.5px; }
  .badge.full { width: 14px; height: 14px; font-size: 8px; }
  .badge.on { width: 24px; height: 24px; font-size: 12px; }
  .badge.on::after { inset: -5px; border-width: 2px; }
}

/* ---------- desktop: tray left, panel right ---------- */
@media (min-width: 900px) {
  .top { padding: 10px 24px; }
  .brand img { height: 44px; }
  .cfg { flex-direction: row; }
  .stage, body[data-step="box"] .stage, body[data-step="review"] .stage {
    flex: 1.25; height: auto; padding: 24px; border-bottom: 0; border-right: 1px solid var(--line);
  }
  .panel { flex: 1; max-width: 520px; }
  .step-body { padding: 22px 24px 30px; }
  .slot-head .head-logo { height: 26px; width: auto; margin-left: auto; flex: none; pointer-events: none; }
.slot-head .link + .head-logo { margin-left: 8px; }
.slot-head { top: -22px; margin: -22px -24px 8px; padding: 16px 24px 12px; }
  .item .ic { display: block; }
  .badge { width: 34px; height: 34px; font-size: 15px; }
  .badge.full { width: 26px; height: 26px; font-size: 12px; }
  .badge.on { width: 38px; height: 38px; }
  .bar { padding: 12px 24px; }
  .guide { font-size: 14px; }
  .live { display: none; }
}

/* ---------- step 1: full page intro, then the split view slides in ---------- */
body.intro .stage { display: none; }
body.intro .panel { max-width: none; }
body.intro .step-body { max-width: 1080px; padding-top: 22px; }
body.intro .step-body h2 { font-size: 30px; }
body.intro .sub { font-size: 14.5px; max-width: 640px; }
body.intro .cards.sizes { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
body.reveal .stage { animation: stageIn .6s cubic-bezier(.2, .8, .2, 1); }
body.reveal .panel { animation: panelIn .6s cubic-bezier(.2, .8, .2, 1); }
@keyframes stageIn { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
@keyframes panelIn { from { opacity: .3; transform: translateX(40px); } to { opacity: 1; transform: none; } }

.pill {
  font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 2px 8px; border-radius: 99px;
  background: var(--teal-soft); color: var(--teal);
}
.size-card { gap: 6px; padding: 14px 16px; }
.size-card .card-top b { font-size: 20px; font-family: var(--sans); font-weight: 700; }
.facts { margin: 2px 0 0; padding-left: 18px; font-size: 13px; color: var(--ink); display: grid; gap: 2px; }
.facts li::marker { color: var(--gold); }
.budget {
  margin-top: 6px; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
  background: var(--ivory); border-radius: 10px; padding: 7px 10px;
}
.budget span { font-size: 12px; color: var(--muted); }
.budget b { font-size: 17px; color: var(--teal); }
.budget small { font-size: 11px; color: var(--muted); }
.card small.soft { color: #a08a62; font-style: italic; }
.card small + small { margin-top: 1px; }

/* the "+" (dry fruit / mixture) compartments */
.badge.extra { background: rgba(180, 138, 60, .95); }
.badge.extra.on { background: #fff; color: var(--gold); border-color: var(--gold); }
.badge.later {
  background: rgba(255, 255, 255, .55); color: var(--gold); border: 1.5px dashed var(--gold);
  box-shadow: none; pointer-events: none; font-size: 13px;
}
.slot-head .num.extra { background: var(--gold); }
.item .pr .oncall { font-size: 12px; color: var(--gold); font-weight: 600; }

@media (max-width: 899px) {
  body.intro .step-body { padding: 14px 12px 20px; }
  body.intro .step-body h2 { font-size: 24px; }
  body.intro .sub { font-size: 13px; }
  body.intro .cards.sizes { grid-template-columns: 1fr; gap: 10px; }
  .size-card { padding: 11px 12px; }
  .size-card .card-top b { font-size: 17px; }
  .facts { font-size: 12px; padding-left: 16px; }
  .budget b { font-size: 15px; }
  .stepper button { min-width: 0; padding: 2px 1px; font-size: 9.5px; }
  .stepper b { width: 21px; height: 21px; font-size: 11px; }
  .brand img { height: 30px; }
  .pill, .tag { font-size: 9.5px; }
  .badge.later { width: 16px; height: 16px; font-size: 10px; }
}

/* ---------- outer box step ---------- */
.box-view { display: none; }
.box-view.on { display: grid; place-items: center; width: 100%; height: 100%; }
.box-view img {
  max-width: 100%; max-height: 100%; object-fit: contain; display: block;
  filter: drop-shadow(0 14px 22px rgba(70, 45, 10, .35)); animation: boxIn .35s ease-out;
}
@keyframes boxIn { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
body.showing-box .tray-wrap { display: none; }
.box-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.box-card {
  border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 8px; text-align: left;
  display: grid; gap: 3px; transition: border-color .15s, box-shadow .15s;
}
.box-card.on { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(14, 90, 87, .14); }
.box-card .bimg { display: grid; place-items: center; aspect-ratio: 4 / 3; background: var(--ivory); border-radius: 8px; overflow: hidden; }
.box-card img { max-width: 92%; max-height: 92%; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(70, 45, 10, .3)); }
.box-card b { font-size: 14px; }
.box-card.on b::after { content: ' ✓'; color: var(--teal); }
.box-card small { font-size: 11.5px; color: var(--muted); }
.card.help { width: 100%; }
.review-box { display: block; width: 100%; max-width: 260px; margin: 4px 0 10px; border-radius: 8px; filter: drop-shadow(0 6px 10px rgba(70, 45, 10, .3)); }

@media (max-width: 899px) {
  .box-grid { grid-template-columns: 1fr; gap: 8px; }
  .box-card { grid-template-columns: 84px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 6px; }
  .box-card .bimg { grid-row: 1 / 3; }
  .box-card b { font-size: 13px; align-self: end; }
  .box-card small { font-size: 10.5px; align-self: start; }
  body.showing-box .stage-fit { height: auto; }
  .box-view.on img { max-height: 46vh; }
  .review-box { max-width: 100%; }
}

/* ---- 2026-11-21: welcome + review polish ---- */
.eyebrow { margin: 0 0 4px; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold, #b48a3c); font-weight: 600; }
ol.how { list-style: none; counter-reset: how; padding: 0; margin: 10px 0 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
ol.how li { counter-increment: how; background: var(--paper, #fffaf1); border: 1px solid var(--line, #e4d6bd); border-radius: 12px; padding: 10px 12px 10px 40px; position: relative; font-size: 13px; color: var(--muted); line-height: 1.35; }
ol.how li::before { content: counter(how); position: absolute; left: 10px; top: 10px; width: 22px; height: 22px; border-radius: 50%; background: var(--teal, #0e5a57); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; }
ol.how li b { display: block; color: var(--ink, #2a2118); font-size: 14px; }
ol.lines-list { margin: 12px 0; padding: 0 0 0 22px; display: grid; gap: 6px; }
ol.lines-list li { padding: 6px 0; border-bottom: 1px dashed var(--line, #e4d6bd); }
ol.lines-list li span { display: inline-block; }
ol.lines-list .n { font-weight: 600; min-width: 46%; }
ol.lines-list .g { color: var(--muted); min-width: 24%; font-variant-numeric: tabular-nums; }
ol.lines-list .p { float: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.note { margin: 14px 0; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line, #e4d6bd); background: var(--paper, #fffaf1); font-size: 13.5px; line-height: 1.5; }
.note b { display: block; margin-bottom: 4px; }
.note p { margin: 4px 0 0; color: var(--muted); }
.note p b { display: inline; color: var(--ink, #2a2118); }
.note.warm { background: linear-gradient(135deg, #fff4dd, #fdeccd); border-color: #ecd3a2; }
.note a { color: var(--teal, #0e5a57); font-weight: 600; }
.disclaimer { margin-top: 14px; font-style: italic; }

.loading { padding: 24px 4px; color: var(--muted); font-size: 15px; }
