/* Fonts are served from this site (fonts/), not from Google. Latin subsets, SIL Open Font License. */
@font-face { font-family: "Alfa Slab One"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/alfa-slab-one.woff2) format("woff2"); }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 400 800; font-stretch: 75% 100%; font-display: swap; src: url(../fonts/archivo.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/ibm-plex-mono-400.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/ibm-plex-mono-500.woff2) format("woff2"); }

:root {
  /* Layout: beer mats on kraft board. Tan wall, cream beer-mat panels with a printed keyline,
     wood-type slab headings, amber for the one thing to press. Bottle green is kept for
     the sign itself: header, tabs and the timer face. One theme by choice. */
  --wall: #dcc9a0;
  --wall-deep: #cfb98b;
  --on-wall-muted: #5a4d35;
  --green: #0f3a2b;
  --green-deep: #09271d;
  --cream: #faf4e4;
  --paper: #fffaf0;
  --ink: #17231c;
  --muted: #5d6553;
  --line: #d6c8a2;
  --gold: #eaa21a;
  --gold-deep: #b27506;
  --red: #b8322a;
  --ok: #1f7a4a;
  --warn: #b4530b;
  --band: #f1d68b;
  --on-green: #f3ead3;
  --on-green-muted: #a9c2b0;
  --font-display: "Alfa Slab One", Rockwell, "Roboto Slab", Georgia, serif;
  --font-body: "Archivo", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--wall); }
body {
  margin: 0; color: var(--ink);
  background: radial-gradient(120% 60% at 50% 0%, #e6d6b1 0%, var(--wall) 55%, var(--wall-deep) 100%) fixed var(--wall);
  font: 400 14.5px/1.45 var(--font-body);
  padding-bottom: calc(84px + env(safe-area-inset-bottom)); min-height: 100vh;
}
a { color: inherit; }
h1, h2 { margin: 0; text-wrap: balance; }
h1 { font: 400 25px/1 var(--font-display); color: var(--ink); letter-spacing: .01em; }
h1::after { content: ""; display: block; width: 44px; height: 6px; margin-top: 8px; border-top: 2px solid var(--red); border-bottom: 2px solid var(--red); }
/* Section headings carry a crown cap. */
h2 {
  font: 800 15px/1.2 var(--font-body); font-stretch: 75%; text-transform: uppercase; letter-spacing: .14em; color: var(--ink);
  padding-left: 24px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='7.6' fill='%23eaa21a' stroke='%23b27506' stroke-width='2.6' stroke-dasharray='1.5 .8'/%3E%3Ccircle cx='10' cy='10' r='4.6' fill='none' stroke='%23b27506' stroke-width='.9'/%3E%3C/svg%3E") left center / 17px no-repeat;
}
code { font-family: var(--font-mono); font-size: .92em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.pint { display: block; flex: 0 0 auto; }

/* ---- shell ---- */
.top {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px 12px;
  background: var(--green); color: var(--on-green);
  position: sticky; top: 0; z-index: 5;
  border-bottom: 2px solid var(--gold); box-shadow: 0 4px 0 var(--green), 0 6px 0 var(--gold);
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--gold); font: 400 20px/1 var(--font-display); letter-spacing: .06em; margin-right: auto; }
.brand svg { width: 26px; height: 26px; }
.brand-text { display: flex; flex-direction: column; gap: 3px; }
.brand-sub { font: 600 9.5px/1 var(--font-body); font-stretch: 75%; letter-spacing: .07em; text-transform: uppercase; color: var(--on-green-muted); white-space: nowrap; }
.sync {
  font: 500 12px/1 var(--font-mono); color: inherit; background: transparent;
  border: 1px solid rgb(243 234 211 / .35); border-radius: 999px;
  padding: 7px 11px 7px 24px; cursor: pointer; position: relative; white-space: nowrap;
}
.sync::before { content: ""; position: absolute; left: 10px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: #8fa697; }
.sync.ok::before { background: #6fd39a; }
.sync.dirty::before { background: var(--gold); }
.sync.bad::before { background: #ff8a7d; }
.sync.busy::before { background: var(--gold); animation: pulse 1s infinite alternate; }
/* The light alone: a round button with the dot in the middle. */
.sync.dot { width: 38px; height: 38px; padding: 0; border-color: rgb(243 234 211 / .22); }
.sync.dot::before { left: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; }
.sync.dot.busy::before { animation-duration: .45s; }
.sync.dot.bad { border-color: #ff8a7d; }
.sync.dot.bad::before { background: #ff5a48; box-shadow: 0 0 0 4px rgb(255 90 72 / .28); }
.sync-tip {
  position: absolute; right: 12px; top: calc(100% + 12px); z-index: 6; max-width: min(300px, calc(100vw - 24px));
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 10px 13px;
  font: 500 13px/1.4 var(--font-body); color: var(--paper); background: var(--ink); border: 1.5px solid var(--paper); border-radius: 10px;
  box-shadow: 0 8px 22px rgb(0 0 0 / .35);
}
.sync-tip[hidden] { display: none; }
.sync-tip.bad { background: var(--red); }
.sync-tip .btn { color: var(--ink); }
.sync.demo { color: var(--green-deep); background: var(--gold); border-color: var(--gold); font-weight: 600; padding-left: 11px; }
.sync.demo::before { display: none; }

/* ---- the demo and the welcome screen of the Android and iOS apps ---- */
.demo-bar {
  display: block; padding: 9px 16px 8px; margin-top: 6px; text-align: center; text-decoration: none;
  font: 600 12.5px/1.3 var(--font-body); color: var(--green-deep); background: var(--gold); border-bottom: 2px solid var(--ink);
}
.demo-bar[hidden] { display: none; }
.demo-bar b { text-decoration: underline; text-underline-offset: 2px; margin-left: 4px; white-space: nowrap; }
body.bare { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.bare .tabs, .bare #sync-chip { display: none; }
.welcome-head { display: flex; align-items: center; gap: 14px; padding: 4px 2px 0; }
.welcome-head p { margin: 14px 0 0; color: var(--on-wall-muted); }
#welcome-account #storage-msg:empty, .foot-actions.alt:empty { display: none; }
#welcome-account .foot-actions.alt { padding-top: 12px; border-top: 1.5px dashed var(--line); }
#welcome-account form { margin-top: 14px; }
#welcome-account .foot-actions.alt { margin-top: 14px; }
@keyframes pulse { to { opacity: .3; } }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex;
  background: var(--green); border-top: 2px solid var(--gold); padding-bottom: env(safe-area-inset-bottom);
}
.tabs a {
  flex: 1; text-align: center; padding: 16px 4px 15px; text-decoration: none; color: var(--on-green-muted);
  font: 800 13px/1 var(--font-body); font-stretch: 75%; letter-spacing: .14em; text-transform: uppercase;
}
.tabs a[aria-current] { color: var(--green-deep); background: var(--gold); }

main { max-width: 880px; margin: 0 auto; padding: 22px 16px 16px; display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 760px) {
  body { padding-bottom: 40px; }
  .tabs { position: sticky; top: 60px; bottom: auto; justify-content: center; border-top: 0; background: transparent; padding-top: 14px; gap: 6px; }
  .tabs a { flex: 0 0 auto; padding: 11px 20px; border-radius: 999px; border: 1px solid rgb(243 234 211 / .25); background: var(--green); }
}

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; min-height: 42px; }
.actions, .foot-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.foot-actions { margin-top: 4px; }
.back { font: 800 13px/1 var(--font-body); font-stretch: 75%; letter-spacing: .14em; text-transform: uppercase; text-decoration: none; color: var(--on-wall-muted); padding: 12px 0; }
.back:hover { color: var(--ink); }

/* ---- controls ---- */
.btn {
  font: 800 13px/1 var(--font-body); font-stretch: 75%; letter-spacing: .12em; text-transform: uppercase; text-decoration: none;
  color: var(--ink); background: var(--paper); border: 1.5px solid var(--ink); border-radius: 8px;
  padding: 11px 14px 10px; cursor: pointer; white-space: nowrap; box-shadow: 0 3px 0 var(--ink);
  transition: transform .06s, box-shadow .06s;
}
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
.btn.primary { background: var(--gold); }
.btn.primary:disabled { background: transparent; color: var(--muted); border: 1.5px dashed var(--line); box-shadow: none; cursor: default; }
.page-head .btn.primary:disabled { color: var(--on-wall-muted); border-color: rgb(23 35 28 / .4); }
.btn.ghost { background: transparent; box-shadow: none; border-color: var(--line); }
.page-head .btn.ghost { color: var(--ink); border-color: rgb(23 35 28 / .5); }
.btn.danger { color: var(--red); border-color: var(--red); box-shadow: 0 3px 0 var(--red); }
.btn.small { padding: 8px 11px 7px; font-size: 12px; box-shadow: 0 2px 0 var(--ink); }
.btn.small.danger { box-shadow: 0 2px 0 var(--red); }
.btn.small.ghost { box-shadow: none; }
main > .foot-actions { padding: 4px 0 8px; }
/* Row of icon buttons under a recipe and a brew log: an icon with a short label below it. */
.toolbar { display: flex; gap: 8px; padding: 4px 0 8px; }
.end-actions { display: grid; justify-items: start; gap: 12px; padding-top: 4px; }
.end-actions .toolbar { width: 100%; padding-top: 0; }
.tile {
  flex: 1 1 0; min-width: 0; max-width: 104px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px 8px;
  font: 800 10.5px/1.15 var(--font-body); font-stretch: 75%; letter-spacing: .1em; text-transform: uppercase; text-decoration: none; text-align: center;
  color: var(--ink); background: var(--paper); border: 1.5px solid var(--ink); border-radius: 8px; box-shadow: 0 3px 0 var(--ink); cursor: pointer;
  transition: transform .06s, box-shadow .06s;
}
.tile:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
.tile.danger { color: var(--red); border-color: var(--red); box-shadow: 0 3px 0 var(--red); }
.tile.danger[data-armed] { color: #fff; background: var(--red); }
.ico { flex: none; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn {
  flex: 0 0 34px; height: 40px; border: 0; background: transparent; color: var(--muted);
  font-size: 22px; line-height: 1; cursor: pointer; border-radius: 6px;
}
.icon-btn:hover { color: var(--red); background: rgb(184 50 42 / .1); }

.fld { display: flex; flex-direction: column; gap: 4px; flex: 1 1 84px; min-width: 0; }
.fld > span { font: 700 11px/1.2 var(--font-body); font-stretch: 80%; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fld.w-name { flex: 3 1 210px; }
.fld.block { margin-top: 12px; }
.fld:has(input[type="date"]) { flex-basis: 150px; }
input, select, textarea {
  width: 100%; min-width: 0; height: 40px; padding: 0 10px; color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--line); border-radius: 7px; font: 500 14.5px/1.3 var(--font-body);
}
/* iPhone zooms the page when a field under 16px is focused; keep it at 16px there only. */
@supports (-webkit-touch-callout: none) { input, select, textarea, input[type="number"], input[type="date"] { font-size: 16px; } }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--ink); box-shadow: 0 0 0 3px var(--band); }
input[type="number"], input[type="date"] { font-family: var(--font-mono); font-size: 14px; font-variant-numeric: tabular-nums; }
textarea { height: auto; padding: 9px 10px; resize: vertical; }
input[type="checkbox"] { width: 22px; height: 22px; flex: 0 0 22px; accent-color: var(--ok); box-shadow: none; }

/* ---- beer-mat panels ---- */
.card, .gauges, .item, .empty-state, .label-card {
  background: var(--cream); border-radius: 14px; box-shadow: 0 3px 0 rgb(74 52 14 / .32), 0 0 0 1px rgb(74 52 14 / .14);
}
.card { padding: 18px 16px 16px; position: relative; }
.card::before, .label-card::before { /* printed keyline */
  content: ""; position: absolute; inset: 5px; border: 1px solid rgb(23 35 28 / .16); border-radius: 10px; pointer-events: none;
}
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; min-height: 30px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.row + .row { margin-top: 12px; padding-top: 12px; border-top: 1.5px dashed var(--line); }
.derived { flex: 0 0 72px; height: 40px; display: flex; align-items: center; justify-content: flex-end; font: 500 13px/1 var(--font-mono); color: var(--ink); font-variant-numeric: tabular-nums; }
.empty, .hint { color: var(--muted); margin: 8px 0 0; font-size: 14px; max-width: 65ch; }
.list > .empty { color: var(--on-wall-muted); }
.hint a { color: var(--warn); font-weight: 600; }
.count { font: 500 12px/1 var(--font-mono); color: var(--muted); }
.summary { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; padding-top: 12px; border-top: 1.5px solid var(--line); font-size: 14px; color: var(--muted); }
.summary b { font-family: var(--font-mono); font-weight: 500; color: var(--ink); }

/* ---- the label: recipe or brew name with its pint ---- */
.label-card { position: relative; display: flex; align-items: center; gap: 14px; padding: 20px 18px 18px; border-top: 8px solid var(--gold); }
.label-card::before { top: 3px; }
.label-main { flex: 1; min-width: 0; }
.overline { display: block; font: 800 12px/1.3 var(--font-body); font-stretch: 75%; letter-spacing: .16em; text-transform: uppercase; color: var(--warn); margin-bottom: 4px; }
.title-fld { display: block; }
.title-input {
  height: auto; padding: 2px 0 6px; background: transparent; border: 0; border-bottom: 2px dashed var(--line); border-radius: 0;
  font: 400 clamp(19px, 5.4vw, 26px)/1.15 var(--font-display); color: var(--ink);
}
.title-input:focus { border-color: var(--ink); box-shadow: none; }
.label-art { position: relative; flex: 0 0 auto; padding-right: 6px; }
.stamp {
  position: absolute; right: -8px; bottom: -6px; width: 58px; height: 58px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; transform: rotate(-10deg);
  background: var(--red); color: var(--paper); border: 2px solid var(--paper); box-shadow: 0 0 0 2px var(--red);
  font: 800 9px/1 var(--font-body); font-stretch: 75%; letter-spacing: .12em; text-transform: uppercase;
}
.stamp b { font: 400 16px/1 var(--font-display); letter-spacing: 0; margin-bottom: 2px; }
.pour .beer { transform-origin: 50% 100%; transform-box: fill-box; animation: pour .9s cubic-bezier(.2, .7, .2, 1) both; }
.pour .foam { animation: head .5s .7s both; }
@keyframes pour { from { transform: scaleY(0); } }
@keyframes head { from { opacity: 0; } }

/* ---- gauges: where the recipe sits against its style ---- */
.gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1.5px; background: var(--line); overflow: hidden; }
.gauge { background: var(--cream); padding: 13px 14px 11px; min-width: 0; }
.g-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.g-label { font: 800 12px/1 var(--font-body); font-stretch: 75%; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.g-value { font: 400 18px/1 var(--font-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--ink); vertical-align: -1px; margin-left: 3px; }
.g-track { position: relative; height: 10px; margin: 11px 0 8px; background: #e6dbbd; border-radius: 5px; }
.g-band { position: absolute; top: 0; bottom: 0; background: var(--gold); opacity: .55; border-radius: 5px; }
.g-mark { position: absolute; top: -4px; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: var(--ink); border: 3px solid var(--cream); }
.g-foot { font: 400 11px/1.3 var(--font-mono); color: var(--muted); }
.gauge.ok .g-mark { background: var(--ok); } .gauge.ok .g-foot b { color: var(--ok); }
.gauge.low .g-mark, .gauge.high .g-mark { background: var(--warn); }
.gauge.low .g-foot b, .gauge.high .g-foot b { color: var(--warn); }
.gauge.plain .g-foot { margin-top: 27px; }

/* ---- lists ---- */
.list { display: flex; flex-direction: column; gap: 10px; }
.item { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 12px 16px 12px 12px; text-decoration: none; transition: transform .08s; }
.item:hover { transform: translateY(-2px); }
.item-main { flex: 1 1 170px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.item-main strong { font: 400 16px/1.2 var(--font-display); overflow-wrap: anywhere; }
.item-main small { color: var(--muted); font-size: 13px; }
.item-main em { color: var(--warn); font-style: normal; font-weight: 700; }
/* Each value has its unit beside it on one line: "1.047 OG  45 IBU  5.0%". */
.item-stats { display: flex; flex-wrap: wrap; gap: 2px 14px; font: 700 10px/1.2 var(--font-body); font-stretch: 80%; letter-spacing: .1em; color: var(--muted); }
.item-stats span { display: inline-flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.item-stats span.pct { gap: 1px; letter-spacing: 0; font-size: 12px; }
.item-stats b { font: 500 15px/1 var(--font-mono); letter-spacing: 0; color: var(--ink); font-variant-numeric: tabular-nums; }
.pill { /* rubber-stamped status */
  font: 800 11px/1 var(--font-body); font-stretch: 75%; letter-spacing: .14em; text-transform: uppercase; padding: 5px 7px 4px;
  border-radius: 4px; border: 2px solid currentColor; color: var(--muted); flex: 0 0 auto; transform: rotate(-3deg);
}
.pill.s-fermenting, .pill.s-conditioning, .pill.s-brew-day { color: var(--warn); }
.pill.s-packaged, .pill.s-finished { color: var(--ok); }
.empty-state { padding: 28px 20px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.empty-state h2 { background: none; padding: 0; font: 400 18px/1.15 var(--font-display); letter-spacing: 0; text-transform: none; }
.empty-state p { margin: 0; color: var(--muted); max-width: 60ch; }

/* ---- brew page ---- */
.pva { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 14px; }
.pva th, .pva td { padding: 8px 4px; border-top: 1.5px dashed var(--line); text-align: right; }
.pva thead th { border-top: 0; font: 800 11px/1 var(--font-body); font-stretch: 75%; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.pva tbody th { text-align: left; font-weight: 500; }
.pva td { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.pva td.ok { color: var(--ok); font-weight: 500; } .pva td.low, .pva td.high { color: var(--warn); font-weight: 500; }
.pva td.low::after { content: " ↓"; } .pva td.high::after { content: " ↑"; } .pva td.ok::after { content: " ✓"; }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { border-top: 1.5px dashed var(--line); }
.steps label { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; cursor: pointer; }
.steps input:checked + span { color: var(--muted); text-decoration: line-through; }
.chart { width: 100%; max-width: 520px; height: auto; margin-top: 14px; display: block; }
.chart text { font: 10px var(--font-mono); fill: var(--muted); }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .target { stroke: var(--ok); stroke-width: 1.2; stroke-dasharray: 4 3; }
.chart .line { fill: none; stroke: var(--gold-deep); stroke-width: 2.5; stroke-linejoin: round; }
.chart .area { fill: var(--gold); opacity: .28; }
.chart .pt { fill: var(--cream); stroke: var(--gold-deep); stroke-width: 2; }
.chart .end { fill: var(--ink); }

/* ---- tools ---- */
.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.results { margin: 14px 0 0; border-top: 1.5px solid var(--line); }
.results div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0 0; }
.results dt { color: var(--muted); font-size: 14px; }
.results dd { margin: 0; font: 400 16px/1 var(--font-display); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---- equipment profiles ---- */
.profile { margin-top: 12px; padding: 12px; border: 1.5px solid var(--line); border-radius: 10px; background: rgb(255 250 240 / .55); }
.profile-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.profile-foot .count { margin-right: auto; }
#fit-line .btn { margin: 4px 0 0 4px; }

/* ---- brew-day timer ---- */
.tchip { display: flex; gap: .6ch; min-width: 0; font: 500 12px/1 var(--font-mono); font-variant-numeric: tabular-nums; color: inherit; text-decoration: none; white-space: nowrap; padding: 8px 10px; border-radius: 999px; background: rgb(243 234 211 / .14); }
.tchip[hidden] { display: none; }
/* The header must not get wider than a phone screen. While the timer chip shows, the subtitle makes
   room for it, and a long step name is cut short. The time is always shown in full. */
.tchip .t-step { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.top:has(.tchip:not([hidden])) .brand-sub { display: none; }
.brand, .sync { flex: none; }
.tchip.run { background: var(--gold); color: var(--green-deep); }
.tchip.done { background: #6fd39a; color: var(--green-deep); }
.segs { display: flex; flex-wrap: wrap; gap: 6px; }
.seg { font: 800 12px/1 var(--font-body); font-stretch: 75%; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); background: transparent; border: 1.5px solid var(--line); border-radius: 999px; padding: 9px 12px 8px; cursor: pointer; }
.seg b { font: 500 12px/1 var(--font-mono); letter-spacing: 0; margin-left: 4px; }
.seg.on { color: var(--on-green); border-color: var(--green); background: var(--green); }
.t-face { display: flex; align-items: center; gap: 14px; margin: 14px 0; padding: 16px 14px; background: var(--green-deep); color: var(--on-green); border-radius: 12px; border: 2px solid var(--green-deep); }
.t-face.run { border-color: var(--gold); }
.t-read { flex: 1; min-width: 0; text-align: center; }
.t-time { display: block; font: 400 clamp(38px, 12.5vw, 58px)/1 var(--font-display); font-variant-numeric: tabular-nums; color: var(--gold); }
.t-next { margin-top: 8px; color: var(--on-green-muted); font-size: 14px; min-height: 1.45em; }
.t-face.run .t-next { color: var(--on-green); }
.t-alerts { list-style: none; margin: 14px 0 0; padding: 0; }
.t-alerts li { display: flex; gap: 12px; padding: 9px 0; border-top: 1.5px dashed var(--line); font-size: 14px; }
.t-alerts b { flex: 0 0 92px; font: 500 12px/1.6 var(--font-mono); color: var(--muted); }
.t-alerts li.done { color: var(--muted); text-decoration: line-through; }
.t-opts { margin-top: 12px; padding-top: 12px; border-top: 1.5px solid var(--line); }
.t-opts label { display: flex; gap: 10px; align-items: center; cursor: pointer; }
.t-opts .btn { margin: 6px 4px 0 0; }

#toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); z-index: 10;
  max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 8px; background: var(--ink); color: var(--paper);
  border: 1.5px solid var(--paper); font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: var(--red); }
#toast.alert { background: var(--red); font: 400 15px/1.3 var(--font-display); pointer-events: auto; cursor: pointer; bottom: auto; top: 70px; box-shadow: 0 8px 28px rgb(0 0 0 / .45); }

@media (prefers-reduced-motion: reduce) {
  .sync.busy::before, .pour .beer, .pour .foam { animation: none; }
  #toast, .btn, .tile, .item { transition: none; }
}

/* ---- tool index and single-tool pages ---- */
.tool-link { flex-wrap: nowrap; padding: 14px 16px; }
.tool-link .go { flex: 0 0 auto; font-size: 20px; color: var(--warn); }
/* Tool badges: a small green beer mat with a gold keyline and a cream line drawing. */
.tool-icon {
  flex: 0 0 var(--s); width: var(--s); height: var(--s); border-radius: 50%; display: grid; place-items: center;
  background: var(--green); color: var(--on-green);
  box-shadow: inset 0 0 0 3px var(--green), inset 0 0 0 4.5px var(--gold), 0 2px 0 rgb(74 52 14 / .28);
}
.tool-icon svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tool-icon svg .thin { stroke-width: 1.4; opacity: .85; }
.tool-icon svg .fill { fill: var(--gold); stroke: none; }
.tool-link:hover .tool-icon { color: var(--gold); }
.tool-head { justify-content: flex-start; gap: 12px; }
.tool-head h2 { background: none; padding-left: 0; }
.tool-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.tool-fields .fld > span { white-space: normal; }
.tool .results div { padding-top: 11px; }
.tool .results dd { font-size: 20px; }
.tool .foot-actions { margin-top: 16px; }

/* ---- brew queue: draggable recipe rows ---- */
/* The tools under the Recipes heading: three icon buttons, the search field when it is open, and a
   short note that says which filter or order is set. */
.list-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: -4px; }
.tool-btn {
  flex: none; width: 40px; height: 38px; display: grid; place-items: center; padding: 0; cursor: pointer;
  color: var(--ink); background: var(--paper); border: 1.5px solid var(--ink); border-radius: 8px; box-shadow: 0 2px 0 var(--ink);
}
.tool-btn:active { transform: translateY(2px); box-shadow: none; }
.tool-btn.on { background: var(--gold); }
.tool-btn .ico { width: 20px; height: 20px; }
.find { flex: 1 1 150px; min-width: 0; }
.find[hidden] { display: none; }
.find input { width: 100%; height: 38px; border-color: rgb(74 52 14 / .35); }
.tools-note { flex: 0 1 auto; min-width: 0; font-size: 13px; color: var(--on-wall-muted); }
.tools-note:empty { display: none; }
/* A press and hold on a recipe opens a menu, so it must not select text or open the phone's link menu. */
.q-row .item { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.hint.on-wall { color: var(--on-wall-muted); margin: -6px 0 -4px; }
.hint.on-wall:empty { display: none; }
.q-row { display: flex; align-items: stretch; position: relative; transition: transform .16s; }
.q-row .item { flex: 1; min-width: 0; }
.q-row .grip + .item { border-radius: 0 14px 14px 0; }
.q-row .item:hover { transform: none; }
.grip {
  flex: 0 0 44px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  background: var(--green); color: var(--on-green); border: 0; border-radius: 14px 0 0 14px; box-shadow: 0 3px 0 rgb(74 52 14 / .32);
  cursor: grab; touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
/* A touch on a grip scrolls the page. After a short hold, enableReorder() in app.js starts the drag. */
.grip b { font: 400 15px/1 var(--font-display); color: var(--gold); }
.q-row.dragging { z-index: 4; transition: none; }
.q-row.dragging .grip { cursor: grabbing; background: var(--gold-deep); }
.q-row.dragging .item, .q-row.dragging .grip { box-shadow: 0 14px 26px rgb(40 26 4 / .4); }
@media (prefers-reduced-motion: reduce) { .q-row { transition: none; } }
#recipe-list { display: flex; flex-direction: column; gap: 10px; }
.q-head { background: none; padding: 0; margin: 8px 0 -2px; font: 800 12px/1 var(--font-body); font-stretch: 75%; letter-spacing: .16em; text-transform: uppercase; color: var(--on-wall-muted); }
.q-head:first-child { margin-top: 0; }
.q-row.archived .item { opacity: .78; }
.q-row .restore { align-self: center; flex: 0 0 auto; margin-left: 8px; }
#bulk:empty { display: none; }
#bulk { margin: 0; }

/* ---- recipe status ---- */
/* The status of a recipe, on its own page: the rubber stamp, as a button that opens a menu. */
.status-line { margin-top: 14px; }
.pill.status-stamp { display: inline-flex; align-items: center; gap: 7px; padding: 8px 10px 7px; font-size: 12.5px; background: transparent; cursor: pointer; }
.pill.status-stamp svg { flex: none; opacity: .75; }
.pill.status-stamp:active { transform: rotate(-3deg) translateY(1px); }

/* ---- compact ingredient rows ---- */
.row.compact { flex-wrap: nowrap; align-items: center; gap: 6px; }
.name-btn { flex: 1 1 auto; min-width: 0; text-align: left; background: transparent; border: 0; padding: 6px 4px 6px 0; cursor: pointer; color: var(--ink); font: inherit; display: flex; flex-direction: column; gap: 2px; }
.name-btn strong { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; text-decoration: underline dotted var(--line); text-underline-offset: 4px; }
.name-btn:hover strong { text-decoration-color: var(--ink); }
.name-btn small { font: 700 10px/1 var(--font-body); font-stretch: 80%; letter-spacing: .1em; text-transform: uppercase; color: var(--warn); }
.amt { flex: 0 0 104px; position: relative; display: block; }
.amt input { padding-right: 30px; text-align: right; }
.amt span[aria-hidden] { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font: 500 12px/1 var(--font-mono); color: var(--muted); pointer-events: none; }
.row.compact .derived { flex: 0 0 46px; }

/* ---- popup sheet ---- */
dialog.sheet {
  width: calc(100% - 24px); max-width: 520px; max-height: 86vh; margin: 7vh auto auto; padding: 18px 16px 16px; overflow: auto;
  border: 0; border-radius: 16px; background: var(--cream); color: var(--ink); border-top: 8px solid var(--gold);
  box-shadow: 0 18px 50px rgb(30 20 4 / .5);
}
dialog.sheet::backdrop { background: rgb(40 28 8 / .55); }
dialog.sheet .hint:empty { display: none; }
.picks { margin-top: 8px; max-height: 32vh; overflow-y: auto; border: 1.5px solid var(--line); border-radius: 8px; background: var(--paper); }
.pick { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; width: 100%; padding: 10px 11px; background: transparent; border: 0; border-top: 1px solid var(--line); cursor: pointer; text-align: left; font: 500 15px/1.2 var(--font-body); color: var(--ink); }
.pick:first-child { border-top: 0; }
.pick small { flex: 0 0 auto; font: 400 12px/1 var(--font-mono); color: var(--muted); }
.pick:hover { background: var(--cream); }
.pick.on { background: var(--green); color: var(--on-green); }
.pick.on small { color: var(--on-green-muted); }
dialog.sheet .row { margin-top: 12px; }
dialog.sheet details { margin-top: 12px; border-top: 1.5px dashed var(--line); padding-top: 10px; }
dialog.sheet summary { cursor: pointer; font: 700 12px/1.4 var(--font-body); font-stretch: 80%; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
dialog.sheet .foot-actions { margin-top: 16px; }

/* ---- list of choices: the Android and iOS apps show this in place of the system list for a <select> ---- */
dialog.choose {
  width: calc(100% - 32px); max-width: 420px; max-height: 80vh; margin: auto; padding: 14px 12px 12px; overflow: hidden;
  border: 0; border-radius: 16px; background: var(--cream); color: var(--ink); border-top: 8px solid var(--gold);
  box-shadow: 0 18px 50px rgb(30 20 4 / .5);
}
dialog.choose[open] { display: flex; flex-direction: column; }
dialog.choose::backdrop { background: rgb(40 28 8 / .55); }
dialog.choose h2 { margin: 0 4px 10px; font: 700 12px/1.2 var(--font-body); font-stretch: 80%; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
dialog.choose .picks { flex: 1 1 auto; min-height: 0; max-height: none; margin: 0; }
dialog.choose .pick { padding: 14px 12px; font-size: 15.5px; }
dialog.choose .pick:disabled { color: var(--muted); opacity: .6; cursor: default; }
dialog.choose .pick:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }

/* ---- substitutes in the fermentable popup ---- */
#fd-subs:not(:empty), #hd-subs:not(:empty) { margin-top: 14px; padding-top: 12px; border-top: 1.5px dashed var(--line); }
#fd-subs h3, #hd-subs h3 { margin: 0; font: 700 12px/1.4 var(--font-body); font-stretch: 80%; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.name-btn small.when { color: var(--muted); font-weight: 600; text-transform: none; letter-spacing: .02em; font-size: 12px; font-stretch: 90%; }
.row.compact .derived { flex-basis: 54px; }

/* ---- water ---- */
.row.salts .fld, .ions-row .fld { flex: 1 1 96px; }
.ions-row .fld { flex-basis: 78px; }
.pva.ions th:first-child { width: 22%; }
.row.salts .fld > span { white-space: normal; }

/* ---- mash pH ---- */
.ph-block { margin-top: 16px; padding-top: 14px; border-top: 1.5px solid var(--line); }
.ph-block h3 { margin: 0 0 10px; font: 800 12px/1.3 var(--font-body); font-stretch: 75%; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.ph-read { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: var(--paper); border: 1.5px solid var(--line); }
.ph-read span { font: 800 12px/1.2 var(--font-body); font-stretch: 75%; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.ph-read b { font: 400 26px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.ph-read.ok { border-color: var(--ok); } .ph-read.ok b { color: var(--ok); }
.ph-read.high b, .ph-read.low b { color: var(--warn); }
.ph-block .hint .btn { margin: 4px 0 0 2px; }

/* ---- hop aroma spider charts ---- */
.radar { display: block; flex: 0 0 auto; max-width: 100%; height: auto; }
.radar .ring { fill: none; stroke: var(--line); stroke-width: 1; }
.radar .spoke { stroke: var(--line); stroke-width: 1; }
.radar .shape { fill: rgb(234 162 26 / .5); stroke: var(--gold-deep); stroke-width: 2; stroke-linejoin: round; }
.radar text { font: 600 10.5px var(--font-body); fill: var(--muted); }
svg.radar[width="38"] .ring, svg.radar[width="34"] .ring { stroke-width: 3; }
svg.radar[width="38"] .shape, svg.radar[width="34"] .shape { stroke-width: 4; }
.name-btn.glyph { flex-direction: row; align-items: center; gap: 9px; }
.name-btn.glyph > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pick.glyph { align-items: center; }
.pick.glyph > span { flex: 1; }
.pick.on .radar .ring { stroke: var(--on-green-muted); }
.aroma-box { margin-top: 12px; display: flex; flex-direction: column; align-items: center; }
.aroma-box h3 { align-self: flex-start; margin: 0 0 4px; font: 800 12px/1.3 var(--font-body); font-stretch: 75%; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.aroma-box .hint { align-self: flex-start; }
#hop-aroma:not(:empty) { margin-top: 14px; padding-top: 12px; border-top: 1.5px solid var(--line); }
svg.radar.malt .ring { stroke: rgb(74 52 14 / .35); stroke-width: 5; }
.amt { flex-basis: 86px; }
.amt input { padding-left: 6px; }
.row.compact { gap: 4px; }
.row.compact .icon-btn { flex-basis: 30px; }

/* ---- colour chip tooltip ---- */
.chip { position: relative; flex: 0 0 auto; display: block; }
.chip::after {
  content: attr(data-tip); position: absolute; left: 0; bottom: calc(100% + 6px);
  padding: 5px 8px; border-radius: 6px; background: var(--ink); color: var(--paper); font: 500 12px/1 var(--font-mono); white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 3;
}
.chip:hover::after, .name-btn:focus-visible .chip::after { opacity: 1; }
.g-value small { font: 500 11px/1 var(--font-mono); color: var(--muted); margin-left: 2px; }

/* ---- gauges inside a card (water ions, mash pH) ---- */
.gauges.inset { margin-top: 14px; box-shadow: none; border: 1.5px solid var(--line); border-radius: 10px; background: var(--line); }
.gauges.inset .gauge { background: var(--paper); }
.gauges.inset.one { grid-template-columns: 1fr; }
.gauges.inset .g-value small { font: 500 11px/1 var(--font-mono); color: var(--muted); }
.gauges.inset .g-label { text-transform: none; letter-spacing: .06em; font-size: 13px; }

/* ---- hydrometer link ---- */
#sec-device .summary { border-top: 0; padding-top: 0; }
.summary .stable { color: var(--ok); font-weight: 700; }
#sec-device .foot-actions { margin-top: 12px; }

/* ---- storage and sign-in ---- */
#storage .segs { margin-bottom: 4px; }
#storage form { margin-top: 12px; }
#storage .foot-actions { margin-top: 12px; }
#storage .foot-actions.alt { padding-top: 12px; border-top: 1.5px dashed var(--line); }
#storage .summary { border-top: 0; padding-top: 0; }

/* Yeast rows: a ring filled to the yeast's attenuation. */
svg.radar.yeast .ring { stroke: var(--line); stroke-width: 14; }
svg.radar.yeast .shape { fill: none; stroke: var(--gold-deep); stroke-width: 14; stroke-linejoin: miter; }

/* ---- recipe versions ---- */
.v-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.v-bar a { color: var(--warn); font-weight: 600; }
.v-list { display: flex; gap: 2px; }
.v-list a, .v-list b { font: 500 12px/1 var(--font-mono); padding: 5px 7px; border-radius: 999px; text-decoration: none; }
.v-list a { color: var(--ink); border: 1px solid var(--line); }
.v-list b { background: var(--green); color: var(--on-green); border: 1px solid var(--green); }
.v-old { margin: 8px 0 0; padding: 6px 9px; border-radius: 6px; background: var(--band); font-size: 13px; }
.v-old a { font-weight: 600; }

/* ---- brew sheet: a sheet of paper on screen, plain black on white when printed ---- */
.brewsheet { background: #fff; color: #111; padding: 22px 18px; border-radius: 4px; box-shadow: 0 3px 0 rgb(74 52 14 / .32), 0 0 0 1px rgb(74 52 14 / .14); font: 400 13px/1.35 var(--font-body); }
.bs-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.brewsheet h1 { font: 400 22px/1.1 var(--font-display); color: #111; }
.brewsheet h1::after { display: none; }
.bs-sub { margin: 4px 0 0; color: #555; }
.bs-glass { flex: 0 0 auto; }
.bs-meta, .bs-stats { display: grid; margin: 14px 0 0; gap: 8px 12px; }
.bs-meta { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.bs-stats { grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 0; border: 1px solid #bbb; }
.bs-meta dt, .bs-stats dt, .bs-table th { font: 700 10px/1.2 var(--font-body); font-stretch: 80%; letter-spacing: .08em; text-transform: uppercase; color: #666; }
.bs-meta dd { margin: 2px 0 0; min-height: 18px; }
.bs-stats > div { padding: 6px 4px; text-align: center; background: #f1f1f1; border: .5px solid #ccc; }
.bs-stats dd { margin: 2px 0 0; font: 500 15px/1.2 var(--font-mono); }
.bs-blank { display: inline-block; width: 100%; min-width: 60px; height: 1.1em; border-bottom: 1px solid #777; vertical-align: bottom; }
.bs-sec { margin-top: 18px; break-inside: avoid; }
.bs-sec h2 { background: none; padding-left: 0; font: 800 12px/1.2 var(--font-body); font-stretch: 75%; letter-spacing: .14em; text-transform: uppercase; padding-bottom: 4px; border-bottom: 1.5px solid #111; }
.bs-pair { display: grid; gap: 0 22px; }
@media (min-width: 640px) { .bs-pair { grid-template-columns: 1fr 1fr; } }
.bs-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.bs-table th { text-align: left; padding: 6px 4px 4px; }
.bs-table td { padding: 5px 4px; border-bottom: 1px solid #ddd; overflow-wrap: anywhere; vertical-align: top; }
.bs-table .r { text-align: right; font-family: var(--font-mono); font-size: 12.5px; }
@media (max-width: 480px) { .bs-table td { padding: 5px 3px; font-size: 12.5px; } .bs-table .r { font-size: 11.5px; } }
.bs-table th.r { font-family: var(--font-body); font-size: 10px; }
.bs-check { list-style: none; margin: 6px 0 0; padding: 0; }
.bs-check li { display: flex; gap: 9px; padding: 3px 0; }
.bs-box { flex: 0 0 13px; height: 13px; margin-top: 2px; border: 1.2px solid #111; font: 700 11px/11px var(--font-body); text-align: center; }
.bs-text { margin: 8px 0 0; }
.bs-lines span { display: block; height: 26px; border-bottom: 1px solid #ccc; }
.bs-note { margin: 6px 0 0; color: #666; font-size: 12px; }
.bs-foot { margin-top: 20px; padding-top: 6px; border-top: 1px solid #ccc; color: #666; font-size: 11px; }

@media print {
  @page { size: A4; margin: 14mm; }
  html, body { background: #fff !important; padding: 0; min-height: 0; }
  header.top, nav.tabs, #toast, .no-print, dialog { display: none !important; }
  main#view { padding: 0; margin: 0; max-width: none; }
  .brewsheet { box-shadow: none; padding: 0; font-size: 10pt; }
  .bs-pair { grid-template-columns: 1fr 1fr; }
  .bs-stats > div { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .bs-check li, .bs-table tr { break-inside: avoid; }
}

/* Recipe name refused because another recipe uses it. */
.name-err { margin: 6px 0 0; font-size: 13px; font-weight: 600; color: var(--red); }
.name-err:empty { display: none; }
.title-input[aria-invalid] { border-bottom-color: var(--red); }

/* Brew rating: five small glasses. Filled ones take the beer's colour. */
.mini-pint { display: block; flex: 0 0 auto; }
.mini-pint.empty { opacity: .4; }
.rating { display: flex; gap: 3px; color: var(--ink); }
.rate-wrap { margin-top: 12px; }
.rate-label { font: 700 11px/1.2 var(--font-body); font-stretch: 80%; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.rate { display: flex; align-items: center; flex-wrap: wrap; margin: 2px 0 0 -9px; }
.rate-btn { display: grid; place-items: center; min-width: 44px; min-height: 48px; padding: 0; border: 0; border-radius: 10px; background: none; color: var(--ink); cursor: pointer; }
.rate-btn:hover .mini-pint.empty { opacity: .7; }
.rate-num { margin-left: 6px; font: 500 14px/1 var(--font-mono); color: var(--muted); }

/* Hydrometer chart: gravity, then temperature on the same time scale. */
.dchart-wrap { margin-top: 10px; max-width: 560px; border-radius: 10px; touch-action: pan-y; cursor: crosshair; }
.readout { min-height: 2.6em; margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.readout b { font: 500 14px/1 var(--font-mono); color: var(--ink); }
.dchart { display: block; width: 100%; height: auto; }
.dchart + .dchart { margin-top: 6px; }
.dchart text { font: 10px var(--font-mono); fill: var(--muted); }
.dchart .ptitle { font: 700 10px var(--font-body); font-stretch: 80%; letter-spacing: .08em; text-transform: uppercase; fill: var(--muted); }
.dchart .grid { stroke: var(--line); stroke-width: 1; }
.dchart .target { stroke: var(--ok); stroke-width: 1.2; stroke-dasharray: 4 3; }
.dchart .line { fill: none; stroke-width: 2; stroke-linejoin: round; }
.dchart.grav .line { stroke: var(--gold-deep); }
.dchart.grav .area { fill: var(--gold); opacity: .22; }
.dchart.temp .line { stroke: var(--green); }
.dchart.temp .area { fill: none; }
.dchart .pt { fill: var(--cream); stroke: var(--ink); stroke-width: 2; }
.dchart .xh { stroke: var(--ink); stroke-width: 1; opacity: .5; }
.dchart .xh-dot { fill: var(--ink); stroke: var(--cream); stroke-width: 2; }

/* Photos: the brew timeline and the pump clip. */
img.photo { display: block; max-width: 100%; height: auto; background: var(--wall-deep); color: var(--muted); font-size: 12px; }
img.photo.missing { min-height: 64px; padding: 10px; border: 1.5px dashed var(--line); background: none; }
.label-art.has-clip { padding-right: 0; }
.clip-btn { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; }
img.clip-img { width: auto; max-width: 96px; max-height: 140px; object-fit: contain; border-radius: 6px; box-shadow: 0 6px 14px rgb(40 26 4 / .3); }
.clip-thumb { flex: 0 0 34px; display: flex; justify-content: center; }
.clip-thumb img { width: auto; max-width: 40px; max-height: 50px; object-fit: contain; border-radius: 4px; box-shadow: 0 2px 5px rgb(40 26 4 / .3); }
.clip-links { display: flex; flex-wrap: wrap; gap: 0 16px; margin-top: 6px; }
label.link-btn { display: inline-flex; align-items: center; }
.tl-add { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.file-btn { cursor: pointer; }
input.sr:focus-visible + .file-btn { outline: 3px solid var(--gold); outline-offset: 2px; }
.timeline, .timeline ol { list-style: none; margin: 0; padding: 0; }
.timeline { margin-top: 16px; }
.tl-day + .tl-day { margin-top: 14px; }
.tl-day h3 { margin: 0 0 6px; font: 700 11px/1.3 var(--font-body); font-stretch: 80%; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tl-day > ol { margin-left: 5px; padding-left: 16px; border-left: 2px solid var(--line); }
.tl-entry { position: relative; padding: 4px 0 10px; }
.tl-entry::before { content: ""; position: absolute; left: -23px; top: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); border: 2px solid var(--cream); }
.tl-photo { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.tl-photo img { width: 100%; max-height: 340px; object-fit: cover; border-radius: 10px; }
.tl-body { margin-top: 4px; }
.tl-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-meta input { padding: 2px 0; border: 0; background: none; font: 500 12px/1.4 var(--font-mono); color: var(--muted); min-height: 28px; }
.tl-stage { font: 700 10px/1 var(--font-body); font-stretch: 80%; letter-spacing: .08em; text-transform: uppercase; color: var(--warn); border: 1.5px solid currentColor; border-radius: 4px; padding: 3px 5px; }
.tl-body textarea { display: block; width: 100%; margin-top: 2px; padding: 6px 8px; border: 1.5px solid transparent; border-radius: 8px; background: rgb(255 255 255 / .35); font: 400 14px/1.45 var(--font-body); color: var(--ink); resize: vertical; field-sizing: content; min-height: 2.4em; }
.tl-body textarea:focus { border-color: var(--line); background: var(--paper); }
.tl-actions { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.link-btn { min-height: 36px; padding: 0; border: 0; background: none; font: 600 12px/1 var(--font-body); color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn.danger { color: var(--red); }
.link-btn[aria-pressed="true"] { color: var(--ok); text-decoration: none; }
.link-btn[aria-pressed="true"]::before { content: "✓ "; }
dialog.photo-view { max-width: min(900px, calc(100vw - 24px)); }
dialog.photo-view img.big { width: 100%; max-height: 72vh; object-fit: contain; margin-top: 10px; border-radius: 8px; background: none; }
dialog.photo-view .caption { margin: 10px 0 0; font-size: 14px; }

/* Narrow phones: no room for the header subtitle beside the status chip. */
@media (max-width: 384px) {
  .brand-sub { display: none; }
}

/* Brew days: one row per year, a dot per brew. */
.bd-facts { margin: 8px 0 6px; font-size: 13px; }
.bd-readout { height: 2.9em; margin: 4px 0 0; font-size: 13px; line-height: 1.45; color: var(--muted); overflow: hidden; } /* fixed height: the chart must not move under the pointer */
.bd-readout b { color: var(--ink); font-weight: 700; }
.bdays { display: block; width: 100%; height: auto; }
.bdays text { font: 10px var(--font-mono); fill: var(--muted); }
.bdays .track { fill: var(--line); opacity: .55; }
.bdays .track.future { opacity: .2; }
.bdays .mdiv { stroke: var(--cream); stroke-width: 1.5; }
.bdays .today { stroke: var(--ink); stroke-width: 1.5; }
.bdays .bday circle { stroke: var(--ink); stroke-width: 1.25; }
.bdays .bday circle.hit { fill: transparent; stroke: none; } /* a bigger target for a finger */
.bdays .bday:hover circle:not(.hit), .bdays .bday:focus circle:not(.hit) { stroke-width: 2.5; }
.bdays .bday:focus { outline: none; }
.bdays .bday:focus-visible circle:not(.hit) { stroke: var(--gold-deep); stroke-width: 3; }

/* Settings pages: a row of links under the heading. */
.subnav { margin: 0 0 14px; }
.subnav .seg { text-decoration: none; }
.subnav .seg:not(.on) { background: rgb(255 250 240 / .55); border-color: var(--wall-deep); color: var(--ink); }

/* Brew page: the device picker and its fetch button on one line. */
.dev-row { align-items: flex-end; margin-top: 14px; }
.dev-row .btn { margin-bottom: 2px; }
