:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --text: #1d1b16;
  --muted: #6b665c;
  --line: #e7e2d8;
  --accent: #b7791f;
  --accent-ink: #ffffff;
  --green: #2f7d4f;
  --red: #b4372f;
  --radius: 12px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15140f;
    --surface: #1e1c17;
    --text: #f1ede4;
    --muted: #a39d90;
    --line: #34302a;
    --accent: #e0a23b;
    --accent-ink: #1d1b16;
    --green: #5cba82;
    --red: #e2766d;
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.5; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* Header */
.top { border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 5; }
.top .wrap { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand { font-weight: 700; letter-spacing: -0.01em; text-decoration: none; font-size: 1.1rem; margin-right: auto; }
.brand span { color: var(--accent); }
.nav a { text-decoration: none; color: var(--muted); font-size: 0.95rem; }
.nav a:hover { color: var(--text); }
.cart-link { display: inline-flex; align-items: center; gap: 6px; }
.badge { background: var(--accent); color: var(--accent-ink); border-radius: 999px; font-size: 0.75rem; padding: 0 7px; font-weight: 600; }

.demo-bar { background: var(--accent); color: var(--accent-ink); text-align: center; font-size: 0.85rem; padding: 6px 16px; }
.staging-bar { background: var(--text); color: var(--bg); }
.staging-bar a { color: inherit; font-weight: 600; }

main { padding: 32px 0 64px; }
h1 { font-size: 1.75rem; letter-spacing: -0.02em; margin: 0 0 4px; }
h2 { font-size: 1.2rem; margin: 0 0 12px; }
.lead { color: var(--muted); margin: 0 0 28px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.nowrap { white-space: nowrap; }

/* Product cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.photo { width: calc(100% + 40px); margin: -20px -20px 0; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius) var(--radius) 0 0; background: var(--line); }
.card-head { display: flex; gap: 14px; align-items: center; }
.icon { width: 48px; height: 48px; border-radius: 10px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.icon.green { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); }
.card h3 { margin: 0; font-size: 1.05rem; }
.size { color: var(--muted); font-size: 0.9rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.93rem; }
.attrs { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 0.85rem; border-top: 1px solid var(--line); padding-top: 12px; }
.attrs dt { color: var(--muted); }
.attrs dd { margin: 0; }
.card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 4px; }
.price { font-weight: 700; font-size: 1.1rem; }

/* Buttons & forms */
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 16px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn.primary:hover { opacity: 0.88; }
.btn.accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.block { width: 100%; padding: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; }
.qty button { border: 0; background: none; width: 34px; height: 34px; cursor: pointer; font-size: 1.1rem; }
.qty span { min-width: 22px; text-align: center; font-weight: 600; }

label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 6px; }
.field { margin-bottom: 16px; }
input, select, textarea { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 10px 12px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
textarea { min-height: 72px; resize: vertical; }
.hint { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }

.options { display: grid; gap: 8px; }
.option { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 12px; align-items: start; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 12px 14px; cursor: pointer; font-weight: 400; margin: 0; }
.option input { width: auto; margin-top: 4px; accent-color: var(--accent); }
.option:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.option.disabled { opacity: 0.55; cursor: not-allowed; }
.option strong { display: block; }
.option .fee { white-space: nowrap; font-size: 0.85rem; color: var(--muted); }
.soon { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; background: var(--line); border-radius: 999px; padding: 1px 8px; margin-left: 6px; font-weight: 600; }

/* Cart / checkout */
.two-col { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 800px) { .two-col { grid-template-columns: 1.2fr 1fr; align-items: start; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.line { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.line:last-of-type { border-bottom: 0; }
.line .grow { flex: 1; min-width: 0; }
.totals { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; display: grid; gap: 4px; }
.totals div { display: flex; justify-content: space-between; }
.totals .grand { font-weight: 700; font-size: 1.05rem; }
.empty { text-align: center; padding: 48px 16px; }
.error { color: var(--red); font-size: 0.9rem; margin: 8px 0; }
.link-btn { background: none; border: 0; color: var(--muted); cursor: pointer; text-decoration: underline; font-size: 0.85rem; padding: 0; }

/* Tracking timeline */
.timeline { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 0; }
.timeline li { position: relative; padding: 0 0 22px 34px; }
.timeline li::before { content: ""; position: absolute; left: 9px; top: 22px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .dot { position: absolute; left: 0; top: 2px; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); display: grid; place-items: center; font-size: 0.7rem; }
.timeline li.done .dot { background: var(--green); border-color: var(--green); color: #fff; }
.timeline li.done::before { background: var(--green); }
.timeline li.current .dot { border-color: var(--green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 22%, transparent); }
.timeline strong { display: block; }
.timeline li:not(.done):not(.current) strong { color: var(--muted); font-weight: 500; }
.banner { border-radius: 10px; padding: 12px 14px; margin: 12px 0; background: color-mix(in srgb, var(--accent) 12%, transparent); }
.banner.red { background: color-mix(in srgb, var(--red) 12%, transparent); }
.banner.green { background: color-mix(in srgb, var(--green) 12%, transparent); }

.pill { display: inline-block; border-radius: 999px; padding: 1px 10px; font-size: 0.78rem; font-weight: 600; background: var(--line); }
.pill.placed { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.pill.approved, .pill.in_transit { background: color-mix(in srgb, var(--green) 18%, transparent); }
.pill.delivered { background: var(--green); color: #fff; }
.pill.cancelled { background: color-mix(in srgb, var(--red) 20%, transparent); }

.footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; padding: 24px 0; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: 0.9rem; opacity: 0; transition: opacity 0.2s; pointer-events: none; z-index: 20; }
.toast.show { opacity: 1; }

/* Admin */
.tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.tabs button.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.order { margin-bottom: 12px; }
.order summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; list-style: none; }
.order summary::-webkit-details-marker { display: none; }
.order summary .grow { flex: 1; }
.order .body { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 16px; display: grid; gap: 16px; }
@media (min-width: 720px) { .order .body { grid-template-columns: 1fr 1fr; } }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 0.9rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.stat b { display: block; font-size: 1.4rem; }

/* Inventory */
.inv-controls { display: grid; grid-template-columns: 1fr 90px; gap: 8px; margin-top: 12px; }
.inv-controls input[name=note] { grid-column: 1 / -1; }
.inv-controls .btn { grid-column: 1 / -1; }
@media (min-width: 720px) { .inv-controls { grid-template-columns: 150px 100px 1fr auto; } .inv-controls input[name=note], .inv-controls .btn { grid-column: auto; } }
.stock-low { color: var(--red); font-weight: 600; }
.qty button:disabled { opacity: 0.3; cursor: not-allowed; }

/* Mobile-first: sticky cart bar + comfortable tap targets */
.cart-bar { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--text); color: var(--bg); text-decoration: none; border-radius: 14px; padding: 14px 18px; box-shadow: 0 6px 24px rgba(0,0,0,.18); max-width: 560px; margin: 0 auto; }
.cart-bar[hidden] { display: none; }
body.has-bar main { padding-bottom: 96px; }
body.has-bar .toast { bottom: calc(88px + env(safe-area-inset-bottom)); }
.btn, .qty button { min-height: 44px; }
.qty button { width: 44px; }
input, select, textarea { font-size: 16px; } /* stops iOS zooming into fields */
@media (max-width: 480px) {
  h1 { font-size: 1.5rem; }
  main { padding-top: 20px; }
  .top .wrap { gap: 12px; height: 54px; }
  .option .fee { grid-column: 2; }
}

/* Waitlist */
.waitlist { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.waitlist .row { flex-wrap: nowrap; }
.waitlist .error { margin: 0; }

/* Education & trust */
.trust { list-style: none; padding: 0; margin: -12px 0 16px; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.85rem; color: var(--muted); }
.trust li::before { content: "✓ "; color: var(--green); font-weight: 700; }
.learn-cta { display: block; text-decoration: none; background: color-mix(in srgb, var(--green) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--green) 30%, var(--line)); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 20px; font-size: 0.92rem; }
.learn-cta strong { color: var(--green); white-space: nowrap; }
.learn-row { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 0.88rem; }
.learn-row a { color: var(--green); font-weight: 600; text-decoration: none; }
.learn-row .watch { color: var(--accent); text-decoration: none; font-size: 0.88rem; font-weight: 600; }
.learn-row .share-link { margin-left: auto; color: var(--muted); text-decoration: none; font-weight: 600; }
.share-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 24px 0 8px; font-size: 0.92rem; }
.share-row span { color: var(--muted); }
.share-row .share-wa { color: var(--green); font-weight: 600; text-decoration: none; }
.share-row .share-copy { flex: 1 1 220px; padding: 4px 8px; font-size: 0.85rem; }

/* Click-to-load YouTube player */
.yt { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; }
.yt img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0.85; }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-play { position: absolute; inset: 0; margin: auto; width: 68px; height: 48px; border: 0; border-radius: 14px; background: rgba(0, 0, 0, 0.72); cursor: pointer; }
.yt-play::after { content: ""; position: absolute; left: 27px; top: 14px; border-style: solid; border-width: 10px 0 10px 17px; border-color: transparent transparent transparent #fff; }
.yt:hover .yt-play { background: #c00; }
.yt-note { position: absolute; left: 10px; bottom: 8px; font-size: 0.75rem; color: #fff; background: rgba(0, 0, 0, 0.55); padding: 2px 8px; border-radius: 999px; }
.video-dialog { width: min(94vw, 760px); border: 0; border-radius: var(--radius); padding: 12px; background: var(--surface); color: var(--text); }
.video-dialog::backdrop { background: rgba(0, 0, 0, 0.7); }
.video-dialog form { margin-top: 10px; }

/* Learn pages */
.prose { max-width: 680px; margin: 0 auto; }
.prose h2 { font-size: 1.25rem; margin: 32px 0 8px; }
.prose h3 { font-size: 1.02rem; margin: 0 0 4px; }
.prose p, .prose li { color: var(--text); }
.prose ul, .prose ol { padding-left: 20px; }
.prose li { margin-bottom: 6px; }
.prose .meta { color: var(--muted); font-size: 0.85rem; margin: 0 0 20px; }
.prose .video-slot { margin: 20px 0; }
.check { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 10px 0; }
.check p { margin: 4px 0 0; font-size: 0.93rem; }
.check .verdict { color: var(--muted); font-size: 0.85rem; }
.check.myth { border-style: dashed; }
.callout { border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); padding: 12px 16px; border-radius: 0 var(--radius) var(--radius) 0; margin: 20px 0; }
.cta-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 8px; }
.guide-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.guide-list a { text-decoration: none; }
.guide-list .card h3 { font-size: 1rem; }
.breadcrumb { font-size: 0.85rem; color: var(--muted); margin-bottom: 8px; }
.breadcrumb a { color: var(--muted); }

/* Phase 1: payments, follow-ups, growth */
.check-label { display: flex; gap: 10px; align-items: center; font-weight: 600; cursor: pointer; }
.check-label.small { font-weight: 400; }
.check-label input { width: auto; accent-color: var(--accent); }
.pay-fields { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; }
.pay ol { padding-left: 20px; margin: 0 0 12px; }
.pay li { margin-bottom: 4px; }
.pay .till { font-size: 1.1rem; letter-spacing: 0.04em; }
.pay form { flex-wrap: nowrap; }
.attention { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.attention .row { flex-wrap: nowrap; }
.stat b + .small { display: block; margin-top: 2px; }
.stat.met b { color: var(--green); }
.stat.unmet b { color: var(--accent); }

/* Static "About" facts on the shop page (also read by crawlers) */
.about { margin-bottom: 40px; }
.about h2 { font-size: 1.05rem; }
.about p { color: var(--muted); margin-top: 0; }
.about[hidden] { display: none; }

/* Answer-first summaries on guides (what AI answers and snippets quote) */
.answer { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 0 var(--radius) var(--radius) 0; padding: 12px 16px; margin: 16px 0 20px; }
.answer p { margin: 0; }

/* Phase 2: wholesale, delivery rules, business details */
.bulk-line { margin: 0; color: var(--green); }
.bulk-applied { color: var(--green); font-weight: 600; }
.option .rule-note { display: block; color: var(--green); margin-top: 2px; }
.option .stock-low { display: block; margin-top: 2px; }
.free-nudge { color: var(--green); margin: 8px 0 0; }
.suggest { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.suggest > p { margin: 0 0 8px; }
.suggest-item { display: flex; align-items: center; gap: 12px; }
.suggest-item .grow { flex: 1; min-width: 0; }
.suggest-item .btn { flex: none; }
.suggest-why { margin: 8px 0 0; }
details.business { border: 1px dashed var(--line); border-radius: 10px; padding: 10px 14px; }
details.business summary { cursor: pointer; font-size: 0.9rem; color: var(--muted); }
details.business[open] summary { margin-bottom: 12px; }
details.business .field:last-child { margin-bottom: 0; }

/* Tables in the admin (scroll sideways on small screens) */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.kpi-table, .rules-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.kpi-table th, .kpi-table td, .rules-table th, .rules-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.kpi-table th, .rules-table th { color: var(--muted); font-weight: 600; font-size: 0.8rem; }
.kpi-table .num { text-align: right; }
.rules-table input { min-width: 90px; }

/* Invoice / receipt */
.invoice { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.inv-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; border-bottom: 2px solid var(--text); padding-bottom: 12px; margin-bottom: 16px; }
.inv-brand { font-size: 1.3rem; }
.inv-meta { text-align: right; }
.inv-meta h2 { margin: 0 0 4px; text-transform: uppercase; letter-spacing: 0.08em; font-size: 1.1rem; }
.inv-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.inv-lines { width: 100%; border-collapse: collapse; font-size: 0.92rem; margin-bottom: 12px; }
.inv-lines th, .inv-lines td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.inv-lines th { font-size: 0.8rem; color: var(--muted); }
.inv-lines .num { text-align: right; white-space: nowrap; }
.inv-lines tfoot td { border-bottom: 0; padding-top: 4px; padding-bottom: 4px; }
.inv-lines .grand td { font-weight: 700; font-size: 1.05rem; border-top: 2px solid var(--text); padding-top: 8px; }
.invoice-dialog { width: min(94vw, 800px); border: 0; border-radius: var(--radius); padding: 12px; background: var(--bg); color: var(--text); }
.invoice-dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
@media (max-width: 480px) { .invoice { padding: 16px; } .inv-meta { text-align: left; } .inv-parties { grid-template-columns: 1fr; } }

/* CBD shop pickup */
.shop-strip { margin: -4px 0 16px; color: var(--muted); }
.shop-strip strong { color: var(--text); }
.pickup { text-align: center; border-color: color-mix(in srgb, var(--green) 40%, var(--line)); }
.pickup-code { display: block; font-size: 2.2rem; letter-spacing: 0.25em; margin: 2px 0 6px; font-variant-numeric: tabular-nums; }

/* Batch page, team */
.batch-facts { margin: 16px 0; }
.staff-row { border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 4px; }
.staff-row .line { border-bottom: 0; }
.audit-table td { white-space: normal; vertical-align: top; }
.audit-table td:first-child { white-space: nowrap; }
.audit-table td:last-child { min-width: 180px; }
/* Catalogue editor and launch checklist (admin) */
.inv .thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); flex: none; }
.hidden-product { opacity: 0.7; }
.edit-product { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.edit-product > summary, .add-product > summary, .launch > summary { cursor: pointer; font-size: 0.92rem; }
.order .edit-product > summary { color: var(--accent); font-weight: 600; gap: 4px; }
.order .edit-product > summary::after { content: "▸"; }
.order .edit-product[open] > summary::after { content: "▾"; }
.product-form { margin-top: 12px; }
.product-form .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 520px) { .product-form .grid2 { grid-template-columns: 1fr; } }
.photo-preview { display: block; width: 96px; height: 96px; object-fit: cover; border-radius: 10px; margin-top: 8px; border: 1px solid var(--line); }
.photo-preview[hidden] { display: none; }
.launch .tick, .checks .tick { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 0.75rem; font-weight: 700; }
.launch .tick.ok, .checks .tick.ok { background: var(--green); border-color: var(--green); color: #fff; }
.etims-text { white-space: pre-wrap; font: 0.9rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; margin: 0; }

/* QR labels: A4 sheets of 24 stickers (3 × 8, 63.5 × 33.9 mm) */
.qr-labels { display: grid; grid-template-columns: repeat(3, 63.5mm); column-gap: 2.5mm; justify-content: center; }
.qr-label { display: flex; align-items: center; gap: 2mm; height: 33.9mm; padding: 2mm 3mm; box-sizing: border-box; overflow: hidden;
  font: 8pt/1.25 system-ui, sans-serif; color: #000; background: #fff; outline: 1px dashed #ccc; break-inside: avoid; }
.qr-label svg { width: 25mm; height: 25mm; flex: none; }
.qr-label strong { font-size: 9pt; }
.qr-note { margin-top: 1mm; font-size: 7pt; }

/* Reviews: stars on cards, the list, and tap-to-rate on the order page */
.stars { color: var(--accent); letter-spacing: 1px; }
.card .rating { display: inline-block; margin: -2px 0 8px; color: var(--text); text-decoration: none; font-size: 0.88rem; }
.reviews-dialog { width: min(560px, calc(100vw - 32px)); max-height: 80vh; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 20px; }
.reviews-dialog::backdrop { background: rgb(0 0 0 / 45%); }
.reviews-dialog h2 { margin-top: 0; }
.review { padding: 12px 0; border-bottom: 1px solid var(--line); }
.review p { margin: 6px 0 0; }
.review .reply { padding-left: 12px; border-left: 3px solid var(--line); color: var(--muted); }
.review-form { display: grid; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.star-pick { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
.star-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-pick label { font-size: 1.8rem; line-height: 1; color: var(--line); cursor: pointer; }
.star-pick input:checked ~ label, .star-pick label:hover, .star-pick label:hover ~ label { color: var(--accent); }
.star-pick input:focus-visible + label { outline: 2px solid var(--accent); border-radius: 4px; }
/* Places (My details, checkout) */
.place-form .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 520px) { .place-form .grid2 { grid-template-columns: 1fr; } }
.pin-field { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.pin-field input[name=maplink] { flex: 1 1 220px; }
.places { margin-bottom: 8px; }
.notify { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }

/* Deliveries (admin): collection point, live map, stops */
.run-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.run-head input { width: auto; }
.run-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; margin-bottom: 16px; }
@media (max-width: 800px) { .run-grid { grid-template-columns: 1fr; } }
.run-grid .panel { margin: 0; }
.run-map-panel { padding: 8px; }
.run-map { position: relative; height: 360px; overflow: hidden; border-radius: 8px; background: #e8e4da; cursor: crosshair; touch-action: manipulation; }
.run-map img { position: absolute; width: 256px; height: 256px; max-width: none; user-select: none; pointer-events: none; }
.run-map svg { position: absolute; inset: 0; pointer-events: none; }
.run-map .stop-pin circle { fill: #2f7d4f; stroke: #fff; stroke-width: 2; }
.run-map .stop-pin text { fill: #fff; font: 700 11px system-ui, sans-serif; text-anchor: middle; }
.run-map .hub-pin { fill: #b7791f; stroke: #fff; stroke-width: 2; }
.map-credit { position: absolute; right: 4px; bottom: 2px; padding: 0 4px; border-radius: 3px; background: rgb(255 255 255 / 85%); color: #333; font-size: 10px; }
.stops { list-style: none; padding: 0; margin: 0 0 12px; }
.stops li { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.stops .seq { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 0.85rem; }
.zones-table input { min-width: 70px; }
.zones-table td:first-child input { min-width: 150px; }
.review-mod { display: grid; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }

/* Rider page (rider.html) */
.rider .stop { margin-bottom: 12px; }
.rider .stop.next { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.rider .stop.done { opacity: 0.6; }
.rider .stop p { margin: 6px 0; }
.stop-head { display: flex; align-items: center; gap: 10px; }
.stop-head .seq, .rider .seq { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 0.85rem; }
.rider .seq.hub { background: var(--accent); }

/* Links and QR codes (Admin → Growth) */
.links .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; margin-top: 12px; }
@media (max-width: 520px) { .links .grid2 { grid-template-columns: 1fr; } }
.link-out { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 12px; }
.link-out code { flex: 1 1 240px; padding: 8px 10px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); font-size: 0.85rem; word-break: break-all; }
.link-qr svg { width: 132px; height: 132px; background: #fff; border-radius: 6px; }
.status-kit { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.status-kit .grow { flex: 1 1 240px; min-width: 0; }
.status-preview { flex: none; width: 180px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); line-height: 0; }
.status-preview > svg { width: 100%; height: auto; }
.status-text { margin: 0 0 12px; padding: 10px 12px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); font: inherit; font-size: 0.85rem; white-space: pre-wrap; word-break: break-word; }
/* Prints, A4 within the @page margins below: 4 table cards, a poster, or 24 round 40 mm lid stickers */
.qr-cards { display: grid; grid-template-columns: repeat(2, 94mm); grid-auto-rows: 130mm; gap: 6mm; justify-content: center; }
.qr-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4mm; padding: 8mm; box-sizing: border-box;
  text-align: center; color: #000; background: #fff; outline: 1px dashed #ccc; break-inside: avoid; font-family: system-ui, sans-serif; }
.qr-card h2 { margin: 0; font-size: 22pt; line-height: 1.15; }
.qr-card svg { width: 58mm; height: 58mm; }
.qr-card p { margin: 0; font-size: 12pt; line-height: 1.3; }
.qr-brand { font: 600 10pt/1 system-ui, sans-serif; letter-spacing: 0.1em; text-transform: uppercase; color: #000; }
.qr-addr { font-size: 8pt; color: #444; word-break: break-all; }
.qr-poster { display: flex; flex-direction: column; align-items: center; gap: 7mm; padding-top: 12mm; text-align: center; color: #000; background: #fff; font-family: system-ui, sans-serif; }
.qr-poster h2 { margin: 0; font-size: 42pt; line-height: 1.08; }
.qr-poster p { margin: 0; font-size: 18pt; line-height: 1.3; }
.qr-poster svg { width: 120mm; height: 120mm; }
.qr-poster .qr-scan { font-size: 13pt; }
.qr-poster .qr-addr { font-size: 11pt; }
.qr-stickers { display: grid; grid-template-columns: repeat(4, 40mm); grid-auto-rows: 40mm; gap: 5mm; justify-content: center; }
.qr-sticker { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.6mm; padding: 3mm; box-sizing: border-box;
  border-radius: 50%; text-align: center; color: #000; background: #fff; outline: 1px dashed #ccc; outline-offset: -1px; overflow: hidden;
  break-inside: avoid; font-family: system-ui, sans-serif; }
.qr-sticker strong { font-size: 9pt; line-height: 1; }
.qr-sticker svg { width: 24mm; height: 24mm; flex: none; }
.qr-sticker span { max-width: 30mm; font-size: 5.5pt; line-height: 1.15; }

/* Printing: only #print-area (filled by KF.printHtml), in black on white */
#print-area { display: none; }
@media print {
  @page { size: A4; margin: 12.9mm 7.25mm; } /* lines the labels up with 24-per-sheet stickers */
  body { background: #fff; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block; }
  #print-area .invoice { border: 0; padding: 0; background: #fff; color: #000; }
  #print-area .inv-head, #print-area .inv-lines .grand td { border-color: #000; }
  #print-area .qr-label, #print-area .qr-card, #print-area .qr-sticker { outline-color: #eee; }
}

/* Admin → Orders → Take an order */
.take-items input { width: 76px; flex: none; }
.take-done p { margin: 0 0 8px; }
/* Admin → Deliveries → Runs */
.runs-table input { width: 110px; }
.gain { color: var(--green); font-weight: 600; }
.loss { color: var(--red); font-weight: 600; }
