:root {
  --bg: #F5F2EC; --card: #FFFDF9; --ink: #2E1A17; --muted: #86766C; --line: #E6DFD4;
  --brand: #9B3434; --brand-2: #7E2525; --accent: #EE6A2C; --ok: #2F7D44;
  --sample: #FCEBDD; --sample-ink: #A1491C; --bottle: #DDEBFA; --bottle-ink: #2A5D93; --decant: #E9E1F7; --decant-ink: #5C3F99;
  --r: 16px; --shadow: 0 6px 24px rgba(60, 30, 20, .08);
  --head: "Rubik", system-ui, sans-serif; --dirt: "Rubik Dirt", "Rubik", sans-serif; --body: "Manrope", system-ui, sans-serif;
}
* { box-sizing: border-box; min-width: 0; }
html { -webkit-text-size-adjust: 100%; }
body { overflow-x: clip; margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--body); padding-bottom: 96px; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }
[hidden] { display: none !important; }

/* header */
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: rgba(245, 242, 236, .92); backdrop-filter: blur(10px); }
.logo { font: 800 19px var(--head); color: var(--ink); text-decoration: none; letter-spacing: -.3px; }
.logo span, .gate-logo span { font-family: var(--dirt); font-weight: 400; color: var(--brand); }
.top-right { display: flex; align-items: center; gap: 10px; }
.lang { display: flex; background: #EAE3D8; border-radius: 999px; padding: 3px; }
.lang button { padding: 5px 11px; border-radius: 999px; font-weight: 700; font-size: 13px; color: var(--muted); }
.lang button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.cart-btn { position: relative; width: 42px; height: 42px; border-radius: 50%; background: var(--card); display: grid; place-items: center; box-shadow: var(--shadow); }
.badge { position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--accent); color: #fff; font: 700 12px/20px var(--body); text-align: center; padding: 0 5px; }

/* tabs */
.tabs { position: sticky; top: 62px; z-index: 25; display: flex; gap: 6px; overflow-x: auto; padding: 4px 16px 10px; background: rgba(245, 242, 236, .92); backdrop-filter: blur(10px); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { text-decoration: none; color: var(--ink); flex: 0 0 auto; padding: 8px 14px; border-radius: 999px; background: var(--card); font-weight: 700; font-size: 14px; border: 1.5px solid transparent; white-space: nowrap; }
.tab small { font-weight: 600; color: var(--muted); margin-left: 4px; }
.tab.on { border-color: var(--ink); }
.tab.t-sample.on { background: var(--sample); border-color: var(--sample-ink); }
.tab.t-bottle.on { background: var(--bottle); border-color: var(--bottle-ink); }
.tab.t-decant.on { background: var(--decant); border-color: var(--decant-ink); }
.tab.t-finder.on { background: var(--ink); color: #fff; }

main { max-width: 1100px; margin: 0 auto; padding: 4px 16px 24px; }
.loading { padding: 80px 0; text-align: center; color: var(--muted); }

/* home */
.hero { padding: 18px 0 8px; }
.hero h1 { font: 400 clamp(34px, 9vw, 60px)/1 var(--dirt); color: var(--brand); margin: 0 0 8px; text-transform: uppercase; }
.hero p { margin: 0; font-size: 16px; color: var(--muted); max-width: 520px; }
.promo { margin: 16px 0; padding: 14px 16px; border-radius: var(--r); color: #fff; font: 700 15px/1.3 var(--head);
  background: linear-gradient(100deg, #E8392B, var(--accent)); box-shadow: 0 8px 22px rgba(238, 106, 44, .3); }
.promo b { font-weight: 800; }
.how { background: var(--card); border-radius: var(--r); padding: 16px; margin: 14px 0 22px; box-shadow: var(--shadow); }
.how h2, .h2 { font: 700 18px var(--head); margin: 0 0 12px; }
.how ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.how li { display: flex; gap: 12px; align-items: flex-start; }
.how li i { flex: 0 0 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; font: 700 14px/28px var(--head); text-align: center; font-style: normal; }
.how .hownote { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.tiles { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.tile { text-align: left; border-radius: var(--r); padding: 18px; position: relative; overflow: hidden; min-height: 132px; display: flex; flex-direction: column; justify-content: space-between; box-shadow: var(--shadow); transition: transform .15s; }
.tile:active { transform: scale(.98); }
.tile .num { font: 800 13px var(--head); opacity: .7; }
.tile h3 { font: 800 24px/1.05 var(--head); margin: 4px 0 6px; }
.tile p { margin: 0; font-size: 14px; opacity: .85; max-width: 90%; }
.tile .count { position: absolute; top: 16px; right: 16px; font: 700 13px var(--head); background: rgba(255,255,255,.6); padding: 3px 9px; border-radius: 999px; }
.tile .go { margin-top: 10px; font-weight: 800; font-size: 14px; }
.tile.t-sample { background: var(--sample); color: #5E2A10; }
.tile.t-bottle { background: var(--bottle); color: #173A61; }
.tile.t-decant { background: var(--decant); color: #36225F; }
.tile.t-finder { background: var(--ink); color: #FBEFE6; }
.tile .emoji { position: absolute; right: 14px; bottom: 6px; font-size: 54px; opacity: .9; }

/* section page */
.sec-head { border-radius: var(--r); padding: 16px; margin: 6px 0 12px; }
.sec-head h2 { font: 800 24px var(--head); margin: 0 0 6px; }
.sec-head p { margin: 0; font-size: 14px; }
.sec-head.t-sample { background: var(--sample); } .sec-head.t-bottle { background: var(--bottle); } .sec-head.t-decant { background: var(--decant); }
.sec-head .promo { margin: 12px 0 0; font-size: 14px; }
.tools { position: sticky; top: 112px; z-index: 20; background: var(--bg); padding: 6px 0 8px; }
.search { width: 100%; padding: 12px 14px 12px 40px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%2386766C' stroke-width='2'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='m13 13 4 4'/%3E%3C/svg%3E") 13px 50% no-repeat; outline: none; }
.search:focus { border-color: var(--ink); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; padding: 6px 12px; border-radius: 999px; background: var(--card); border: 1.5px solid var(--line); font-size: 13px; font-weight: 600; white-space: nowrap; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.like { background: #DDF2E2; border-color: var(--ok); color: #1E5E2A; }
.chip.dislike { background: #F8DADA; border-color: #B33; color: #8A1F1F; text-decoration: line-through; }

.list { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
.row { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 14px; padding: 10px 10px 10px 12px; border: 1.5px solid transparent; }
.row.in { border-color: var(--ok); background: #F6FBF6; }
.row.dim { opacity: .55; }
.row .info { flex: 1; min-width: 0; text-align: left; }
.row .brand { font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 700; }
.row .name { font: 700 16px/1.2 var(--head); margin: 1px 0 3px; }
.row .mini { display: flex; flex-wrap: wrap; gap: 4px; font-size: 12px; color: var(--muted); }
.row .mini span::after { content: "·"; margin-left: 4px; } .row .mini span:last-child::after { content: ""; }
.thumb { flex: 0 0 44px; height: 56px; border-radius: 10px; background: #F0EAE0 center/contain no-repeat; display: grid; place-items: center; font: 800 15px var(--head); color: var(--muted); }
.tag { display: inline-block; font: 800 10px/1 var(--head); padding: 4px 6px; border-radius: 6px; vertical-align: middle; margin-left: 4px; letter-spacing: .4px; }
.tag.new { background: var(--accent); color: #fff; }
.tag.res { background: #FFE08A; color: #6B4E00; }
.tag.bo { background: #FFD1B0; color: #7A3300; }
.add { flex: 0 0 auto; min-width: 44px; height: 44px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 800; font-size: 22px; display: grid; place-items: center; padding: 0 10px; }
.add.in { background: var(--ok); font-size: 18px; }
.add:disabled { background: #CFC7BC; }
.sizes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; margin-top: 8px; max-width: 360px; }
.size { border: 1.5px solid var(--line); border-radius: 10px; padding: 6px 2px; text-align: center; background: #fff; line-height: 1.15; }
.size b { display: block; font: 800 14px var(--head); }
.size small { font-size: 11.5px; white-space: nowrap; color: var(--muted); font-weight: 600; }
.size.in { background: var(--ok); border-color: var(--ok); color: #fff; } .size.in small { color: #E6F6EA; }
.row.decant { align-items: flex-start; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }

/* bottle cards */
.cards { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { background: var(--card); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; border: 1.5px solid transparent; box-shadow: var(--shadow); }
.card.in { border-color: var(--ok); }
.card .ph { aspect-ratio: 3/4; background: #F0EAE0 center/contain no-repeat; display: grid; place-items: center; font: 800 26px var(--head); color: #C9BDB0; }
.card .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.card .name { font: 700 15px/1.2 var(--head); }
.card .meta { font-size: 12.5px; color: var(--muted); }
.card .price { font: 800 18px var(--head); margin-top: auto; padding-top: 6px; }
.card .add { width: 100%; height: 40px; font-size: 14px; margin-top: 6px; }

/* sheet (modal / bottom sheet) */
.overlay { position: fixed; inset: 0; background: rgba(30, 15, 10, .45); z-index: 40; }
.sheet { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; max-height: 92vh; overflow-y: auto; background: var(--bg); border-radius: 22px 22px 0 0; padding: 8px 18px calc(24px + env(safe-area-inset-bottom)); animation: up .22s ease-out; overscroll-behavior: contain; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: #D5CCC0; margin: 4px auto 10px; }
.sheet .x { position: sticky; top: 0; float: right; width: 36px; height: 36px; border-radius: 50%; background: var(--card); font-size: 20px; box-shadow: var(--shadow); z-index: 2; }
.pf-top { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 12px; }
.pf-photo { flex: 0 0 110px; height: 146px; border-radius: 14px; background: #EFE8DD center/contain no-repeat; display: grid; place-items: center; font: 800 30px var(--head); color: #C9BDB0; }
.pf-brand { font-size: 12px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); font-weight: 700; }
.pf-name { font: 800 24px/1.1 var(--head); margin: 2px 0 6px; }
.pf-dupe { font-size: 13px; color: var(--brand); font-weight: 600; }
.block { background: var(--card); border-radius: 14px; padding: 12px 14px; margin: 10px 0; }
.block h4 { margin: 0 0 8px; font: 700 13px var(--head); text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.pyr { display: grid; gap: 8px; }
.pyr-row { display: grid; grid-template-columns: 64px 1fr; gap: 8px; align-items: start; }
.pyr-row > b { font-size: 12px; color: var(--muted); padding-top: 5px; }
.notes { display: flex; flex-wrap: wrap; gap: 5px; }
.note { padding: 4px 10px; border-radius: 999px; background: #F3EDE4; font-size: 13px; font-weight: 600; }
.note.hit { background: #DDF2E2; color: #1E5E2A; }
.acc { display: grid; gap: 5px; }
.acc div { height: 24px; border-radius: 7px; color: #fff; font: 700 12.5px/24px var(--body); padding: 0 10px; white-space: nowrap; overflow: hidden; }
.fmt { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.fmt:first-of-type { border-top: 0; }
.fmt .lbl { flex: 1; font-weight: 600; font-size: 14px; }
.fmt .lbl small { display: block; color: var(--muted); font-weight: 500; }
.fmt .dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; }
.sim { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.sim button { flex: 0 0 132px; text-align: left; background: #F7F2EA; border-radius: 12px; padding: 10px; }
.sim .brand { font-size: 10.5px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.sim .name { font: 700 14px/1.15 var(--head); }
.sim small { color: var(--ok); font-weight: 700; font-size: 11.5px; }
.muted { color: var(--muted); font-size: 13.5px; }

/* cart bar */
.cartbar { position: fixed; z-index: 35; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto;
  background: var(--ink); color: #fff; border-radius: 16px; padding: 10px 10px 10px 16px; display: flex; align-items: center; gap: 10px; box-shadow: 0 10px 30px rgba(40, 20, 10, .35); }
.cartbar .t { flex: 1; min-width: 0; }
.cartbar .t b { font: 800 16px var(--head); display: block; }
.cartbar .t small { opacity: .8; font-size: 12.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cartbar button { background: var(--accent); color: #fff; font-weight: 800; padding: 11px 16px; border-radius: 12px; }

/* cart */
.cart h2 { font: 800 24px var(--head); margin: 0 0 10px; }
.cline { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.cline:first-of-type { border-top: 0; }
.cline .lbl { flex: 1; font-size: 14px; } .cline .lbl b { font-family: var(--head); }
.cline .rm { width: 32px; height: 32px; border-radius: 50%; background: #F3EDE4; font-size: 16px; color: var(--muted); }
.sumrow { display: flex; justify-content: space-between; font-size: 14px; padding: 3px 0; }
.sumrow.total { font: 800 20px var(--head); padding-top: 10px; border-top: 1.5px solid var(--ink); margin-top: 8px; }
.hint { background: #FFF1E6; border: 1.5px dashed var(--accent); color: #8A3A0F; border-radius: 12px; padding: 10px 12px; font-weight: 700; font-size: 13.5px; margin: 8px 0; }
.form { display: grid; gap: 10px; }
.form label { font-weight: 700; font-size: 13.5px; display: grid; gap: 5px; }
.form input, .form textarea { width: 100%; padding: 12px 13px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; outline: none; font-weight: 500; }
.form input:focus, .form textarea:focus { border-color: var(--ink); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.seg button { padding: 11px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font-weight: 700; }
.seg button.on { border-color: var(--ink); background: var(--ink); color: #fff; }
.send { width: 100%; padding: 15px; border-radius: 14px; background: var(--brand); color: #fff; font: 800 17px var(--head); margin-top: 4px; }
.send:disabled { opacity: .6; }
.err { color: #B22; font-weight: 700; font-size: 13.5px; }
.hp { position: absolute; left: -9999px; }
.done { text-align: center; padding: 30px 10px; }
.done .big { font-size: 60px; }
.done h2 { font: 800 24px var(--head); }

/* finder */
.seg3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 8px 0 12px; }
.seg3 button { padding: 10px 6px; border-radius: 12px; background: var(--card); font-weight: 700; font-size: 14px; border: 1.5px solid var(--line); }
.seg3 button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.grid-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.pick { text-align: left; padding: 12px; border-radius: 14px; background: var(--card); border: 1.5px solid var(--line); font-weight: 700; display: flex; gap: 8px; align-items: center; }
.pick span { font-size: 22px; }
.pick.on { border-color: var(--ink); background: #2E1A17; color: #fff; }
.note-group { margin: 10px 0; }
.note-group h5 { margin: 0 0 6px; font: 700 13px var(--head); color: var(--muted); }
.note-group .notes .chip { flex: none; }
.results { margin-top: 18px; }
.res-item .why { font-size: 12px; color: var(--ok); font-weight: 700; }
.res-item .fmts { font-size: 12px; color: var(--muted); }

.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 10px 16px 30px; }

@media (min-width: 720px) {
  body { font-size: 16px; }
  .tabs { justify-content: center; top: 64px; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .tile { min-height: 170px; }
  .list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards { grid-template-columns: repeat(4, 1fr); }
  .grid-pick { grid-template-columns: repeat(4, 1fr); }
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; transform: translate(-50%, -50%); width: min(620px, 94vw); max-height: 88vh; border-radius: 22px; animation: none; }
  .sheet .grab { display: none; }
  .how ol { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1000px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } .list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* gate */
.gate { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: grid; place-items: center; padding: 24px; }
.gate-box { text-align: center; width: min(360px, 100%); }
.gate-logo { font: 800 40px var(--head); margin-bottom: 14px; }
.gate-q { color: var(--muted); margin: 0 0 22px; }
.gate button { display: block; width: 100%; padding: 18px; margin: 10px 0; border-radius: 16px; background: var(--card); font: 800 20px var(--head); box-shadow: var(--shadow); border: 1.5px solid var(--line); }
.gate button:active { background: var(--ink); color: #fff; }

.more { border-style: dashed; color: var(--muted); }
.tag.left { background: #FFE9C7; color: #8A4B00; }
.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 12px; font-weight: 700; font-size: 14px; z-index: 120; opacity: 0; pointer-events: none; transition: .2s; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* чипсы: на телефоне свайп с подсказкой-градиентом, на компьютере переносятся на новую строку */
.chips { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); padding-right: 24px; }
@media (min-width: 720px) { .chips { flex-wrap: wrap; overflow: visible; -webkit-mask-image: none; mask-image: none; padding-right: 0; } }
.tile .emoji { display: none; }
