/* ScentWise — design system
   One family, warm neutrals, one accent, a colour per scent family.
   Every text/background pair below is ≥ 4.5:1 in both appearances. */

:root {
  /* White, beige and gold: cream ground, white cards, gold for actions and selected states. */
  --bg: #f7f1e6;
  --bg2: #efe6d6;
  --surface: #ffffff;
  --line: rgba(120, 95, 40, .12);
  --line2: rgba(120, 95, 40, .26);
  --fg: #2a2218;
  --fg2: #5b5040;
  --fg3: #6e6350;
  --accent: #7f6226;
  --accent-soft: rgba(201, 169, 110, .18);
  --gold: #c9a96e;
  --gold-dark: #a78747;
  --glass: rgba(247, 241, 230, .74);
  --btn: linear-gradient(135deg, #c9a96e, #a78747);
  --btn-fg: #1a1410;
  --band: #2a2218;
  --band-fg: #f7f1e6;
  --band-fg2: #c8bfae;
  --danger: #a3372f;
  --ok: #3c6238;
  --shadow: 0 18px 50px rgba(74, 56, 24, .16);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Instrument Sans", "Helvetica Neue", sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Instrument Sans", "Helvetica Neue", sans-serif;
  --r-sm: 12px;
  --r: 20px;
  --r-lg: 28px;
  --nav-h: 56px;
  --tab-h: calc(49px + env(safe-area-inset-bottom, 0px));
  --gutter: 80px;
  --max: 1440px;
  /* scent families: tile + ink */
  --f-fresh: #dfeef2;    --f-fresh-ink: #2b5f6e;
  --f-citrus: #f3efc4;   --f-citrus-ink: #6b6417;
  --f-floral: #f7e1e4;   --f-floral-ink: #8a3b4a;
  --f-woody: #ebdcc8;    --f-woody-ink: #6b4a2a;
  --f-amber: #e7d8ec;    --f-amber-ink: #5a3a6e;
  --f-green: #dfeadb;    --f-green-ink: #3c6238;
  --f-gourmand: #f1e0d0; --f-gourmand-ink: #7a4a2b;
  --f-other: #f3f1ec;    --f-other-ink: #5b574f;
  color-scheme: light;
}
/* Dark palette: opt-in only via <html data-theme="dark">. The site renders light by default. */
:root[data-theme="dark"] {
    --bg: #0e0d0b;
    --bg2: #1a1917;
    --surface: #161513;
    --line: rgba(255, 255, 255, .1);
    --line2: rgba(255, 255, 255, .22);
    --fg: #f4f2ed;
    --fg2: #a9a49b;
    --fg3: #8f8a82;
    --accent: #d8b978;
    --accent-soft: rgba(216, 185, 120, .14);
    --glass: rgba(14, 13, 11, .72);
    --btn: #f4f2ed;
    --btn-fg: #1d1b18;
    --band: #1a1917;
    --shadow: 0 18px 50px rgba(0, 0, 0, .5);
    --danger: #e08a82;
    --ok: #a4c9a0;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
}
h1, h2, h3, h4, p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--fg); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a, button, summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
input, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
svg { flex-shrink: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::selection { background: var(--accent-soft); }

/* ---------- type ---------- */
.t-display { font-family: var(--font-display); font-size: clamp(40px, 6vw, 80px); line-height: 1.05; letter-spacing: -.03em; font-weight: 700; }
.t-1 { font-family: var(--font-display); font-size: clamp(34px, 4.2vw, 56px); line-height: 1.08; letter-spacing: -.025em; font-weight: 700; }
.t-2 { font-family: var(--font-display); font-size: clamp(28px, 3vw, 40px); line-height: 1.12; letter-spacing: -.02em; font-weight: 700; }
.t-3 { font-family: var(--font-display); font-size: clamp(22px, 2vw, 28px); line-height: 1.2; letter-spacing: -.015em; font-weight: 600; }
.t-4 { font-size: 24px; line-height: 1.2; letter-spacing: -.015em; font-weight: 600; }
.t-head { font-size: 21px; line-height: 1.35; font-weight: 600; }
.t-body { font-size: 17px; line-height: 1.5; }
.t-call { font-size: 15px; line-height: 1.45; }
.t-foot { font-size: 13px; line-height: 1.4; font-weight: 500; }
.t-cap { font-size: 12px; line-height: 1.4; font-weight: 500; }
.muted { color: var(--fg2); }
.muted-2 { color: var(--fg3); }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--fg3); }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.section { padding: 112px 0; }
.section-tight { padding: 64px 0; }
.view { display: none; min-height: 60vh; }
.view.is-active { display: block; }
main { padding-top: var(--nav-h); }

/* ---------- glass navigation ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  height: var(--nav-h);
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 17px; font-weight: 700; letter-spacing: -.01em; color: var(--fg); }
.brand-dot { width: 10px; height: 10px; border-radius: 999px; background: var(--gold); }
.nav-links { display: flex; gap: 32px; font-size: 14px; font-weight: 500; color: var(--fg2); }
.nav-links a { color: var(--fg2); padding: 8px 0; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--fg); font-weight: 600; }
.nav-actions { display: flex; align-items: center; gap: 8px; }

.tabbar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: var(--tab-h);
  padding: 6px 8px env(safe-area-inset-bottom, 0px);
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--line);
  justify-content: space-around; align-items: flex-start;
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 64px; min-height: 44px; font-size: 12px; font-weight: 500; color: var(--fg2); }
.tab[aria-current="page"] { color: var(--accent); font-weight: 600; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 22px; border-radius: 999px; font-size: 15px; font-weight: 600; white-space: nowrap; transition: transform .15s ease, opacity .15s ease, background .15s ease; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--btn); color: var(--btn-fg); }
.btn-primary:hover { opacity: .92; color: var(--btn-fg); box-shadow: 0 8px 24px rgba(201, 169, 110, .35); }
.btn-quiet { background: transparent; color: var(--fg); border: 1px solid var(--line2); }
.btn-quiet:hover { background: var(--bg2); }
.btn-text { color: var(--accent); padding: 0 12px; }
.btn-text:hover { color: var(--fg); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; }
.btn-md { height: 40px; padding: 0 18px; font-size: 14px; }
.btn-lg { height: 52px; padding: 0 26px; font-size: 16px; }
.btn-inverse { background: var(--band-fg); color: var(--band); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 44px; height: 44px; border-radius: 999px; color: var(--fg); }
.icon-btn:hover { background: var(--bg2); }
.icon-btn.sm { width: 36px; height: 36px; }
.icon-btn.glass { background: var(--glass); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1); padding: 2px var(--gutter); }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; background: var(--bg2); color: var(--fg); font-size: 14px; font-weight: 500; white-space: nowrap; flex-shrink: 0; }
.chip:hover { background: var(--line); }
.chip[aria-pressed="true"], .chip.is-on { background: var(--btn); color: var(--btn-fg); }
.chip .dot { width: 10px; height: 10px; border-radius: 999px; }
.chip.ghost { background: transparent; border: 1px solid var(--line2); }
.chip.ghost[aria-pressed="true"], .chip.ghost.is-on { background: var(--btn); color: var(--btn-fg); border-color: transparent; }

.field { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 8px 0 20px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line2); }
.field:focus-within { border-color: var(--fg3); }
.field input { flex: 1; min-width: 0; height: 100%; background: transparent; border: 0; outline: 0; font-size: 17px; }
.field input::placeholder { color: var(--fg3); }
.field.lg { height: 64px; padding-left: 24px; }
.field.sm { height: 44px; padding-left: 16px; }
.field .btn { flex-shrink: 0; }

.progress { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 999px; background: var(--gold); transition: width .3s ease; }

.badge { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; background: var(--bg2); color: var(--fg2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge svg { color: var(--accent); }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; min-height: 240px; text-align: left; transition: transform .2s ease, border-color .2s ease; }
.tile:hover { transform: translateY(-2px); border-color: var(--line2); }
.tile .ico { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 999px; background: var(--bg2); color: var(--fg); }
.tile.wide { grid-column: span 2; }

.pcard { display: flex; flex-direction: column; gap: 12px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); text-align: left; transition: transform .2s ease, border-color .2s ease; }
.pcard:hover { transform: translateY(-2px); border-color: var(--line2); }
.pcard .art { position: relative; display: flex; align-items: center; justify-content: center; height: 200px; border-radius: 14px; overflow: hidden; }
.pcard .art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pcard .meta { display: flex; flex-direction: column; gap: 4px; padding: 0 6px; min-width: 0; }
.pcard .name { font-size: 17px; font-weight: 600; line-height: 1.3; }
.pcard .brand { font-size: 14px; color: var(--fg2); }
.pcard .notes { font-size: 13px; color: var(--fg3); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard .foot { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 6px; }
.pcard .fam { font-size: 12px; font-weight: 600; }
.pcard .heart { position: absolute; z-index: 1; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 999px; background: rgba(255,255,255,.72); color: #1d1b18; display: flex; align-items: center; justify-content: center; }
.pcard .heart.is-on { color: var(--danger); }

.bottle { display: block; }

/* scent-family fills */
.fam-fresh { background: var(--f-fresh); color: var(--f-fresh-ink); }
.fam-citrus { background: var(--f-citrus); color: var(--f-citrus-ink); }
.fam-floral { background: var(--f-floral); color: var(--f-floral-ink); }
.fam-woody { background: var(--f-woody); color: var(--f-woody-ink); }
.fam-amber { background: var(--f-amber); color: var(--f-amber-ink); }
.fam-green { background: var(--f-green); color: var(--f-green-ink); }
.fam-gourmand { background: var(--f-gourmand); color: var(--f-gourmand-ink); }
.fam-other { background: var(--f-other); color: var(--f-other-ink); }
.ink-fresh { color: var(--f-fresh-ink); } .ink-citrus { color: var(--f-citrus-ink); } .ink-floral { color: var(--f-floral-ink); } .ink-woody { color: var(--f-woody-ink); }
.ink-amber { color: var(--f-amber-ink); } .ink-green { color: var(--f-green-ink); } .ink-gourmand { color: var(--f-gourmand-ink); } .ink-other { color: var(--f-other-ink); }
html[data-theme="dark"] .ink-fresh { color: #8fc0cf; } html[data-theme="dark"] .ink-citrus { color: #d9d27a; } html[data-theme="dark"] .ink-floral { color: #e9a3b0; } html[data-theme="dark"] .ink-woody { color: #d9b58c; }
html[data-theme="dark"] .ink-amber { color: #c9a6d8; } html[data-theme="dark"] .ink-green { color: #a4c9a0; } html[data-theme="dark"] .ink-gourmand { color: #dcb08d; } html[data-theme="dark"] .ink-other { color: #a9a49b; }

/* skeletons */
.skel { position: relative; overflow: hidden; background: var(--bg2); border-radius: 12px; }
.skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); animation: shimmer 1.4s infinite; }
html[data-theme="dark"] .skel::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent); }
@keyframes shimmer { to { transform: translateX(100%); } }

/* ---------- home ---------- */
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 24px; padding: 128px 0 104px; background: radial-gradient(ellipse at 50% -10%, rgba(201, 169, 110, .26), transparent 62%); }
.hero .t-display { max-width: 960px; }
.hero .lead { max-width: 640px; font-size: 21px; line-height: 1.4; color: var(--fg2); }
.hero .field { width: 100%; max-width: 760px; margin-top: 8px; }
.band { margin: 0 var(--gutter); border-radius: 36px; background: var(--band); color: var(--band-fg); padding: 80px; display: flex; flex-direction: column; gap: 56px; }
.band .muted { color: var(--band-fg2); }
.band .btn-quiet { color: var(--band-fg); border-color: rgba(255,255,255,.22); }
.band .btn-quiet:hover { background: rgba(255,255,255,.06); }
.band .pcard { background: #3a2f22; border-color: rgba(255,255,255,.12); color: var(--band-fg); }
.band .pcard .brand { color: var(--band-fg2); }
.band .pcard .notes { color: #b3a892; }
.band .pcard .btn-quiet { color: var(--band-fg); border-color: rgba(255,255,255,.22); }
.stat { display: flex; flex-direction: column; gap: 6px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.12); }
.stat b { font-family: var(--font-display); font-size: clamp(40px, 4vw, 56px); line-height: 1.05; letter-spacing: -.025em; font-weight: 700; }
.step { display: flex; flex-direction: column; gap: 12px; padding-top: 24px; border-top: 1px solid var(--line); }
.notice { display: flex; align-items: flex-start; gap: 16px; padding: 20px 24px; border-radius: var(--r); background: var(--bg2); max-width: 760px; }
.notice .ico { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 36px; height: 36px; border-radius: 999px; background: var(--surface); color: var(--accent); }

.price { display: flex; flex-direction: column; gap: 28px; padding: 36px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.price.featured { background: var(--btn); color: var(--btn-fg); border-color: transparent; }
.price .amount { font-family: var(--font-display); font-size: 48px; line-height: 1; letter-spacing: -.025em; font-weight: 700; }
.price ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; font-size: 15px; line-height: 1.45; }
.price li { display: flex; gap: 10px; align-items: flex-start; }
.price li svg { color: var(--accent); margin-top: 2px; }
.price.featured li svg { color: currentColor; }
.price.featured ul { opacity: .88; }
.price .btn { margin-top: auto; }

/* ---------- explore ---------- */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.results-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.empty { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 40px 0; color: var(--fg2); }

/* ---------- detail sheet ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(14, 13, 11, .45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 24px; }
.sheet { position: relative; width: 100%; max-width: 900px; max-height: min(88vh, 900px); display: grid; grid-template-columns: 360px minmax(0, 1fr); background: var(--surface); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.sheet .hero-art { position: relative; display: flex; align-items: center; justify-content: center; min-height: 360px; overflow: hidden; }
.sheet .hero-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sheet .body { display: flex; flex-direction: column; gap: 24px; padding: 32px; overflow-y: auto; }
.sheet .close { position: absolute; top: 12px; right: 12px; z-index: 2; }
.sheet .heart { position: absolute; top: 12px; left: 12px; z-index: 2; }
.notes-table { display: flex; flex-direction: column; border-radius: var(--r); border: 1px solid var(--line); overflow: hidden; }
.notes-table > div { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 15px; }
.notes-table > div:last-child { border-bottom: 0; }
.notes-table b { flex-shrink: 0; width: 64px; font-size: 13px; font-weight: 600; color: var(--fg3); padding-top: 2px; }
.rowcard { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 12px 8px 8px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); text-align: left; width: 100%; }
.rowcard:hover { border-color: var(--line2); }
.rowcard .art { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 48px; height: 48px; border-radius: 12px; overflow: hidden; }
.rowcard .meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.rowcard .name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rowcard .brand { font-size: 13px; color: var(--fg2); }
.sheet .actions { position: sticky; bottom: 0; display: flex; gap: 8px; padding: 12px 0 0; margin-top: auto; background: var(--surface); }

/* ---------- advisor ---------- */
.advisor { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: calc(100vh - var(--nav-h)); }
.modes { display: flex; flex-direction: column; justify-content: space-between; gap: 24px; padding: 24px 16px 24px 0; border-right: 1px solid var(--line); }
.mode-list { display: flex; flex-direction: column; gap: 4px; }
.mode { display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 12px; border-radius: 14px; color: var(--fg2); font-size: 15px; font-weight: 600; text-align: left; width: 100%; }
.mode:hover { background: var(--bg2); }
.mode[aria-current="true"] { background: var(--bg2); color: var(--fg); }
.mode[aria-current="true"] svg { color: var(--accent); }
.mode svg { width: 20px; height: 20px; }
.meter { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--r); background: var(--bg2); }
.chat { display: flex; flex-direction: column; padding: 24px 0 24px 40px; min-height: 0; min-width: 0; }
.chat-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.thread { display: flex; flex-direction: column; gap: 24px; padding: 28px 0; flex: 1; }
.msg-user { align-self: flex-end; max-width: 560px; padding: 14px 18px; border-radius: 20px 20px 6px 20px; background: var(--btn); color: var(--btn-fg); font-size: 16px; line-height: 1.45; white-space: pre-wrap; }
.msg-ai { display: flex; flex-direction: column; gap: 16px; max-width: 960px; }
.msg-ai .intro { font-size: 17px; line-height: 1.5; white-space: pre-wrap; }
.msg-ai .intro p { margin: 0 0 8px; }
.recs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.rec { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.rec .art { position: relative; display: flex; align-items: center; justify-content: center; height: 130px; border-radius: 14px; overflow: hidden; }
.rec .art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.rec .head { display: flex; flex-direction: column; gap: 2px; padding: 0 6px; min-width: 0; }
.rec .meta { display: flex; flex-direction: column; gap: 6px; padding: 0 6px; }
.rec .why { font-size: 14px; line-height: 1.45; color: var(--fg2); }
.rec .notes { font-size: 13px; color: var(--fg3); }
.rec .scores { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--fg3); font-weight: 500; }
.rec .foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 0 6px 6px; margin-top: auto; }
.rec.is-locked { position: relative; }
.rec.is-locked > * { filter: blur(6px); pointer-events: none; user-select: none; }
.rec.is-locked::after { content: ""; position: absolute; inset: 0; border-radius: var(--r); }
.gate { display: flex; flex-direction: column; gap: 12px; padding: 20px 24px; border-radius: var(--r); background: var(--bg2); }
.feedback { display: flex; align-items: center; gap: 12px; }
.composer { display: flex; flex-direction: column; gap: 10px; }
/* the field grows with the text; the textarea's one-line height equals its line height so no scrollbar appears */
.composer .field { height: auto; min-height: 60px; padding: 6px 6px 6px 22px; border-radius: 30px; align-items: flex-end; }
.composer textarea { flex: 1; min-width: 0; resize: none; height: 24px; max-height: 160px; padding: 0; margin: 12px 0; background: transparent; border: 0; outline: 0; font-size: 17px; line-height: 24px; overflow-y: auto; }
.composer textarea::placeholder { color: var(--fg3); }
.send { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 48px; height: 48px; border-radius: 999px; background: var(--btn); color: var(--btn-fg); }
.send:disabled { opacity: .4; }
.dropzone { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 120px; padding: 20px; border-radius: var(--r); border: 1px dashed var(--line2); color: var(--fg2); font-size: 15px; cursor: pointer; }
.dropzone.has-image { border-style: solid; }
.dropzone img { max-height: 160px; border-radius: 12px; }
.typing { display: inline-flex; gap: 5px; padding: 14px 18px; border-radius: 20px; background: var(--bg2); }
.typing i { width: 7px; height: 7px; border-radius: 999px; background: var(--fg3); animation: bounce 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-4px); opacity: 1; } }

/* ---------- celebrities ---------- */
.celeb-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.celeb { display: flex; flex-direction: column; gap: 12px; padding: 20px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); text-align: left; }
.celeb:hover { border-color: var(--line2); }
.avatar { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 999px; background: var(--bg2); color: var(--fg2); font-size: 17px; font-weight: 700; }

/* ---------- account ---------- */
.account { max-width: 640px; display: flex; flex-direction: column; gap: 24px; }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.kv:last-child { border-bottom: 0; }
.form { display: flex; flex-direction: column; gap: 12px; }
.input { height: 48px; padding: 0 18px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line2); outline: 0; font-size: 16px; }
.input:focus { border-color: var(--fg3); }
.alert { padding: 14px 18px; border-radius: var(--r-sm); background: var(--bg2); font-size: 14px; line-height: 1.45; color: var(--fg2); }
.alert.error { color: var(--danger); }

/* ---------- compare tray + sheet, scent profile ---------- */
.tray { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--glass); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); border-top: 1px solid var(--line); }
.tray-inner { display: flex; align-items: center; gap: 12px; max-width: var(--max); margin: 0 auto; }
.tray-count, .cmp-hint { display: none; }
.section-b { padding-bottom: 120px; }
body.has-tray main { padding-bottom: 96px; }
.icon-btn.cmp.is-on, .btn.cmp.is-on { background: var(--btn); color: var(--btn-fg); border-color: transparent; }
.badge.pop { color: var(--accent); }
.cmp-sheet { grid-template-columns: 1fr; max-width: 1100px; }
.cmp-grid { display: grid; gap: 16px; }
.cmp-col { display: flex; flex-direction: column; gap: 12px; padding: 12px; border-radius: var(--r); border: 1px solid var(--line); min-width: 0; }
.cmp-row { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-top: 1px solid var(--line); }
.score { display: flex; align-items: center; gap: 10px; }

/* ---------- footer / toast / cookie ---------- */
.footer { border-top: 1px solid var(--line); padding: 40px 0 56px; margin-top: auto; }
.footer .links { display: flex; gap: 24px; flex-wrap: wrap; font-size: 14px; font-weight: 500; }
.footer .links a { color: var(--fg2); }
.toast-wrap { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { padding: 12px 18px; border-radius: 999px; background: var(--btn); color: var(--btn-fg); font-size: 14px; font-weight: 500; box-shadow: var(--shadow); animation: rise .25s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.cookie { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 70; max-width: 560px; margin: 0 auto; padding: 20px 22px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line2); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; font-size: 14px; line-height: 1.5; color: var(--fg2); }
.cookie .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cookie label { display: flex; align-items: center; gap: 10px; font-size: 13px; min-height: 32px; }
.cookie input[type="checkbox"] { accent-color: var(--accent); width: 18px; height: 18px; }

/* ---------- reveal ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(12px); transition: opacity .5s ease, transform .5s ease; }
  .reveal.in { opacity: 1; transform: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  :root { --gutter: 40px; }
  .grid-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .celeb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .band { padding: 56px; }
}
@media (max-width: 860px) {
  :root { --gutter: 20px; }
  .nav .wrap { gap: 12px; }
  .nav-links { display: none; }
  .nav-actions .icon-btn { display: none; }
  .tabbar { display: flex; }
  main { padding-bottom: calc(var(--tab-h) + 24px); }
  .section { padding: 64px 0; }
  .section-b { padding-bottom: 72px; }
  .hero { padding: 40px 0 32px; gap: 16px; align-items: flex-start; text-align: left; }
  .hero .lead { font-size: 17px; }
  .hero .field { margin-top: 4px; }
  /* the chip strip must stretch to the column, not size to its content, or it widens the page */
  #hero-chips { align-self: stretch; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1); padding: 2px var(--gutter); }
  #hero-chips::-webkit-scrollbar { display: none; }
  .grid-4, .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile.wide { grid-column: span 2; }
  .tile { min-height: 180px; padding: 20px; gap: 16px; }
  .band { margin: 0 var(--gutter); padding: 32px 24px; border-radius: 28px; gap: 32px; }
  .price { padding: 24px; }
  .celeb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* explore filters: one swipeable row each instead of three stacked rows */
  #family-chips, #gender-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1); padding: 2px var(--gutter); }
  #family-chips::-webkit-scrollbar, #gender-chips::-webkit-scrollbar { display: none; }
  /* advisor: one column, composer docked above the tab bar */
  .advisor { grid-template-columns: 1fr; min-height: 0; }
  .modes { display: none; }
  .chat { padding: 12px 0 0; min-height: calc(100vh - var(--nav-h) - var(--tab-h) - 8px); min-height: calc(100dvh - var(--nav-h) - var(--tab-h) - 8px); }
  .thread { padding: 20px 0 16px; gap: 20px; }
  .thread .chips .chip { white-space: normal; height: auto; min-height: 44px; padding: 10px 16px; text-align: left; line-height: 1.3; max-width: 100%; }
  .composer { position: sticky; bottom: calc(var(--tab-h) + 8px); z-index: 30; padding: 8px 0; background: linear-gradient(to top, var(--bg) 78%, rgba(247, 241, 230, 0)); }
  body.has-tray .composer { bottom: calc(var(--tab-h) + 76px); }
  .composer .field { min-height: 56px; padding: 4px 4px 4px 18px; border-radius: 28px; }
  .composer textarea { font-size: 16px; }
  #composer-note { font-size: 12px; padding-left: 18px; }
  .recs { grid-template-columns: minmax(0, 1fr); }
  .rec { display: grid; grid-template-columns: 64px minmax(0, 1fr); grid-template-areas: "art head" "meta meta" "foot foot"; align-items: center; gap: 10px 12px; }
  .rec .art { grid-area: art; width: 64px; height: 64px; border-radius: 12px; }
  .rec .head { grid-area: head; padding: 0; }
  .rec .meta { grid-area: meta; padding: 0; }
  .rec .foot { grid-area: foot; padding: 0; margin-top: 0; }
  .gate form .btn { flex: 1; }
  /* sheets rise from the bottom edge */
  .sheet-backdrop { align-items: flex-end; padding: 0; }
  .sheet { grid-template-columns: 1fr; max-height: 92vh; max-height: 92dvh; border-radius: 28px 28px 0 0; }
  .sheet .hero-art { min-height: 200px; }
  .sheet .body { padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0px)); }
  /* compare: columns become a swipe carousel so two bottles still sit side by side */
  .cmp-hint { display: inline; }
  .cmp-grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 20px; gap: 12px; margin: 0 -20px; padding: 4px 20px 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .cmp-grid::-webkit-scrollbar { display: none; }
  .cmp-col { flex: 0 0 min(84%, 320px); scroll-snap-align: start; }
  /* compare tray collapses to a single row */
  .tray { bottom: var(--tab-h); padding-bottom: 10px; }
  .tray .tray-chips, .tray .btn-text { display: none; }
  .tray-count { display: inline; }
  .tray-label { flex: 1; }
  body.has-tray main { padding-bottom: calc(var(--tab-h) + 100px); }
  .toast-wrap { bottom: calc(var(--tab-h) + 16px); width: calc(100% - 32px); align-items: center; }
  .cookie { bottom: calc(var(--tab-h) + 12px); padding: 16px 18px; }
  .footer { padding: 32px 0 40px; }
  .footer .links a { padding: 8px 0; }
}
@media (max-width: 480px) {
  .grid-4, .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3, #faq-list, .grid-2.pricing { grid-template-columns: 1fr; }
  .pcard .art { height: 150px; }
  .pcard .name { font-size: 15px; }
  .chip { height: 44px; }
  .pcard .btn-profile { display: none; }
  .field.lg { height: 56px; padding-left: 18px; }
  .field.lg .btn { height: 44px; padding: 0 16px; font-size: 14px; }
  .footer .links { gap: 16px; }
  .celeb-grid { grid-template-columns: 1fr; }
}
/* touch screens: no lift-on-hover, it would stick after a tap */
@media (hover: none) {
  .pcard:hover, .tile:hover { transform: none; border-color: var(--line); }
  .btn-primary:hover { box-shadow: none; opacity: 1; }
}

/* cookie banner shown via inline display:block by the consent script */
.cookie[style*="block"] > * + * { margin-top: 12px; }
