/* Winenotes: white pages, burgundy accents. One phone-width column with a bottom bar and a big round Taste button.
   Wine pages get a coloured hero by wine type, with an outlined name behind the bottle (or your own photo) and taste sliders.
   No web fonts or other external requests: system fonts keep the page fast and the CSP strict. */
:root {
  --bg: #FFFFFF; --surface: #FFFFFF; --ink: #2B1A21; --muted: #7C6B72; --line: #F0E4E8; --line-strong: #E4D2D9;
  --accent: #7D1D3F; --accent-2: #5B1130; --accent-soft: #FAF0F3; --accent-ink: #FFFFFF; --track: #EFE1E6;
  --warn: #B4462B; --warn-soft: #FCEDE8;
  --grad: linear-gradient(135deg, #922651 0%, #6B1736 100%);
  --shadow: 0 1px 2px rgba(91, 17, 48, .05), 0 12px 28px -10px rgba(91, 17, 48, .20);
  --shadow-sm: 0 1px 2px rgba(91, 17, 48, .06), 0 4px 14px -6px rgba(91, 17, 48, .16);
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: env(safe-area-inset-top, 0px); }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; }
img { display: block; }
[hidden] { display: none !important; }
a { color: var(--accent); }
p { margin: 0; }
.app { max-width: 560px; margin-inline: auto; padding-inline: 16px; position: relative; }
main { padding-block: 10px 150px; }
main:focus { outline: none; }
.ic { width: 22px; height: 22px; flex: none; }

.appbar {
  position: sticky; top: 0; z-index: 6; margin-inline: -16px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 8px; min-height: 48px;
  display: flex; align-items: center; background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); text-decoration: none; font-weight: 800; font-size: 17px; letter-spacing: -0.01em; }
body[data-route="detail"] .appbar { display: none; }

.kicker { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
h1 { font-weight: 800; font-size: 28px; line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 6px; text-wrap: balance; }
h2 { font-weight: 800; font-size: 18px; letter-spacing: -0.01em; margin: 0 0 10px; }
.sub, .meta { color: var(--muted); font-size: 13px; margin: 0; }
.lead { color: var(--muted); margin: 4px 0 18px; max-width: 60ch; }
.hint { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.muted { color: var(--muted); }
.page-head { margin-bottom: 14px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: #fff; color: var(--ink); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); }
.skip:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* form controls */
input, select, textarea {
  font: inherit; font-size: 16px; color: var(--ink); background: #fff; border: 1.5px solid var(--line-strong); border-radius: 14px;
  padding: 10px 14px; min-height: 46px; width: 100%; min-width: 0;
}
textarea { min-height: 92px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #A8979E; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(125, 29, 63, .12); }
input.invalid { border-color: var(--warn); }
input[type="checkbox"] { width: 20px; min-height: 20px; height: 20px; accent-color: var(--accent); padding: 0; }
.field { display: grid; gap: 8px; min-width: 0; }
.lbl { font-size: 14px; font-weight: 700; }
.req { font-weight: 400; color: var(--muted); font-size: 12px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form { display: grid; gap: 20px; }
.err { color: var(--warn); font-size: 14px; margin: 0 0 8px; }
.check { display: inline-flex; align-items: center; gap: 10px; min-height: 36px; cursor: pointer; font-size: 14px; }

/* buttons, chips */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 700; font-size: 15px;
  min-height: 46px; padding: 10px 18px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: #fff; color: var(--accent); cursor: pointer; text-decoration: none;
}
.btn .ic { width: 18px; height: 18px; }
.btn.small { min-height: 38px; padding: 6px 14px; font-size: 14px; }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 8px 18px -8px rgba(107, 23, 54, .6); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--accent); padding-inline: 8px; }
.btn.warn { color: var(--warn); border-color: #E9C3B8; }
.btn.warn-solid { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-row { display: grid; gap: 10px; margin-bottom: 10px; }
.btn-row .btn, .empty .btn { width: 100%; }
.empty .btn { max-width: 320px; }
.sect label.btn { width: 100%; margin-top: 10px; }
.link { all: unset; cursor: pointer; color: var(--accent); font-weight: 700; font-size: 13px; }
.link:focus-visible { outline: 2px solid var(--accent); border-radius: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip { font: inherit; font-size: 14px; min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: #fff; color: var(--ink); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 700; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { font-size: 12px; line-height: 1; padding: 6px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.pill.q { background: var(--grad); color: #fff; }
.pill.wait { background: var(--warn-soft); color: var(--warn); }
.urow { display: grid; gap: 10px; }
.uhead { display: grid; gap: 2px; overflow-wrap: anywhere; }
.banner { background: var(--accent-soft); border-radius: 16px; padding: 12px 14px; font-size: 14px; margin-bottom: 12px; }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.row-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.empty { text-align: center; padding: 40px 12px; color: var(--muted); }
.empty p { margin: 0 0 12px; }
.empty h1 { color: var(--ink); }
.status { min-height: 1.4em; color: var(--muted); font-size: 14px; }

/* panels */
.sect { margin-top: 22px; }
.sheet { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 16px; margin: 14px 0; box-shadow: var(--shadow-sm); }
.kvs { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 4px 16px; box-shadow: var(--shadow-sm); }
.kv { display: grid; gap: 2px; padding: 11px 0; border-top: 1px solid var(--line); }
.kv:first-child { border-top: 0; }
.kv dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; margin: 0; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.prose { white-space: pre-wrap; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 13px; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.ok { color: var(--accent); font-weight: 700; }
.miss { color: var(--warn); font-weight: 700; }
.bars { display: grid; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 16px; box-shadow: var(--shadow-sm); }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; font-size: 14px; }
.bar-num { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.bar-track { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: var(--track); overflow: hidden; }
.bar-track span { display: block; height: 100%; background: var(--grad); border-radius: 999px; }
.list-plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.list-plain li { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; display: flex; justify-content: space-between; gap: 10px; box-shadow: var(--shadow-sm); }

/* explore: journal list */
.search { position: relative; margin-bottom: 14px; }
.search .ic { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--accent); width: 20px; height: 20px; pointer-events: none; }
.search input { padding-left: 46px; border-radius: 999px; background: #FBF5F7; border-color: transparent; min-height: 50px; }
.search input:focus { background: #fff; border-color: var(--accent); }
.tabs { display: flex; gap: 22px; overflow-x: auto; margin-inline: -16px; padding: 0 16px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab-btn { flex: none; font: inherit; font-size: 15px; background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 2px 9px; color: var(--muted); cursor: pointer; }
.tab-btn[aria-pressed="true"] { color: var(--accent); font-weight: 800; border-bottom-color: var(--accent); }
.sortrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 12px; }
.sortrow select { width: auto; min-height: 38px; padding: 4px 30px 4px 12px; border-radius: 999px; font-size: 14px; background-color: #fff; }
.list { display: grid; gap: 16px; }
.wcard {
  position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 8px; align-items: stretch; text-align: left; width: 100%;
  font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 14px 14px 14px 18px; min-height: 150px; cursor: pointer; box-shadow: var(--shadow);
}
.wcard:hover { border-color: var(--line-strong); }
.wmark {
  position: absolute; left: 14px; right: 14px; top: 6px; z-index: 0; font-weight: 900; font-size: 34px; line-height: 1; letter-spacing: -0.02em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; color: transparent; -webkit-text-stroke: 1.2px #EBDCE2; pointer-events: none;
}
.wbody { position: relative; z-index: 1; display: grid; align-content: end; gap: 3px; min-width: 0; padding-top: 38px; }
.wkick { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.wname { font-weight: 800; font-size: 18px; line-height: 1.15; overflow-wrap: anywhere; }
.wsub { font-size: 13px; color: var(--muted); }
.wrate { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.wart { position: relative; z-index: 1; display: grid; place-items: center; }
.wart img { width: 96px; height: 128px; object-fit: cover; border-radius: 16px; box-shadow: var(--shadow-sm); }
.wart .bottle { width: 44px; height: 118px; }
.stars { position: relative; display: inline-block; font-size: 14px; line-height: 1; letter-spacing: 1px; white-space: nowrap; vertical-align: middle; font-family: "Segoe UI Symbol", "Apple Symbols", system-ui, sans-serif; }
.stars .bg { color: #E8D6DD; }
.stars .fg { position: absolute; left: 0; top: 0; overflow: hidden; color: var(--accent); }
.bottle { fill: currentColor; color: var(--bottle, #7D1D3F); }
.bottle .shine { fill: none; stroke: #fff; stroke-opacity: .28; stroke-width: 2.2; stroke-linecap: round; }
.bottle .foil { fill: #D8B24E; }
.bottle .foil-line { fill: none; stroke: #9C7A22; stroke-opacity: .7; stroke-width: 1; stroke-linecap: round; }
.bottle .lab { fill: #FBF4EA; }
.bottle .lab-in { fill: none; stroke: currentColor; stroke-opacity: .38; stroke-width: .7; }
.bottle .lab-ink { fill: currentColor; opacity: .82; }
.cat-white { --bottle: #8FA35A; } .cat-rose { --bottle: #D8708C; } .cat-red { --bottle: #7D1D3F; } .cat-sparkling { --bottle: #7FA37A; } .cat-fortified { --bottle: #8A5A2B; } .cat-none { --bottle: #A68994; }

/* wine page hero */
.hero {
  --hero-bg: linear-gradient(165deg, #A82B57 0%, #7D1D3F 55%, #5B1130 100%); --hero-ink: #fff; --mark: rgba(255, 255, 255, .42); --bottle: #2A0C17; --chip: rgba(255, 255, 255, .22);
  position: relative; margin-inline: -16px; padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 64px; min-height: 330px; overflow: hidden;
  background: var(--hero-bg); color: var(--hero-ink);
}
.hero.cat-white { --hero-bg: linear-gradient(165deg, #F7E0AE 0%, #E7BC6C 100%); --hero-ink: #3A2A12; --mark: rgba(58, 42, 18, .3); --bottle: #55703F; --chip: rgba(255, 255, 255, .55); }
.hero.cat-rose { --hero-bg: linear-gradient(165deg, #F8BCCB 0%, #E2859F 100%); --hero-ink: #4A1427; --mark: rgba(74, 20, 39, .3); --bottle: #8C2C4E; --chip: rgba(255, 255, 255, .5); }
.hero.cat-sparkling { --hero-bg: linear-gradient(165deg, #EBF3D9 0%, #BAD2A0 100%); --hero-ink: #27361B; --mark: rgba(39, 54, 27, .3); --bottle: #3C5A2C; --chip: rgba(255, 255, 255, .55); }
.hero.cat-fortified { --hero-bg: linear-gradient(165deg, #CF9760 0%, #7C4A27 100%); --hero-ink: #fff; --mark: rgba(255, 255, 255, .4); --bottle: #2D1A0C; }
.hero-bar { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.round { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--chip); color: var(--hero-ink); text-decoration: none; border: 0; }
.chip-top { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 7px 12px; border-radius: 8px; background: var(--chip); color: var(--hero-ink); max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-mark {
  position: absolute; left: 16px; right: 16px; top: 74px; z-index: 1; font-weight: 900; font-size: clamp(34px, 12vw, 58px); line-height: .95; letter-spacing: -0.02em; text-transform: uppercase;
  color: transparent; -webkit-text-stroke: 1.5px var(--mark); overflow-wrap: anywhere; max-height: 128px; overflow: hidden; pointer-events: none;
}
.hero-art { position: relative; z-index: 2; display: grid; place-items: center; margin: 14px auto 0; height: 190px; }
.hero-art img { height: 190px; width: auto; max-width: 70vw; border-radius: 22px; object-fit: cover; box-shadow: 0 18px 36px -12px rgba(0, 0, 0, .45); border: 4px solid rgba(255, 255, 255, .85); }
.hero-art .bottle { height: 190px; width: 70px; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .28)); }
.hero-foot { position: absolute; z-index: 3; left: 16px; right: 16px; bottom: 54px; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.hero-price { font-weight: 800; font-size: 24px; line-height: 1; }
.hero-price small { display: block; font-size: 11px; font-weight: 500; opacity: .85; margin-top: 4px; }
.hero-rate { text-align: right; font-size: 12px; }
.hero-rate .stars .bg { color: rgba(255, 255, 255, .45); } .hero-rate .stars .fg { color: #fff; } .hero-rate b { display: block; font-size: 15px; margin-top: 3px; }
.hero.cat-white .hero-rate .stars .bg, .hero.cat-rose .hero-rate .stars .bg, .hero.cat-sparkling .hero-rate .stars .bg { color: rgba(0, 0, 0, .18); }
.hero.cat-white .hero-rate .stars .fg, .hero.cat-rose .hero-rate .stars .fg, .hero.cat-sparkling .hero-rate .stars .fg { color: var(--hero-ink); }
.wave { position: absolute; left: 0; bottom: -1px; width: 100%; height: 46px; z-index: 2; display: block; }
.wave path { fill: #fff; }
.wine-title { margin-top: 6px; }
.wine-title h1 { font-size: 26px; }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 18px 0 6px; text-align: center; }
.trio div { display: grid; justify-items: center; gap: 6px; font-size: 13px; line-height: 1.25; overflow-wrap: anywhere; }
.trio .ic { width: 28px; height: 28px; color: var(--accent); }
.trio small { display: block; color: var(--muted); font-size: 11px; }

/* sliders */
.slider { position: relative; padding: 4px 0; }
.range { -webkit-appearance: none; appearance: none; display: block; width: 100%; min-height: 32px; height: 32px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; --p: 50%; cursor: pointer; touch-action: pan-y; }
.range:focus { box-shadow: none; }
.range::-webkit-slider-runnable-track { height: 8px; border-radius: 999px; background: linear-gradient(to right, var(--accent) var(--p), var(--track) var(--p)); }
.range::-moz-range-track { height: 8px; border-radius: 999px; background: var(--track); }
.range::-moz-range-progress { height: 8px; border-radius: 999px; background: var(--accent); }
.range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 28px; height: 28px; margin-top: -10px; border-radius: 50%; background: var(--grad); border: 4px solid #fff; box-shadow: 0 3px 10px rgba(91, 17, 48, .4); }
.range::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #7D1D3F; border: 4px solid #fff; box-shadow: 0 3px 10px rgba(91, 17, 48, .4); }
.range:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--accent); outline-offset: 2px; }
.slider.unset .range::-webkit-slider-runnable-track { background: var(--track); }
.slider.unset .range::-moz-range-progress { background: var(--track); }
.slider.unset .range::-webkit-slider-thumb { background: #fff; border-color: #D6BDC7; box-shadow: 0 2px 6px rgba(91, 17, 48, .25); }
.slider.unset .range::-moz-range-thumb { background: #fff; border-color: #D6BDC7; }
.slider-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.slider-val { font-weight: 800; color: var(--accent); font-size: 15px; }
.slider-val.unset { color: var(--muted); font-weight: 500; }
.slider-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.slider-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 20px; }
.prof { display: grid; gap: 6px; }
.prof-head { display: flex; justify-content: space-between; font-size: 13px; }
.prof-head b { color: var(--accent); }
.prof-row { display: grid; grid-template-columns: 62px minmax(0, 1fr) 62px; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); }
.prof-row span:last-child { text-align: right; }
.prof-track { position: relative; height: 8px; border-radius: 999px; background: var(--track); }
.prof-thumb { position: absolute; top: 50%; width: 22px; height: 22px; border-radius: 50%; background: var(--grad); border: 4px solid #fff; box-shadow: 0 3px 10px rgba(91, 17, 48, .35); transform: translate(-50%, -50%); }
.profile { display: grid; gap: 16px; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 16px; box-shadow: var(--shadow-sm); }

/* segmented buttons, cards for choices */
.seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 8px; }
.opt { font: inherit; font-size: 14px; min-height: 46px; padding: 8px 8px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: #fff; color: var(--ink); cursor: pointer; overflow-wrap: anywhere; }
.opt[aria-checked="true"] { background: var(--grad); border-color: transparent; color: #fff; font-weight: 700; }
.mode-group { display: grid; gap: 14px; }
.mode { display: grid; gap: 4px; text-align: left; font: inherit; color: var(--ink); background: #fff; border: 1.5px solid var(--line-strong); border-radius: 22px; padding: 18px; cursor: pointer; min-height: 56px; box-shadow: var(--shadow-sm); }
.mode[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); }
.mode-title { font-weight: 800; font-size: 18px; }
.mode.big { grid-template-columns: 52px minmax(0, 1fr); column-gap: 14px; align-items: center; }
.mode.big .orb { grid-row: span 3; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--grad); color: #fff; }
.mode.big .meta { margin-top: 2px; }
.lex-group { display: grid; gap: 6px; margin-bottom: 8px; }
.lex-group .kicker { margin: 0; }
.add-input { margin-top: 4px; }
.blic-row { display: grid; gap: 8px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.blic-row:last-child { border-bottom: 0; }
.suggest { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--accent-soft); border-radius: 18px; padding: 14px 16px; }
.suggest .meta { display: block; margin-top: 2px; }
details.ded { border: 1.5px solid var(--line-strong); border-radius: 18px; padding: 12px 16px; background: #fff; }
details.ded summary { font-weight: 700; cursor: pointer; min-height: 32px; }
details.ded[open] summary { margin-bottom: 12px; }

/* wizard */
.wiz-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.steps { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr)); gap: 6px; }
.step { width: 100%; min-height: 8px; height: 8px; padding: 0; border-radius: 999px; border: 0; background: var(--track); color: transparent; font-size: 0; cursor: pointer; }
.step.done { background: #C58AA0; }
.step.on { background: var(--grad); }
.wiz-foot { position: sticky; bottom: env(safe-area-inset-bottom, 0px); background: linear-gradient(to top, #fff 72%, rgba(255, 255, 255, 0)); padding-block: 22px calc(10px + env(safe-area-inset-bottom, 0px)); margin-top: 20px; }
.foot-btns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 10px; }
.foot-btns .btn { width: 100%; min-height: 50px; }

/* photo */
.photo-box { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.photo-prev { width: 104px; height: 132px; border-radius: 18px; overflow: hidden; background: var(--accent-soft); border: 1.5px dashed #D9B9C6; display: grid; place-items: center; color: var(--accent); font-size: 12px; text-align: center; flex: none; }
.photo-prev img { width: 100%; height: 100%; object-fit: cover; }
.photo-prev .ic { width: 30px; height: 30px; }
.photo-actions { display: grid; gap: 8px; justify-items: start; }
.cam-only { display: none; }
@media (pointer: coarse) { .cam-only { display: inline-flex; } }

/* floating action button on the wine page */
.fab { position: fixed; left: 0; right: 0; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); z-index: 12; pointer-events: none; }
.fab-in { max-width: 560px; margin-inline: auto; padding-inline: 16px; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.fab-main { pointer-events: auto; width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--grad); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 12px 24px -8px rgba(107, 23, 54, .65); }
.fab-main .ic { width: 26px; height: 26px; transition: transform .2s; }
.fab.open .fab-main .ic { transform: rotate(45deg); }
.fab-actions { display: none; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: auto; }
.fab.open .fab-actions { display: flex; }
.fab-act { display: inline-flex; align-items: center; gap: 10px; border: 0; background: transparent; color: var(--ink); font: inherit; font-weight: 700; font-size: 13px; text-decoration: none; cursor: pointer; padding: 0; }
.fab-act span.lab { background: #fff; padding: 7px 12px; border-radius: 999px; box-shadow: var(--shadow-sm); }
.fab-act .dotbtn { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: #fff; color: var(--accent); box-shadow: var(--shadow); }
.fab-act.warn .dotbtn { color: var(--warn); }
.fab-act.armed .dotbtn { background: var(--warn); color: #fff; }

/* bottom bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -8px 24px -14px rgba(91, 17, 48, .25); padding-bottom: env(safe-area-inset-bottom, 0px); }
.tabbar-in { max-width: 560px; margin-inline: auto; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end; padding: 6px 8px 8px; }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 50px; color: #A28C95; text-decoration: none; font-size: 11px; font-weight: 600; border-radius: 12px; }
.tab[aria-current="page"] { color: var(--accent); }
.tab .ic { width: 24px; height: 24px; }
.tab-taste { color: var(--accent); }
.tab-taste .orb { display: grid; place-items: center; width: 56px; height: 56px; margin-top: -30px; border-radius: 50%; background: var(--grad); color: #fff; border: 4px solid #fff; box-shadow: 0 10px 22px -6px rgba(107, 23, 54, .6); }
.tab-taste .ic { width: 26px; height: 26px; }
body[data-route="wizard"] .tabbar, body[data-route="choose"] .tabbar, body[data-route="auth"] .tabbar, body[data-route="loading"] .tabbar, body[data-route="setup"] .tabbar, body[data-route="unavailable"] .tabbar { display: none; }
body[data-route="wizard"] .fab, body[data-route="choose"] .fab { display: none; }
body[data-route="auth"] main, body[data-route="loading"] main, body[data-route="setup"] main, body[data-route="unavailable"] main { padding-bottom: 40px; }
.auth-tabs { margin-bottom: 14px; }
.noscript { padding: 24px; }

/* toasts */
#toasts { position: fixed; left: 0; right: 0; bottom: calc(100px + env(safe-area-inset-bottom, 0px)); z-index: 60; display: grid; justify-items: center; gap: 8px; padding: 0 16px; pointer-events: none; }
.toast { pointer-events: auto; max-width: 520px; padding: 12px 18px; border-radius: 999px; background: var(--ink); color: #fff; box-shadow: 0 8px 28px rgba(0, 0, 0, .25); font-size: 14px; }
.toast.err { background: var(--warn); }

@media (max-width: 380px) { .two { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print { .appbar, .tabbar, .fab, #toasts, .wiz-foot { display: none !important; } }

/* AI features */
.ai-box { background: linear-gradient(180deg, #FBF5F7, #fff); border: 1px solid var(--line); border-radius: 20px; padding: 14px 16px; display: grid; gap: 10px; margin: 14px 0; box-shadow: var(--shadow-sm); }
.ai-box > h2 { margin: 0; }
.ai-head { display: flex; align-items: center; gap: 10px; }
.ai-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 800; letter-spacing: .06em; color: #fff; background: var(--grad); padding: 4px 9px; border-radius: 999px; }
.ai-badge .ic { width: 12px; height: 12px; }
.ai-box .btn.small { justify-self: start; }
.ai-box textarea { min-height: 64px; }
.ai-result { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; display: grid; gap: 8px; }
.ai-result p { margin: 0; }
.ai-result ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.ai-result .kvs { box-shadow: none; padding: 0 4px; }
.ai-question { font-style: italic; color: var(--accent); }
