/* TankTrue: Meniscus brand. Two self-hosted faces (Geist + Instrument Serif, both OFL), so the strict CSP holds. */
@font-face {
  font-family: "Geist"; src: url("/fonts/geist-latin.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Serif"; src: url("/fonts/instrument-serif-latin.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Serif"; src: url("/fonts/instrument-serif-italic-latin.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  color-scheme: light dark;
  --h: 182; /* sea glass: water, not indigo */
  --a1: oklch(0.95 0.03 178);
  --a2: oklch(0.90 0.05 178);
  --a3: oklch(0.80 0.08 178);
  --a5: oklch(0.60 0.10 178);
  --a6: oklch(0.48 0.09 185);
  --a7: oklch(0.38 0.07 190);
  --on-accent: oklch(0.99 0.01 175);
  --bg: oklch(0.97 0.012 175);
  --surface: oklch(0.995 0.004 175);
  --ink: oklch(0.24 0.03 210);
  --ink-2: oklch(0.46 0.025 205);
  --line: oklch(0.89 0.016 180);
  --field-line: oklch(0.58 0.02 200); /* 3:1 on bg and surface (WCAG 1.4.11) */
  --warn-bg: oklch(0.96 0.045 85);
  --warn-ink: oklch(0.42 0.09 65);
  --warn-line: oklch(0.80 0.12 80);
  --bad: oklch(0.52 0.17 28);
  --urgent: oklch(0.52 0.17 28);
  --on-warn: var(--ink);
  --band: oklch(0.86 0.06 180);
  --water-1: oklch(0.86 0.07 180);
  --water-2: oklch(0.70 0.10 190);
  --glass: oklch(1 0 0 / 0.55);
  --meniscus: oklch(0.60 0.10 178);
  --r-chip: 8px; --r-card: 14px; --r-sheet: 22px; --r-pill: 999px; --r-tick: 2px; --r-vial: 30px;
  --r1: var(--r-chip); --r2: var(--r-chip); --r3: var(--r-card);
  --shadow: 0 1px 2px oklch(0.3 0.04 205 / 0.06), 0 12px 32px -20px oklch(0.3 0.06 205 / 0.32);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-fill: cubic-bezier(0.34, 1.3, 0.64, 1); /* the water rise only */
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1); /* done checks only */
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Instrument Serif", ui-serif, Georgia, "Times New Roman", serif;
  /* 1.2 scale from 1rem */
  --t-1: 0.833rem; --t1: 1.2rem; --t2: 1.44rem; --t3: 1.728rem; --t4: 2.074rem; --t5: 2.488rem; --t6: 2.986rem; --t7: 3.583rem; --t8: 4.1rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --a1: oklch(0.26 0.035 190);
    --a2: oklch(0.33 0.05 185);
    --a3: oklch(0.48 0.08 180);
    --a5: oklch(0.72 0.11 174);
    --a6: oklch(0.80 0.11 172);
    --a7: oklch(0.87 0.08 172);
    --on-accent: oklch(0.2 0.025 195);
    --bg: oklch(0.2 0.025 195);
    --surface: oklch(0.245 0.03 195);
    --ink: oklch(0.95 0.012 175);
    --ink-2: oklch(0.74 0.025 180);
    --line: oklch(0.34 0.03 195);
    --field-line: oklch(0.6 0.03 190);
    --warn-bg: oklch(0.28 0.05 75);
    --warn-ink: oklch(0.88 0.09 85);
    --warn-line: oklch(0.62 0.12 75);
    --bad: oklch(0.74 0.14 28);
    --urgent: oklch(0.76 0.14 28);
    --on-warn: oklch(0.2 0.025 195);
    --band: oklch(0.40 0.07 185);
    --water-1: oklch(0.45 0.08 185);
    --water-2: oklch(0.32 0.07 200);
    --glass: oklch(1 0 0 / 0.06);
    --meniscus: oklch(0.80 0.11 172);
    --shadow: 0 1px 2px oklch(0 0 0 / 0.4), 0 12px 32px -18px oklch(0 0 0 / 0.7);
  }
}
/* Browsers without OKLCH (pre-2023): sRGB hex of the same tokens. */
@supports not (color: oklch(0 0 0)) {
  :root {
    --bg: #edf8f5; --surface: #fbfefd; --ink: #0c2327; --ink-2: #485c5f; --line: #d0dedb; --field-line: #6d7e7f; --a1: #daf6ee; --a2: #bce9de; --a5: #269380; --a6: #006e64; --a7: #004e4b; --on-accent: #f5fefb; --band: #a6ded2; --water-1: #9ee1d3; --water-2: #43b2ac; --meniscus: #269380; --glass: #ffffff8c;
  }
  @media (prefers-color-scheme: dark) {
    :root {
      --bg: #071a19; --surface: #0d2525; --ink: #e7f1ee; --ink-2: #9bb0ab; --line: #253d3d; --field-line: #6c8684; --a1: #0c2928; --a2: #0f3e39; --a5: #4bbb9f; --a6: #6ad5b6; --a7: #9de6ce; --on-accent: #071a19; --band: #01544d; --water-1: #00635b; --water-2: #003d41; --meniscus: #6ad5b6; --glass: #ffffff0f;
    }
  }
}

*, *::before, *::after { box-sizing: border-box; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 20; padding: 0.75rem 1rem; border-radius: var(--r1); background: var(--ink); color: var(--bg); }
.skip:focus { top: 1rem; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0 auto; max-width: 46rem; padding: 0 16px calc(6rem + env(safe-area-inset-bottom));
  background: var(--bg); color: var(--ink);
  font: 400 1rem/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, .range, .price { font-family: var(--display); font-weight: 400; font-synthesis: none; letter-spacing: -0.02em; }
p { margin: 0 0 0.75rem; }

/* ---- Type ---------------------------------------------------------------- */
.eyebrow {
  margin: 0 0 0.5rem; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--a6);
}
.masthead { padding: clamp(2.5rem, 9vw, 4.5rem) 0 1.75rem; }
h1 {
  margin: 0 0 0.875rem; max-width: 13ch;
  font-size: clamp(2.125rem, 7.2vw, 3.375rem); font-weight: 700; line-height: 1.02; letter-spacing: -0.035em;
}
h2 { margin: 0 0 0.5rem; font-family: var(--display); font-size: var(--t3); font-weight: 400; line-height: 1.1; letter-spacing: -0.01em; }
.points { max-width: 36rem; margin: 1.5rem 0 0; padding-left: 1.125rem; display: grid; gap: 0.375rem; font-size: var(--t-1); color: var(--ink-2); }
.points li::marker { color: var(--a6); }
#install { margin-top: 1rem; }
.unit, .hint, .caption, .fineprint { color: var(--ink-2); }
.unit { font-weight: 400; font-size: 0.8125rem; }
.hint, .caption { font-size: 0.875rem; }
.fineprint { font-size: 0.8125rem; border-top: 1px solid var(--line); padding-top: 0.875rem; margin-top: 1.25rem; }

/* ---- Cards & form --------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r3);
  box-shadow: var(--shadow); padding: clamp(1.125rem, 4vw, 1.75rem); margin-bottom: 1.25rem;
}
fieldset { border: 0; margin: 0 0 1.5rem; padding: 0; min-width: 0; }
legend { font-weight: 650; font-size: 1.0625rem; letter-spacing: -0.01em; margin-bottom: 0.875rem; padding: 0; }
.grid { display: grid; gap: 0.875rem 1rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
label { display: block; font-size: 0.875rem; font-weight: 550; }
label > input, label > select { display: block; margin-top: 0.375rem; }
input, select, button { font: inherit; color: inherit; }
input, select {
  width: 100%; min-height: 2.75rem; padding: 0.5rem 0.75rem;
  background: var(--bg); border: 1px solid var(--field-line); border-radius: var(--r1);
  font-variant-numeric: tabular-nums;
}
input[type=number] { appearance: textfield; -moz-appearance: textfield; }
input::-webkit-inner-spin-button, input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--a5); outline-offset: 2px;
}
.check { display: flex; align-items: center; gap: 0.625rem; margin-top: 1rem; font-weight: 450; }
.check input { width: 1.25rem; min-height: 1.25rem; accent-color: var(--a6); }

/* Readings: date on its own line on phones, one row per reading from 640px. */
.reading {
  display: grid; gap: 0.375rem; align-items: center; margin-bottom: 0.625rem;
  grid-template-columns: repeat(7, minmax(0, 1fr)) 2.75rem;
}
.reading input { padding: 0.5rem 0.125rem; text-align: center; }
.reading .when { grid-column: 1 / 8; display: flex; gap: 0.375rem; }
.reading .when input { text-align: left; min-width: 0; }
.reading .when [type=date] { flex: 1; }
.reading .when [type=time] { flex: 0 1 7rem; }
.reading .remove { grid-column: 8; grid-row: 1; }
.reading.head { font-size: 0.75rem; font-weight: 600; color: var(--ink-2); text-align: center; margin-bottom: 0.375rem; }
/* Phones: the strip names fit the narrow columns where the full words overlap. */
@media (max-width: 639px) {
  .reading.head [data-short] { font-size: 0; }
  .reading.head [data-short]::before { content: attr(data-short); font-size: 0.75rem; }
}
.reading.head span:first-child, .reading.head span:last-child { display: none; }
.remove {
  min-height: 2.75rem; border: 0; border-radius: var(--r1); background: none;
  color: var(--ink-2); font-size: 1.25rem; cursor: pointer;
}
.remove:hover { background: var(--a1); color: var(--ink); }
@media (min-width: 640px) {
  .reading { grid-template-columns: 15rem repeat(7, minmax(0, 1fr)) 2.75rem; }
  .reading .when { grid-column: auto; }
  .reading .remove { grid-column: auto; grid-row: auto; }
  .reading.head span:first-child, .reading.head span:last-child { display: block; }
  .reading.head span:first-child { text-align: left; }
}
.row-actions { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }

/* ---- Buttons --------------------------------------------------------------- */
button, .primary { cursor: pointer; }
/* Secondary: any button without a class of its own. */
button:not([class]) {
  min-height: 2.75rem; padding: 0 1.125rem; border: 1px solid var(--a5); border-radius: var(--r2);
  background: var(--surface); color: var(--a7); font-weight: 600;
}
button:not([class]):hover { background: var(--a1); }
.primary, .save button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: 0 1.375rem; border: 0; border-radius: var(--r2);
  background: var(--a6); color: var(--on-accent); font-weight: 650; text-decoration: none;
  transition: background 160ms var(--ease), transform 160ms var(--ease);
}
.primary:hover, .save button:hover { background: var(--a7); }
.primary:active, .save button:active { transform: translateY(1px); }
form > .primary { width: 100%; }
@media (min-width: 640px) { form > .primary { width: auto; } }
.quiet { border: 0; background: none; padding: 0.375rem 0; color: var(--a6); font-weight: 600; }
.file { cursor: pointer; }
.file input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file:focus-within { outline: 2px solid var(--a6); outline-offset: 2px; }
.quiet:hover { color: var(--a7); text-decoration: underline; text-underline-offset: 3px; }
/* Touch screens: every tap target at least 44px (WCAG 2.5.5). */
@media (pointer: coarse) {
  button, summary, .check { min-height: 44px; }
  .remove { min-width: 44px; min-height: 44px; }
  p a:not(.primary), li a:not(.primary) { padding-block: 0.625rem; } /* inline links: taller hit area, same line box */
}
.errors { color: var(--bad); font-size: 0.9375rem; font-weight: 550; }
.errors:empty { display: none; }

/* ---- Result ---------------------------------------------------------------- */
.result.shown { animation: rise 360ms var(--ease) both; }
.range {
  margin: 0.25rem 0 0.375rem; font-size: clamp(1.875rem, 7.5vw, 2.875rem); font-weight: 700;
  line-height: 1.08; letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
}
.range .to { font-family: var(--sans); font-size: 0.45em; font-weight: 500; letter-spacing: 0; color: var(--ink-2); vertical-align: 0.35em; padding: 0 0.15em; }

/* Next step: the one thing to do, set apart from the explanation below it. */
.today {
  margin: 1.25rem 0; padding: 0.875rem 1rem; border-radius: var(--r2);
  border-left: 3px solid var(--a6); background: var(--a1);
}
.today .eyebrow { margin-bottom: 0.25rem; }
.today p:last-child { margin: 0; font-size: 1.0625rem; font-weight: 550; line-height: 1.4; }

/* The memorable bit: a week-ruled timeline with the P50-P90 band shaded, so uncertainty is visible. */
.timeline { margin: 1.5rem 0 1rem; }
.tl-axis {
  position: relative; height: 2.75rem; border-bottom: 2px solid var(--ink-2);
  background: repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px var(--week, 100%));
}
.tl-band { position: absolute; top: 0.625rem; bottom: 0; background: var(--band); border-radius: var(--r1) var(--r1) 0 0; }
.result.shown .tl-band { animation: fill 640ms var(--ease) both; transform-origin: left; }
.tl-tick { position: absolute; bottom: 0; width: 2px; translate: -50% 0; }
.tl-confirm { top: 0.25rem; background: var(--ink-2); }
.tl-p90 { top: 0.625rem; background: var(--a7); }
.tl-dot {
  position: absolute; bottom: 0; translate: -50% 50%; width: 1.125rem; height: 1.125rem;
  border-radius: var(--r-pill); background: var(--surface); border: 3px solid var(--a6);
}
.tl-scale {
  display: flex; justify-content: space-between; margin-top: 0.5rem;
  font-size: 0.75rem; color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.tl-legend { margin: 0.875rem 0 0; display: grid; gap: 0.375rem; }
.tl-legend div { display: flex; align-items: baseline; gap: 0.625rem; }
.tl-legend dt { font-size: 0.9375rem; color: var(--ink-2); }
.tl-legend dd { margin: 0 0 0 auto; font-family: var(--sans); font-weight: 650; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tl-legend div::before { content: ""; flex: none; width: 0.875rem; height: 0.875rem; translate: 0 0.125rem; }
.key-confirm::before { background: linear-gradient(90deg, transparent 6px, var(--ink-2) 6px 8px, transparent 8px); }
.key-p50::before { border-radius: var(--r-pill); border: 3px solid var(--a6); }
.key-p90::before { background: var(--band); border-right: 2px solid var(--a7); border-radius: var(--r-tick); }
.key-confirm dd { color: var(--a7); }

.note, .warnings li {
  padding: 0.75rem 1rem; border-radius: var(--r2); border-left: 3px solid var(--warn-line);
  background: var(--warn-bg); color: var(--warn-ink); font-size: 0.9375rem;
}
.explain, .warnings { list-style: none; margin: 1rem 0; padding: 0; display: grid; gap: 0.5rem; }
.explain li { padding-left: 1rem; position: relative; color: var(--ink-2); }
.explain li::before { content: ""; position: absolute; left: 0; top: 0.65em; width: 0.375rem; height: 0.375rem; border-radius: var(--r-pill); background: var(--a5); }
.warnings:empty, .explain:empty, .note:empty { display: none; }

details { margin-top: 1rem; }
summary { cursor: pointer; font-weight: 600; color: var(--a6); padding: 0.25rem 0; }
.table-wrap { overflow-x: auto; margin: 0.75rem 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: 0.75rem; margin: 0.75rem 0; }
.kpis dt { font-size: 0.8125rem; color: var(--ink-2); }
.kpis dd { margin: 0.125rem 0 0; font-family: var(--sans); font-size: 1.375rem; letter-spacing: -0.01em; }
.notice code { overflow-wrap: anywhere; }
.kpis .unit { display: block; }
.prose .card > h2:first-child { margin-top: 0; }
#commission table, .notice table { white-space: normal; }
.notice td:first-child { white-space: nowrap; }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
th, td { text-align: left; padding: 0.5rem 0.75rem 0.5rem 0; border-bottom: 1px solid var(--line); }
th { font-size: 0.75rem; font-weight: 600; color: var(--ink-2); }

/* ---- Save + pre-order -------------------------------------------------------- */
.next { display: grid; gap: 1.25rem; margin-top: 1.5rem; }
@media (min-width: 720px) { .next { grid-template-columns: 1fr 1fr; align-items: start; } }
.save label { font-size: 0.9375rem; font-weight: 600; }
.inline { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.inline input { flex: 1; min-width: 0; }
.save .hint { margin-top: 0.5rem; }
.sync { margin-top: 1.25rem; display: grid; gap: 0.75rem; }
.sync > * { margin: 0; }
.sync .explain { margin: 0; }
.sync .explain button { text-align: left; }
.consent { margin: 0.625rem 0 0; font-size: 0.8125rem; color: var(--ink-2); }
.pass {
  padding: 1.25rem; border-radius: var(--r2); border: 1px solid var(--a3);
  background: linear-gradient(160deg, var(--a1), var(--surface) 70%);
}
.pass p:not(.eyebrow):not(.price) { font-size: 0.9375rem; color: var(--ink-2); }
.price { margin: 0 0 0.5rem; font-size: 2.25rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.price span { font-family: var(--sans); font-size: 0.875rem; font-weight: 500; letter-spacing: 0; color: var(--ink-2); }
.pass .primary { width: 100%; margin-top: 0.25rem; }

/* ---- Static page header ---- */
.page-head { margin-bottom: 1.5rem; }
.lockup { display: inline-flex; align-items: center; gap: 0.375rem; color: var(--ink); text-decoration: none; font-family: var(--display); font-size: var(--t3); letter-spacing: -0.01em; line-height: 1; }
.lockup svg { width: 1.75rem; height: 1.75rem; }
.lockup .w { fill: var(--a5); }

/* ---- Pricing (8d) ------------------------------------------------------------ */
.plans { display: grid; gap: 0.75rem; margin-top: 1rem; }
@media (min-width: 720px) {
  .plans { grid-template-columns: 1.15fr 1fr; }
  #plan-pass, #plan-lifetime { grid-column: 1 / -1; }
}
.plan .primary { display: flex; width: 100%; margin-top: 0.75rem; text-align: center; }
.plan .primary:disabled { background: var(--line); color: var(--ink-2); cursor: default; transform: none; }
.plan .terms { margin: 0.5rem 0 0; font-size: 0.8125rem; color: var(--ink-2); }
#plan-pass { border-color: var(--a3); background: linear-gradient(160deg, var(--a1), var(--surface) 70%); }
.pro-lock { margin: 0.5rem 0 0; font-size: 0.9375rem; color: var(--ink-2); }
/* UI-only gate (see app.js): [data-pro] hides for free users, the lock note hides for Pro. */
body:not(.pro) [data-pro] { display: none !important; }
.pro .pro-lock { display: none; }

/* ---- Calculator ------------------------------------------------------------- */
.calc > p { color: var(--ink-2); }
.calc .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.625rem; margin: 1rem 0; align-items: end; }
.calc-out { display: block; padding: 0.875rem 1rem; border-radius: var(--r2); background: var(--a1); font-size: 0.9375rem; }
.calc-out strong { font-family: var(--sans); font-size: 1.125rem; letter-spacing: -0.01em; }
.calc-out[data-level=warn], .calc-out[data-level=high] { background: var(--warn-bg); color: var(--warn-ink); }
.calc-out[data-level=high] strong { color: var(--bad); }

/* ---- Chrome ------------------------------------------------------------------ */
.banner {
  margin: 0.75rem auto 0; padding: 0.5rem 0.875rem; border-radius: var(--r-pill); width: fit-content; max-width: 100%;
  background: var(--ink); color: var(--bg); font-size: var(--t-1); font-weight: 550;
  box-shadow: 0 6px 24px -8px rgb(0 0 0 / 0.3);
}
.banner .quiet { margin-left: 0.5rem; padding: 0; color: inherit; text-decoration: underline; }
footer { font-size: 0.8125rem; color: var(--ink-2); padding-top: 0.5rem; }
a { color: var(--a6); text-underline-offset: 3px; }
a.primary { color: var(--on-accent); }

/* ---- Privacy page and unsubscribe/delete confirmations ------------------------ */
.prose, .notice { margin-top: clamp(1.5rem, 6vw, 3rem); }
.prose h1, .notice h1 { font-size: clamp(1.875rem, 6vw, 2.5rem); }
.prose h2 { font-size: 1.125rem; margin-top: 1.75rem; }
.prose ul { padding-left: 1.25rem; display: grid; gap: 0.5rem; }
.notice form { margin: 1.25rem 0; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes fill { from { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- Tanks -------------------------------------------------------------------- */
.switch { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; font-weight: 600; }
.switch select { flex: 1; margin-top: 0; }
.tanks .grid { margin: 1rem 0; }

.toast {
  position: fixed; left: 50%; bottom: calc(4.75rem + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 10;
  display: flex; align-items: center; gap: 1rem; padding: 0.625rem 1rem;
  border-radius: var(--r1); background: var(--ink); color: var(--bg); box-shadow: 0 6px 24px rgb(0 0 0 / 0.25);
}
.toast[hidden] { display: none; }
.toast .quiet { min-height: 2.75rem; color: inherit; text-decoration: underline; }

/* Trends: green / amber / red bands; the label beside each chart says the level in words too. */
.trends { --ok: oklch(0.72 0.13 150); --watch: oklch(0.80 0.14 80); --high: oklch(0.62 0.18 28); }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; font-size: 0.8125rem; color: var(--ink-2); }
.key { display: inline-block; width: 0.875rem; height: 0.625rem; border-radius: var(--r-tick); margin-left: 0.375rem; }
.key.band-ok { background: color-mix(in oklch, var(--ok) 35%, transparent); }
.key.band-watch { background: color-mix(in oklch, var(--watch) 40%, transparent); }
.key.band-high { background: color-mix(in oklch, var(--high) 35%, transparent); }
.key.band-cycling { background: color-mix(in oklch, var(--ink-2) 25%, transparent); }
.wc-key { width: 0; height: 0.875rem; border-left: 2px dashed var(--a6); border-radius: 0; }
.chart { margin: 0 0 1.25rem; }
.levels { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: 0.625rem; }
.levels > li { font-size: 0.9375rem; }
.chart figcaption { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 0.375rem; font-size: 0.9375rem; }
.chart-note { margin: 0.5rem 0 0; }
.chart-caption { margin: 0.375rem 0 0; font-size: 0.8125rem; color: var(--ink-2); }
.chart svg { display: block; width: 100%; height: auto; border-radius: var(--r1); border: 1px solid var(--line); }
.chart .band-ok { fill: color-mix(in oklch, var(--ok) 22%, transparent); }
.chart .band-watch { fill: color-mix(in oklch, var(--watch) 26%, transparent); }
.chart .band-high { fill: color-mix(in oklch, var(--high) 22%, transparent); }
.chart .band-cycling { fill: color-mix(in oklch, var(--ink-2) 14%, transparent); }
.trend { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.pt { fill: var(--ink); }
.wc { stroke: var(--a6); stroke-width: 2; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.lvl { font-size: 0.75rem; font-weight: 650; padding: 0.0625rem 0.5rem; border-radius: var(--r-pill); color: var(--ink); }
.lvl-ok { background: color-mix(in oklch, var(--ok) 30%, transparent); }
.lvl-watch { background: color-mix(in oklch, var(--watch) 38%, transparent); }
.lvl-high { background: color-mix(in oklch, var(--high) 32%, transparent); }
.lvl-cycling { background: color-mix(in oklch, var(--ink-2) 22%, transparent); }
.wc-form { display: flex; flex-wrap: wrap; align-items: end; gap: 0.5rem 1rem; }

/* Stocking */
.lines { margin: 0 0 1rem; padding-left: 1.25rem; }
.lines li + li { margin-top: 0.25rem; }
.lines:empty { display: none; }
.bioload { margin-top: 1.25rem; }
#fish-form { margin-top: 0.5rem; }

/* Fish in this tank: one card per species, every figure a source link */
.species { display: grid; gap: 0.75rem; margin: 1rem 0; }
.species:empty { display: none; }
.species-card { border: 1px solid var(--line); border-radius: var(--r2); padding: 0.75rem 1rem; }
.species-card header { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.species-card h3 { margin: 0; font-size: 1rem; }
.species-card .caption { margin: 0.125rem 0 0.5rem; font-style: italic; }
.species-card dl { margin: 0; display: grid; gap: 0.375rem; font-size: 0.875rem; }
.species-card dt { font-size: 0.75rem; font-weight: 600; color: var(--ink-2); }
.species-card dd { margin: 0; overflow-wrap: anywhere; }
.warnings li a { color: inherit; }
#stock-guide { margin-top: 1rem; }

/* ---- Tank age + triage -------------------------------------------------------- */
.triage .flow { border-top: 1px solid var(--line); padding-top: 0.5rem; }
.triage .urgent { border: 2px solid var(--urgent); border-radius: var(--r2); padding: 0.5rem 0.75rem; }
.triage .urgent summary { color: var(--urgent); }
.triage ol.lines { list-style: decimal; }
.triage #died-form { margin-top: 0.75rem; }

/* Bulk log */
.bulk { margin: 1.25rem 0; }
.checks { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin-bottom: 0.75rem; }
.check { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 450; }
.quarantine .batch { border-top: 1px solid var(--line); padding-top: 0.75rem; margin-top: 0.75rem; }
.quarantine .batch h3 { margin: 0 0 0.375rem; font-size: 1rem; }
.quarantine .batch .check { display: flex; margin-top: 0.375rem; }
.quarantine .batch form { margin-top: 0.75rem; }

/* ---- 8a: tabs, hero, first run ------------------------------------------------ */
.lines, output, .hero-date { font-variant-numeric: tabular-nums; }
.panel:not(#tab-today) { padding-top: 1.5rem; }
.masthead.compact { padding: 1.5rem 0 0.25rem; }
.masthead.compact h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.masthead.compact .eyebrow { color: var(--ink-2); font-weight: 550; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 0.25rem max(8px, env(safe-area-inset-left)) env(safe-area-inset-bottom);
  background: var(--bg);
  background: color-mix(in oklch, var(--bg) 82%, transparent);
  border-top: 1px solid var(--line);
  -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
}
@supports not (backdrop-filter: blur(1px)) { .tabbar { background: color-mix(in oklch, var(--bg) 96%, transparent); } }
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.125rem;
  min-height: 52px; max-width: 11rem; width: 100%; justify-self: center;
  color: var(--ink-2); font-size: 0.6875rem; font-weight: 550; letter-spacing: 0.01em; text-decoration: none;
  transition: color 160ms var(--ease);
}
.tabbar svg { width: 1.375rem; height: 1.375rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tabbar .f { fill: var(--a6); stroke: none; opacity: 0; transition: opacity 160ms var(--ease); }
.tabbar a:hover { color: var(--ink); }
.tabbar a[aria-current="page"] { color: var(--a6); }
.tabbar a[aria-current="page"] .f { opacity: 0.35; }
/* Wide screens: the tabs become a left rail. */
@media (min-width: 1024px) {
  body { padding-left: 6.5rem; padding-bottom: 2rem; }
  .tabbar { right: auto; top: 0; width: 5.5rem; grid-template-columns: 1fr; align-content: center; gap: 0.5rem; padding: 1rem 0.5rem; border-top: 0; border-right: 1px solid var(--line); }
}
:is(button, .primary, .tabbar a) { transition: transform 100ms var(--ease), color 160ms var(--ease), background-color 160ms var(--ease); }
:is(button, .primary, .tabbar a):active { transform: scale(0.97); }
::view-transition-old(root) { animation: 150ms var(--ease) both vt-out; }
::view-transition-new(root) { animation: 150ms var(--ease) both vt-in; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-4px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(4px); } }

/* Hero: a test vial. P90 sits at 86% so the water always has headroom; P50 is the dashed line below it. */
.hero {
  display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 0 1rem; align-items: start;
  padding: 0.5rem 0 1.75rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--line);
}
.hero-copy { min-width: 0; }
.vial {
  position: relative; justify-self: center; width: 60px; height: 11rem; overflow: hidden;
  border: 1.5px solid var(--ink-2); border-top: 0; border-radius: 0 0 var(--r-vial) var(--r-vial);
  background: var(--glass); box-shadow: inset 6px 0 10px -6px oklch(1 0 0 / 0.5);
}
.vial::before { content: ""; position: absolute; inset: 0 -1px auto; height: 4px; background: var(--ink-2); border-radius: var(--r-tick); z-index: 2; } /* the lip */
.vial .water {
  position: absolute; inset: 0; transform: translateY(calc((1 - var(--level, 0)) * 100%));
  background: linear-gradient(var(--water-1), var(--water-2)) no-repeat 0 6px / 100% 100%;
  filter: drop-shadow(0 -1px 0 var(--meniscus));
}
.meniscus { position: absolute; top: 0; left: 0; width: 200%; height: 10px; fill: var(--water-1); }
.vial .mark { position: absolute; left: 0; right: 0; bottom: calc(var(--p) * 100%); border-top: 1px dashed var(--ink); z-index: 1; }
.vial .mark::after {
  position: absolute; right: 4px; bottom: 2px; padding: 0 3px; border-radius: var(--r-tick);
  font: 600 0.625rem/1.4 var(--sans); letter-spacing: 0.04em; color: var(--ink); background: var(--surface);
}
.vial .p90 { --p: var(--p90); }
.vial .p50 { --p: var(--p50); border-top-color: var(--a6); }
.vial .p90::after { content: "P90"; }
.vial .p50::after { content: "P50"; color: var(--a6); bottom: auto; top: 2px; } /* below its line, so close P50 and P90 labels never stack */
.hero.empty .mark { display: none; }
.hero-likely { margin: 0; font-size: var(--t-1); font-weight: 550; color: var(--ink-2); }
.hero-date { margin: 0 0 0.25rem; font-family: var(--display); font-weight: 400; letter-spacing: -0.02em; font-size: clamp(var(--t6), 16vw, var(--t8)); line-height: 0.95; }
.hero-date em { font-style: italic; color: var(--a6); }
.hero-range { margin: 0 0 0.5rem; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 550; }
.hero h2 { font-size: var(--t4); line-height: 1.05; margin-bottom: 0.5rem; }
.hero #hero-text { color: var(--ink-2); margin-bottom: 1rem; }
.hero #hero-thin { margin: 0 0 0.25rem; }
.hero #boost-ask .chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.375rem; }
.hero #hero-confirm { margin: 0; }
@media screen and (prefers-reduced-motion: no-preference) {
  .vial.go .water { animation: vial-fill 1200ms var(--ease-fill) both; }
  .meniscus { animation: drift 6s linear infinite; }
  .paused .meniscus { animation-play-state: paused; }
  .vial.go ~ .hero-copy .hero-date { animation: date-rise 800ms var(--ease-out) both; }
  @keyframes vial-fill { from { transform: translateY(calc((1 - var(--from, 0)) * 100%)); } }
  @keyframes drift { to { transform: translateX(-50%); } }
  @keyframes date-rise { from { opacity: 0; transform: translateY(8px); } }
}

/* First run: a full-screen intro, one question per screen. */
.onboard.ob-full {
  width: 100%; max-width: 100%; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; overflow: hidden;
  /* Deep water in both themes: the dark palette, scoped to this dialog. */
  --a1: oklch(0.26 0.035 190); --a2: oklch(0.33 0.05 185); --a3: oklch(0.48 0.08 180); --a5: oklch(0.72 0.11 174);
  --a6: oklch(0.80 0.11 172); --a7: oklch(0.87 0.08 172); --on-accent: oklch(0.2 0.025 195);
  --bg: oklch(0.2 0.025 195); --surface: oklch(0.245 0.03 195); --ink: oklch(0.95 0.012 175); --ink-2: oklch(0.74 0.025 180);
  --line: oklch(0.34 0.03 195); --field-line: oklch(0.6 0.03 190); --bad: oklch(0.74 0.14 28);
  --water-1: oklch(0.45 0.08 185); --water-2: oklch(0.32 0.07 200); --glass: oklch(1 0 0 / 0.06); --meniscus: oklch(0.80 0.11 172);
  background: radial-gradient(120% 60% at 50% 0%, var(--a2), var(--bg) 70%); color: var(--ink); color-scheme: dark;
}
.onboard.ob-full[open] { display: flex; flex-direction: column; }
.onboard::backdrop { background: var(--bg); }
.ob-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0.75rem 16px; padding-top: calc(0.75rem + env(safe-area-inset-top)); }
.ob-head .quiet { min-height: 2.75rem; padding-inline: 0.25rem; justify-self: start; }
.ob-head #ob-skip { justify-self: end; }
.ob-head .quiet:disabled { visibility: hidden; }
.ob-progress { display: block; width: 1.25rem; height: 2.25rem; overflow: visible; }
.ob-progress .g { fill: none; stroke: var(--ink-2); stroke-width: 1.5; stroke-linejoin: round; }
.ob-progress .w { fill: var(--water-2); transform-box: fill-box; transform: translateY(calc((1 - var(--step, 0)) * 100%)); }
.ob-screen { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 0.75rem; padding: 0.5rem 16px calc(1.25rem + env(safe-area-inset-bottom)); }
.ob-screen[hidden] { display: none; }
.ob-content { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; justify-content: safe center; gap: 1rem; }
.ob-content.more-below { -webkit-mask: linear-gradient(#000 calc(100% - 3rem), transparent); mask: linear-gradient(#000 calc(100% - 3rem), transparent); }
.ob-screen > .primary { width: 100%; flex: none; }
.ob-screen > .quiet { flex: none; align-self: center; min-height: 2.75rem; }
.ob-title { margin: 0; font-size: var(--t6); line-height: 1.02; outline: none; }
#sheet-title:focus { outline: none; }
.ob-title em { font-style: italic; color: var(--a6); }
.ob-sub { margin: 0; font-size: 1.0625rem; color: var(--ink-2); max-width: 28rem; }
.onboard .chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
.onboard .product-pick { text-align: center; margin-top: 0.75rem; }
.onboard .product-pick .chips { margin: 0.375rem 0; }
.ob-cards { display: grid; gap: 0.75rem; }
.ob-card {
  display: flex; align-items: center; min-height: 4.25rem; padding: 0 1.25rem; border: 1px solid var(--line); border-radius: var(--r3);
  background: var(--surface); color: var(--ink); font: 400 var(--t3)/1.1 var(--display); text-align: left;
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease);
}
.ob-card[aria-pressed=true] { border-color: var(--a6); background: var(--a1); }
.ob-vial { height: 9rem; align-self: center; }
[data-screen="welcome"] .ob-vial { --level: 0.58; height: 11rem; }
.ob-vial.full { --level: 1; }
.ob-date { margin: 0 0 0.25rem; font: 400 clamp(var(--t6), 18vw, 5.5rem)/0.95 var(--display); letter-spacing: -0.02em; }
.ob-date em { font-style: italic; color: var(--a6); }
.ob-reveal { text-align: center; }
.ob-reveal .hero-range, .ob-reveal .hint { margin-inline: auto; }
.onboard .dial-wrap { width: 100%; }
.onboard .dial-wrap.untouched .dial-val { opacity: 0.5; }
.onboard .dial-num { font-size: var(--t5); }
.onboard .dial-foot { display: flex; align-items: center; justify-content: center; gap: 0.75rem; }
.bubbles { position: absolute; inset: 0; z-index: 1; }
.bubbles span { position: absolute; bottom: 0; width: 6px; height: 6px; border-radius: var(--r-pill); background: var(--glass); border: 1px solid var(--meniscus); opacity: 0; }
.bubbles span:nth-child(1) { left: 20%; }
.bubbles span:nth-child(2) { left: 45%; width: 8px; height: 8px; }
.bubbles span:nth-child(3) { left: 65%; }
.bubbles span:nth-child(4) { left: 35%; width: 4px; height: 4px; }
@media screen and (prefers-reduced-motion: no-preference) {
  .onboard[open] { animation: rise 160ms var(--ease) both; }
  .ob-screen:not([hidden]) .ob-content { animation: ob-in 600ms var(--ease-out) both; }
  .ob-progress .w { transition: transform 600ms var(--ease-fill); }
  .ob-title span { display: inline-block; animation: ob-in 600ms var(--ease-out) both; }
  .ob-title span:nth-child(2) { animation-delay: 80ms; }
  .ob-title span:nth-child(3) { animation-delay: 160ms; }
  .ob-title span:nth-child(4) { animation-delay: 240ms; }
  .ob-title span:nth-child(5) { animation-delay: 320ms; }
  .ob-title span:nth-child(6) { animation-delay: 400ms; }
  .bubbles span { animation: bubble-rise 5s ease-in infinite; }
  .bubbles span:nth-child(2) { animation-delay: 1.2s; }
  .bubbles span:nth-child(3) { animation-delay: 2.4s; }
  .bubbles span:nth-child(4) { animation-delay: 3.4s; }
  .ob-vial.go ~ .ob-reveal .ob-date { animation: date-rise 800ms var(--ease-out) both; }
  @keyframes ob-in { from { opacity: 0; transform: translateX(30px); } }
  @keyframes bubble-rise { 0% { opacity: 0; transform: translateY(0); } 15% { opacity: 0.8; } 100% { opacity: 0; transform: translateY(-5rem); } }
}
@media (prefers-reduced-motion: reduce) {
  .bubbles { display: none; }
  /* The global reduce rule kills animations; screens still cross-fade (opacity only), as the spec asks. */
  .onboard .ob-screen:not([hidden]) .ob-content { animation: ob-fade 200ms linear both !important; }
  @keyframes ob-fade { from { opacity: 0; } }
}

/* The one spring: a done check. */
.check input { transition: scale 320ms var(--spring); }
.check input:active { scale: 0.8; }
.toast.done::before { content: "\2713"; font-weight: 700; color: var(--a3); animation: pop 320ms var(--spring); }
@keyframes pop { from { scale: 0.4; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Tanks overview (iteration 9): flagged rows lead and carry the warn tokens; each row opens its tank. */
.ov { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.ov-row {
  display: grid; gap: 0.125rem; width: 100%; text-align: left; cursor: pointer;
  padding: 0.75rem 0.875rem; border: 1px solid var(--line); border-radius: var(--r2); background: var(--bg);
  transition: border-color 0.2s var(--ease);
}
.ov-row:hover { border-color: var(--a3); }
.ov-name { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; font-weight: 650; letter-spacing: -0.01em; }
.ov-title { display: flex; align-items: center; gap: 0.625rem; }
/* Mini vial: the hero's glass at 24px, filled to this tank's level. */
.mini-vial {
  flex: none; width: 12px; height: 24px; border: 1.5px solid var(--ink-2); border-top-width: 2px; border-radius: 0 0 var(--r-pill) var(--r-pill);
  background: linear-gradient(to top, var(--a6) calc(var(--level) * 100%), var(--glass) 0);
}
.mini-vial.none { background: var(--glass); border-style: dashed; }
.about { margin-top: 2rem; }
.about .points { margin-top: 0.5rem; }
.ov-meta { font-size: 0.875rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ov-flag { flex: none; font-size: 0.75rem; font-weight: 650; padding: 0.0625rem 0.5rem; border-radius: var(--r-pill); background: var(--warn-line); color: var(--on-warn); }
.flagged .ov-row { border-color: var(--warn-line); border-left-width: 3px; background: var(--warn-bg); }
.flagged .ov-meta, .ov-why { color: var(--warn-ink); }
.ov-why { margin: 0.375rem 0 0; padding-left: 1.125rem; font-size: 0.875rem; }
.confirm { margin-top: 1rem; padding: 0.875rem 1rem; border: 1px solid var(--a3); border-radius: var(--r2); background: var(--a1); }
.confirm p { margin: 0 0 0.5rem; font-weight: 600; }
.confirm .lines { margin-bottom: 0.75rem; }

/* The Dial: one number control (public/dial.js) */
.dial { display: flex; flex-direction: column; align-items: center; width: 100%; user-select: none; -webkit-user-select: none; }
.dial-top { display: flex; align-items: center; gap: 0.875rem; }
.dial-minus, .dial-plus { width: 44px; height: 44px; border-radius: var(--r-pill); border: 1px solid currentColor; opacity: 0.55; background: none; color: inherit; font: inherit; font-size: 1.5rem; line-height: 1; cursor: pointer; transition: opacity 0.2s, transform 0.15s; }
.dial-minus:hover, .dial-plus:hover { opacity: 1; }
.dial-minus:active, .dial-plus:active { transform: scale(0.9); }
.dial-val { display: flex; align-items: baseline; gap: 0.375rem; }
.dial-num { width: 3.2ch; background: none; border: 0; border-bottom: 1px dashed transparent; color: inherit; font: 400 var(--t8)/1 var(--display); letter-spacing: -0.03em; text-align: center; padding: 0; outline: none; transition: border-color 0.2s; }
.dial-num:focus { border-bottom-color: currentColor; }
.dial-unit { font-size: 1rem; opacity: 0.7; white-space: nowrap; }
.dial-sub { font-size: 0.875rem; opacity: 0.7; min-height: 1.3em; margin-top: 2px; }
.dial-ruler { position: relative; width: 100%; height: 64px; margin-top: 0.875rem; overflow: hidden; cursor: grab; touch-action: pan-y; -webkit-mask: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent); mask: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent); }
.dial-ruler:active { cursor: grabbing; }
.dial-ruler:focus-visible { outline: 2px solid var(--a5); outline-offset: -2px; }
.dial-strip { position: absolute; top: 0; left: 50%; height: 100%; will-change: transform; }
.dial-t { position: absolute; bottom: 22px; width: 1px; height: 12px; background: currentColor; opacity: 0.35; }
.dial-t.mid { height: 18px; opacity: 0.5; }
.dial-t.maj { height: 28px; width: 2px; opacity: 0.9; }
.dial-t.maj b { position: absolute; top: 32px; left: 50%; transform: translateX(-50%); font: 500 0.75rem var(--sans); white-space: nowrap; }
.dial-needle { position: absolute; left: 50%; bottom: 16px; width: 3px; height: 40px; margin-left: -1.5px; border-radius: var(--r-tick); background: var(--a5); }

/* ---- Sheet and Log a test ------------------------------------------------------ */
.sheet {
  width: 520px; max-width: calc(100vw - 32px); max-height: 90dvh; padding: 0 1.25rem 1.25rem; overflow-y: auto; overscroll-behavior: contain;
  border: 1px solid var(--line); border-radius: var(--r-sheet); background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
}
.sheet::backdrop { background: oklch(0.2 0.02 225 / 0.45); }
@media (max-width: 639px) {
  .sheet { width: 100%; max-width: 100%; margin: auto 0 0; padding-bottom: calc(1.25rem + env(safe-area-inset-bottom)); border-width: 1px 0 0; border-radius: var(--r-sheet) var(--r-sheet) 0 0; }
}
.sheet-grip { display: block; padding: 0.75rem 0 0.5rem; touch-action: none; cursor: grab; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.sheet-grip::before { content: ""; display: block; width: 2.5rem; height: 4px; margin: 0 auto; border-radius: var(--r-pill); background: var(--line); }
.sheet h2 { margin-bottom: 0.75rem; }
.sheet-actions { display: flex; gap: 1rem; align-items: center; margin-top: 1rem; }
.sheet-actions .primary { flex: 1; }
.sheet .chips, .sheet .when { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.875rem; }
.chip {
  display: inline-flex; align-items: center; gap: 0.375rem; min-height: 2.75rem; padding: 0 0.875rem; border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink); font-size: 0.875rem; font-weight: 550;
}
.chip[aria-pressed=true] { background: var(--a1); border-color: var(--a6); color: var(--a7); }
.chip.pick input { width: auto; min-height: 2rem; padding: 0.125rem 0.375rem; margin: 0; border-radius: var(--r-chip); }
.chip.typed { min-height: 2.75rem; border-style: dashed; color: var(--ink-2); }
.swatch-row { margin-bottom: 1rem; border-radius: var(--r2); }
.swatch-row.due { outline: 2px solid var(--a5); outline-offset: 4px; }
.sw-label { display: block; margin-bottom: 0.375rem; font-size: 0.875rem; font-weight: 600; }
.sw-body { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.swatch {
  min-width: 2.75rem; min-height: 2.75rem; padding: 0 0.625rem; border: 1px solid var(--line); border-radius: var(--r2);
  background: var(--surface); color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums;
}
.swatch[aria-pressed=true] { box-shadow: 0 0 0 2px var(--a6); border-color: var(--a6); }
.sheet .more { margin-bottom: 1rem; }
.sheet .more summary { min-height: 2.75rem; display: flex; align-items: center; cursor: pointer; font-weight: 600; color: var(--a6); }
.sheet .dial-wrap { width: 100%; }
.sheet .dial-wrap.untouched .dial-val { opacity: 0.5; }
.sheet .dial-num { font-size: var(--t5); }
.sheet .dial-foot { display: flex; align-items: center; justify-content: center; gap: 0.75rem; }
.sheet #strip-timer { margin: 0.5rem 0 1rem; padding-top: 0.75rem; border-top: 1px solid var(--line); }
@media screen and (prefers-reduced-motion: no-preference) {
  .sheet[open] { animation: sheet-in 600ms var(--ease-out) both; }
  @keyframes sheet-in { from { opacity: 0; transform: translateY(30px); } }
}

/* ---- Tank rows: one summary row per area, each opens a sheet ------------------ */
#rows, .rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.row {
  display: grid; grid-template-columns: 1.5rem 1fr auto auto; align-items: center; gap: 0.75rem; width: 100%; min-height: 2.75rem;
  padding: 0.625rem 0.875rem; text-align: left; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r2);
}
.row.off { border-style: dashed; color: var(--ink-2); }
.row-ico { display: inline-flex; color: var(--a6); }
.row.off .row-ico { color: var(--ink-2); }
.row-ico svg { width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.row-text { display: grid; min-width: 0; }
.row-text b { font-weight: 600; }
.row-status { font-size: 0.8125rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.badge {
  padding: 0.125rem 0.625rem; border-radius: var(--r-pill); font-size: 0.75rem; font-weight: 600;
  background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--warn-line);
}
.chev { color: var(--ink-2); font-size: 1.25rem; line-height: 1; }
@media screen and (prefers-reduced-motion: no-preference) {
  .row { transition: border-color 160ms var(--ease-out); }
}
.row:hover { border-color: var(--a5); }
.sheet .card { background: none; border: 0; box-shadow: none; padding: 0; margin-bottom: 1rem; border-radius: 0; }
.sheet .field { margin-bottom: 0.875rem; }
.sheet .field > .sw-label { margin-bottom: 0.375rem; }

/* ---- Today as a glance ----------------------------------------------------------- */
.tank-switch { margin-bottom: 0.5rem; }
#tab-today .hero { padding-bottom: 1rem; margin-bottom: 0.75rem; }
#errors { margin: 0 0 0.75rem; }
#tab-today .warnings { margin: 0 0 0.75rem; }
.today-card { padding-block: 0.875rem; margin-bottom: 0.75rem; }
.finish-card { margin-bottom: 0.75rem; }
.finish-card h2 { font-size: var(--t2); }
.finish-card p { margin: 0 0 0.5rem; }
/* While it asks, the card is today's one job and names the readings, so the today and recent cards step aside. */
.finish-card:not([hidden]) ~ #today-card, .finish-card:not([hidden]) ~ #recent { display: none; }
#checkin:not([hidden]) ~ #today-card, #checkin:not([hidden]) ~ #recent { display: none; }
/* Open, the fish-in card is today's one job and leads with today's action, so the today card and Recent step aside. */
.fishin:has(details[open]) ~ #today-card, .fishin:has(details[open]) ~ #recent { display: none; }
.fishin-today { font-size: 1.0625rem; font-weight: 550; line-height: 1.4; }
.fishin { padding-block: 0.25rem 0.75rem; margin-bottom: 0.75rem; }
.fishin .lines { margin-bottom: 0.5rem; }
.fishin .lines li + li { margin-top: 0.125rem; }
.fishin details { margin-top: 0; }
.fishin summary { font-weight: 600; cursor: pointer; min-height: 2.75rem; display: flex; align-items: center; }
.fishin p, .ob-fishin p { margin: 0 0 0.5rem; }
.fishin p:last-child { margin-bottom: 0; }
.ob-fishin { margin-top: 1rem; text-align: left; }
.today-card p { margin: 0; }
.today-card #today-text { font-size: 1.0625rem; font-weight: 550; line-height: 1.4; }
.recent { padding-block: 0.75rem; margin-bottom: 0.75rem; }
.recent-head { display: flex; align-items: center; justify-content: space-between; }
.recent-head h2 { margin: 0; font-size: var(--t2); }
.recent-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; }
.recent-list li { display: grid; grid-template-columns: 4.5rem repeat(3, 2.75rem); gap: 0.5rem; align-items: center; }
.rt-date { font-size: 0.875rem; color: var(--ink-2); }
.dot {
  width: 2.75rem; min-height: 2.75rem; padding: 0; border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink); font-size: 0.8125rem; font-weight: 600; font-variant-numeric: tabular-nums;
}
#log-test { width: 100%; }
@media (max-width: 40rem) {
  body { padding-bottom: calc(4rem + env(safe-area-inset-bottom)); }
  #tab-today .vial { height: 9rem; }
  #tab-today .hero { padding-top: 0; }
  #tab-today .hero-date { margin-bottom: 0; }
  #tab-today .hero-range { margin-bottom: 0.25rem; }
  .recent-list { gap: 0; }
  .masthead.compact { padding-top: 0.75rem; }
  .masthead.compact .eyebrow { font-size: 0.6875rem; letter-spacing: 0.03em; }
  .today-card #today-text { font-size: 1rem; line-height: 1.35; }
  .today-card, .recent, #tab-today .hero { margin-bottom: 0.5rem; }
  .recent { padding-block: 0.5rem; }
  .today-card { padding-block: 0.625rem; }
  footer { padding-top: 0; font-size: 0.75rem; line-height: 1.3; }
  footer p { margin-bottom: 0.25rem; }
  #tab-today .hero { padding-bottom: 0.75rem; }
}
