/* ============================================================
   ATuttoVino — Design System
   Tokens from design_handoff_atuttovino/tokens.css
   ============================================================ */

:root {
  --bg:        #FAF8F5;
  --surface:   #FFFFFF;
  --sidebar:   #F3F0EA;
  --ink:       #1B1918;
  --ink-2:     #3B3836;
  --muted:     #807A74;
  --muted-2:   #B8B2AB;
  --line:      #E6E1D8;
  --line-2:    #EFEAE1;
  --accent:    #D62828;
  --accent-ink:#A71D1D;
  --success:   #3F8F3F;
  --error-bg:  #FBEAEA;
  --error-bd:  #F3C8C8;

  --font-display: "DM Serif Display", Georgia, serif;
  --font-ui:      "DM Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;

  --r-sm:   10px;
  --r-md:   14px;
  --r-lg:   22px;
  --r-pill: 999px;

  --shadow-soft:  0 10px 30px -18px rgba(0,0,0,.18);
  --shadow-modal: 0 40px 100px -20px rgba(0,0,0,.45);

  --ease-soft: cubic-bezier(.2,.9,.3,1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%;
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; color: inherit; }
a { text-decoration: none; color: inherit; }

.tool-btns-hidden {
  display: none !important;
}

.tool-btn-hidden {
  display: none !important;
}

/* ── Shared utilities ────────────────────────────────────────── */
.dot {
  display: inline-block;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
  transform: translateY(-8px);
  margin-left: 2px;
}
.kicker {
  font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted);
}
.accent-word { color: var(--accent); font-style: italic; }

/* ── Age Gate ────────────────────────────────────────────────── */
.ag-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(27,25,24,0.72);
  backdrop-filter: blur(18px) saturate(1.05);
  -webkit-backdrop-filter: blur(18px) saturate(1.05);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  overflow-y: auto;
  animation: agFade 350ms ease;
}
@keyframes agFade { from { opacity:0; } to { opacity:1; } }

.ag-modal {
  width: 100%; max-width: 560px;
  background: var(--surface);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-modal);
  animation: agPop 450ms var(--ease-soft);
}
@keyframes agPop {
  from { opacity:0; transform: translateY(14px) scale(.97); }
  to   { opacity:1; transform: none; }
}

.ag-top {
  padding: 42px 36px 24px;
  background:
    radial-gradient(ellipse at 50% 120%, rgba(214,40,40,0.12) 0%, transparent 60%),
    linear-gradient(180deg, #FAF8F5 0%, #F5F1EA 100%);
  text-align: center;
  border-bottom: 1px solid var(--line);
}
.ag-logo {
  width: 90px; height: auto;
  display: block; margin: 0 auto;
}
.ag-tagline {
  margin-top: 14px;
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.32em; text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.ag-tagline::before,
.ag-tagline::after {
  content: ""; width: 28px; height: 1px; background: var(--line);
}

.ag-body { padding: 36px 36px 28px; }
.ag-body h1 {
  font-family: var(--font-display); font-weight: 400;
  font-size: 38px; line-height: 1.05; letter-spacing: -0.02em;
  text-align: center; margin: 0 0 12px;
}
.ag-body h1 em { font-style: italic; color: var(--accent); }
.ag-lead {
  text-align: center;
  font-size: 14px; line-height: 1.6; color: var(--muted);
  max-width: 400px; margin: 0 auto 24px;
}

/* DOB */
.dob-label {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em;
  color: var(--muted); text-transform: uppercase;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-bottom: 10px;
}
.dob-label::before {
  content: ""; width: 5px; height: 5px;
  border-radius: 50%; background: var(--accent);
}
.dob-grid {
  display: flex; align-items: flex-end; justify-content: center;
  gap: 4px; margin-bottom: 8px;
}
.dob-grid input {
  text-align: center;
  font-family: var(--font-display); font-size: 30px; letter-spacing: -0.01em;
  padding: 10px 0 8px;
  background: transparent; border: none;
  border-bottom: 1.5px solid var(--line);
  outline: none;
  transition: border-color .15s;
  color: var(--ink);
}
.dob-grid input:focus { border-bottom-color: var(--accent); }
.dob-grid input.error { border-bottom-color: var(--accent); color: var(--accent); }
.dob-grid input::placeholder { color: var(--muted-2); }
#dob-day, #dob-month { width: 72px; }
#dob-year { width: 104px; }
.dob-sep {
  font-family: var(--font-display); font-size: 26px;
  color: var(--muted-2); padding-bottom: 10px;
}
.dob-caps {
  display: flex; justify-content: center; gap: 16px;
  font-family: var(--font-mono); font-size: 9.5px;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 22px;
}
.dob-caps span:nth-child(1) { width: 72px; text-align: center; }
.dob-caps span:nth-child(2) { width: 72px; text-align: center; }
.dob-caps span:nth-child(3) { width: 104px; text-align: center; }

.ag-error {
  background: var(--error-bg); border: 1px solid var(--error-bd);
  border-radius: var(--r-sm); padding: 10px 14px;
  font-size: 13px; color: var(--accent); text-align: center;
  margin-bottom: 16px;
  animation: shake .35s ease;
}
@keyframes shake {
  0%,100% { transform: none; }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.ag-remember {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 13px; color: var(--ink-2);
  margin-bottom: 20px;
  user-select: none; cursor: pointer;
}
.ag-check-box {
  width: 18px; height: 18px;
  border: 1.5px solid var(--muted-2);
  border-radius: 5px; display: grid; place-items: center;
  transition: all .15s;
  flex-shrink: 0;
}
.ag-remember.on .ag-check-box { background: var(--ink); border-color: var(--ink); }
.ag-check-icon { opacity: 0; transform: scale(.6); transition: all .15s; color: #fff; }
.ag-remember.on .ag-check-icon { opacity: 1; transform: scale(1); }

.ag-cta {
  width: 100%; padding: 16px;
  background: var(--ink); color: var(--bg);
  border-radius: 13px;
  font-size: 15px; font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: background .15s, transform .1s;
}
.ag-cta:hover { background: #000; }
.ag-cta:active { transform: translateY(1px); }
.ag-cta:disabled { opacity:.4; cursor:not-allowed; }
.ag-cta-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

.ag-leave {
  display: block; width: 100%;
  text-align: center; color: var(--muted);
  font-size: 13px; padding: 12px;
  margin-top: 4px;
}
.ag-leave:hover { color: var(--ink-2); text-decoration: underline; }

.ag-foot {
  padding: 14px 36px 20px;
  border-top: 1px solid var(--line);
  background: #FBFAF7;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.ag-disclaimer {
  font-family: var(--font-mono); font-size: 9.5px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
  flex: 1;
}
.ag-links {
  display: flex; gap: 12px;
  font-family: var(--font-mono); font-size: 9.5px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.ag-links a:hover { color: var(--ink); }

/* AG success */
.ag-success {
  text-align: center; padding: 24px 0 12px;
  animation: agFade .4s ease;
}
.ag-success-ring {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--accent); display: grid; place-items: center;
  color: #fff; margin: 0 auto 16px;
  animation: agPop .5s var(--ease-soft);
}
.ag-success h2 {
  font-family: var(--font-display); font-weight: 400;
  font-size: 26px; margin: 0 0 6px; letter-spacing: -0.01em;
}
.ag-success p { color: var(--muted); font-size: 13.5px; margin: 0; }

/* ── App shell ───────────────────────────────────────────────── */
#app {
  display: grid;
  grid-template-columns: 288px 1fr;
  height: 100vh; width: 100vw;
  overflow: hidden;
}
#app.sidebar-collapsed { grid-template-columns: 64px 1fr; }

.sidebar-overlay { display: none; position: fixed; }

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  min-height: 0; overflow: hidden;
  transition: width 200ms ease;
}
.sidebar-brand {
  padding: 16px 18px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.sidebar-logo {
  width: 32px; height: auto; flex-shrink: 0;
}
.sidebar-name {
  font-family: var(--font-display); font-size: 16px;
  letter-spacing: -0.01em; line-height: 1.1;
}
.sidebar-tag {
  font-family: var(--font-mono); font-size: 9.5px;
  letter-spacing: 0.14em; color: var(--muted); text-transform: uppercase;
  margin-top: 1px;
}

.sidebar-inner {
  padding: 12px 10px 8px;
  display: flex; flex-direction: column; gap: 8px;
  flex: 1; min-height: 0; overflow: hidden;
}
.new-chat-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  font-size: 14px; font-weight: 500;
  background: var(--sidebar);
  transition: border-color .15s, transform .12s;
  flex-shrink: 0;
}
.new-chat-btn:hover { border-color: var(--ink-2); transform: translateY(-1px); }
.new-chat-plus {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
  font-size: 14px; line-height: 1; flex-shrink: 0;
}
.sidebar-search {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  color: var(--muted); font-size: 13px;
  flex-shrink: 0;
}
.sidebar-search input {
  flex: 1; border: none; outline: none;
  background: transparent; font-size: 13px; color: var(--ink);
}
.sidebar-section-label {
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted);
  padding: 8px 8px 4px;
  flex-shrink: 0;
}
.conv-list {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 1px;
}
.conv-list::-webkit-scrollbar { width: 4px; }
.conv-list::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.conv-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 9px;
  cursor: pointer; font-size: 13.5px; color: var(--ink-2);
  transition: background .12s;
}
.conv-row:hover { background: rgba(0,0,0,.035); }
.conv-row.active {
  background: var(--surface); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}
.conv-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted-2); flex-shrink: 0;
}
.conv-row.active .conv-dot { background: var(--accent); }
.conv-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-time {
  font-size: 10.5px; color: var(--muted);
  font-family: var(--font-mono); flex-shrink: 0;
}
.sidebar-footer {
  border-top: 1px solid var(--line);
  padding: 10px 12px;
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--ink); color: #FAF8F5;
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: 13px;
  flex-shrink: 0;
}
.user-avatar.guest {
  background: var(--line-2);
  color: var(--ink);
  border: 1px solid var(--line);
}
.user-meta { line-height: 1.2; flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 500; }
.user-sub { font-size: 11px; color: var(--muted); font-family: var(--font-mono); }
.user-entry-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 52px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
  transition: background .12s, border-color .12s, color .12s;
}
.user-entry-btn:hover {
  background: var(--line-2);
  border-color: var(--ink);
  color: var(--ink);
}
.icon-btn {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center; color: var(--muted);
  transition: background .12s, color .12s;
}
.icon-btn:hover { background: rgba(0,0,0,.05); color: var(--ink); }

/* collapsed sidebar hides text */
#app.sidebar-collapsed .sidebar-name,
#app.sidebar-collapsed .sidebar-tag,
#app.sidebar-collapsed .new-chat-btn span:not(.new-chat-plus),
#app.sidebar-collapsed .sidebar-search,
#app.sidebar-collapsed .sidebar-section-label,
#app.sidebar-collapsed .conv-list,
#app.sidebar-collapsed .user-avatar,
#app.sidebar-collapsed .user-meta,
#app.sidebar-collapsed .user-entry-btn { display: none; }
#app.sidebar-collapsed .sidebar-brand { justify-content: center; padding: 18px 0; }
#app.sidebar-collapsed .sidebar-inner { padding: 12px 0; align-items: center; }
#app.sidebar-collapsed .new-chat-btn { padding: 10px; justify-content: center; width: 44px; }
#app.sidebar-collapsed .sidebar-footer { justify-content: center; padding: 10px 0; }

/* collapse button */
.collapse-btn {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: grid; place-items: center; color: var(--muted);
  transition: background .12s, color .12s;
}
.collapse-btn:hover { background: var(--line-2); color: var(--ink); }

/* ── Main pane ───────────────────────────────────────────────── */
.main {
  display: flex; flex-direction: column;
  min-width: 0; min-height: 0;
  background: var(--bg);
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  flex-shrink: 0; z-index: 2;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 6px; }
.mobile-auth-btn {
  display: none;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.mobile-auth-btn:hover { background: var(--line-2); color: var(--ink); }
.toggle-sidebar-btn {
  width: 36px; height: 36px; border-radius: 9px;
  display: none; place-items: center; color: var(--muted);
  transition: background .12s; flex-shrink: 0;
}
.toggle-sidebar-btn:hover { background: var(--line-2); color: var(--ink); }
.ghost-btn {
  padding: 6px 12px; border-radius: 9px;
  font-size: 13px; color: var(--ink-2);
  transition: background .12s;
}
.ghost-btn:hover { background: var(--line-2); }
.primary-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 30px -18px rgba(0,0,0,.26);
  transition: background .12s ease, transform .12s ease;
}
.primary-btn:hover {
  background: #2a2624;
  transform: translateY(-1px);
}

/* model pill in topbar */
.model-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 8px;
  border: 1px solid var(--line); border-radius: 999px;
  font-size: 13px; background: var(--surface); color: var(--ink);
  cursor: default; user-select: none;
}
.model-chip {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--ink); position: relative; flex-shrink: 0;
}
.model-chip::after {
  content: ""; position: absolute; right: 2px; bottom: 2px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
}
.model-caret { color: var(--muted); font-size: 10px; }
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}
.lang-toggle button {
  min-width: 34px;
  padding: 5px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.lang-toggle button.on {
  background: var(--ink);
  color: #fff;
}

/* quick chips below suggest-grid */
.quick-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center; margin-top: 20px;
  max-width: 740px;
}
.quick-chip {
  border: 1px solid var(--line); background: var(--surface);
  padding: 7px 14px; border-radius: 999px;
  font-size: 12.5px; color: var(--ink-2);
  cursor: pointer; transition: border-color .12s, color .12s;
}
.quick-chip:hover { border-color: var(--ink); color: var(--ink); }

/* ── Chat scroll area ───────────────────────────────────────── */
.chat-scroll {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column;
}
.chat-scroll::-webkit-scrollbar { width: 8px; }
.chat-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }

/* ── Empty state ────────────────────────────────────────────── */
.empty-state {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-start;
  padding: clamp(28px, 6vh, 72px) 24px 24px;
  text-align: center; min-height: 100%;
}
.empty-logo {
  width: 80px; height: auto; margin-bottom: 20px;
}
.empty-state h1 {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.02; letter-spacing: -0.02em;
  margin: 0 0 8px; max-width: 700px;
}
.empty-state h1 .accent-word { color: var(--accent); font-style: italic; }
.empty-state h1 .dot { width: 11px; height: 11px; transform: translateY(-10px); }
.empty-sub {
  color: var(--muted); font-size: 15px;
  max-width: 500px; margin: 0 0 28px; line-height: 1.55;
}
.suggest-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px; width: 100%; max-width: 740px;
}
.suggest-card {
  text-align: left; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 15px 15px 13px;
  cursor: pointer; position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 7px;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.suggest-card:hover {
  transform: translateY(-2px);
  border-color: var(--ink-2);
  box-shadow: var(--shadow-soft);
}
.suggest-card .s-tag {
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; gap: 6px;
}
.suggest-card .s-tag-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.suggest-card .s-q {
  font-family: var(--font-display); font-size: 16px;
  line-height: 1.25; letter-spacing: -0.005em; color: var(--ink);
}
.suggest-card .s-hint { font-size: 12px; color: var(--muted); }
.suggest-card::after {
  content: "→"; position: absolute; right: 13px; bottom: 9px;
  color: var(--muted-2); font-family: var(--font-mono);
  transition: transform .18s, color .18s;
}
.suggest-card:hover::after { color: var(--accent); transform: translateX(3px); }

/* ── Messages ───────────────────────────────────────────────── */
.messages {
  max-width: 760px; margin: 0 auto; width: 100%;
  padding: 28px 24px 16px;
  display: flex; flex-direction: column; gap: 22px;
}
.msg { display: flex; gap: 12px; animation: msgIn .30s ease both; }
@keyframes msgIn {
  from { opacity:0; transform: translateY(6px); }
  to   { opacity:1; transform: none; }
}
.msg-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  flex-shrink: 0; display: grid; place-items: center;
  font-family: var(--font-display); font-size: 13px;
  margin-top: 2px;
}
.msg.user .msg-avatar { background: var(--line-2); color: var(--ink-2); }
.msg.ai .msg-avatar {
  background: var(--surface); border: 1px solid var(--line);
  overflow: hidden;
}
.msg.ai .msg-avatar img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.msg-body { flex: 1; min-width: 0; }
.msg-role {
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 5px;
}
.msg-content {
  font-size: 15px; line-height: 1.65; color: var(--ink);
}
.msg.ai .msg-content h3 {
  font-family: var(--font-display); font-weight: 400;
  font-size: 19px; margin: 14px 0 6px; letter-spacing: -0.01em;
}
.msg.ai .msg-content p { margin: 0 0 10px; }
.msg.ai .msg-content p:last-child { margin-bottom: 0; }
.msg.ai .msg-content ul { padding-left: 0; list-style: none; margin: 8px 0 12px; }
.msg.ai .msg-content li { position: relative; padding-left: 18px; margin-bottom: 5px; }
.msg.ai .msg-content li::before {
  content: ""; position: absolute; left: 2px; top: 9px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}
.msg.ai .msg-content em { color: var(--ink-2); font-style: italic; }
.msg.ai .msg-content strong { font-weight: 600; }
.msg.ai .msg-content table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 10px 0 14px;
  font-size: 13px;
}
.msg.ai .msg-content th,
.msg.ai .msg-content td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

/* Wine card inside message */
.wine-card-msg {
  margin: 10px 0 4px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 14px 16px; background: var(--surface);
  display: grid; grid-template-columns: 40px 1fr auto;
  gap: 14px; align-items: center;
  text-decoration: none; color: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.wine-card-msg:hover {
  border-color: var(--ink-2);
  box-shadow: var(--shadow-soft);
}
.wine-card-bottle {
  width: 40px; height: 60px; border-radius: 4px 4px 8px 8px;
  background: linear-gradient(180deg,#3a0d0f 0%,#5c1416 45%,#2a0608 100%);
  position: relative; flex-shrink: 0;
  overflow: hidden;
}
.wine-card-bottle img {
  width: 100%; height: 100%; object-fit: cover; border-radius: inherit;
}
.wine-card-bottle::before {
  content: ""; position: absolute; left: 50%; top: -5px;
  transform: translateX(-50%);
  width: 10px; height: 8px; background: var(--ink); border-radius: 2px;
}
.wine-card-info .wc-name {
  font-family: var(--font-display); font-size: 16px;
  letter-spacing: -0.01em; line-height: 1.15;
}
.wine-card-info .wc-meta {
  font-size: 12px; color: var(--muted);
  margin-top: 2px; font-family: var(--font-mono);
  letter-spacing: 0.06em;
}
.wine-card-price {
  text-align: right; flex-shrink: 0;
}
.wine-card-price .wc-price {
  font-family: var(--font-display); font-size: 20px;
  letter-spacing: -0.01em;
}
.wine-card-price .wc-avail {
  font-size: 11px; color: var(--muted); font-family: var(--font-mono);
  letter-spacing: 0.08em; margin-top: 2px;
}
.wine-card-price .wc-avail.green { color: var(--success); }

/* Typing indicator */
.typing-dots {
  display: flex; align-items: center; gap: 5px;
  padding: 14px 16px; background: var(--surface);
  border-radius: 4px 18px 18px 18px;
  width: fit-content;
}
.typing-dots span {
  display: block; width: 5px; height: 5px;
  border-radius: 50%; background: var(--muted-2);
  animation: bounce 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: .18s; }
.typing-dots span:nth-child(3) { animation-delay: .36s; background: var(--accent); }
@keyframes bounce {
  0%,80%,100% { transform: translateY(0); opacity:.45; }
  40%          { transform: translateY(-4px); opacity:1; }
}

/* ── Composer ───────────────────────────────────────────────── */
.composer-bar {
  padding: 0 20px 18px;
  background: linear-gradient(to top, var(--bg) 70%, transparent);
  flex-shrink: 0;
}
.composer-wrap { max-width: 760px; margin: 0 auto; }
.composer {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 10px 40px -24px rgba(0,0,0,.18);
  transition: border-color .15s, box-shadow .15s;
}
.composer:focus-within {
  border-color: var(--ink-2);
  box-shadow: 0 10px 40px -20px rgba(0,0,0,.24);
}
.composer textarea {
  display: block; width: 100%;
  background: transparent; border: none; outline: none;
  font-size: 15px; font-weight: 400; color: var(--ink);
  resize: none; line-height: 1.55;
  padding: 20px 64px 20px 18px;
  min-height: 64px; max-height: 200px;
  overflow-y: auto;
}
.composer textarea::placeholder { color: var(--muted); }
.composer-row {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex; align-items: center; justify-content: flex-start;
  gap: 8px;
  padding: 0;
  pointer-events: none;
}
.tool-btns { display: flex; gap: 2px; }
.tool-btns-voice-only { display: flex; }
.tool-btns button {
  width: 32px; height: 32px; border-radius: 8px;
  color: var(--muted); display: grid; place-items: center;
  transition: background .12s, color .12s;
  pointer-events: auto;
}
.tool-btns button:hover { background: var(--line-2); color: var(--ink); }
.tool-btns button svg { display: block; }
.voice-btn.recording {
  background: rgba(214,40,40,.12);
  color: var(--accent);
}
.voice-btn.recording svg {
  animation: voicePulse 1s ease-in-out infinite;
}
.voice-btn.busy {
  opacity: .6;
  cursor: wait;
}
@keyframes voicePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}
.send-btn {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--ink); color: var(--bg);
  display: grid; place-items: center;
  transition: transform .12s, background .15s, opacity .12s;
  flex-shrink: 0;
  margin-left: 0;
  pointer-events: auto;
}
.send-btn:disabled { opacity: .35; cursor: not-allowed; }
.send-btn:not(:disabled):hover { transform: translateY(-1px); }
.send-btn.ready { background: var(--accent); }
.send-btn svg { width: 14px; height: 14px; fill: currentColor; }
.composer-hint {
  text-align: center; padding: 7px 0 0;
  font-size: 10.5px; color: var(--muted);
  font-family: var(--font-mono); letter-spacing: .12em; text-transform: uppercase;
}

/* ================================================================
   WINE DETAIL PAGE
   ================================================================ */

.wd-topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 40px;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.wd-topbar-left, .wd-topbar-right { display: flex; align-items: center; gap: 12px; }
.back-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px 7px 9px; border-radius: 10px;
  font-size: 13px; color: var(--ink-2);
  transition: background .12s;
}
.back-btn:hover { background: var(--line-2); }
.wd-brand { display: flex; align-items: center; gap: 10px; }
.wd-brand-logo { width: 22px; height: auto; }
.wd-brand-name { font-family: var(--font-display); font-size: 16px; letter-spacing: -0.01em; }
.crumbs {
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.crumbs .sep { margin: 0 6px; color: var(--muted-2); }
.wd-icon-btn {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center; color: var(--ink-2);
  transition: background .12s;
}
.wd-icon-btn:hover { background: var(--line-2); }

.wd-page {
  max-width: 1200px; margin: 0 auto;
  padding: 36px 40px 80px;
}

/* Hero 2-col */
.wd-hero {
  display: grid; grid-template-columns: 420px 1fr;
  gap: 60px; align-items: stretch;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--line);
}
.wd-info-col { display: flex; flex-direction: column; }

/* Bottle stage */
.bottle-stage {
  background:
    radial-gradient(ellipse at 50% 85%, rgba(0,0,0,.08) 0%, transparent 55%),
    linear-gradient(180deg, #F5F1EA 0%, #EDE7DB 100%);
  border-radius: 20px;
  display: grid; place-items: center;
  padding: 40px 0;
  position: relative; overflow: hidden;
  align-self: stretch;
}
.bottle-stage .bs-counter {
  position: absolute; top: 16px; right: 16px;
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.14em; color: var(--muted); text-transform: uppercase;
}
.bottle-stage .bs-wm {
  position: absolute; left: 18px; top: 18px;
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.14em; color: var(--muted); text-transform: uppercase;
  display: flex; align-items: center; gap: 6px;
}
.bottle-stage .bs-wm::before {
  content: ""; width: 5px; height: 5px;
  border-radius: 50%; background: var(--accent);
}

/* Real bottle image */
.bottle-img {
  width: 130px; height: 420px; object-fit: contain;
  filter: drop-shadow(0 24px 28px rgba(0,0,0,.20));
}

/* CSS bottle fallback */
.css-bottle {
  width: 130px; height: 440px; position: relative;
  filter: drop-shadow(0 30px 30px rgba(0,0,0,.18));
}
.css-bottle .b-cap {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 44px; height: 38px;
  background: linear-gradient(180deg,#2a1210 0%,#1a0807 100%);
  border-radius: 3px 3px 2px 2px;
}
.css-bottle .b-neck {
  position: absolute; top: 36px; left: 50%; transform: translateX(-50%);
  width: 46px; height: 110px;
  background: linear-gradient(90deg,#240809 0%,#5c1416 50%,#240809 100%);
  border-radius: 4px 4px 0 0;
}
.css-bottle .b-body {
  position: absolute; top: 140px; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg,#1a0606 0%,#4a1012 40%,#6a1820 55%,#4a1012 75%,#1a0606 100%);
  border-radius: 10px 10px 14px 14px;
}
.css-bottle .b-label {
  position: absolute; top: 210px; left: 14px; right: 14px;
  background: #FAF8F5; padding: 16px 8px 12px;
  text-align: center; border: 1px solid rgba(0,0,0,.08);
}
.css-bottle .b-label .bl-top {
  font-family: var(--font-mono); font-size: 7px;
  letter-spacing: 0.22em; color: var(--ink-2); text-transform: uppercase;
}
.css-bottle .b-label .bl-mid {
  font-family: var(--font-display); font-size: 13px; color: var(--ink);
  margin-top: 5px; line-height: 1.1;
}
.css-bottle .b-label .bl-line { height: 1px; background: var(--line); margin: 6px 12px; }
.css-bottle .b-label .bl-bot {
  font-family: var(--font-mono); font-size: 7px;
  letter-spacing: 0.18em; color: var(--muted); text-transform: uppercase;
}

/* Info column */
.wd-producer {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 6px;
}
.wd-producer::before {
  content: ""; width: 6px; height: 6px;
  border-radius: 50%; background: var(--accent);
}
.wd-wine-name {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(38px, 4.5vw, 60px); line-height: 1;
  letter-spacing: -0.025em; margin: 8px 0 4px;
}
.wd-wine-name em { font-style: italic; color: var(--accent); }
.wd-subtitle {
  font-size: 16px; color: var(--ink-2);
  font-family: var(--font-display); font-style: italic;
}

.wd-badges {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 20px 0 22px;
}
.wd-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border: 1px solid var(--line);
  border-radius: var(--r-pill); font-size: 12px; color: var(--ink-2);
  background: var(--surface);
}
.wd-badge-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--muted-2); }
.wd-badge.hot .wd-badge-dot { background: var(--accent); }

/* Stats grid */
.wd-stats {
  display: grid; grid-template-columns: repeat(4,1fr);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 16px 0; margin-bottom: 26px; gap: 0;
}
.wd-stat {
  padding: 0 14px;
  border-right: 1px solid var(--line);
}
.wd-stat:last-child { border-right: none; }
.wd-stat:first-child { padding-left: 0; }
.wd-stat .sk {
  font-family: var(--font-mono); font-size: 9.5px;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 5px;
}
.wd-stat .sv {
  font-family: var(--font-display); font-size: 22px;
  letter-spacing: -0.01em; line-height: 1.05;
}
.wd-stat .sv small {
  font-family: var(--font-ui); font-size: 12px;
  color: var(--muted); margin-left: 3px;
}

/* Purchase block */
.wd-purchase {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 20px;
  display: grid; grid-template-columns: 1fr auto;
  gap: 20px; align-items: center;
  margin-top: auto;
}
.wd-price-col .old-price {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--muted); text-decoration: line-through;
}
.wd-price-big {
  font-family: var(--font-display); font-size: 40px;
  letter-spacing: -0.02em; line-height: 1; margin: 2px 0 3px;
}
.wd-price-vat {
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.wd-stock {
  display: flex; align-items: center; gap: 7px;
  margin-top: 8px; font-size: 13px; color: var(--ink-2);
}
.wd-stock-pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
  animation: wdPulse 2s infinite;
}
@keyframes wdPulse {
  0%   { box-shadow: 0 0 0 0 rgba(63,143,63,.5); }
  70%  { box-shadow: 0 0 0 8px rgba(63,143,63,0); }
  100% { box-shadow: 0 0 0 0 rgba(63,143,63,0); }
}
.wd-buy-col { display: flex; flex-direction: column; gap: 8px; min-width: 240px; }
.wd-qty {
  display: flex; align-items: center; justify-content: space-between;
  padding: 3px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--bg);
}
.wd-qty-btn {
  width: 30px; height: 30px; border-radius: 8px;
  font-size: 18px; line-height: 1; color: var(--ink-2);
  transition: background .12s;
}
.wd-qty-btn:hover { background: var(--line-2); color: var(--ink); }
.wd-qty-val {
  font-family: var(--font-display); font-size: 18px; padding: 0 12px;
}
.wd-buy-btn {
  padding: 13px 18px; background: var(--ink); color: var(--bg);
  border-radius: 11px; font-size: 14px; font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .12s, background .12s;
}
.wd-buy-btn:hover { transform: translateY(-1px); background: #000; }
.wd-buy-btn .btn-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.wd-buy-alt {
  padding: 11px; border: 1px solid var(--line);
  border-radius: 11px; font-size: 13px; color: var(--ink-2);
  text-align: center; background: var(--surface);
  transition: border-color .12s;
}
.wd-buy-alt:hover { border-color: var(--ink); color: var(--ink); }

/* Sections */
.wd-sections { padding-top: 48px; display: grid; gap: 52px; }
.wd-section-h {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 18px;
}
.wd-section-h h2 {
  font-family: var(--font-display); font-weight: 400;
  font-size: 30px; letter-spacing: -0.015em; margin: 0;
}
.wd-kicker {
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; gap: 7px;
}
.wd-kicker::before {
  content: ""; width: 5px; height: 5px;
  border-radius: 50%; background: var(--accent);
}

/* Tasting note */
.wd-taste {
  display: grid; grid-template-columns: 1fr 1fr; gap: 36px;
}
.wd-taste-note {
  font-family: var(--font-display); font-size: 20px;
  line-height: 1.5; letter-spacing: -0.005em;
  color: var(--ink); margin: 0;
}
.wd-taste-note::first-letter {
  font-size: 58px; float: left;
  line-height: .9; padding: 4px 10px 0 0;
  color: var(--accent);
}
.wd-taste-right { display: flex; flex-direction: column; gap: 14px; }
.wd-pull {
  border-left: 2px solid var(--accent);
  padding: 2px 0 2px 16px;
  font-size: 14.5px; color: var(--ink-2); line-height: 1.6;
}
.wd-signed {
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}

/* Structure bars */
.wd-bars {
  display: grid; grid-template-columns: repeat(2,1fr);
  gap: 26px 48px;
}
.bar-row .bar-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 7px;
}
.bar-lbl {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2);
}
.bar-ends {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.1em; color: var(--muted);
}
.bar-track {
  height: 6px; border-radius: 4px;
  background: var(--line-2); overflow: hidden;
}
.bar-fill {
  height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--ink) 0%, var(--accent) 100%);
  width: 0;
  transition: width .8s ease;
}

/* Aromas */
.wd-aromas {
  display: grid; grid-template-columns: 200px 1fr;
  gap: 36px; align-items: center;
}
.aroma-wheel {
  width: 200px; height: 200px; position: relative; flex-shrink: 0;
}
.aroma-wheel svg { width: 100%; height: 100%; }
.aroma-wheel-center {
  position: absolute; inset: 0;
  display: grid; place-items: center; text-align: center;
  pointer-events: none;
}
.aroma-count {
  font-family: var(--font-display); font-size: 28px; line-height: 1;
}
.aroma-label {
  font-family: var(--font-mono); font-size: 9px;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted);
  margin-top: 2px;
}
.aroma-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.aroma-tag {
  padding: 6px 13px; border-radius: var(--r-pill);
  font-size: 13px; background: var(--surface);
  border: 1px solid var(--line);
  display: inline-flex; align-items: center; gap: 7px;
}
.aroma-tag-dot { width: 7px; height: 7px; border-radius: 50%; }

/* Pairings */
.wd-pairings {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 14px;
}
.pairing-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 18px 14px 16px;
  text-align: center; transition: border-color .15s, transform .15s;
}
.pairing-card:hover { border-color: var(--ink-2); transform: translateY(-2px); }
.pairing-icon { font-size: 28px; margin-bottom: 8px; }
.pairing-name {
  font-family: var(--font-display); font-size: 16px;
  letter-spacing: -0.005em; margin-bottom: 4px;
}
.pairing-sub { font-size: 12px; color: var(--muted); }

/* Technical facts */
.wd-tech {
  display: grid; grid-template-columns: repeat(2,1fr); gap: 0;
  border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden;
}
.tech-row {
  display: grid; grid-template-columns: 140px 1fr;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.tech-row:nth-child(odd) { background: var(--surface); }
.tech-row:nth-last-child(-n+2) { border-bottom: none; }
.tech-key {
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); align-self: center;
}
.tech-val { color: var(--ink-2); }

/* Producer card */
.wd-producer-card {
  display: grid; grid-template-columns: 200px 1fr;
  gap: 32px; align-items: start;
}
.producer-photo {
  width: 200px; height: 160px; border-radius: var(--r-md);
  background: repeating-linear-gradient(
    45deg, var(--line) 0, var(--line) 1px,
    var(--line-2) 0, var(--line-2) 8px
  );
  overflow: hidden;
}
.producer-photo img { width: 100%; height: 100%; object-fit: cover; }
.producer-name-big {
  font-family: var(--font-display); font-size: 24px;
  letter-spacing: -0.01em; margin-bottom: 10px;
}
.producer-narrative {
  font-size: 14.5px; line-height: 1.65; color: var(--ink-2);
  margin-bottom: 14px;
}
.producer-facts {
  display: flex; gap: 24px; flex-wrap: wrap;
}
.producer-fact {
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; gap: 6px;
}
.producer-fact strong { color: var(--ink); font-style: normal; }

/* Vintages rail */
.vintages-rail {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.vintage-pill {
  padding: 7px 16px;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.1em; color: var(--ink-2);
  cursor: pointer; transition: all .12s;
  text-decoration: none;
}
.vintage-pill:hover { border-color: var(--ink); color: var(--ink); }
.vintage-pill.current { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.vintage-pill.sold-out { opacity: .4; cursor: default; }

/* Ask-AI banner */
.ask-ai-banner {
  background: var(--ink); border-radius: 18px;
  padding: 36px 40px;
  display: grid; grid-template-columns: 1fr auto;
  gap: 32px; align-items: center;
}
.aab-text .aab-kicker {
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(255,255,255,.45); margin-bottom: 10px;
}
.aab-text h3 {
  font-family: var(--font-display); font-weight: 400;
  font-size: 26px; letter-spacing: -0.015em;
  color: var(--bg); margin: 0 0 8px;
}
.aab-text p {
  font-size: 14px; color: rgba(255,255,255,.55); margin: 0;
}
.aab-btn {
  padding: 13px 22px;
  background: rgba(255,255,255,.1); color: var(--bg);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 12px; font-size: 14px; font-weight: 500;
  white-space: nowrap;
  display: flex; align-items: center; gap: 8px;
  transition: background .15s;
}
.aab-btn:hover { background: rgba(255,255,255,.18); }

/* Related wines */
.related-wines {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 16px;
}
.related-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); overflow: hidden;
  text-decoration: none; color: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.related-card:hover {
  border-color: var(--ink-2); box-shadow: var(--shadow-soft);
}
.rc-stage {
  height: 120px; background: linear-gradient(180deg,#F5F1EA 0%,#EDE7DB 100%);
  display: grid; place-items: center;
  overflow: hidden;
}
.rc-stage img { height: 100px; width: auto; object-fit: contain; }
.rc-body { padding: 14px; }
.rc-producer {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 4px;
}
.rc-name {
  font-family: var(--font-display); font-size: 16px;
  letter-spacing: -0.01em; margin-bottom: 4px;
}
.rc-type { font-size: 12px; color: var(--muted); }
.rc-price {
  font-family: var(--font-display); font-size: 16px;
  letter-spacing: -0.01em; margin-top: 8px;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  #app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: 280px; z-index: 100;
    transform: translateX(-100%);
    transition: transform 260ms ease;
    box-shadow: 4px 0 20px rgba(0,0,0,.12);
  }
  .sidebar.open { transform: none; }
  .sidebar-overlay {
    position: fixed; inset: 0; z-index: 99;
    background: rgba(0,0,0,.35);
    display: none;
  }
  .sidebar-overlay.open { display: block; }
  .toggle-sidebar-btn { display: grid; }
  .topbar { padding: 12px 18px; }
  .topbar-right .ghost-btn,
  .topbar-right .primary-btn { display: none; }
  .mobile-auth-btn { display: inline-flex; align-items: center; justify-content: center; }
  .lang-toggle { margin-left: auto; }
}
@media (max-width: 680px) {
  .empty-state { padding-top: 18px; }
  .empty-logo { width: 56px; margin-bottom: 12px; }
  .empty-state h1 { font-size: 40px; line-height: .95; }
  .empty-state h1 .dot { width: 9px; height: 9px; transform: translateY(-7px); }
  .empty-sub { font-size: 14px; margin-bottom: 18px; }
  .chat-scroll { padding: 18px 14px 22px; }
  .messages,
  .suggest-grid { max-width: 100%; }
  .msg { gap: 10px; }
  .msg-avatar { width: 28px; height: 28px; }
  .msg-content { font-size: 14px; line-height: 1.58; }
  .msg.ai .msg-content table { font-size: 12px; }
  .composer-bar { padding: 0 12px calc(10px + env(safe-area-inset-bottom)); }
  .composer-wrap { max-width: 100%; }
  .composer textarea {
    min-height: 52px;
    padding: 16px 58px 16px 14px;
    font-size: 14px;
    line-height: 1.45;
  }
  .composer-row { right: 10px; gap: 6px; }
  .tool-btns button { width: 30px; height: 30px; }
  .send-btn { width: 32px; height: 32px; border-radius: 9px; }
  .composer-hint { display: none; }
  .sidebar-footer { display: none; }
  .topbar { padding: 10px 12px; }
  .model-pill span:nth-child(2) { max-width: 96px; }
  .mobile-auth-btn { padding: 5px 10px; font-size: 11px; }
  .suggest-grid { grid-template-columns: 1fr; }
  .ag-foot { flex-direction: column; align-items: flex-start; gap: 8px; }
  .ag-modal .ag-top { padding: 28px 20px 18px; }
  .ag-body { padding: 26px 22px 22px; }
  .ag-body h1 { font-size: 30px; }
  .dob-grid input { font-size: 26px; }
  #dob-day, #dob-month { width: 60px; }
  #dob-year { width: 88px; }

  .wd-hero { grid-template-columns: 1fr; gap: 0; }
  .bottle-stage { min-height: 300px; border-radius: 16px 16px 0 0; }
  .wd-info-col { border-radius: 0 0 16px 16px; }
  .wd-page { padding: 20px 20px 60px; }
  .wd-topbar { padding: 12px 20px; }
  .wd-stats { grid-template-columns: repeat(2,1fr); }
  .wd-purchase { grid-template-columns: 1fr; }
  .wd-buy-col { min-width: unset; }
  .wd-taste { grid-template-columns: 1fr; }
  .wd-aromas { grid-template-columns: 1fr; }
  .aroma-wheel { margin: 0 auto; }
  .wd-bars { grid-template-columns: 1fr; }
  .wd-pairings { grid-template-columns: repeat(2,1fr); }
  .wd-tech { grid-template-columns: 1fr; }
  .wd-producer-card { grid-template-columns: 1fr; }
  .ask-ai-banner { grid-template-columns: 1fr; padding: 24px; }
  .related-wines { grid-template-columns: 1fr; }
  .topbar-left { gap: 10px; min-width: 0; }
  .model-pill { padding: 6px 10px 6px 8px; }
  .model-pill span:nth-child(2) {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .lang-toggle button {
    min-width: 30px;
    padding: 5px 8px;
  }
}
@media (max-height: 760px) {
  .ag-top { padding: 24px 32px 14px; }
  .ag-logo { width: 70px; }
  .ag-body h1 { font-size: 32px; }
  .ag-body { padding: 22px 32px 20px; }
}
