/* Layout: a shared fridge door. Home is a board of pinned cards, every section sits one tap away
   in the menu, and each person carries their own colour so you can see who added what. */
:root {
  --paper: #eef2f0;
  --card: #ffffff;
  --sunk: #f5f7f6;
  --ink: #1b2430;
  --muted: #5d6a76;
  --line: #dbe2df;
  --accent: #2a55cf;
  --accent-soft: #e3e9fb;
  --on-accent: #ffffff;
  --good: #23845a;
  --good-soft: #def2e8;
  --warn: #a8700a;
  --warn-soft: #faefd6;
  --bad: #c13d36;
  --bad-soft: #fbe3e1;
  --shadow: 0 1px 2px rgb(27 36 48 / 6%), 0 4px 14px rgb(27 36 48 / 5%);
  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 14px;
  --r-sm: 9px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #10151b; --card: #19212a; --sunk: #141b22; --ink: #e6ebf0; --muted: #94a1ae; --line: #29333e;
    --accent: #7f9cff; --accent-soft: #232f4f; --on-accent: #0d1424;
    --good: #5cc795; --good-soft: #17352a; --warn: #e3b04a; --warn-soft: #3a2f16; --bad: #f07a72; --bad-soft: #3d1f1e;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #10151b; --card: #19212a; --sunk: #141b22; --ink: #e6ebf0; --muted: #94a1ae; --line: #29333e;
  --accent: #7f9cff; --accent-soft: #232f4f; --on-accent: #0d1424;
  --good: #5cc795; --good-soft: #17352a; --warn: #e3b04a; --warn-soft: #3a2f16; --bad: #f07a72; --bad-soft: #3d1f1e;
  --shadow: 0 1px 2px rgb(0 0 0 / 30%); color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body { background: var(--paper); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.45; -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 1.85rem; font-weight: 700; line-height: 1.1; }
h2 { font-size: 1.15rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.num { font-variant-numeric: tabular-nums; }
.label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 650; color: var(--muted); }

/* Shell */
.app { display: grid; grid-template-columns: 1fr; min-height: 100vh; }
.side { display: none; }
main { width: 100%; max-width: 1000px; margin: 0 auto; min-width: 0;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 20px 120px; display: flex; flex-direction: column; gap: 20px; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around;
  background: var(--card); border-top: 1px solid var(--line);
  padding-top: 6px; padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  padding-left: max(8px, env(safe-area-inset-left, 0px)); padding-right: max(8px, env(safe-area-inset-right, 0px)); }
.tab { flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px;
  border: 0; background: none; border-radius: 10px; color: var(--muted); font-size: 0.74rem; font-weight: 600; cursor: pointer; }
.tab svg { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--accent); }
@media (min-width: 900px) {
  .app { grid-template-columns: 250px 1fr; }
  .tabbar { display: none; }
  main { padding-block: 32px 60px; }
  .side { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
    padding: 24px 14px; border-right: 1px solid var(--line); background: var(--card); }
  .side .brand { padding: 0 10px 18px; }
  .side .nav { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 0; background: none;
    cursor: pointer; text-align: left; font-weight: 550; color: var(--ink); width: 100%; }
  .side .nav svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
  .side .nav:hover { background: var(--sunk); }
  .side .nav[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
  .side .nav[aria-current="page"] svg { color: var(--accent); }
  .side .sep { height: 1px; background: var(--line); margin: 10px 6px; }
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.brand .mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; }
.brand .mark svg { width: 18px; height: 18px; }

.demo-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px; border-radius: var(--r);
  background: var(--accent-soft); color: var(--ink); font-size: 0.88rem; }
.demo-bar b { font-weight: 650; }

/* Page header */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.page-head .title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.page-head .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--card); box-shadow: var(--shadow); color: var(--accent); flex: none; }
.page-head .ico svg { width: 22px; height: 22px; }
.page-head p { color: var(--muted); }

/* Surfaces */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; min-width: 0; }
.card > * + * { margin-top: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.section { display: flex; flex-direction: column; gap: 10px; }
.grid2 { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid2 { grid-template-columns: 1fr 1fr; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 14px; border-radius: 10px; border: 0;
  background: var(--accent); color: var(--on-accent); font-weight: 650; cursor: pointer; white-space: nowrap; }
.btn svg { width: 18px; height: 18px; }
.btn.ghost { background: var(--sunk); color: var(--ink); border: 1px solid var(--line); }
.btn.soft { background: var(--accent-soft); color: var(--accent); }
.btn.sm { padding: 6px 10px; font-size: 0.85rem; border-radius: 8px; }
.btn.good { background: var(--good-soft); color: var(--good); }
.btn:hover { filter: brightness(0.97); }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; border: 0; background: none; border-radius: 9px; color: var(--muted); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--sunk); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.del:hover { color: var(--bad); background: var(--bad-soft); }
.pin-btn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* Forms */
.add { display: flex; flex-wrap: wrap; gap: 8px; }
.add > .grow { flex: 1 1 180px; min-width: 0; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
input[type="text"], input[type="number"], input[type="date"], input[type="time"], select, textarea {
  background: var(--sunk); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; min-width: 0; max-width: 100%; }
textarea { resize: vertical; min-height: 70px; width: 100%; }
/* 16px stops iPhones zooming in when you tap a box */
input, select, textarea { font-size: 16px; }
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
input.w-sm { width: 80px; } input.w-md { width: 130px; }

/* Lists */
.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-top: 1px solid var(--line); min-width: 0; }
.list > .row:first-child { border-top: 0; }
.row .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.row .main .t { overflow-wrap: anywhere; }
.row.done .t { text-decoration: line-through; color: var(--muted); }
.row .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 0.82rem; color: var(--muted); }
.check { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); background: var(--card); flex: none; display: grid; place-items: center; cursor: pointer; padding: 0; color: transparent; }
.check:hover { border-color: var(--accent); }
.check svg { width: 15px; height: 15px; }
.check[aria-checked="true"] { background: var(--good); border-color: var(--good); color: var(--card); }
.empty { padding: 18px 8px; text-align: center; color: var(--muted); }
.group-title { padding-top: 12px; }

/* Chips and people */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 0.76rem; font-weight: 600; background: var(--sunk); color: var(--muted); white-space: nowrap; }
.chip.good { background: var(--good-soft); color: var(--good); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filter { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-size: 0.86rem; font-weight: 600; color: var(--muted); }
.filter[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.who { width: 22px; height: 22px; border-radius: 50%; background: var(--p); color: #fff; display: inline-grid; place-items: center; font-size: 0.7rem; font-weight: 700; flex: none; }
.who.both { background: linear-gradient(135deg, var(--p) 50%, var(--q) 50%); }
.who.lg { width: 40px; height: 40px; font-size: 1rem; }
.online { width: 9px; height: 9px; border-radius: 50%; background: var(--good); display: inline-block; }

/* Home */
.hello { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.hello .date { color: var(--muted); font-weight: 550; }
.edit-home { background: var(--card); box-shadow: var(--shadow); width: 38px; height: 38px; }
/* Coming up: one list of everything dated, grouped by day */
.upnext .up-list { display: flex; flex-direction: column; }
.up-day { font-size: 0.78rem; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.06em; padding: 12px 2px 4px; }
.up-list .up-day:first-child { padding-top: 2px; }
.up-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 2px; border: 0; border-top: 1px solid var(--line); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; min-width: 0; }
.up-day + .up-row { border-top: 0; }
.up-row .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.up-row .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-row .meta { font-size: 0.8rem; color: var(--muted); }
.up-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.up-ico svg { width: 18px; height: 18px; }
.up-time { font-weight: 650; font-size: 0.9rem; color: var(--ink); }
.up-more { align-self: flex-start; }
/* Home tiles: one big line, one small line */
.tiles { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (min-width: 760px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.htile { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 14px; border-radius: var(--r); background: var(--card); box-shadow: var(--shadow);
  border: 0; cursor: pointer; text-align: left; color: inherit; font: inherit; min-width: 0; min-height: 124px; }
.htile:active { transform: scale(0.98); }
.htile .h-top { display: flex; align-items: center; gap: 8px; margin-bottom: auto; }
.htile .ico { width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.htile .ico svg { width: 17px; height: 17px; }
.htile .nm { font-size: 0.8rem; font-weight: 650; color: var(--muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.htile .big { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.htile .sm { font-size: 0.8rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.bad-t { color: var(--bad); font-weight: 650; }
/* More sheet */
.sheet-back { position: fixed; inset: 0; z-index: 30; background: rgb(10 14 20 / 40%); }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; background: var(--card); border-radius: 20px 20px 0 0; max-height: 85vh; overflow-y: auto;
  padding: 8px max(16px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; gap: 14px; box-shadow: 0 -8px 30px rgb(0 0 0 / 18%); }
.sheet .grab { width: 38px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto; }
.sheet > .btn { align-self: center; }
.m-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.m-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 2px; border: 0; background: none; border-radius: 12px;
  color: var(--ink); font: inherit; font-size: 0.76rem; font-weight: 600; cursor: pointer; text-align: center; min-width: 0; }
.m-tile:active { background: var(--sunk); }
.m-tile .ico { width: 48px; height: 48px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.m-tile .ico svg { width: 23px; height: 23px; }
.m-tile .chip { position: absolute; top: 4px; right: 6px; padding: 1px 6px; font-size: 0.68rem; }
body.sheet-open { overflow: hidden; }
@media (prefers-reduced-motion: no-preference) {
  #sheet:not(.still) .sheet { animation: sheet-up .22s ease-out; }
  #sheet:not(.still) .sheet-back { animation: fade-in .2s ease-out; }
  @keyframes sheet-up { from { transform: translateY(100%); } }
  @keyframes fade-in { from { opacity: 0; } }
}
@media (min-width: 900px) { .sheet { left: 50%; right: auto; width: 520px; transform: translateX(-50%); bottom: 24px; border-radius: 20px; } }
.big { font-family: var(--font-display); font-size: 2.3rem; font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.pin-edit .row { gap: 12px; }
.pin-edit .row svg.m { width: 20px; height: 20px; color: var(--accent); flex: none; }
.switch { width: 44px; height: 26px; border-radius: 999px; border: 0; background: var(--line); position: relative; cursor: pointer; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--card); transition: transform .15s; box-shadow: 0 1px 2px rgb(0 0 0 / 20%); }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }

/* Menu */
.menu-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; border-radius: var(--r); background: var(--card); box-shadow: var(--shadow); border: 0; cursor: pointer; text-align: left; position: relative; min-width: 0; }
.tile:hover { outline: 2px solid var(--accent-soft); }
.tile .ico { width: 40px; height: 40px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.tile .ico svg { width: 21px; height: 21px; }
.tile .nm { font-family: var(--font-display); font-weight: 650; font-size: 1.02rem; }
.tile .ds { color: var(--muted); font-size: 0.84rem; }
.tile .count { position: absolute; top: 14px; right: 14px; }

/* Calendar */
.cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal .dow { text-align: center; font-size: 0.72rem; font-weight: 650; color: var(--muted); padding: 4px 0; text-transform: uppercase; letter-spacing: 0.06em; }
.day { aspect-ratio: 1 / 1; max-width: 100%; border-radius: 10px; border: 0; background: var(--sunk); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 6px 2px; gap: 4px; min-width: 0; }
.day.out { background: transparent; color: var(--muted); opacity: 0.55; }
.day .n { font-weight: 600; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.day.today .n { background: var(--accent); color: var(--on-accent); border-radius: 999px; padding: 0 6px; }
.day[aria-pressed="true"] { outline: 2px solid var(--accent); }
.day .dots { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
.day .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--p, var(--accent)); display: block; }
.day .dots i.star { background: var(--warn); border-radius: 1px; transform: rotate(45deg); }
@media (min-width: 760px) { .day { aspect-ratio: 1.25 / 1; } }
.time { font-variant-numeric: tabular-nums; font-weight: 650; min-width: 46px; color: var(--accent); }

/* Budget */
.bar { height: 10px; border-radius: 999px; background: var(--sunk); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.bar.warn > span { background: var(--warn); } .bar.bad > span { background: var(--bad); }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat .v { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.cat-row { display: grid; grid-template-columns: minmax(0, 7rem) 1fr auto; gap: 10px; align-items: center; font-size: 0.88rem; }
.amt { font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; }
.balance { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--sunk); }

/* Important dates */
.count-box { width: 64px; flex: none; text-align: center; border-radius: 12px; padding: 6px 0; background: var(--sunk); }
.count-box .d { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; line-height: 1.05; font-variant-numeric: tabular-nums; }
.count-box .u { font-size: 0.7rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.count-box.soon { background: var(--warn-soft); color: var(--warn); }
.count-box.today { background: var(--accent); color: var(--on-accent); }
.count-box.today .u { color: inherit; }

/* Date ideas */
.pick { border-radius: var(--r); padding: 20px; background: var(--accent); color: var(--on-accent); display: flex; flex-direction: column; gap: 10px; }
.pick .label { color: inherit; opacity: 0.8; }
.pick h2 { font-size: 1.5rem; }
.pick .btn { background: var(--card); color: var(--ink); }

/* Meals */
.meal-day { display: grid; grid-template-columns: 76px 1fr auto; gap: 12px; align-items: center; padding: 12px 2px; border-top: 1px solid var(--line); }
.list > .meal-day:first-child { border-top: 0; }
.meal-day .dn { font-weight: 700; } .meal-day .dd { font-size: 0.8rem; color: var(--muted); }
.meal-day.is-today .dn { color: var(--accent); }
.meal-day .what { min-width: 0; overflow-wrap: anywhere; }
.meal-form { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 8px; }

/* Stars */
.stars { display: inline-flex; gap: 0; }
.stars button { border: 0; background: none; padding: 2px; cursor: pointer; color: var(--line); font-size: 1.05rem; line-height: 1; }
.stars button.on { color: var(--warn); }

/* Notes */
.notes { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); align-items: start; }
.note { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px; border-top: 4px solid var(--p); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.note .txt { white-space: pre-wrap; overflow-wrap: anywhere; }
.note .foot { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--muted); }
.note .foot .icon-btn { margin-left: auto; }

/* Us */
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 3px solid transparent; background: var(--p); cursor: pointer; }
.swatch[aria-pressed="true"] { border-color: var(--ink); }
.person { display: flex; align-items: center; gap: 12px; }
.steps { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 4px; }

/* Toast */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(86px + env(safe-area-inset-bottom, 0px)); z-index: 40;
  background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 12px; display: flex; gap: 14px; align-items: center;
  box-shadow: 0 6px 24px rgb(0 0 0 / 20%); max-width: calc(100% - 32px); font-size: 0.92rem; }
.toast button { background: none; border: 0; color: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; padding: 0; }
@media (min-width: 900px) { .toast { bottom: 28px; } }
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: up .18s ease-out; }
  @keyframes up { from { opacity: 0; transform: translate(-50%, 8px); } }
}

/* Mobile top bar, bottom quick buttons with Home in the middle */
.col { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(10px, env(safe-area-inset-right, 0px)); padding-block: 12px 0; }
.topbar .add { flex-wrap: nowrap; align-items: center; gap: 2px; }
.topbar .who { width: 28px; height: 28px; font-size: 0.8rem; }
.topbar + main { padding-top: 12px; }
@media (min-width: 900px) { .topbar { display: none; } .topbar + main { padding-top: 32px; } }
.tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab { min-width: 0; }
.home-tab { justify-content: center; }
.home-tab .hb { width: 54px; height: 54px; margin-top: -24px; border-radius: 50%; background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center; box-shadow: 0 6px 16px rgb(42 85 207 / 35%); border: 4px solid var(--card); }
.home-tab .hb svg { width: 24px; height: 24px; }
.home-tab[aria-current="page"] .hb { background: var(--ink); color: var(--card); box-shadow: none; }
.quick-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.quick-edit select { width: 100%; }
.quick-home { display: none; }
@media (min-width: 640px) {
  .quick-edit { grid-template-columns: 1fr 1fr auto 1fr auto; }
  .quick-home { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--accent); padding: 0 6px 4px; }
  .quick-home svg { width: 24px; height: 24px; }
}
@media (min-width: 900px) { .quick-edit { grid-template-columns: 1fr 1fr; } .quick-home { display: none; } }

/* Saved dinners */
.recipe-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.chips-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.linkish { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 600; cursor: pointer; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.plan-box { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 12px; background: var(--sunk); }
.ing { margin: 8px 0 12px; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 4px; }
.method { white-space: pre-wrap; margin: 8px 0 12px; line-height: 1.6; overflow-wrap: anywhere; }
.recipe a { color: var(--accent); font-weight: 600; }
.recipe .grid2 > div { min-width: 0; }

/* Love notes */
.note.big { box-shadow: none; background: var(--sunk); }
.note.big .txt { font-family: var(--font-display); font-size: 1.15rem; line-height: 1.35; }

/* Swipe back */
.back-btn { margin-left: -8px; }
.back-btn[hidden] { display: none; }
.col { will-change: auto; background: var(--paper); }
body.swiping .col { box-shadow: -8px 0 24px rgb(0 0 0 / 12%); }
body.swiping { overflow-x: hidden; }
.back-hint { position: fixed; left: calc(10px + env(safe-area-inset-left, 0px)); top: 50%; transform: translateY(-50%); z-index: 30;
  width: 40px; height: 40px; border-radius: 50%; background: var(--card); color: var(--muted); display: grid; place-items: center;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: background .15s, color .15s; }
.back-hint svg { width: 20px; height: 20px; }
.back-hint.ready { background: var(--accent); color: var(--on-accent); }
@media (min-width: 900px) { .topbar { display: flex; } .topbar .brand, .topbar #top-me, .topbar .icon-btn[data-to="menu"] { display: none; } .topbar:has(.back-btn[hidden]) { display: none; } }

/* Notifications */
.bell-btn { position: relative; }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 0.68rem; font-weight: 700;
  display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; line-height: 1; }
.bell-btn .badge { position: absolute; top: 1px; right: 0; border: 2px solid var(--paper); }
.side .nav .badge { margin-left: auto; }
.tab { position: relative; }
.tab .tab-badge { position: absolute; top: 2px; left: calc(50% + 4px); }
.alert-row { width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; cursor: pointer; font: inherit; color: inherit; border-radius: 0; }
.list > .label + .alert-row { border-top: 0; }
.alert-row.new { background: var(--accent-soft); border-radius: 10px; padding-inline: 8px; }
.alert-row .t b { font-weight: 650; }
.alert-row .chev { width: 16px; height: 16px; color: var(--muted); flex: none; }
.dot-new { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; }
.rem-ico { width: 32px; height: 32px; border-radius: 9px; background: var(--sunk); color: var(--accent); display: grid; place-items: center; flex: none; }
.rem-ico svg { width: 17px; height: 17px; }
.rem-ico.urgent { background: var(--warn-soft); color: var(--warn); }
svg.m { width: 20px; height: 20px; color: var(--accent); flex: none; }
.banner { position: fixed; z-index: 45; left: 50%; transform: translateX(-50%); top: calc(10px + env(safe-area-inset-top, 0px));
  width: min(440px, calc(100% - 24px)); display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; border: 0;
  background: var(--card); color: var(--ink); box-shadow: 0 10px 30px rgb(0 0 0 / 18%); text-align: left; cursor: pointer; font: inherit; }
.banner b { font-weight: 650; }

/* Love nudges */
.nudges { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.nudge { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--sunk);
  cursor: pointer; font-weight: 600; text-align: left; font-size: 0.88rem; color: var(--ink); }
.nudge .e { font-size: 1.3rem; line-height: 1; }
.nudge:hover { border-color: var(--accent); }
.nudge.sent { animation: pop .45s ease-out; }
@keyframes pop { 40% { transform: scale(1.06); background: var(--accent-soft); } }
.nudge-pop { position: fixed; z-index: 50; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(320px, calc(100% - 32px));
  background: var(--card); color: var(--ink); border-radius: 20px; padding: 24px 20px; text-align: center; box-shadow: 0 20px 60px rgb(0 0 0 / 30%);
  display: flex; flex-direction: column; align-items: center; gap: 6px; }
.nudge-pop .nudge-emoji { font-size: 3.2rem; line-height: 1.1; }
.nudge-pop .nudge-from { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; }
.nudge-pop .nudge-text { color: var(--muted); margin-bottom: 8px; }
@media (prefers-reduced-motion: no-preference) {
  .banner { animation: drop .25s ease-out; }
  @keyframes drop { from { opacity: 0; transform: translate(-50%, -12px); } }
  .nudge-pop .nudge-emoji { animation: beat 1s ease-in-out 2; }
  @keyframes beat { 30% { transform: scale(1.25); } 60% { transform: scale(.95); } }
}
svg.mini { width: 14px; height: 14px; vertical-align: -2px; margin-right: 2px; }
.row a { color: var(--accent); font-weight: 600; }

/* Sign in and pairing */
.auth { min-height: 100vh; display: grid; place-items: center; padding-block: 24px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.auth-card { width: min(420px, 100%); background: var(--card); border-radius: 20px; box-shadow: var(--shadow); padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.auth-brand { margin-bottom: 4px; }
.auth input[type="email"], .auth input[type="password"], .auth input[type="text"] { background: var(--sunk); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; width: 100%; }
.auth-msg { padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); font-size: 0.9rem; }
.swatch-pick input { position: absolute; opacity: 0; pointer-events: none; }
.swatch-pick input:checked + .swatch { border-color: var(--ink); }
.swatch-pick input:focus-visible + .swatch { outline: 2px solid var(--accent); outline-offset: 2px; }
.radio-row { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; cursor: pointer; }
.radio-row input { margin-top: 3px; }
.invite { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.invite .code { font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; letter-spacing: 0.12em; font-variant-numeric: tabular-nums; }

/* Feel like an app, not a web page: no zooming, no text selection on buttons, no pull-to-refresh bounce */
html, body { touch-action: pan-x pan-y; overscroll-behavior: none; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, select, [contenteditable], .note .txt, .method, .selectable { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
button, a, [data-act], label { touch-action: manipulation; }
img, svg { -webkit-user-drag: none; }

/* Labelled date boxes in add forms, and chips you can tap to change a date */
.date-field { display: inline-flex; align-items: center; gap: 8px; background: var(--sunk); border: 1px solid var(--line); border-radius: 10px; padding: 0 0 0 11px; color: var(--muted); font-size: 0.86rem; font-weight: 600; }
.date-field input[type="date"], .date-field input[type="time"] { border: 0; background: transparent; padding-left: 4px; }
.chip-date { position: relative; display: inline-flex; cursor: pointer; }
.chip-date input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; padding: 0; border: 0; cursor: pointer; }
.chip-date .chip { text-decoration: underline dotted; text-underline-offset: 2px; }

.edit-box { display: flex; flex-direction: column; gap: 8px; padding: 10px; margin: 4px 0; border-radius: var(--r-sm); background: var(--sunk); border: 1px solid var(--line); }
.edit-box > input { width: 100%; }

/* "Anytime" instead of a date */
.when { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.any { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; background: var(--sunk); border: 1px solid var(--line); font-size: 0.86rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.any input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.any:has(input:checked) { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.when:has(.any input:checked) .date-field { opacity: 0.55; }
.chip-x { width: 22px; height: 22px; display: inline-grid; place-items: center; border: 0; border-radius: 50%; background: var(--sunk); color: var(--muted); cursor: pointer; padding: 0; }
.chip-x svg { width: 12px; height: 12px; }
