/* Jade Bite — v5.0 Uber Eats home (Oliver: "Go back to uber eats style
   design", "Change hero", "With chat button").
   - Home is a browse-first Uber Eats page: search + chips + hero +
     Ask Bun + Signature big-image cards + 10 cities + decode teaser.
   - Chat is a feature, not the homepage: Bun avatar button beside the
     search bar + a full-width Ask Bun button under the hero.
   - Bottom nav is Home / Search / Orders / Account (v3.2 naming).
   - Kept from v4.1–v4.4: Cormorant Garamond + Inter, small sizes
     (h1 26px/600, dish names 16px/600, body 15px), English-only UI,
     400px frame, FAQ, Kit at top of Account, diet multi-select,
     human copy, system-follow theme, electric purple, warm colours 0.
   - Not back: 40px/900 titles, grey-blue corporate palette, fat cards,
     grey pill nav, hero text wall.
   v4.2 English-only UI + smaller app frame (see below for the v4.2 note).
   v4.2 (Oliver: "不要中英文交叉使用", "页面框架偏大，感官非 app 模式", "Kit 直接放 Account"):
   - UI copy is English only. Chinese stays only where it has to be read in the real
     world: dish names + the big waiter sentences (diet cards, order slip, hotel card).
   - Frame shrinks toward a real app: main column 480px -> 400px, tighter padding,
     gaps and nav. Fonts untouched (v4.1 Cormorant + Inter, sizes as they were).
   - Kit lives at the top of Account, already open — no separate Kit entry.
   v4.1 smaller + lighter (Oliver: "make the type smaller, prettier, swap it").
   v3.4/v4.0's display serif was still too heavy on the eye: 30px/700
   + 16px body felt chunky at phone width. v4.1 goes one step
   smaller and lighter instead of louder.
   - Type: Cormorant Garamond (display serif, light + airy, italic
     accents) + Inter (body). Chosen over Playfair Display: Playfair is
     sturdier/heavier with thick strokes; Cormorant is finer, higher
     contrast, more breathing room — the light, elegant feel Oliver
     asked for. h1 26px/600, h2 20px/600, dish names 16px/600,
     body 15px/1.6, 400-500 weight. No 900 anywhere, no 700 on display
     type. Letter-spacing, sentence case, italic touches — design,
     not shouting. Cormorant has a small x-height, so display sizes
     read delicate on purpose; body never drops below 15px.
   - Mindtrip lessons (see Blueprint §12.27): photo-led cards, generous
     whitespace, restrained colour (one violet accent, black anchor),
     sentence-case headlines, preference chips in plain language,
     price shown plainly, one clear next step per card. No brand colour,
     logo or copy copied from Mindtrip — design language only.
   - Theme: follows the phone (prefers-color-scheme). No toggle button,
     no menu button, no localStorage override. <head> sets data-theme
     before CSS; app.js listens for system changes.
   - Warm colours 0, gradients 0. Bottom nav stays solid black.
   - Bottom clearance untouched (v3.1): main padding-bottom 168px. */
:root{
  --font-display:"Cormorant Garamond",Georgia,"Times New Roman",serif;
  --font-body:Inter,-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Roboto,"PingFang SC","Microsoft YaHei",sans-serif;
  --accent:#6D28D9; --accent-ink:#ffffff; --accent-soft:#F1EBFE;
  --ok:#15803d; --ok-bg:#DCFCE7; --warn:#92400E; --warn-bg:#FEF3C7;
  --bad:#B91C1C; --bad-bg:#FEE2E2;
  --radius:20px; --shadow:0 1px 2px rgba(16,24,40,.06); --shadow-lift:0 10px 28px rgba(16,24,40,.12);
}
html[data-theme="light"]{
  --bg:#F5F6F8; --card:#ffffff; --card2:#F5F6F8; --ink:#0A0A0B; --muted:#6B7280;
  --line:#E7E9EC; --line-strong:#D4D7DB; --input-bg:#ffffff; --code-bg:#F0F1F3;
  color-scheme:light;
}
html[data-theme="dark"]{
  --bg:#0A0E14; --card:#141B26; --card2:#1A2331; --ink:#F2F4F7; --muted:#9AA7B8;
  --line:#232E3D; --line-strong:#38465A; --input-bg:#0F151D; --code-bg:#1A2331;
  --accent:#A78BFA; --accent-soft:#241A45; --shadow:0 1px 2px rgba(0,0,0,.4); --shadow-lift:0 10px 28px rgba(0,0,0,.5);
  --ok:#4ADE80; --ok-bg:#0D2B18; --warn:#FBBF24; --warn-bg:#33270A;
  --bad:#F87171; --bad-bg:#3A1414;
  color-scheme:dark;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;scroll-behavior:smooth;scroll-padding-top:76px;scroll-padding-bottom:168px}
body{margin:0;background:var(--bg);color:var(--ink);font:15px/1.6 var(--font-body);overflow-x:hidden;-webkit-font-smoothing:antialiased}
img{max-width:100%}
html[data-theme="dark"] img{filter:brightness(.92)}
/* v4.2 bottom clearance: bottom nav footprint max ~102px (12px bottom margin +
   ~56px nav height + up to 34px iPhone safe area); main bottom padding 156px
   leaves ~54px clear above the nav. */
main{max-width:400px;margin:0 auto;padding:12px 12px 156px;display:flex;flex-direction:column;gap:14px}
h1{font-family:var(--font-display);font-size:26px;line-height:1.2;font-weight:600;letter-spacing:0;margin:12px 0}
h1 em{font-style:italic;font-weight:500}
h2{font-family:var(--font-display);font-size:20px;line-height:1.3;font-weight:600;letter-spacing:0;margin:0}
h3{font-size:17px;line-height:1.3;font-weight:600;margin:20px 0 8px}
p{margin:10px 0}
a{color:var(--accent)}
.hidden{display:none!important}

/* ---- Dev badge ---- */
.dev-badge{display:inline-block;background:var(--accent);color:var(--accent-ink);font-size:11px;font-weight:700;letter-spacing:.05em;padding:5px 10px;border-radius:999px;white-space:nowrap;flex:0 0 auto}
.dev-note{background:var(--accent-soft);color:var(--ink);font-weight:600;padding:14px 16px;border-radius:20px}

/* ---- App bar (sticky top) ---- */
.appbar{position:sticky;top:0;z-index:40;background:var(--card);border-bottom:1px solid var(--line)}
.appbar-wrap{max-width:400px;margin:0 auto;padding:0 12px}
.appbar-inner{display:flex;align-items:center;gap:10px;min-height:56px}
.appbar-inner img{width:40px;height:40px;border-radius:50%;object-fit:cover;display:block;flex:0 0 40px;border:1px solid var(--line)}
.appbar-title{font-family:var(--font-display);font-size:18px;font-weight:600;letter-spacing:0;flex:1;min-width:0}

/* ---- Bottom nav (fixed): SOLID BLACK pill, white icons, lavender active ---- */
.bottomnav{position:fixed;bottom:12px;left:50%;transform:translateX(-50%);width:calc(100% - 24px);max-width:376px;background:#0A0A0B;border:0;border-radius:999px;box-shadow:0 10px 28px rgba(0,0,0,.35);display:flex;z-index:40;padding-bottom:env(safe-area-inset-bottom)}
.bottomnav a{flex:1;display:flex;flex-direction:column;align-items:center;gap:2px;text-align:center;padding:9px 4px;font-size:12px;font-weight:600;line-height:1.2;color:#9CA3AF;text-decoration:none;min-height:56px}
.bottomnav a svg{width:22px;height:22px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.bottomnav a.active{color:#C4B5FD}
html[data-theme="dark"] .bottomnav{background:#000000;border:1px solid #232E3D}

/* ---- Cards: every section is one card ---- */
.card{background:var(--card);border:1px solid var(--line);border-radius:20px;box-shadow:var(--shadow);padding:20px;margin:0;scroll-margin-top:68px;scroll-margin-bottom:168px;overflow:hidden;overflow-wrap:anywhere}
.card-body{padding-top:4px}
.card-decoder{border:2px solid var(--accent)}
.sec-kicker{font-size:12px;font-weight:600;letter-spacing:.14em;text-transform:uppercase;color:var(--accent);margin:0 0 8px}
.block-sub{font-size:15px;color:var(--muted);margin:0 0 14px;line-height:1.6}

/* ---- Collapsible card headers (<details class="card">) ---- */
details.card>summary{list-style:none;cursor:pointer;display:flex;align-items:flex-start;gap:12px;padding:0}
details.card>summary::-webkit-details-marker{display:none}
details.card>summary .card-head{flex:1;min-width:0}
details.card>summary .card-sub{display:block;font-size:15px;color:var(--muted);margin-top:6px;line-height:1.5;overflow:hidden;text-overflow:ellipsis}
details.card>summary .chev{flex:0 0 auto;font-size:20px;color:var(--muted);line-height:1.4;transition:transform .2s}
details.card[open]>summary .chev{transform:rotate(180deg)}
details.card>summary .card-sub{white-space:nowrap}
details.card[open]>summary .card-sub{white-space:normal}

/* ---- Top search bar + category chips (Uber Eats-style, bigger) ---- */
.searchbar{display:flex;align-items:center;gap:10px;background:var(--card);border:1.5px solid var(--line);border-radius:999px;padding:4px 16px;min-height:44px;box-shadow:var(--shadow);scroll-margin-top:76px}
.searchbar svg{flex:0 0 auto;width:24px;height:24px;stroke:var(--ink);fill:none;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.searchbar input{flex:1;min-width:0;border:0;background:transparent;color:var(--ink);font:inherit;font-size:15px;font-weight:500;min-height:44px;padding:0 4px;box-shadow:none}
.searchbar input:focus{outline:none}
.searchbar input::placeholder{color:var(--muted)}
.cat-chips{display:flex;gap:10px;overflow-x:auto;padding:2px 2px 6px;scrollbar-width:none;scroll-margin-top:76px}
.cat-chips::-webkit-scrollbar{display:none}
.cat-chips .chip{flex:0 0 auto;margin:0}
.cat-chips .chip[aria-pressed="true"]{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
/* v6.4: dropdowns replace the chip rows (category + city) — one <select>
   each, same filter behaviour. Header currency select sits at the right. */
.filter-select{display:block;width:100%;min-height:44px;margin:6px 0 10px;padding:10px 12px;border:1px solid var(--line);border-radius:14px;background:var(--card);color:var(--ink);font:inherit;font-size:15px}
.fx-select{flex:0 0 auto;min-height:36px;margin-left:auto;padding:6px 8px;border:1px solid var(--line);border-radius:999px;background:var(--card);color:var(--ink);font:inherit;font-size:13px;font-weight:600}

/* ---- Decoder ---- */
.count-slim{margin:12px 0 0}
.progress{height:10px;background:var(--card2);border:1px solid var(--line);border-radius:999px;overflow:hidden}
.progress>div{height:100%;background:var(--accent)}
.subcard{background:var(--card2);border:1px solid var(--line);border-radius:20px;padding:16px;margin:12px 0 0;overflow-wrap:anywhere}
.subcard:first-child{margin-top:0}
.subcard .muted,.subcard .small{color:var(--muted)}
.subcard a{color:var(--accent)}

/* ---- Signature dishes: vertical list of horizontal cards, image-led ---- */
.swipe-hint{font-size:15px;color:var(--muted);margin:8px 0 0}
.story-grid{display:flex;flex-direction:column;gap:14px;margin:12px 0 0;padding:0}
.story-city{font-family:var(--font-display);font-size:17px;font-weight:600;margin:24px 0 4px}
.story{flex:1 1 auto;display:flex;flex-direction:row;align-items:center;gap:12px;text-align:left;padding:12px;overflow:hidden;border:1px solid var(--line);border-radius:20px;background:var(--card);color:var(--ink);cursor:pointer;box-shadow:var(--shadow);transition:transform .18s ease,box-shadow .18s ease}
.story:hover,.story:focus-visible{transform:translateY(-4px);box-shadow:var(--shadow-lift)}
.story:active{transform:translateY(-1px) scale(.99)}
.story .thumb{flex:0 0 120px;height:120px;border-radius:20px;overflow:hidden;background:var(--card2)}
.story .thumb img{width:100%;height:100%;object-fit:cover;display:block}
.story>span+span{display:block;flex:1;min-width:0;padding:0}
.story .en{font-size:16px;font-weight:600;color:var(--ink);display:block;line-height:1.25}
.story .zh{font-size:15px;color:var(--muted);display:block;margin-top:4px}
.story .price{font-size:15px;font-weight:600;color:var(--accent);display:block;margin-top:8px}
.story .how{font-size:15px;line-height:1.5;margin:8px 0 0}
.next-steps{display:flex;flex-direction:column;gap:12px;margin:16px 0 4px}
.next-steps button{margin:0}
.muted{color:var(--muted);font-size:15px}
.small{font-size:15px;color:var(--muted)}
code{word-break:break-all;background:var(--code-bg);color:var(--ink);padding:1px 5px;border-radius:16px}
#qrTable{overflow-x:auto}
#qrTable table{min-width:0}
input[type=checkbox],input[type=radio]{width:22px;height:22px;min-height:22px;vertical-align:middle;accent-color:var(--accent)}
button{font:inherit;font-size:15px;font-weight:600;cursor:pointer;border:0;background:var(--accent);color:var(--accent-ink);padding:12px 18px;margin:4px 4px 4px 0;min-height:48px;border-radius:999px;box-shadow:0 6px 16px rgba(109,40,217,.25);transition:transform .12s ease,box-shadow .12s ease}
button:hover{box-shadow:0 8px 22px rgba(109,40,217,.32)}
button:active{transform:scale(.97);box-shadow:0 2px 8px rgba(109,40,217,.25)}
button.ghost{background:var(--card);color:var(--ink);border:1.5px solid var(--line-strong);box-shadow:none}
button.big{padding:13px 20px;font-size:16px;font-weight:600;min-height:48px;width:100%;margin:4px 0}
button:disabled{opacity:.45;cursor:not-allowed}
input[type=text],input[type=number],input[type=email],select,textarea{font:inherit;font-size:15px;width:100%;padding:12px 18px;border:1.5px solid var(--line-strong);background:var(--input-bg);color:var(--ink);min-height:48px;border-radius:999px;font-weight:500}
label{display:block;font-weight:600;margin:12px 0 6px}
.chips{display:flex;flex-wrap:wrap;gap:10px;margin:10px 0}
.chip{border:1.5px solid var(--line-strong);background:var(--card);color:var(--ink);padding:9px 16px;cursor:pointer;min-height:40px;font-size:14px;font-weight:600;border-radius:999px}
.chip[aria-pressed="true"]{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.verdict{font-family:var(--font-display);font-size:21px;font-weight:600;line-height:1.3;padding:16px 18px;margin:12px 0;border-radius:20px;box-shadow:var(--shadow)}
.verdict.ok{background:var(--ok-bg);color:var(--ok)}
.verdict.ask{background:var(--warn-bg);color:var(--warn)}
.verdict.no{background:var(--bad-bg);color:var(--bad)}
.bigzh{font-size:22px;line-height:1.5;font-weight:600}
.grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
@media(max-width:560px){.grid{grid-template-columns:1fr}}
.dish{border:1px solid var(--line);padding:16px;background:var(--card2);color:var(--ink);cursor:pointer;text-align:left;min-height:56px;box-shadow:none;border-radius:20px}
.dish .en{font-size:16px;font-weight:600;color:var(--ink)}
.dish .zh{color:var(--muted);font-size:15px}
table{width:100%;border-collapse:collapse;font-size:15px;color:var(--ink)}
th,td{text-align:left;padding:12px 6px;border-bottom:1px solid var(--line);vertical-align:top;overflow-wrap:anywhere}
th{font-size:12px;color:var(--muted);text-transform:uppercase;letter-spacing:.06em}
.badge{display:inline-block;padding:4px 12px;font-size:14px;font-weight:700;border-radius:999px}
.badge.ok{background:var(--ok-bg);color:var(--ok)}.badge.ask{background:var(--warn-bg);color:var(--warn)}.badge.no{background:var(--bad-bg);color:var(--bad)}
.ad{border:1.5px dashed var(--accent);padding:18px;text-align:center;background:var(--card2);border-radius:24px}
.ad .count{font-family:var(--font-display);font-size:24px;font-weight:600;color:var(--accent)}
.overlay{position:fixed;inset:0;background:var(--bg);color:var(--ink);z-index:50;padding:24px;overflow:auto}
.overlay .bigzh{color:var(--ink)}
#slipOverlay>button,#cardOverlay>button{position:sticky;bottom:12px;width:100%;margin:16px 0 0}
.sub-mascot{width:56px;height:56px;border-radius:50%;object-fit:cover;display:block;margin:4px 0;border:1px solid var(--line)}
.mascot-mini{width:36px;height:36px;border-radius:50%;object-fit:cover;display:block;margin:4px 0;border:1px solid var(--line)}
#subscribeDone .verdict{margin:10px 0}
footer{padding:8px 4px;border-top:1px solid var(--line)}
.city-img{width:100%;height:200px;object-fit:cover;display:block;margin:10px 0;border-radius:20px}
.btn-link{display:block;text-align:center;background:var(--accent);color:var(--accent-ink);font-weight:600;padding:14px 20px;font-size:15px;min-height:48px;text-decoration:none;margin:4px 0;border-radius:999px;box-shadow:0 6px 16px rgba(109,40,217,.25)}

/* ---- v3.1: thumb-cluster REMOVED (was fixed right:12px bottom:100px,
   2x52px buttons = 214px footprint covering content while scrolling).
   Theme + menu buttons now live inside .bottomnav (see above). No
   fixed element other than the bottom nav itself overlaps content. ---- */
/* ---- Camera-first decode ---- */
.camera-btn{background:var(--accent)}
#photoPreview img{margin-top:4px}
#manualInput summary{cursor:pointer;font-weight:600;list-style:none}
#manualInput summary::-webkit-details-marker{display:none}


/* ---- v5.3: decoder, clearer — one purpose line, three labelled ways in,
   live suggestions under the input, one-line price basis everywhere. ---- */
.decode-purpose{font-size:15px;line-height:1.6;color:var(--ink);margin:0 0 4px}
.decode-ways{display:flex;gap:10px;margin:4px 0}
.decode-ways .way-btn{flex:1;min-width:0;margin:0;padding:12px 8px;font-size:15px}
.decode-suggest{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0 0}
.decode-suggest .chip{margin:0}
.price-note{font-size:13px !important;line-height:1.5}
#decodeStatus{margin:8px 0 0}
.chat-dish .cd-note{font-size:12px;color:var(--muted);display:block;margin-top:2px}
/* ---- v3.4: three ways in (Mindtrip-style — one row, plain language) ---- */
.input-row{display:flex;gap:10px;margin:4px 0}
.input-row button{flex:1;min-width:0;margin:0;padding:12px 10px;font-size:14px}
.camera-btn{background:var(--accent)}
.voice-btn{background:var(--card);color:var(--accent);border:1.5px solid var(--accent);box-shadow:none}
.voice-row{display:flex;align-items:center;gap:10px;margin:8px 0 0}
.voice-lang{flex:0 0 auto;min-height:36px;padding:6px 14px;font-size:14px;font-weight:600;background:var(--card2);color:var(--ink);border:1px solid var(--line);box-shadow:none;margin:0}
.mic-btn{display:inline-block;min-height:32px;padding:4px 12px;font-size:14px;font-weight:600;background:var(--card2);color:var(--accent);border:1px solid var(--line);box-shadow:none;margin:0 0 0 6px;vertical-align:middle}
/* ---- v5.0: Uber Eats home — search row + Bun button, Ask Bun, cities ---- */
.search-row{display:flex;gap:10px;align-items:center}
.search-row .searchbar{flex:1;min-width:0}
/* v5.3 (idiot-friendly): the Bun button is no longer icon-only — avatar +
   the word "Chat", so a first-time user never has to guess what it does. */
.bun-btn{flex:0 0 auto;width:auto;height:48px;min-height:48px;padding:0 14px 0 7px;margin:0;border-radius:999px;background:var(--card);border:1.5px solid var(--line-strong);box-shadow:var(--shadow);display:flex;align-items:center;justify-content:center;gap:6px;font-size:14px;font-weight:600;color:var(--ink)}
.bun-btn img{width:34px;height:34px;border-radius:50%;object-fit:cover;display:block}
.bun-btn span{line-height:1}
/* v5.3: the one-line value prop — what this app solves, first screen,
   under the Hero. Cormorant italic, no headline wall, no stats. */
.value-prop{font-family:var(--font-display);font-size:19px;font-style:italic;font-weight:500;line-height:1.45;color:var(--ink);margin:2px 2px 0;text-align:center}
/* v6.7: slogan on the home view — the brand line under the Hero, above the value prop. Cormorant, small, quiet. */
.slogan{font-family:var(--font-display);font-size:17px;font-weight:600;letter-spacing:.05em;line-height:1.4;color:var(--muted);margin:2px 2px 0;text-align:center}
.ask-bun{display:flex;align-items:center;gap:12px;width:100%;min-height:52px;text-align:left;padding:12px 16px;border-radius:20px;margin:0}
.ask-bun img{width:32px;height:32px;border-radius:50%;object-fit:cover;display:block;flex:0 0 32px}
.ask-bun span{flex:1;min-width:0}
/* v6.6: Ask Bun is a curtain, not a pill. A slim vertical tab hugs
   the right edge (Bun avatar + vertical "Ask Bun"); tap it and the
   chat slides in from the right as a drawer over the current view —
   the bottom nav stays visible below it, one tap closes it (scrim,
   ×, Esc). The tab collapses to a 14px edge strip (›) and back; the
   entry is never hidden for good. The drawer reuses the real chat
   view + composer (moved in by JS, moved back on close) — no second
   chat UI. Cold palette only, vars only, theme follows the phone. */
.bun-tab{position:fixed;right:max(0px,calc(50% - 200px));bottom:calc(96px + env(safe-area-inset-bottom));z-index:45;width:34px;display:flex;flex-direction:column;background:var(--card);border:1.5px solid var(--line-strong);border-right:0;border-radius:16px 0 0 16px;box-shadow:var(--shadow-lift);overflow:hidden}
.bun-tab-open{flex:1;min-height:0;margin:0;padding:10px 0 8px;background:transparent;color:var(--accent);border:0;border-radius:0;box-shadow:none;display:flex;flex-direction:column;align-items:center;gap:6px}
.bun-tab-open img{width:26px;height:26px;border-radius:50%;object-fit:cover;display:block}
.bun-tab-label{writing-mode:vertical-rl;font-size:12px;font-weight:600;letter-spacing:.08em;line-height:1;color:var(--accent)}
.bun-tab-collapse{flex:0 0 auto;min-height:24px;height:24px;margin:0;padding:0;background:transparent;color:var(--muted);border:0;border-top:1px solid var(--line);border-radius:0;box-shadow:none;font-size:16px;line-height:1}
.bun-tab.collapsed{width:14px;border-left:2px solid var(--accent)}
.bun-tab.collapsed .bun-tab-open{min-height:64px;padding:0}
.bun-tab.collapsed .bun-tab-open img,.bun-tab.collapsed .bun-tab-label{display:none}
.bun-tab.collapsed .bun-tab-open::after{content:"›";font-size:16px;font-weight:600;color:var(--accent);line-height:1}
.bun-tab.collapsed .bun-tab-collapse{display:none}
/* v6.6: the tab is draggable (touch-action:none lets the pointer drag
   instead of scrolling the page). In chat it sits above the composer
   so it never covers the send button. Cold palette only, vars only. */
.bun-tab{touch-action:none;user-select:none;-webkit-user-select:none;cursor:grab}
.bun-tab.dragging{cursor:grabbing}
.bun-tab.in-chat{bottom:calc(148px + env(safe-area-inset-bottom))}
/* Drawer: panel stops above the bottom nav, so the nav stays visible
   and tappable while chatting. Scrim stops at the same line. */
.bun-drawer-scrim{position:fixed;inset:0 0 calc(84px + env(safe-area-inset-bottom)) 0;background:rgba(10,10,11,.45);z-index:54}
.bun-drawer{position:fixed;top:0;right:max(0px,calc(50% - 200px));bottom:calc(84px + env(safe-area-inset-bottom));width:min(360px,94vw);z-index:55;background:var(--card);border-left:1px solid var(--line-strong);box-shadow:-12px 0 32px rgba(16,24,40,.18);display:flex;flex-direction:column;transform:translateX(105%);visibility:hidden;transition:transform .28s ease,visibility 0s linear .28s}
.bun-drawer.open{transform:translateX(0);visibility:visible;transition:transform .28s ease}
.bun-drawer-close{position:absolute;top:10px;right:10px;z-index:2;width:36px;height:36px;min-height:36px;margin:0;padding:0;border-radius:50%;background:var(--card);color:var(--muted);border:1px solid var(--line-strong);box-shadow:var(--shadow);font-size:20px;line-height:1;display:flex;align-items:center;justify-content:center}
.bun-drawer-body{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:12px 12px 0}
.bun-drawer-body #backHomeBtn{display:none}
.bun-drawer-body .chat-head{padding-right:48px}
.bun-drawer-body #chatLog{min-height:0}
.bun-drawer-foot{flex:0 0 auto;border-top:1px solid var(--line)}
.bun-drawer-foot #chatComposer{position:static;left:auto;transform:none;width:100%;max-width:none;bottom:auto;margin:0;border:0;border-radius:0;box-shadow:none;padding:6px 6px 6px 8px}
body.bun-drawer-open{overflow:hidden}
@media (prefers-reduced-motion: reduce){
  .bun-drawer{transition:none}
}
.home-sec{margin:6px 0 0}
.home-sec .block-sub{margin:6px 0 12px}
/* v5.2: home sections fold — Signature open by default, Cities closed.
   Same summary pattern as details.card (title + sub + chevron), lighter
   chrome: no card border. <summary> is natively keyboard-operable;
   aria-expanded is synced by app.js. (v5.7: decode teaser deleted.) */
.home-sec>summary{list-style:none;cursor:pointer;display:flex;align-items:flex-start;gap:12px;padding:0}
.home-sec>summary::-webkit-details-marker{display:none}
.home-sec>summary .card-head{flex:1;min-width:0}
.home-sec>summary .card-sub{display:block;font-size:15px;color:var(--muted);margin-top:6px;line-height:1.5}
.home-sec>summary .chev{flex:0 0 auto;font-size:20px;color:var(--muted);line-height:1.4;transition:transform .2s}
.home-sec[open ]>summary .chev{transform:rotate(180deg)}
.home-sec[open ]>:not(summary){animation:secIn .25s ease}
@keyframes secIn{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}
/* v5.2: Orders tabs — Dine-in / Delivery segmented control. */
.order-tabs{display:flex;gap:8px;margin:0 0 12px}
.order-tabs button{flex:1;margin:0;min-height:48px;background:var(--card2);color:var(--ink);border:1.5px solid var(--line-strong);box-shadow:none}
.order-tabs button[aria-selected="true"]{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.city-row{display:flex;gap:10px;overflow-x:auto;padding:2px 2px 6px;scrollbar-width:none}
.city-row::-webkit-scrollbar{display:none}
.city-row .chip{flex:0 0 auto;margin:0}
/* While a search / chip filter is active, Home shows only the results. */
#homeView.filtering .browse-block{display:none}
.back-home{margin:0 0 4px;min-height:40px;padding:8px 14px;font-size:14px}
.story .spice{font-size:14px;color:var(--muted);display:block;margin-top:4px}

/* ---- v5.0: chat is a feature now — Bun button / Ask Bun open it ---- */
.chat-head{display:flex;align-items:center;gap:12px;padding:4px 4px 0}
/* v6.2: hero is a 3-photo carousel — slides stack, fade on switch
   (opacity .6s), dots sit bottom-centre. Height stays 160px; slides are
   800x320 bands so object-position is neutral. Dots get a shadow so they
   stay visible on bright photos (duck slide is mostly white marble).
   Night brightness comes from the global dark-theme img rule (0.92). */
.hero-banner{margin:0;border-radius:20px;overflow:hidden;box-shadow:var(--shadow);position:relative}
.hero-slides{position:relative;height:160px}
.hero-slide{position:absolute;inset:0;margin:0;width:100%;height:160px;opacity:0;transition:opacity .6s ease;pointer-events:none}
.hero-slide.is-active{opacity:1}
.hero-slide img{width:100%;height:160px;object-fit:cover;object-position:center;display:block}
.hero-slide figcaption{position:absolute;top:10px;left:10px;background:rgba(0,0,0,.55);color:#fff;font-size:13px;line-height:1.4;padding:3px 10px;border-radius:999px}
.hero-dots{position:absolute;left:0;right:0;bottom:8px;display:flex;justify-content:center;gap:6px;pointer-events:none}
.hero-dot{pointer-events:auto;width:8px;height:8px;min-height:0;margin:0;padding:0;border:0;border-radius:50%;background:rgba(255,255,255,.55);box-shadow:0 0 0 1px rgba(0,0,0,.18);cursor:pointer}
.hero-dot.is-active{background:#fff;transform:scale(1.3)}
.chat-head img{width:40px;height:40px;border-radius:50%;object-fit:cover;display:block;flex:0 0 40px;border:1px solid var(--line)}
.chat-head-text{flex:1;min-width:0}
.chat-name{font-family:var(--font-display);font-size:18px;font-weight:600;line-height:1.2;margin:0}
.chat-head-text p{font-size:13px;color:var(--muted);margin:2px 0 0;line-height:1.4}
.chat-tastes{flex:0 0 auto;min-height:40px;padding:8px 14px;font-size:14px;margin:0}
.chat-log{display:flex;flex-direction:column;gap:10px;padding:12px 4px 8px;min-height:52vh}
.msg{display:flex;gap:8px;max-width:100%}
.msg .avatar{width:32px;height:32px;border-radius:50%;object-fit:cover;display:block;flex:0 0 32px;border:1px solid var(--line);margin-top:2px}
.msg .bubble{padding:10px 14px;border-radius:20px;font-size:15px;line-height:1.6;overflow-wrap:anywhere;max-width:82%}
.msg.bun{justify-content:flex-start}
.msg.bun .bubble{background:var(--card);border:1px solid var(--line);border-bottom-left-radius:6px;box-shadow:var(--shadow)}
.msg.user{justify-content:flex-end}
.msg.user .bubble{background:var(--accent);color:#fff;border-bottom-right-radius:6px}
.msg.user .bubble a{color:#fff}
.msg .bubble .verdict{margin:0 0 8px;font-size:18px}
.msg .bubble p{margin:8px 0}
.msg-photo img{width:100%;border-radius:16px;display:block}
.typing i{display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--muted);margin-right:4px;animation:chatblink 1.2s infinite}
.typing i:nth-child(2){animation-delay:.2s}
.typing i:nth-child(3){animation-delay:.4s}
@keyframes chatblink{0%,100%{opacity:.3}50%{opacity:1}}
.chat-chips{display:flex;gap:6px;overflow-x:auto;padding:4px 4px 6px;scrollbar-width:none}
.chat-chips::-webkit-scrollbar{display:none}
.chat-chips .chip{flex:0 0 auto;margin:0}
/* v4.3: diet step is multi-select — chips wrap so all 8 + Done are visible
   without scrolling; Done is a solid accent button, not a plain chip. */
.chat-chips.wrap{flex-wrap:wrap;overflow-x:visible}
.chat-chips .chip-done{background:var(--accent);color:var(--accent-ink);border-color:var(--accent);font-weight:700}
.chat-composer{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(76px + env(safe-area-inset-bottom));width:calc(100% - 24px);max-width:376px;display:flex;gap:8px;align-items:center;background:var(--card);border:1px solid var(--line);border-radius:999px;padding:6px 6px 6px 8px;box-shadow:0 8px 24px rgba(16,24,40,.14);z-index:41}
.chat-composer button{flex:0 0 auto;min-height:40px;width:40px;padding:0;margin:0;border-radius:50%;font-size:19px;box-shadow:none;display:flex;align-items:center;justify-content:center}
.chat-composer button.icon-ghost{background:var(--card2);color:var(--ink);border:1px solid var(--line)}
.chat-composer input{flex:1;min-width:0;border:0;background:transparent;color:var(--ink);font:inherit;font-size:15px;min-height:44px;padding:0 4px;box-shadow:none}
.chat-composer input:focus{outline:none}
.chat-cards{display:flex;gap:12px;overflow-x:auto;padding:12px 2px 8px;scrollbar-width:none}
.chat-cards::-webkit-scrollbar{display:none}
.chat-dish{flex:0 0 200px;background:var(--card);border:1px solid var(--line);border-radius:20px;overflow:hidden;box-shadow:var(--shadow);text-align:left;padding:0}
.chat-dish img{width:100%;height:110px;object-fit:cover;display:block}
.chat-dish .cd-body{padding:12px 14px}
.chat-dish .en{font-size:16px;font-weight:600;display:block;line-height:1.25}
.chat-dish .zh{font-size:14px;color:var(--muted);display:block;margin-top:2px}
.chat-dish .price{font-size:14px;font-weight:600;color:var(--accent);display:block;margin-top:6px}
.chat-dish .cd-verdict{font-size:13px;line-height:1.5;color:var(--muted);display:block;margin-top:6px}
.chat-dish .cd-actions{display:flex;gap:6px;margin-top:10px}
.chat-dish .cd-actions button{flex:1;min-height:40px;padding:6px 4px;font-size:13px;margin:0;box-shadow:none}
.next-row{display:flex;flex-direction:column;gap:8px;margin-top:10px}
/* ---- v5.1: Signature no-photo tile — first Chinese character on the
   accent-soft tile. Never another dish's photo. ---- */
.story .thumb-ph{display:flex;align-items:center;justify-content:center;background:var(--accent-soft)}
.story .thumb-ph .ph-zh{font-family:var(--font-display);font-size:44px;font-weight:600;color:var(--accent);line-height:1}
.sig-city{margin-top:18px}
.sig-city:first-child{margin-top:8px}
#sigCityChips{margin:0 0 4px}
/* ---- v4.1: FAQ — read-only answers live here, nowhere else ---- */
.faq-item{border-bottom:1px solid var(--line);padding:12px 0}
.faq-item:last-child{border-bottom:0}
.faq-item summary{cursor:pointer;list-style:none;font-size:15px;font-weight:600;line-height:1.5}
.faq-item summary::-webkit-details-marker{display:none}
.faq-item p{font-size:15px;color:var(--muted);line-height:1.6;margin:8px 0 4px}
.faq-item p b{color:var(--ink)}
.next-row button{margin:0;text-align:left}
/* ---- v5.9: drinks — same card language as dishes; temp chips reuse .chip ---- */
.drink-card h3{margin:0 0 4px}
.drink-card p{margin:6px 0}
.drink-temp{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0}
.drink-temp .chip{margin:0}
#drinkPhrases table{width:100%;border-collapse:collapse}
#drinkPhrases td{padding:6px 8px 6px 0;font-size:15px;line-height:1.5;vertical-align:top}
#drinkPhrases td:first-child{white-space:nowrap}
/* ---- v6.1: Account — blinking sign-up email input + direct social share ---- */
/* Email input pulses gently (border glow + placeholder fade) so the empty
   field reads as "fill me in" without shouting. Subtle on purpose. */
@keyframes sub-blink {
  0%, 100% { border-color: var(--line-strong); box-shadow: none; }
  50% { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(109, 40, 217, .18); }
}
@keyframes sub-blink-ph { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
input.blink-input { animation: sub-blink 2.2s ease-in-out infinite; }
input.blink-input::placeholder { animation: sub-blink-ph 2.2s ease-in-out infinite; }
input.blink-input:focus { animation: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(109, 40, 217, .18); }
@media (prefers-reduced-motion: reduce) {
  input.blink-input, input.blink-input::placeholder { animation: none; }
}
.share-row { display: flex; gap: 8px; margin: 8px 0; }
.share-btn { flex: 1; text-align: center; background: var(--card); color: var(--ink); border: 1.5px solid var(--line-strong); font-weight: 600; font-size: 14px; padding: 12px 6px; min-height: 48px; border-radius: 999px; text-decoration: none; display: flex; align-items: center; justify-content: center; }
.share-btn:active { transform: scale(.97); }

/* ---- v6.0: Orders — logic you can see, taps that answer ---- */
/* Toast: one pill above the bottom nav. Every tap answers — no more
   silent taps, no more blocking alert(). */
.toast{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(84px + env(safe-area-inset-bottom));width:calc(100% - 24px);max-width:376px;background:#0A0A0B;color:#fff;border-radius:999px;padding:12px 16px;display:flex;align-items:center;gap:10px;z-index:60;box-shadow:0 10px 28px rgba(0,0,0,.35);font-size:14px;font-weight:600;cursor:pointer}
.toast span{flex:1;min-width:0}
.toast button{flex:0 0 auto;margin:0;min-height:36px;padding:6px 14px;font-size:14px;box-shadow:none}
/* Orders nav badge: list count on the tab, so it never looks empty. */
.bottomnav a{position:relative}
.ord-badge{position:absolute;top:2px;right:calc(50% - 28px);min-width:18px;height:18px;border-radius:999px;background:var(--accent);color:#fff;font-size:11px;font-weight:700;line-height:18px;text-align:center;padding:0 5px}
/* Dine-in stepper: numbered, with current / done state. */
.steps{list-style:none;margin:12px 0;padding:0;display:flex;flex-direction:column;gap:10px;counter-reset:step}
.steps li{position:relative;padding:10px 12px 10px 44px;border:1px solid var(--line);border-radius:16px;background:var(--card2)}
.steps li::before{counter-increment:step;content:counter(step);position:absolute;left:12px;top:10px;width:22px;height:22px;border-radius:50%;background:var(--card);border:1.5px solid var(--line-strong);color:var(--muted);font-size:13px;font-weight:700;line-height:20px;text-align:center}
.steps li.current{border-color:var(--accent)}
.steps li.current::before{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.steps li.done{opacity:.85}
.steps li.done::before{content:"✓";background:var(--ok-bg);border-color:var(--ok);color:var(--ok)}
.step-btns{display:flex;gap:8px;margin-top:10px;flex-wrap:wrap}
.step-btns button{margin:0}
.route-on{border:1.5px solid var(--accent);border-radius:20px;padding:12px;margin:12px 0}
/* Order lines: qty stepper + remove, so the list is editable in place. */
.ord-line{display:flex;align-items:center;gap:8px;margin:10px 0}
/* Route A table: keep headers + Chinese cells on one line ("CHINESE"
   used to break as "CHINES E"); the note column still wraps. */
#qrTable th{white-space:nowrap}
#qrTable td:first-child{white-space:nowrap}
.ord-line .ord-name{flex:1;min-width:0}
.ord-line .ord-price{font-weight:700;white-space:nowrap}
.ord-qty{display:flex;align-items:center;gap:6px;flex:0 0 auto}
.ord-n{min-width:24px;text-align:center;font-weight:600}
.qty-btn{width:32px;height:32px;min-width:32px;min-height:32px;padding:0;margin:0;border-radius:50%;font-size:16px;box-shadow:none;display:inline-flex;align-items:center;justify-content:center}
.qty-btn.ord-remove{background:var(--card);color:var(--muted);border:1.5px solid var(--line-strong)}
button.armed{background:var(--warn-bg);color:var(--warn);border-color:var(--warn)}

/* ---- Design polish pass, 27 Nov (all screens) ----
   P0 fix: the header comment above used to close early (after the words
   "see below for the v4.2 note"), so the note text + :root{...} were
   swallowed as one invalid selector — every :root variable (--accent,
   fonts, --radius, --shadow, verdict colours) was dead in light mode.
   Fixed by removing that stray close; the rules below assume :root
   works again.
   P1: solid accent fills. --accent is light lavender (#A78BFA) in dark
   mode for text, but white text on it is only 2.5:1 — buttons need the
   deep purple in both themes, so fills use --accent-solid instead.
   P2: appbar — the currency select inherited width:100% from the global
   select rule and squeezed the title to 0px wide while bleeding off the
   right edge; it now sizes to content and the title never wraps.
   P3: hero dots were 8px tap targets; the visual dot stays 8px (::after)
   on a 20px hit area. P4: the FX rate phrase no longer breaks mid-line.
   P5: search row gives the placeholder a little more room. */
:root{--accent-solid:#6D28D9}
html[data-theme="dark"]{--accent-solid:#6D28D9}
button{background:var(--accent-solid)}
.btn-link{background:var(--accent-solid)}
.camera-btn{background:var(--accent-solid)}
.order-tabs button[aria-selected="true"]{background:var(--accent-solid)}
.chip[aria-pressed="true"]{background:var(--accent-solid)}
.cat-chips .chip[aria-pressed="true"]{background:var(--accent-solid)}
.chat-chips .chip-done{background:var(--accent-solid)}
.dev-badge{background:var(--accent-solid)}
.progress>div{background:var(--accent-solid)}
.ord-badge{background:var(--accent-solid)}
.steps li.current::before{background:var(--accent-solid)}
.msg.user .bubble{background:var(--accent-solid)}
.fx-select{width:auto;max-width:160px}
.appbar-title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hero-dot{position:relative;width:20px;height:20px;background:transparent;box-shadow:none}
.hero-dot::after{content:"";position:absolute;left:6px;top:6px;width:8px;height:8px;border-radius:50%;background:rgba(255,255,255,.55);box-shadow:0 0 0 1px rgba(0,0,0,.18)}
.hero-dot.is-active{background:transparent;transform:scale(1.3)}
.hero-dot.is-active::after{background:#fff}
.fx-basis{white-space:nowrap}
.searchbar{padding:4px 12px}
.searchbar svg{width:22px;height:22px}
.bun-btn{padding:0 10px 0 6px}
