/* Fonts are stored on our own server (scripts/fetch-fonts.js), no Google requests from the browser. */
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 600 800; font-display: swap; src: url("/fonts/bricolage-grotesque.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/fonts/figtree.woff2") format("woff2"); }

/* Base (on claude.ai the page skeleton provided these) */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
body { margin: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }

/* Layout: one column of tile grids — "To buy" on top, recent below, the full shelf of items after; a sticky header with the add field. */
:root {
  --bg: #EDF0E8;
  --surface: #F8FAF4;
  --ink: #17231B;
  --muted: #5C6A60;
  --line: #D3DBCF;
  --leaf: #2C6649;
  --tile: #E0E7DA;
  --tile-hover: #D5DECD;
  --on: #EAA52A;
  --on-ink: #2B1B00;
  --done: #D3DACD;
  --danger: #B3402E;
  --shadow: 0 1px 0 rgba(23, 35, 27, .08);
  --f-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --f-body: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111814; --surface: #19221C; --ink: #E5ECE3; --muted: #95A297; --line: #2A372F;
    --leaf: #74C196; --tile: #1F2A23; --tile-hover: #26332B; --on: #E3A02C; --on-ink: #241600;
    --done: #252F28; --danger: #E2715E; --shadow: 0 1px 0 rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111814; --surface: #19221C; --ink: #E5ECE3; --muted: #95A297; --line: #2A372F;
  --leaf: #74C196; --tile: #1F2A23; --tile-hover: #26332B; --on: #E3A02C; --on-ink: #241600;
  --done: #252F28; --danger: #E2715E; --shadow: 0 1px 0 rgba(0, 0, 0, .3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--f-body); font-size: 15px; line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 10; background: var(--bg);
}
.wrap {
  max-width: 760px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 40px;
}

/* Header */
header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  background: var(--bg);
  padding-block: 14px 12px;
  display: grid; gap: 12px;
}
.bar { display: flex; align-items: center; gap: 12px; }
.brand {
  font-family: var(--f-display); font-weight: 800; font-size: 30px; letter-spacing: -.02em;
  line-height: 1; margin: 0; display: flex; align-items: baseline; gap: 2px;
}
.brand i { font-style: normal; color: var(--on); }
.count {
  margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted);
  font-size: 14px;
}
.sync {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  padding: 4px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted);
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.sync::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.sync.live { color: var(--leaf); border-color: color-mix(in srgb, var(--leaf) 40%, var(--line)); }
.sync.live::before { background: var(--leaf); }

.add { position: relative; }
.add input {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px;
  padding: 13px 44px 13px 16px; box-shadow: var(--shadow);
}
.add input::placeholder { color: var(--muted); }
.add input:focus { outline: none; border-color: var(--leaf); }
.add .clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 10px; border: 0; background: transparent;
  color: var(--muted); font-size: 20px; cursor: pointer;
}

/* Sections */
section { margin-top: 22px; }
.sec-head { display: flex; align-items: baseline; gap: 10px; margin: 0 0 10px; }
h2 {
  font-family: var(--f-display); font-weight: 600; font-size: 13px; text-transform: uppercase;
  letter-spacing: .1em; color: var(--muted); margin: 0;
}
.sec-head .n { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sec-head button.link { margin-left: auto; }
button.link {
  border: 0; background: none; color: var(--leaf); font: inherit; font-weight: 600; font-size: 13px;
  cursor: pointer; padding: 4px 2px;
}

.grid {
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(98px, 1fr));
}
.tile {
  position: relative; aspect-ratio: 1 / 1; max-width: 100%;
  border: 0; border-radius: 14px; background: var(--tile); color: var(--ink);
  font: inherit; cursor: pointer; padding: 10px 6px 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  text-align: center; user-select: none; -webkit-user-select: none; touch-action: manipulation;
  transition: transform .12s ease, background-color .15s ease;
  min-width: 0;
}
.tile.press { transform: scale(.96); }
.tile:focus-visible { outline: 2.5px solid var(--leaf); outline-offset: 2px; }
.tile .em { font-size: 30px; line-height: 1; }
.tile .nm {
  font-weight: 600; font-size: 13.5px; line-height: 1.2; max-width: 100%;
  overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tile .sp {
  font-size: 12px; line-height: 1.2; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--muted);
}
.tile.on { background: var(--on); color: var(--on-ink); }
.tile.on .sp { color: var(--on-ink); opacity: .8; }
.tile.done { background: var(--done); }
.tile .qty {
  position: absolute; top: 6px; left: 6px; max-width: calc(100% - 34px);
  font-size: 11.5px; font-weight: 700; line-height: 1.5; padding: 0 7px; border-radius: 999px;
  background: color-mix(in srgb, var(--on-ink) 14%, transparent); color: var(--on-ink);
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.parts { display: grid; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.prow {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 30px; align-items: center; gap: 10px;
  padding: 8px 8px 8px 12px; border-bottom: 1px solid var(--line); background: var(--bg);
}
.prow:last-child { border-bottom: 0; }
.prow .t { min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .t small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.prow .q { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.prow button { width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; }
.prow button:hover { background: var(--tile); color: var(--danger); }
.prow button:focus-visible { outline: 2.5px solid var(--leaf); }
.prow.total { background: var(--surface); }
.prow.total .t { font-weight: 500; color: var(--muted); }
.grow { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 0 8px; }
.grow .ghead { margin: 0; min-width: 0; }
.qrow { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.sheet .qrow input { margin-top: 0; flex: 1; min-width: 0; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.qb {
  width: 46px; height: 46px; flex: none; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--bg); color: var(--ink); font-size: 20px; cursor: pointer;
}
.qb:focus-visible { outline: 2.5px solid var(--leaf); outline-offset: 2px; }
.sheet .chips { margin-top: 8px; }
.sheet select {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--bg);
  border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-top: 6px;
}
.sheet select:focus { outline: none; border-color: var(--leaf); }
.tile.done .em { filter: grayscale(.6); opacity: .8; }
.tile .who {
  position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%;
  font-size: 10px; font-weight: 700; display: grid; place-items: center;
  background: color-mix(in srgb, var(--on-ink) 14%, transparent); color: var(--on-ink);
}
.tile.new { background: transparent; border: 1.5px dashed var(--line); color: var(--leaf); }
.tile.new .em { font-family: var(--f-display); font-weight: 800; }
.tile.just { animation: pop .28s ease; }
@keyframes pop { 0% { transform: scale(.9); } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }

.empty {
  border: 1.5px dashed var(--line); border-radius: 16px; padding: 22px 18px;
  color: var(--muted); display: grid; gap: 4px;
}
.empty strong { color: var(--ink); font-family: var(--f-display); font-size: 18px; font-weight: 600; }

details.cat { border-top: 1px solid var(--line); }
details.cat:last-of-type { border-bottom: 1px solid var(--line); }
details.cat summary {
  list-style: none; cursor: pointer; padding: 14px 2px; display: flex; align-items: center; gap: 10px;
  font-weight: 600;
}
details.cat summary::-webkit-details-marker { display: none; }
details.cat summary::after {
  content: ""; margin-left: auto; width: 8px; height: 8px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform .15s ease;
}
details.cat[open] summary::after { transform: rotate(-135deg); }
details.cat summary .c { color: var(--muted); font-weight: 500; font-size: 13px; font-variant-numeric: tabular-nums; }

.hint { color: var(--muted); font-size: 13px; margin: 10px 2px 0; }

/* Sheet */
.scrim { position: fixed; inset: 0; background: rgba(10, 16, 12, .45); z-index: 20; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21;
  background: var(--surface); border-radius: 20px 20px 0 0;
  max-width: 560px; margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
  padding-block: 18px calc(20px + env(safe-area-inset-bottom, 0px));
  display: grid; gap: 14px;
}
.sheet .top { display: flex; align-items: center; gap: 12px; }
.sheet .top .em { font-size: 34px; }
.sheet h3 { font-family: var(--f-display); font-weight: 800; font-size: 22px; margin: 0; line-height: 1.1; }
.sheet label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.sheet input {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--bg);
  border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-top: 6px;
}
.sheet input:focus { outline: none; border-color: var(--leaf); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: 13px;
  border-radius: 999px; padding: 6px 12px; cursor: pointer;
}
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn {
  font: inherit; font-weight: 700; border-radius: 12px; padding: 12px 16px; cursor: pointer;
  border: 1.5px solid var(--line); background: transparent; color: var(--ink);
}
.btn.primary { background: var(--leaf); border-color: var(--leaf); color: var(--surface); flex: 1; }
.btn.danger { color: var(--danger); }
.btn:focus-visible, .chip:focus-visible, button.link:focus-visible { outline: 2.5px solid var(--leaf); outline-offset: 2px; }

/* Toast */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 30;
  background: var(--ink); color: var(--bg); border-radius: 12px; padding: 10px 10px 10px 16px;
  display: flex; align-items: center; gap: 14px; font-weight: 500; font-size: 14px;
  max-width: calc(100% - 32px); box-shadow: 0 6px 24px rgba(0,0,0,.2);
}
.toast button { border: 0; background: none; color: var(--on); font: inherit; font-weight: 700; cursor: pointer; padding: 6px 8px; }

/* Sign-off */
.slogan {
  margin-top: 44px; padding-block: 26px 8px; border-top: 1px solid var(--line);
  text-align: center; font-family: var(--f-display); line-height: 1.05; color: var(--muted);
  font-size: clamp(22px, 6vw, 30px); font-weight: 600; letter-spacing: -.01em; text-wrap: balance;
}
.slogan strong { color: var(--ink); font-weight: 800; }
.slogan i { font-style: normal; color: var(--on); }

/* View toggle */
.vt {
  margin-left: auto; align-self: center; display: inline-flex;
  border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden;
}
.vt button {
  width: 36px; height: 30px; border: 0; background: transparent; color: var(--muted);
  display: grid; place-items: center; cursor: pointer;
}
.vt button + button { border-left: 1.5px solid var(--line); }
.vt button svg { width: 16px; height: 16px; }
.vt button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.vt button:focus-visible { outline: 2.5px solid var(--leaf); outline-offset: -2px; }

/* List view: the same tiles laid out as rows, in the same colours as the tiles */
.view-list .grid {
  grid-template-columns: 1fr; gap: 3px;
  background: transparent; border-radius: 14px; overflow: hidden;
}
.view-list .tile {
  aspect-ratio: auto; min-height: 56px; border-radius: 0; background: var(--tile);
  padding: 8px 12px; text-align: left;
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto auto;
  grid-template-areas: "mark em nm qty who ed" "mark em sp qty who ed"; grid-template-rows: auto auto;
  align-items: center; align-content: center; justify-items: start; column-gap: 0; row-gap: 0;
}
/* rows without a note have one line, so the name sits exactly in the middle */
.view-list .tile:not(:has(.sp)) { grid-template-areas: "mark em nm qty who ed"; grid-template-rows: auto; }
.view-list .tile.press { transform: none; filter: brightness(.94); }
.view-list .tile.on { background: var(--on); color: var(--on-ink); }
.view-list .tile.done { background: var(--done); }
.view-list .tile::before {
  content: "+"; grid-area: mark; width: 24px; height: 24px; border-radius: 50%; margin-right: 12px;
  display: grid; place-items: center; box-sizing: border-box;
  border: 1.5px dashed color-mix(in srgb, var(--ink) 30%, transparent); color: var(--leaf); font-weight: 800; font-size: 15px; line-height: 1;
  background: var(--bg);
}
.view-list .tile.on::before { content: ""; border: 2px solid color-mix(in srgb, var(--on-ink) 55%, transparent); background: var(--bg); }
.view-list .tile.done::before { content: "✓"; border: 0; background: var(--leaf); color: var(--surface); font-size: 13px; }
.view-list .tile.done .nm { text-decoration: line-through; color: var(--muted); }
.view-list .tile .em { grid-area: em; font-size: 22px; width: 28px; text-align: center; margin-right: 10px; }
.view-list .tile .nm { grid-area: nm; font-size: 15px; align-self: center; -webkit-line-clamp: 2; }
.view-list .tile .sp { grid-area: sp; align-self: start; margin-top: 1px; color: var(--muted); opacity: 1; font-size: 12.5px; max-width: 100%; }
.view-list .tile.on .sp { color: var(--on-ink); opacity: .75; }
.view-list .tile .qty {
  grid-area: qty; position: static; margin-left: 10px; max-width: 40vw;
  background: var(--surface); color: var(--ink); font-size: 13px; padding: 2px 9px;
}
.view-list .tile.on .qty { background: color-mix(in srgb, var(--on-ink) 14%, transparent); color: var(--on-ink); }
.view-list .tile .who { grid-area: who; position: static; margin-left: 8px; }
details.cat .grid { margin-bottom: 14px; }
.tile .ed { display: none; }
.view-list .tile .ed {
  grid-area: ed; display: grid; place-items: center; width: 36px; height: 36px; margin: -4px -6px -4px 6px;
  border-radius: 10px; color: var(--muted);
}
.view-list .tile .ed svg { width: 16px; height: 16px; }
.view-list .tile.on .ed { color: var(--on-ink); }
.view-list details.cat .grid { padding-bottom: 0; }

/* Suggestions dropdown */
.sugg {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 6;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px;
  box-shadow: 0 12px 32px rgba(10, 16, 12, .16); padding: 6px;
  max-height: min(60vh, 440px); overflow-y: auto; overscroll-behavior: contain;
  display: grid; gap: 2px;
}
.sopt {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 10px; cursor: pointer; user-select: none; -webkit-user-select: none;
}
.sopt[aria-selected="true"] { background: var(--tile); box-shadow: inset 3px 0 0 var(--leaf); }
.sopt .e { font-size: 22px; text-align: center; line-height: 1; }
.sopt .tx { min-width: 0; display: grid; }
.sopt .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sopt .s { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sopt .b { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 8px; background: var(--on); color: var(--on-ink); white-space: nowrap; }
.sopt .b.soft { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.sopt.new .e { color: var(--leaf); font-family: var(--f-display); font-weight: 800; }
.sopt.new .t { font-weight: 500; }
.sugg .kbd { color: var(--muted); font-size: 12px; padding: 4px 10px 2px; }
@media (hover: none) { .sugg .kbd { display: none; } }

/* Sorting */
.sortbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 12px; }
.sortbar .chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.sortbar .link { margin-left: auto; }
.groups { display: grid; gap: 18px; }
.ghead {
  display: flex; align-items: baseline; gap: 8px; margin: 0 0 8px;
  font-family: var(--f-display); font-weight: 600; font-size: 17px; line-height: 1.2;
}
.ghead .n { color: var(--muted); font-family: var(--f-body); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.ghead.loose { color: var(--muted); }
.arow { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.arow:last-child { border-bottom: 0; }
.arow .pos { width: 22px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.arow .lbl { flex: 1; min-width: 0; font-weight: 600; }
.arow button {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg);
  color: var(--ink); font-size: 16px; cursor: pointer;
}
.arow button:disabled { opacity: .3; cursor: default; }
.arow button:focus-visible { outline: 2.5px solid var(--leaf); outline-offset: 1px; }

/* Recipes */
.rbtn {
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 700; font-size: 14px; border-radius: 999px; padding: 7px 14px;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.rbtn:hover { border-color: var(--leaf); }
.rbtn:focus-visible, .x:focus-visible { outline: 2.5px solid var(--leaf); outline-offset: 2px; }
.rbtn svg { width: 16px; height: 16px; }
.sheet.big { max-width: 640px; max-height: 90vh; max-height: 90dvh; overflow-y: auto; overscroll-behavior: contain; }
.sheet .top .x {
  margin-left: auto; width: 36px; height: 36px; border-radius: 10px; border: 0; background: var(--bg);
  color: var(--muted); font-size: 22px; cursor: pointer; flex: none;
}
.sheet .sub { color: var(--muted); font-size: 14px; margin: 0; }
.sheet textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--bg);
  border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-top: 6px;
  min-height: 120px; resize: vertical;
}
.sheet textarea:focus { outline: none; border-color: var(--leaf); }
.rview { display: grid; gap: 14px; }
.pick {
  border: 1.5px dashed var(--line); border-radius: 14px; background: transparent; color: var(--ink);
  font: inherit; padding: 16px; display: flex; align-items: center; gap: 12px; cursor: pointer; text-align: left;
}
.pick:hover { border-color: var(--leaf); }
.pick .plus {
  width: 38px; height: 38px; border-radius: 10px; background: var(--leaf); color: var(--surface);
  display: grid; place-items: center; font-family: var(--f-display); font-weight: 800; font-size: 22px; flex: none;
}
.pick small { display: block; color: var(--muted); font-size: 13px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.thumbs img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.rlist { display: grid; gap: 6px; margin-top: 6px; }
.rlist button {
  display: flex; align-items: center; gap: 10px; text-align: left; width: 100%;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit;
  border-radius: 12px; padding: 10px 12px; cursor: pointer;
}
.rlist button:hover { border-color: var(--leaf); }
.rlist .t { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rlist .m { margin-left: auto; color: var(--muted); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.busy { display: flex; align-items: center; gap: 12px; color: var(--muted); padding-block: 22px; flex-wrap: wrap; }
.busy .btn { margin-left: auto; }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--leaf); animation: spin .9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.err { color: var(--danger); font-size: 14px; margin: 0; }
.rmeta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rmeta input { margin-top: 0; flex: 1 1 220px; font-family: var(--f-display); font-weight: 600; font-size: 18px; }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; }
.stepper button { width: 36px; height: 36px; border: 0; background: none; color: var(--ink); font-size: 18px; cursor: pointer; border-radius: 50%; }
.stepper button:focus-visible { outline: 2.5px solid var(--leaf); }
.stepper span { min-width: 84px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; font-size: 14px; }
.ask {
  background: color-mix(in srgb, var(--on) 18%, var(--surface)); border-radius: 14px; padding: 14px;
  display: grid; gap: 10px;
}
.ask strong { font-family: var(--f-display); font-size: 17px; font-weight: 600; }
.ask .seg { display: flex; flex-wrap: wrap; gap: 6px; }
.ask .seg .chip.active { background: var(--leaf); border-color: var(--leaf); color: var(--surface); }
h4.grp {
  font-family: var(--f-display); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); margin: 4px 0 0; display: flex; gap: 8px;
}
.ings { display: grid; }
.sheet .ing {
  display: grid; grid-template-columns: 24px 28px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 10px 2px; border-bottom: 1px solid var(--line); cursor: pointer;
  text-transform: none; letter-spacing: 0; font-size: 15px; font-weight: 400; color: var(--ink);
}
.ing:last-child { border-bottom: 0; }
.ing input { width: 20px; height: 20px; margin: 0; accent-color: var(--leaf); }
.ing .e { font-size: 22px; text-align: center; }
.ing .nm2 { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.ing .nm2 b { font-weight: 600; }
.ing .note { color: var(--muted); font-size: 13px; }
.ing .onl { font-size: 11px; font-weight: 700; color: var(--on-ink); background: var(--on); border-radius: 999px; padding: 1px 7px; }
.ing .amt { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.ing.off .nm2 b, .ing.off .amt { opacity: .55; }
.sticky-actions { position: sticky; bottom: 0; background: var(--surface); padding-block: 10px 2px; }
.btn:disabled { opacity: .5; cursor: default; }

@media (prefers-reduced-motion: reduce) {
  .spin { animation-duration: 2.4s; }
  .tile, details.cat summary::after { transition: none; }
  .tile.just { animation: none; }
}
@media (max-width: 420px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .brand { font-size: 26px; }
  .count { display: none; }
  .rbtn { margin-left: auto; }
}

/* ---------- Self-hosted additions: account, household, offline ---------- */
.sync.off { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.sync.off::before { background: var(--danger); }
.hbtn {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  font-family: var(--f-display); font-weight: 800; font-size: 16px; cursor: pointer;
}
.hbtn:hover { border-color: var(--leaf); }
.hbtn:focus-visible { outline: 2.5px solid var(--leaf); outline-offset: 2px; }
@media (max-width: 420px) { .bar { gap: 8px; } .rbtn { padding: 7px 11px; } }

.auth {
  min-height: 100vh; min-height: 100dvh; display: grid; align-content: center; justify-items: center; gap: 18px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 32px;
}
.acard {
  width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: 26px 22px; display: grid; gap: 14px; box-shadow: 0 10px 40px rgba(10, 16, 12, .08);
}
.brand.big { font-size: 42px; margin-bottom: 4px; }
.acard h2 {
  font-family: var(--f-display); font-weight: 800; font-size: 24px; text-transform: none; letter-spacing: -.01em;
  color: var(--ink); margin: 0 0 4px; text-wrap: balance;
}
#authBody { display: grid; gap: 12px; }
.acard .sub, .sheet .sub { color: var(--muted); margin: 0; }
.aform { display: grid; gap: 6px; }
.aform label, .hsec > label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-top: 6px; }
.aform input, .inline input, .stack input, .linkbox input {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--bg);
  border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
.aform input:focus, .inline input:focus, .stack input:focus, .linkbox input:focus { outline: none; border-color: var(--leaf); }
.aform .btn { margin-top: 10px; }
.acard .link { justify-self: start; }
.fine { color: var(--muted); font-size: 13px; line-height: 1.45; margin: 0; }
.slogan.small { margin: 0; border: 0; padding: 0; font-size: 20px; }
.hsec { display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.hsec:first-of-type { border-top: 0; padding-top: 0; }
.inline { display: flex; gap: 8px; }
.inline input { flex: 1; min-width: 0; }
.stack { display: grid; gap: 8px; }
.linkbox { display: grid; gap: 8px; padding: 12px; border-radius: 14px; background: color-mix(in srgb, var(--on) 16%, var(--surface)); }
.prow .t small { display: inline; color: var(--muted); font-size: 12px; font-weight: 500; margin-left: 4px; }
.macts { display: flex; gap: 10px; }
.link.danger { color: var(--danger); }
/* member rows: name left, actions right; actions move below the name when space runs out */
#hMembers .prow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 10px 12px; }
#hMembers .prow .t { flex: 1 1 150px; white-space: normal; }
#hMembers .prow .q:empty { display: none; }
.macts { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.macts button, .prow .macts button {
  width: auto; height: auto; border-radius: 6px; padding: 4px 0; background: none;
  font: inherit; font-weight: 600; font-size: 14px; white-space: nowrap; color: var(--leaf);
}
.prow .macts button.danger { color: var(--danger); }
.prow .macts button:hover { background: none; text-decoration: underline; }

a.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }

/* symbol picker for own items */
.emgrid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 4px; margin-top: 6px;
  max-height: 148px; overflow-y: auto; overscroll-behavior: contain;
  padding: 4px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--bg);
}
.emgrid button {
  height: 42px; border: 0; border-radius: 10px; background: transparent; font-size: 22px; line-height: 1; cursor: pointer;
}
.emgrid button[aria-pressed="true"] { background: color-mix(in srgb, var(--on) 35%, var(--surface)); box-shadow: inset 0 0 0 2px var(--on); }
.emgrid button:focus-visible { outline: 2.5px solid var(--leaf); outline-offset: -2px; }

/* sheets scroll on their own; the page behind them does not move */
.scrim { touch-action: none; overscroll-behavior: contain; }
.sheet { overscroll-behavior: contain; }

/* theme switch in the menu */
.seg.theme { display: flex; flex-wrap: wrap; gap: 6px; }
.seg.theme .chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* Hover colours only where there is a real mouse. On phones a finger that starts a scroll
   would otherwise leave items "hovered" in another colour. Press feedback comes from the .press class (app.js). */
@media (hover: hover) and (pointer: fine) {
  .tile:hover { background: var(--tile-hover); }
  .tile.on:hover { background: color-mix(in srgb, var(--on) 88%, var(--ink)); }
  .view-list .tile:hover { background: var(--tile-hover); }
  .view-list .tile.on:hover { background: color-mix(in srgb, var(--on) 88%, var(--ink)); }
  .view-list .tile.done:hover { background: var(--tile-hover); }
  .view-list .tile .ed:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }
  .view-list .tile.on .ed:hover { background: color-mix(in srgb, var(--on-ink) 12%, transparent); color: var(--on-ink); }
  .sopt:hover { background: var(--tile-hover); }
  .emgrid button:hover { background: var(--tile); }
}
