@font-face {
  font-family: 'Rethink Sans';
  src: url('/fonts/rethink-sans.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('/fonts/fraunces.woff2') format('woff2');
  font-weight: 500 800;
  font-display: swap;
}

:root {
  --paper: #f4efe3;
  --paper-2: #ebe4d4;
  --card: #fbf8f1;
  --ink: #1f2a22;
  --ink-2: #566158;
  --ink-3: #8a9289;
  --line: #d9d0bd;
  --accent: #1f4d33;
  --accent-ink: #f4efe3;
  --accent-soft: #dfe9df;
  --tomato: #d9472f;
  --butter: #f2c14e;
  --shadow: 0 1px 0 rgba(31, 42, 34, .04), 0 10px 30px -12px rgba(31, 42, 34, .25);
  --tag-l: 87%;
  --tag-s: 46%;
  --tag-ink-l: 24%;
  --radius: 18px;
  --composer-h: 76px;
  --kb: 0px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #111a14;
    --paper-2: #18231c;
    --card: #1b271f;
    --ink: #ece6d8;
    --ink-2: #b4baae;
    --ink-3: #7c867d;
    --line: #2c3a30;
    --accent: #9fd5b0;
    --accent-ink: #10180f;
    --accent-soft: #223428;
    --tomato: #ff7a62;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 14px 34px -14px rgba(0, 0, 0, .7);
    --tag-l: 22%;
    --tag-s: 26%;
    --tag-ink-l: 84%;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #111a14; --paper-2: #18231c; --card: #1b271f; --ink: #ece6d8; --ink-2: #b4baae; --ink-3: #7c867d;
  --line: #2c3a30; --accent: #9fd5b0; --accent-ink: #10180f; --accent-soft: #223428; --tomato: #ff7a62;
  --tag-l: 22%; --tag-s: 26%; --tag-ink-l: 84%; color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.35 'Rethink Sans', ui-rounded, -apple-system, system-ui, sans-serif;
  overscroll-behavior-y: none;
}
/* faint paper grain */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.12 0 0 0 0 0.16 0 0 0 0 0.13 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
svg { display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.app {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 0 calc(var(--composer-h) + env(safe-area-inset-bottom) + 24px);
}

/* ---------- header ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.top.scrolled { border-bottom-color: var(--line); }
.top-row { display: flex; align-items: center; gap: 10px; }
.title {
  margin: 0;
  font: 750 34px/1 'Fraunces', Georgia, serif;
  font-variation-settings: 'opsz' 144;
  letter-spacing: -.02em;
}
.title em { font-style: normal; color: var(--accent); }
.sync {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--ink-3);
  margin-top: 6px;
  transition: background .3s;
}
.sync.live { background: #3fa66b; box-shadow: 0 0 0 4px color-mix(in srgb, #3fa66b 20%, transparent); }
.sync.wait { background: var(--butter); }
.sync.off { background: var(--tomato); }
.icon-btn {
  margin-left: auto;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--ink);
}
.icon-btn svg { width: 22px; height: 22px; fill: currentColor; }
.icon-btn:active { background: var(--paper-2); }

.mode {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 12px;
  padding: 4px;
  border-radius: 999px;
  background: var(--paper-2);
}
.mode-btn {
  position: relative; z-index: 1;
  height: 36px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink-2);
  transition: color .25s;
}
.mode-btn[aria-checked="true"] { color: var(--accent-ink); }
.mode-thumb {
  position: absolute; top: 4px; bottom: 4px; left: 4px;
  width: calc(50% - 4px);
  border-radius: 999px;
  background: var(--accent);
  transition: transform .32s cubic-bezier(.3, 1.4, .5, 1);
}
.mode[data-mode="topup"] .mode-thumb { transform: translateX(100%); }

.progress { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.progress-track { flex: 1; height: 6px; border-radius: 99px; background: var(--paper-2); overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--tomato); border-radius: 99px; transition: width .4s cubic-bezier(.2, .8, .2, 1); }
.progress-text { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- suggestions ---------- */
.suggest { padding: 6px 0 2px; }
.suggest-head { display: flex; align-items: baseline; gap: 14px; padding: 0 16px; }
.suggest-title { margin: 0; font: 650 17px/1.2 'Fraunces', Georgia, serif; font-variation-settings: 'opsz' 40; }
.suggest-title small { font: 400 13px 'Rethink Sans', sans-serif; color: var(--ink-3); margin-left: 6px; }
.link-btn { font-size: 14px; font-weight: 700; color: var(--accent); padding: 6px 0; }
#suggest-all { margin-left: auto; }
#suggest-hide { color: var(--ink-3); }
.chips {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding: 8px 16px 10px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 14px 0 10px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 15px;
  white-space: nowrap;
  scroll-snap-align: start;
  transition: transform .15s, opacity .2s;
}
.chip:active { transform: scale(.96); }
.chip .plus { color: var(--accent); font-weight: 700; font-size: 18px; line-height: 1; }
.chip small { color: var(--ink-3); font-size: 12px; }
.chip.gone { opacity: 0; transform: scale(.8); }

/* ---------- list ---------- */
.list { padding: 4px 12px 0; }
.dept { margin-top: 18px; animation: rise .45s cubic-bezier(.2, .8, .2, 1) backwards; }
.dept:nth-child(2) { animation-delay: .03s; }
.dept:nth-child(3) { animation-delay: .06s; }
.dept:nth-child(4) { animation-delay: .09s; }
.dept:nth-child(n+5) { animation-delay: .12s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.dept-label {
  --h: 120;
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 0 6px 4px;
  padding: 5px 12px 5px 10px;
  border-radius: 8px 999px 999px 8px;
  background: hsl(var(--h) var(--tag-s) var(--tag-l));
  color: hsl(var(--h) 40% var(--tag-ink-l));
  font: 700 13px/1 'Rethink Sans', sans-serif;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.dept-label::before {
  content: '';
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--paper);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, .15);
}
.dept-label .emoji { font-size: 15px; letter-spacing: 0; }
.dept-label .count { opacity: .7; font-variant-numeric: tabular-nums; }
.dept[data-dept="fruitveg"] .dept-label { --h: 110; }
.dept[data-dept="bakery"] .dept-label { --h: 36; }
.dept[data-dept="meat"] .dept-label { --h: 4; }
.dept[data-dept="fish"] .dept-label { --h: 200; }
.dept[data-dept="dairy"] .dept-label { --h: 48; }
.dept[data-dept="chilled"] .dept-label { --h: 170; }
.dept[data-dept="cupboard"] .dept-label { --h: 22; }
.dept[data-dept="snacks"] .dept-label { --h: 320; }
.dept[data-dept="drinks"] .dept-label { --h: 188; }
.dept[data-dept="frozen"] .dept-label { --h: 212; }
.dept[data-dept="household"] .dept-label { --h: 230; }
.dept[data-dept="health"] .dept-label { --h: 340; }
.dept[data-dept="baby"] .dept-label { --h: 14; }
.dept[data-dept="pets"] .dept-label { --h: 30; }
.dept[data-dept="other"] .dept-label { --h: 90; --tag-s: 8%; }

.items {
  list-style: none; margin: 0; padding: 0 4px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.item {
  position: relative;
  display: grid;
  grid-template-columns: 48px 1fr 40px;
  align-items: center;
  min-height: 56px;
  border-bottom: 1px dashed var(--line);
  background: var(--card);
  touch-action: pan-y;
}
.item:last-child { border-bottom: 0; }
.item:first-child { border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); }
.item:last-child { border-bottom-left-radius: var(--radius); border-bottom-right-radius: var(--radius); }
.item.new { animation: pop-in .5s cubic-bezier(.2, 1.3, .4, 1); }
@keyframes pop-in { from { opacity: 0; transform: scale(.96); background: var(--accent-soft); } }
.item.flash { animation: flash 1.2s ease; }
@keyframes flash { 0%, 40% { background: color-mix(in srgb, var(--butter) 35%, var(--card)); } }

.tick {
  width: 48px; height: 56px;
  display: grid; place-items: center;
}
.tick i {
  position: relative;
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--ink-3);
  transition: background .2s, border-color .2s, transform .2s;
}
.tick i::after {
  content: '';
  position: absolute; left: 7px; top: 3px;
  width: 6px; height: 12px;
  border: solid #fff; border-width: 0 2.6px 2.6px 0;
  transform: rotate(45deg) scale(0);
  transition: transform .25s cubic-bezier(.3, 1.6, .5, 1) .05s;
}
.item.checked .tick i { background: var(--tomato); border-color: var(--tomato); animation: tickpop .35s cubic-bezier(.3, 1.6, .5, 1); }
.item.checked .tick i::after { transform: rotate(45deg) scale(1); }
@keyframes tickpop { 50% { transform: scale(1.18); } }

.body { min-width: 0; padding: 8px 0; text-align: left; }
.name-line { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.name {
  position: relative;
  font-size: 18px;
  overflow-wrap: anywhere;
  transition: color .3s;
}
.name::after {
  content: '';
  position: absolute; left: -2px; right: -2px; top: 54%;
  height: 2px; border-radius: 2px;
  background: currentColor;
  transform: scaleX(0); transform-origin: left;
  transition: transform .35s cubic-bezier(.6, 0, .2, 1);
}
.item.checked .name { color: var(--ink-3); }
.item.checked .name::after { transform: scaleX(1); }
.item.checked .qty, .item.checked .meta { opacity: .55; }
.qty {
  flex: none;
  font-size: 13px; font-weight: 700;
  padding: 2px 7px; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 2px; font-size: 13px; color: var(--ink-3); }
.meta .who {
  display: inline-grid; place-items: center;
  width: 18px; height: 18px; border-radius: 50%;
  font-size: 10px; font-weight: 700;
  background: var(--paper-2); color: var(--ink-2);
}
.meta .sorting { color: var(--accent); }
.meta .sorting::before { content: '✦ '; animation: twinkle 1s infinite alternate; }
@keyframes twinkle { to { opacity: .3; } }
.meta .unsorted { color: var(--tomato); }
.handle {
  width: 40px; height: 56px;
  display: grid; place-items: center;
  color: var(--ink-3);
  touch-action: none;
  cursor: grab;
}
.handle svg { width: 16px; height: 16px; fill: currentColor; opacity: .7; }

.item.dragging {
  z-index: 30;
  box-shadow: 0 18px 40px -10px rgba(0, 0, 0, .35);
  border-radius: 14px;
  border-bottom-color: transparent;
  transform: scale(1.02);
  transition: none;
}
.drag-gap { height: 56px; border-bottom: 1px dashed var(--line); background: var(--paper-2); }
.dept.drop-target .items { outline: 2px dashed var(--accent); outline-offset: 2px; }

/* ---------- empty ---------- */
.empty { text-align: center; padding: 48px 32px 0; color: var(--ink-2); animation: rise .5s both; }
.empty-art svg { width: 96px; height: 96px; margin: 0 auto 8px; fill: var(--card); stroke: var(--line); stroke-width: 4; stroke-linecap: round; }
.empty-title { margin: 0 0 6px; font: 650 22px/1.2 'Fraunces', Georgia, serif; color: var(--ink); }
.empty-sub { margin: 0; font-size: 15px; line-height: 1.5; }

/* ---------- composer ---------- */
.composer {
  position: fixed; z-index: 25;
  left: 0; right: 0; bottom: 0;
  padding: 10px 12px calc(env(safe-area-inset-bottom) + 10px);
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(16px);
  backdrop-filter: saturate(1.4) blur(16px);
  border-top: 1px solid var(--line);
  transform: translateY(calc(-1 * var(--kb)));
}
.composer > * { max-width: 616px; margin-left: auto; margin-right: auto; }
.add-form { display: flex; align-items: center; gap: 6px; }
.field { flex: 1; min-width: 0; }
.field input {
  width: 100%;
  height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--card);
  font-size: 17px; /* 16px+ stops iOS zooming in */
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.field input::placeholder { color: var(--ink-3); }
.tool-btn {
  flex: none;
  width: 44px; height: 48px;
  display: grid; place-items: center;
  color: var(--ink-2);
  border-radius: 14px;
}
.tool-btn svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tool-btn:active { background: var(--paper-2); }
.tool-btn.mic { width: 48px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); }
.tool-btn.mic svg { stroke-width: 2; }
.tool-btn.busy { opacity: .5; pointer-events: none; }
.send-btn {
  flex: none;
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--tomato); color: #fff;
  animation: pop-in .25s;
}
.send-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.rec {
  display: flex; align-items: center; gap: 10px;
  height: 48px; margin-bottom: 8px; padding: 0 6px 0 16px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tomato) 14%, var(--card));
  border: 1.5px solid color-mix(in srgb, var(--tomato) 40%, transparent);
}
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--tomato); animation: pulse 1.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--tomato) 60%, transparent); } 100% { box-shadow: 0 0 0 12px transparent; } }
.rec-label { font-weight: 700; }
.rec-time { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.rec-cancel { margin-left: auto; padding: 0 12px; height: 36px; color: var(--ink-2); font-weight: 700; }
.rec-stop { height: 36px; padding: 0 18px; border-radius: 999px; background: var(--tomato); color: #fff; font-weight: 700; }
.rec.working .rec-dot { animation: none; background: var(--accent); }

/* ---------- toasts ---------- */
.toasts {
  position: fixed; z-index: 60;
  left: 12px; right: 12px;
  bottom: calc(var(--composer-h) + env(safe-area-inset-bottom) + 12px + var(--kb));
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 14px;
  max-width: 560px; width: max-content;
  padding: 12px 16px;
  border-radius: 16px;
  background: #1f2a22; color: #f4efe3;
  box-shadow: 0 14px 34px -10px rgba(0, 0, 0, .45);
  font-size: 15px; line-height: 1.35;
  animation: toast-in .35s cubic-bezier(.2, 1.2, .4, 1);
}
.toast.out { animation: toast-out .25s forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }
.toast button { flex: none; color: var(--butter); font-weight: 700; padding: 4px 0; }
.toast.ai { background: #13321f; }
.toast .ai-cost { display: block; margin-top: 2px; font-size: 13px; color: #b9d9c3; font-variant-numeric: tabular-nums; }

/* ---------- sheets ---------- */
.backdrop {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(17, 26, 20, .38);
  animation: fade .25s;
}
.backdrop.out { animation: fade .2s reverse forwards; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; z-index: 71;
  left: 0; right: 0; bottom: 0;
  max-width: 640px; margin: 0 auto;
  max-height: calc(92dvh - env(safe-area-inset-top));
  display: flex; flex-direction: column;
  background: var(--paper);
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -20px 50px -20px rgba(0, 0, 0, .4);
  padding-bottom: calc(env(safe-area-inset-bottom) + var(--kb));
  animation: sheet-in .38s cubic-bezier(.2, 1, .3, 1);
}
.sheet.out { animation: sheet-out .22s ease-in forwards; }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes sheet-out { to { transform: translateY(100%); } }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 10px 20px 6px; flex: none; }
.sheet-title { margin: 0; font: 700 24px/1.15 'Fraunces', Georgia, serif; font-variation-settings: 'opsz' 72; }
.sheet-close { margin-left: auto; width: 36px; height: 36px; border-radius: 50%; background: var(--paper-2); display: grid; place-items: center; font-size: 20px; color: var(--ink-2); }
.sheet-body { overflow-y: auto; padding: 6px 20px 16px; -webkit-overflow-scrolling: touch; }
.sheet-foot { display: flex; gap: 10px; padding: 10px 20px 14px; flex: none; border-top: 1px solid var(--line); }
.sheet p { line-height: 1.45; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 20px;
  border-radius: 14px;
  font-weight: 700; font-size: 17px;
  background: var(--paper-2); color: var(--ink);
  transition: transform .12s, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.danger { background: var(--tomato); color: #fff; }
.btn.grow { flex: 1; }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 15px; border-radius: 11px; }

.menu-list { list-style: none; margin: 0; padding: 0; }
.menu-list button {
  width: 100%;
  display: flex; align-items: center; gap: 14px;
  min-height: 56px; padding: 6px 4px;
  border-bottom: 1px dashed var(--line);
  text-align: left; font-size: 17px;
}
.menu-list li:last-child button { border-bottom: 0; }
.menu-list .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--paper-2); font-size: 18px; flex: none; }
.menu-list .sub { display: block; font-size: 13px; color: var(--ink-3); margin-top: 1px; }
.menu-list .danger { color: var(--tomato); }

.form-row { margin: 14px 0; }
.form-row > label, .form-label { display: block; font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.text-in, .text-area {
  width: 100%;
  min-height: 50px; padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--card);
  font-size: 17px;
  outline: none;
}
.text-area { min-height: 160px; resize: vertical; line-height: 1.4; }
.text-in:focus, .text-area:focus { border-color: var(--accent); }
.stepper { display: inline-flex; align-items: center; border-radius: 14px; background: var(--card); border: 1.5px solid var(--line); }
.stepper button { width: 50px; height: 48px; font-size: 22px; font-weight: 700; color: var(--accent); }
.stepper output { min-width: 40px; text-align: center; font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.dept-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.dept-pick {
  display: flex; align-items: center; gap: 8px;
  min-height: 46px; padding: 6px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--card);
  font-size: 15px; text-align: left;
}
.dept-pick[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.check-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); font-size: 15px; }
.check-row input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); flex: none; }

/* review list for voice / photo */
.heard { margin: 0 0 12px; padding: 12px 14px; border-radius: 14px; background: var(--paper-2); font-size: 15px; color: var(--ink-2); }
.heard b { color: var(--ink); }
.review { list-style: none; margin: 0; padding: 0; }
.review li { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.review li:last-child { border-bottom: 0; }
.review input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--accent); margin: 0; }
.review .r-name { width: 100%; border: 0; background: transparent; font-size: 17px; padding: 4px 0; outline: none; border-bottom: 1px solid transparent; }
.review .r-name:focus { border-bottom-color: var(--accent); }
.review .r-sub { font-size: 13px; color: var(--ink-3); }
.review .r-dup { grid-column: 2 / 4; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--tomato); }
.seg { display: inline-flex; border-radius: 10px; background: var(--paper-2); padding: 3px; }
.seg button { padding: 6px 12px; border-radius: 8px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.qty-mini { font-size: 14px; font-weight: 700; color: var(--accent); white-space: nowrap; }

/* settings */
.set-section { margin: 22px 0 8px; font: 700 19px 'Fraunces', Georgia, serif; }
.card { background: var(--card); border-radius: 16px; padding: 4px 14px; box-shadow: var(--shadow); }
.row { display: flex; align-items: center; gap: 10px; min-height: 52px; border-bottom: 1px dashed var(--line); }
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .val { color: var(--ink-2); font-size: 15px; }
.row select, .row input[type="number"] { border: 1.5px solid var(--line); background: var(--paper); border-radius: 10px; padding: 8px 10px; font-size: 16px; max-width: 60%; }
.row input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--accent); }
.mini-btn { width: 34px; height: 34px; border-radius: 10px; background: var(--paper-2); font-weight: 700; color: var(--ink-2); flex: none; }
.meter { height: 10px; border-radius: 99px; background: var(--paper-2); overflow: hidden; margin: 10px 0 6px; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.meter.hot i { background: var(--tomato); }
.big-num { font: 750 30px/1 'Fraunces', Georgia, serif; font-variant-numeric: tabular-nums; }
.usage-log { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.usage-log li { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.usage-log li:last-child { border-bottom: 0; }
.usage-log .u-top { display: flex; gap: 8px; font-weight: 700; }
.usage-log .u-top span:last-child { margin-left: auto; font-variant-numeric: tabular-nums; }
.usage-log .u-det { color: var(--ink-2); margin-top: 2px; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; word-break: break-all; background: var(--paper-2); padding: 10px 12px; border-radius: 10px; }
.export-box { white-space: pre-wrap; font-size: 16px; line-height: 1.5; max-height: 40vh; overflow: auto; }
.tesco-links { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 14px; }
.tesco-links a { display: block; padding: 7px 0; color: var(--accent); font-weight: 700; text-decoration: none; break-inside: avoid; }

/* ---------- gate (join / who are you) ---------- */
.gate { position: relative; z-index: 1; min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.gate-card { width: 100%; max-width: 420px; text-align: center; animation: rise .5s both; }
.gate-card img { width: 88px; height: 88px; border-radius: 22px; box-shadow: var(--shadow); }
.gate-card h1 { font: 750 34px/1.1 'Fraunces', Georgia, serif; margin: 18px 0 8px; }
.gate-card p { color: var(--ink-2); line-height: 1.5; }
.who-grid { display: grid; gap: 10px; margin-top: 20px; }
.who-grid .btn { min-height: 58px; font-size: 19px; }
.install-tip { margin: 0 12px 4px; padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); color: var(--ink); font-size: 14px; line-height: 1.45; display: flex; gap: 10px; align-items: flex-start; }
.install-tip button { margin-left: auto; color: var(--ink-3); font-weight: 700; }

@media (min-width: 700px) {
  .list { padding-top: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
