/* Layout: one phone-width column. Chrome is ink and paper; each bean brings its own colour,
   which floods its hero and becomes the accent for everything on its page. */
:root {
  --bg: #f3f4f1; --surface: #ffffff; --surface-2: #e9eae6; --line: rgba(18, 20, 23, .09); --line-2: rgba(18, 20, 23, .18);
  --fg: #121417; --muted: #4f555c; --faint: #62686f;
  --accent: #121417; --accent-ink: #ffffff;
  --flow: #1d5a8c; --flow-bg: rgba(29, 90, 140, .1);
  --ask: #7f4d00; --ask-bg: rgba(201, 138, 26, .16); --app: #2a682d; --app-bg: rgba(42, 104, 45, .12);
  --c1: #1f6058; --c2: #2a4799; --c3: #54449a;
  --shadow: 0 1px 2px rgba(18, 20, 23, .06), 0 8px 24px -12px rgba(18, 20, 23, .18);
  --f-display: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --f-body: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --r: 16px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0d0f12; --surface: #171a1e; --surface-2: #21252a; --line: rgba(242, 243, 241, .09); --line-2: rgba(242, 243, 241, .18);
  --fg: #f2f3f1; --muted: #b3b8be; --faint: #9399a0;
  --accent: #f2f3f1; --accent-ink: #0d0f12;
  --flow: #9cc8f0; --flow-bg: rgba(156, 200, 240, .14);
  --ask: #f0c26a; --ask-bg: rgba(240, 194, 106, .14); --app: #9ed39a; --app-bg: rgba(158, 211, 154, .14);
  --c1: #86d8ca; --c2: #a9bcff; --c3: #c9bdff;
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 10px 30px -14px rgba(0, 0, 0, .7);
  color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0d0f12; --surface: #171a1e; --surface-2: #21252a; --line: rgba(242, 243, 241, .09); --line-2: rgba(242, 243, 241, .18);
  --fg: #f2f3f1; --muted: #b3b8be; --faint: #9399a0;
  --accent: #f2f3f1; --accent-ink: #0d0f12;
  --flow: #9cc8f0; --flow-bg: rgba(156, 200, 240, .14);
  --ask: #f0c26a; --ask-bg: rgba(240, 194, 106, .14); --app: #9ed39a; --app-bg: rgba(158, 211, 154, .14);
  --c1: #86d8ca; --c2: #a9bcff; --c3: #c9bdff;
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 10px 30px -14px rgba(0, 0, 0, .7);
  color-scheme: dark; }

/* bean scope: the bean's colour becomes the accent (dark tone in light theme, glow tone in dark) */
.bscope { --b: var(--bean-ink); --b-on: #ffffff; --accent: var(--b); --accent-ink: var(--b-on); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bscope { --b: var(--bean-glow); --b-on: #0d0f12; } }
:root[data-theme="dark"] .bscope { --b: var(--bean-glow); --b-on: #0d0f12; }

* { box-sizing: border-box; }
html, body { background: var(--bg); }
body { color: var(--fg); font: 15px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wrap { max-width: 480px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 0 176px; }

/* top bar */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); display: flex; align-items: center; gap: 8px; padding-block: 14px 10px; }
.wordmark { font: italic 400 30px/1 var(--f-display); letter-spacing: -.01em; margin: 0 auto 0 0; }
.back { border: 0; background: none; color: var(--muted); padding: 8px 6px; margin-left: -6px; font-weight: 500; }
.pill { display: inline-flex; align-items: center; gap: 6px; font: 500 11px/1 var(--f-mono); letter-spacing: .04em; text-transform: uppercase; padding: 6px 9px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
.pill.sim { color: var(--ask); border-color: transparent; background: var(--ask-bg); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

h1, h2, h3 { margin: 0; text-wrap: balance; font-weight: 400; }
.eyebrow { font: 500 11px/1.2 var(--f-mono); letter-spacing: .09em; text-transform: uppercase; color: var(--faint); }
.section { display: grid; gap: 14px; padding-block: 30px 4px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-head h2 { font: 400 28px/1.1 var(--f-display); letter-spacing: -.01em; }
.section-head .count { font: 400 12px var(--f-mono); color: var(--faint); }
.lede { color: var(--muted); margin: 0; max-width: 62ch; text-wrap: pretty; }
.muted { color: var(--muted); }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }

/* source tags */
.src { display: inline-flex; align-items: center; font: 500 10px/1 var(--f-mono); letter-spacing: .05em; text-transform: uppercase; padding: 4px 6px; border-radius: 5px; white-space: nowrap; }
.src.label { color: var(--muted); background: var(--surface-2); }
.src.est { color: var(--flow); background: var(--flow-bg); }
.src.ask { color: var(--ask); background: var(--ask-bg); }
.src.you { color: var(--fg); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.src.app { color: var(--app); background: var(--app-bg); }

/* bean colour surfaces */
.flood { background: linear-gradient(155deg, var(--bean) 0%, var(--bean-deep) 100%); color: var(--bean-on); position: relative; overflow: hidden; }
.flood::after { content: ""; position: absolute; inset: 0; background: radial-gradient(90% 60% at 80% 0%, rgba(255, 255, 255, .18), transparent 60%); pointer-events: none; }
.photo { position: relative; display: grid; place-items: center; overflow: hidden; aspect-ratio: 1 / 1.08; max-width: 100%; }
.photo svg { width: 74%; height: auto; filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .35)); position: relative; z-index: 1; }

/* cellar */
.now .t { font: italic 400 28px/1.05 var(--f-display); position: relative; z-index: 1; }
.now .sub { font-size: 13.5px; margin-top: 6px; position: relative; z-index: 1; }
.now .photo { border-radius: 14px; background: rgba(255, 255, 255, .1); }
.strip { display: flex; flex-wrap: wrap; gap: 4px 14px; font: 400 12.5px var(--f-mono); margin-top: 12px; position: relative; z-index: 1; }
.strip b { font-weight: 500; }
.now .tagline { font: 500 11px/1.2 var(--f-mono); letter-spacing: .09em; text-transform: uppercase; position: relative; z-index: 1; }
.beans { display: grid; gap: 12px; }
.bean-card { display: grid; grid-template-columns: 104px 1fr; gap: 16px; padding: 10px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); text-align: left; width: 100%; box-shadow: var(--shadow); transition: transform .15s ease-out, border-color .15s ease-out; }
.bean-card .photo { border-radius: 14px; }
.bean-card .name { font: italic 400 24px/1.05 var(--f-display); letter-spacing: -.005em; }
.bean-card .meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.bean-card .row { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.notes { display: flex; flex-wrap: wrap; gap: 5px; }
.note { font-size: 12px; padding: 3px 9px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.status { font: 500 11px/1 var(--f-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--accent); display: inline-flex; align-items: center; gap: 6px; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.mini-roast { width: 64px; height: 5px; border-radius: 3px; background: linear-gradient(90deg, #d9bd8f, #a8743f, #6b4024, #2b1a10); position: relative; }
.mini-roast i { position: absolute; top: -3px; width: 2px; height: 11px; background: var(--fg); border-radius: 1px; }
.add-cta { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 18px; border-radius: 20px; border: 1.5px dashed var(--line-2); background: none; color: var(--muted); font-weight: 600; width: 100%; transition: color .15s ease-out, border-color .15s ease-out; }

/* bean hero */
.hero-flood { margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px))); padding: 4px max(16px, env(safe-area-inset-left, 0px)) 24px; border-radius: 0 0 30px 30px; display: grid; gap: 18px; }
.hero-flood .photo { aspect-ratio: 16 / 10; }
.hero-flood .photo svg { width: 38%; }
.hero-flood .eyebrow { color: var(--bean-on); opacity: .92; position: relative; z-index: 1; }
.hero-flood h1 { font: italic 400 46px/.98 var(--f-display); letter-spacing: -.02em; position: relative; z-index: 1; margin-top: 8px; }
.hero-flood .by { font-size: 15px; margin-top: 8px; position: relative; z-index: 1; }
.hero-flood .ph-tag { position: absolute; left: 0; bottom: 0; z-index: 2; font: 500 10px/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; padding: 5px 8px; border-radius: 6px; background: rgba(0, 0, 0, .28); color: #fff; }
.read-line { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 12.5px; color: var(--muted); padding-top: 16px; }
.read-line span.k { display: inline-flex; gap: 6px; align-items: center; }

/* facts */
.facts { display: grid; border-top: 1px solid var(--line); }
.fact { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: start; }
.fact > .k { font: 500 11px/1.6 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding-top: 1px; }
.fact .v { min-width: 0; display: grid; gap: 7px; }
.fact .v .main { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-weight: 500; }
.fact .v .sub { font-size: 13px; color: var(--muted); text-wrap: pretty; }
.scale { position: relative; height: 26px; }
.scale svg { width: 100%; height: 100%; overflow: visible; display: block; }
.ask-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line-2); background: var(--surface); padding: 8px 13px; border-radius: 99px; font-size: 13.5px; font-weight: 500; color: var(--fg); transition: background-color .15s ease-out, border-color .15s ease-out, color .15s ease-out; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* assessment */
.read { font: 400 25px/1.25 var(--f-display); margin: 0; letter-spacing: -.005em; text-wrap: pretty; }
.read em { font-style: italic; color: var(--accent); }
.qs { display: grid; gap: 14px; padding: 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.q { display: grid; gap: 9px; }
.q .qt { font-weight: 600; font-size: 14.5px; }
.q .why { font-size: 13px; color: var(--muted); }
.cmp { display: grid; gap: 10px; padding: 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.cmp-grid { display: grid; grid-template-columns: 1fr auto auto; gap: 8px 18px; font-size: 13.5px; align-items: baseline; }
.cmp-grid .k { color: var(--muted); }
.cmp-grid .now-v { color: var(--accent); font-weight: 500; }
.cmp-h { font: 500 10.5px var(--f-mono); letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }

/* recipe */
.recipe { border-radius: 22px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; box-shadow: var(--shadow); }
.recipe-head { display: flex; justify-content: space-between; align-items: start; gap: 10px; padding: 18px 18px 0; }
.recipe-head .p { font: italic 400 26px/1.1 var(--f-display); }
.nums { display: grid; grid-template-columns: repeat(4, 1fr); padding: 16px 18px 6px; }
.nums div { display: grid; gap: 3px; }
.nums .k { font: 500 10px/1 var(--f-mono); letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }
.nums .v { font: 500 24px/1.1 var(--f-body); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.nums .v small { font-size: 13px; color: var(--muted); font-weight: 500; margin-left: 1px; letter-spacing: 0; }
.nums .s { font: 400 11.5px var(--f-mono); color: var(--muted); }
.chart { padding: 6px 12px 2px 6px; }
.chart svg { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 14px; padding: 0 18px 12px; font: 400 11.5px var(--f-mono); color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 14px; height: 2px; vertical-align: middle; margin-right: 6px; background: var(--accent); }
.legend span.fl::before { background: none; border-top: 2px dashed var(--muted); height: 0; }
.phases { display: flex; align-items: stretch; gap: 6px; padding: 2px 18px 16px; }
.ph { flex: 1; min-width: 0; display: grid; gap: 1px; justify-items: center; text-align: center; padding: 9px 4px; border-radius: 12px; background: var(--surface-2); font-size: 11.5px; color: var(--muted); }
.ph .mono { font-size: 11px; }
.ph b { font: 600 15px var(--f-body); color: var(--fg); font-variant-numeric: tabular-nums; }
.ph-arrow { align-self: center; color: var(--faint); font-size: 12px; }
.prof-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.prof-actions .btn { flex: none; white-space: nowrap; }
.btn.primary.xs, .btn.xs { padding: 8px 12px; font-size: 13px; border-radius: 10px; white-space: nowrap; flex: none; }
.loaded { font: 500 11.5px var(--f-mono); color: var(--app); white-space: nowrap; padding: 8px 0; }
.why-panel { display: grid; gap: 10px; justify-items: start; padding: 16px 18px 18px; border-top: 1px solid var(--line); font-size: 14px; }
.why-panel ul { margin: 0; padding-left: 18px; display: grid; gap: 8px; color: var(--muted); }
.why-panel li::marker { color: var(--accent); }
.you-do { display: flex; gap: 10px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--line); font-size: 13.5px; }
.recipe-actions { display: flex; gap: 8px; padding: 0 18px 18px; }
.btn { border: 0; border-radius: 14px; padding: 13px 16px; font-weight: 600; font-size: 15px; transition: transform .12s ease-out, filter .15s ease-out; }
.btn.primary { background: var(--accent); color: var(--accent-ink); flex: 1; }
.btn.ghost { background: var(--surface-2); color: var(--fg); }
.btn.small { padding: 9px 13px; font-size: 13.5px; border-radius: 11px; }

/* profiles */
.group-label { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.group-label span { font: 500 11px var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); white-space: nowrap; }
.group-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.profiles { display: grid; gap: 10px; }
.prof { border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.prof > button { display: grid; grid-template-columns: 1fr 96px; gap: 12px; padding: 15px; width: 100%; border: 0; background: none; text-align: left; align-items: center; }
.prof .pt { font: italic 400 23px/1.1 var(--f-display); }
.prof .fit { display: flex; gap: 8px; align-items: center; margin-top: 7px; flex-wrap: wrap; }
.fitbar { display: inline-flex; gap: 3px; }
.fitbar i { width: 12px; height: 5px; border-radius: 2px; background: var(--line-2); }
.fitbar i.on { background: var(--accent); }
.prof .tag { font: 500 11px/1 var(--f-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.prof .notice { font-size: 13.5px; color: var(--muted); margin-top: 6px; }
.prof .spark svg { width: 100%; height: auto; display: block; }
.prof .more { display: grid; gap: 10px; padding: 0 15px 15px; font-size: 14px; }
.prof .more p { margin: 0; color: var(--muted); }
.prof.dim .pt, .prof.dim .notice { color: var(--muted); }
.prof.new { border-style: dashed; border-color: var(--line-2); background: transparent; }
.honest { font-size: 12.5px; color: var(--faint); margin: 0; text-wrap: pretty; }

/* taste */
.dims { display: grid; gap: 20px; padding: 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.dim { display: grid; gap: 7px; }
.dim-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.dim-top b { font-weight: 600; }
.dim-ends { display: flex; justify-content: space-between; font: 400 11.5px var(--f-mono); color: var(--faint); }
.dim-move { font-size: 13px; color: var(--muted); }
.track { position: relative; }
.track svg { width: 100%; height: 22px; display: block; overflow: visible; }
.mk { position: absolute; top: 6px; width: 10px; height: 10px; }
.mk.you { background: var(--fg); transform: rotate(45deg); margin-left: -5px; }
.mk.aim { width: 13px; height: 13px; top: 4.5px; margin-left: -6.5px; border-radius: 50%; border: 2.5px solid var(--accent); background: var(--surface); }
.key { display: flex; flex-wrap: wrap; gap: 14px; font: 400 11.5px var(--f-mono); color: var(--muted); }
.key i { display: inline-block; vertical-align: middle; margin-right: 6px; }
.basis { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 12px; padding: 3px; background: var(--surface); }
.seg button { border: 0; background: none; padding: 7px 11px; border-radius: 9px; font-size: 13px; font-weight: 500; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--fg); }
.compare { display: grid; gap: 8px; padding: 14px 16px; border-radius: var(--r); border: 1px solid var(--line); font-size: 13.5px; }
.compare .row { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.compare .row:last-of-type { border-bottom: 0; padding-bottom: 0; }

/* flight */
.flight { display: grid; }
.step { display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding-bottom: 20px; position: relative; }
.step::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 1.5px; background: var(--line-2); }
.step:last-child::before { display: none; }
.step .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 500 13px var(--f-mono); border: 1.5px solid var(--line-2); color: var(--muted); background: var(--bg); position: relative; }
.step.done .n { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.step.next .n { border-color: var(--accent); color: var(--accent); }
.step .body { display: grid; gap: 6px; min-width: 0; }
.step .st { font: italic 400 23px/1.1 var(--f-display); }
.step .sr { font: 400 12.5px var(--f-mono); color: var(--muted); }
.step .exp { font-size: 14px; text-wrap: pretty; }
.step .fb { padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 12px; font-size: 13.5px; }
.stars { color: var(--accent); letter-spacing: 2px; }
.slider { display: grid; gap: 4px; }
.slider .ends { display: flex; justify-content: space-between; font: 400 11.5px var(--f-mono); color: var(--faint); }
input[type=range] { width: 100%; accent-color: var(--accent); }
.likes { display: flex; gap: 6px; flex-wrap: wrap; }

/* quick fixes */
.fixes { border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.fixes .r { display: grid; grid-template-columns: 38% 1fr; gap: 12px; padding: 12px 15px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.fixes .r:last-child { border-bottom: 0; }
.fixes .r b { font-weight: 600; }
.fixes .r .a { display: grid; gap: 5px; justify-items: start; }

/* palate */
.palate-sum { font: 400 30px/1.15 var(--f-display); margin: 0; letter-spacing: -.01em; text-wrap: pretty; }
.palate-sum em { font-style: italic; color: var(--c1); }
.mix { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; }
.mix i { display: block; }
.mix-key { display: flex; gap: 14px; flex-wrap: wrap; font: 400 12px var(--f-mono); color: var(--muted); }
.mix-key i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.hist { display: grid; border-top: 1px solid var(--line); }
.hist .r { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.hist .r .photo { border-radius: 10px; }
.hist .nm { font: italic 400 20px/1.1 var(--f-display); }
.mem { display: grid; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.mem .r { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 8px 10px 15px; border-bottom: 1px solid var(--line); font-size: 14px; }
.mem .r:last-child { border-bottom: 0; }
.mem .forget { border: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 500; padding: 8px 10px; min-height: 32px; border-radius: 8px; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: from-font; }
.mem .empty { padding: 14px 15px; color: var(--muted); font-size: 14px; }

/* add */
.scan .sweep { position: absolute; left: 0; right: 0; height: 2px; background: #fff; box-shadow: 0 0 18px 4px rgba(255, 255, 255, .5); z-index: 2; top: 50%; }
@media (prefers-reduced-motion: no-preference) {
  .scan .sweep { animation: sweep 2.4s ease-in-out infinite; }
  @keyframes sweep { 0%, 100% { top: 12%; } 50% { top: 86%; } }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* hover and press, pointer devices only for hover */
@media (hover: hover) {
  .bean-card:hover { border-color: var(--line-2); }
  .add-cta:hover { color: var(--fg); border-color: var(--fg); }
  .chip:hover:not([aria-pressed="true"]) { border-color: var(--accent); }
  .btn.primary:hover { filter: brightness(1.08); }
  .ask .mic:hover { color: var(--fg); border-color: var(--fg); }
}
.btn:active, .bean-card:active, .chip:active, .add-btn:active { transform: scale(.96); }
@media (hover: hover) { .opt:hover { border-color: var(--line-2); } }

/* bottom: ask bar + tabs */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: linear-gradient(to top, var(--bg) 72%, transparent); padding-bottom: env(safe-area-inset-bottom, 0px); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.dock-in { max-width: 480px; margin: 0 auto; display: grid; gap: 8px; padding-top: 20px; }
.ask { display: flex; gap: 8px; align-items: center; padding: 6px 6px 6px 16px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.ask input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 16px; padding: 6px 0; }
.ask input::placeholder { color: var(--faint); }
.ask button { border: 0; width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.ask .mic { background: none; color: var(--muted); border: 1px solid var(--line-2); }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.tabs button { border: 0; background: none; padding: 9px 0 10px; display: grid; justify-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; color: var(--faint); }
.tabs button[aria-current="page"] { color: var(--fg); }
.tabs svg { width: 22px; height: 22px; }
.toast { position: fixed; left: 50%; transform: translate(-50%, 12px); bottom: calc(146px + env(safe-area-inset-bottom, 0px)); z-index: 20; width: min(440px, calc(100% - 32px)); padding: 12px 14px; border-radius: 14px; background: var(--fg); color: var(--bg); font-size: 13.5px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); opacity: 0; pointer-events: none; transition: opacity .2s ease-out, transform .2s ease-out; display: flex; gap: 12px; align-items: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast .msg { flex: 1; min-width: 0; }
.toast b { font-weight: 700; }
.toast button { border: 0; background: none; color: var(--bg); font-weight: 700; padding: 8px 10px; border-radius: 8px; text-decoration: underline; text-underline-offset: 3px; }
.ctx { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; }
.ctx-chip { white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; }
.ctx-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dot); }
.chat { display: grid; gap: 10px; padding-top: 6px; }
.msg { max-width: 88%; padding: 11px 14px; border-radius: 20px; font-size: 15px; line-height: 1.45; min-width: 0; }
.msg.me { justify-self: end; background: var(--fg); color: var(--bg); border-bottom-right-radius: 6px; }
.msg.ai { justify-self: start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg ul, .msg ol { margin: 8px 0 4px; padding-left: 20px; display: grid; gap: 6px; }
.msg li::marker { color: var(--accent); }
.chg { margin-top: 10px; border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden; background: var(--bg); }
.chg .row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 13.5px; align-items: baseline; }
.chg .k { color: var(--muted); }
.chg .was { text-decoration: line-through; text-decoration-color: var(--line-2); }
.now-v { color: var(--accent); font-weight: 500; }
.chg .st { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 9px 12px; }
.st-ok { font: 500 11.5px var(--f-mono); color: var(--app); }
/* home: one card that always says what to do next */
.now { display: grid; grid-template-columns: 1fr 92px; gap: 12px; align-items: end; padding: 18px; border-radius: 22px; box-shadow: var(--shadow); }
.now .hint { font-size: 14px; margin-top: 12px; position: relative; z-index: 1; text-wrap: pretty; }
.now .acts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; position: relative; z-index: 1; }
.now .acts .btn { flex: 1 1 auto; }
.btn.on-flood { background: var(--bean-on); color: var(--bean-btn, var(--bean-deep)); }
.btn.flood-ghost { background: rgba(255, 255, 255, .16); color: var(--bean-on); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); }
.now .q { grid-column: 1 / -1; font: italic 400 22px/1.1 var(--f-display); position: relative; z-index: 1; margin-top: 2px; }
.rate { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; position: relative; z-index: 1; }
.rate button { border: 0; border-radius: 14px; padding: 14px 6px 12px; min-height: 64px; background: rgba(255, 255, 255, .16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); color: var(--bean-on); display: grid; gap: 2px; justify-items: center; font-weight: 600; font-size: 14px; transition: transform .12s ease-out; }
.rate button small { font-weight: 400; font-size: 12px; opacity: .85; }
.rate button:active, .now .acts .btn:active { transform: scale(.96); }
.reply { grid-column: 1 / -1; display: grid; gap: 10px; position: relative; z-index: 1; padding: 14px; border-radius: 16px; background: rgba(0, 0, 0, .18); font-size: 14px; }
.reply .chg-row { display: flex; gap: 10px; align-items: baseline; font: 400 13px var(--f-mono); }
.reply .chg-row s { opacity: .7; }
.reply .links { display: flex; gap: 14px; flex-wrap: wrap; }
.reply .linkish, .now .linkish { color: var(--bean-on); }
.welcome { display: grid; gap: 14px; padding: 22px 18px 18px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.welcome h2 { font: 400 34px/1.05 var(--f-display); letter-spacing: -.01em; margin: 0; text-wrap: balance; }
.welcome .big { display: grid; grid-template-columns: 24px 1fr; gap: 2px 12px; align-items: center; text-align: left; padding: 14px 16px; }
.welcome .big small { grid-column: 2; font-weight: 400; font-size: 13px; opacity: .8; }
.welcome .big svg { width: 22px; height: 22px; }
.welcome .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.steps3 { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.steps3 li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: start; }
.steps3 li:last-child { border-bottom: 0; }
.steps3 .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 500 12px var(--f-mono); border: 1px solid var(--line-2); color: var(--muted); }
.steps3 li.cur .n { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.steps3 b { display: block; font-weight: 600; }
.steps3 span.d { display: block; font-size: 13px; color: var(--muted); }
.opt .ic.sw { box-shadow: inset 0 -12px 0 var(--sw); }
.hero-act { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 8px 8px 8px 14px; border-radius: 14px; background: rgba(0, 0, 0, .22); position: relative; z-index: 1; color: var(--bean-on); }
.hero-act .r { font: 400 12.5px/1.4 var(--f-mono); min-width: 0; }
.hero-act .btn { flex: none; white-space: nowrap; }
.hero-act .ok { font-weight: 600; font-size: 13.5px; padding: 8px 6px; white-space: nowrap; }
/* add sheet + tablet import + manual entry */
.add-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--fg); color: var(--bg); font-weight: 600; font-size: 13.5px; padding: 8px 13px 8px 10px; border-radius: 99px; min-height: 36px; transition: transform .12s ease-out; }
.add-btn svg { width: 16px; height: 16px; }
.section-head .right { display: flex; align-items: center; gap: 12px; }
.scrim { position: fixed; inset: 0; z-index: 30; border: 0; background: rgba(8, 9, 11, .5); opacity: 0; transition: opacity .2s ease-out; }
.sheet { position: fixed; left: 50%; bottom: 0; z-index: 31; width: min(480px, 100%); transform: translate(-50%, 24px); opacity: 0; transition: transform .24s cubic-bezier(0.2, 0, 0, 1), opacity .2s ease-out; background: var(--surface); border-radius: 24px 24px 0 0; padding: 10px 16px calc(16px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -10px 40px rgba(0, 0, 0, .25); display: grid; gap: 12px; }
#sheet.on .scrim { opacity: 1; } #sheet.on .sheet { transform: translate(-50%, 0); opacity: 1; }
#sheet:not(.on) { pointer-events: none; }
.sheet .grab { width: 36px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 0 auto 4px; }
.sheet h2 { font: 400 28px/1.1 var(--f-display); margin: 0 0 2px; }
.opts { display: grid; gap: 8px; }
.opt { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; text-align: left; border: 1px solid var(--line); background: var(--bg); border-radius: 16px; padding: 12px 14px 12px 12px; min-height: 64px; transition: transform .12s ease-out, border-color .15s ease-out; }
.opt .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--fg); }
.opt .ic svg { width: 22px; height: 22px; }
.opt b { display: block; font-weight: 600; }
.opt .d { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; text-wrap: pretty; }
.opt .badge { font: 500 11px/1 var(--f-mono); padding: 5px 8px; border-radius: 99px; background: var(--app-bg); color: var(--app); white-space: nowrap; }
.opt:active { transform: scale(.96); }
.opts .or { font: 500 11px/1.2 var(--f-mono); letter-spacing: .09em; text-transform: uppercase; color: var(--faint); padding: 6px 2px 0; }
.picks { display: grid; border-top: 1px solid var(--line); }
.pick { display: grid; grid-template-columns: 24px 40px 1fr; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.pick input { width: 22px; height: 22px; margin: 0; accent-color: var(--fg); }
.pick .sw { width: 40px; height: 48px; border-radius: 8px; }
.pick b { display: block; font: italic 400 21px/1.1 var(--f-display); }
.pick .m { display: block; font-size: 13px; color: var(--muted); margin-top: 3px; }
.pick .m.mono { font: 400 12px/1.4 var(--f-mono); color: var(--faint); }
.group-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 22px 0 6px; }
.group-h:first-child { margin-top: 0; }
.group-h .count, .disclose .count { font: 400 12px var(--f-mono); color: var(--faint); }
.disclose { display: flex; width: 100%; justify-content: space-between; align-items: center; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 14px 0; font-weight: 600; text-align: left; }
.disclose .chev { transition: transform .15s ease-out; color: var(--faint); }
.disclose[aria-expanded="true"] .chev { transform: rotate(90deg); }
.sticky-act { position: sticky; bottom: calc(150px + env(safe-area-inset-bottom, 0px)); padding-top: 16px; display: grid; gap: 8px; background: linear-gradient(to top, var(--bg) 70%, transparent); }
.nudge { display: grid; gap: 4px; padding: 12px 14px 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
.nudge .t { display: flex; gap: 10px; align-items: flex-start; }
.nudge .acts { display: flex; gap: 12px; padding-left: 26px; }
.nudge svg { width: 20px; height: 20px; flex: none; color: var(--fg); }
.field { display: grid; gap: 6px; padding: 12px 0; }
.field label, .field .lbl { font: 500 11px/1.6 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.field input { font-size: 16px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); width: 100%; }
.field input[aria-invalid="true"] { border-color: #c2412b; }
.field .err { font-size: 13px; color: #b2361f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .field .err { color: #ff9b85; } }
:root[data-theme="dark"] .field .err { color: #ff9b85; }
.field .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.field .opt-note { font: 400 12.5px var(--f-body); letter-spacing: 0; text-transform: none; color: var(--faint); margin-left: 4px; }
.linkish { border: 0; background: none; font-weight: 600; font-size: 13.5px; text-decoration: underline; text-underline-offset: 3px; padding: 6px 4px; min-height: 32px; }
.qr { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.qr .chip { font-size: 13px; padding: 7px 11px; text-align: left; }
.ctable { display: grid; grid-template-columns: auto 1fr 1fr; gap: 7px 12px; margin: 10px 0; font-size: 13px; }
.ctable .k { color: var(--muted); }
.mini-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0 10px; }
.mini-charts div { display: grid; gap: 4px; font: 400 11px var(--f-mono); color: var(--muted); }
.mini-charts svg { width: 100%; height: auto; }
.typing { display: inline-flex; gap: 5px; padding: 14px 16px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
@media (prefers-reduced-motion: no-preference) {
  .typing i { animation: blink 1s infinite ease-in-out; } .typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
  @keyframes blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
}

/* ---------- app-only ---------- */
.photo img.shot { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; outline: 1px solid rgba(0, 0, 0, .1); outline-offset: -1px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .photo img.shot { outline-color: rgba(255, 255, 255, .1); } }
.hero-flood .photo.has-shot { border-radius: 20px; aspect-ratio: 4 / 3; max-height: 300px; width: 100%; }
.pill.warn { background: var(--ask-bg); color: var(--ask); border-color: transparent; }
.pair { min-height: 70vh; display: grid; align-content: center; gap: 18px; padding-top: 24px; }
.pair h1 { font: 400 40px/1.05 var(--f-display); margin: 0; }
.pair .field input { letter-spacing: .12em; text-transform: uppercase; font-family: var(--f-mono); }
.pending { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--fg); flex: none; }
@media (prefers-reduced-motion: no-preference) { .spin { animation: spin .8s linear infinite; } }
@keyframes spin { to { transform: rotate(360deg); } }
.err-box { padding: 14px 16px; border-radius: 16px; background: var(--ask-bg); color: var(--fg); font-size: 14px; display: grid; gap: 10px; }
.edit-grid { display: grid; gap: 0; }
.edit-grid .field { padding: 10px 0; }
.foot { display: grid; gap: 8px; justify-items: start; }
.ver { font: 400 11.5px var(--f-mono); color: var(--faint); }
.mem-add { display: flex; gap: 8px; margin-top: 12px; }
.mem-add input { flex: 1; min-width: 0; font-size: 16px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); }
.msg.ai p { margin: 0 0 8px; } .msg.ai p:last-child { margin-bottom: 0; }
.prof .kind { font: 500 10.5px/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
input[type=file].hidden-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.add-cta svg { width: 20px; height: 20px; flex: none; }
.checks { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13.5px; color: var(--muted); }
.prof .rank { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; margin-right: 8px; font: 500 11.5px var(--f-mono); background: var(--surface-2); color: var(--muted); vertical-align: 2px; }
.prof .prof-row { padding: 0 15px 15px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
