/* === ../shared/css/base.css === */
/* Shared base for Cockpit and Home: tokens, reset, typography and the common components.
   A page links this file first, then its own stylesheet. A page may override only --accent and --accent-soft.
   System fonts only: no web fonts are loaded. */

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --serif: var(--display);  /* old name, kept so older rules keep working */

  --ground: #F2F2F7; --surface: #FFFFFF; --raised: #FFFFFF;
  --ink: #1C1C1E; --muted: #6E6E73;
  --line: rgba(60, 60, 67, .16);
  --fill: rgba(120, 120, 128, .12);      /* control track, tinted buttons */
  --inset: #F2F2F7;                      /* a card inside a card */
  --edge: transparent;                   /* card border: none in light (the shadow does it), a hairline in dark */
  --accent: #2F55D4; --accent-soft: #E6ECFC;
  --on-accent: #FFFFFF;                  /* text on a filled accent button */
  --on-prio: #FFFFFF;                    /* text on a filled P1/P2 badge */
  --p1: #C8332B; --p2: #D0731A; --p3: #2F6FB0; --p4: #7A8494;
  --good: #1F8A55; --good-bg: #E3F4EA;
  --bad: #B3261E; --bad-bg: #FBE7E5;
  --warn: #9A6200; --warn-bg: #FBF0DC;
  --shadow: 0 1px 2px rgb(0 0 0 / .04), 0 4px 14px rgb(0 0 0 / .05);
  --shadow-hover: 0 2px 4px rgb(0 0 0 / .05), 0 8px 22px rgb(0 0 0 / .08);
  --shadow-lg: 0 10px 40px rgb(0 0 0 / .18);

  --r-card: 12px; --r-ctl: 10px; --r-pill: 999px;
  --ease: cubic-bezier(.2, .8, .2, 1); --dur: 180ms;
}
/* Dark: "none" is written as a zero shadow so it can be combined with a ring (box-shadow lists) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #000000; --surface: #1C1C1E; --raised: #2C2C2E;
    --ink: #F2F2F7; --muted: #98989F;
    --line: rgba(84, 84, 88, .55);
    --fill: rgba(118, 118, 128, .24);
    --inset: #2C2C2E;
    --edge: rgba(84, 84, 88, .55);
    --accent: #8AA6FF; --accent-soft: #232E4A;
    --on-accent: #0B1020;
    --p1: #FF7A70; --p2: #F5A54F; --p3: #77AEF0; --p4: #8D97A7;
    --on-prio: #1C1C1E;
    --good: #5CCF92; --good-bg: #173326;
    --bad: #FF8A80; --bad-bg: #3A1D1B;
    --warn: #E8B04E; --warn-bg: #33291A;
    --shadow: 0 0 #0000; --shadow-hover: 0 0 #0000;
    --shadow-lg: 0 10px 40px rgb(0 0 0 / .6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #000000; --surface: #1C1C1E; --raised: #2C2C2E;
  --ink: #F2F2F7; --muted: #98989F;
  --line: rgba(84, 84, 88, .55);
  --fill: rgba(118, 118, 128, .24);
  --inset: #2C2C2E;
  --edge: rgba(84, 84, 88, .55);
  --accent: #8AA6FF; --accent-soft: #232E4A;
  --on-accent: #0B1020;
  --p1: #FF7A70; --p2: #F5A54F; --p3: #77AEF0; --p4: #8D97A7;
  --on-prio: #1C1C1E;
  --good: #5CCF92; --good-bg: #173326;
  --bad: #FF8A80; --bad-bg: #3A1D1B;
  --warn: #E8B04E; --warn-bg: #33291A;
  --shadow: 0 0 #0000; --shadow-hover: 0 0 #0000;
  --shadow-lg: 0 10px 40px rgb(0 0 0 / .6);
}

/* ---------- Reset and type ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }  /* the hidden attribute must win over components that set display */
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  background: var(--ground); color: var(--ink);
  font: 15px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  padding: 0 0 env(safe-area-inset-bottom, 0);
}
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

h1 { font: 700 clamp(28px, 4vw, 34px)/1.1 var(--display); letter-spacing: -0.02em; margin: 28px 0 4px; text-wrap: balance; }
h2 { font: 600 20px/1.25 var(--display); letter-spacing: -0.01em; margin: 32px 0 10px; }
h3 { font-size: 15px; font-weight: 600; }
.hint { font: 400 13px/1.3 var(--sans); letter-spacing: 0; color: var(--muted); margin-left: 6px; }
.hint.mono { font-family: var(--mono); }
.sub { color: var(--muted); font-size: 15px; margin: 0; }
.eyebrow { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Page frame: header bar, brand switch, nav ---------- */
.wrap { margin: 0 auto; padding-inline: max(clamp(16px, 2.5vw, 40px), env(safe-area-inset-left, 0px)) max(clamp(16px, 2.5vw, 40px), env(safe-area-inset-right, 0px)); padding-block: 0 64px; }
/* Sticks at the very top; the bar's own background fills the status-bar / Dynamic Island strip */
header.top {
  position: sticky; top: 0; z-index: 5;
  padding-top: env(safe-area-inset-top, 0px);
  background: color-mix(in srgb, var(--ground) 72%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  header.top { background: var(--ground); }
}
header.top .wrap { display: flex; align-items: center; gap: 16px; padding-block: 10px; flex-wrap: wrap; }
.brand { margin-right: auto; }
nav { display: flex; gap: 2px; flex-wrap: wrap; row-gap: 4px; }
nav a {
  color: var(--muted); font: 500 14px/1.3 var(--sans); padding: 6px 12px; border-radius: var(--r-pill);
  text-decoration: none; white-space: nowrap;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
nav a:hover { background: var(--fill); color: var(--ink); text-decoration: none; }
nav a[aria-current="page"] { background: var(--raised); color: var(--ink); box-shadow: 0 0 0 1px var(--edge), var(--shadow); }
.who { font-size: 13px; color: var(--muted); display: flex; gap: 10px; align-items: center; }
/* Switch between the two pages (Cockpit, Home): a segmented control, the current one selected */
.appswitch { display: inline-flex; align-self: center; gap: 2px; padding: 2px; border-radius: var(--r-ctl); background: var(--fill); }
.appswitch a { font: 600 15px/1.3 var(--display); letter-spacing: -0.01em; text-decoration: none; color: var(--muted); padding: 4px 12px; border-radius: 8px; white-space: nowrap; transition: color var(--dur) var(--ease); }
.appswitch a:hover { color: var(--ink); text-decoration: none; }
.appswitch a[aria-current="page"] { background: var(--raised); color: var(--ink); box-shadow: 0 0 0 1px var(--edge), var(--shadow); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: 500 14px/1.25 var(--sans); background: var(--accent); color: var(--on-accent);
  border: 0; border-radius: var(--r-ctl); padding: 8px 14px; cursor: pointer; white-space: nowrap;
  transition: filter var(--dur) var(--ease), transform var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: default; filter: none; transform: none; }
.btn.ghost { background: var(--fill); color: var(--ink); }
.btn.ghost[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.btn.bad, .btn.ghost.bad { color: var(--bad); }
.btn.bad:not(.ghost) { background: var(--bad-bg); }
.linkbtn { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font-size: 13px; text-decoration: none; }
.linkbtn:hover { text-decoration: underline; }
.linkbtn:disabled { color: var(--muted); cursor: default; text-decoration: none; }
.linkbtn.lg { font-size: 14px; }
/* Small action on a card */
.qa {
  font: 500 12.5px/1.3 var(--sans); padding: 4px 10px; border-radius: 8px; border: 0;
  background: var(--fill); color: var(--ink); cursor: pointer;
  transition: filter var(--dur) var(--ease), transform var(--dur) var(--ease), background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.qa:hover { filter: brightness(.97); }
.qa:active { transform: scale(.97); }
.qa.ok { color: var(--good); background: var(--good-bg); }
.qa.bad { color: var(--bad); background: var(--bad-bg); }
.qa.bad.arm, .btn.bad.arm, .btn.ghost.bad.arm { color: var(--on-prio); background: var(--bad); }  /* second tap of a two-tap confirm */
/* Birthday answer: square icon button, wished (cake) or not (struck cake); aria-label and title name it */
.bdbtn {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0; border-radius: 8px; border: 0; cursor: pointer;
  transition: filter var(--dur) var(--ease), transform var(--dur) var(--ease), background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.bdbtn:hover { filter: brightness(.96); }
.bdbtn:active { transform: scale(.96); }
.bdbtn:disabled { opacity: .55; cursor: default; filter: none; transform: none; }
.bdbtn.yes { color: var(--good); background: var(--good-bg); }
.bdbtn.no { color: var(--bad); background: var(--bad-bg); }
@media (max-width: 720px) { .bdbtn { width: 44px; height: 44px; } }

/* ---------- Segmented controls and chips ---------- */
.chips, .viewswitch, .seg { display: inline-flex; align-items: center; gap: 2px; padding: 2px; background: var(--fill); border-radius: var(--r-ctl); max-width: 100%; }
.chips button, .viewswitch button {
  font: 500 13px/1.3 var(--sans); color: var(--ink); background: transparent; border: 0;
  border-radius: 8px; padding: 5px 12px; cursor: pointer; white-space: nowrap;
  transition: background-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.chips button[aria-pressed="true"], .viewswitch button[aria-pressed="true"] { background: var(--raised); box-shadow: 0 0 0 1px var(--edge), var(--shadow); }
.chips .n { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 12px; margin-left: 5px; color: var(--muted); }
/* Priority picker: the checked segment takes its priority colour */
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; left: 0; top: 0; margin: 0; opacity: 0; pointer-events: none; }  /* anchored, or the hidden radios widen the form on a phone */
.seg span { display: inline-block; font: 600 13px/1.3 var(--mono); padding: 5px 14px; border-radius: 8px; color: var(--muted); transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.seg label:hover span { color: var(--ink); }
.seg input:checked + span { color: var(--on-prio); box-shadow: var(--shadow); }
.seg .p1 input:checked + span { background: var(--p1); }
.seg .p2 input:checked + span { background: var(--p2); }
.seg .p3 input:checked + span { background: var(--p3); }
.seg .p4 input:checked + span { background: var(--p4); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Inputs ---------- */
:where(input:not([type="checkbox"], [type="radio"], [type="file"], [type="range"], [type="color"]), select, textarea) {
  font: 14px/1.3 var(--sans); color: var(--ink); background-color: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 8px 11px; min-width: 0;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
:where(input:not([type="checkbox"], [type="radio"], [type="file"], [type="range"], [type="color"]), select, textarea):focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
}
:where(select:not([multiple])) {
  -webkit-appearance: none; appearance: none; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%238E8E93' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
:where(input[type="search"]) {
  -webkit-appearance: none; appearance: none; padding-left: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Ccircle cx='7' cy='7' r='4.75' fill='none' stroke='%238E8E93' stroke-width='1.6'/%3E%3Cpath d='m10.5 10.5 3 3' stroke='%238E8E93' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 11px center;
}
:where(textarea) { resize: vertical; line-height: 1.45; }
:where(input[type="checkbox"], input[type="radio"]) { accent-color: var(--accent); }
::placeholder { color: var(--muted); opacity: .8; }

/* ---------- Pills ---------- */
.pill { display: inline-block; font: 500 11.5px/1.45 var(--sans); padding: 2px 8px; border-radius: var(--r-pill); white-space: nowrap; vertical-align: baseline; color: var(--muted); background: var(--fill); }
a.pill:hover { text-decoration: none; filter: brightness(.97); }

/* ---------- Cards and grouped lists ---------- */
.card { background: var(--surface); border: 1px solid var(--edge); border-radius: var(--r-card); box-shadow: var(--shadow); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; justify-content: space-between; align-items: baseline; }
.list li:last-child { border-bottom: 0; }
/* Inset grouped table */
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--edge); border-radius: var(--r-card); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font: 600 12px/1.3 var(--sans); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: baseline; }
th:first-child, td:first-child { padding-left: 16px; }
th:last-child, td:last-child { padding-right: 16px; }
tbody tr:last-child > td { border-bottom: 0; }
th.num, td.num { text-align: right; }
td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
tbody tr { transition: background-color var(--dur) var(--ease); }
@media (hover: hover) { .tablewrap tbody tr:hover { background: var(--fill); } }

/* ---------- Notice, skeleton ---------- */
.notice { margin-top: 20px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--edge); border-radius: var(--r-card); box-shadow: var(--shadow); color: var(--muted); }
.notice.err { color: var(--bad); background: var(--bad-bg); box-shadow: none; border-color: transparent; }
.skel { height: 74px; border-radius: var(--r-card); background: linear-gradient(90deg, var(--surface) 0%, var(--fill) 50%, var(--surface) 100%); background-size: 200% 100%; animation: skel 1.4s linear infinite; }
@keyframes skel { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ---------- Tabs: a scrollable strip of pills ---------- */
.tabs { display: flex; gap: 4px; margin-top: 26px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; padding: 2px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button, .tabs a {
  display: inline-flex; align-items: center; font: 500 14px/1.3 var(--sans); color: var(--muted);
  background: none; border: 0; border-radius: var(--r-pill); padding: 7px 14px; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.tabs button:hover, .tabs a:hover { color: var(--ink); background: var(--fill); text-decoration: none; }
.tabs [aria-selected="true"], .tabs [aria-selected="true"]:hover { color: var(--ink); background: var(--raised); box-shadow: 0 0 0 1px var(--edge), var(--shadow); }
.tabs .n { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 12px; margin-left: 6px; color: var(--muted); }

/* ---------- Dialog sheet ---------- */
dialog { border: 0; border-radius: 16px; padding: 18px 20px; background: var(--ground); color: var(--ink); box-shadow: var(--shadow-lg); max-height: calc(100vh - 48px); }
dialog::backdrop { background: rgba(0, 0, 0, .35); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
dialog[open] { animation: sheet-in 200ms var(--ease); }
dialog[open]::backdrop { animation: fade-in 200ms var(--ease); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 50;
  max-width: calc(100vw - 32px); padding: 10px 18px; border-radius: var(--r-pill);
  font: 500 14px/1.35 var(--sans); color: var(--ground);
  background: color-mix(in srgb, var(--ink) 92%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: var(--shadow-lg);
  animation: toast-in 220ms var(--ease);
}
#toast.bad { background: var(--bad); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- Login ---------- */
.login {
  width: min(380px, calc(100% - 32px)); margin: calc(12vh + env(safe-area-inset-top, 0px)) auto 0;
  padding: 28px; display: grid; gap: 12px;
  background: var(--surface); border: 1px solid var(--edge); border-radius: 16px; box-shadow: var(--shadow);
}
.login h1 { margin: 0 0 2px; }
.login .stack { display: grid; gap: 12px; }
.login label { display: grid; gap: 5px; font-size: 13px; color: var(--muted); }
.login input { width: 100%; font-size: 15px; background-color: var(--ground); }
.login .btn { width: 100%; padding-block: 10px; font-size: 15px; }
.login .notice { margin-top: 0; }

/* ---------- Touch, motion ---------- */
@media (pointer: coarse) {
  nav a { padding: 8px 12px; }
  .appswitch a { padding: 6px 13px; }
  .chips button, .viewswitch button { padding: 7px 13px; }
  .qa { padding: 7px 12px; font-size: 13px; }
  .btn { min-height: 40px; }
  .linkbtn { padding: 6px 0; }
  .tabs button, .tabs a { padding: 9px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
/* === ../shared/css/ios26.css === */
/* iOS and iPadOS 26 ("Liquid Glass") layer of Cockpit and Home, under the V3 styles.
   Every rule is scoped under body.ui-v2, which both pages carry in their own HTML.
   Both pages link this file right after base.css and before their own stylesheets. Values come from docs/ios26-tokens.md.
   This file never sets --accent, --accent-soft or --on-accent: each page sets its own.
   Low-specificity rules use :where(body.ui-v2) so they only replace the base defaults; page rules still win over them.
   Tokens added here: --glass-bg, --glass-blur, --glass-rim, --glass-shadow (the .glass recipe), --sel-fill (selected
   capsule inside glass), --seg-thumb and --seg-thumb-shadow (selected segment), --r-sheet (sheet radius). */

/* ---------- Tokens ---------- */
body.ui-v2 {
  --ground: #F2F2F7; --surface: #FFFFFF; --raised: #FFFFFF;
  --ink: #000000; --muted: rgba(60, 60, 67, .6);
  --line: rgba(0, 0, 0, .12);                 /* Separators / Non-opaque */
  --fill: rgba(118, 118, 128, .12);           /* Fills / Tertiary */
  --inset: #F2F2F7;
  --edge: transparent;
  --shadow: 0 0 #0000;                        /* iOS grouped cells are flat */
  --shadow-hover: 0 2px 10px rgb(0 0 0 / .06);
  --shadow-lg: 0 12px 48px rgb(0 0 0 / .18);
  --r-card: 24px; --r-ctl: 12px; --r-sheet: 34px;

  --glass-bg: rgba(255, 255, 255, .65);
  --glass-blur: saturate(180%) blur(14px);
  --glass-rim: inset 0 0 0 .5px rgba(255, 255, 255, .7), 0 0 0 .5px rgba(0, 0, 0, .06);
  --glass-shadow: 0 8px 40px rgb(0 0 0 / .12);
  --sel-fill: rgba(0, 0, 0, .07);
  --seg-thumb: #FFFFFF;
  --seg-thumb-shadow: 0 2px 6px rgb(0 0 0 / .12);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.ui-v2 {
    --ground: #000000; --surface: #1C1C1E; --raised: #2C2C2E;
    --ink: #FFFFFF; --muted: rgba(235, 235, 245, .7);
    --line: rgba(255, 255, 255, .17);
    --fill: rgba(118, 118, 128, .24);
    --inset: #2C2C2E;
    --edge: transparent;
    --shadow: 0 0 #0000; --shadow-hover: 0 0 #0000;
    --shadow-lg: 0 12px 48px rgb(0 0 0 / .6);

    --glass-bg: rgba(37, 37, 40, .62);
    --glass-rim: inset 0 0 0 .5px rgba(255, 255, 255, .14);
    --glass-shadow: 0 8px 40px rgb(0 0 0 / .5);
    --sel-fill: rgba(255, 255, 255, .16);
    --seg-thumb: rgba(255, 255, 255, .27);
    --seg-thumb-shadow: 0 0 #0000;
  }
}
:root[data-theme="dark"] body.ui-v2 {
  --ground: #000000; --surface: #1C1C1E; --raised: #2C2C2E;
  --ink: #FFFFFF; --muted: rgba(235, 235, 245, .7);
  --line: rgba(255, 255, 255, .17);
  --fill: rgba(118, 118, 128, .24);
  --inset: #2C2C2E;
  --edge: transparent;
  --shadow: 0 0 #0000; --shadow-hover: 0 0 #0000;
  --shadow-lg: 0 12px 48px rgb(0 0 0 / .6);

  --glass-bg: rgba(37, 37, 40, .62);
  --glass-rim: inset 0 0 0 .5px rgba(255, 255, 255, .14);
  --glass-shadow: 0 8px 40px rgb(0 0 0 / .5);
  --sel-fill: rgba(255, 255, 255, .16);
  --seg-thumb: rgba(255, 255, 255, .27);
  --seg-thumb-shadow: 0 0 #0000;
}

/* ---------- Glass: a reusable surface (pages may also apply the same recipe in CSS) ---------- */
body.ui-v2 .glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-rim), var(--glass-shadow);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  body.ui-v2 .glass { background: var(--raised); }
}

/* ---------- Typography: Large Title and Title 3; body text size unchanged ---------- */
:where(body.ui-v2) h1 { font: 700 34px/41px var(--display); letter-spacing: .4px; }
:where(body.ui-v2) h2 { font: 600 20px/25px var(--display); letter-spacing: -.45px; }
@media (max-width: 720px) {
  :where(body.ui-v2) h1 { font-size: 30px; line-height: 36px; }
}

/* ---------- Header bar and the Cockpit | Home switch ---------- */
body.ui-v2 header.top { border-bottom: 0; background: color-mix(in srgb, var(--ground) 70%, transparent); }  /* blur from base.css */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  body.ui-v2 header.top { background: var(--ground); }
}
body.ui-v2 .appswitch { gap: 2px; padding: 2px; border-radius: 999px; background: var(--fill); }
body.ui-v2 .appswitch a { border-radius: 999px; }
body.ui-v2 .appswitch a[aria-current="page"] { background: var(--seg-thumb); color: var(--ink); box-shadow: var(--seg-thumb-shadow); }

/* ---------- Generic controls ---------- */
:where(body.ui-v2) .btn { border-radius: 999px; }
/* Inputs, selects and textareas keep their base look; their radius already follows --r-ctl (12px above). */
/* === css/home.css === */
/* Home: page rules on top of ../shared/css/base.css (tokens, type, buttons, inputs, login). The pages themselves are
   styled by css/home-v3.css; here Home sets its accent, the toast and the phone basics. */

/* ---------- Accent ---------- */
:root {
  --accent: #7A2E3B; --accent-soft: #F1E4E5;   /* white on the accent: 9.2:1 */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #D98C99; --accent-soft: #35221F;  /* base --on-accent #0B1020 on the accent: 7.3:1 */
  }
}
:root[data-theme="dark"] {
  --accent: #D98C99; --accent-soft: #35221F;
}

/* ---------- Text ---------- */
.empty { color: var(--muted); font-size: 14px; margin: 6px 0; }

/* ---------- Toast (Home uses the class .toast; base styles #toast) ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 50;
  max-width: calc(100vw - 32px); padding: 10px 18px; border-radius: var(--r-pill);
  font: 500 14px/1.35 var(--sans); color: var(--ground);
  background: color-mix(in srgb, var(--ink) 92%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: var(--shadow-lg);
  animation: toast-in 220ms var(--ease);
}

/* ---------- Phones ---------- */
@media (max-width: 720px) {
  .wrap { padding-bottom: 48px; }
  /* iOS zooms into any field under 16px on focus */
  input, select, textarea { font-size: 16px !important; }

  h1 { margin-top: 18px; }
  h2 { margin-top: 26px; }
}
/* === ../shared/css/ios26-v3.css === */
/* UI V3 (native iOS 26 layout): the chrome and the shared components of Cockpit and Home. Spec: docs/ui-v3.md.
   Every rule is scoped under body.ui-v3. The body carries ui-v2 too, so ios26.css and the older page styles still apply
   underneath. Linked after those stylesheets of the page and before the app's own V3 file (Cockpit css/v3.css, Home css/home-v3.css), which sets the accent tokens below.
   Phone = below 768px (top row + floating tab bar); desktop and iPad = 768px and up (sticky glass top bar).

   Tokens (set here for light and dark): --v3-label, --v3-label2 (secondary), --v3-label3 (tertiary), --v3-ground,
   --v3-cell (list and card surface), --v3-cell2 (surface inside a sheet), --v3-sheet (sheet ground), --v3-sep
   (hairline), --v3-fill (tertiary fill), --v3-fill-sel (selected capsule), --v3-thumb (selected segment),
   --v3-glass / --v3-glass-blur / --v3-glass-shadow / --v3-glass-rim (tab bar glass), --v3-glass-sm /
   --v3-glass-sm-shadow (top-row circles), --v3-tabink, --v3-chev, --v3-badge, --v3-red-ink (destructive text),
   --v3-top (top padding of the first row), --v3-gutter (side gutter), --v3-clear (bottom padding that clears the
   tab bar). Set by the app file: --v3-accent (glyphs, selected tab), --v3-accent-ink (text, links),
   --v3-accent-fill (filled buttons, the switch, Save), --v3-on-accent (text on the fill).

   Page and head (build the head with v3Head() in shared/js/v3-ui.js)
   .v3-page         page wrapper inside #view; bottom padding clears the tab bar on a phone
   .v3-head         page head: .v3-toprow (.v3-lead = app switch or back circle, .v3-acts = circles), then
                    .v3-titleblock (.v3-eyebrow, h1.v3-title 34/41 bold, .v3-subtitle 15/20 secondary).
                    .v3-head.v3-deep = nav row with a back circle (deeper pages); .v3-notitle = top row only
   .v3-gap          22px space above a block (between sections)
   Grouped lists
   .v3-sechead      section header above a list or card (13/18 semibold secondary); an <a> or button in it is the
                    trailing link in the accent
   .v3-list         grouped inset list (radius 24, --v3-cell); its rows are direct children
   .v3-row          row (a, button.v3-rowbtn or div): optional leading .v3-tile (30px icon tile, white glyph; colour
                    classes red, orange, green, blue, purple, grey; default the accent), .v3-avatar (40px) or
                    .v3-check (24px round check, aria-pressed="true" = done; put v3Icon("check", 14, 3) inside),
                    then .v3-text (.v3-rtitle 17/22, .v3-rsub 15/20 secondary), then trailing .v3-value (17
                    secondary), a .v3-pill and/or v3Chevron(). Hairlines are inset to the text start; the last
                    row has none. .v3-list.v3-dense = 13/18 subtitles (desktop tables of rows)
   .v3-secfoot      footer under a list (13/18 secondary)
   Surfaces and controls
   .v3-card         flat card: radius 24, padding 16, --v3-cell
   .v3-tiles        number tiles: 2 columns on a phone, 4 on desktop; each child is a card with .v3-lbl (13
                    secondary) and a <b> value (28/34 bold)
   .v3-seg          segmented control: buttons with aria-pressed (or links with aria-current); .v3-segfull = full
                    width (always full width on a phone)
   .v3-chips        a row of .v3-chip filter capsules (32px; aria-pressed="true" = accent fill); one scrolling row
                    on a phone
   .v3-btn          filled capsule (accent fill, white 15/600; 44px on a phone, 34px on desktop); .tinted (accent
                    12% fill, accent text), .gray (grey fill, accent text), .plain (text only, accent);
                    .v3-btnrow lays buttons side by side, equal width
   .v3-circle       44px glass circle (36px in the desktop top bar); .fill = accent, .plain = grey fill;
                    .v3-dot inside = red badge dot. .v3-circles groups circles in one glass capsule
   .v3-glassbtn     44px glass capsule with text
   .v3-pill         22px status capsule 12/600; .red (overdue, risk), .orange (due soon, end of support), .green
                    (done, supporter), .blue (deal step), .purple (reach out), .grey (waiting; also the default)
   .v3-count        red count capsule (Inbox badge)
   .v3-sheet        <dialog> made by v3Sheet(): bottom sheet on a phone (top radius 34, grabber), centred 560px
                    card on desktop; .v3-sheethead = Close circle | title | Save circle; .v3-sheetbody
   .v3-red          destructive text (Sign out) */

/* ---------- Tokens ---------- */
body.ui-v3 {
  --v3-label: #000000; --v3-label2: rgba(60, 60, 67, .6); --v3-label3: rgba(60, 60, 67, .3);
  --v3-ground: #F2F2F7; --v3-cell: #FFFFFF; --v3-cell2: #FFFFFF; --v3-sheet: #F2F2F7;
  --v3-sep: rgba(60, 60, 67, .18);
  --v3-fill: rgba(118, 118, 128, .12); --v3-fill-sel: rgba(118, 118, 128, .14);
  --v3-thumb: #FFFFFF; --v3-thumb-shadow: 0 2px 6px rgba(0, 0, 0, .12);
  --v3-glass: rgba(255, 255, 255, .65);
  --v3-glass-blur: blur(14px) saturate(180%);
  --v3-glass-shadow: 0 8px 40px rgba(0, 0, 0, .12);
  --v3-glass-rim: inset 0 0 0 .5px rgba(0, 0, 0, .06), inset 0 1px 0 rgba(255, 255, 255, .9);
  --v3-glass-sm: rgba(255, 255, 255, .7);
  --v3-glass-sm-shadow: 0 2px 12px rgba(0, 0, 0, .06), inset 0 0 0 .5px rgba(0, 0, 0, .06);
  --v3-tabink: #1A1A1A; --v3-chev: rgba(60, 60, 67, .3);
  --v3-badge: #FF383C; --v3-red-ink: #E9152D;
  --v3-backdrop: rgba(0, 0, 0, .25);
  --v3-top: max(16px, calc(env(safe-area-inset-top, 0px) + 4px));
  --v3-gutter: 16px;
  --v3-clear: calc(94px + max(26px, env(safe-area-inset-bottom, 0px)));
  letter-spacing: -.2px;
}
@media (min-width: 768px) {
  body.ui-v3 { --v3-gutter: 24px; --v3-clear: 32px; }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.ui-v3 {
    --v3-label: #FFFFFF; --v3-label2: rgba(235, 235, 245, .6); --v3-label3: rgba(235, 235, 245, .3);
    --v3-ground: #000000; --v3-cell: #1C1C1E; --v3-cell2: #2C2C2E; --v3-sheet: #1C1C1E;
    --v3-sep: rgba(84, 84, 88, .6);
    --v3-fill: rgba(118, 118, 128, .24); --v3-fill-sel: rgba(118, 118, 128, .24);
    --v3-thumb: #636366; --v3-thumb-shadow: 0 2px 6px rgba(0, 0, 0, .3);
    --v3-glass: rgba(30, 30, 30, .6);
    --v3-glass-shadow: 0 8px 40px rgba(0, 0, 0, .5);
    --v3-glass-rim: inset 0 0 0 .5px rgba(255, 255, 255, .14), inset 0 1px 0 rgba(255, 255, 255, .08);
    --v3-glass-sm: rgba(44, 44, 46, .7);
    --v3-glass-sm-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .12), inset 0 1px 0 rgba(255, 255, 255, .08);
    --v3-tabink: #FFFFFF; --v3-chev: rgba(235, 235, 245, .3);
    --v3-badge: #FF4245; --v3-red-ink: #FF6165;
  }
}
:root[data-theme="dark"] body.ui-v3 {
  --v3-label: #FFFFFF; --v3-label2: rgba(235, 235, 245, .6); --v3-label3: rgba(235, 235, 245, .3);
  --v3-ground: #000000; --v3-cell: #1C1C1E; --v3-cell2: #2C2C2E; --v3-sheet: #1C1C1E;
  --v3-sep: rgba(84, 84, 88, .6);
  --v3-fill: rgba(118, 118, 128, .24); --v3-fill-sel: rgba(118, 118, 128, .24);
  --v3-thumb: #636366; --v3-thumb-shadow: 0 2px 6px rgba(0, 0, 0, .3);
  --v3-glass: rgba(30, 30, 30, .6);
  --v3-glass-shadow: 0 8px 40px rgba(0, 0, 0, .5);
  --v3-glass-rim: inset 0 0 0 .5px rgba(255, 255, 255, .14), inset 0 1px 0 rgba(255, 255, 255, .08);
  --v3-glass-sm: rgba(44, 44, 46, .7);
  --v3-glass-sm-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .12), inset 0 1px 0 rgba(255, 255, 255, .08);
  --v3-tabink: #FFFFFF; --v3-chev: rgba(235, 235, 245, .3);
  --v3-badge: #FF4245; --v3-red-ink: #FF6165;
}

/* ---------- Page frame: #view gutters; pages without a V3 renderer (body.v3-compat) get the tab bar clearance ---------- */
body.ui-v3 main#view {
  padding-inline: max(var(--v3-gutter), env(safe-area-inset-left, 0px)) max(var(--v3-gutter), env(safe-area-inset-right, 0px));
  padding-bottom: 0;
}
body.ui-v3.v3-compat main#view { padding-bottom: var(--v3-clear); }
body.ui-v3 .v3-page { padding-bottom: var(--v3-clear); }

/* ---------- Glass circles, glass text buttons, the app switch ---------- */
body.ui-v3 .v3-circle {
  flex: none; position: relative; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none;
  color: var(--v3-label); background: var(--v3-glass-sm);
  -webkit-backdrop-filter: blur(12px) saturate(180%); backdrop-filter: blur(12px) saturate(180%);
  box-shadow: var(--v3-glass-sm-shadow);
  transition: transform var(--dur) var(--ease), filter var(--dur) var(--ease);
}
body.ui-v3 .v3-circle:hover { text-decoration: none; filter: brightness(.97); }
body.ui-v3 .v3-circle:active { transform: scale(.95); }
body.ui-v3 .v3-circle:disabled { opacity: .5; cursor: default; transform: none; }
body.ui-v3 .v3-circle.fill { background: var(--v3-accent-fill); color: var(--v3-on-accent); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
body.ui-v3 .v3-circle.plain { background: var(--v3-fill); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
body.ui-v3 .v3-circles {
  display: inline-flex; flex: none; border-radius: 999px; background: var(--v3-glass-sm);
  -webkit-backdrop-filter: blur(12px) saturate(180%); backdrop-filter: blur(12px) saturate(180%);
  box-shadow: var(--v3-glass-sm-shadow);
}
body.ui-v3 .v3-circles > .v3-circle { background: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
body.ui-v3 .v3-dot {
  position: absolute; top: 8px; right: 7px; width: 9px; height: 9px; padding: 0; border-radius: 999px;
  background: var(--v3-badge); box-shadow: 0 0 0 2px var(--v3-cell); font-size: 0; line-height: 0; overflow: hidden; color: transparent;
}
body.ui-v3 .v3-glassbtn {
  flex: none; height: 44px; padding: 0 18px; border: 0; border-radius: 999px; display: inline-flex; align-items: center;
  font: 600 15px/20px var(--sans); color: var(--v3-label); cursor: pointer; text-decoration: none; white-space: nowrap;
  background: var(--v3-glass-sm); -webkit-backdrop-filter: blur(12px) saturate(180%); backdrop-filter: blur(12px) saturate(180%);
  box-shadow: var(--v3-glass-sm-shadow);
}
body.ui-v3 .v3-glassbtn:hover { text-decoration: none; filter: brightness(.97); }
body.ui-v3 .v3-glassbtn[aria-pressed="true"] { background: var(--v3-accent-fill); color: var(--v3-on-accent); box-shadow: none; }
body.ui-v3 .v3-appswitch {
  display: inline-grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); flex: none; padding: 3px; border-radius: 999px;
  background: var(--v3-glass-sm); -webkit-backdrop-filter: blur(12px) saturate(180%); backdrop-filter: blur(12px) saturate(180%);
  box-shadow: var(--v3-glass-sm-shadow);
}
body.ui-v3 .v3-appswitch a {
  height: 38px; padding: 0 16px; display: flex; align-items: center; justify-content: center; border-radius: 999px;
  font: 500 15px/20px var(--sans); color: var(--v3-label); text-decoration: none; white-space: nowrap; box-shadow: none;
}
body.ui-v3 .v3-appswitch a:hover { text-decoration: none; }
body.ui-v3 .v3-appswitch a[aria-current="page"] { background: var(--v3-accent-fill); color: var(--v3-on-accent); font-weight: 600; }
body.ui-v3 .v3-count {
  display: inline-block; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--v3-badge); color: #FFFFFF;
  font: 700 11px/18px var(--sans); letter-spacing: 0; text-align: center; font-variant-numeric: tabular-nums;
}

/* ---------- Chrome, phone: top row of compat pages and the floating tab bar ---------- */
body.ui-v3 .v3-compatrow { display: none; }
body.ui-v3 .v3-tabbar {
  position: fixed; z-index: 6; display: flex; gap: 10px; align-items: center;
  left: max(20px, env(safe-area-inset-left, 0px)); right: max(20px, env(safe-area-inset-right, 0px));
  bottom: max(26px, env(safe-area-inset-bottom, 0px));
}
body.ui-v3 .v3-tabs {
  flex: 1 1 auto; min-width: 0; height: 62px; padding: 4px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  border-radius: 999px; background: var(--v3-glass);
  -webkit-backdrop-filter: var(--v3-glass-blur); backdrop-filter: var(--v3-glass-blur);
  box-shadow: var(--v3-glass-shadow), var(--v3-glass-rim);
}
body.ui-v3 .v3-tabs a {
  min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  border-radius: 999px; color: var(--v3-tabink); font: 600 10px/12px var(--sans); letter-spacing: 0; text-decoration: none;
}
body.ui-v3 .v3-tabs a:hover { text-decoration: none; }
body.ui-v3 .v3-tabs a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.ui-v3 .v3-tabs a[aria-current="page"] { background: var(--v3-fill-sel); color: var(--v3-accent); }
body.ui-v3 .v3-tabs a:focus-visible, body.ui-v3 .v3-tabsearch:focus-visible { outline: 2px solid var(--v3-accent); outline-offset: -2px; }
body.ui-v3 .v3-tabsearch {
  flex: none; width: 62px; height: 62px; padding: 0; border: 0; border-radius: 999px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: var(--v3-tabink);
  background: var(--v3-glass); -webkit-backdrop-filter: var(--v3-glass-blur); backdrop-filter: var(--v3-glass-blur);
  box-shadow: var(--v3-glass-shadow), var(--v3-glass-rim);
}
body.ui-v3 .v3-bar { display: none; }
@media (max-width: 767.98px) {
  body.ui-v3.v3-compat .v3-compatrow {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: var(--v3-top) max(var(--v3-gutter), env(safe-area-inset-right, 0px)) 0 max(var(--v3-gutter), env(safe-area-inset-left, 0px));
  }
  body.ui-v3 .v3-compatrow .v3-acts { display: flex; gap: 8px; align-items: center; }
  /* Toasts sit just above the tab bar */
  body.ui-v3 #toast, body.ui-v3 .toast { bottom: calc(100px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- Chrome, desktop and iPad: the sticky glass top bar ---------- */
@media (min-width: 768px) {
  body.ui-v3 .v3-tabbar { display: none; }
  body.ui-v3 .v3-bar {
    position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; min-height: 64px;
    padding: calc(12px + env(safe-area-inset-top, 0px)) max(var(--v3-gutter), env(safe-area-inset-right, 0px)) 12px max(var(--v3-gutter), env(safe-area-inset-left, 0px));
    background: color-mix(in srgb, var(--v3-ground) 72%, transparent);
    -webkit-backdrop-filter: var(--v3-glass-blur); backdrop-filter: var(--v3-glass-blur);
    box-shadow: inset 0 -.5px 0 var(--v3-sep);
  }
  /* The switch is a plain segmented control in the bar */
  body.ui-v3 .v3-bar .v3-appswitch { background: var(--v3-fill); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  body.ui-v3 .v3-bar .v3-appswitch a { height: 30px; padding: 0 12px; font-size: 13px; line-height: 18px; }
  body.ui-v3 .v3-bar .v3-appswitch a[aria-current="page"] { background: var(--v3-thumb); color: var(--v3-label); box-shadow: var(--v3-thumb-shadow); }
  body.ui-v3 .v3-nav {
    display: flex; gap: 2px; min-width: 0; padding: 4px; border-radius: 999px; overflow-x: auto; scrollbar-width: none;
    background: var(--v3-glass-sm); box-shadow: var(--v3-glass-sm-shadow);
  }
  body.ui-v3 .v3-nav::-webkit-scrollbar { display: none; }
  body.ui-v3 .v3-nav a {
    flex: none; height: 32px; padding: 0 14px; display: inline-flex; align-items: center; gap: 6px; border-radius: 999px;
    color: var(--v3-tabink); font: 500 14px/18px var(--sans); white-space: nowrap; text-decoration: none; box-shadow: none;
  }
  body.ui-v3 .v3-nav a:hover { background: var(--v3-fill); color: var(--v3-tabink); text-decoration: none; }
  body.ui-v3 .v3-nav a[aria-current="page"] { background: var(--v3-fill-sel); color: var(--v3-accent-ink); font-weight: 600; box-shadow: none; }
  body.ui-v3 .v3-searchfield {
    margin-left: auto; flex: 0 1 240px; min-width: 0; height: 36px; padding: 0 12px; display: flex; align-items: center; gap: 8px;
    border: 0; border-radius: 999px; background: var(--v3-fill); color: var(--v3-label2); font: 400 14px/18px var(--sans);
    cursor: pointer; text-align: left;
  }
  body.ui-v3 .v3-searchfield svg { flex: none; }
  body.ui-v3 .v3-searcht { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.ui-v3 .v3-kbd { flex: none; font: 600 12px/16px var(--sans); color: var(--v3-label2); }
  body.ui-v3 .v3-bar .v3-circle { width: 36px; height: 36px; }
}
/* iPad portrait and narrow windows: the search field becomes a circle and the nav tightens (it scrolls if still too wide) */
@media (min-width: 768px) and (max-width: 1099.98px) {
  body.ui-v3 .v3-bar { gap: 8px; }
  body.ui-v3 .v3-nav a { padding: 0 10px; }
  body.ui-v3 .v3-searchfield { flex: none; width: 36px; padding: 0; justify-content: center; }
  body.ui-v3 .v3-searcht, body.ui-v3 .v3-kbd { display: none; }
}

/* ---------- Page head and large title ---------- */
body.ui-v3 .v3-head {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "lead acts" "title title";
  align-items: center; column-gap: 12px; padding-top: var(--v3-top);
}
body.ui-v3 .v3-toprow { display: contents; }
body.ui-v3 .v3-lead { grid-area: lead; display: flex; align-items: center; min-width: 0; }
body.ui-v3 .v3-acts { grid-area: acts; display: flex; gap: 8px; align-items: center; justify-self: end; }
body.ui-v3 .v3-titleblock { grid-area: title; min-width: 0; padding-top: 6px; }
body.ui-v3 .v3-title { margin: 0; font: 700 34px/41px var(--display); letter-spacing: .4px; text-wrap: balance; }
body.ui-v3 .v3-eyebrow { margin: 0; font: 600 13px/18px var(--sans); letter-spacing: -.08px; color: var(--v3-label2); text-transform: none; }
body.ui-v3 .v3-subtitle { margin: 0; font: 400 15px/20px var(--sans); letter-spacing: -.23px; color: var(--v3-label2); }
body.ui-v3 .v3-head.v3-notitle { grid-template-areas: "lead acts"; }
@media (min-width: 768px) {
  body.ui-v3 .v3-head { grid-template-areas: "title acts"; align-items: end; padding-top: 20px; }
  body.ui-v3 .v3-head.v3-notitle:not(.v3-deep) { grid-template-areas: ". acts"; }
  body.ui-v3 .v3-head:not(.v3-deep) .v3-lead { display: none; }
  body.ui-v3 .v3-head.v3-deep { grid-template-areas: "lead lead" "title acts"; row-gap: 8px; }
  body.ui-v3 .v3-head.v3-deep.v3-notitle { grid-template-areas: "lead acts"; align-items: center; }
}

/* ---------- Grouped inset list ---------- */
body.ui-v3 .v3-sechead {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  margin: 22px 0 0; padding: 0 16px 6px; font: 600 13px/18px var(--sans); letter-spacing: -.08px; color: var(--v3-label2);
}
body.ui-v3 .v3-sechead a, body.ui-v3 .v3-sechead button {
  font: 400 15px/20px var(--sans); color: var(--v3-accent-ink); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: none;
}
body.ui-v3 .v3-secfoot { margin: 6px 0 0; padding: 0 16px; font: 400 13px/18px var(--sans); letter-spacing: -.08px; color: var(--v3-label2); }
body.ui-v3 .v3-list { display: block; margin: 0; padding: 0; list-style: none; border-radius: 24px; background: var(--v3-cell); overflow: hidden; }
body.ui-v3 .v3-row {
  --v3-inset: 16px;
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 12px 16px;
  color: var(--v3-label); text-decoration: none; font: 400 17px/22px var(--sans); letter-spacing: -.43px;
}
body.ui-v3 .v3-row:has(> .v3-tile) { --v3-inset: 58px; }
body.ui-v3 .v3-row:has(> .v3-check) { --v3-inset: 52px; }
body.ui-v3 .v3-row:has(> .v3-avatar) { --v3-inset: 68px; }
body.ui-v3 .v3-list > .v3-row:not(:last-child)::after {
  content: ""; position: absolute; left: var(--v3-inset); right: 0; bottom: 0; height: .5px; background: var(--v3-sep); pointer-events: none;
}
body.ui-v3 a.v3-row:hover { text-decoration: none; }
body.ui-v3 .v3-rowbtn { width: 100%; margin: 0; border: 0; background: none; text-align: left; cursor: pointer; }
@media (hover: hover) {
  body.ui-v3 a.v3-row:hover, body.ui-v3 .v3-rowbtn:hover { background: var(--v3-fill); }
}
body.ui-v3 a.v3-row:active, body.ui-v3 .v3-rowbtn:active { background: var(--v3-fill); }
body.ui-v3 .v3-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
body.ui-v3 .v3-rtitle { font: 400 17px/22px var(--sans); letter-spacing: -.43px; color: var(--v3-label); overflow-wrap: anywhere; }
body.ui-v3 .v3-rsub { font: 400 15px/20px var(--sans); letter-spacing: -.23px; color: var(--v3-label2); overflow-wrap: anywhere; }
body.ui-v3 .v3-list.v3-dense .v3-rsub { font-size: 13px; line-height: 18px; letter-spacing: -.08px; }
body.ui-v3 .v3-value { flex: none; font: 400 17px/22px var(--sans); letter-spacing: -.43px; color: var(--v3-label2); text-align: right; }
body.ui-v3 .v3-chev { flex: none; color: var(--v3-chev); }
body.ui-v3 .v3-tile {
  flex: none; width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--v3-accent-fill); color: #FFFFFF;
}
body.ui-v3 .v3-tile.red { background: #FF383C; }
body.ui-v3 .v3-tile.orange { background: #FF8D28; }
body.ui-v3 .v3-tile.green { background: #34C759; }
body.ui-v3 .v3-tile.blue { background: #0088FF; }
body.ui-v3 .v3-tile.purple { background: #CB30E0; }
body.ui-v3 .v3-tile.grey { background: #8E8E93; }
body.ui-v3 .v3-avatar {
  flex: none; width: 40px; height: 40px; border-radius: 999px; overflow: hidden; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #A0A0A8, #5A5A62); color: #FFFFFF; font: 600 15px/1 var(--sans); letter-spacing: 0;
}
body.ui-v3 .v3-avatar img { width: 100%; height: 100%; object-fit: cover; }
body.ui-v3 .v3-check {
  flex: none; width: 24px; height: 24px; padding: 0; border-radius: 999px; border: 1.5px solid var(--v3-label3); background: transparent;
  display: inline-flex; align-items: center; justify-content: center; color: #FFFFFF; cursor: pointer;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
body.ui-v3 .v3-check svg { opacity: 0; }
body.ui-v3 .v3-check[aria-pressed="true"] { background: var(--v3-accent); border-color: var(--v3-accent); }
body.ui-v3 .v3-check[aria-pressed="true"] svg { opacity: 1; }
body.ui-v3 .v3-check:focus-visible { outline: 2px solid var(--v3-accent); outline-offset: 2px; }

/* ---------- Card and number tiles ---------- */
body.ui-v3 .v3-card { border: 0; border-radius: 24px; padding: 16px; background: var(--v3-cell); box-shadow: none; }
body.ui-v3 .v3-card > :first-child { margin-top: 0; }
body.ui-v3 .v3-card > :last-child { margin-bottom: 0; }
body.ui-v3 .v3-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 768px) { body.ui-v3 .v3-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
body.ui-v3 .v3-tiles > * { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 14px 16px; border-radius: 24px; background: var(--v3-cell); color: var(--v3-label); text-decoration: none; }
body.ui-v3 .v3-tiles .v3-lbl { font: 400 13px/18px var(--sans); letter-spacing: -.08px; color: var(--v3-label2); }
body.ui-v3 .v3-tiles b { font: 700 28px/34px var(--display); letter-spacing: .38px; font-variant-numeric: tabular-nums; }

/* ---------- Segmented control ---------- */
body.ui-v3 .v3-seg {
  display: inline-grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); max-width: 100%;
  padding: 3px; border-radius: 999px; background: var(--v3-fill);
}
body.ui-v3 .v3-seg.v3-segfull { display: grid; width: 100%; }
body.ui-v3 .v3-seg > button, body.ui-v3 .v3-seg > a {
  min-width: 0; height: 32px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font: 500 14px/18px var(--sans); letter-spacing: -.15px; color: var(--v3-label); text-decoration: none;
  transition: background-color var(--dur) var(--ease);
}
body.ui-v3 .v3-seg > [aria-pressed="true"], body.ui-v3 .v3-seg > [aria-selected="true"], body.ui-v3 .v3-seg > [aria-current="page"] {
  background: var(--v3-thumb); box-shadow: var(--v3-thumb-shadow); font-weight: 600;
}
body.ui-v3 .v3-seg > :focus-visible { outline: 2px solid var(--v3-accent); outline-offset: -2px; }
@media (max-width: 767.98px) { body.ui-v3 .v3-seg { display: grid; width: 100%; } }

/* ---------- Chips ---------- */
body.ui-v3 .v3-chips { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 767.98px) {
  body.ui-v3 .v3-chips {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    margin-inline: calc(-1 * var(--v3-gutter)); padding-inline: var(--v3-gutter);
  }
  body.ui-v3 .v3-chips::-webkit-scrollbar { display: none; }
}
body.ui-v3 .v3-chip {
  flex: none; height: 32px; padding: 0 14px; border: 0; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px;
  background: var(--v3-fill); color: var(--v3-label); font: 500 14px/18px var(--sans); letter-spacing: -.15px; white-space: nowrap;
  cursor: pointer; text-decoration: none;
}
body.ui-v3 .v3-chip:hover { text-decoration: none; }
body.ui-v3 .v3-chip[aria-pressed="true"], body.ui-v3 .v3-chip[aria-current="page"] { background: var(--v3-accent-fill); color: var(--v3-on-accent); font-weight: 600; }

/* ---------- Buttons ---------- */
body.ui-v3 .v3-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 16px;
  border: 0; border-radius: 999px; cursor: pointer; white-space: nowrap; text-decoration: none;
  background: var(--v3-accent-fill); color: var(--v3-on-accent); font: 600 15px/20px var(--sans); letter-spacing: -.23px;
  transition: filter var(--dur) var(--ease), transform var(--dur) var(--ease);
}
@media (max-width: 767.98px) { body.ui-v3 .v3-btn { height: 44px; padding: 0 18px; } }
body.ui-v3 .v3-btn:hover { text-decoration: none; filter: brightness(1.06); }
body.ui-v3 .v3-btn:active { transform: scale(.98); }
body.ui-v3 .v3-btn:disabled { opacity: .5; cursor: default; filter: none; transform: none; }
body.ui-v3 .v3-btn.tinted { background: color-mix(in srgb, var(--v3-accent) 12%, transparent); color: var(--v3-accent-ink); }
body.ui-v3 .v3-btn.gray { background: var(--v3-fill); color: var(--v3-accent-ink); }
body.ui-v3 .v3-btn.plain { background: none; color: var(--v3-accent-ink); padding-inline: 4px; }
body.ui-v3 .v3-btn.tinted:hover, body.ui-v3 .v3-btn.gray:hover, body.ui-v3 .v3-btn.plain:hover { filter: brightness(.96); }
body.ui-v3 .v3-btnrow { display: flex; gap: 8px; }
body.ui-v3 .v3-btnrow > .v3-btn { flex: 1 1 0; min-width: 0; }

/* ---------- Pills ---------- */
body.ui-v3 .v3-pill {
  display: inline-flex; align-items: center; flex: none; height: 22px; padding: 0 8px; border-radius: 999px; white-space: nowrap;
  font: 600 12px/16px var(--sans); letter-spacing: 0; background: rgba(118, 118, 128, .12); color: rgba(60, 60, 67, .8);
}
body.ui-v3 .v3-pill.red { background: rgba(255, 56, 60, .12); color: #C4161B; }
body.ui-v3 .v3-pill.orange { background: rgba(255, 141, 40, .16); color: #A84A00; }
body.ui-v3 .v3-pill.green { background: rgba(52, 199, 89, .14); color: #1F7A35; }
body.ui-v3 .v3-pill.blue { background: rgba(0, 136, 255, .12); color: #0062C4; }
body.ui-v3 .v3-pill.purple { background: rgba(203, 48, 224, .12); color: #8A1F9A; }
body.ui-v3 .v3-pill.grey { background: rgba(118, 118, 128, .12); color: rgba(60, 60, 67, .8); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.ui-v3 .v3-pill, :root:not([data-theme="light"]) body.ui-v3 .v3-pill.grey { background: rgba(118, 118, 128, .24); color: rgba(235, 235, 245, .8); }
  :root:not([data-theme="light"]) body.ui-v3 .v3-pill.red { background: rgba(255, 66, 69, .22); color: #FF8A8C; }
  :root:not([data-theme="light"]) body.ui-v3 .v3-pill.orange { background: rgba(255, 146, 48, .22); color: #FFB06A; }
  :root:not([data-theme="light"]) body.ui-v3 .v3-pill.green { background: rgba(48, 209, 88, .2); color: #30D158; }
  :root:not([data-theme="light"]) body.ui-v3 .v3-pill.blue { background: rgba(0, 145, 255, .22); color: #6CB8FF; }
  :root:not([data-theme="light"]) body.ui-v3 .v3-pill.purple { background: rgba(219, 52, 242, .22); color: #EA8DFF; }
}
:root[data-theme="dark"] body.ui-v3 .v3-pill, :root[data-theme="dark"] body.ui-v3 .v3-pill.grey { background: rgba(118, 118, 128, .24); color: rgba(235, 235, 245, .8); }
:root[data-theme="dark"] body.ui-v3 .v3-pill.red { background: rgba(255, 66, 69, .22); color: #FF8A8C; }
:root[data-theme="dark"] body.ui-v3 .v3-pill.orange { background: rgba(255, 146, 48, .22); color: #FFB06A; }
:root[data-theme="dark"] body.ui-v3 .v3-pill.green { background: rgba(48, 209, 88, .2); color: #30D158; }
:root[data-theme="dark"] body.ui-v3 .v3-pill.blue { background: rgba(0, 145, 255, .22); color: #6CB8FF; }
:root[data-theme="dark"] body.ui-v3 .v3-pill.purple { background: rgba(219, 52, 242, .22); color: #EA8DFF; }

body.ui-v3 .v3-red { color: var(--v3-red-ink); }

/* ---------- Bottom sheet (v3Sheet) ---------- */
body.ui-v3 dialog.v3-sheet {
  width: 100%; max-width: none; max-height: calc(100dvh - 54px - env(safe-area-inset-top, 0px));
  margin: auto 0 0; padding: 0; border: 0; border-radius: 34px 34px 0 0; overflow-y: auto; overscroll-behavior: contain;
  background: var(--v3-sheet); color: var(--v3-label); box-shadow: 0 -8px 40px rgba(0, 0, 0, .18);
}
body.ui-v3 dialog.v3-sheet[open] { animation: sheet-up 280ms var(--ease); }
body.ui-v3 dialog.v3-sheet::backdrop { background: var(--v3-backdrop); -webkit-backdrop-filter: none; backdrop-filter: none; }
body.ui-v3 .v3-sheetbox { padding: 6px var(--v3-gutter) calc(24px + env(safe-area-inset-bottom, 0px)); }
body.ui-v3 .v3-sheetbox::before { content: ""; display: block; width: 36px; height: 5px; margin: 0 auto; border-radius: 999px; background: var(--v3-label3); }
body.ui-v3 .v3-sheethead { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 8px; padding-top: 10px; }
body.ui-v3 .v3-sheettitle { margin: 0; text-align: center; font: 600 17px/22px var(--sans); letter-spacing: -.43px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.ui-v3 .v3-sheetbody { margin-top: 14px; }
body.ui-v3 .v3-sheetbody > .v3-sechead:first-child { margin-top: 6px; }
body.ui-v3 .v3-sheet .v3-list, body.ui-v3 .v3-sheet .v3-card, body.ui-v3 .v3-sheet .v3-tiles > * { background: var(--v3-cell2); }
@media (min-width: 768px) {
  body.ui-v3 dialog.v3-sheet { width: min(560px, calc(100vw - 48px)); max-height: 85vh; margin: auto; border-radius: 34px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
  body.ui-v3 dialog.v3-sheet[open] { animation: sheet-in 200ms var(--ease); }
  body.ui-v3 .v3-sheetbox { padding: 16px 20px 24px; }
  body.ui-v3 .v3-sheetbox::before { display: none; }
  body.ui-v3 .v3-sheethead { padding-top: 0; }
}

/* ---------- Spacing (after the components, so it wins over their margin: 0) ---------- */
body.ui-v3 .v3-gap { margin-top: 22px; }

/* ---------- No backdrop-filter: glass becomes solid ---------- */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  body.ui-v3 .v3-circle:not(.fill):not(.plain), body.ui-v3 .v3-circles, body.ui-v3 .v3-glassbtn, body.ui-v3 .v3-appswitch,
  body.ui-v3 .v3-tabs, body.ui-v3 .v3-tabsearch, body.ui-v3 .v3-nav { background: var(--v3-cell); }
  body.ui-v3 .v3-circles > .v3-circle { background: transparent; }
  body.ui-v3 .v3-bar { background: var(--v3-ground); }
}
/* === css/home-v3.css === */
/* Home UI V3: the accent and the shell. Components and chrome: ../shared/css/ios26-v3.css (read its header for the
   class reference). Every rule is under body.ui-v3. Page files may add their own rules here or in their own stylesheet. */

/* Accent: wine. Dark mode fills with a lighter wine and writes text in rose. */
body.ui-v3 { --v3-accent: #8E2A44; --v3-accent-ink: #8E2A44; --v3-accent-fill: #8E2A44; --v3-on-accent: #FFFFFF; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.ui-v3 { --v3-accent: #E0708C; --v3-accent-ink: #E0708C; --v3-accent-fill: #B03A5B; }
}
:root[data-theme="dark"] body.ui-v3 { --v3-accent: #E0708C; --v3-accent-ink: #E0708C; --v3-accent-fill: #B03A5B; }

/* ======================================================================================================
   Home V3 pages (js/v3-tonight.js, v3-cellar.js, v3-storage.js, v3-meals.js). Classes start with h3-.
   ====================================================================================================== */

/* ---------- Shared: tokens, helpers, caps, fields ---------- */
body.ui-v3 {
  --h3-tint: #F4E3E7; --h3-slot: #E5E5EA; --h3-tag: #FFFFFF; --h3-orange: #C46A00;
  --h3-hero: radial-gradient(120% 90% at 50% 20%, #E9C3CD 0%, #F4E3E7 50%, var(--v3-ground) 100%);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.ui-v3 {
    --h3-tint: rgba(176, 58, 91, .24); --h3-slot: #2C2C2E; --h3-tag: #1C1C1E; --h3-orange: #FF9F0A;
    --h3-hero: radial-gradient(120% 90% at 50% 20%, #5A1A2C 0%, #2A0C16 55%, #000000 100%);
  }
}
:root[data-theme="dark"] body.ui-v3 {
  --h3-tint: rgba(176, 58, 91, .24); --h3-slot: #2C2C2E; --h3-tag: #1C1C1E; --h3-orange: #FF9F0A;
  --h3-hero: radial-gradient(120% 90% at 50% 20%, #5A1A2C 0%, #2A0C16 55%, #000000 100%);
}
@media (min-width: 768px) { body.ui-v3 .v3-head .h3-phone { display: none; } }
body.ui-v3 .h3-gap8 { margin-top: 8px; }
body.ui-v3 .h3-gap12 { margin-top: 12px; }
body.ui-v3 .h3-gap16 { margin-top: 16px; }
body.ui-v3 .h3-muted { color: var(--v3-label2); }
body.ui-v3 .h3-small { font-size: 13px; line-height: 18px; letter-spacing: -.08px; }
body.ui-v3 .v3-value.h3-small { font-size: 15px; line-height: 20px; }
body.ui-v3 .h3-accent { color: var(--v3-accent-ink); font-weight: 600; }
body.ui-v3 .h3-loading { margin-top: 16px; }
body.ui-v3 .h3-hint { margin: 0; padding: 0 4px; }
body.ui-v3 .h3-danger, body.ui-v3 .v3-btn.h3-danger { color: var(--v3-red-ink); }
body.ui-v3 .h3-prose { margin: 0; font: 400 15px/21px var(--sans); letter-spacing: -.23px; color: var(--v3-label); white-space: pre-line; max-width: 70ch; }
body.ui-v3 .h3-prose p, body.ui-v3 .h3-prose ul { margin: 0 0 8px; }
body.ui-v3 .h3-prose > :last-child { margin-bottom: 0; }
body.ui-v3 .h3-notes { white-space: normal; max-width: none; }
body.ui-v3 .h3-notes ul { padding-left: 20px; }
body.ui-v3 .v3-sechead > span { min-width: 0; }
/* Two columns on wide screens; stacked on a phone */
body.ui-v3 .h3-cols { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 24px; align-items: start; }
@media (min-width: 900px) { body.ui-v3 .h3-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Chips that wrap (filter sheet, the extra actions), also on a phone */
body.ui-v3 .v3-chips.h3-wrap { flex-wrap: wrap; overflow: visible; margin-inline: 0; padding-inline: 0; }
body.ui-v3 .v3-chip .h3-n { opacity: .7; font-variant-numeric: tabular-nums; }
body.ui-v3 .v3-chip svg { flex: none; }
/* Text fields: search capsules and note boxes */
body.ui-v3 .h3-field {
  display: block; width: 100%; box-sizing: border-box; margin: 0; padding: 11px 14px; border: 0; border-radius: 12px;
  background: var(--v3-cell); color: var(--v3-label); font: 400 17px/22px var(--sans); letter-spacing: -.43px; box-shadow: none;
}
body.ui-v3 .v3-sheet .h3-field { background: var(--v3-cell2); }
body.ui-v3 .h3-field::placeholder { color: var(--v3-label3); }
body.ui-v3 .h3-field:focus-visible { outline: 2px solid var(--v3-accent); outline-offset: 0; }
body.ui-v3 textarea.h3-field { resize: vertical; min-height: 72px; }
body.ui-v3 .h3-field.h3-searchin { height: 40px; padding: 0 16px; border-radius: 999px; background: var(--v3-fill); }
@media (min-width: 768px) { body.ui-v3 .v3-page > .h3-searchin { max-width: 480px; } }
/* Bottle caps: a round tile coloured by kind and style */
body.ui-v3 .cap-red { background: radial-gradient(circle at 35% 30%, #C8506E, #6A1A30); }
body.ui-v3 .cap-white { background: radial-gradient(circle at 35% 30%, #F5E3A0, #B89A3E); }
body.ui-v3 .cap-spark { background: radial-gradient(circle at 35% 30%, #FFF4C8, #D4AF37); }
body.ui-v3 .cap-rose { background: radial-gradient(circle at 35% 30%, #F7B5C4, #C2607A); }
body.ui-v3 .cap-beer { background: radial-gradient(circle at 35% 30%, #D9A05A, #7A4A16); }
body.ui-v3 .cap-spirit { background: radial-gradient(circle at 35% 30%, #B07A4A, #4A2A12); }
body.ui-v3 .h3-cap { flex: none; width: 30px; height: 30px; border-radius: 999px; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .12); }
body.ui-v3 .h3-cap.lg { width: 40px; height: 40px; }
body.ui-v3 .v3-row:has(> .h3-cap) { --v3-inset: 58px; }
body.ui-v3 .v3-row:has(> .h3-cap.lg) { --v3-inset: 68px; }
/* Key and value rows (bottle facts) */
body.ui-v3 .h3-kv { justify-content: space-between; align-items: baseline; }
body.ui-v3 .h3-k { flex: none; max-width: 45%; color: var(--v3-label); }
body.ui-v3 .h3-v { min-width: 0; color: var(--v3-label2); text-align: right; overflow-wrap: anywhere; }
/* Score buttons (0 to 10, or 1 to 5) */
body.ui-v3 .h3-scores { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
body.ui-v3 .h3-scores.s5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (min-width: 768px) { body.ui-v3 .h3-scores:not(.s5) { grid-template-columns: repeat(11, minmax(0, 1fr)); } }
body.ui-v3 .h3-scores button {
  height: 44px; padding: 0; border: 0; border-radius: 12px; background: var(--v3-cell2); color: var(--v3-label);
  font: 600 17px/22px var(--sans); cursor: pointer; font-variant-numeric: tabular-nums;
}
body.ui-v3 .h3-scores button[aria-pressed="true"] { background: var(--v3-accent-fill); color: var(--v3-on-accent); }
body.ui-v3 .h3-scores button:focus-visible { outline: 2px solid var(--v3-accent); outline-offset: 2px; }
body.ui-v3 .h3-stack { display: flex; flex-direction: column; gap: 8px; }
body.ui-v3 .h3-stack > .v3-btn { width: 100%; }
body.ui-v3 .h3-accentbtn { color: var(--v3-accent-ink); }
@media (max-width: 389.98px) { body.ui-v3 .h3-wide { display: none; } }
/* Tag capsules (recipe facts) */
body.ui-v3 .h3-tags { display: flex; flex-wrap: wrap; gap: 6px; }
body.ui-v3 .h3-tag {
  display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 999px;
  background: var(--h3-tag); color: var(--v3-label); font: 600 13px/18px var(--sans); letter-spacing: -.08px; white-space: nowrap;
}
body.ui-v3 .v3-sheet .h3-tag { background: var(--v3-cell2); }
body.ui-v3 .h3-tag.acc { background: color-mix(in srgb, var(--v3-accent) 12%, transparent); color: var(--v3-accent-ink); }
/* Servings stepper and radio rows */
body.ui-v3 .h3-stepper { display: inline-flex; gap: 8px; flex: none; }
body.ui-v3 .h3-stepper button {
  width: 36px; height: 36px; padding: 0; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--v3-fill); color: var(--v3-accent-ink); font: 600 20px/1 var(--sans);
}
body.ui-v3 .h3-radio { cursor: pointer; }
body.ui-v3 .h3-radio input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--v3-accent-fill); }
body.ui-v3 .v3-row.h3-radio { --v3-inset: 48px; }
/* Day block: weekday over the date (meal rows, the week list) */
body.ui-v3 .h3-dayblock { flex: none; width: 38px; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
body.ui-v3 .h3-dayblock span { font: 600 11px/13px var(--sans); letter-spacing: .2px; color: var(--v3-label2); }
body.ui-v3 .h3-dayblock b { font: 700 20px/24px var(--display); color: var(--v3-label); }
body.ui-v3 .h3-dayblock.today b { color: var(--v3-accent-ink); }
body.ui-v3 .v3-row:has(> .h3-dayblock) { --v3-inset: 66px; }
/* Search sheet: tall on a phone */
@media (max-width: 767.98px) { body.ui-v3 dialog.h3-searchsheet { min-height: 85dvh; } }

/* ---------- Tonight ---------- */
body.ui-v3 .h3-tgrid { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 24px; align-items: start; }
@media (min-width: 900px) { body.ui-v3 .h3-tgrid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } }
body.ui-v3 .h3-menu { margin-top: 16px; padding: 0; overflow: hidden; }
body.ui-v3 .h3-menuart { height: 132px; display: flex; align-items: center; justify-content: center; background: var(--h3-tint); color: var(--v3-accent-ink); }
body.ui-v3 .h3-emoji { font-size: 64px; line-height: 1; }
body.ui-v3 .h3-menubody { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
body.ui-v3 .h3-kick { margin: 0; font: 600 13px/18px var(--sans); letter-spacing: -.08px; color: var(--v3-accent-ink); }
body.ui-v3 .h3-menutitle { margin: 0; font: 700 22px/28px var(--display); letter-spacing: -.26px; color: var(--v3-label); }
body.ui-v3 .h3-menusub { margin: 0; font: 400 15px/20px var(--sans); letter-spacing: -.23px; color: var(--v3-label2); }
body.ui-v3 .h3-cookedpill { margin-top: 6px; }
body.ui-v3 .h3-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; padding: 12px; text-align: center; }
body.ui-v3 .h3-sday { padding: 6px 0; border-radius: 14px; color: var(--v3-label); text-decoration: none; display: flex; flex-direction: column; align-items: center; }
body.ui-v3 .h3-sday:hover { text-decoration: none; background: var(--v3-fill); }
body.ui-v3 .h3-swd { font: 600 11px/13px var(--sans); color: var(--v3-label2); }
body.ui-v3 .h3-sdn { font: 600 17px/22px var(--sans); }
body.ui-v3 .h3-sday.away .h3-sdn { color: var(--v3-label3); }
body.ui-v3 .h3-sday.planned:not(.on) .h3-sdn::after { content: ""; display: block; width: 4px; height: 4px; margin: 1px auto 0; border-radius: 999px; background: var(--v3-accent); }
body.ui-v3 .h3-sday.on { background: var(--v3-accent-fill); color: var(--v3-on-accent); }
body.ui-v3 .h3-sday.on:hover { background: var(--v3-accent-fill); }
body.ui-v3 .h3-sday.on .h3-swd { color: inherit; opacity: .85; }
body.ui-v3 .h3-sday.on .h3-sdn { font-weight: 700; }

/* ---------- Cellar: bottle list, bottle page, log ---------- */
body.ui-v3 .v3-tiles > a:hover { text-decoration: none; filter: brightness(.98); }
body.ui-v3 .v3-tiles .v3-lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.ui-v3 .h3-bottle, body.ui-v3 .h3-recipe { position: relative; }
body.ui-v3 .h3-bottle > :not(.h3-hero), body.ui-v3 .h3-recipe > :not(.h3-rhero) { position: relative; z-index: 1; }
body.ui-v3 .h3-hero {
  position: absolute; z-index: 0; top: 0; height: 340px; pointer-events: none;
  left: calc(-1 * max(var(--v3-gutter), env(safe-area-inset-left, 0px))); right: calc(-1 * max(var(--v3-gutter), env(safe-area-inset-right, 0px)));
  background: var(--h3-hero);
}
body.ui-v3 .h3-bottleart { position: absolute; left: 50%; top: 92px; transform: translateX(-50%); }
body.ui-v3 .h3-bottleart .glass { fill: #1A0A10; stroke: rgba(255, 255, 255, .18); stroke-width: 1; }
body.ui-v3 .h3-bottleart[data-cap="cap-white"] .glass, body.ui-v3 .h3-bottleart[data-cap="cap-spark"] .glass { fill: #26301A; }
body.ui-v3 .h3-bottleart[data-cap="cap-beer"] .glass { fill: #3A220A; }
body.ui-v3 .h3-bottleart[data-cap="cap-spirit"] .glass { fill: #2E1C0E; }
body.ui-v3 .h3-bottleart .label { fill: #EDE3D2; }
body.ui-v3 .h3-bottleart .stripe { fill: #8E2A44; }
body.ui-v3 .h3-bottleart[data-cap="cap-white"] .stripe, body.ui-v3 .h3-bottleart[data-cap="cap-spark"] .stripe { fill: #B89A3E; }
body.ui-v3 .h3-bottleart[data-cap="cap-rose"] .stripe { fill: #C2607A; }
body.ui-v3 .h3-bottleart[data-cap="cap-beer"] .stripe, body.ui-v3 .h3-bottleart[data-cap="cap-spirit"] .stripe { fill: #7A4A16; }
body.ui-v3 .h3-bottleart .line { fill: rgba(0, 0, 0, .3); }
body.ui-v3 .h3-bhead { margin-top: 262px; }
body.ui-v3 .h3-kicker { margin: 0; font: 600 13px/18px var(--sans); letter-spacing: .4px; text-transform: uppercase; color: var(--v3-accent-ink); }
body.ui-v3 .h3-btitle { margin: 2px 0 0; font: 700 28px/34px var(--display); letter-spacing: .36px; color: var(--v3-label); text-wrap: balance; }
body.ui-v3 .h3-tiles3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
body.ui-v3 .h3-tiles3 > div { min-width: 0; padding: 12px; border-radius: 18px; background: var(--v3-cell); }
body.ui-v3 .h3-tiles3 .v3-lbl { display: block; font: 400 12px/16px var(--sans); color: var(--v3-label2); }
body.ui-v3 .h3-tiles3 b { display: block; font: 700 20px/25px var(--display); color: var(--v3-label); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
body.ui-v3 .h3-tiles3 b small { font-size: 13px; font-weight: 600; color: var(--v3-label2); }
body.ui-v3 .h3-tiles3 b.orange { color: var(--h3-orange); }
body.ui-v3 .h3-tiles3 b.red { color: var(--v3-red-ink); }
body.ui-v3 .h3-fill > button { font-size: 13px; }
body.ui-v3 .h3-fill > button:disabled { cursor: default; }
body.ui-v3 .h3-actrow .h3-iconbtn { flex: none; aspect-ratio: 1; padding: 0; }
@media (max-width: 767.98px) { body.ui-v3 .h3-actrow .v3-btn { height: 50px; font-size: 17px; } }
body.ui-v3 .h3-wbar { display: inline-block; vertical-align: middle; width: 64px; height: 4px; margin-left: 8px; border-radius: 2px; background: var(--v3-fill); overflow: hidden; }
body.ui-v3 .h3-wbar i { display: block; height: 100%; background: var(--v3-accent); }
body.ui-v3 .h3-wbar.over i { background: var(--v3-red-ink); }
@media (min-width: 768px) {
  body.ui-v3 .h3-hero { height: 300px; }
  body.ui-v3 .h3-bottleart { top: 34px; }
  body.ui-v3 .h3-bhead { margin-top: 196px; }
}

/* ---------- Storage ---------- */
body.ui-v3 .h3-fridgewrap { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 24px; align-items: start; }
@media (min-width: 900px) {
  body.ui-v3 .h3-fridgewrap { grid-template-columns: minmax(0, 440px) minmax(0, 1fr); }
  body.ui-v3 .h3-fridgewrap > :not(.h3-fridgelist) { grid-column: 1; }
  body.ui-v3 .h3-fridgelist { grid-column: 2; grid-row: 1 / span 3; }
  body.ui-v3 .h3-fridgelist > .v3-sechead:first-child { margin-top: 0; }
}
body.ui-v3 .h3-fridge { border-radius: 28px; }
body.ui-v3 .h3-fridgehead { display: flex; justify-content: space-between; gap: 12px; font: 600 13px/18px var(--sans); letter-spacing: -.08px; color: var(--v3-label2); }
body.ui-v3 .h3-grid { margin-top: 12px; padding: 0 18px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
body.ui-v3 .h3-slot { display: block; aspect-ratio: 1; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(127, 127, 127, .12); }
body.ui-v3 .h3-slot:not(.h3-capbtn) { background: var(--h3-slot); }
body.ui-v3 .h3-capbtn { width: 100%; padding: 0; border: 0; cursor: pointer; transition: transform var(--dur) var(--ease); }
body.ui-v3 .h3-capbtn:active { transform: scale(.94); }
body.ui-v3 .h3-capbtn[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--v3-cell), 0 0 0 5px var(--v3-accent); }
body.ui-v3 .h3-capbtn:focus-visible { outline: 2px solid var(--v3-accent); outline-offset: 3px; }
body.ui-v3 .h3-legend { margin-top: 14px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; font: 400 12px/16px var(--sans); color: var(--v3-label2); }
body.ui-v3 .h3-legend span { display: inline-flex; align-items: center; gap: 5px; }
body.ui-v3 .h3-legend i { width: 10px; height: 10px; border-radius: 999px; }
body.ui-v3 .h3-legend i.empty { background: var(--h3-slot); box-shadow: inset 0 0 0 1px rgba(127, 127, 127, .3); }
body.ui-v3 .h3-selcard {
  margin-top: 12px; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 24px;
  background: var(--v3-glass-sm); -webkit-backdrop-filter: blur(14px) saturate(180%); backdrop-filter: blur(14px) saturate(180%); box-shadow: var(--v3-glass-sm-shadow);
}
body.ui-v3 .h3-selsub { font: 400 13px/18px var(--sans); letter-spacing: -.08px; color: var(--v3-label2); }
body.ui-v3 .h3-selcard .v3-btn.h3-selopen { flex: none; height: 32px; padding: 0 14px; font-size: 14px; }
body.ui-v3 .v3-row.h3-on { background: var(--v3-fill-sel); }
body.ui-v3 .h3-pickhint { margin-top: 22px; }
@media (min-width: 900px) { body.ui-v3 .h3-pickhint { margin-top: 46px; } }

/* ---------- Meals: plan, night sheet, recipes, recipe page, summary ---------- */
body.ui-v3 .h3-nights { display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 900px) { body.ui-v3 .h3-nights { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); } }
body.ui-v3 .h3-night {
  width: 100%; min-height: 68px; margin: 0; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px;
  border: 0; border-radius: 22px; background: var(--v3-cell); color: var(--v3-label); text-align: left; cursor: pointer;
  font: 400 17px/22px var(--sans); letter-spacing: -.43px;
}
body.ui-v3 .h3-night:hover { filter: brightness(.98); }
body.ui-v3 .h3-night:focus-visible { outline: 2px solid var(--v3-accent); outline-offset: 2px; }
body.ui-v3 .h3-night.away { background: color-mix(in srgb, var(--v3-cell) 55%, transparent); }
body.ui-v3 .h3-night.away .v3-rtitle, body.ui-v3 .h3-night.away .h3-dayblock b { color: var(--v3-label2); }
body.ui-v3 .h3-night.open { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--v3-accent) 35%, transparent); }
body.ui-v3 .h3-night .v3-pill { flex: none; }
body.ui-v3 .h3-emo {
  flex: none; width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--h3-tint); color: var(--v3-accent-ink); font-size: 17px; line-height: 1;
}
body.ui-v3 .h3-emo.lg { width: 48px; height: 48px; border-radius: 12px; font-size: 26px; }
body.ui-v3 .h3-emo.m-pot, body.ui-v3 .h3-rhero.m-pot { background: linear-gradient(160deg, #E8C3A4, #B97F57); }
body.ui-v3 .h3-emo.m-pan, body.ui-v3 .h3-rhero.m-pan { background: linear-gradient(160deg, #F7DD98, #DDA052); }
body.ui-v3 .h3-emo.m-wok, body.ui-v3 .h3-rhero.m-wok { background: linear-gradient(160deg, #CBE8B5, #7FB063); }
body.ui-v3 .h3-emo.m-oven, body.ui-v3 .h3-rhero.m-oven { background: linear-gradient(160deg, #F2C2A2, #C9734C); }
body.ui-v3 .h3-emo.m-bbq, body.ui-v3 .h3-rhero.m-bbq { background: linear-gradient(160deg, #D2AE9A, #8A5A44); }
body.ui-v3 .h3-emo.m-airfryer, body.ui-v3 .h3-rhero.m-airfryer { background: linear-gradient(160deg, #F6D2AE, #D08B4E); }
body.ui-v3 .h3-emo.m-no_cook, body.ui-v3 .h3-rhero.m-no_cook { background: linear-gradient(160deg, #C6EAEE, #6FB2BC); }
body.ui-v3 .v3-row:has(> .h3-emo) { --v3-inset: 58px; }
body.ui-v3 .v3-row:has(> .h3-emo.lg) { --v3-inset: 76px; }
body.ui-v3 .h3-recrow .v3-rsub { display: flex; flex-direction: column; }
body.ui-v3 .h3-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
body.ui-v3 .h3-meta { font-size: 13px; line-height: 18px; letter-spacing: -.08px; }
body.ui-v3 .h3-pvemo { font-size: 48px; line-height: 1; text-align: center; margin-bottom: 8px; }
body.ui-v3 .v3-row.h3-steprow { justify-content: space-between; }
/* Recipe page: hero band with the emoji, the body over its fade */
body.ui-v3 .h3-rhero {
  position: absolute; z-index: 0; top: 0; height: 290px; pointer-events: none; display: flex; justify-content: center; padding-top: 86px; box-sizing: border-box;
  left: calc(-1 * max(var(--v3-gutter), env(safe-area-inset-left, 0px))); right: calc(-1 * max(var(--v3-gutter), env(safe-area-inset-right, 0px)));
  background: linear-gradient(160deg, #D9A9B5, #8E2A44); color: rgba(255, 255, 255, .85);
}
body.ui-v3 .h3-rhero > span { font-size: 88px; line-height: 1; }
body.ui-v3 .h3-rhero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 110px; background: linear-gradient(180deg, transparent, var(--v3-ground)); }
body.ui-v3 .h3-rbody { margin-top: 176px; }
body.ui-v3 .h3-lead { margin-top: 4px; color: var(--v3-label2); }
body.ui-v3 .h3-facts { padding-inline: 0; }
body.ui-v3 .h3-rpanes { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 24px; align-items: start; margin-top: 14px; }
body.ui-v3 .h3-inghead, body.ui-v3 .h3-stephead { display: none; }
body.ui-v3 .h3-rpane > .h3-steps:first-of-type { margin-top: 0; }
@media (max-width: 899.98px) {
  body.ui-v3 .h3-rpanes[data-tab="ings"] .h3-rsteps, body.ui-v3 .h3-rpanes[data-tab="steps"] .h3-rings { display: none; }
}
@media (min-width: 900px) {
  body.ui-v3 .h3-rtabs { display: none; }
  body.ui-v3 .h3-rpanes { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); margin-top: 8px; }
  body.ui-v3 .h3-inghead, body.ui-v3 .h3-stephead { display: flex; }
}
@media (min-width: 768px) {
  body.ui-v3 .h3-rhero { height: 260px; padding-top: 60px; }
  body.ui-v3 .h3-rbody { margin-top: 150px; }
}
body.ui-v3 .h3-step { align-items: flex-start; }
body.ui-v3 .v3-row.h3-step { --v3-inset: 52px; }
body.ui-v3 .h3-stepno {
  flex: none; width: 24px; height: 24px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--v3-accent) 14%, transparent); color: var(--v3-accent-ink); font: 700 13px/1 var(--sans); font-variant-numeric: tabular-nums;
}
/* Summary for Julie */
body.ui-v3 .h3-sumcard { padding: 12px 16px; }
body.ui-v3 .h3-sumtext {
  display: block; width: 100%; box-sizing: border-box; margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none;
  color: var(--v3-label); font: 400 15px/21px var(--sans); letter-spacing: -.23px; resize: vertical;
}
body.ui-v3 .h3-sumtext:focus-visible { outline: 2px solid var(--v3-accent); outline-offset: 4px; border-radius: 4px; }
body.ui-v3 .h3-sumbtns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 768px) {
  body.ui-v3 .h3-sumbtns { display: flex; flex-wrap: wrap; }
  body.ui-v3 .h3-mealseg, body.ui-v3 .h3-storeseg { min-width: 280px; }
}
