:root {
  color-scheme: light;
  --paper: #f3f4ef;
  --surface: #ffffff;
  --ink: #2a1d17;
  --ink-2: #6b5f58;
  --line: #dcdcd4;
  --cherry: #a3172f;
  --cherry-ink: #ffffff;
  --cherry-soft: #f5e1e4;
  --warn: #fbb315;
  --warn-soft: #fdf1d3;
  /* charts (validated reference palette) */
  --series-1: #257de0;
  --series-2: #f47230;
  --ref: #7c7c76;
  --grid: #e2e2dc;
  --axis: #bdbdb6;
  --q1: #6aabf1; --q2: #338ced; --q3: #2370cd; --q4: #1757ac; --q5: #0e3d7e;
  --font: 'Barlow', system-ui, sans-serif;
  --cond: 'Barlow Condensed', 'Barlow', system-ui, sans-serif;
  --nav-h: 64px;
  /* flavour families, in wheel order; checked for contrast and colour-blind separation of neighbours */
  --f-floral: #b865a3; --f-fruity: #bd0f22; --f-sour: #a28c1e; --f-green: #366e28; --f-other: #2c84b9;
  --f-roasted: #be5616; --f-spices: #931a62; --f-nutty: #864718; --f-sweet: #b87a23;
  --r: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #16110e;
    --surface: #211a16;
    --ink: #f1eae4;
    --ink-2: #a99c93;
    --line: #3a2f29;
    --cherry: #e0566e;
    --cherry-ink: #1a0e10;
    --cherry-soft: #3b1f25;
    --warn-soft: #3a2c10;
    --series-1: #338ced;
    --series-2: #e76624;
    --ref: #85807b;
    --grid: #2e2622;
    --axis: #4a3f39;
    --q1: #1757ac; --q2: #2370cd; --q3: #338ced; --q4: #6aabf1; --q5: #9dc8f7;
    --f-floral: #ce7ebd; --f-fruity: #e43657; --f-sour: #c4932e; --f-green: #218a31; --f-other: #3b97bf;
    --f-roasted: #b4663d; --f-spices: #ac326e; --f-nutty: #8e5c1b; --f-sweet: #ce871d;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 16px/1.45 var(--font);
  font-variant-numeric: lining-nums;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
a { color: inherit; text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--cherry); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--cond); font-weight: 600; line-height: 1.1; margin: 0; }
h2 { font-size: 22px; margin: 30px 0 10px; }
h2 a { text-decoration-color: var(--ink-2); }
h3 { font-size: 19px; }
p { margin: 0 0 10px; max-width: 70ch; }
b { font-weight: 600; }
.muted { color: var(--ink-2); }
.hint { color: var(--ink-2); font-size: 14px; }
.center { text-align: center; }
.lede { font-size: 17px; color: var(--ink-2); margin: 0 0 14px; }

#app { max-width: 560px; margin: 0 auto; min-height: 100dvh; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 24px); }
.pad { padding: 0 16px; }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 14px) 16px 12px; background: var(--paper);
}
.topbar h1 { font-size: 32px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: 0.005em; }
.topbar .back { display: grid; place-items: center; width: 36px; height: 36px; margin-left: -8px; border-radius: 50%; color: var(--ink); }
.topbar .back svg, .icon-btn svg, .gear svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.gear { display: grid; place-items: center; width: 40px; height: 40px; color: var(--ink-2); border-radius: 50%; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 14px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: 500 15px var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--cherry); border-color: var(--cherry); color: var(--cherry-ink); }
.btn.big { min-height: 48px; flex: 1; font-size: 16px; }
.btn.huge { min-height: 64px; min-width: 132px; font: 600 24px var(--cond); }
.btn.danger { color: var(--cherry); }
.link { background: none; border: 0; padding: 0; color: var(--ink); font: inherit; text-decoration: underline; text-decoration-color: var(--ink-2); text-underline-offset: 3px; cursor: pointer; }
.link.small { font-size: 13px; color: var(--ink-2); }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border: 0; background: none; color: var(--ink-2); border-radius: 50%; cursor: pointer; }
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.actions-row.end { margin-top: 36px; }

/* lists */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rows > li { border-bottom: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; text-decoration: none; color: inherit; min-height: 64px; }
.pad .row { padding-left: 0; padding-right: 0; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-title { font-weight: 600; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.row-meta { display: flex; flex-wrap: wrap; column-gap: 14px; color: var(--ink); font-variant-numeric: tabular-nums; font-size: 15px; }
.row-sub { color: var(--ink-2); font-size: 14px; }
.row-notes { display: flex; flex-wrap: wrap; column-gap: 12px; font-size: 14px; color: var(--ink-2); }
.row-notes span { display: inline-flex; align-items: center; gap: 5px; }
.row-side { flex: none; }
.row-side .pourchart { width: 92px; height: 34px; display: block; }
.score { font: 600 26px var(--cond); font-variant-numeric: tabular-nums; }
.rows.compact .row { min-height: 52px; padding-top: 10px; padding-bottom: 10px; }
.rows.compact .score { font-size: 22px; }
.cat-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }

.empty { padding: 8px 16px 0; }
.empty p { color: var(--ink-2); font-size: 17px; max-width: 34ch; }
.empty .btn { margin-top: 6px; }

/* readout: the scale-display numerals */
.readout { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 4px 0 16px; }
.readout div { display: flex; flex-direction: column; }
.readout b { font: 600 40px/1 var(--cond); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.readout span { font-size: 13px; color: var(--ink-2); margin-top: 4px; }

.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 20px 0; }
.facts div { display: contents; }
.facts dt { color: var(--ink-2); }
.facts dd { margin: 0; }
.notes { white-space: pre-wrap; }
.callout { border-left: 3px solid var(--ink); padding-left: 12px; }

/* forms */
.form { display: block; }
.field { display: flex; flex-direction: column; gap: 4px; margin: 0 0 14px; min-width: 0; }
.field-label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field-hint { font-size: 13px; color: var(--ink-2); }
input[type=text], input[type=search], input[type=date], input[type=datetime-local], select, textarea {
  width: 100%; min-height: 46px; padding: 0 12px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: 400 17px var(--font); font-variant-numeric: tabular-nums; appearance: none; -webkit-appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
textarea { padding: 10px 12px; min-height: 84px; resize: vertical; line-height: 1.4; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--cherry); outline-offset: -1px; border-color: transparent; }
.with-unit { position: relative; display: block; }
.with-unit input { padding-right: 52px; }
.with-unit .unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-2); font-size: 14px; pointer-events: none; }
.grid2, .grid3 { display: grid; gap: 0 12px; }
.grid2 { grid-template-columns: 1fr 1fr; }
.grid3 { grid-template-columns: 1fr 1fr 1fr; }
.grid3 .with-unit input { padding-right: 34px; }
.grid3 .with-unit .unit { right: 9px; }
.warn { background: var(--warn-soft); border-left: 3px solid var(--warn); padding: 10px 12px; border-radius: 0 8px 8px 0; font-size: 15px; }
.switch { display: flex; align-items: center; gap: 10px; margin: 10px 0; font-size: 15px; }
.switch input { width: 20px; height: 20px; accent-color: var(--cherry); }

details.tool { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 16px 0; }
details.tool + details.tool { margin-top: -17px; }
details.tool > summary { list-style: none; cursor: pointer; padding: 14px 0; font-weight: 500; display: flex; justify-content: space-between; align-items: center; }
details.tool > summary::-webkit-details-marker { display: none; }
details.tool > summary::after { content: ''; width: 8px; height: 8px; border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); transform: rotate(45deg); margin-right: 4px; transition: transform .15s; }
details.tool[open] > summary::after { transform: rotate(-135deg); }
details.tool[open] { padding-bottom: 8px; }

/* chips and segmented scales */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip, .note, .cat {
  min-height: 36px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: 400 15px var(--font); cursor: pointer;
}
.chip.on, .note.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.scale { display: flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.seg { flex: 1; min-height: 42px; border: 0; border-left: 1px solid var(--line); background: none; color: var(--ink); font: 500 16px var(--font); font-variant-numeric: tabular-nums; cursor: pointer; padding: 0 4px; }
.seg:first-child { border-left: 0; }
.seg.on { background: var(--ink); color: var(--paper); }
.scale.meter:has(.seg.on) .seg:not(.on ~ .seg):not(.on) { background: var(--cherry-soft); }
.scale.wide .seg, .scale.words .seg { font-size: 14px; line-height: 1.15; padding: 6px 4px; }
.scale.wide { margin-bottom: 16px; }
.unit-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 16px; color: var(--ink-2); font-size: 14px; }
.unit-row .scale { flex: none; width: 180px; }

/* tasting form */
.block { margin-bottom: 8px; }
.block > h2 { margin-top: 34px; }
.struct { margin: 0 0 18px; }
.struct-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; font-weight: 500; }
.struct-head .muted { font-weight: 400; font-size: 13px; }
.sublabel { font-size: 13px; color: var(--ink-2); margin: 10px 0 6px; }
.search { margin: 6px 0 4px; }
.cats { display: flex; gap: 8px; overflow-x: auto; margin: 8px -16px 4px; padding: 2px 16px 8px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cat { flex: none; display: inline-flex; align-items: center; gap: 7px; }
.cat.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); font-weight: 500; }
.groups { border-left: 3px solid var(--cat); padding: 2px 0 2px 12px; margin: 8px 0 12px; }
.group { margin-bottom: 12px; }
.group-label { font-size: 13px; color: var(--ink-2); margin: 0 0 6px; }
.notes-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.note { min-height: 34px; padding: 0 12px; font-size: 15px; }
.sel-title { margin: 18px 0 8px; font-size: 18px; }
.selected { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.selected li { border-bottom: 1px solid var(--line); padding: 10px 0 12px; }
.sel-head { display: flex; align-items: center; gap: 8px; }
.sel-head b { font-size: 17px; }
.sel-head .muted { font-size: 13px; flex: 1; }
.sel-controls { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.sel-controls .scale .seg { min-height: 36px; font-size: 14px; }
.sel-controls .chip { min-height: 32px; font-size: 14px; }
.score-live { display: flex; align-items: baseline; gap: 10px; margin-top: 6px; min-height: 52px; }
.score-live b { font: 600 52px/1 var(--cond); }
.score-live span { color: var(--ink-2); }
.ey { font-size: 15px; color: var(--ink-2); }
.ey b { color: var(--ink); font-size: 17px; }

/* tasting page */
.tasted { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.tasted li { display: grid; grid-template-columns: 12px auto auto 1fr; align-items: center; gap: 4px 10px; }
.tasted b { font-size: 18px; font-weight: 500; }
.tasted .muted { font-size: 13px; text-align: right; }
.pips { display: inline-flex; gap: 3px; }
.pips i { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--ink-2); }
.pips i.on { background: var(--ink); border-color: var(--ink); }
.struct-sum { list-style: none; padding: 0; margin: 0; }
.struct-sum li { display: grid; grid-template-columns: 96px 54px 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.struct-sum span { color: var(--ink-2); }
.struct-sum b { font: 600 20px var(--cond); font-variant-numeric: tabular-nums; }
.struct-sum em { font-style: normal; }
.next { margin: 28px 0 8px; padding: 14px 16px 16px; background: var(--cherry-soft); border-radius: 12px; }
.next h2 { margin: 0 0 8px; }
.next ul { margin: 0 0 12px; padding-left: 20px; }
.next li { margin-bottom: 4px; }
.next .btn { white-space: normal; text-align: left; padding: 10px 14px; line-height: 1.25; }

/* recipe page */
table.pours { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; margin-bottom: 8px; }
.pours th { text-align: left; font: 500 13px var(--font); color: var(--ink-2); padding: 6px 8px 6px 0; border-bottom: 1px solid var(--line); }
.pours td { padding: 8px 8px 8px 0; border-bottom: 1px solid var(--line); }
.pours td b { font: 600 20px var(--cond); }
.pourchart { overflow: visible; }
.pourchart.big { width: 100%; height: auto; display: block; margin: 6px 0 4px; }
.pourline { fill: none; stroke: var(--cherry); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.pourchart .pt { fill: var(--cherry); stroke: var(--paper); stroke-width: 2; }
.pourchart .tick { fill: var(--ink-2); font: 11px var(--font); font-variant-numeric: tabular-nums; }
.pourchart .grid { stroke: var(--grid); stroke-width: 1; }
.pourchart .axis { stroke: var(--axis); stroke-width: 1; }
.diff { list-style: none; padding: 0; margin: 0; }
.diff li { display: grid; grid-template-columns: 110px auto 1fr; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.diff span { color: var(--ink-2); }
.diff s { color: var(--ink-2); text-decoration-thickness: 1px; }
.pour-edit { display: flex; flex-direction: column; gap: 8px; }
.pour-row { display: grid; grid-template-columns: 72px 92px 1fr 36px; gap: 8px; align-items: center; }
.pour-row input { padding: 0 10px; }
.pour-row .with-unit input { padding-right: 26px; }
.pour-row .with-unit .unit { right: 9px; }

/* water */
.steps { padding-left: 22px; margin: 0 0 14px; }
.steps > li { margin-bottom: 10px; padding-left: 4px; }
.dose { list-style: none; padding: 0; margin: 8px 0 0; }
.dose li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.dose b { font: 600 26px var(--cond); font-variant-numeric: tabular-nums; min-width: 78px; }
.dose em { font-style: normal; color: var(--ink-2); font-size: 14px; flex-basis: 100%; padding-left: 88px; }
.salt-rows { display: flex; flex-direction: column; gap: 8px; }
.salt-row { display: grid; grid-template-columns: 1fr 104px 36px; gap: 8px; align-items: center; }
.salt-row .with-unit input { padding-right: 34px; }
.result { border-top: 1px solid var(--line); margin-top: 8px; }

/* timer */
.timer-screen ~ #tabs, body.timing #tabs { display: none; }
.timer { padding: 4px 16px 24px; display: flex; flex-direction: column; gap: 10px; }
.t-elapsed { font: 500 104px/0.9 var(--cond); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.t-now { display: flex; flex-direction: column; }
.t-now span { font-size: 18px; color: var(--ink-2); }
.t-now b { font: 600 72px/1 var(--cond); color: var(--cherry); font-variant-numeric: tabular-nums; }
.t-next { min-height: 22px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.t-bar { position: relative; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 6px 0; }
.t-bar span { position: absolute; inset: 0 auto 0 0; background: var(--cherry); }
.t-bar i { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--paper); }
.ladder { list-style: none; padding: 0; margin: 4px 0; }
.ladder li { display: grid; grid-template-columns: 56px 80px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; color: var(--ink-2); }
.ladder li.done { color: var(--ink-2); text-decoration: line-through; text-decoration-color: var(--line); }
.ladder li.now { color: var(--ink); font-weight: 600; }
.ladder li.now .l-to { color: var(--cherry); }
.l-to { font-weight: 600; }
.t-controls { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-top: 8px; }
.t-controls .btn:not(.huge) { flex: 1; min-height: 52px; }

/* charts */
.chart-block { margin: 30px 0 0; }
.chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.chart-sub { color: var(--ink-2); font-size: 14px; }
.chart { width: 100%; height: auto; display: block; overflow: visible; font-family: var(--font); }
.chart .tick { fill: var(--ink-2); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .axis-title { fill: var(--ink-2); font-size: 12px; }
.chart .row-label { fill: var(--ink); font-size: 13px; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--axis); stroke-width: 1; }
.chart .zone { fill: var(--ink); opacity: 0.06; }
.chart .zone-label { fill: var(--ink-2); font-size: 11px; }
.chart .trend { stroke: var(--ink-2); stroke-width: 1.5; opacity: 0.7; }
.chart .connector { stroke: var(--axis); stroke-width: 2; }
.chart .dot { cursor: pointer; outline: none; }
.chart .dot .hit { fill: transparent; }
.chart .dot .mark { fill: var(--series-1); stroke: var(--paper); stroke-width: 2; }
.chart .dot.s2 .mark { fill: var(--series-2); }
.chart .dot.ref .mark { fill: var(--ref); }
.chart .dot.q0 .mark { fill: var(--paper); stroke: var(--ink-2); stroke-width: 1.5; }
.chart .dot.q1 .mark { fill: var(--q1); } .chart .dot.q2 .mark { fill: var(--q2); } .chart .dot.q3 .mark { fill: var(--q3); } .chart .dot.q4 .mark { fill: var(--q4); } .chart .dot.q5 .mark { fill: var(--q5); }
.chart .dot.hover .mark, .chart .dot:focus-visible .mark { stroke: var(--ink); stroke-width: 2; }
.chart .dot-label { fill: var(--ink); font-size: 11px; font-weight: 500; }
.chart .dot.ref .dot-label { fill: var(--ink-2); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--ink-2); margin: 6px 0 0; }
.legend.inline { display: inline-flex; margin: 0; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.key { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--series-1); }
.key.s2 { background: var(--series-2); } .key.ref { background: var(--ref); }
.key.q0 { background: var(--paper); border: 1.5px solid var(--ink-2); }
.key.q1 { background: var(--q1); } .key.q2 { background: var(--q2); } .key.q3 { background: var(--q3); } .key.q4 { background: var(--q4); } .key.q5 { background: var(--q5); }
.hbars { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.hbar { display: grid; grid-template-columns: minmax(96px, 38%) 1fr 34px; align-items: center; gap: 10px; min-height: 28px; outline: none; border-radius: 4px; }
.hbar-label { display: flex; align-items: center; gap: 7px; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { height: 12px; }
.hbar-fill { display: block; height: 12px; background: var(--series-1); border-radius: 0 4px 4px 0; min-width: 2px; }
.hbar.hover .hbar-fill, .hbar:focus-visible .hbar-fill { filter: brightness(1.12); }
.hbar-val { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; text-align: right; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.data th { text-align: left; font-weight: 500; color: var(--ink-2); padding: 6px 8px 6px 0; border-bottom: 1px solid var(--line); }
.data td { padding: 7px 8px 7px 0; border-bottom: 1px solid var(--line); }
.board td:first-child { width: 55%; }
.filters { display: flex; gap: 8px; margin: 0 0 16px; }
.filters select { min-height: 40px; font-size: 15px; }
.chart-block .filters { margin: 8px 0 6px; }

/* tooltip & toast */
#tip { position: fixed; left: 0; top: 0; z-index: 50; max-width: 240px; padding: 6px 10px; border-radius: 8px; background: var(--ink); color: var(--paper); font-size: 13px; line-height: 1.35; pointer-events: none; }
#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 14px); z-index: 40; display: flex; align-items: center; gap: 14px; max-width: calc(100% - 32px); padding: 11px 16px; border-radius: 12px; background: var(--ink); color: var(--paper); font-size: 15px; }
#toast[hidden], #tip[hidden] { display: none; }
#toast button { background: none; border: 0; color: var(--paper); font: 600 15px var(--font); text-decoration: underline; padding: 0; }

/* bottom navigation */
#tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: center; background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
#tabs .tabs-inner { display: grid; grid-template-columns: repeat(5, 1fr); width: 100%; max-width: 560px; }
#tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: var(--nav-h); color: var(--ink-2); text-decoration: none; font-size: 12px; font-weight: 500; }
#tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#tabs a[aria-current=page] { color: var(--ink); }
#tabs a[aria-current=page] svg { stroke: var(--cherry); stroke-width: 2; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (min-width: 600px) { body { padding-top: 12px; } }

/* Flavour-family pictograms and the flavour ring */
.fi { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: -3px; }
.fi.sm { width: 15px; height: 15px; vertical-align: -2px; }
.ring { position: relative; display: inline-grid; place-items: center; flex: none; }
.ring svg { position: absolute; inset: 0; }
.ring-c { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; line-height: 1; }
.row > .ring { margin-right: -2px; }
.tasted li { grid-template-columns: 20px auto auto 1fr; }
.sel-head .fi, .tasted .fi { width: 20px; height: 20px; }
.hbar-label .fi { margin-right: 6px; }
.meta { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0 0 18px; font-size: 15px; }
.meta div { display: contents; }
.meta dt { color: var(--ink-2); font-size: 13px; padding-top: 2px; }
.meta dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.cup-hero { display: flex; align-items: center; gap: 20px; margin: 4px 0 14px; }
.cup-hero .ring-c b { font: 600 42px/1 var(--cond); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.cup-hero .ring-c b.n5 { font-size: 34px; }
.cup-hero .ring-c b.n6 { font-size: 30px; }
.cup-hero .ring-c span { font-size: 12px; color: var(--ink-2); margin-top: 5px; }
.cup-hero .hint { margin: 0; }
.fam-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; min-width: 0; flex: 1; }
.fam-legend li { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 8px; font-size: 15px; }
.fam-legend .fi { width: 20px; height: 20px; }
.fam-legend b { font-weight: 500; font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 14px; }
.readout.small { gap: 6px 26px; }
.readout.small b { font-size: 24px; }
