/* Bar Lens: copper and walnut. Light by default, dark from the phone setting or the header switch (data-theme on <html>). */
:root{
  --bg:#F6F2EC; --surface:#FFFFFF; --ink:#211A15; --muted:#6B5F55; --line:#E3DAD0;
  --accent:#8A3B12; --accent-ink:#FFFFFF; --price:#8A3B12; --chip:#EFE7DE; --warn:#B3261E;
  --mark:#F7E2C8; --bar:#C8763A; --bar-bg:#EFE7DE; --good:#2F6B3A; --input-line:#8E7F73;
  --display:"Zilla Slab", Georgia, serif; --body:"Work Sans", system-ui, sans-serif; --mono:"IBM Plex Mono", ui-monospace, monospace;
}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){
  --bg:#15110E; --surface:#1F1915; --ink:#F1E9E1; --muted:#AD9F93; --line:#3A302A;
  --accent:#F0A35A; --accent-ink:#1B120B; --price:#F0B65A; --chip:#2C241F; --warn:#FF8A80;
  --mark:#4A3020; --bar:#F0A35A; --bar-bg:#2C241F; --good:#8FD19E; --input-line:#7A6C61; color-scheme:dark}}
:root[data-theme="dark"]{
  --bg:#15110E; --surface:#1F1915; --ink:#F1E9E1; --muted:#AD9F93; --line:#3A302A;
  --accent:#F0A35A; --accent-ink:#1B120B; --price:#F0B65A; --chip:#2C241F; --warn:#FF8A80;
  --mark:#4A3020; --bar:#F0A35A; --bar-bg:#2C241F; --good:#8FD19E; --input-line:#7A6C61; color-scheme:dark}
*{box-sizing:border-box}
[hidden]{display:none!important}
html,body{margin:0}
body{background:var(--bg);color:var(--ink);font-family:var(--body);font-size:15px;line-height:1.5}
.wrap{max-width:760px;margin:0 auto;padding-block:20px 40px;padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px));display:grid;gap:16px}
.top{display:flex;justify-content:space-between;align-items:start;gap:12px}
.top-actions{display:flex;flex-direction:column;align-items:flex-end;gap:8px;flex:none}
.icon-btn{display:grid;place-items:center;width:34px;height:34px;padding:0;border:0;border-radius:999px;background:var(--chip);color:var(--ink);cursor:pointer}
.icon-btn svg{display:none;width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
/* the theme button shows the current mode: no data-theme = following the system */
:root:not([data-theme]) .i-system,:root[data-theme="light"] .i-light,:root[data-theme="dark"] .i-dark{display:block}
h1{font-family:var(--display);font-weight:700;font-size:2rem;line-height:1.1;margin:0}
h2{font-family:var(--display);font-weight:700;font-size:1.4rem;line-height:1.2;margin:0 0 8px}
.lede{margin:4px 0 0;color:var(--muted);max-width:52ch}
.muted{color:var(--muted)} .small{font-size:.82rem}
.pill{font:inherit;font-size:.8rem;font-weight:600;white-space:nowrap;background:var(--chip);color:var(--ink);border:0;border-radius:999px;padding:6px 12px;cursor:pointer}
.pill.pro{background:var(--accent);color:var(--accent-ink)}
.panel{background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:14px;display:grid;gap:10px}
.row{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.field{display:grid;gap:4px;min-width:0;flex:1 1 140px}
label,.label{font-size:.72rem;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);font-weight:600}
select,input[type=search],input[type=email],textarea{font:inherit;color:var(--ink);background:var(--bg);border:1px solid var(--input-line);border-radius:6px;padding:8px 10px;width:100%;min-width:0}
textarea{resize:vertical;line-height:1.45}
.row input[type=email]{flex:1 1 180px;width:auto}
.btn{font:inherit;font-weight:600;border:0;border-radius:6px;padding:10px 16px;background:var(--accent);color:var(--accent-ink);cursor:pointer;text-decoration:none;display:inline-block;text-align:center}
.btn.block{display:block;width:100%}
.btn[disabled]{opacity:.5;cursor:default}
.btn.ghost{background:transparent;color:var(--ink);border:1px solid var(--line)}
.btn.small{padding:6px 12px;font-size:.88rem}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.status{font-size:.88rem;color:var(--muted);min-height:1.4em;flex:1 1 200px}
.status.err{color:var(--warn)}

.likes-head{display:flex;flex-wrap:wrap;gap:4px 10px;align-items:baseline}
.likes{display:flex;flex-wrap:wrap;gap:6px}
.like{font:inherit;font-size:.88rem;border:1px solid var(--line);background:var(--bg);color:var(--ink);border-radius:999px;padding:5px 12px;cursor:pointer}
.like[aria-pressed="true"]{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}

.tabs{display:flex;gap:4px;background:var(--chip);border-radius:8px;padding:4px}
.tabs button{flex:1;font:inherit;font-weight:600;border:0;border-radius:6px;padding:8px 4px;background:transparent;color:var(--muted);cursor:pointer}
.tabs button[aria-selected="true"]{background:var(--surface);color:var(--ink);box-shadow:0 1px 2px rgba(0,0,0,.08)}

.found{font-size:.88rem;color:var(--muted);display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.found:empty{display:none}

.drop{border:2px dashed var(--line);border-radius:8px;padding:14px;display:flex;gap:14px;align-items:center;cursor:pointer;flex-wrap:wrap;text-transform:none;letter-spacing:0;font-size:.95rem;color:var(--ink);font-weight:400;position:relative}
.drop:hover,.drop:focus-within{border-color:var(--accent)}
.drop img{width:64px;height:64px;object-fit:cover;border-radius:6px}
.drop input{position:absolute;opacity:0;width:1px;height:1px}
/* live camera (photo tab): preview, framing guide and a bar that fills while the phone is held steady */
.stage{position:relative;background:#0E0B09;border-radius:10px;overflow:hidden;aspect-ratio:3/4;max-height:62vh;width:100%;margin:0 auto}
.stage video,.stage img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.stage img{object-fit:contain}
.stage .guide{position:absolute;inset:15%;border:2px dashed rgba(255,255,255,.55);border-radius:8px;pointer-events:none}
.stage video[hidden]~.guide,.stage video[hidden]~.steady{display:none}
.stage .steady{position:absolute;left:12px;right:12px;bottom:12px;height:6px;border-radius:3px;background:rgba(255,255,255,.25);overflow:hidden}
.stage .steady i{display:block;height:100%;width:0;background:#F0A35A;border-radius:3px;transition:width .15s linear}
@media (prefers-reduced-motion:reduce){.stage .steady i{transition:none}}
/* a drink card still being written */
.drink.skel{gap:10px}

/* glossary */
.cats{display:flex;gap:6px;overflow-x:auto;padding-bottom:2px;scrollbar-width:thin}
.cats .like{white-space:nowrap;flex:none}
.glist{list-style:none;margin:0;padding:0;display:grid;max-height:60vh;overflow:auto;border-top:1px solid var(--line)}
.glist li{border-bottom:1px solid var(--line)}
.glist button{font:inherit;color:inherit;background:none;border:0;width:100%;text-align:left;padding:9px 2px;cursor:pointer;display:grid;gap:1px}
.glist button:hover b{color:var(--accent)}
.glist .gcat{font-size:.72rem;text-transform:uppercase;letter-spacing:.06em;color:var(--muted)}
.glist .gwhat{font-size:.88rem;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* results */
.meta{display:flex;flex-wrap:wrap;gap:6px 16px;font-size:.85rem;color:var(--muted)}
.meta:empty{display:none}
.meta b{color:var(--ink);font-weight:600}
#picks{background:var(--surface);border:1px solid var(--accent);border-radius:10px;padding:12px 14px;display:grid;gap:8px}
#picks h3{font-family:var(--display);font-weight:700;font-size:1.1rem;margin:0}
#picks ol{margin:0;padding-left:20px;display:grid;gap:4px}
#picks a{color:var(--accent);font-weight:600;text-decoration:none}
.section h3{font-family:var(--display);font-weight:500;font-size:1.3rem;margin:10px 0 8px;padding-bottom:6px;border-bottom:1px solid var(--line)}
.drinks{display:grid;gap:10px}
.drink{background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:14px;display:grid;gap:8px;scroll-margin-top:12px}
.drink.best{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent) inset}
.dtop{display:flex;justify-content:space-between;gap:12px;align-items:baseline}
.name{font-family:var(--display);font-weight:700;font-size:1.18rem;line-height:1.2}
.sub{font-size:.85rem;color:var(--muted)}
.price{font-family:var(--mono);font-variant-numeric:tabular-nums;color:var(--price);white-space:nowrap}
.desc{margin:0}
.spec{margin:0;font-size:.9rem;color:var(--muted)}
.spec b{color:var(--ink);font-weight:600}
.term{font:inherit;color:inherit;background:var(--mark);border:0;border-bottom:1px dotted var(--accent);border-radius:3px;padding:0 2px;cursor:pointer}
.term:hover{border-bottom-style:solid}
.wl{font:inherit;background:none;border:0;padding:0;cursor:pointer;color:var(--accent);font-weight:500;text-decoration:underline dotted;text-underline-offset:3px}
.wl:hover{text-decoration-style:solid}
.back{font:inherit;font-size:.88rem;font-weight:600;color:var(--accent);background:none;border:0;padding:0 0 8px;cursor:pointer;display:block}
.photo{margin:0 0 12px;display:grid;gap:4px}
.photo img{width:100%;max-height:220px;object-fit:cover;border-radius:8px;background:var(--chip)}
.photo figcaption{font-size:.75rem;color:var(--muted)}
.photo figcaption a{color:inherit}
.badges{display:flex;flex-wrap:wrap;gap:6px}
.chip{font-size:.75rem;background:var(--chip);border-radius:999px;padding:2px 9px;border:0;color:var(--ink);font-family:var(--body)}
button.chip{cursor:pointer;font-size:.8rem;padding:3px 10px}
button.chip:hover{background:var(--mark)}
.chip.alert{color:var(--warn);font-weight:600}
.chip.match{background:var(--accent);color:var(--accent-ink);font-weight:600}
.strength{display:inline-flex;align-items:center;gap:6px;font-size:.78rem;font-weight:600}
.strength i{display:inline-flex;gap:2px}
.strength i span{width:7px;height:12px;border-radius:2px;background:var(--bar-bg)}
.strength i span.on{background:var(--bar)}
.flavor{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:4px 14px;font-size:.78rem}
.fl{display:grid;grid-template-columns:52px 1fr;align-items:center;gap:6px;color:var(--muted)}
.fl .track{height:6px;border-radius:3px;background:var(--bar-bg);overflow:hidden}
.fl .track span{display:block;height:100%;background:var(--bar);border-radius:3px}
.like-line{font-size:.88rem;margin:0}
.like-line b{font-weight:600}
.tip{background:var(--chip);border-radius:8px;padding:8px 12px;font-size:.9rem}
.story{border-left:3px solid var(--bar);padding:2px 0 2px 12px}
.story summary{cursor:pointer;font-family:var(--display);font-weight:700;color:var(--accent);list-style-position:outside}
.story p{margin:6px 0 0;font-size:.92rem;line-height:1.55}

.sheet{border:0;border-radius:16px 16px 0 0;padding:20px 18px calc(20px + env(safe-area-inset-bottom,0px));width:100%;max-width:640px;margin:auto auto 0;max-height:88vh;overflow:auto;background:var(--surface);color:var(--ink)}
.sheet::backdrop{background:rgba(0,0,0,.45)}
.sheet-close{position:sticky;top:0;float:right;margin:-8px -6px 0 0}
.sheet-close button{font-size:1.6rem;line-height:1;border:0;background:var(--chip);color:var(--ink);border-radius:999px;width:36px;height:36px;cursor:pointer}
.sheet .sub{margin:0 0 10px}
.sheet .grid{display:grid;gap:10px}
.sheet p{margin:0}
.sheet dl{display:grid;grid-template-columns:auto 1fr;gap:6px 12px;margin:0;font-size:.92rem}
.sheet dt{color:var(--muted);font-weight:600}
.sheet dd{margin:0}
.perks{padding-left:18px;margin:8px 0 14px}
.skeleton{height:14px;background:var(--chip);border-radius:4px;animation:pulse 1.2s ease-in-out infinite}
@keyframes pulse{50%{opacity:.5}}
@media (prefers-reduced-motion:reduce){.skeleton{animation:none}}
footer{font-size:.8rem;color:var(--muted)}
footer a{color:inherit}
