/* "Back bar" look: bar-signage display type, spec-sheet measurements, ink and one cherry accent.
   Layout: a dark top bar, the drink index on the left, the open spec on the right. The home page is full width. */
:root {
  color-scheme: light;
  --bg: #F5F5F2;
  --surface: #F5F5F2;
  --raised: #FFFFFF;
  --ink: #121418;
  --muted: #5E626B;
  --rule: #D9DAD4;
  --accent: #B3122E;
  --accent-ink: #FFFFFF;
  --accent-soft: #F7E1E4;
  --green: #121418;
  --green-soft: #ECECE6;
  --danger: #A3302A;
  --focus: #1F5F8B;
  --bar-bg: #121418;
  --bar-ink: #F5F5F2; --bar-red: #E8394F; --bar-red-hi: #FF5A6E;
  --bar-muted: #C9CCD2;
  --bar-line: #4A4E57;
  --f-display: "Big Shoulders Display", "Arial Narrow", "Helvetica Neue", sans-serif;
  --f-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --r: 4px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121418; --surface: #121418; --raised: #1C1F25; --ink: #EDEDE8; --muted: #A3A7AF;
    --rule: #2E323A; --accent: #FF5A6E; --accent-ink: #121418; --accent-soft: #3A1A20;
    --green: #EDEDE8; --green-soft: #262A31; --danger: #FF8A80; --focus: #7FB2E8;
    --bar-bg: #1C1F25; --bar-ink: #EDEDE8; --bar-muted: #A3A7AF; --bar-line: #3A3F48; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121418; --surface: #121418; --raised: #1C1F25; --ink: #EDEDE8; --muted: #A3A7AF;
  --rule: #2E323A; --accent: #FF5A6E; --accent-ink: #121418; --accent-soft: #3A1A20;
  --green: #EDEDE8; --green-soft: #262A31; --danger: #FF8A80; --focus: #7FB2E8;
  --bar-bg: #1C1F25; --bar-ink: #EDEDE8; --bar-muted: #A3A7AF; --bar-line: #3A3F48; color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
img { max-width: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.5;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 20px 48px;
}
.wrap { max-width: 1120px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Masthead */
.mast { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.brand { font-family: var(--f-display); font-weight: 700; font-size: clamp(26px, 4vw, 34px); letter-spacing: -.01em; margin: 0; }
.brand a { color: inherit; text-decoration: none; border-radius: 6px; }
.brand a:hover em { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.brand em { font-style: italic; font-weight: 600; color: var(--accent); }
.tag { color: var(--muted); font-size: 13px; }
.status { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.auth { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.signin { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); padding: 12px 14px; }
.signin label { font-size: 13px; font-weight: 600; }
.signin input { padding: 7px 10px; border: 1px solid var(--rule); border-radius: 8px; background: var(--raised); min-width: 0; flex: 1 1 220px; }
.locker-btn { border: 0; background: var(--green-soft); color: var(--green); border-radius: 999px; padding: 5px 12px; font-weight: 700; font-size: 13px; cursor: pointer; }
.locker-btn:hover { filter: brightness(.97); }
.filters { }
.filters summary { cursor: pointer; font-size: 13px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; list-style: none; }
.filters summary::-webkit-details-marker { display: none; }
.filters summary::after { content: "▾"; color: var(--muted); font-size: 12px; }
.filters[open] summary::after { content: "▴"; }
.fcount { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 0 7px; font-size: 11px; margin-left: 6px; }
.fgrid { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 10px; }
@media (max-width: 780px) { .fgrid { grid-template-columns: 1fr 1fr; } }
.fgrid label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); min-width: 0; }
.fgrid select { padding: 6px 8px; border: 1px solid var(--rule); border-radius: 7px; background: var(--raised); font-size: 13px; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--ink); width: 100%; min-width: 0; }
.fclear { background: none; border: 0; color: var(--accent); font-weight: 700; font-size: 13px; cursor: pointer; padding: 6px 0 0; }
.from { font-size: 14px; color: var(--muted); margin-top: 6px; }
.from button { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--green); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.status.ok .dot { background: var(--green); }
.status.warn .dot { background: var(--accent); }

/* Grid */
.grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 780px) { .grid { grid-template-columns: minmax(0, 1fr); } }

/* Index */
.index { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.panel-title { font-family: var(--f-display); font-size: 20px; font-weight: 700; margin: 0; line-height: 1.2; }
.panel-title .count { font-family: var(--f-body); font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.index-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.label { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.search { width: 100%; padding: 9px 11px; border: 1px solid var(--rule); border-radius: 8px; background: var(--raised); }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 60vh; overflow-y: auto; }
@media (max-width: 780px) { .list { max-height: 240px; } }
.list button { width: 100%; text-align: left; background: none; border: 0; border-radius: 7px; padding: 7px 8px; cursor: pointer; display: flex; align-items: center; gap: 10px; }
.list .txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.thumb { flex: none; width: 38px; height: 38px; border-radius: 7px; object-fit: cover; background: var(--green-soft); color: var(--green); display: grid; place-items: center; font-family: var(--f-display); font-weight: 700; font-size: 18px; }
.list button:hover { background: var(--green-soft); }
.list button[aria-current="true"] { background: var(--ink); color: var(--bg); }
.list button[aria-current="true"] .sub { color: inherit; opacity: .7; }
.list .nm { font-family: var(--f-display); font-size: 17px; font-weight: 600; line-height: 1.25; }
.list .sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty-list { color: var(--muted); font-size: 13px; padding: 6px 4px; }

.btn { border: 1px solid var(--rule); background: var(--raised); border-radius: 8px; padding: 8px 14px; cursor: pointer; font-weight: 600; font-size: 14px; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.danger { color: var(--danger); }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Spec card */
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); padding: clamp(18px, 3vw, 32px); display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 20px; align-items: start; }
.hero.no-photo { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 560px) { .hero { grid-template-columns: minmax(0, 1fr); } .photo { order: -1; } }
.photo { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.photo img { width: 100%; max-width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--r); background: var(--green-soft); display: block; }
@media (max-width: 560px) { .photo img { aspect-ratio: 4 / 3; max-height: 320px; } }
.photo .missing { aspect-ratio: 4 / 5; border-radius: var(--r); background: var(--green-soft); color: var(--muted); display: grid; place-items: center; font-size: 13px; padding: 12px; text-align: center; }
.photo-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.uploading { opacity: .55; }
.spec-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: flex-start; }
.drink-name { font-family: var(--f-display); font-weight: 700; font-size: clamp(32px, 6vw, 52px); line-height: 1.08; letter-spacing: -.015em; margin: 0; text-wrap: balance; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { font-size: 13px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--green-soft); color: var(--green); }
.chip.amber { background: var(--accent-soft); color: var(--accent); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.confirm { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--raised); border: 1px solid var(--danger); border-radius: 8px; padding: 8px 12px; font-size: 14px; }

/* Batch controls */
.batch { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; background: var(--raised); border: 1px solid var(--rule); border-radius: var(--r); padding: 16px; }
.ctl { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.stepper { display: flex; align-items: stretch; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; width: fit-content; }
.stepper button { width: 40px; border: 0; background: var(--surface); cursor: pointer; font-size: 18px; font-weight: 600; }
.stepper button:hover { background: var(--green-soft); }
.stepper input { width: 72px; text-align: center; border: 0; border-inline: 1px solid var(--rule); font-family: var(--f-mono); font-size: 20px; font-weight: 600; padding: 6px 0; background: var(--raised); }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; width: fit-content; }
.seg button { border: 0; background: transparent; padding: 7px 12px; cursor: pointer; font-size: 13px; font-weight: 600; }
.seg button + button { border-left: 1px solid var(--rule); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.fill { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.fill input { width: 88px; padding: 7px 9px; border: 1px solid var(--rule); border-radius: 8px; background: var(--raised); font-family: var(--f-mono); }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--accent); }
.hint { font-size: 13px; color: var(--muted); }

/* Ingredient table */
.spec-table { width: 100%; border-collapse: collapse; }
.spec-table td { padding: 11px 0; border-bottom: 1px solid var(--rule); vertical-align: baseline; }
.spec-table tr:last-child td { border-bottom: 0; }
.spec-table .q { font-family: var(--f-mono); font-weight: 600; font-size: 19px; text-align: right; white-space: nowrap; padding-right: 8px; width: 1%; font-variant-numeric: tabular-nums; }
.spec-table .u { font-family: var(--f-mono); color: var(--muted); font-size: 13px; white-space: nowrap; padding-right: 18px; width: 1%; }
.spec-table .n { font-size: 16px; font-weight: 500; }
.spec-table .note { display: block; font-size: 13px; color: var(--muted); font-weight: 400; }
.spec-table tr.water .n, .spec-table tr.water .q { color: var(--green); }
.totals { display: flex; flex-wrap: wrap; gap: 8px 24px; border-top: 2px solid var(--ink); padding-top: 12px; }
.tot { display: flex; flex-direction: column; }
.tot b { font-family: var(--f-body); font-weight: 700; font-size: 19px; font-variant-numeric: lining-nums tabular-nums; }
.tot span { font-size: 12px; color: var(--muted); }
.notes { border-left: 3px solid var(--accent); padding: 2px 0 2px 14px; color: var(--ink); max-width: 65ch; white-space: pre-wrap; margin: 0; }
.notes-label { margin-bottom: 6px; }

/* Form */
.form { display: flex; flex-direction: column; gap: 18px; }
.form h2 { font-family: var(--f-display); font-weight: 700; font-size: 30px; margin: 0; }
.row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { font-size: 12px; font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea, .ing-row input, .ing-row select { padding: 8px 10px; border: 1px solid var(--rule); border-radius: 8px; background: var(--raised); width: 100%; min-width: 0; }
.field textarea { min-height: 80px; resize: vertical; }
.ing-head, .ing-row { display: grid; grid-template-columns: 76px 104px minmax(0, 1.2fr) minmax(0, 1fr) 128px 60px 32px; gap: 8px; align-items: center; }
.ing-row .flt { display: flex; align-items: center; gap: 5px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.ing-row .flt input { width: auto; accent-color: var(--accent); margin: 0; }
.float-tag { font-size: 11px; padding: 1px 7px; margin-left: 4px; vertical-align: 2px; }
.ing-head { font-size: 12px; font-weight: 600; color: var(--muted); }
.brand-note b { font-weight: 600; color: var(--ink); }
.ing-row input.amt { font-family: var(--f-mono); text-align: right; }
.ing-row .x { border: 0; background: none; cursor: pointer; font-size: 18px; color: var(--muted); border-radius: 6px; height: 36px; }
.ing-row .x:hover { color: var(--danger); background: var(--surface); }
@media (max-width: 480px) {
  .ing-head { display: none; }
  .ing-row { grid-template-columns: 72px 1fr 64px 36px; }
  .ing-row .amt { grid-column: 1; grid-row: 1; }
  .ing-row select.ing-unit { grid-column: 2; grid-row: 1; }
  .ing-row .flt { grid-column: 3; grid-row: 1; }
  .ing-row .x { grid-column: 4; grid-row: 1; }
  .ing-row .ing-name { grid-column: 1 / 5; grid-row: 2; }
  .ing-row .ing-brand { grid-column: 1 / 5; grid-row: 3; }
  .ing-row .ing-kind { grid-column: 1 / 5; grid-row: 4; }
  .ing-row { padding-bottom: 10px; border-bottom: 1px dashed var(--rule); }
}
.ings { display: flex; flex-direction: column; gap: 8px; }
.err { color: var(--danger); font-size: 13px; font-weight: 600; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.blank { text-align: center; padding: 48px 16px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.blank .glass { font-family: var(--f-display); font-weight: 600; font-size: 28px; color: var(--ink); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--bg); padding: 9px 16px; border-radius: 8px; font-size: 14px; font-weight: 600; z-index: 20; }
@media (prefers-reduced-motion: no-preference) {
  .card { animation: rise .25s ease-out; }
  @keyframes rise { from { transform: translateY(4px); } to { transform: none; } }
}
@media (max-width: 600px) {
  body { font-size: 16px; line-height: 1.55; }
  input, select, textarea, .search, .fgrid select, .signin input, .fill input { font-size: 16px; }
  .tag, .status, .btn.small, .seg button, .locker-btn, .filters summary, .fclear, .empty-list, .ing-row .flt { font-size: 14px; }
  .label, .fgrid label, .field label, .tot span { font-size: 12.5px; }
  .list .nm { font-size: 18px; }
  .list .sub, .hint, .spec-table .note { font-size: 14px; }
  .spec-table .n { font-size: 17px; }
  .spec-table .u { font-size: 14px; }
  .fgrid select { padding: 8px 10px; }
}
.modal { position: fixed; inset: 0; z-index: 30; background: rgba(10, 18, 14, .55); display: grid; place-items: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.sheet { background: var(--surface); color: var(--ink); border-radius: 14px; width: min(520px, 100%); max-height: 100%; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sheet-head h3 { margin: 0; font-family: var(--f-display); font-size: 22px; }
.sheet .x { border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px 8px; border-radius: 8px; }
.sheet .x:hover { background: var(--green-soft); color: var(--ink); }
.share-preview { width: 100%; border-radius: 10px; border: 1px solid var(--rule); background: var(--raised); min-height: 160px; display: grid; place-items: center; color: var(--muted); font-size: 14px; overflow: hidden; }
.share-preview img { display: block; width: 100%; height: auto; }
.share-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.share-actions .btn { padding: 11px 14px; font-size: 15px; }
.panel-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.index-head { flex-wrap: wrap; }
.scan-banner { background: var(--accent-soft); color: var(--ink); border-radius: var(--r); padding: 12px 14px; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.scan-banner b { color: var(--accent); }
.scanning { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 32px 8px; text-align: center; }
.scanning img { max-width: min(280px, 100%); max-height: 320px; border-radius: var(--r); border: 1px solid var(--rule); object-fit: contain; background: var(--raised); }
.scanning .glass { font-family: var(--f-display); font-weight: 700; font-size: 24px; }
.dots::after { content: ""; display: inline-block; width: 1.2em; text-align: left; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
@media (prefers-reduced-motion: reduce) { .dots::after { animation: none; content: "…"; } }
.editor-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.rate { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--rule); padding-top: 14px; }
.rate-stars { display: inline-flex; gap: 2px; }
.star { border: 0; background: none; cursor: pointer; font-size: 30px; line-height: 1; padding: 2px 3px; color: var(--rule); border-radius: 6px; }
.star.on { color: var(--accent); }
.rate-stars:hover .star { color: var(--accent); }
.rate-stars .star:hover ~ .star { color: var(--rule); }
.linkish { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 13px; padding: 4px; }
.avg { font-size: 14px; color: var(--muted); font-weight: 600; display: inline-flex; gap: 6px; align-items: center; margin-top: 8px; }
.avg .stars, .sub .stars { color: var(--accent); letter-spacing: 1px; }
.make { display: flex; flex-direction: column; gap: 18px; }
.make-title { font-family: var(--f-display); font-weight: 700; font-size: 30px; margin: 0; }
.make-sec { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--rule); padding-top: 14px; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.sec-head h3 { margin: 0; font-family: var(--f-display); font-size: 20px; }
.cgroup { display: flex; flex-direction: column; gap: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-item { display: inline-flex; align-items: center; gap: 2px; background: var(--green-soft); color: var(--green); border-radius: 999px; padding: 4px 4px 4px 12px; font-size: 14px; font-weight: 600; }
.chip-item button { border: 0; background: none; color: inherit; cursor: pointer; font-size: 17px; line-height: 1; padding: 2px 7px; border-radius: 999px; }
.chip-item button:hover { background: var(--raised); }
.chip-add { display: flex; gap: 6px; }
.chip-add input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--rule); border-radius: 8px; background: var(--raised); }
.ideas { display: grid; gap: 14px; }
.idea { background: var(--raised); border: 1px solid var(--rule); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.idea-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.idea-head h3 { margin: 0; font-family: var(--f-display); font-size: 24px; line-height: 1.15; }
.idea-line { margin: 0; max-width: 65ch; }
.idea .spec-table .q { font-size: 17px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--raised); border: 1px solid var(--rule); border-radius: var(--r); padding: 10px 12px; display: flex; flex-direction: column; text-decoration: none; color: var(--ink); min-width: 0; }
.stat:hover { border-color: var(--ink); }
.stat b { font-family: var(--f-display); font-size: 26px; line-height: 1.1; }
.stat span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.plist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.prow { width: 100%; text-align: left; background: var(--raised); border: 1px solid var(--rule); border-radius: 9px; padding: 8px; cursor: pointer; display: flex; align-items: center; gap: 10px; color: var(--ink); }
.prow:hover { border-color: var(--ink); }
.prow .txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.prow .nm { font-family: var(--f-display); font-weight: 600; font-size: 17px; line-height: 1.25; }
.prow .sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-mark { color: var(--danger); font-size: 16px; }
.btn.fav-on { color: var(--danger); border-color: var(--danger); }
.list .fav-dot { color: var(--danger); }
.sortrow { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.sortrow select { flex: 1; min-width: 0; padding: 6px 8px; border: 1px solid var(--rule); border-radius: 7px; background: var(--raised); font-size: 13px; color: var(--ink); font-weight: 500; }
.list .ghead { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 8px 2px; display: flex; justify-content: space-between; gap: 8px; }
.list .ghead span { letter-spacing: 0; text-transform: none; font-weight: 600; }
.list li.ver button { padding-left: 18px; }
.list .std-tag { color: var(--accent); font-weight: 700; }
.list .lookup-btn { width: 100%; align-items: flex-start; text-align: left; border: 1px dashed var(--accent); background: var(--accent-soft); color: var(--ink); border-radius: 8px; padding: 10px 12px; cursor: pointer; font-size: 14px; display: flex; flex-direction: column; gap: 2px; margin: 6px 0 2px; }
.list .lookup-btn b { color: var(--accent); }
.list .lookup-btn:disabled { cursor: default; opacity: .8; }
.about { margin: 0; max-width: 65ch; color: var(--muted); }
@media (max-width: 600px) { .sortrow, .sortrow select { font-size: 15px; } }
.tools { display: grid; grid-template-columns: 1fr; gap: 6px; }
@media (max-width: 780px) { .tools { grid-template-columns: 1fr 1fr; } }
.tool { text-align: left; background: var(--raised); border: 1px solid var(--rule); border-radius: 9px; padding: 9px 11px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; color: var(--ink); min-width: 0; }
.tool:hover { border-color: var(--ink); }
.tool b { font-size: 14px; }
.tool span { font-size: 12.5px; color: var(--muted); }
.miss { color: var(--accent); font-weight: 600; }
.sec-head h3 .count { font-family: var(--f-body); font-size: 14px; color: var(--muted); font-weight: 600; margin-left: 4px; }
.ing-dym { grid-column: 1 / -1; text-align: left; background: var(--accent-soft); border: 0; border-radius: 7px; padding: 6px 10px; font-size: 13px; cursor: pointer; color: var(--ink); }
.ing-dym b { color: var(--accent); }
.small-step button { width: 34px; font-size: 16px; }
.small-step .sv { min-width: 44px; text-align: center; font-family: var(--f-mono); font-weight: 600; font-size: 17px; display: grid; place-items: center; border-inline: 1px solid var(--rule); background: var(--raised); }
.shop { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.shop li { display: flex; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.shop li:last-child { border-bottom: 0; }
.shop .sname { font-weight: 600; }
.shop .sdetail { font-family: var(--f-mono); font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.menu-card { background: var(--raised); border: 1px solid var(--rule); border-radius: var(--r); padding: 28px 20px; text-align: center; display: flex; flex-direction: column; gap: 16px; }
.menu-kicker { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.menu-title { font-family: var(--f-display); font-size: 30px; margin: 0; }
.menu-name { font-family: var(--f-display); font-size: 21px; font-weight: 700; }
.menu-desc { color: var(--muted); font-size: 14.5px; max-width: 40ch; margin: 2px auto 0; }
@media print {
  body.print-menu *, body.print-list * { visibility: hidden !important; }
  body.print-menu #menu-card, body.print-menu #menu-card *, body.print-list #shop, body.print-list #shop * { visibility: visible !important; }
  body.print-menu #menu-card, body.print-list #shop { position: absolute; left: 0; top: 0; width: 100%; border: 0; background: #fff; color: #000; }
  body.print-list #shop .panel-actions { display: none; }
  body { background: #fff !important; }
}
.swap { border: 1px solid var(--rule); background: transparent; color: var(--muted); border-radius: 999px; font-size: 11.5px; font-weight: 600; padding: 1px 8px; margin-left: 6px; cursor: pointer; vertical-align: 2px; }
.swap:hover { color: var(--accent); border-color: var(--accent); }
.swaps { display: flex; flex-direction: column; gap: 10px; }
.swap-opt { border: 1px solid var(--rule); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; gap: 6px; background: var(--raised); }
.swap-name b { font-size: 16px; }
.swap-why { font-size: 14px; }
body.no-scroll { overflow: hidden; }
.make-mode { position: fixed; inset: 0; z-index: 40; background: var(--bg); overflow-y: auto;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(24px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.mm-inner { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.mm-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.mm-title { font-family: var(--f-display); font-size: clamp(34px, 8vw, 48px); margin: 2px 0 0; line-height: 1.05; }
.mm-x { border: 1px solid var(--rule); background: var(--raised); font-size: 28px; width: 48px; height: 48px; border-radius: 12px; cursor: pointer; color: var(--ink); flex: none; }
.mm-hint { margin: 0; }
.mm-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.mm-ing { width: 100%; display: grid; grid-template-columns: 112px 1fr; gap: 12px; align-items: center; text-align: left; background: var(--raised); border: 2px solid var(--rule); border-radius: 12px; padding: 14px; cursor: pointer; color: var(--ink); }
.mm-ing[aria-pressed="true"] { border-color: var(--green); background: var(--green-soft); }
.mm-ing[aria-pressed="true"] .mm-n { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--muted); }
.mm-q { font-family: var(--f-mono); font-weight: 600; font-size: 26px; text-align: right; font-variant-numeric: tabular-nums; }
.mm-q small { font-size: 15px; color: var(--muted); }
.mm-n { font-size: 21px; font-weight: 600; display: flex; flex-direction: column; }
.mm-n small { font-size: 14px; color: var(--muted); font-weight: 500; }
.mm-steps { margin: 0; padding-left: 26px; display: flex; flex-direction: column; gap: 10px; font-size: 19px; line-height: 1.45; }
.mm-progress { font-weight: 700; color: var(--green); }
.mm-done { padding: 14px; font-size: 17px; }
@media (max-width: 480px) { .mm-ing { grid-template-columns: 84px 1fr; } .mm-q { font-size: 22px; } .mm-n { font-size: 18px; } }
.note-form { display: flex; flex-direction: column; gap: 6px; }
.rnotes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rnotes li { border-left: 3px solid var(--rule); padding: 2px 0 2px 12px; }
.rnotes .stars { color: var(--accent); letter-spacing: 1px; }
.rnotes p { margin: 3px 0 0; max-width: 65ch; }
.linkish.who { color: var(--green); font-weight: 700; font-size: inherit; padding: 0; }
.list-pick { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.listbox { border: 1px solid var(--rule); border-radius: var(--r); padding: 10px 12px; background: var(--raised); }
.listbox[open] { display: flex; flex-direction: column; gap: 10px; }
.listbox summary { cursor: pointer; }
.lockerchip { border: 0; cursor: pointer; padding: 6px 12px; }
.from button[data-locker] { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--green); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.install-tip { background: var(--accent-soft); border-radius: 9px; padding: 10px 12px; font-size: 13.5px; display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.chip-add.with-brand { flex-wrap: wrap; }
.chip-add.with-brand input:first-child { flex: 2 1 180px; }
.chip-add .brand-in { flex: 1 1 130px; min-width: 0; padding: 8px 10px; border: 1px solid var(--rule); border-radius: 8px; background: var(--raised); }
.bar-chip { padding-left: 4px; }
.bar-chip .chip-main { font-weight: 600; font-size: 14px; padding: 2px 6px 2px 8px; }
.bar-chip .chip-main small { font-weight: 500; opacity: .8; }
.bar-chip .chip-stock { font-size: 14px; }
.bar-chip.out { background: var(--surface); color: var(--muted); border: 1px dashed var(--rule); }
.bar-chip.out .chip-main { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.bar-chip .out-tag { text-transform: uppercase; letter-spacing: .06em; font-size: 10.5px; color: var(--danger); text-decoration: none; display: inline-block; }
@media (max-width: 480px) { .chip-add.with-brand input:first-child { flex-basis: 100%; } }
.stock-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.stock-photo { position: relative; border: 1px solid var(--rule); border-radius: 9px; overflow: hidden; background: var(--raised); display: flex; flex-direction: column; min-width: 0; }
.stock-photo img, .stock-photo .ph { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--green-soft); }
.stock-photo.reading img, .stock-photo.preparing img { opacity: .55; }
.stock-state { font-size: 12.5px; font-weight: 700; padding: 5px 8px; }
.stock-photo.done .stock-state { color: var(--green); }
.stock-photo.error .stock-state { color: var(--danger); }
.stock-err { font-size: 12px; color: var(--muted); padding: 0 8px 8px; }
.stock-list { display: flex; flex-direction: column; gap: 8px; }
.stock-row { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 4px 10px; align-items: start; border: 1px solid var(--rule); border-radius: 9px; padding: 10px; background: var(--raised); }
.stock-row.off { opacity: .6; }
.stock-row input[type=checkbox] { width: 20px; height: 20px; margin-top: 8px; accent-color: var(--accent); }
.stock-fields { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
.stock-fields input, .stock-fields select { padding: 7px 9px; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); width: 100%; min-width: 0; }
.stock-meta { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
@media (max-width: 600px) { .stock-fields { grid-template-columns: 1fr 1fr; } .stock-fields input:first-child { grid-column: 1 / -1; } }
.brand-link { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--green); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.bottle-top { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 600px) { .bottle-top { grid-template-columns: minmax(0, 1fr); } }
.bottle-photo { margin: 0; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.bottle-photo img, .bottle-ph { width: 100%; max-width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--r); background: var(--green-soft); }
@media (max-width: 600px) { .bottle-photo img, .bottle-ph { max-width: 220px; } }
.bottle-ph { display: grid; place-items: center; font-family: var(--f-display); font-size: 64px; font-weight: 700; color: var(--green); }
.bottle-info { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px 16px; margin: 0; }
.facts dt { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 600; }
.bottle-desc { margin: 0; max-width: 65ch; line-height: 1.6; }
.mk-name { margin: 0; font-family: var(--f-display); font-size: 24px; }
.mk-swaps { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.mk-swaps s { color: var(--muted); }
.need-tag { font-size: 11px; padding: 1px 7px; margin-left: 4px; vertical-align: 2px; }
#gen-body, #swap-body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.site-foot { text-align: center; color: var(--muted); font-size: 13px; padding: 28px 16px 8px; }
.site-foot a { color: var(--muted); }
@media print { .site-foot { display: none; } }
.hint a { color: var(--green); }
.btn.danger-solid:not(:disabled) { background: var(--danger); border-color: var(--danger); color: var(--raised); }

/* Age check: shown on a device's first visit until someone confirms they're 21+ */
.age-gate { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--bg); overflow-y: auto; }
.age-ok .age-gate { display: none; }
html:not(.age-ok) body { overflow: hidden; }
.age-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; padding: 28px 24px; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,.08); }
.age-brand { font-family: var(--f-display); font-weight: 700; font-size: 24px; margin-bottom: 18px; }
.age-brand em { color: var(--accent); }
.age-card h2 { font-family: var(--f-display); font-size: 21px; margin: 0 0 8px; }
.age-card p { margin: 0 0 18px; }
.age-card .hint { margin: 16px 0 0; }
.age-actions { display: flex; flex-direction: column; gap: 10px; }
.age-actions .btn { width: 100%; padding: 12px; font-size: 16px; }
.signin .signin-age { flex: 1 1 100%; font-size: 13px; font-weight: 400; order: 0; }
.signin .signin-age input { flex: none; padding: 0; width: 18px; height: 18px; min-width: 18px; margin-top: 1px; }
.signin a { color: var(--green); }

/* Reports */
.report-link { font-size: 12px; color: var(--muted); }
.report-line { margin: 4px 0 0; text-align: right; }
.rnotes .report-link { margin-left: 6px; }
.bottle-photo .report-link { display: block; margin-top: 6px; }
.rp-reasons { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.rp-reasons legend { margin-bottom: 6px; }
.rp-thumb { display: block; max-width: 160px; max-height: 160px; border-radius: 8px; margin-top: 8px; object-fit: cover; }
.rp-snap { margin: 0; font-style: italic; }
.rp-reasons-list { margin: 0; padding-left: 20px; font-size: 14px; }

/* Home page */
.home { display: flex; flex-direction: column; gap: 26px; }
.home-hero { display: flex; flex-direction: column; gap: 10px; }
.home-title { font-family: var(--f-display); font-size: 30px; line-height: 1.15; margin: 0; }
.home-lede { margin: 0; font-size: 17px; color: var(--muted); max-width: 60ch; }
.home-ctas { justify-content: flex-start; }
.home-stats { margin: 0; }
.home-search { display: flex; gap: 8px; max-width: 520px; }
.home-search input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 8px; background: var(--raised); font-size: 16px; }
.home-sec .sec-head { margin-bottom: 8px; }
.home-feat { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 18px; align-items: center; width: 100%; text-align: left;
  background: var(--raised); border: 1px solid var(--rule); border-radius: 12px; padding: 12px; cursor: pointer; font: inherit; color: inherit; }
.home-feat:hover { border-color: var(--accent); }
.home-feat img, .home-feat-ph { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.home-feat-ph { display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); font-family: var(--f-display); font-size: 64px; }
.home-feat-txt { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.home-feat-name { font-family: var(--f-display); font-size: 26px; font-weight: 700; line-height: 1.15; }
.home-feat-ing { font-size: 14px; }
.home-feat-go { color: var(--accent); font-weight: 600; margin-top: 4px; }
.home-features { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.home-features li { display: flex; flex-direction: column; gap: 4px; background: var(--raised); border: 1px solid var(--rule); border-radius: 10px; padding: 12px 14px; }
.home-features li span { font-size: 14px; color: var(--muted); }
.home-features .linkish { align-self: flex-start; margin-top: 2px; }
@media (max-width: 780px) { body.on-home .grid > main { order: -1; } }
@media (max-width: 480px) {
  .home-title { font-size: 25px; }
  .home-feat { grid-template-columns: minmax(0, 1fr); }
  .home-feat img, .home-feat-ph { aspect-ratio: 4 / 3; }
}

/* My bar: liquors grouped into shelves by type */
.chips.shelved { display: flex; flex-direction: column; gap: 0; }
.shelf { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px 12px; align-items: start; padding: 8px 0; border-top: 1px solid var(--rule); }
.shelf:first-child { border-top: 0; padding-top: 2px; }
.shelf-name { font-weight: 700; font-size: 14px; padding-top: 6px; }
.shelf-n { color: var(--muted); font-weight: 500; font-size: 12px; margin-left: 2px; }
.shelf-chips { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 600px) {
  .shelf { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .shelf-name { padding-top: 0; }
}

/* =====================================================================
   "Back bar" layer: overrides the base styles above.
   ===================================================================== */
body { padding: 0 0 48px; font-size: 16px; }
.wrap { max-width: 1200px; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); gap: 22px; }

/* Display type: condensed caps, like bar signage */
.drink-name, .make-title, .panel-title, .sec-head h3, .sheet-head h3, .form h2, .blank .glass, .scanning .glass,
.home-title, .home-feat-name, .age-brand, .age-card h2, .mm-title, .brand span {
  font-family: var(--f-display); font-weight: 900; text-transform: uppercase; letter-spacing: .005em; line-height: .95;
}
.label, .fgrid label, .ing-head, .field label { font-family: var(--f-mono); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.field label { font-size: 11.5px; }

/* Top bar */
.topbar { background: var(--bar-bg); color: var(--bar-ink); border-bottom: 1px solid var(--bar-line); }
.topbar-in { max-width: 1200px; margin: 0 auto; padding: 12px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-wrap: wrap; align-items: center; gap: 10px 26px; }
.brand { margin: 0; font-size: 26px; }
.brand a { color: var(--bar-ink); text-decoration: none; display: inline-flex; align-items: center; gap: 10px; border-radius: 4px; }
.brand span { font-size: 26px; letter-spacing: .04em; line-height: 1; }
.brand-cherry { fill: var(--accent); }
.brand span { color: var(--bar-red); }
.brand a:hover span { color: var(--bar-red-hi); }
.cart-hub { fill: var(--bar-bg); }
.topnav { display: flex; flex-wrap: wrap; gap: 2px 18px; }
.topnav button { border: 0; background: none; color: var(--bar-muted); font-weight: 600; font-size: 15px; padding: 6px 0; cursor: pointer; border-bottom: 2px solid transparent; }
.topnav button:hover { color: var(--bar-ink); }
.topnav button[aria-current="page"] { color: var(--bar-ink); border-bottom-color: var(--accent); }
.topsearch { margin-left: auto; display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.08); border-radius: 6px; padding: 0 12px; height: 40px; min-width: 240px; flex: 0 1 320px; color: var(--bar-muted); }
.topsearch .search { border: 0; background: transparent; color: var(--bar-ink); padding: 0; height: 100%; outline: none; width: 100%; font-size: 15px; }
.topsearch .search::placeholder { color: var(--bar-muted); }
.topsearch:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.topbar .auth { gap: 10px; }
.topbar .status { color: var(--bar-muted); }
.topbar .status.ok .dot { background: #7BC47F; }
.topbar .btn { background: transparent; color: var(--bar-ink); border-color: var(--bar-line); }
.topbar .btn:hover { border-color: var(--bar-ink); }
.topbar #auth-btn { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.topbar .locker-btn { background: transparent; color: var(--bar-ink); border: 1.5px solid var(--bar-line); border-radius: 6px; padding: 6px 12px; font-size: 14px; }
.topbar .locker-btn:hover { border-color: var(--bar-ink); filter: none; }
@media (max-width: 780px) {
  .topnav { display: none; }
  .topbar-in { gap: 10px 12px; }
  .brand span { font-size: 22px; }
  .topbar .status { display: none; }
  .topbar .auth { margin-left: auto; }
  .topsearch { order: 5; flex: 1 1 100%; margin-left: 0; height: 44px; }
  .topsearch .search { font-size: 16px; }
}

/* Buttons: crisp, inked */
.btn { border: 1.5px solid var(--ink); background: transparent; color: var(--ink); border-radius: 6px; padding: 9px 16px; font-weight: 600; }
.btn:hover { background: var(--green-soft); border-color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.btn.primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn.small { padding: 6px 12px; font-size: 13.5px; }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.ghost { border-color: var(--rule); }
.linkish { color: var(--muted); }

/* Sidebar: flat sections ruled in ink, no boxes */
.index { gap: 22px; }
.panel { background: transparent; border: 0; border-top: 2px solid var(--ink); border-radius: 0; padding: 12px 0 0; }
.panel-title { font-size: 24px; }
.panel-title .count { font-family: var(--f-mono); font-size: 13px; }
.fgrid select, .sortrow select { border-radius: 4px; border: 1.5px solid var(--rule); background: var(--raised); }
.tool { border-radius: 4px; border: 1.5px solid var(--rule); background: var(--raised); }
.tool:hover { border-color: var(--ink); }
.list button { border-radius: 4px; }
.list button:hover { background: var(--green-soft); }
.list .nm { font-family: var(--f-display); font-weight: 800; font-size: 19px; text-transform: uppercase; line-height: 1.05; }
.list .ghead, .ghead { font-family: var(--f-mono); letter-spacing: .08em; }
.thumb { border-radius: 4px; background: var(--green-soft); }
.glassbox { background: var(--tl, var(--green-soft)); display: flex; align-items: flex-end; justify-content: center; overflow: hidden; }
.glassbox .glass-svg { width: 82%; height: auto; }
.thumb.glassbox .glass-svg { width: 100%; height: 100%; }
.glass-svg .gl { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.glass-svg .ice { fill: #FFFFFF; fill-opacity: .55; stroke: var(--ink); stroke-width: 2; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .glassbox { background: var(--td, var(--green-soft)); } }
:root[data-theme="dark"] .glassbox { background: var(--td, var(--green-soft)); }

/* Main column: content sits on the page, not in a box */
.card { background: transparent; border: 0; border-radius: 0; padding: 0; gap: 26px; }
.grid { grid-template-columns: 260px minmax(0, 1fr); gap: 40px; }
body.on-home .grid { grid-template-columns: minmax(0, 1fr); }
body.on-home .grid > aside { display: none; }

/* Recipe page */
.hero { grid-template-columns: minmax(0, 1fr) 260px; gap: 28px; }
.drink-name { font-size: clamp(48px, 7vw, 88px); line-height: .9; }
.photo img, .photo .glassbox { border-radius: 4px; }
.photo .glassbox { aspect-ratio: 4 / 5; padding-top: 16px; }
@media (max-width: 560px) { .photo .glassbox { aspect-ratio: 4 / 3; max-height: 300px; } .photo .glassbox .glass-svg { width: auto; height: 92%; } }
.meta { gap: 6px 14px; }
.chip { font-family: var(--f-mono); font-size: 12px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; padding: 0; border-radius: 0; background: none; color: var(--muted); }
.chip.amber { background: none; color: var(--accent); }
.float-tag { border: 1.5px solid var(--accent); border-radius: 3px; padding: 0 5px; font-size: 10.5px; }
.from { font-size: 15px; }
.from button { color: var(--ink); }
.batch { background: var(--bar-bg); color: var(--bar-ink); border: 0; border-radius: 4px; }
.batch .label { color: var(--bar-muted); }
.batch .hint { color: var(--bar-muted); }
.batch .stepper { border: 1.5px solid var(--bar-line); border-radius: 6px; }
.batch .stepper button { background: transparent; color: var(--bar-ink); }
.batch .stepper button:hover { background: rgba(255,255,255,.1); }
.batch .stepper input { background: transparent; color: var(--bar-ink); border-inline-color: var(--bar-line); }
.batch .fill input { background: transparent; color: var(--bar-ink); border: 1.5px solid var(--bar-line); border-radius: 6px; }
.batch .fill .btn, .batch .btn { color: var(--bar-ink); border-color: var(--bar-line); }
.batch .fill .btn:hover { background: rgba(255,255,255,.1); }
.batch .seg { border: 1.5px solid var(--bar-line); border-radius: 6px; }
.batch .seg button { color: var(--bar-ink); }
.batch .seg button + button { border-left-color: var(--bar-line); }
.batch .seg button[aria-pressed="true"] { background: var(--bar-ink); color: var(--bar-bg); }
.batch .check input { accent-color: var(--accent); }
.spec-table td { border-bottom-color: var(--rule); padding: 13px 0; }
.spec-table .q { font-size: 22px; }
.spec-table .n { font-size: 17px; font-weight: 600; }
.brand-link { color: var(--muted); }
.totals { border-top: 2px solid var(--ink); }
.notes { border-left: 0; padding: 0; font-size: 17px; }
.rate { border-top: 2px solid var(--ink); }
.star.on, .rate-stars:hover .star { color: var(--accent); }

/* Sections inside pages */
.make-sec { border-top: 2px solid var(--ink); }
.make-title { font-size: clamp(36px, 5vw, 56px); }
.sec-head h3 { font-size: 26px; }
.prow { border-radius: 4px; }
.chip-item { background: var(--green-soft); color: var(--ink); border-radius: 4px; }
.shelf-name { font-family: var(--f-display); font-weight: 900; text-transform: uppercase; font-size: 20px; letter-spacing: .01em; }
.sheet { border-radius: 6px; }
.sheet-head h3 { font-size: 28px; }
.toast { background: var(--bar-bg); color: var(--bar-ink); border-radius: 6px; }
.signin { background: var(--raised); border: 2px solid var(--ink); border-radius: 4px; }
.site-foot { border-top: 1px solid var(--rule); margin-top: 24px; padding-top: 18px; }

/* Home page */
.home { gap: 40px; }
.home-top { display: flex; flex-wrap: wrap; gap: 36px; align-items: stretch; padding-bottom: 40px; border-bottom: 2px solid var(--ink); }
.home-hero { flex: 1 1 480px; min-width: 0; justify-content: space-between; gap: 24px; }
.home-title { font-size: clamp(56px, 9vw, 112px); line-height: .88; margin: 0; }
.home-title em { font-style: normal; color: var(--accent); }
.home-lede { color: var(--muted); font-size: 18px; max-width: 46ch; }
.home-ctas .btn { padding: 12px 20px; font-size: 15px; }
.home-ctas .btn:not(.primary) { border-width: 2px; }
.home-day { flex: 0 1 380px; min-width: min(300px, 100%); background: var(--raised); border: 2px solid var(--ink); border-radius: 4px; display: flex; flex-direction: column; text-align: left; padding: 0; cursor: pointer; color: inherit; font: inherit; }
.home-day:hover { border-color: var(--accent); }
.home-day-head { display: flex; justify-content: space-between; padding: 9px 14px; border-bottom: 2px solid var(--ink); font-family: var(--f-mono); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.home-day .glassbox, .home-day img { height: 200px; width: 100%; object-fit: cover; display: flex; }
.home-day .glassbox .glass-svg { width: auto; height: 90%; }
.home-day-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; }
.home-feat-name { font-size: 40px; }
.home-day-ings { display: flex; flex-direction: column; gap: 3px; font-size: 15px; }
.home-day-ings span b { font-family: var(--f-mono); font-weight: 600; display: inline-block; min-width: 64px; }
.home-feat-go { color: var(--accent); font-weight: 700; }
.home-browse { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; margin-top: -18px; padding-bottom: 16px; border-bottom: 1px solid var(--rule); }
.home-browse .label { margin-right: -10px; }
.home-browse .pills { display: flex; flex-wrap: wrap; gap: 6px; }
.home-browse button { height: 36px; padding: 0 14px; border-radius: 4px; border: 1.5px solid var(--rule); background: var(--raised); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; }
.home-browse button:hover { border-color: var(--ink); }
.home-browse button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.home-sec .sec-head { margin-bottom: 14px; }
.home-sec .sec-head h3 { font-size: 40px; }
.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px; }
.tile { width: 100%; border: 0; background: none; padding: 0; text-align: left; cursor: pointer; color: inherit; font: inherit; display: flex; flex-direction: column; gap: 10px; }
.tile-img { position: relative; aspect-ratio: 4 / 3; border-radius: 4px; overflow: hidden; }
.tile-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-img .glassbox { width: 100%; height: 100%; }
.tile-img .glassbox .glass-svg { width: auto; height: 88%; }
.tile-rate { position: absolute; top: 10px; left: 10px; background: var(--raised); color: var(--ink); font-family: var(--f-mono); font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 3px; }
.tile-name { font-family: var(--f-display); font-weight: 800; font-size: 26px; line-height: 1.02; text-transform: uppercase; }
.tile-sub { font-size: 14px; color: var(--muted); margin-top: -6px; }
.tile:hover .tile-name { color: var(--accent); }
.menu-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.menu-list button { width: 100%; display: flex; align-items: baseline; gap: 10px; padding: 14px 0; border: 0; border-bottom: 1px solid var(--rule); background: none; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.menu-list .mn { font-weight: 700; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; }
.menu-list .lead { flex: 1; min-width: 20px; border-bottom: 2px dotted var(--rule); transform: translateY(-4px); }
.menu-list .ms { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-list button:hover .mn { color: var(--accent); }
.home-split { display: flex; flex-wrap: wrap; gap: 44px; align-items: flex-start; }
.home-split > .home-sec { flex: 2 1 520px; min-width: 0; }
.home-promo { flex: 1 1 300px; min-width: 0; background: var(--bar-bg); color: var(--bar-ink); border-radius: 4px; padding: 26px; display: flex; flex-direction: column; gap: 16px; }
.home-promo h3 { margin: 0; font-family: var(--f-display); font-weight: 900; text-transform: uppercase; font-size: 34px; line-height: .95; }
.home-promo ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; color: var(--bar-muted); font-size: 15px; }
.home-promo b { color: var(--bar-ink); }
.home-promo .btn { align-self: flex-start; }
.home-quick { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 600px) {
  .home { gap: 30px; }
  .home-top { gap: 24px; padding-bottom: 28px; }
  .home-title { font-size: 56px; }
  .home-browse { margin-top: -10px; flex-wrap: nowrap; overflow-x: auto; }
  .home-browse .pills { flex-wrap: nowrap; }
  .home-browse button { flex: none; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .tile-name { font-size: 21px; }
  .home-sec .sec-head h3 { font-size: 32px; }
}

/* Phone tab bar */
.tabbar { display: none; }
@media (max-width: 780px) {
  body { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
  .tabbar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
    background: var(--bar-bg); border-top: 1px solid var(--bar-line); padding: 6px 4px calc(8px + env(safe-area-inset-bottom, 0px)); }
  .tabbar button { border: 0; background: none; color: var(--bar-muted); font-size: 12px; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; min-height: 48px; cursor: pointer; }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar [data-nav="cart"] svg { width: 26px; height: 26px; margin: -2px 0; }
  .tabbar button[aria-current="page"] { color: var(--bar-ink); font-weight: 700; }
  .tabbar button[aria-current="page"] svg { color: var(--accent); }
  .toast { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
}
@media print { .topbar, .tabbar { display: none !important; } }

/* Phone and tablet layout (after the desktop sizes above so these win) */
@media (max-width: 780px) {
  .grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}
@media (max-width: 560px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .drink-name { font-size: 52px; }
  .make-title { font-size: 40px; }
}

/* Header and home refinements */
.topbar .status:not(.warn) { display: none; }
@media (min-width: 781px) {
  .topsearch { flex: 1 1 180px; max-width: 260px; min-width: 140px; }
  .topbar .auth { flex: none; }
  .topnav { gap: 2px 16px; }
}
@media (max-width: 780px) {
  /* On phones the open drink (or page) comes first; the drink list and tools follow it. */
  .grid > main { order: -1; }
}
.home-top.signed { align-items: center; }
.home-top.signed .home-hero { justify-content: center; gap: 28px; }
/* Signed-in welcome: the cart name is a greeting, not a headline */
.home-top.signed .home-title { font-size: clamp(38px, 5vw, 60px); line-height: .95; }
/* One size for the big headlines: home welcome, drink names and page titles */
.home-title, .drink-name, .make-title { font-size: clamp(38px, 5vw, 60px); line-height: .95; }
@media (max-width: 560px) { .drink-name, .make-title { font-size: 40px; } }
@media (max-width: 600px) { .home-title { font-size: 40px; } }

/* Signed-in welcome: a one-line greeting, two big tiles and one Add button */
.home-hello { margin: 0; font-size: 18px; color: var(--muted); }
.home-hello b { color: var(--ink); font-weight: 700; }
.home-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.home-tile { display: flex; align-items: center; gap: 12px; text-align: left; padding: 14px; min-height: 64px; border: 2px solid var(--ink); border-radius: 6px; background: var(--raised); color: var(--ink); font: inherit; cursor: pointer; }
.home-tile:hover { border-color: var(--accent); }
.home-tile svg { flex: none; width: 28px; height: 28px; color: var(--accent); }
.home-tile > span { display: flex; flex-direction: column; min-width: 0; }
.home-tile b { font-size: 16px; line-height: 1.2; }
.home-tile span span { font-size: 13px; color: var(--muted); }
.home-add { align-self: flex-start; }
.home-top.signed .home-hero { gap: 14px; justify-content: center; }
@media (max-width: 600px) {
  .home-tile { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; }
  .home-top.signed { gap: 18px; padding-bottom: 22px; }
}
.add-menu { display: flex; flex-direction: column; gap: 8px; }
.add-menu button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 14px 16px; min-height: 56px; border: 1.5px solid var(--rule); border-radius: 6px; background: var(--raised); color: var(--ink); font: inherit; cursor: pointer; }
.add-menu button:hover { border-color: var(--ink); }
.add-menu b { font-size: 16px; }
.add-menu span { font-size: 13.5px; color: var(--muted); }

/* Amounts: bold proportional figures (a monospace font spaces fractions badly), with fractions drawn
   as a raised top number, a drawn slash and a bottom number so they read the same in any font. */
.spec-table .q, .mm-q, .home-day-ings b { font-family: var(--f-body); font-weight: 700; font-variant-numeric: lining-nums tabular-nums; letter-spacing: -.01em; }
.spec-table .u { font-family: var(--f-body); font-weight: 500; }
.fr { display: inline-flex; align-items: baseline; white-space: nowrap; margin-left: .04em; }
.fr .fn, .fr .fd { font-size: .7em; line-height: 1; }
.fr .fn { position: relative; top: -.42em; }
.fr .fs { display: inline-block; width: .08em; min-width: 1.5px; height: .78em; background: currentColor; border-radius: 1px; transform: skewX(-22deg); margin: 0 .1em; align-self: center; position: relative; top: -.05em; }

/* Ask the bartender */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ask-intro { margin: 0; color: var(--muted); font-size: 17px; max-width: 60ch; }
.ask-thread { display: flex; flex-direction: column; gap: 18px; }
.ask-thread:empty { display: none; }
.ask-q { align-self: flex-end; max-width: 85%; background: var(--green-soft); border-radius: 8px 8px 2px 8px; padding: 10px 14px; }
.ask-q p, .ask-answer { margin: 4px 0 0; font-size: 16.5px; }
.ask-a { display: flex; flex-direction: column; gap: 12px; }
.ask-a > .label, .ask-q > .label { font-size: 11px; }
.ask-err { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ask-drink { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; border: 2px solid var(--ink); border-radius: 4px; padding: 14px; background: var(--raised); }
.ask-pic .glassbox { width: 100%; aspect-ratio: 4 / 5; border-radius: 4px; }
.ask-pic .glassbox .glass-svg { width: auto; height: 88%; }
.ask-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ask-body h3 { margin: 0; font-family: var(--f-display); font-weight: 900; text-transform: uppercase; font-size: 30px; line-height: .95; }
.ask-why { margin: 0; }
.ask-notes { margin: 0; font-size: 15px; color: var(--muted); }
.ask-need { margin: 0; font-size: 14.5px; }
.ask-need b { color: var(--accent); }
.ask-body .spec-table td { padding-top: 8px; padding-bottom: 8px; }
.ask-body .spec-table .q { font-size: 19px; }
.ask-starts { display: flex; flex-wrap: wrap; gap: 8px; }
.ask-starts button { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--ink); background: transparent; color: var(--ink); font-weight: 600; font-size: 14.5px; cursor: pointer; }
.ask-starts button:hover { background: var(--ink); color: var(--bg); }
.ask-form { display: flex; gap: 8px; align-items: stretch; }
.ask-form textarea { flex: 1; min-width: 0; resize: vertical; min-height: 52px; padding: 12px 14px; border: 2px solid var(--ink); border-radius: 6px; background: var(--raised); font-size: 16px; line-height: 1.4; }
.ask-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.ask-form .btn { padding: 0 22px; }
.ask-opts { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
@media (max-width: 560px) {
  .ask-drink { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .ask-pic .glassbox { aspect-ratio: auto; height: 110px; }
  .ask-q { max-width: 92%; }
}

.ba-form { display: flex; flex-direction: column; gap: 12px; }

/* All drinks page: the drink index on its own, full width; recipe pages have no sidebar */
body.on-browse .grid { grid-template-columns: minmax(0, 1fr); }
body.on-browse .grid > main { display: none; }
body.on-browse .list { max-height: none; }
@media (min-width: 781px) {
  body.on-browse .index { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 22px 44px; align-items: start; }
  body.on-browse .index > section:nth-of-type(3) { grid-column: 2; grid-row: 1 / span 2; }
  body.on-browse .list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 2px 16px; }
  body.on-browse .list > .ghead, body.on-browse .list > .empty-list { grid-column: 1 / -1; }
}
@media (max-width: 780px) { body.on-browse .index > section:nth-of-type(3) { order: -1; } }
.back-link { align-self: flex-start; padding: 0; margin-bottom: -10px; font-size: 14px; font-weight: 600; text-decoration: none; color: var(--muted); }
.back-link:hover { color: var(--ink); }
/* Totals: the caption style (.tot span) mustn't shrink the fraction inside the number */
.tot b .fr { font-size: 1em; color: inherit; }
.tot b .fr .fn, .tot b .fr .fd { font-size: .7em; color: inherit; }
/* Keep the top bar on one line on wide screens; the search box gives way first */
@media (min-width: 1100px) {
  .topbar-in { flex-wrap: nowrap; }
  .topnav { flex-wrap: nowrap; white-space: nowrap; }
  .topsearch { min-width: 120px; }
  .brand span { white-space: nowrap; }
}

/* Recipe page: the spec sits right under the drink's style line */
.spec-block { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.spec-top > div:first-child { flex: 1 1 320px; min-width: 0; }

/* Spec heading: "Spec for [−] 1 [+] drink · or batch it" */
.spec-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 4px; }
.spec-stepper button { width: 36px; font-size: 17px; }
.spec-stepper input { width: 52px; font-family: var(--f-body); font-weight: 700; font-size: 18px; padding: 4px 0; }
.batch-link { font-size: 14px; font-weight: 600; color: var(--accent); padding: 4px 2px; }
.bf-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.bf-row input, .bf-row select { font-size: 16px; }

/* Under the spec: unit toggle and the water option (the dark strip is gone) */
.spec-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; }
.unit-toggle { display: flex; align-items: center; gap: 2px; font-size: 13.5px; color: var(--muted); }
.unit-toggle span { margin-right: 4px; }
.unit-toggle button { border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; padding: 6px 8px; min-height: 32px; border-radius: 4px; cursor: pointer; }
.unit-toggle button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.unit-toggle button:hover:not([aria-pressed="true"]) { color: var(--ink); }
.water-link { font-size: 13.5px; font-weight: 600; color: var(--accent); padding: 6px 0; }

/* Phone header: one slim row (logo, search button, account button); the search box opens on demand */
.top-icons { display: none; }
.icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: transparent; color: var(--bar-ink); cursor: pointer; }
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn:hover, .icon-btn[aria-expanded="true"] { background: rgba(255,255,255,.1); }
@media (max-width: 780px) {
  .topbar { position: sticky; top: 0; z-index: 14; transition: transform .2s ease; }
  .topbar.tucked { transform: translateY(-100%); }
  .topbar-in { padding-top: 6px; padding-bottom: 6px; flex-wrap: wrap; }
  .top-icons { display: flex; margin-left: auto; gap: 2px; }
  .topbar .auth { display: none; }
  .topsearch { display: none; }
  body.search-open .topsearch { display: flex; margin-bottom: 6px; }
}
@media (max-width: 780px) and (prefers-reduced-motion: reduce) { .topbar { transition: none; } }

/* Recipe actions: Make it, Mocktail, Share, ♥ and ⋯ More. On computers they follow the spec; on phones they're pinned above the tab bar. */
.recipe-bar { display: flex; flex-wrap: nowrap; gap: 8px; align-items: center; }
.recipe-bar .btn { white-space: nowrap; }
.recipe-bar .fav-btn { font-size: 18px; line-height: 1; padding-inline: 12px; }
.recipe-bar .fav-on { color: var(--accent); border-color: var(--accent); }
@media (min-width: 781px) {
  body.on-home .card > .back-link, body.on-home .card > .hero { order: -2; }
  body.on-home .card > .recipe-bar { order: -1; }
}
@media (max-width: 780px) {
  .recipe-bar { position: sticky; bottom: calc(66px + env(safe-area-inset-bottom, 0px)); z-index: 6; background: var(--bg); border-top: 1px solid var(--rule); margin: 0 -16px; padding: 10px 16px; }
  .recipe-bar .btn { flex: 1 1 auto; padding: 10px 8px; min-height: 44px; font-size: 14px; }
  .recipe-bar .fav-btn, .recipe-bar #more-btn { flex: 0 0 auto; }
}
.more-menu .danger b { color: var(--danger); }

/* Quick filter chips above the drinks; the full filters open on demand on phones */
.fchips-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fchips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; padding: 2px 0; }
.fchips::-webkit-scrollbar { display: none; }
.fchip { flex: none; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--rule); background: var(--raised); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; }
.fchip:hover { border-color: var(--ink); }
.fchip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
#filters-toggle { flex: none; display: none; }
body:not(.on-merged) .fchips-row { display: none; }
@media (max-width: 780px) {
  #filters-toggle { display: inline-flex; min-height: 38px; align-items: center; }
  body.on-browse:not(.filters-open) .index > section:nth-of-type(1) { display: none; }
  body.on-browse.filters-open .index > section:nth-of-type(1) { order: -2; }
}

/* Phones: pop-ups slide up from the bottom edge, within thumb reach */
@media (max-width: 600px) {
  .modal { place-items: end center; padding: 0; }
  .sheet { width: 100%; max-height: 88vh; border-radius: 16px 16px 0 0; padding: 10px 16px calc(18px + env(safe-area-inset-bottom, 0px)); }
  .sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--rule); margin: 0 auto 4px; flex: none; }
}
@media (max-width: 600px) and (prefers-reduced-motion: no-preference) {
  .modal:not([hidden]) .sheet { animation: sheet-up .22s ease-out; }
  @keyframes sheet-up { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
}
/* Comfortable tap targets (44px) without changing how the links look */
.back-link, .batch-link, .water-link, .report-link, .sec-head .linkish, .plan-links button { min-height: 44px; display: inline-flex; align-items: center; }
.unit-toggle button { min-height: 40px; }
.swap { min-height: 30px; padding: 4px 10px; position: relative; }
.swap::after { content: ""; position: absolute; inset: -8px -4px; }

.canmake-link { align-self: flex-start; color: var(--accent); font-weight: 600; font-size: 14.5px; text-decoration: none; padding: 0; min-height: 40px; display: inline-flex; align-items: center; }
.plan-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.plan-row button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 14px 16px; min-height: 64px; border: 1.5px solid var(--rule); border-radius: 6px; background: var(--raised); color: var(--ink); font: inherit; cursor: pointer; }
.plan-row button:hover { border-color: var(--ink); }
.plan-row b { font-size: 16px; }
.plan-row span { font-size: 13.5px; color: var(--muted); }
@media (max-width: 600px) { .plan-row { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 780px) {
  .topbar .brand { flex: 1 1 0; min-width: 0; }
  .topbar .brand a { max-width: 100%; }
  .topbar .brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .top-icons { flex: none; }
}

/* Home = welcome + the drink list. The index (filters, drinks) sits under the main column, full width. */
body.on-merged .grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
body.on-merged .index > section:nth-of-type(2) { display: none; } /* Tools: they live in Plan & explore and the menu */
body.on-merged .list { max-height: none; }
body.on-merged.searching .grid > main { display: none; }
#drinks-title { scroll-margin-top: 70px; }
.home-after:not([hidden]) { margin-top: 8px; }
@media (min-width: 781px) {
  body.on-merged .index { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 22px 44px; align-items: start; }
  body.on-merged .index > section:nth-of-type(3) { grid-column: 2; grid-row: 1; }
  body.on-merged .index > section:nth-of-type(1) { grid-column: 1; grid-row: 1; }
  body.on-merged .list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 2px 16px; }
  body.on-merged .list > .ghead, body.on-merged .list > .empty-list { grid-column: 1 / -1; }
}
@media (max-width: 780px) {
  body.on-merged:not(.filters-open) .index > section:nth-of-type(1) { display: none; }
  body.on-merged .index > section:nth-of-type(3) { order: -1; }
  body.on-merged.filters-open .index > section:nth-of-type(1) { order: -2; }
  body.on-merged .grid > main { order: -1; }
}
body.on-merged .grid > main { order: -1; }
.home-top.signed { align-items: flex-start; }
.home-top.signed .home-hero { justify-content: flex-start; }
/* Signed in on a computer: greeting on top, then a wide drink-of-the-day card (picture left, recipe right) */
@media (min-width: 781px) {
  .home-top.signed { flex-direction: column; align-items: stretch; gap: 16px; padding-bottom: 28px; }
  .home-top.signed .home-hero { flex: none; }
  .home-top.signed .home-day { flex: none; width: 100%; display: grid; grid-template-columns: 300px minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .home-top.signed .home-day-head { grid-column: 1 / -1; }
  .home-top.signed .home-day > .glassbox, .home-top.signed .home-day > img { height: 100%; min-height: 200px; }
  .home-top.signed .home-day-body { align-self: center; }
}
@media (min-width: 781px) {
  .home-top.signed .home-day { grid-template-rows: auto auto; grid-template-columns: 260px minmax(0, 1fr); }
  .home-top.signed .home-day > .glassbox, .home-top.signed .home-day > img { height: 220px; min-height: 0; }
  .home-top.signed .home-day > .glassbox .glass-svg { width: auto; height: 86%; }
}

/* "+ Filters" leads the chip row and scrolls with it, so it never sits on top of a chip */
.fchips-row { overflow-x: auto; scrollbar-width: none; gap: 6px; padding: 2px 0; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
.fchips-row::-webkit-scrollbar { display: none; }
.fchips-row .fchips { overflow: visible; flex: none; padding: 0; }
.fchips-row .fchips:empty { display: none; }
.filters-chip { border-color: var(--ink); }
.filters-chip[aria-expanded="true"] { background: var(--ink); color: var(--bg); }
@media (max-width: 780px) { #filters-toggle { display: inline-flex; align-items: center; } }

.site-foot { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.foot-line { margin: 0; }
.foot-line b { color: var(--ink); }

.ra-body .ask-drink { grid-template-columns: minmax(0, 1fr); }
.ra-body .ask-pic { display: none; }
.ra-body .ask-thread { max-height: 52vh; overflow-y: auto; }

.riff { font-size: 15px; color: var(--muted); margin-top: 4px; }
.riff-link { color: var(--accent); font-weight: 700; font-size: inherit; padding: 0; text-decoration: none; }
.riff-link:hover { text-decoration: underline; }
.brand-mark { width: 32px; height: 32px; flex: none; }

/* ---------- site stats (admins) ---------- */
.st-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.st-tile { border: 1px solid var(--rule); border-radius: 6px; padding: 10px 12px; background: var(--surface); display: flex; flex-direction: column; gap: 2px; }
.st-tile b { font-family: var(--f-display); font-size: 26px; line-height: 1.1; }
.st-tile span { color: var(--muted); font-size: 13px; }
.st-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.st-chart h4 { margin: 0 0 6px; font-size: 14px; }
.st-bars { display: flex; align-items: flex-end; gap: 4px; height: 130px; padding-bottom: 18px; position: relative; }
.st-bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; min-width: 0; }
.st-fill { width: 100%; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; }
.st-v { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.st-wk { position: absolute; bottom: -18px; font-size: 10px; color: var(--muted); white-space: nowrap; }
.st-bar:nth-child(even) .st-wk { visibility: hidden; }
.st-table { border-collapse: collapse; width: 100%; max-width: 420px; font-size: 14px; }
.st-table th, .st-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--rule); }
.st-table td:last-child, .st-table th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.st-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.st-list { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.make.stats { display: flex; flex-direction: column; gap: 20px; max-width: 1000px; }
.make.stats > .editor-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.make.stats .make-title { font-size: 34px; line-height: 1.1; }

/* ---------- Drinks sections on Home ---------- */
#list .sec-head-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 18px 0 6px; margin: 0; border-top: 1px solid var(--rule); list-style: none; }
#list .sec-head-row:first-child { border-top: 0; padding-top: 4px; }
#list .sec-head-row h3 { margin: 0; font-family: var(--f-display); font-size: 20px; letter-spacing: .02em; }
#list .sec-head-row span { color: var(--muted); font-size: 13px; }
#list .sec-more { list-style: none; padding: 4px 0 6px; }
#list .sec-more .linkish { font-weight: 600; color: var(--accent); text-decoration: none; padding: 6px 0; font-size: 14px; }
#list .sec-more .linkish:hover { text-decoration: underline; }
#list .sec-all { padding-top: 16px; border-top: 1px solid var(--rule); margin-top: 8px; }
#list .sec-all .btn { width: 100%; justify-content: center; }
#list .sec-back { padding-bottom: 8px; }
#list .sec-empty { list-style: none; padding: 6px 0 10px; }
#list .sec-all .btn { border: 2px solid var(--ink); border-radius: 4px; padding: 10px 14px; font-weight: 700; background: var(--surface); }

.signin-code { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 8px; border-top: 1px solid var(--rule); }
.signin-code input { flex: 0 1 160px; font-size: 20px; letter-spacing: .2em; font-variant-numeric: tabular-nums; }

/* ---------- photo review (admins) ---------- */
.pr-item { display: flex; gap: 14px; align-items: flex-start; border-top: 1px solid var(--rule); padding-top: 14px; flex-wrap: wrap; }
.pr-item img { width: 160px; height: 160px; object-fit: cover; border-radius: 6px; border: 1px solid var(--rule); background: var(--raised); }
.pr-body { display: flex; flex-direction: column; gap: 6px; flex: 1 1 200px; min-width: 0; }
.pr-reason { background: var(--bg); border-left: 3px solid var(--accent); padding: 6px 10px; font-size: 14px; }
.held-note { margin: 0; }

/* ---------- how-to chips and sheet ---------- */
.howto-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.howto-row .label { margin-right: 4px; }
.howto-chip { border: 1px solid var(--rule); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 5px 11px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.howto-chip:hover { border-color: var(--ink); }
.howto { display: flex; flex-direction: column; gap: 10px; }
.howto ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; line-height: 1.5; }
.howto-tip { margin: 0; background: var(--bg); border-left: 3px solid var(--accent); padding: 8px 12px; font-size: 14px; }
.howto .hint { margin: 0; }

/* ---------- Missing something? (swaps) ---------- */
.missing-row { margin: 4px 0 10px; }
.missing-row .linkish { color: var(--accent); font-weight: 700; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; padding: 4px 0; }

/* ingredient names that open a how-to guide */
.spec-table .ing-link { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left;
  text-decoration: underline dotted; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.spec-table .ing-link:hover { color: var(--accent); }
.howto-amount { margin: 0; font-weight: 700; background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 10px 12px; }
.howto-buy { margin: 0; font-weight: 600; }

/* ---------- drink log ---------- */
.made-sec { border-top: 2px solid var(--ink); padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.made-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.made-head b { font-size: 18px; }
.made-head .hint { margin-top: 2px; }
.log-list { list-style: none; margin: 4px 0 0; padding: 0; }
.log-list li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--rule); font-size: 15px; line-height: 1.45; }
.lg-date { flex: 0 0 64px; font-weight: 700; font-size: 13px; padding-top: 2px; }
.lg-body { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; overflow-wrap: anywhere; }
.lg-riff, .made-sec > .linkish { color: var(--accent); font-weight: 700; font-size: 13px; text-decoration: underline; }
.lg-edit { font-size: 13px; color: var(--muted); }
.lg-private { margin: 0; }
.made-form { display: flex; flex-direction: column; gap: 6px; }
.made-form label { font-weight: 700; font-size: 13px; margin-top: 6px; }
.made-form input, .made-form textarea { font: inherit; font-size: 16px; padding: 10px; border: 1px solid var(--rule); border-radius: 8px; background: var(--raised, #fff); color: var(--ink); }
.made-form .btn { margin-top: 10px; justify-content: center; }
.made-rate { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 6px 0 4px; }
.made-rate b { font-size: 18px; }
.big-stars .star { font-size: 34px; }
.made-tag { color: #2E7D4F; font-weight: 700; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .made-tag { color: #6FCF97; } }
:root[data-theme="dark"] .made-tag { color: #6FCF97; }
.lg-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.lg-tiles div { border: 1px solid var(--rule); background: var(--surface); border-radius: 6px; padding: 8px 10px; min-width: 0; }
.lg-tiles b { display: block; font-size: 19px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-tiles span { font-size: 12px; color: var(--muted); }
.lg-timeline { list-style: none; margin: 0; padding: 0; }
.lg-month { font-family: var(--f-mono, ui-monospace, monospace); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border-top: 1px solid var(--rule); padding: 10px 0 2px; }
.lg-entry { display: flex; gap: 10px; align-items: center; width: 100%; background: none; border: 0; padding: 7px 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.lg-entry .txt { display: flex; flex-direction: column; min-width: 0; }
.lg-note { font-size: 14px; overflow-wrap: anywhere; }

/* Drink of the day on tablets and computers: the picture fills its whole column, centered,
   and on iPad-size screens (signed out too) the card spans the width with the picture beside the recipe. */
.home-day .glassbox { align-items: center; justify-content: center; }
.home-day img { object-position: center; }
@media (min-width: 781px) {
  .home-top.signed .home-day > .glassbox, .home-top.signed .home-day > img { height: 100%; min-height: 220px; align-self: stretch; }
}
@media (min-width: 781px) and (max-width: 1000px) {
  .home-top:not(.signed) .home-day { flex: 1 1 100%; max-width: none; display: grid; grid-template-columns: 280px minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .home-top:not(.signed) .home-day-head { grid-column: 1 / -1; }
  .home-top:not(.signed) .home-day > .glassbox, .home-top:not(.signed) .home-day > img { height: 100%; min-height: 220px; align-self: stretch; }
  .home-top:not(.signed) .home-day-body { align-self: center; }
}
@media (min-width: 781px) {
  .home-top.signed .home-day > .glassbox .glass-svg, .home-top:not(.signed) .home-day > .glassbox .glass-svg { height: auto; width: auto; max-height: 72%; max-width: 72%; }
}

/* What can I make? */
.basics-toggle { align-items: flex-start; background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 10px 12px; }
.basics-toggle .hint { font-weight: 400; }
.plist .pick { color: var(--muted); font-weight: 600; }

/* ---------- shopping list ---------- */
.shop-add { border: 1.5px solid var(--accent); color: var(--accent); background: var(--surface); border-radius: 999px; padding: 3px 10px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; vertical-align: middle; }
.shop-add.on { background: var(--accent); color: #fff; cursor: default; }
li.has-shop { display: flex; align-items: center; gap: 8px; }
li.has-shop > .prow { flex: 1; min-width: 0; }
.shop-btns { display: flex; flex-direction: column; gap: 4px; flex: none; }
.worth .shop-add, .pick-list .shop-add { padding: 1px 8px; font-size: 11px; }
.count-pill { background: var(--accent); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 12px; font-weight: 700; }
.missing-row { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.bi-shop { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.shop-form { display: flex; gap: 8px; }
.shop-form input { flex: 1; min-width: 0; font-size: 16px; padding: 9px 11px; border: 1px solid var(--rule); border-radius: 8px; background: var(--raised, #fff); color: var(--ink); }
.shop-list { list-style: none; margin: 0; padding: 0; }
.shop-grp { font-family: var(--f-mono, ui-monospace, monospace); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border-top: 1px solid var(--rule); padding: 12px 0 4px; display: flex; gap: 8px; align-items: center; }
.shop-grp span { text-transform: none; letter-spacing: 0; font-family: var(--f-body); }
.shop-grp .linkish { margin-left: auto; color: var(--accent); font-weight: 700; text-transform: none; letter-spacing: 0; font-family: var(--f-body); font-size: 13px; }
.shop-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.shop-check { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; cursor: pointer; }
.shop-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.shop-check .box { width: 26px; height: 26px; border: 2px solid var(--ink); border-radius: 6px; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 900; }
.shop-check input:checked + .box { background: var(--ink); color: var(--bg); }
.shop-check input:checked + .box::after { content: "✓"; }
.shop-check input:focus-visible + .box { outline: 2px solid var(--focus); outline-offset: 2px; }
.shop-check .txt { display: flex; flex-direction: column; min-width: 0; }
.shop-check .txt b { font-size: 17px; overflow-wrap: anywhere; }
.shop-item.done .txt b { text-decoration: line-through; color: var(--muted); font-weight: 600; }
.shop-item .x { background: none; border: 0; color: var(--muted); font-size: 22px; cursor: pointer; padding: 4px 8px; }
.shop-sugg { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px dashed var(--rule); border-radius: 6px; margin: 4px 0; background: var(--surface); }
.shop-sugg .txt { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.shop-prompt { list-style: none; background: var(--surface); border: 1px solid var(--ink); border-left: 4px solid #2E7D4F; border-radius: 6px; padding: 10px 12px; margin: 4px 0 8px; display: flex; flex-direction: column; gap: 6px; }
.shop-empty { padding: 10px 0; }

/* ---------- menu decoder ---------- */
.menu-page { max-width: 820px; }
.md-intro { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 14px 18px; }
.md-intro p { margin: 0 0 8px; } .md-intro ul { margin: 0 0 10px; padding-left: 20px; line-height: 1.6; }
.md-preview { max-width: 220px; max-height: 260px; object-fit: contain; border-radius: 6px; border: 1px solid var(--rule); }
.md-jump { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.md-jump::-webkit-scrollbar { display: none; }
.md-jump a { flex: none; border: 1px solid var(--rule); background: var(--surface); border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: none; }
.md-card { border-top: 2px solid var(--ink); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; scroll-margin-top: 80px; }
.md-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.md-head h3 { margin: 0; font-family: var(--f-display); font-size: 28px; line-height: 1.05; }
.md-price { font-weight: 700; color: var(--muted); }
.md-menu { margin: 0; color: var(--muted); font-style: italic; }
.md-riff { margin: 0; }
.md-riff .linkish { font-weight: 700; color: var(--accent); text-decoration: underline; }
.md-meta { font-size: 14px; color: var(--muted); }
.md-conf { font-weight: 700; border-radius: 999px; padding: 1px 8px; border: 1px solid var(--rule); background: var(--surface); color: var(--ink); }
.md-conf.high { border-color: #2E7D4F; color: #2E7D4F; }
.md-conf.low { border-color: var(--accent); color: var(--accent); }
.md-have { font-size: 14px; color: var(--muted); line-height: 2; }
.md-have.ok { color: #2E7D4F; font-weight: 600; }
.md-miss { font-size: 12px; color: var(--accent); font-weight: 700; margin-left: 4px; }
.md-spec .q { white-space: nowrap; }
.md-spec .chip { font-size: 11px; padding: 1px 7px; }
.md-steps, .md-house ol { margin: 4px 0 0; padding-left: 22px; line-height: 1.55; display: flex; flex-direction: column; gap: 4px; }
.md-house { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 10px 14px; scroll-margin-top: 90px; }
.md-house summary { font-weight: 700; cursor: pointer; }
.md-house ul { margin: 8px 0 0; padding-left: 20px; }
.md-house .hint { margin: 8px 0 0; }
.md-note { margin: 0; }
.md-actions { justify-content: flex-start; }
