:root {
  --bg: #F5F4F2;
  --card: #FFFFFF;
  --ink: #15171A;
  --muted: #5F6368;
  --faint: #8A8D92;
  --line: #EDEBE7;
  --accent: #C2410C;
  --accent-ink: #9A3412;
  --warn: #854D0E;
  --bad: #B42318;
  --good: #166534;
  --dark2: #2C2F34;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --text: Inter, system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--text); -webkit-font-smoothing: antialiased; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.accent { stroke: var(--accent); width: 16px; height: 16px; }
[hidden] { display: none !important; }

#app { max-width: 480px; margin: 0 auto; min-height: 100vh; }
.view { padding: max(20px, env(safe-area-inset-top)) 20px calc(40px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 18px; }

.top { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; }
.wordmark { font-family: var(--display); font-weight: 700; font-size: 24px; letter-spacing: -0.5px; }
.icon-btn { width: 44px; height: 44px; border-radius: 22px; border: none; background: var(--card); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.loc { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px 0 10px; border: none; border-radius: 18px; background: var(--card); font-size: 14px; font-weight: 500; margin-bottom: -8px; }
.display { margin: 0; font-family: var(--display); font-weight: 700; font-size: 34px; line-height: 1.05; letter-spacing: -1px; }
.h2 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -0.3px; }
.h3 { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -0.3px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.label { font-size: 13px; font-weight: 600; color: var(--muted); }

.scan-card { background: var(--ink); color: #fff; border-radius: 28px; padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.scan-title { font-family: var(--display); font-weight: 700; font-size: 24px; line-height: 1.15; }
.scan-sub { font-size: 14px; line-height: 1.45; color: #C9CBCF; margin-top: 6px; }
.scan-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 20px; border-radius: 24px; border: none; font-weight: 600; font-size: 15px; cursor: pointer; }
.btn.wide { width: 100%; }
.btn-accent { background: var(--accent); color: #fff; padding-left: 16px; }
.btn-ghost-dark { background: var(--dark2); color: #fff; }
.btn-light { background: #fff; color: var(--ink); }
.link-light { background: none; border: none; color: #C9CBCF; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; align-self: flex-start; padding: 4px 0; }
.link { background: none; border: none; color: var(--accent); font-size: 14px; font-weight: 500; padding: 8px 0; }
.pages { display: flex; gap: 8px; }
.pages img { width: 56px; height: 72px; object-fit: cover; border-radius: 10px; border: 2px solid var(--dark2); }

.row-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.list { background: var(--card); border-radius: 20px; padding: 0 16px; }
.row { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); width: 100%; background: none; border-left: none; border-right: none; border-top: none; text-align: left; }
.row:last-child { border-bottom: none; }
.num { font-family: var(--display); font-weight: 500; font-size: 15px; color: var(--faint); width: 20px; flex: none; }
.row .main { flex: 1; min-width: 0; }
.row .t { display: block; font-weight: 600; font-size: 15px; }
.row .s { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.tick { width: 28px; height: 28px; border-radius: 14px; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.tick svg { width: 16px; height: 16px; stroke-width: 2.6; }
.tick.off { background: none; border: 1.5px solid #C9CBCF; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 -20px; padding: 0 20px; scrollbar-width: none; }
.chip { flex: none; height: 36px; padding: 0 14px; border-radius: 18px; border: none; background: var(--card); font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; }
.chip.on { background: var(--ink); color: #fff; font-weight: 600; }
.chip.bad { color: var(--bad); }
.chip.add { background: none; border: 1px dashed #A3A6AB; color: var(--muted); }
.profile-strip { display: flex; flex-direction: column; gap: 10px; }
.mode { font-size: 12px; color: var(--faint); margin: 0; }

.bar { display: flex; align-items: center; gap: 12px; padding-top: 12px; }
.bar-title { flex: 1; min-width: 0; }

.picks { background: var(--ink); color: #fff; border-radius: 24px; padding: 16px 18px; }
.picks .label { color: #A3A6AB; font-weight: 500; }
.pick { display: flex; align-items: baseline; gap: 12px; padding: 10px 0; border: none; border-bottom: 1px solid var(--dark2); background: none; color: #fff; width: 100%; text-align: left; }
.pick:last-child { border-bottom: none; padding-bottom: 2px; }
.pick .n { font-family: var(--display); color: #FDBA8C; width: 16px; flex: none; }
.pick .t { flex: 1; font-size: 15px; font-weight: 500; }
.pick .t small { display: block; color: #A3A6AB; font-size: 13px; font-weight: 400; margin-top: 2px; }
.pick .p { color: #C9CBCF; font-size: 14px; }

.section-title { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 8px 4px; }
.dish { display: block; width: 100%; padding: 14px 0; border: none; border-bottom: 1px solid var(--line); background: none; text-align: left; }
.dish:last-child { border-bottom: none; }
.dish .head { display: flex; justify-content: space-between; gap: 10px; font-weight: 600; font-size: 16px; }
.dish .price { white-space: nowrap; }
.dish .tr { font-size: 14px; color: var(--muted); margin-top: 2px; }
.dish .flag { font-size: 13px; font-weight: 500; margin-top: 6px; }
.dish.no .head, .dish.no .tr { color: var(--faint); }
.f-local { color: var(--accent-ink); }
.f-warn { color: var(--warn); }
.f-bad { color: var(--bad); }
.f-good { color: var(--good); }

.dark-card { background: var(--ink); color: #fff; border-radius: 22px; padding: 14px 14px 14px 18px; display: flex; flex-direction: column; gap: 12px; }
.phrase { display: flex; align-items: center; gap: 12px; }
.phrase .txt { flex: 1; min-width: 0; }
.phrase .o { font-size: 16px; font-weight: 600; }
.phrase .tr { font-size: 13px; color: #C9CBCF; margin-top: 2px; }
.speak { width: 48px; height: 48px; border-radius: 24px; border: none; background: #fff; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.note { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); }

.d-kicker { font-size: 13px; color: var(--muted); }
.d-title { margin: 6px 0 0; font-family: var(--display); font-weight: 700; font-size: 34px; line-height: 1.05; letter-spacing: -1px; overflow-wrap: anywhere; }
.d-name { font-size: 17px; font-weight: 500; margin-top: 8px; }
.d-pron { font-size: 15px; color: var(--muted); margin-top: 2px; }
.d-desc { margin: 0; font-size: 16px; line-height: 1.5; }
.d-flag { display: flex; gap: 10px; align-items: center; font-size: 15px; font-weight: 500; }
.kv { padding: 14px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: none; }
.kv .k { font-size: 13px; color: var(--muted); }
.kv .v { font-size: 15px; font-weight: 500; margin-top: 3px; }
.kv .x { font-size: 13px; font-weight: 500; margin-top: 4px; }
#dish-body { display: flex; flex-direction: column; gap: 20px; }
.btn-outline { background: var(--card); color: var(--ink); }

.progress { display: flex; align-items: center; gap: 14px; }
.track { flex: 1; height: 6px; border-radius: 3px; background: #E4E2DD; overflow: hidden; }
.fill { height: 6px; background: var(--ink); width: 0; transition: width .3s; }

.field { display: flex; flex-direction: column; gap: 10px; }
#r-sections { display: flex; flex-direction: column; gap: 18px; }
.btn-icon { width: 48px; padding: 0; }
select { width: 100%; height: 48px; border-radius: 14px; border: none; background: var(--card); padding: 0 14px; font-size: 15px; }
.seg { display: flex; background: var(--card); border-radius: 22px; padding: 4px; }
.seg button { flex: 1; height: 40px; border-radius: 18px; border: none; background: none; font-weight: 500; font-size: 14px; }
.seg button.on { background: var(--ink); color: #fff; font-weight: 600; }

.loading { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; }
.loading .thumbs { display: flex; gap: 8px; }
.loading .thumbs img { width: 84px; height: 112px; object-fit: cover; border-radius: 14px; }
.loading p { margin: 0; }
.pulse { width: 48px; height: 4px; border-radius: 2px; background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scaleX(.3); opacity: .5; } 50% { transform: scaleX(1); opacity: 1; } }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 16px; font-size: 14px; max-width: calc(100% - 40px); z-index: 10; }
.empty { padding: 18px 0; color: var(--muted); font-size: 14px; }
