/* Dinner Clipper: a grocery flyer on newsprint. Sale red for prices, highlighter yellow for the good part. */
:root {
  --paper: #fffaf0; --ink: #1a1a1a; --muted: #5f5b52; --line: #e8dfcb;
  --red: #e1251b; --red-dark: #b81b13; --yellow: #ffe14d; --green: #2f8f4e; --card: #ffffff;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.5 "Rubik", "Helvetica Neue", Arial, sans-serif; }
a { color: var(--red-dark); }
.wrap { max-width: 980px; margin: 0 auto; padding-inline: 18px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }

.top { background: var(--red); color: #fff; }
.top .wrap { display: flex; align-items: center; gap: 10px; padding-block: 12px; }
.logo { font: 400 28px/1 "Anton", Impact, sans-serif; letter-spacing: .02em; color: #fff; text-decoration: none; display: flex; align-items: center; gap: 8px; text-transform: uppercase; }
.tag { background: var(--yellow); color: var(--red-dark); width: 34px; height: 34px; display: grid; place-items: center; border-radius: 6px 6px 6px 16px; transform: rotate(-8deg); font-size: 22px; }
.beta { font-size: 12px; font-weight: 700; border: 1.5px solid #fff; border-radius: 999px; padding: 2px 8px; text-transform: uppercase; letter-spacing: .06em; }

.hero, .result-head { padding: 34px 0 20px; }
.kicker { font-weight: 700; color: var(--red); text-transform: uppercase; letter-spacing: .1em; font-size: 13px; margin: 0 0 6px; }
h1 { font: 400 clamp(40px, 7vw, 68px)/1 "Anton", Impact, sans-serif; text-transform: uppercase; letter-spacing: .01em; }
.hl { background: linear-gradient(transparent 55%, var(--yellow) 55%); padding: 0 4px; }
.lede { font-size: 19px; color: var(--muted); max-width: 58ch; margin: 14px 0 0; }

.card { background: var(--card); border: 2px solid var(--ink); border-radius: 14px; box-shadow: 5px 5px 0 var(--ink); }
.planner { padding: 22px; display: grid; gap: 14px; grid-template-columns: 1fr 1fr; margin: 6px 0 30px; }
.planner .wide { grid-column: 1 / -1; }
.planner label { display: grid; gap: 6px; font-weight: 600; font-size: 15px; }
.planner input[type=text], .planner input:not([type]), .planner select {
  width: 100%; font: 18px "Rubik", sans-serif; padding: 12px; border: 2px solid var(--ink); border-radius: 10px; background: #fff; }
.stores { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.stores legend { font-weight: 600; font-size: 15px; margin-bottom: 6px; padding: 0; }
.pill { display: inline-flex !important; grid-auto-flow: column; align-items: center; gap: 8px; border: 2px solid var(--ink); border-radius: 999px; padding: 9px 16px; cursor: pointer; background: #fff; }
.pill:has(input:checked) { background: var(--yellow); }
.check { display: flex !important; align-items: center; gap: 10px; font-weight: 500 !important; }
.check input { width: 20px; height: 20px; accent-color: var(--red); }
.go { font: 400 24px/1 "Anton", Impact, sans-serif; text-transform: uppercase; letter-spacing: .03em; background: var(--red); color: #fff; border: 2px solid var(--ink); border-radius: 12px; padding: 16px; cursor: pointer; box-shadow: 4px 4px 0 var(--ink); }
.go:hover { background: var(--red-dark); }
.go:disabled { opacity: .75; cursor: progress; }
.go:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.err { background: #fde2e0; border: 2px solid var(--red); border-radius: 10px; padding: 10px 12px; margin: 0; }
.hint { color: var(--muted); font-size: 15px; margin: 6px 0 0; }
@media (max-width: 560px) { .planner { grid-template-columns: 1fr; } }

.how { list-style: none; padding: 0; margin: 0 0 40px; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); counter-reset: s; }
.how li { counter-increment: s; border-top: 3px dashed var(--ink); padding-top: 12px; color: var(--muted); }
.how li b { display: block; color: var(--ink); font: 400 24px/1.1 "Anton", sans-serif; text-transform: uppercase; }
.how li b::before { content: counter(s) ". "; color: var(--red); }

.store-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.store { background: var(--yellow); border: 2px solid var(--ink); border-radius: 12px; padding: 10px 14px; display: grid; max-width: 440px; }
.store b { font-size: 18px; }
.store span { font-size: 14.5px; color: #3d3a33; }

.sec { font: 400 34px/1 "Anton", Impact, sans-serif; text-transform: uppercase; margin: 34px 0 14px; }
.list { padding: 16px 18px; margin-bottom: 14px; }
.list h3 { font-size: 20px; margin-bottom: 8px; }
.list ul { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: baseline; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.list li:last-child { border-bottom: 0; }
.list .what { flex: 1; }
.list small { color: var(--muted); }
.sale { background: var(--red); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .06em; padding: 2px 6px; border-radius: 4px; }
.cost { font-weight: 700; font-variant-numeric: tabular-nums; }

.meals { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.meal { padding: 18px; display: grid; gap: 8px; align-content: start; }
.meal-head { display: flex; gap: 12px; align-items: flex-start; }
.num { background: var(--red); color: #fff; font: 400 22px/1 "Anton", sans-serif; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; flex: none; }
.meal h3 { font-size: 20px; }
.meal-head p { margin: 2px 0 0; color: var(--muted); font-size: 15.5px; }
.meta { margin: 0; font-size: 14px; font-weight: 600; color: var(--green); }
.meal summary { cursor: pointer; font-weight: 700; color: var(--red-dark); }
.meal h4 { margin: 12px 0 4px; font-size: 15px; text-transform: uppercase; letter-spacing: .06em; }
.meal ul, .meal ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 15.5px; }

.tips { padding: 18px 20px; margin-top: 30px; }
.tips ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }

.deals { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); margin-bottom: 40px; }
.deal { background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 2px; font-size: 14.5px; }
.deal .price { font: 400 26px/1 "Anton", sans-serif; color: var(--red); }
.deal .price small { font-size: 15px; }
.deal span:last-child { color: var(--muted); font-size: 13px; }

footer { border-top: 2px solid var(--ink); padding: 18px 0 26px; color: var(--muted); font-size: 14px; }

/* ---------- shopping list: totals, actions, ticks ---------- */
.shop-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.total-tag { background: var(--yellow); border: 2px solid var(--ink); border-radius: 8px 8px 8px 22px; padding: 8px 16px; display: grid; justify-items: end; transform: rotate(-2deg); box-shadow: 3px 3px 0 var(--ink); margin-bottom: 12px; }
.total-tag span { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.total-tag b { font: 400 38px/1 "Anton", sans-serif; color: var(--red-dark); }
.total-tag small { font-size: 12px; color: #3d3a33; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.act { font: 600 15px "Rubik", sans-serif; background: #fff; color: var(--ink); border: 2px solid var(--ink); border-radius: 999px; padding: 9px 16px; cursor: pointer; text-decoration: none; }
.act:hover { background: var(--yellow); }
.act:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.list-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.list-head h3 { margin: 0; }
.subtotal { font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.tick { flex: 1; display: flex; align-items: baseline; gap: 10px; cursor: pointer; }
.tick input { width: 18px; height: 18px; accent-color: var(--green); transform: translateY(3px); flex: none; }
.tick input:checked + .what { text-decoration: line-through; color: var(--muted); }
.grand { display: flex; justify-content: space-between; align-items: baseline; border-top: 3px double var(--ink); padding: 12px 4px 0; margin-top: 4px; font-weight: 700; font-size: 18px; }
.grand b { font: 400 34px/1 "Anton", sans-serif; color: var(--red-dark); }

@media print {
  .top, footer, .actions, .hint a, .store-chips, #copied { display: none !important; }
  body { background: #fff; font-size: 13px; }
  .card { box-shadow: none; border: 1px solid #999; }
  .total-tag { transform: none; box-shadow: none; }
  /* "Print list" prints just the shopping list */
  body.print-list main > section:not(#shop) { display: none; }
  body.print-list main > .result-head { display: block; }
  body.print-list .result-head .lede { display: none; }
  details { display: block; } details > summary { display: none; }
}

@media print {
  body.print-all #deals, body.print-all .tips, body.print-all .actions, body.print-all .hint { display: none !important; }
  body.print-all .meal { break-inside: avoid; }
  body.print-all .meals { grid-template-columns: 1fr; }
  body.print-all #dinners { break-before: page; }
}

/* ---------- progress page ---------- */
.waiting { padding: 40px 18px 60px; max-width: 640px; }
.waiting h1 { font-size: clamp(34px, 6vw, 52px); margin-bottom: 18px; }
.bar { position: relative; height: 34px; background: #fff; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; box-shadow: 4px 4px 0 var(--ink); }
.fill { height: 100%; width: 0; background: repeating-linear-gradient(-45deg, var(--red) 0 14px, #ee4237 14px 28px); transition: width .12s linear; }
@media (prefers-reduced-motion: no-preference) { .fill { background-size: 40px 40px; animation: march 1s linear infinite; } }
@keyframes march { from { background-position: 0 0; } to { background-position: 40px 0; } }
.pct { position: absolute; inset: 0; display: grid; place-items: center; font: 400 18px/1 "Anton", sans-serif; color: var(--ink); text-shadow: 0 0 4px #fff, 0 0 8px #fff; }
.detail { color: var(--muted); margin: 12px 0 22px; min-height: 1.5em; }
.stages { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 10px; }
.stages li { display: flex; align-items: center; gap: 12px; color: var(--muted); font-weight: 500; }
.stages .dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #c9c2b0; flex: none; display: grid; place-items: center; font-size: 13px; }
.stages li.now { color: var(--ink); font-weight: 700; }
.stages li.now .dot { border-color: var(--red); background: var(--yellow); }
.stages li.done { color: var(--ink); }
.stages li.done .dot { background: var(--green); border-color: var(--green); }
.stages li.done .dot::after { content: "✓"; color: #fff; font-weight: 700; }
.tipcard { padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; }
.tipcard p { margin: 0; }
.tag.small { width: auto; height: auto; padding: 4px 8px; font: 700 12px "Rubik", sans-serif; transform: rotate(-4deg); background: var(--yellow); color: var(--red-dark); border-radius: 4px; flex: none; }

/* ---------- savings, comparison, subscribe ---------- */
.savings { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.savings div { background: #fff; border: 2px solid var(--ink); border-radius: 12px; padding: 8px 14px; display: grid; }
.savings b { font: 400 30px/1 "Anton", sans-serif; color: var(--green); }
.savings span { font-size: 13px; font-weight: 600; color: var(--muted); }
.compare { margin: 0 0 34px; }
.cmp-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.cmp { background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 16px; display: grid; gap: 4px; }
.cmp.us { border: 2px solid var(--ink); background: var(--yellow); box-shadow: 4px 4px 0 var(--ink); }
.cmp .who { font-weight: 700; text-transform: uppercase; font-size: 13px; letter-spacing: .06em; }
.cmp b { font: 400 44px/1 "Anton", sans-serif; color: var(--red-dark); }
.cmp.us b { color: var(--ink); }
.cmp span:last-child { color: var(--muted); font-size: 14.5px; }
.cmp.us span:last-child { color: #3d3a33; }
.subscribe { padding: 20px; margin-top: 30px; background: var(--yellow); }
.subscribe p { margin: 0 0 12px; }
.sub-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.sub-form input[type=email] { font: 18px "Rubik", sans-serif; padding: 12px; border: 2px solid var(--ink); border-radius: 10px; min-width: 0; }
.sub-form .go { font-size: 20px; padding: 12px 18px; }
.sub-form .consent { grid-column: 1 / -1; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.sub-form .consent input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.sr { position: absolute; left: -9999px; }
@media (max-width: 520px) { .sub-form { grid-template-columns: 1fr; } }

/* meal builder + per-person total */
.meals-pick { border: 2px dashed var(--ink); border-radius: 12px; padding: 12px 14px 14px; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.meals-pick legend { font-weight: 700; padding: 0 6px; }
.meals-pick .snack { grid-column: 1 / -1; }
@media (max-width: 560px) { .meals-pick { grid-template-columns: repeat(3, 1fr); } .meals-pick select { padding: 10px 6px; } }
.total-tag em { font-style: normal; font-weight: 700; font-size: 15px; color: var(--ink); background: #fff; border: 1.5px solid var(--ink); border-radius: 999px; padding: 2px 10px; margin: 4px 0 2px; }
.grand span small { display: block; font-size: 14px; font-weight: 600; color: var(--muted); }
.meal-group { font: 400 24px/1 "Anton", sans-serif; text-transform: uppercase; margin: 22px 0 10px; color: var(--red-dark); }

.eta { color: var(--muted); font-size: 14px; white-space: nowrap; }

/* ---------- email gate, mix it up ---------- */
.gate { padding: 20px; margin: 4px 0 18px; background: var(--yellow); border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.gate { margin: 0 0 26px; }
.gate-kicker { font: 400 30px/1.05 "Anton", Impact, sans-serif; text-transform: uppercase; margin: 0 0 14px; }
.gate-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 14px; }
.gate-stats div { background: #fff; border: 2px solid var(--ink); border-radius: 12px; padding: 10px 12px; }
.gate-stats b { display: block; font: 400 34px/1 "Anton", Impact, sans-serif; color: var(--green); }
.gate-stats span { font-size: 13px; font-weight: 600; }
.gate-gets { list-style: none; padding: 0; margin: 0 0 16px; font-weight: 600; }
.gate-gets li { padding-left: 28px; position: relative; margin: 6px 0; }
.gate-gets li::before { content: "✓"; position: absolute; left: 0; color: #fff; background: var(--green); border-radius: 50%; width: 20px; height: 20px; font-size: 13px; line-height: 20px; text-align: center; top: 1px; }
.locked .meal details, .locked .list ul, .locked .grand {
  filter: blur(6px); pointer-events: none; user-select: none; -webkit-user-select: none; }
.locked .mix, .locked .actions, .locked > .hint { display: none; }
.locked .meal details { max-height: 60px; overflow: hidden; }
.sub-form p.consent { margin: 0; color: var(--ink); opacity: .8; }
.note { background: #fff; border-left: 5px solid var(--green); padding: 10px 14px; font-weight: 600; }
.mix { text-align: center; margin: 22px 0 6px; }
.mix .go { font-size: 22px; padding: 12px 26px; }
.mix .hint { margin-top: 8px; }
form.inline { display: contents; }
@media print { .gate, .mix, .note { display: none !important; } }
