:root {
  --bg: #15100C; --bg2: #1C1510; --card: #1E1611; --line: #2E231A; --line2: #3A2D22; --chip: #4A3A2C;
  --text: #F3E9DA; --soft: #E3D5C1; --muted: #B8A58C; --dim: #A8957C; --gold: #D9A44A;
  --serif: "Cormorant Garamond", Georgia, serif; --sans: Inter, system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--text); }
.app { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.loading { margin: auto; color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* top bars */
.bar { position: sticky; top: 0; z-index: 5; background: var(--bg); display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); padding-top: max(8px, env(safe-area-inset-top)); }
.bar .mid { flex: 1; min-width: 0; display: flex; justify-content: center; }
.bar .mid img { height: 34px; width: auto; display: block; }
.icon { width: 44px; height: 44px; border: 0; background: transparent; color: #CDBBA2; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 8px; flex: none; }
.icon:hover { background: #1E1611; }
.icon svg { width: 20px; height: 20px; }
.textbtn { min-height: 44px; padding: 0 10px; border: 0; background: transparent; color: #CDBBA2; cursor: pointer; font-size: 14px; }

/* buttons & fields */
.btn { min-height: 52px; width: 100%; display: flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid #6B5642; background: transparent; color: var(--text); font-size: 16px; font-weight: 500; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--gold); border-color: var(--gold); color: var(--bg); font-weight: 600; }
.btn[disabled] { background: var(--line2); border-color: var(--line2); color: var(--dim); cursor: not-allowed; }
.link { color: var(--gold); font-weight: 500; background: none; border: 0; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.label { font-size: 12px; letter-spacing: 1.5px; color: var(--dim); text-transform: uppercase; }
.input { min-height: 50px; padding: 0 14px; background: var(--card); border: 1px solid var(--line2); border-radius: 8px; color: var(--text); font-size: 16px; width: 100%; }
.input:focus, select:focus, .btn:focus-visible, .chip:focus-visible, .icon:focus-visible, .row:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.45; color: var(--soft); cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--gold); flex: none; }
.error { color: #F0A58A; font-size: 14px; min-height: 20px; }
.small { font-size: 12px; line-height: 1.5; color: var(--dim); }

/* screens */
.screen { flex: 1; display: flex; flex-direction: column; }
.pad { padding: 20px 24px; }
.h1 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 34px; line-height: 1.1; }
.lead { margin: 6px 0 0; font-size: 15px; line-height: 1.5; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.foot { padding: 12px 24px calc(28px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }

/* welcome */
.welcome { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; text-align: center; padding: 40px 24px 10px; }
.welcome img { width: 290px; max-width: 80vw; height: auto; }
.welcome .rule { width: 48px; height: 1px; background: var(--chip); }
.welcome p { margin: 0; font-family: var(--serif); font-size: 24px; font-style: italic; line-height: 1.3; color: var(--soft); max-width: 300px; }

/* onboarding */
.progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 0 24px; }
.progress span { height: 3px; border-radius: 2px; background: var(--line2); }
.progress span.on { background: var(--gold); }
.option { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg2); color: var(--text); text-align: left; cursor: pointer; width: 100%; }
.option[aria-pressed="true"] { border-color: var(--gold); background: #2A1F15; }
.option b { font-size: 17px; font-weight: 600; }
.option span { font-size: 14px; line-height: 1.45; color: var(--muted); }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--chip); background: transparent; color: var(--soft); font-size: 14px; font-weight: 500; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--bg); }
.group { padding: 18px 20px 0; }
.group .chips { margin-top: 10px; }

/* search */
.search { display: flex; align-items: center; gap: 8px; padding: 0 14px; min-height: 48px; background: var(--card); border: 1px solid var(--line2); border-radius: 8px; margin-top: 8px; }
.search input { flex: 1; min-width: 0; height: 46px; border: 0; outline: none; background: transparent; color: var(--text); font-size: 16px; }
.search svg { width: 18px; height: 18px; color: var(--dim); flex: none; }
select.input { appearance: auto; }
.sticky-foot { position: sticky; bottom: 0; display: flex; gap: 10px; padding: 12px 20px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg); }
.sticky-foot .btn { width: auto; }
.sticky-foot .btn.primary { flex: 1; }

/* results */
.rhead { flex: 1; min-width: 0; }
.rhead .count { font-family: var(--serif); font-size: 24px; font-weight: 600; line-height: 1.1; }
.rhead .sum { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.region { padding: 18px 20px 6px; display: flex; align-items: baseline; justify-content: space-between; border-bottom: 1px solid var(--line2); }
.region h2 { margin: 0; font-family: var(--serif); font-size: 22px; font-weight: 600; color: var(--gold); }
.row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 20px; border: 0; border-bottom: 1px solid #2A2018; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.row:hover { background: #1A140F; }
.row .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.over { font-size: 11px; font-weight: 500; letter-spacing: 1.5px; color: var(--dim); text-transform: uppercase; }
.row .name { font-size: 16px; font-weight: 600; line-height: 1.3; }
.row .meta { font-size: 13px; color: var(--muted); }
.row .right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.price { font-family: var(--serif); font-size: 22px; font-weight: 600; color: var(--gold); }
.segs { display: flex; gap: 2px; }
.segs i { width: 9px; height: 4px; border-radius: 1px; background: var(--line2); }
.segs i.on { background: var(--gold); }
.segs.big { gap: 3px; } .segs.big i { width: 16px; height: 6px; border-radius: 2px; }
.empty { padding: 48px 32px; text-align: center; color: var(--muted); line-height: 1.6; }

/* bottle */
.hero { padding: 28px 20px 24px; display: flex; flex-direction: column; gap: 12px; background: var(--bg2); }
.hero .top { display: flex; align-items: center; justify-content: space-between; }
.tier { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 600; letter-spacing: 1.5px; color: var(--gold); text-transform: uppercase; }
.hero h1 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 38px; line-height: 1.05; text-wrap: balance; }
.tag { font-size: 12px; padding: 6px 10px; border: 1px solid var(--chip); border-radius: 999px; color: var(--soft); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats div { padding: 16px 0; text-align: center; }
.stats div + div { border-left: 1px solid var(--line); }
.stats div:last-child { background: #241A12; }
.stats small { display: block; font-size: 11px; letter-spacing: 1.5px; color: var(--dim); }
.stats b { display: block; font-family: var(--serif); font-size: 30px; font-weight: 600; margin-top: 2px; }
.stats b span { font-size: 16px; color: #CDBBA2; }
.facts { padding: 8px 20px; }
.fact { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 48px; border: 0; border-bottom: 1px solid #2A2018; background: transparent; color: var(--text); font-size: 15px; text-align: right; padding: 0; }
.fact:last-child { border-bottom: 0; }
button.fact { cursor: pointer; } button.fact:hover span:last-child { color: var(--gold); }
.fact span:first-child { color: var(--dim); font-size: 13px; text-align: left; }
.notes { margin: 12px 20px 0; padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; gap: 14px; }
.notes h2, .dyk h2 { margin: 0; font-family: var(--serif); font-size: 24px; font-weight: 600; }
.notes .k { font-size: 11px; font-weight: 600; letter-spacing: 1.5px; color: var(--gold); text-transform: uppercase; }
.notes p, .dyk p { margin: 4px 0 0; font-size: 15px; line-height: 1.55; color: var(--soft); }
.dyk { margin: 16px 20px 0; padding: 20px; border-top: 2px solid var(--gold); }
.dyk h2 { font-style: italic; font-weight: 500; font-size: 22px; }
.pager { display: flex; gap: 10px; padding: 28px 20px calc(32px + env(safe-area-inset-bottom)); }
.pager .btn { min-height: 48px; font-size: 14px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #2A1F15; border: 1px solid var(--chip); color: var(--text); padding: 10px 16px; border-radius: 8px; font-size: 14px; z-index: 20; }
