html.android { --safe-top: 0px; --safe-bottom: 0px; }
[hidden] { display: none !important; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(120% 60% at 100% 0%, color-mix(in srgb, var(--mint) 10%, transparent), transparent 60%), var(--bg);
  color: var(--text); font: 17px/1.6 var(--font); overflow: hidden;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
.ic { width: 24px; height: 24px; flex: none; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }

#app { display: flex; flex-direction: column; height: 100%; max-width: 640px; margin: 0 auto; }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 8px; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 20px; }
.brand .logo { width: 36px; height: 36px; border-radius: 11px; display: block; }
.brand .ai { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--gold); color: #261600; }
.pill { display: flex; align-items: center; gap: 6px; padding: 9px 14px; max-width: 52vw; white-space: nowrap; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; transition: .25s var(--ease); }
.pill .ic { width: 18px; height: 18px; }
.pill span { overflow: hidden; text-overflow: ellipsis; }
.pill.on { background: color-mix(in srgb, var(--mint) 18%, var(--surface)); border-color: var(--mint); color: var(--mint); }
.pill.on::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px color-mix(in srgb, var(--mint) 25%, transparent); }

/* ---------- screens ---------- */
#screens { flex: 1; position: relative; overflow: hidden; }
.screen { position: absolute; inset: 0; overflow-y: auto; padding: 8px 18px 120px; opacity: 0; transform: translateX(-24px); pointer-events: none; transition: opacity .35s var(--ease), transform .35s var(--ease); }
.screen.active { opacity: 1; transform: none; pointer-events: auto; }
.screen::-webkit-scrollbar { display: none; }
h1 { font-size: 30px; line-height: 1.25; margin: 10px 0 6px; font-weight: 700; }
h2 { font-size: 20px; margin: 26px 0 12px; font-weight: 700; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.lead { color: var(--muted); margin: 0 0 18px; }

/* ---------- home ---------- */
.hero-actions { display: grid; gap: 14px; margin-top: 18px; }
.action { position: relative; display: flex; align-items: center; gap: 16px; padding: 22px; border-radius: var(--radius); text-align: start; overflow: hidden; transition: transform .2s var(--ease); }
.action:active, .tile:active, .cta:active, .preset:active { transform: scale(.97); }
.action .bubble { width: 64px; height: 64px; border-radius: 22px; display: grid; place-items: center; flex: none; }
.action .bubble .ic { width: 32px; height: 32px; }
.action b { display: block; font-size: 22px; }
.action small { display: block; font-size: 14px; opacity: .8; margin-top: 2px; }
.action.primary { background: linear-gradient(135deg, var(--mint), var(--mint2)); color: var(--on-mint); box-shadow: var(--glow); min-height: 150px; }
.action.primary .bubble { background: rgba(255, 255, 255, .22); }
.action.primary::after { content: ""; position: absolute; width: 220px; height: 220px; border-radius: 50%; left: -70px; bottom: -110px; background: rgba(255, 255, 255, .14); }
.action.secondary { background: var(--surface); border: 1px solid var(--line); }
.action.secondary .bubble { background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold); }
.presets { display: grid; grid-auto-flow: column; grid-auto-columns: 168px; gap: 12px; overflow-x: auto; margin: 0 -18px; padding: 4px 18px 8px; scroll-snap-type: x mandatory; }
.presets::-webkit-scrollbar { display: none; }
.preset { scroll-snap-align: start; text-align: start; padding: 16px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); min-height: 132px; display: flex; flex-direction: column; justify-content: space-between; transition: transform .2s var(--ease); }
.preset .flag { font-size: 34px; line-height: 1; }
.preset b { display: block; margin-top: 10px; }
.preset small { color: var(--muted); font-size: 12.5px; }
.last { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); width: 100%; text-align: start; }
.last .flag { font-size: 32px; }
.last .go { margin-inline-start: auto; width: 46px; height: 46px; border-radius: 16px; background: var(--mint); color: var(--on-mint); display: grid; place-items: center; }

/* ---------- wizard ---------- */
.steps { display: flex; gap: 6px; margin: 6px 0 18px; }
.steps i { flex: 1; height: 5px; border-radius: 9px; background: var(--line); transition: background .3s; }
.steps i.done { background: var(--mint); }
.wiz-head { display: flex; align-items: center; gap: 12px; }
.round { width: 48px; height: 48px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; flex: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.tile { position: relative; padding: 18px 12px; border-radius: 22px; background: var(--surface); border: 2px solid transparent; text-align: center; transition: transform .2s var(--ease), border-color .2s, background .2s; display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 112px; justify-content: center; }
.tile .emo { font-size: 40px; line-height: 1.1; }
.tile b { font-size: 16px; font-weight: 500; }
.tile small { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.tile.sel { border-color: var(--mint); background: color-mix(in srgb, var(--mint) 12%, var(--surface)); }
.tile.sel::after { content: "✓"; position: absolute; top: 8px; inset-inline-end: 10px; width: 22px; height: 22px; border-radius: 50%; background: var(--mint); color: var(--on-mint); font-size: 13px; display: grid; place-items: center; font-weight: 700; }
.swatch { width: 54px; height: 54px; border-radius: 50%; box-shadow: inset 0 -6px 12px rgba(0, 0, 0, .3); }
.wide-tile { grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; gap: 14px; min-height: 84px; text-align: start; }
.wide-tile .emo { font-size: 36px; }
.wide-tile div { display: flex; flex-direction: column; }

.summary { display: grid; gap: 10px; }
.sum-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 20px; background: var(--surface); width: 100%; text-align: start; }
.sum-row .emo { font-size: 28px; width: 36px; text-align: center; }
.sum-row small { display: block; color: var(--muted); font-size: 13px; }
.sum-row .edit { margin-inline-start: auto; color: var(--mint); font-size: 14px; }
.photo-thumb { width: 100%; height: 170px; object-fit: cover; border-radius: 22px; margin-bottom: 12px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; font-size: 13px; background: color-mix(in srgb, var(--mint) 16%, transparent); color: var(--mint); }
.badge.warn { background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold); }

/* ---------- buttons ---------- */
.cta { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 19px; border-radius: 22px; font-size: 19px; font-weight: 700; background: linear-gradient(135deg, var(--mint), var(--mint2)); color: var(--on-mint); box-shadow: var(--glow); transition: transform .2s var(--ease), opacity .2s; }
.cta.alt { background: var(--surface); color: var(--text); box-shadow: none; border: 1px solid var(--line); }
.cta.gold { background: linear-gradient(135deg, var(--gold), var(--gold2)); color: var(--on-gold); box-shadow: var(--gold-glow); }
.cta:disabled { opacity: .4; }
.dock { position: sticky; bottom: 0; padding: 18px 0 4px; margin-top: 18px; background: linear-gradient(transparent, var(--bg) 35%); display: grid; gap: 10px; }

/* ---------- thinking ---------- */
.think { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 22px; }
.orb { width: 150px; height: 150px; border-radius: 50%; background: conic-gradient(from 0deg, var(--mint), var(--mint2), var(--gold), var(--mint)); animation: spin 2.4s linear infinite; filter: blur(.5px); position: relative; }
.orb::after { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: var(--bg); }
.orb-emo { position: absolute; inset: 0; display: grid; place-items: center; font-size: 54px; z-index: 1; animation: spin 2.4s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
.think-steps { display: grid; gap: 10px; width: 100%; max-width: 330px; text-align: start; }
.think-steps div { display: flex; align-items: center; gap: 12px; color: var(--muted); transition: color .3s; }
.think-steps div .dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; flex: none; }
.think-steps div.now { color: var(--text); }
.think-steps div.now .dot { border-color: var(--mint); border-top-color: transparent; animation: spin 1s linear infinite; }
.think-steps div.ok { color: var(--text); }
.think-steps div.ok .dot { background: var(--mint); border-color: var(--mint); color: var(--on-mint); }
.think-steps .dot .ic { width: 16px; height: 16px; }

/* ---------- recipe ---------- */
.r-head { padding: 20px; border-radius: var(--radius); background: linear-gradient(160deg, color-mix(in srgb, var(--mint) 20%, var(--surface)), var(--surface) 70%); border: 1px solid var(--line); }
.r-head .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.r-head h1 { margin: 4px 0 8px; }
.why { display: flex; gap: 10px; margin-top: 10px; color: var(--text); font-size: 15.5px; }
.why .ic { color: var(--gold); margin-top: 2px; }
.taste { margin: 10px 0 0; color: var(--muted); font-size: 15px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 14px; }
.stat { position: relative; text-align: start; padding: 16px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; transition: transform .2s var(--ease); }
.stat:active { transform: scale(.97); }
.stat .lbl { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; }
.stat .lbl .ic { width: 20px; height: 20px; color: var(--mint); }
.stat .val { font-size: 32px; font-weight: 700; line-height: 1.15; margin-top: 4px; }
.stat .val small { font-size: 15px; font-weight: 400; color: var(--muted); margin-inline-start: 4px; }
.stat .sub { font-size: 13px; color: var(--muted); }
.stat .q { position: absolute; top: 12px; inset-inline-end: 12px; width: 24px; height: 24px; border-radius: 50%; background: var(--surface2); color: var(--muted); font-size: 13px; display: grid; place-items: center; }
.meter { height: 6px; border-radius: 9px; background: var(--surface2); margin-top: 8px; position: relative; overflow: hidden; }
.meter i { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 9px; background: linear-gradient(90deg, var(--mint2), var(--mint)); }
[dir=rtl] .meter i { background: linear-gradient(270deg, var(--mint2), var(--mint)); }

.timeline { display: flex; align-items: flex-end; gap: 4px; height: 150px; margin-top: 8px; padding: 12px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); }
.tl-pour { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; min-width: 0; }
.tl-bar { width: 100%; border-radius: 12px 12px 6px 6px; background: linear-gradient(180deg, var(--mint), var(--mint2)); position: relative; transition: height .5s var(--ease); display: grid; place-items: center; color: var(--on-mint); font-size: 13px; font-weight: 700; min-height: 26px; }
.tl-pour small { font-size: 11.5px; color: var(--muted); text-align: center; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tl-pause { width: 18px; align-self: center; text-align: center; color: var(--muted); font-size: 11px; writing-mode: vertical-rl; flex: none; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.seg button { padding: 13px 8px; border-radius: 15px; color: var(--muted); font-size: 15px; transition: .2s; }
.seg button.on { background: var(--surface2); color: var(--text); box-shadow: 0 0 0 1.5px var(--mint) inset; }
.option-row { display: grid; gap: 12px; margin-top: 12px; }
.changes { margin-top: 12px; padding: 16px; border-radius: 22px; border: 1px dashed var(--gold); background: color-mix(in srgb, var(--gold) 7%, transparent); }
.changes b { color: var(--gold); display: flex; align-items: center; gap: 8px; }
.changes ul { margin: 8px 0 0; padding-inline-start: 20px; }
.empty { text-align: center; padding: 40px 10px; color: var(--muted); }
.empty .emo { font-size: 64px; display: block; margin-bottom: 8px; }

/* ---------- brew ---------- */
.ring-wrap { position: relative; width: min(78vw, 320px); aspect-ratio: 1; margin: 12px auto 4px; }
.ring-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { stroke: var(--surface2); }
.ring-fg { stroke: url(#ringGrad); transition: stroke-dashoffset .6s var(--ease); }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-center .big { font-size: 64px; font-weight: 700; line-height: 1; }
.ring-center small { color: var(--muted); }
.stage { text-align: center; font-size: 19px; margin: 8px 0 2px; min-height: 30px; }
.brew-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.mini { padding: 12px; border-radius: 18px; background: var(--surface); text-align: center; }
.mini b { display: block; font-size: 22px; }
.mini small { color: var(--muted); font-size: 12.5px; }
.brew-btns { display: flex; justify-content: center; gap: 22px; margin-top: 8px; }
.big-btn { width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); }
.big-btn .ic { width: 30px; height: 30px; }
.big-btn.stop { color: var(--rose); }
canvas#chart { width: 100%; height: 110px; border-radius: 18px; background: var(--surface); display: block; }

/* ---------- rate ---------- */
.faces { display: flex; justify-content: space-between; gap: 6px; }
.faces button { flex: 1; aspect-ratio: 1; max-width: 72px; font-size: 38px; border-radius: 20px; background: var(--surface); transition: transform .2s var(--ease), background .2s; filter: grayscale(.6); }
.faces button.sel { background: color-mix(in srgb, var(--mint) 18%, var(--surface)); transform: scale(1.12); filter: none; box-shadow: 0 0 0 2px var(--mint) inset; }
.slider-card { padding: 16px; border-radius: 22px; background: var(--surface); margin-top: 12px; }
.slider-card .ends { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.slider-card .ends span { display: flex; align-items: center; gap: 4px; }
.slider-card .ends b { font-size: 22px; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 34px; background: transparent; }
input[type=range]::-webkit-slider-runnable-track { height: 10px; border-radius: 9px; background: linear-gradient(90deg, var(--gold), var(--mint), var(--rose)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 32px; height: 32px; margin-top: -11px; border-radius: 50%; background: #fff; border: 4px solid var(--mint); box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
/* RTL: minimum (sour / weak) sits on the right, so the colour ramp flips with it */
[dir=rtl] input[type=range]::-webkit-slider-runnable-track { background: linear-gradient(270deg, var(--gold), var(--mint), var(--rose)); }
input[type=range]::-moz-range-track { height: 10px; border-radius: 9px; background: linear-gradient(90deg, var(--gold), var(--mint), var(--rose)); }
input[type=range]::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 4px solid var(--mint); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 11px 16px; border-radius: 99px; background: var(--surface); border: 1.5px solid var(--line); font-size: 15px; transition: .2s; }
.chip.sel { border-color: var(--mint); background: color-mix(in srgb, var(--mint) 14%, var(--surface)); color: var(--mint); }

/* ---------- library / settings ---------- */
.lib-item { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 22px; background: var(--surface); margin-bottom: 10px; width: 100%; text-align: start; }
.lib-item .flag { font-size: 34px; }
.lib-item .meta { flex: 1; min-width: 0; }
.lib-item .meta b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-item .meta small { color: var(--muted); font-size: 13px; }
.stars { color: var(--gold); font-size: 13px; letter-spacing: 1px; }
.set-card { padding: 18px; border-radius: 22px; background: var(--surface); margin-bottom: 12px; }
.set-card h3 { margin: 0 0 4px; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.set-card p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.key-row { display: flex; gap: 8px; }
.key-row input { flex: 1; min-width: 0; font: inherit; font-size: 15px; padding: 14px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--bg2); color: var(--text); direction: ltr; }
.key-row button { width: 54px; border-radius: 16px; background: var(--surface2); display: grid; place-items: center; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); width: 100%; text-align: start; }
.toggle:first-of-type { border-top: 0; }
.toggle small { display: block; color: var(--muted); font-size: 13px; }
.switch { width: 54px; height: 32px; border-radius: 99px; background: var(--line); position: relative; flex: none; transition: .25s; }
.switch::after { content: ""; position: absolute; top: 4px; inset-inline-start: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: .25s var(--ease); }
.toggle.on .switch { background: var(--mint); }
.toggle.on .switch::after { inset-inline-start: 26px; }
pre.log { direction: ltr; text-align: left; font-size: 11.5px; max-height: 260px; overflow: auto; background: var(--bg2); padding: 12px; border-radius: 14px; margin: 0; white-space: pre-wrap; word-break: break-all; color: var(--muted); }

/* ---------- tab bar ---------- */
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%, 640px); display: grid; grid-template-columns: repeat(5, 1fr); padding: 8px 6px calc(10px + var(--safe-bottom)); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-top: 1px solid var(--line); z-index: 5; }
.tabbar button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0; border-radius: 16px; color: var(--muted); font-size: 12.5px; transition: color .2s; }
.tabbar button .ic { width: 26px; height: 26px; }
.tabbar button.on { color: var(--mint); }
.tabbar button.on .ic { filter: drop-shadow(0 0 10px color-mix(in srgb, var(--mint) 60%, transparent)); }
body.immersive .tabbar { transform: translate(-50%, 110%); transition: transform .3s var(--ease); }

/* ---------- bottom sheet ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 20; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); opacity: 0; transition: opacity .3s; }
.sheet { position: absolute; bottom: 0; left: 50%; width: min(100%, 640px); max-height: 88vh; overflow-y: auto; transform: translate(-50%, 100%); transition: transform .35s var(--ease); background: var(--bg2); border-radius: 30px 30px 0 0; padding: 10px 20px calc(24px + var(--safe-bottom)); border-top: 1px solid var(--line); }
.sheet-wrap.open .sheet-backdrop { opacity: 1; }
.sheet-wrap.open .sheet { transform: translate(-50%, 0); }
.grab { width: 44px; height: 5px; border-radius: 9px; background: var(--line); margin: 0 auto 10px; }
.sheet h2 { margin-top: 6px; }
.explain-box { padding: 14px 16px; border-radius: 18px; background: var(--surface); margin: 12px 0; font-size: 15.5px; }
.explain-box.ai { border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); }
.explain-box.ai b { color: var(--gold); display: flex; align-items: center; gap: 6px; font-size: 14px; margin-bottom: 4px; }
.explain-box.ai .ic { width: 18px; height: 18px; }
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 16px 0; }
.stepper button { width: 64px; height: 64px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; }
.stepper button .ic { width: 28px; height: 28px; }
.stepper .v { font-size: 48px; font-weight: 700; text-align: center; flex: 1; line-height: 1; }
.stepper .v small { display: block; font-size: 14px; font-weight: 400; color: var(--muted); margin-top: 6px; }
.scale-bar { position: relative; height: 16px; border-radius: 99px; margin: 26px 4px 8px; background: linear-gradient(90deg, #E9DCC9, #B8946A, #6E4A2D); }
[dir=rtl] .scale-bar { background: linear-gradient(270deg, #E9DCC9, #B8946A, #6E4A2D); }
.scale-bar i { position: absolute; top: 50%; width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 4px solid var(--mint); transform: translate(50%, -50%); transition: inset-inline-start .3s var(--ease); box-shadow: 0 4px 12px rgba(0, 0, 0, .35); }
.scale-ends { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }

/* ---------- camera ---------- */
.camera { position: fixed; inset: 0; z-index: 30; background: #000; height: 100dvh; overflow: hidden; }
.camera[hidden] { display: none; }
.camera video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-frame { position: absolute; inset: calc(14% + var(--safe-top)) 9% calc(230px + var(--safe-bottom)); pointer-events: none; }
.cam-frame span { position: absolute; width: 46px; height: 46px; border: 4px solid #fff; border-radius: 6px; opacity: .9; }
.cam-frame span:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 22px; }
.cam-frame span:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 22px; }
.cam-frame span:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 22px; }
.cam-frame span:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 22px; }
.cam-hint { position: absolute; top: calc(14% + var(--safe-top) - 46px); width: 100%; text-align: center; color: #fff; text-shadow: 0 2px 8px #000; margin: 0; font-size: 16px; }
.cam-btn { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .18); color: #fff; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.cam-close { position: absolute; z-index: 2; top: calc(16px + var(--safe-top)); inset-inline-end: 16px; }
/* bottom bar sits on a dark band above the iPhone home indicator, always visible */
.cam-bar { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 22px 20px calc(22px + var(--safe-bottom)); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; justify-items: center; row-gap: 10px;
  background: linear-gradient(0deg, rgba(0, 0, 0, .85) 55%, transparent); }
.cam-side { display: grid; justify-items: center; gap: 6px; color: #fff; font-size: 13px; cursor: pointer; }
.cam-side.ghost { visibility: hidden; }
.shutter { width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; background: transparent; border: 5px solid #fff; transition: transform .15s, opacity .2s; }
.shutter .shutter-ring { width: 68px; height: 68px; border-radius: 50%; background: linear-gradient(160deg, var(--gold), var(--mint)); }
.shutter:active { transform: scale(.9); }
.shutter:disabled { opacity: .35; }
.shutter-label { grid-column: 1 / -1; margin: 0; color: #fff; font-weight: 600; font-size: 16px; }
/* no live camera: two big real buttons */
.camera.native { background: radial-gradient(90% 60% at 50% 0%, #2A2018, var(--bg)); }
.camera.native video, .camera.native .cam-frame, .camera.native .cam-hint { display: none; }
.cam-native { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: calc(70px + var(--safe-top)) 24px calc(30px + var(--safe-bottom)); text-align: center; color: var(--text); }
.cam-native h2 { justify-content: center; margin: 6px 0 0; font-size: 26px; }
.cam-native p { color: var(--muted); margin: 0 0 14px; }
.cam-native-ic { width: 96px; height: 96px; margin: 0 auto; border-radius: 30px; display: grid; place-items: center; color: var(--on-mint); background: linear-gradient(135deg, var(--mint), var(--mint2)); }
.cam-native-ic .ic { width: 50px; height: 50px; }
.cam-native label.cta { cursor: pointer; }

#toast { position: fixed; top: calc(14px + var(--safe-top)); left: 50%; transform: translate(-50%, calc(-100% - 40px - var(--safe-top))); opacity: 0; visibility: hidden; transition: transform .35s var(--ease), opacity .25s, visibility .35s; z-index: 40; background: var(--text); color: var(--bg); padding: 13px 20px; border-radius: 18px; font-size: 15px; max-width: calc(100% - 32px); transition: transform .35s var(--ease); box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
#toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }

/* ---------- v3 additions ---------- */
.morning { width: 100%; display: flex; align-items: center; gap: 14px; padding: 16px 18px; margin: 4px 0 6px; border-radius: var(--radius); text-align: start;
  background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 26%, var(--surface)), var(--surface) 75%); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); }
.morning .sun { font-size: 40px; }
.morning small { display: block; color: var(--muted); font-size: 13px; }
.morning b { display: block; font-size: 19px; }
.morning .go { margin-inline-start: auto; width: 52px; height: 52px; border-radius: 18px; background: var(--gold); color: var(--on-gold); display: grid; place-items: center; flex: none; }
.mini-seg { margin-inline-start: auto; display: flex; gap: 4px; padding: 4px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); }
.mini-seg button { white-space: nowrap; padding: 5px 12px; border-radius: 99px; font-size: 13px; font-weight: 400; color: var(--muted); }
.mini-seg button.on { background: var(--surface2); color: var(--text); box-shadow: 0 0 0 1.5px var(--mint) inset; }
.mode-seg { margin-top: 14px; }
.ice-card { width: 100%; display: flex; align-items: center; gap: 14px; margin-top: 12px; padding: 14px 16px; border-radius: 22px; text-align: start; position: relative;
  background: linear-gradient(135deg, color-mix(in srgb, #7FD3FF 22%, var(--surface)), var(--surface)); border: 1px solid color-mix(in srgb, #7FD3FF 40%, transparent); }
.ice-card .emo { font-size: 36px; }
.ice-card b { display: block; font-size: 20px; }
.ice-card small { color: var(--muted); font-size: 13px; }
.ice-card .q, .q-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--surface2); color: var(--muted); font-size: 12px; display: inline-grid; place-items: center; margin-inline-start: auto; }
.pour-list { display: grid; gap: 8px; margin-top: 12px; }
.pour-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: var(--surface); text-align: start; width: 100%; }
.pour-row .pn { width: 34px; height: 34px; border-radius: 12px; background: color-mix(in srgb, var(--mint) 18%, transparent); color: var(--mint); display: grid; place-items: center; font-weight: 700; flex: none; }
.pour-row > div { flex: 1; min-width: 0; }
.pour-row .kv { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; }
.pour-row .kv i { font-style: normal; font-size: 13px; color: var(--muted); }
.pour-row > .ic { color: var(--muted); width: 18px; }
.ctl { border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.effect { margin: -4px 0 12px; font-size: 14px; color: var(--muted); line-height: 1.6; }
.brew-stats.four { grid-template-columns: repeat(4, 1fr); gap: 8px; }
.brew-stats.four .mini { padding: 10px 4px; }
.brew-stats.four .mini b { font-size: 19px; }
.mini .of { font-size: 12px; color: var(--muted); font-weight: 400; }
.ring-center { width: 100%; height: 100%; }
.chart-legend { display: flex; justify-content: center; gap: 16px; font-size: 12.5px; color: var(--muted); margin: 6px 0 2px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 5px; }
.abc-card { padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); margin: 8px 0 6px; }
.abc { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.slot { position: relative; min-height: 136px; padding: 30px 8px 12px; border-radius: 20px; background: var(--bg2); border: 2px dashed var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; }
.slot.set { border-style: solid; border-color: color-mix(in srgb, var(--mint) 55%, transparent); }
.slot .letter, .letter-sm { position: absolute; top: 8px; inset-inline-start: 8px; width: 28px; height: 28px; border-radius: 10px; background: linear-gradient(135deg, var(--mint), var(--mint2)); color: var(--on-mint); font-weight: 700; display: grid; place-items: center; font-size: 15px; }
.letter-sm { position: static; display: inline-grid; }
.slot .flag { font-size: 30px; line-height: 1; }
.slot b { font-size: 13.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.slot small { color: var(--muted); font-size: 12px; }

/* ---------- coffee icon system ---------- */
.ic.xs { width: 16px; height: 16px; vertical-align: -3px; }
.emo .ic { width: var(--s, 40px); height: var(--s, 40px); }
.emo.tint, .flag.tint { color: var(--mint); }
.flag .ic { width: 32px; height: 32px; color: var(--mint); }
.sum-row .emo .ic { width: 30px; height: 30px; }
.sum-row .emo { display: flex; gap: 3px; justify-content: center; align-items: center; }
.dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 -2px 4px rgba(0, 0, 0, .25); flex: none; }
.dot.lg { width: 40px; height: 40px; box-shadow: inset 0 -5px 10px rgba(0, 0, 0, .28), 0 0 0 4px color-mix(in srgb, currentColor 0%, transparent); }
.orb-emo .ic { width: 58px; height: 58px; color: var(--text); }
.sun .ic { width: 40px; height: 40px; color: var(--gold); }
.morning.empty-m { background: var(--surface); border-style: dashed; }
.morning.empty-m .go { background: var(--surface2); color: var(--gold); }
.badge .ic { width: 15px; height: 15px; }
.why .ic, .taste .ic { color: var(--gold); }
.stars { display: inline-flex; gap: 2px; color: var(--line); }
.stars .ic.on { color: var(--gold); }
.faces.cups button { filter: none; color: var(--line); display: grid; place-items: center; }
.faces.cups button .ic { width: 38px; height: 38px; }
.faces.cups button.sel { color: var(--gold); transform: none; box-shadow: none; background: color-mix(in srgb, var(--gold) 14%, var(--surface)); }
.score-word { text-align: center; color: var(--muted); margin: 8px 0 0; min-height: 24px; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 16px 10px; border-radius: 20px; background: var(--bg2); border: 2px solid var(--line); transition: .2s; }
.mode .ic { width: 42px; height: 42px; color: var(--muted); }
.mode b { font-size: 16px; }
.mode small { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.mode.on { border-color: var(--mint); background: color-mix(in srgb, var(--mint) 12%, var(--bg2)); }
.mode.on .ic { color: var(--mint); }
.hint { color: var(--muted); font-size: 13px; text-align: center; margin: 10px 0 0; }
.tl-pour small .ic.xs { width: 13px; height: 13px; vertical-align: -2px; }
.q-dot { border: 0; cursor: pointer; }

/* ---------- before-you-start + ice ---------- */
.prep { margin-top: 14px; padding: 16px; border-radius: 22px; background: linear-gradient(160deg, color-mix(in srgb, #7FD3FF 12%, var(--surface)), var(--surface) 70%); border: 1px solid var(--line); }
.prep-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.prep-head b { display: flex; align-items: center; gap: 8px; font-size: 17px; }
.prep ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: s; }
.prep li { display: flex; align-items: center; gap: 12px; font-size: 15.5px; counter-increment: s; }
.prep li::before { content: counter(s); width: 24px; height: 24px; border-radius: 50%; background: var(--surface2); color: var(--muted); font-size: 13px; display: grid; place-items: center; flex: none; }
.prep li .ic { width: 26px; height: 26px; color: var(--mint); flex: none; }
.prep li small { color: var(--muted); }
.prep .cta { margin-top: 12px; padding: 14px; font-size: 16px; }
.warn-s { color: var(--gold); font-size: 12.5px; margin: 8px 0 0; }
.tile .warn-s { margin: 2px 0 0; }
.ice-big { display: flex; flex-direction: column; align-items: center; margin: 6px 0 12px; }
.ice-big b { font-size: 64px; line-height: 1; color: #7FD3FF; }
.ice-big span { font-size: 18px; }
.ice-big small { color: var(--muted); }
.meter.big { height: 14px; margin: 4px 0 0; }

.alt-bars { display: inline-flex; align-items: flex-end; gap: 3px; height: 32px; flex: none; }
.alt-bars i { width: 7px; border-radius: 3px; background: var(--line); }
.alt-bars i.on { background: linear-gradient(var(--mint), var(--mint2)); }
.wide-tile .alt-bars { width: 40px; justify-content: center; }
.lib-item .del { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; color: var(--muted); flex: none; }
.lib-item .del:active { color: var(--rose); }
.lib-item .del .ic { width: 20px; height: 20px; }
.cta.danger { background: var(--rose); color: #fff; box-shadow: none; }
.temp-line { font-size: 13.5px; color: var(--muted); margin: 10px 0 0; line-height: 1.6; }
.temp-line .ic { color: #7FD3FF; }
.brand b { letter-spacing: .3px; }

.radius { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.radius button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 2px; border-radius: 16px; background: var(--bg2); border: 2px solid var(--line); font-weight: 700; font-size: 15px; }
.radius button span { width: 40px; height: 40px; display: grid; place-items: center; }
.radius button span::before { content: ""; width: var(--r); height: var(--r); border-radius: 50%; border: 2px dashed var(--mint); }
.radius button small { font-size: 11px; font-weight: 400; color: var(--muted); }
.radius button small.rec { color: var(--gold); }
.radius button.on { border-color: var(--mint); background: color-mix(in srgb, var(--mint) 12%, var(--bg2)); }

.read-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.read-chips span { padding: 3px 10px; border-radius: 99px; background: var(--surface2); color: var(--text); direction: ltr; }

.pill.warn { border-color: var(--gold); color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, var(--surface)); }
.pill.warn::before { background: var(--gold); }
.water-card { display: flex; gap: 12px; padding: 14px 16px; border-radius: 18px; background: var(--surface); margin: 8px 0 12px; }
.water-card .ic { width: 30px; height: 30px; color: #7FD3FF; flex: none; }
.water-card.low { border: 1px solid var(--gold); }
.water-card.low .ic { color: var(--gold); }
.water-card small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 3px; }

.steps-big { list-style: none; margin: 14px 0; padding: 0; display: grid; gap: 10px; counter-reset: st; }
.steps-big li { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; background: var(--surface); counter-increment: st; }
.steps-big li::before { content: counter(st); width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--mint), var(--mint2)); color: var(--on-mint); font-weight: 700; display: grid; place-items: center; flex: none; }
.steps-big li > div { flex: 1; min-width: 0; }
.steps-big small { display: block; color: var(--muted); font-size: 13px; }
.cta.step-btn { width: auto; padding: 10px 14px; font-size: 14px; border-radius: 14px; flex: none; text-decoration: none;  white-space: nowrap; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ================= account · subscription ================= */
.field { display: grid; gap: 6px; margin: 4px 0 14px; }
.field span { font-size: 14px; color: var(--muted); }
.field input, .otp { width: 100%; font: inherit; font-size: 18px; color: var(--text); background: var(--surface); border: 1.5px solid var(--line); border-radius: 18px; padding: 16px 18px; outline: none; transition: border-color .2s; }
.field input:focus, .otp:focus { border-color: var(--mint); }
.field input.bad, .otp.bad { border-color: var(--rose); animation: shake .3s; }
.otp { text-align: center; font-size: 34px; letter-spacing: 14px; margin: 6px 0 14px; padding: 14px; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-inline-end-color: transparent; display: inline-block; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fine { font-size: 12.5px; color: var(--muted); text-align: center; margin: 12px 0 0; line-height: 1.7; }
.fine a, .legal a { color: var(--mint); }
.pw-hero { text-align: center; padding: 6px 0 4px; }
.pw-hero h2 { justify-content: center; white-space: normal; font-size: 24px; margin: 12px 0 6px; }
.pw-badge { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 99px; font-weight: 700; font-size: 14px; color: var(--on-gold); background: linear-gradient(135deg, var(--gold), var(--gold2)); }
.pw-badge .ic { width: 16px; height: 16px; }
.pw-hero .burst { width: 84px; height: 84px; margin: 6px auto; border-radius: 28px; display: grid; place-items: center; color: var(--on-gold); background: linear-gradient(135deg, var(--gold), var(--gold2)); box-shadow: var(--gold-glow); animation: pop .6s var(--ease); }
.pw-hero .burst .ic { width: 44px; height: 44px; }
@keyframes pop { from { transform: scale(.4) rotate(-20deg); opacity: 0; } }
.perks { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 4px; }
.perks li { display: flex; gap: 12px; align-items: center; padding: 8px 4px; }
.perks .pk { width: 40px; height: 40px; flex: none; border-radius: 14px; display: grid; place-items: center; color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, transparent); }
.perks small { display: block; color: var(--muted); font-size: 13px; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 14px; }
.plan { position: relative; display: grid; gap: 2px; justify-items: center; padding: 20px 10px 14px; border-radius: 22px; background: var(--surface); border: 1.5px solid var(--line); transition: .2s var(--ease); }
.plan.sel { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 8%, var(--surface)); box-shadow: var(--gold-glow); }
.plan .price { font-size: 24px; font-weight: 700; }
.plan small { color: var(--muted); font-size: 12.5px; }
.plan .tag { position: absolute; top: -11px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--gold); color: var(--on-gold); }
.pay-loading { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 30px; color: var(--muted); }
.mysr-form { margin: 8px 0; min-height: 120px; }
.acct-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.acct-head small { display: block; color: var(--muted); font-size: 13px; }
.acct-head .badge { margin-inline-start: auto; }
.badge.pro { color: var(--on-gold); background: linear-gradient(135deg, var(--gold), var(--gold2)); font-weight: 700; }
.avatar { width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; font-weight: 700; font-size: 20px; color: var(--on-mint); background: linear-gradient(135deg, var(--mint), var(--mint2)); }
.acct-links { display: flex; justify-content: space-between; margin-top: 14px; font-size: 14px; }
.acct-links button { color: var(--muted); padding: 6px 0; }
.danger-link, .danger-text { color: var(--rose) !important; }
.pay-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.pay-row div { flex: 1; } .pay-row small { display: block; color: var(--muted); font-size: 13px; }
.legal { text-align: center; color: var(--muted); font-size: 12px; line-height: 1.8; margin: 20px 0 8px; }

/* ================= beans ("محاصيلي") ================= */
.muted { color: var(--muted); }
.quota { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; margin-bottom: 12px; border-radius: 18px; background: var(--surface); text-align: start; }
.quota small { display: block; color: var(--muted); font-size: 12.5px; }
.quota .bar { flex: 1; height: 8px; border-radius: 9px; background: var(--surface2); overflow: hidden; }
.quota .bar i { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg, var(--mint), var(--gold)); }
.quota .up { font-size: 13px; font-weight: 700; color: var(--gold); white-space: nowrap; }
.sync-hint { display: flex; gap: 10px; align-items: center; width: 100%; padding: 12px 14px; margin-bottom: 12px; border-radius: 18px; text-align: start; font-size: 14px; border: 1px dashed color-mix(in srgb, var(--mint) 50%, transparent); color: var(--muted); }
.sync-hint b { color: var(--mint); }
.beans { display: grid; gap: 12px; margin-top: 14px; }
@media (min-width: 560px) { .beans { grid-template-columns: 1fr 1fr; } }
.bean { padding: 16px; border-radius: 24px; background: linear-gradient(160deg, var(--surface2), var(--surface)); border: 1px solid var(--line); cursor: pointer; transition: transform .2s var(--ease), border-color .2s; }
.bean:active { transform: scale(.98); }
.bean:hover { border-color: color-mix(in srgb, var(--mint) 40%, var(--line)); }
.bean.done { opacity: .7; }
.bean-top { display: flex; align-items: center; gap: 12px; }
.bean-top .flag { font-size: 34px; line-height: 1; }
.bean-id { flex: 1; min-width: 0; }
.bean-id b { display: block; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bean-id small { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.round.play { background: linear-gradient(135deg, var(--mint), var(--mint2)); color: var(--on-mint); border: 0; box-shadow: var(--glow); }
.bean-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.bean-tags span { font-size: 12.5px; padding: 4px 10px; border-radius: 99px; background: var(--bg2); color: var(--muted); }
.bean-tags .flav { color: var(--text); background: color-mix(in srgb, var(--c) 18%, transparent); }
.bean-foot { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.stars .ic.on { color: var(--gold); }
.fresh { position: relative; margin-inline-start: auto; width: 86px; height: 22px; border-radius: 99px; background: var(--bg2); overflow: hidden; display: grid; place-items: center; }
.fresh i { position: absolute; inset-block: 0; inset-inline-start: 0; background: color-mix(in srgb, var(--mint) 28%, transparent); }
.fresh.rest i { background: color-mix(in srgb, var(--mint2) 22%, transparent); }
.fresh.ok i { background: color-mix(in srgb, var(--gold) 25%, transparent); }
.fresh.old i { background: color-mix(in srgb, var(--rose) 25%, transparent); }
.fresh em { position: relative; font-style: normal; font-size: 11.5px; }
.empty.rich { background: var(--surface); border-radius: 26px; padding: 34px 20px; margin-top: 14px; }
.empty.rich b { display: block; color: var(--text); font-size: 19px; }
.empty.rich p { margin: 6px 0 18px; }
.bean-hero { display: flex; align-items: center; gap: 14px; }
.bean-hero h2 { margin: 0; white-space: normal; }
.bean-hero small { color: var(--muted); font-size: 13.5px; }
.flag.big { font-size: 48px; line-height: 1; }
.flag.big .ic { width: 44px; height: 44px; }
.kpis { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; margin: 16px 0; }
.kpis > div { padding: 12px 6px; border-radius: 18px; background: var(--surface); text-align: center; }
.kpis b { display: block; font-size: 22px; }
.kpis b em { font-size: 12px; font-style: normal; color: var(--muted); }
.kpis small { color: var(--muted); font-size: 12px; }
.fresh-kpi.peak b { color: var(--mint); } .fresh-kpi.old b { color: var(--rose); } .fresh-kpi.ok b { color: var(--gold); }
.best { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; margin-bottom: 10px; border-radius: 22px; text-align: start; background: linear-gradient(135deg, color-mix(in srgb, var(--mint) 18%, var(--surface)), var(--surface)); border: 1.5px solid color-mix(in srgb, var(--mint) 45%, transparent); }
.best > div { flex: 1; } .best small { display: block; color: var(--muted); font-size: 12.5px; }
.best .round { background: var(--mint); color: var(--on-mint); border: 0; }
h3.sub { font-size: 15px; color: var(--muted); margin: 20px 0 8px; }
.brews { display: grid; gap: 6px; }
.brew-row { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 16px; background: var(--surface); font-size: 14px; text-align: start; }
.brew-row small { margin-inline-start: auto; color: var(--muted); font-size: 12px; }
.verdict { font-size: 11.5px; padding: 2px 8px; border-radius: 99px; background: var(--bg2); color: var(--muted); }
.v-perfect { color: var(--mint); } .v-sour { color: var(--gold); } .v-bitter { color: var(--rose); }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.sheet-actions .cta { font-size: 15px; padding: 14px; }
.known { text-align: center; }
.known h2 { justify-content: center; margin: 10px 0 4px; }
.known .best { margin-top: 14px; }
.community { text-align: start; padding: 14px 16px; border-radius: 20px; margin: 10px 0 12px; background: color-mix(in srgb, var(--gold) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent); }
.community b:first-child { display: flex; gap: 6px; align-items: center; color: var(--gold); font-size: 14px; }
.community p { margin: 6px 0 0; font-size: 14.5px; }
.tabbar button span { font-size: 11.5px; white-space: nowrap; }

/* ================= photography ================= */
/* the bag shows through the scan card's far edge; the dripper sits behind the quick card */
.action.primary { background: linear-gradient(260deg, var(--mint) 38%, color-mix(in srgb, var(--mint2) 78%, transparent) 70%, color-mix(in srgb, var(--mint2) 30%, transparent)), url(assets/img/bag-800.webp) -50px 72% / auto 175% no-repeat, var(--mint2); }
.action.primary::after { display: none; }
.action.secondary { background: linear-gradient(260deg, var(--surface) 42%, color-mix(in srgb, var(--surface) 70%, transparent) 70%, color-mix(in srgb, var(--surface) 20%, transparent)), url(assets/img/grinder-800.webp) left center / 55% auto no-repeat, var(--surface); }
.empty.rich { background: linear-gradient(0deg, var(--surface) 45%, color-mix(in srgb, var(--surface) 40%, transparent)), url(assets/img/beans-800.webp) center top / cover; padding-top: 120px; }
.pw-hero:not(.done) { margin: -8px -4px 0; padding: 70px 10px 6px; border-radius: 24px; background: linear-gradient(0deg, var(--bg2) 15%, color-mix(in srgb, var(--bg2) 30%, transparent) 75%), url(assets/img/beans-800.webp) center / cover; }

/* ================= typography ================= */
h1, h2, .pw-hero h2, .action b, .plan .price, .kpis b, .avatar, .brand b { font-family: var(--font-display); font-weight: 700; letter-spacing: -.2px; }
h1 { font-weight: 700; }
.num, .stat .val { font-family: var(--font-display); font-weight: 500; }
b, strong { font-weight: 600; }
.lead { font-weight: 300; }
.beta-note { padding: 12px 14px; border-radius: 16px; font-size: 14px !important; color: var(--text) !important; background: color-mix(in srgb, var(--gold) 10%, var(--surface2)); border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent); }
.beta-note b { color: var(--gold); }
.gsi { display: grid; place-items: center; min-height: 52px; margin: 10px 0 6px; color-scheme: normal; }
.or { display: flex; align-items: center; gap: 12px; margin: 14px 0; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* flavour picker by family; processing-method icons */
.grid.four { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.grid.four .tile { padding: 12px 6px; min-height: 0; }
.grid.four .tile .emo { font-size: 30px; }
.grid.four .tile b { font-size: 13.5px; line-height: 1.3; }
h3.grp { font-size: 14px; color: var(--muted); font-weight: 600; margin: 18px 2px 8px; }
h3.grp:first-of-type { margin-top: 4px; }
.emo.proc { width: 56px; height: 56px; margin: 0 auto 4px; border-radius: 18px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); }
.emo.proc .ic { width: 30px; height: 30px; }
.tile small.std { color: var(--mint); font-weight: 600; }
.mode-hint { margin: 8px 2px 14px; font-size: 13.5px; color: var(--muted); line-height: 1.7; }
.mode-hint b { color: var(--text); }
.mode-seg button .ic { width: 16px; height: 16px; vertical-align: -3px; }

/* rating */
.rate-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 20px; background: var(--surface); margin-bottom: 6px; }
.rate-head small { display: block; color: var(--muted); font-size: 12.5px; }
.rate-head b { display: block; font-size: 16px; }
.score { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; }
.score button { flex: 1; max-width: 76px; aspect-ratio: .85; border-radius: 20px; background: var(--surface); border: 1.5px solid var(--line); color: var(--muted); display: grid; place-items: center; align-content: center; gap: 4px; transition: transform .2s var(--ease), background .2s, color .2s; }
.score button .ic { width: 34px; height: 34px; }
.score button span { font-size: 12px; }
.score button.sel { color: var(--on-gold); background: linear-gradient(160deg, var(--gold), var(--gold2)); border-color: transparent; }
.score button:active { transform: scale(.94); }
.scale5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.scale5 button { padding: 12px 4px 10px; border-radius: 16px; background: var(--surface); border: 1.5px solid var(--line); display: grid; justify-items: center; gap: 6px; font-size: 12px; color: var(--muted); line-height: 1.3; }
.scale5 button i { width: 14px; height: 14px; border-radius: 50%; background: var(--c, var(--mint)); opacity: .55; }
.scale5.strength button i { width: 10px; height: var(--h); border-radius: 4px; background: var(--mint); }
.scale5 button.on { border-color: var(--mint); color: var(--text); background: color-mix(in srgb, var(--mint) 12%, var(--surface)); }
.scale5 button.on i { opacity: 1; }
h3.sub small { font-weight: 400; color: var(--muted); font-size: 12px; }
.chip .ic { width: 16px; height: 16px; vertical-align: -3px; }
.cta:disabled { opacity: .4; }
.seg.three { grid-template-columns: repeat(3, 1fr); }
.seg .ic.xs { vertical-align: -3px; }
.origin-chips { margin: 12px 0 4px; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.origin-chips .chip { white-space: nowrap; flex: none; }
.bean-tags span .ic { width: 14px; height: 14px; vertical-align: -2px; }
.scale-diff { text-align: center; font-size: 18px; margin: -6px 0 6px; color: var(--muted); }
.scale-diff.ok { color: var(--sage); font-weight: 600; }
.scale-diff.under { color: var(--gold); }
.scale-diff.over { color: var(--rose); }
.scale-diff .ic { width: 18px; height: 18px; vertical-align: -3px; }
.brew-done { text-align: center; }
.brew-done h2 { justify-content: center; margin: 10px 0 4px; }
.brew-done .burst { width: 76px; height: 76px; margin: 4px auto; border-radius: 26px; display: grid; place-items: center; color: var(--on-mint); background: linear-gradient(135deg, var(--mint), var(--mint2)); }
.brew-done .burst .ic { width: 40px; height: 40px; }
.dock.end { position: static; background: none; padding-top: 22px; }
.std-tag { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px; color: var(--mint); background: color-mix(in srgb, var(--mint) 14%, transparent); vertical-align: 2px; }
.emo.proc.sm { width: 40px; height: 40px; border-radius: 13px; margin: 0; }
.emo.proc.sm .ic { width: 22px; height: 22px; }
