/* Ohana: plain CSS, no build step (propshaft serves it as is). */

:root {
  --bg: #f4f5f8;
  --card: #ffffff;
  --ink: #15202b;
  --muted: #667482;
  --line: #e8eaef;
  --accent: #2f7a6b;
  --on-accent: #ffffff;
  --radius: 18px;
  --shadow: 0 1px 2px rgb(16 24 40 / .04), 0 6px 20px rgb(16 24 40 / .05);

  --rose: #d6456b;
  --blue: #3b78d8;
  --amber: #c98a12;
  --green: #2f8f5b;
  --violet: #8a5cd6;
  --teal: #1f9aa0;
  --coral: #d0532c;
  --plum: #a8379a;
  --slate: #5a6a7b;
  --navy: #2b4c8c;
  --brown: #8a5530;
  --olive: #6e7d16;

  /* the same colours as TEXT: darker, so they read on white and on their own tint (the plain ones are for fills) */
  --rose-ink: #be2a51;
  --blue-ink: #2764c3;
  --amber-ink: #875d0c;
  --green-ink: #26744a;
  --violet-ink: #7b48d1;
  --teal-ink: #177175;
  --coral-ink: #b24725; /* design said #c44e29: 3.9:1 on its chip tint, below the 4.5 rule */
  --plum-ink: #a8379a;
  --slate-ink: #5a6a7b;
  --navy-ink: #2b4c8c;
  --brown-ink: #8a5530;
  --olive-ink: #647114; /* design said #6b7915: 4.05:1 on its chip tint */
  --seg-thumb: var(--card); --seg-on: var(--ink); --seg-off: var(--muted); --seg-rim: 0 0 0 0 transparent; --seg-shadow: 0 1px 2px rgb(0 0 0 / .08);
}

/* Dark: when the system is dark (unless the person chose light), or when they chose dark.
   The choice is the theme cookie, shown as data-theme on <html>; no choice = follow the system. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --bin-black: #0b0c0d; --bin-brown: #a8734a; --bin-yellow: #f2c40f; --bin-blue: #4f8be0; --bin-edge: rgba(255, 255, 255, .55);
  --bin-black-ink: #d9dcde; --bin-brown-ink: #a8734a; --bin-yellow-ink: #f2c40f; --bin-blue-ink: #4f8be0;
    --bg: #111517;
    --seg-thumb: #56636a; --seg-on: #fff; --seg-off: #b4bfc4; --seg-rim: inset 0 0 0 .5px #6b787e; --seg-shadow: none; /* #302: a segmented control is lighter than its track in dark */
    --card: #1b2124;
    --ink: #e9edee;
    --muted: #94a1a7;
    --line: #2a3438;
    --accent: #5cc0ac;
    --on-accent: #0c1f1a;
    --shadow: none;

    --rose: #ef7a99;
    --blue: #7aa7f0;
    --amber: #e8b648;
    --green: #5fc58c;
    --violet: #b394f0;
    --teal: #5cc9cf;
    --coral: #f28a66;
    --plum: #e07fd2;
    --slate: #a5b3c2;
    --navy: #8fb2ec;
    --brown: #cf9c72;
    --olive: #b6c452;
    --rose-ink: var(--rose);
    --blue-ink: var(--blue);
    --amber-ink: var(--amber);
    --green-ink: var(--green);
    --violet-ink: var(--violet);
    --teal-ink: var(--teal);
    --coral-ink: var(--coral);
    --plum-ink: var(--plum);
    --slate-ink: var(--slate);
    --navy-ink: var(--navy);
    --brown-ink: var(--brown);
    --olive-ink: var(--olive);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bin-black: #0b0c0d; --bin-brown: #a8734a; --bin-yellow: #f2c40f; --bin-blue: #4f8be0; --bin-edge: rgba(255, 255, 255, .55);
  --bin-black-ink: #d9dcde; --bin-brown-ink: #a8734a; --bin-yellow-ink: #f2c40f; --bin-blue-ink: #4f8be0;
    --bg: #111517;
    --seg-thumb: #56636a; --seg-on: #fff; --seg-off: #b4bfc4; --seg-rim: inset 0 0 0 .5px #6b787e; --seg-shadow: none; /* #302: a segmented control is lighter than its track in dark */
    --card: #1b2124;
    --ink: #e9edee;
    --muted: #94a1a7;
    --line: #2a3438;
    --accent: #5cc0ac;
    --on-accent: #0c1f1a;
    --shadow: none;

    --rose: #ef7a99;
    --blue: #7aa7f0;
    --amber: #e8b648;
    --green: #5fc58c;
    --violet: #b394f0;
    --teal: #5cc9cf;
    --coral: #f28a66;
    --plum: #e07fd2;
    --slate: #a5b3c2;
    --navy: #8fb2ec;
    --brown: #cf9c72;
    --olive: #b6c452;
    --rose-ink: var(--rose);
    --blue-ink: var(--blue);
    --amber-ink: var(--amber);
    --green-ink: var(--green);
    --violet-ink: var(--violet);
    --teal-ink: var(--teal);
    --coral-ink: var(--coral);
    --plum-ink: var(--plum);
    --slate-ink: var(--slate);
    --navy-ink: var(--navy);
    --brown-ink: var(--brown);
    --olive-ink: var(--olive);
    color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }

body {
  margin: 0 auto;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding: 20px 16px 40px;
  max-width: 1280px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol, dl { margin: 0; padding: 0; }
ul, ol { list-style: none; }

.muted { color: var(--muted); font-weight: 400; }

/* ---- header: greeting, people, actions ---- */
.top {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
  align-items: flex-end;
  justify-content: space-between;
  margin: 8px 0 18px;
}
.eyebrow { color: var(--accent); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: .8rem; }
.app-sub { color: var(--muted); font-size: .92rem; }
h1 { font-size: 2.1rem; line-height: 1.12; font-weight: 800; letter-spacing: -.02em; }
h1 small { font-size: 1rem; color: var(--muted); font-weight: 400; margin-left: .4em; }

.people { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.people li {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 14px 4px 4px; border-radius: 99px;
  background: var(--card); box-shadow: var(--shadow); border: 1px solid var(--line);
  font-size: .9rem;
}
.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-size: .72rem; font-weight: 700; letter-spacing: .02em;
  color: var(--ink);
  background: color-mix(in srgb, var(--c, var(--muted)) 22%, var(--card));
  box-shadow: 0 0 0 2px var(--c, var(--line));
}

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: .9rem; }
.legend li { display: flex; align-items: center; gap: 6px; }
.dot { width: .7rem; height: .7rem; border-radius: 50%; background: var(--c, var(--muted)); display: inline-block; }

/* member colours: set --c, used by dots, chips, avatars and agenda cards */
.c-rose  { --c: var(--rose);  --c-ink: var(--rose-ink); }
.c-blue  { --c: var(--blue);  --c-ink: var(--blue-ink); }
.c-amber { --c: var(--amber); --c-ink: var(--amber-ink); }
.c-green { --c: var(--green); --c-ink: var(--green-ink); }
.c-family { --c: var(--muted); --c-ink: var(--muted); } /* #373 a Family event (nobody in particular): grey, and the blocks draw no bar */
.blk.c-family, .tv-banner.c-family { box-shadow: 0 0 0 1px var(--card); }
.c-multi { --c: var(--muted); --c-ink: var(--muted); } /* an event for several people (#189): neutral, the names say who */

/* ---- layout: phone = one column, tablet = two, wall display = three ----
   Widgets flow in the order the family chose; a "wide" one takes the whole row. */
/* one list in the order the family chose; from tablet width it runs in two balanced columns, weather and "wide" widgets across both */
.grid { column-gap: 16px; }
@media (min-width: 900px) {
  .grid { column-count: 2; }
  .widget[data-widget="weather"], .widget.wide { column-span: all; }
}
.widget { min-width: 0; display: flex; flex-direction: column; break-inside: avoid; margin-bottom: 16px; }
.widget > .card { flex: 1; }

/* ---- edit mode (family admins) ---- */
.edit-bar {
  display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: space-between;
  margin-bottom: 16px; padding: 14px 18px; border-radius: var(--radius);
  border: 1px dashed var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--card));
}
.edit-bar p { font-size: .9rem; margin-top: 2px; max-width: 34rem; }
.edit-colors, .edit-actions { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.swatch-row { display: flex; gap: 8px; }
.swatch-btn {
  appearance: none; width: 30px; height: 30px; padding: 0; border-radius: 50%; cursor: pointer;
  background: var(--sw); border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--line);
  display: grid; place-items: center;
}
.swatch-btn.on { box-shadow: 0 0 0 3px var(--sw); }
.swatch-btn.on span::after { content: "✓"; color: #fff; font-size: .8rem; font-weight: 700; }
.widget-tools {
  display: flex; align-items: center; gap: 6px; padding: 6px 8px 6px 12px; margin-bottom: 6px;
  border-radius: 12px; background: color-mix(in srgb, var(--accent) 12%, var(--card)); font-size: .88rem;
}
.widget-tools .btn.small { padding: 3px 9px; }
.widget-tools .btn[disabled] { opacity: .35; cursor: default; }
.drag-handle { cursor: grab; font-size: 1.2rem; line-height: 1; color: var(--muted); user-select: none; }
.drag-handle[hidden] { display: none; }
.editing .widget > .card { outline: 2px dashed color-mix(in srgb, var(--accent) 40%, transparent); outline-offset: -2px; }
.widget.is-hidden > .card { opacity: .4; }
.widget.dragging { opacity: .5; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 20px 22px;
  min-width: 0;
}
.card h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.card h2 .muted { font-size: .85rem; }
.card h3 { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 16px 0 4px; }

/* ---- weather: the same white card, a big icon and temperature ---- */
.big-icon { font-size: 4rem; line-height: 1; flex: none; }
.now .mid { min-width: 0; } .now .mid h3 { margin: 0; font-size: .9rem; text-transform: none; letter-spacing: 0; color: var(--muted); font-weight: 500; }
.forecast { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; text-align: center; font-size: .85rem; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.forecast li { display: grid; gap: 2px; }
.forecast .icon { font-size: 1.4rem; }
.forecast .rain { color: var(--muted); font-size: .75rem; }

/* ---- agenda (today, tomorrow): plain rows with a dot in the person's colour ---- */
.agenda { display: grid; }
.agenda li {
  display: grid;
  grid-template-columns: 4.2rem 1fr;
  gap: 10px;
  padding: 10px 0 10px 18px;
  border-top: 1px solid var(--line);
  position: relative;
}
.agenda li:first-child { border-top: 0; }
.agenda li::before { content: ""; position: absolute; left: 2px; top: 1.05rem; width: .55rem; height: .55rem; border-radius: 50%; background: var(--c, var(--muted)); }
.agenda time { font-variant-numeric: tabular-nums; font-weight: 600; font-size: .9rem; }
.agenda time .muted { display: block; font-size: .8rem; }
.agenda p { font-size: .85rem; }

/* ---- checklists (tasks + shopping) ---- */
.checks li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.checks li:last-child { border-bottom: 0; }
.checks label { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.checks input { accent-color: var(--accent); width: 1.05rem; height: 1.05rem; flex: none; }
.checks .done label span { text-decoration: line-through; color: var(--muted); }
.chip {
  font-size: .72rem;
  padding: 2px 10px;
  border-radius: 99px;
  color: var(--c-ink, var(--c));
  background: color-mix(in srgb, var(--c) 14%, transparent);
  white-space: nowrap;
}
.due { font-size: .8rem; white-space: nowrap; min-width: 4.4rem; text-align: right; }
.due.late { color: var(--rose-ink); font-weight: 600; }

/* ---- weekly agenda ---- */
.week { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 760px)  { .week { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1100px) { .week { grid-template-columns: repeat(7, 1fr); } }
.day {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 14px;
  padding: 10px;
  min-height: 7rem;
  min-width: 0;
}
.day.today { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--card)); }
.day h3 { margin: 0 0 8px; color: var(--ink); text-transform: none; letter-spacing: 0; font-size: .95rem; }
.day h3 .muted { font-size: .8rem; }
.day li {
  padding: 3px 0 3px 14px;
  margin-bottom: 4px;
  position: relative;
  font-size: .82rem;
  line-height: 1.3;
}
.day li::before { content: ""; position: absolute; left: 2px; top: .62rem; width: .45rem; height: .45rem; border-radius: 50%; background: var(--c, var(--muted)); }
.day time { display: block; color: var(--muted); font-variant-numeric: tabular-nums; font-size: .75rem; }
.empty { font-size: .85rem; }

.foot { margin-top: 28px; text-align: center; color: var(--muted); font-size: .8rem; }

/* ======== editing: buttons, forms, flash, lists ======== */
.flash { margin: 0 0 14px; padding: 10px 16px; border-radius: 14px; font-size: .92rem; border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); }
.flash.notice { background: color-mix(in srgb, var(--green) 10%, var(--card)); box-shadow: inset 4px 0 0 var(--green); }
.flash.alert { background: color-mix(in srgb, var(--rose) 10%, var(--card)); box-shadow: inset 4px 0 0 var(--rose); }

a { color: var(--accent); }
a.plain { color: inherit; text-decoration: none; }
a.plain:hover { text-decoration: underline; }
.grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }

.btn {
  display: inline-block; font: inherit; font-size: .9rem; line-height: 1.2;
  padding: 8px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: var(--accent); }
.btn { transition: border-color .15s, background-color .15s, transform .1s; }
.btn:active { transform: translateY(1px); }
.btn.primary:hover { filter: brightness(1.07); }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn:active { transform: none; } }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.small { padding: 4px 10px; font-size: .82rem; }
.btn.danger { color: var(--rose-ink); }
.btn.danger:hover { border-color: var(--rose); }
button.btn { appearance: none; }
:where(a, button, input, select):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.top-nav { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.legend li { color: var(--c-ink, var(--c)); }
.legend .dot { background: var(--c); }
.welcome { margin: 12px 0 16px; }
.welcome p { margin-top: 6px; color: var(--muted); }
.card-action { margin-top: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.spacer { flex: 1; }

/* quick-add row inside a card */
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.quick > input[type=text], .quick > input[type=date], .quick > select { /* #389 direct children only: a field inside a labelled box (a column) must not take the 8rem as a height */
  flex: 1 1 8rem; min-width: 0;
}
.quick > input[type=text]:first-child { flex: 3 1 12rem; }
input[type=text], input[type=search], input[type=url], input[type=date], input[type=datetime-local], input[type=number], input[type=time], input[type=tel], select { /* #388: number, time and tel fields share the padding of the rest (Servings was 20 px tall) */
  font: inherit; font-size: .92rem; padding: 8px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
}

/* tick button = round checkbox that posts a toggle */
.tick-form { display: contents; }
.tick {
  appearance: none; flex: none; width: 1.4rem; height: 1.4rem; padding: 0;
  border: 2px solid var(--muted); border-radius: 50%; background: transparent; cursor: pointer;
  display: grid; place-items: center;
}
.tick:hover { border-color: var(--accent); }
.tick.on { background: var(--accent); border-color: var(--accent); }
.tick.on span::after { content: "✓"; color: var(--on-accent); font-size: .75rem; line-height: 1; }
.checks .done .grow { text-decoration: line-through; color: var(--muted); }
.checks li { flex-wrap: nowrap; }
.card h3 + .checks { margin-bottom: 4px; }

/* week view: add link in the day header */
.day h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.day .add { text-decoration: none; font-weight: 700; padding: 0 6px; border-radius: 6px; color: var(--muted); }
.day .add:hover { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* form pages */
.page { max-width: 720px; margin: 0 auto; } /* #397 one narrow column (forms, lists, settings) = the 720 px of Tasks and Shopping; the wide pages (Home, Calendar, Meals) are the other width */
.page h1 { margin: 6px 0 16px; font-size: 1.9rem; letter-spacing: -.02em; }
.page > .eyebrow { display: inline-block; margin: 14px 0 2px; text-transform: none; letter-spacing: 0; font-weight: 500; font-size: .9rem; } /* #395 the back link sits 14 px under the nav and has its own arrow */
.page > .eyebrow a { color: var(--muted); text-decoration: none; }
.page > .eyebrow a:hover { color: var(--accent); text-decoration: underline; }
.page > p { margin-bottom: 14px; }
.page > .card, .page > section.card { margin-bottom: 16px; }
.form .field { margin-bottom: 16px; display: block; border: 0; padding: 0; }
.form label, .form legend { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 6px; padding: 0; }
.form input[type=text], .form input[type=search], .form input[type=url], .form input[type=date], .form input[type=datetime-local], .form select { width: 100%; }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .form .two { grid-template-columns: 1fr; } }
.swatches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 14px; } /* 12 colours: 3 x 4 on a phone, 6 x 2 from a wide window (#272) */
@media (min-width: 640px) { .swatches { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.swatch .in-use { font-size: .75rem; }
.swatch { display: flex !important; align-items: center; gap: 6px; font-size: .9rem !important; color: var(--ink) !important; cursor: pointer; }
.swatch .dot { background: var(--c); }
.form-errors { border: 1px solid var(--line); background: color-mix(in srgb, var(--rose) 10%, var(--card)); box-shadow: inset 4px 0 0 var(--rose); border-radius: 14px; padding: 10px 16px; margin-bottom: 16px; font-size: .9rem; }
.form-errors ul { margin-top: 4px; padding-left: 18px; list-style: disc; }
.delete-form { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }

/* people list */
.rows li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.rows li:last-child { border-bottom: 0; }
.rows .push { margin-left: auto; }
.rows .dot { background: var(--c); width: .9rem; height: .9rem; }
.rows .avatar { width: 34px; height: 34px; font-size: .8rem; }

/* ======== site chrome, landing, admin ======== */
.site-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin: -4px 0 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.site-nav .brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.site-nav .brand .logo-mark { flex: none; }
.site-nav .crumb { color: var(--muted); }
.site-nav .who { font-size: .8rem; }

/* the quiet bar: places on the left, one add button and the account menu on the right */
.main-nav { display: flex; flex-wrap: wrap; gap: 4px 2px; margin-left: 8px; } /* wraps onto a second row when large text does not fit (#622), never clipped */
.nav-link { padding: 6px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-size: .9rem; white-space: nowrap; transition: color .15s, background-color .15s; }
.nav-link:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.nav-link.current { color: var(--ink); font-weight: 600; background: color-mix(in srgb, var(--ink) 8%, var(--card)); }
.user-menu { position: relative; }
.user-btn { list-style: none; cursor: pointer; display: grid; border-radius: 50%; }
.user-btn::-webkit-details-marker { display: none; }
.user-btn .avatar { width: 32px; height: 32px; }
.user-menu[open] .user-btn .avatar { box-shadow: 0 0 0 2px var(--accent); }
.menu-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; min-width: 230px; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.menu-item { display: block; width: 100%; box-sizing: border-box; text-align: left; font: inherit; font-size: .9rem; padding: 8px 10px; border: 0; border-radius: 9px; background: none; color: var(--ink); text-decoration: none; cursor: pointer; }
.menu-item:hover, .menu-item:focus-visible { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.menu-panel hr { border: 0; border-top: 1px solid var(--line); margin: 4px 2px; }
.site-nav .menu-panel form.inline { display: block; margin: 0; }
@media (prefers-reduced-motion: reduce) { .nav-link { transition: none; } }
form.inline { display: inline; }
.top .eyebrow { display: none; } /* the nav bar already carries the brand */
.btn.big { padding: 12px 24px; font-size: 1rem; border-radius: 14px; }
/* Sign in with Apple: Apple's own look, black on light and white on dark (the logo follows the text colour). */
.btn.apple-btn { background: #000; border-color: #000; color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn.block.apple-btn { display: flex; }
.btn.apple-btn:hover { border-color: var(--accent); }
.btn.apple-btn svg { width: 1.1em; height: 1.1em; fill: currentColor; flex: none; margin-top: -2px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.apple-btn { background: #fff; border-color: #fff; color: #000; } }
:root[data-theme="dark"] .btn.apple-btn { background: #fff; border-color: #fff; color: #000; }
/* The Google logo on "Continue with Google", laid out like the Apple logo on Apple's button. */
.btn.google-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn.block.google-btn { display: flex; }
.btn.google-btn svg { width: 1.1em; height: 1.1em; flex: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---- landing ---- */
.landing { display: grid; gap: 56px; padding-top: 4vh; }
.hero { display: grid; gap: 36px; align-items: center; }
@media (min-width: 900px) { .hero { grid-template-columns: 1.05fr .95fr; gap: 56px; } }
.hero h1 { font-size: clamp(2.3rem, 6vw, 3.6rem); line-height: 1.05; letter-spacing: -.03em; margin: 8px 0 16px; }
.hero .lead { color: var(--muted); font-size: 1.15rem; max-width: 34rem; }
.hero .actions { margin-top: 26px; }
.actions.center { justify-content: center; }

.preview {
  background: var(--card); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow);
  padding: 22px; display: grid; gap: 16px; max-width: 460px; width: 100%; justify-self: center;
  background-image: radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%);
}
@media (min-width: 900px) { .preview { transform: rotate(1.2deg); } }
.preview-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.preview-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.stack { display: flex; }
.stack li + li { margin-left: -2px; }
.stack .avatar { box-shadow: 0 0 0 2px var(--c), 0 0 0 4px var(--card); }

.pillars ul { display: grid; gap: 16px; }
@media (min-width: 760px) { .pillars ul { grid-template-columns: repeat(3, 1fr); } }
.pillars h3 { font-size: 1.1rem; margin: 14px 0 6px; text-transform: none; letter-spacing: 0; color: var(--ink); }
.pillars p { color: var(--muted); }

.how { text-align: center; }
.how h2 { font-size: clamp(1.5rem, 4vw, 2rem); letter-spacing: -.02em; margin-bottom: 24px; }
.steps-row { display: grid; gap: 14px; text-align: left; }
@media (min-width: 760px) { .steps-row { grid-template-columns: repeat(3, 1fr); } }
.steps-row li { display: grid; gap: 4px; justify-items: start; padding: 18px 20px; border-radius: var(--radius); background: color-mix(in srgb, var(--accent) 7%, var(--card)); border: 1px solid var(--line); }
.steps-row span:not(.step-no) { color: var(--muted); font-size: .95rem; }
.step-no { display: grid; place-items: center; flex: none; width: 40px; height: 40px; padding: 0; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 1rem; line-height: 1; font-variant-numeric: tabular-nums; margin-bottom: 8px; }
.how .actions { margin-top: 28px; }

/* ---- sign-in, sign-up, invitations ---- */
.auth { max-width: 420px; margin: 5vh auto 0; text-align: center; }
.auth-mark { display: inline-block; line-height: 0; text-decoration: none; margin-bottom: 16px; } /* #381 the real Ohana mark, 64 px, no tile and no letter */
.auth-mark .logo-mark { display: block; }
/* #381 social buttons: Google then Apple, 12 px apart, 50 px tall; the "or" line has 22 px above and 16 below */
.auth .social { display: grid; gap: 12px; margin-top: 0; }
.auth .social form { margin: 0; }
.auth .social .btn { min-height: 50px; width: 100%; margin: 0; }
/* #401 create-account pages: the email form sits behind a smaller "Sign up with email instead" (closed when the page opens); its button is the plain outlined style, so Google and Apple stay the main choice */
.signup-email { margin-top: 14px; }
.signup-email > summary { cursor: pointer; text-align: center; color: var(--muted); font-size: .9rem; padding: 10px; border-radius: 10px; list-style: none; }
.signup-email > summary::-webkit-details-marker { display: none; }
.signup-email > summary::after { content: " ›"; display: inline-block; transition: transform .15s; }
.signup-email[open] > summary::after { transform: rotate(90deg); }
.signup-email > summary:hover { color: var(--ink); }
.signup-email .form { margin-top: 8px; }
.or-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 16px; color: var(--muted); font-size: .85rem; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth h1 { font-size: 1.9rem; letter-spacing: -.02em; }
.auth-sub { color: var(--muted); margin: 6px 0 22px; }
.auth .card { text-align: left; padding: 24px; }
.auth .card > p { margin-bottom: 14px; }
.auth-foot { margin-top: 18px; color: var(--muted); font-size: .92rem; }
.auth .form .field { margin-bottom: 16px; }
.auth .form label { font-size: .85rem; margin-bottom: 6px; }
.auth input[type=email], .auth input[type=password], .auth input[type=text] { padding: 12px 14px; font-size: 1rem; }
.btn.block { display: block; width: 100%; text-align: center; }
.auth .btn.block + .btn.block, .auth .card > .btn.block { margin-top: 10px; }
.auth form.button_to { margin-top: 10px; }
.invite-family { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 14px; margin-bottom: 18px; background: color-mix(in srgb, var(--accent) 8%, var(--card)); }
.invite-family .avatar { width: 44px; height: 44px; font-size: .95rem; }
.invite-family p { font-size: .9rem; }
.hint { color: var(--muted); font-size: .8rem; margin-top: 4px; }
.open-in-app { margin-top: 20px; display: grid; gap: 8px; }
.open-in-app h2.hint { margin: 0; font-size: .85rem; font-weight: 600; text-transform: none; }
.open-in-app .store-btn { background: #000; border-color: #000; color: #fff; }
.slug-input { display: flex; align-items: center; gap: 4px; }
.slug-input input { flex: 1; }
.sub { font-size: .95rem; font-weight: 700; color: var(--ink); margin: 26px 0 8px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); gap: 8px; margin: 14px 0 18px; }
.stats div { background: color-mix(in srgb, var(--ink) 4%, var(--card)); border-radius: 14px; padding: 10px 14px; }
.stats dt { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.stats dd { margin: 0; font-size: 1.5rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px 8px; border-bottom: 1px solid var(--line); }
.table tbody tr:hover { background: color-mix(in srgb, var(--ink) 3%, transparent); }
.card:has(.table) { overflow-x: auto; }
.inline-form { display: inline-flex; gap: 6px; }
.invite input[type=text] { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; }
/* #390 invitations: badge, date and Withdraw on one line, the link on its own full line under them with a Copy button */
.rows li.invite { flex-wrap: wrap; row-gap: 8px; }
.invite-form select[name="invitation[role]"] { flex: 1 1 100%; } /* the role line ("Member: edits events, tasks...") has the whole row, so it is never cut */
.invite .invite-link { flex: 1 1 100%; display: flex; gap: 8px; align-items: center; }
.invite .invite-link input { flex: 1 1 auto; min-width: 0; }
/* (violet and teal sit with the other member colours above in spirit: --c for fills, --c-ink for text) */
.chip.c-violet, .c-violet { --c: var(--violet); --c-ink: var(--violet-ink); }
.c-teal { --c: var(--teal); --c-ink: var(--teal-ink); }
.c-coral { --c: var(--coral); --c-ink: var(--coral-ink); }
.c-plum { --c: var(--plum); --c-ink: var(--plum-ink); }
.c-slate { --c: var(--slate); --c-ink: var(--slate-ink); }
.c-navy { --c: var(--navy); --c-ink: var(--navy-ink); }
.c-brown { --c: var(--brown); --c-ink: var(--brown-ink); }
.c-olive { --c: var(--olive); --c-ink: var(--olive-ink); }
.tick.static { cursor: default; border-color: var(--line); }
.tick.static:hover { border-color: var(--line); }
.tick.static.on { border-color: var(--accent); }
@media (min-width: 900px) { .page:has(.table) { max-width: 860px; } }
input[type=email], input[type=password] { font: inherit; font-size: .92rem; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.form input[type=email], .form input[type=password] { width: 100%; }

/* ======== calendar sources ======== */
.synced { color: var(--teal-ink); font-size: .85em; white-space: nowrap; }
.sources { max-width: 760px; }
.source { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; background: color-mix(in srgb, var(--ink) 2%, var(--card)); }
.source > header { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.source h3 { margin: 0; font-size: 1rem; text-transform: none; letter-spacing: 0; color: var(--ink); }
.source .calendars li { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.source .error { color: var(--rose-ink); font-size: .85rem; flex-basis: 100%; }
.provider-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.steps { padding-left: 1.2em; list-style: decimal; margin: 6px 0 14px; color: var(--muted); font-size: .9rem; }
.steps li { margin-bottom: 4px; }

/* ======== site banner, admin panel ======== */
.banner { margin: 0 0 14px; padding: 10px 16px; border-radius: 14px; font-size: .92rem; border: 1px solid var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--card)); }
.banner.warning { border-color: var(--amber); background: color-mix(in srgb, var(--amber) 14%, var(--card)); }
.admin-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.admin-nav a { padding: 6px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); text-decoration: none; color: var(--ink); font-size: .88rem; }
.admin-nav a:hover { border-color: var(--accent); }
.admin-nav a.current { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.page.wide { max-width: 980px; }
.attention { display: grid; gap: 6px; margin: 12px 0 4px; }
.attention a { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); }
.attention a.warn { border-color: var(--amber); }
.attention a.bad { border-color: var(--rose); }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 56px; margin: 8px 0 2px; }
.bars span { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }
.bars-legend { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); }
.filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.filter input[type=search], .filter select { flex: 1 1 10rem; font: inherit; font-size: .9rem; padding: 7px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.once { border: 1px dashed var(--amber); border-radius: 14px; padding: 12px 14px; margin: 10px 0; background: color-mix(in srgb, var(--amber) 8%, var(--card)); }
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row input { flex: 1; min-width: 0; }
.starter-make { margin: 14px 0; }
.table-scroll { overflow-x: auto; }
.nowrap { white-space: nowrap; }
.once code, code.big { font-size: 1rem; user-select: all; }
textarea { font: inherit; font-size: .92rem; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); width: 100%; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; }
.pill { font-size: .72rem; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--line); white-space: nowrap; }
.pill.ok { border-color: var(--green); color: var(--green-ink); }
.pill.bad { border-color: var(--rose); color: var(--rose-ink); }
.pill.warn { border-color: var(--amber); color: var(--amber-ink); }

/* ======== expenses ======== */
.seg { margin-bottom: 10px; } /* before the page rules that reset a child's margin (.tasks-page > *): the segmented control itself is defined once, further down (#389) */
.stepper { display: flex; justify-content: center; align-items: center; gap: 18px; margin-bottom: 8px; font-weight: 600; }
.stepper a { text-decoration: none; font-size: 1.3rem; padding: 0 10px; color: var(--muted); }
.total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 12px; }
.total strong { font-size: 1.8rem; font-variant-numeric: tabular-nums; }
.delta { margin-left: auto; font-weight: 600; font-size: .9rem; }
.delta.up { color: var(--rose-ink); }
.delta.down { color: var(--green-ink); }
.split { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-bottom: 14px; }
.donut { width: 170px; height: 170px; border-radius: 50%; display: grid; place-items: center; flex: none; position: relative; }
.donut::before { content: ""; position: absolute; inset: 24px; border-radius: 50%; background: var(--card); }
.donut span { position: relative; font-weight: 700; font-size: .95rem; font-variant-numeric: tabular-nums; text-align: center; max-width: 100px; line-height: 1.2; }
.cats { flex: 1 1 14rem; list-style: none; padding: 0; margin: 0; }
.cats li { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: .92rem; }
.cats .pct { width: 3rem; text-align: right; }
.expense-list .dot, .cats .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }
.expense-list { margin-top: 6px; }

/* ---- theme button, custom colour wheel ---- */
.theme-toggle { min-width: 2.2rem; padding: 4px 9px; }
/* One theme button, two forms: the one that leads away from what is showing. Light by default; dark when chosen, or when the device is dark and nothing was chosen. */
.site-nav form.inline.theme-to-light { display: none; }
:root[data-theme="dark"] .site-nav form.inline.theme-to-dark { display: none; }
:root[data-theme="dark"] .site-nav form.inline.theme-to-light { display: inline; }
:root[data-theme="dark"] .site-nav .menu-panel form.inline.theme-to-light { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .site-nav form.inline.theme-to-dark { display: none; }
  :root:not([data-theme]) .site-nav form.inline.theme-to-light { display: inline; }
  :root:not([data-theme]) .site-nav .menu-panel form.inline.theme-to-light { display: block; }
}
.swatch-row { flex-wrap: wrap; align-items: center; }
.custom-colour { display: flex; gap: 6px; align-items: center; }
.wheel {
  position: relative; display: block; width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  background: conic-gradient(#ff3b30, #ffcc00, #34c759, #00c7be, #007aff, #af52de, #ff2d55, #ff3b30);
  border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--line);
}
.wheel::after { content: "+"; display: grid; place-items: center; position: absolute; inset: 8px; border-radius: 50%; background: var(--cur, var(--card)); color: var(--muted); font-size: 15px; font-weight: 500; line-height: 1; box-shadow: 0 0 0 2px var(--card); } /* #374 the picker is a ring with a plus; a custom colour fills the middle */
.wheel.on::after { content: ""; }
.wheel.on { box-shadow: 0 0 0 3px var(--cur); }
.wheel input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.wheel:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }


/* ======== profiles ======== */
.avatar-photo { object-fit: cover; padding: 0; }
.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.profile-head .avatar { width: 64px; height: 64px; font-size: 1.3rem; }
.photo-row { display: flex; align-items: center; gap: 12px; min-width: 0; } /* #388: the row may shrink to its card, so the file chooser never pushes the page sideways */
.photo-row input[type=file] { flex: 1 1 0; min-width: 0; }
.photo-row .avatar { width: 56px; height: 56px; }
.birthday { margin: 2px 0 8px; font-size: .9rem; }

/* ======== legal pages: /privacy and /terms, and the links to them ======== */
.legal-links { margin-top: 24px; text-align: center; color: var(--muted); font-size: .9rem; }
.legal-links a { color: var(--muted); text-decoration: none; }
.legal-links a:hover { color: var(--accent); text-decoration: underline; }
.language-picker { margin-top: 8px; text-align: center; color: var(--muted); font-size: .9rem; }
.language-picker strong { color: var(--ink, inherit); font-weight: 600; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; text-decoration: none; }
.link-button:hover { color: var(--accent); text-decoration: underline; }

/* long text: wider than a form, still one column on a phone */
.page.legal { max-width: 720px; line-height: 1.6; }
.legal h2 { margin-top: 32px; }
.legal h3 { margin-top: 20px; text-transform: none; }
.legal ul { margin-bottom: 14px; padding-left: 1.2em; list-style: disc; }

/* ======== month view ======== */
.month-filter { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 0 0 14px; }
.month-filter .chip { text-decoration: none; border: 1px solid var(--line); }
.month-filter .chip.all { --c: var(--accent); --c-ink: var(--ink); }
.month-filter .chip.on { background: color-mix(in srgb, var(--c, var(--accent)) 22%, var(--card)); border-color: var(--c, var(--accent)); font-weight: 600; }
.month-head, .month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.month-head span { text-align: center; color: var(--muted); font-size: .78rem; padding: 0 0 6px; }
.cell {
  border: 1px solid transparent;
  background: color-mix(in srgb, var(--ink) 4%, var(--card));
  border-radius: 10px;
  padding: 6px;
  min-height: 6.5rem;
  min-width: 0;
}
.cell.outside { opacity: .7; }
.cell.today { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--card)); }
.cell.picked { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent); }
.cell-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.cell .num { font-weight: 600; font-size: .85rem; text-decoration: none; padding: 2px 6px; margin: -2px -6px; }
.cell.today .num { color: var(--accent); }
.cell .add { text-decoration: none; font-weight: 700; padding: 0 5px; border-radius: 6px; color: var(--muted); }
.cell .add:hover { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.chips { list-style: none; margin: 0; padding: 0; }
.chips li {
  display: flex; gap: 4px; align-items: baseline;
  padding: 1px 5px; margin-bottom: 2px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--c, var(--muted)) 16%, var(--card));
  box-shadow: inset 2px 0 0 var(--c, var(--muted));
  font-size: .75rem; line-height: 1.3;
  overflow: hidden; white-space: nowrap;
}
.chips li span { overflow: hidden; text-overflow: ellipsis; }
/* #387 a month cell is narrow below a wide window: the time takes the first line and the title two lines under it, instead of two letters and an ellipsis */
@media (max-width: 1099px) { .chips li { flex-wrap: wrap; row-gap: 0; white-space: normal; } .chips li time { flex: 1 1 100%; } .chips li span { flex: 1 1 100%; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; } }
.chips time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .7rem; flex: none; }
.cell .more { font-size: .72rem; }
.cell .dots { display: none; }
.month-day { margin-top: 14px; }
@media (max-width: 640px) {
  .month.card { padding: 10px; }
  .cell { min-height: 3.2rem; padding: 4px; text-align: center; }
  .cell-top { justify-content: center; }
  .cell .add, .chips, .cell .more { display: none; }
  .cell .dots { display: flex; justify-content: center; flex-wrap: wrap; gap: 3px; }
  .cell .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--muted)); }
}

/* ======== day and week: the time grid ======== */
.timeview { --hour: 3rem; --gutter: 3rem; padding: 10px; overflow-x: auto; }
.tv-head, .tv-banners, .tv-body { display: grid; grid-template-columns: var(--gutter) repeat(var(--cols), minmax(0, 1fr)); min-width: min(100%, calc(var(--cols) * 5.5rem)); }
.tv-head { gap: 0 4px; padding-bottom: 6px; }
.tv-day { text-align: center; padding: 4px 0; border-radius: 10px; text-decoration: none; font-size: .85rem; color: var(--muted); }
.tv-day strong { color: var(--ink); font-size: 1.05rem; }
.tv-day.today { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.tv-day.today strong { color: var(--accent); }
.tv-banners { padding-bottom: 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.tv-gutter { font-size: .7rem; align-self: start; padding-top: 3px; }
.tv-banner-grid { grid-column: 2 / -1; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-auto-rows: 1.5rem; gap: 2px 4px; }
.tv-banner {
  padding: 1px 8px; border-radius: 6px; font-size: .78rem; line-height: 1.5rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  background: color-mix(in srgb, var(--c, var(--muted)) 22%, var(--card)); box-shadow: inset 3px 0 0 var(--c, var(--muted));
}
.tv-hours { display: flex; flex-direction: column; }
.tv-hours span { height: var(--hour); font-size: .7rem; color: var(--muted); font-variant-numeric: tabular-nums; transform: translateY(-.55em); }
.tv-col { position: relative; border-left: 1px solid var(--line); display: flex; flex-direction: column; height: calc(var(--hour) * var(--hours)); }
.tv-col.today { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.tv-col .slot { display: block; flex: none; height: var(--hour); border-top: 1px solid var(--line); text-decoration: none; }
.tv-col a.slot:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.blk {
  position: absolute; padding: 2px 6px; border-radius: 8px; overflow: hidden; font-size: .76rem; line-height: 1.3; min-width: 0;
  background: color-mix(in srgb, var(--c, var(--muted)) 20%, var(--card)); box-shadow: inset 3px 0 0 var(--c, var(--muted)), 0 0 0 1px var(--card);
}
.blk.short { padding-top: 1px; padding-bottom: 0; white-space: nowrap; }
.blk.short time, .blk.short a, .blk.short span.plain { display: inline; }
.blk.short time { margin-right: 4px; }
.blk.short .muted { display: none; }
.blk time { display: block; color: var(--muted); font-variant-numeric: tabular-nums; font-size: .7rem; }
.blk .muted { display: block; font-size: .7rem; }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--rose-ink, #d33); z-index: 2; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: inherit; }
.tv-list { display: none; }
.tv-list-day { padding: 8px 0; border-bottom: 1px solid var(--line); }
.tv-list-day:last-child { border-bottom: 0; }
.tv-list-day { scroll-margin-top: 12px; }
.tv-list-day h3 { display: flex; justify-content: space-between; margin: 0 0 6px; font-size: .95rem; text-transform: none; letter-spacing: 0; color: var(--ink); }
.tv-list-day.today h3 { color: var(--accent); }
@media (max-width: 640px) {
  .timeview.week-grid { display: none; }
  .tv-list { display: block; }
  .timeview { --gutter: 2.4rem; }
}

/* ---- repeat part of the event form ---- */
.form .check { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; color: var(--ink); font-size: .92rem; }
.form .check input[type=date], .form .check input[type=number] { width: auto; }
.repeat-days { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.repeat-days .check { margin: 0; }
.form .hint { font-size: .78rem; margin: 4px 0 0; }
fieldset.repeat, fieldset.scope { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.delete-form { margin-top: 18px; }
.form input[type=number] { width: 5.5rem; }

/* ---- arranging the shopping list ---- */
.arrange-link { margin-left: 8px; font-weight: 400; }
.arrange-help { font-size: .82rem; margin: 0 0 8px; }
.shopping .drag-handle { cursor: grab; color: var(--muted); padding: 0 4px; user-select: none; }
.shopping li.dragging { opacity: .45; }

/* ---- all / my tasks ---- */
.task-filter { display: flex; gap: 6px; margin: 0 0 10px; }
.task-filter .chip { text-decoration: none; border: 1px solid var(--line); --c: var(--accent); --c-ink: var(--ink); padding: 3px 12px; }
.task-filter .chip.on { background: color-mix(in srgb, var(--accent) 22%, var(--card)); border-color: var(--accent); font-weight: 600; }

/* ---- meals ---- */
/* four days: side by side from tablet width (two by two on a tablet); on a phone one day at a time, picked from the strip of chips */
.slider-track { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr)); align-items: start; }
.day-strip-nav, .more-menu { display: none; }
.week-head { align-items: center; }
.week-jump { display: inline-flex; margin: 0; }
.week-range { position: relative; overflow: hidden; font-weight: 600; white-space: nowrap; }
.week-range input[type=date] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.week-jump.js .jump-go { display: none; }
.week-jump .jump-go { margin-left: 6px; }
.week-jump.js .week-range { cursor: pointer; }
.meal-off-note { font-size: .82rem; margin: 8px 0 0; }
@media (min-width: 700px) { .meal-off-note { display: none; } .today-link { order: 0; } .week-head .week-range span { font-weight: 600; } }
@media (max-width: 699px) {
  .day-strip-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; margin: 6px 0 4px; }
  .dchip { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; min-height: 58px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--muted); font-size: .72rem; text-decoration: none; }
  .dchip b { font-size: 1rem; font-weight: 600; color: var(--ink); }
  .dchip i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: block; }
  .dchip i.none { background: transparent; border: 1px solid var(--line); }
  .dchip.today b { text-decoration: underline; }
  .dchip[aria-current="date"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
  .dchip[aria-current="date"] b { color: var(--on-accent); }
  .dchip[aria-current="date"] i { background: var(--on-accent); }
  .slider-track { display: block; }
  .slider-track > .meal-day:not(.selected) { display: none; }
  .slider-track > .meal-day { margin-top: 8px; }
  header.top:has(.week-head) { flex-wrap: wrap; }
  header.top > .top-nav { min-width: 0; flex: 1 1 100%; }
  .top-nav > .wide-only, .top-nav > .today-link { display: none; } .top-nav > .btn.primary { flex: 1 1 0; }
  .more-menu { display: block; position: relative; flex: none; margin-left: 6px; }
  .more-menu > summary { list-style: none; cursor: pointer; }
  .more-menu > summary::-webkit-details-marker { display: none; }
  .more-menu[open] .more-items { position: absolute; right: 0; z-index: 5; min-width: 12rem; display: grid; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
  .more-items .menu-item { padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); }
  .top-nav > .btn-group.week-head { flex: 1 1 100%; min-width: 0; justify-content: space-between; }
  .top-nav > .btn-group.week-head .week-jump { flex: 1 1 0; min-width: 0; }
  .top-nav > .btn-group.week-head { flex-wrap: nowrap; gap: 4px; }
  .top-nav > .btn-group.week-head > .btn, .week-head > .more-menu > .btn { flex: 0 0 44px; min-width: 44px; }
  .week-head .week-range { min-width: 0; max-width: 100%; flex: 1 1 auto; justify-content: center; border-color: transparent; background: transparent; }
  .week-head .week-range span { overflow: hidden; text-overflow: ellipsis; }
}
.meal-day h2 { font-size: 1rem; }
.meal-day.today { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: -2px; }
.meal-slots { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.meal-slot { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; }
.meal-slot-name { grid-column: 1 / -1; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.meal-what { display: grid; gap: 2px; overflow-wrap: break-word; min-width: 0; }
.meal-safety { margin: 18px 0; color: var(--muted); font-size: .9rem; text-align: center; }

/* meals, phase 2: labels, recipes, ingredient rows, food profile */
.meal-label { color: var(--danger, #b3261e); font-size: .85rem; font-weight: 600; }
p.meal-label { margin: 10px 0; text-align: center; }
.ingredient-rows .ingredient-row { display: grid; grid-template-columns: 2fr 1fr auto; gap: 8px; align-items: center; margin-bottom: 6px; }
.recipes .tag-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.recipes .chip.on { outline: 2px solid var(--accent); }
.recipe-list li { align-items: start; }
.recipe-list .grow { display: grid; gap: 4px; }
.food-consent { background: var(--surface-2, rgba(127, 127, 127, .12)); border-radius: 8px; padding: 10px 12px; }
form.inline { display: inline; }

/* OhAI's meal proposals: the button on the plan page and the sheet */
.proposal-row .meal-what { display: grid; gap: 6px; }
.proposal-row input[type="text"] { width: 100%; }
.proposal-reason { font-size: .85rem; }
.lookup-row { display: grid; gap: 6px; }
.lookup-row input[type="text"] { width: 100%; }
.lookup-sources { padding-left: 1.2em; }

/* ---- phone pass (meals and the shared header) ---- */
.btn-group { display: inline-flex; gap: 6px; flex: none; }
@media (max-width: 600px) {
  /* header: brand and theme on the first row; the account buttons on one tidy row below, the address cut short */
  .site-nav { gap: 6px 8px; }
  .site-nav .btn.small { padding: 3px 9px; font-size: .78rem; }
  .site-nav .who { max-width: 4.4rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .site-nav .main-nav { order: 5; flex: 1 1 100%; margin-left: 0; gap: 2px; }
  .site-nav .main-nav .nav-link { flex: 1 1 0; min-width: 0; padding: 8px 2px; text-align: center; font-size: .8rem; overflow: hidden; text-overflow: ellipsis; }
  .site-nav .crumb { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .site-nav form.inline { margin-left: auto; }
  /* page toolbars: buttons share the row instead of leaving ragged gaps */
  .top-nav { gap: 8px; }
  .top-nav > .btn { flex: 1 1 auto; text-align: center; }
  .top-nav > .btn-group { flex: 1 1 100%; }
  .top-nav > .btn-group .btn { flex: 1 1 auto; text-align: center; }
}
@media all {
  /* the plan and the widget: the slot name beside the dish, not above it */
  .slider-track .meal-day { padding: 12px 14px; }
  .meal-day h2 { margin-bottom: 8px; }
  .slider-track .meal-slots { gap: 8px; }
  .slider-track .meal-slot { grid-template-columns: 4.6rem minmax(0, 1fr) auto; gap: 0 10px; align-items: start; padding-top: 8px; border-top: 1px solid var(--line); }
  .slider-track .meal-slot:first-child { border-top: 0; padding-top: 0; }
  .slider-track .meal-slot-name { grid-column: auto; font-size: .7rem; letter-spacing: .05em; padding-top: 3px; }
  .slider-track .meal-slot > .btn { grid-column: 3; align-self: center; }
  .slider-track .meal-slot.empty .meal-slot-name { align-self: center; padding-top: 0; }
}
.meal-day.today { border-left: 4px solid var(--accent); }
.meal-day.today h2 .muted { color: var(--accent); font-weight: 600; }

/* ---- meals: ingredient rows, secondary actions, quiet days, the plan toolbar ---- */
.ingredient-rows .ingredient-row { grid-template-columns: minmax(0, 1fr) minmax(5.5rem, 8rem) 2rem; }
.ingredient-row input[type="text"] { width: 100%; min-width: 0; }
.remove-row { position: relative; display: grid; place-items: center; width: 2rem; height: 2rem; margin: 0 !important; border-radius: 8px; color: var(--muted); cursor: pointer; font-size: .95rem; }
.remove-row.none { cursor: default; }
.remove-row input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.remove-row:not(.none):hover, .remove-row:has(input:focus-visible) { color: var(--rose-ink); outline: 2px solid color-mix(in srgb, var(--rose, #b3261e) 40%, transparent); }
.remove-row:has(input:checked) { background: color-mix(in srgb, var(--rose, #b3261e) 22%, transparent); color: var(--rose-ink); }
.ingredient-row:has(.remove-row input:checked) input[type="text"] { opacity: .45; text-decoration: line-through; }
.ingredient-rows .extra-row { display: none; }
.ingredient-rows .more-toggle:checked ~ .extra-row { display: grid; }
.ingredient-rows .more-toggle:checked ~ .more-label { display: none; }
.ingredient-rows .more-toggle:focus-visible ~ .more-label { outline: 2px solid var(--accent); outline-offset: 2px; }
.ingredient-rows .more-label { margin-top: 4px; cursor: pointer; }
.actions.secondary { margin-top: 10px; gap: 8px; }
.actions.secondary form.inline { display: contents; }
@media (max-width: 520px) {
  .ingredient-rows .ingredient-row { grid-template-columns: minmax(0, 1fr) 5rem 1.75rem; gap: 6px; }
  .remove-row { width: 1.75rem; }
}
@media (max-width: 600px) {
  .meal-form .actions { position: sticky; bottom: 0; z-index: 3; margin: 14px -4px 0; padding: 10px 4px; background: var(--card); border-top: 1px solid var(--line); }
  .actions.secondary .btn, .actions.secondary form { flex: 1 1 auto; text-align: center; }
  .actions.secondary form button.btn { width: 100%; }
}

/* ---- meal settings grid and autosave ---- */
.slot-grid { border-collapse: collapse; width: 100%; max-width: 30rem; }
@media (max-width: 359px) {
  .slot-grid th, .slot-grid td { padding: 6px 2px; }
  .slot-grid thead th { letter-spacing: 0; font-size: .7rem; }
}
input[type=file] { max-width: 100%; font-size: .9rem; } /* #152 W7: the picture chooser stays inside its card at 320 px */
.top .top-nav .btn { white-space: nowrap; } /* #152 W9 */
.top { flex-wrap: wrap; }
.slot-grid th, .slot-grid td { padding: 6px 4px; text-align: center; font-weight: 500; font-size: .85rem; }
.slot-grid th[scope="row"] { text-align: left; font-size: .9rem; white-space: nowrap; }
.slot-grid thead th { color: var(--muted); font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; }
.slot-grid tbody tr { border-top: 1px solid var(--line); }
.slot-grid th .grid-tick.head, .slot-grid th[scope="row"] .grid-tick.head { display: inline-flex; margin: 0 6px 0 0; vertical-align: middle; }
.slot-grid thead th .grid-tick.head { display: flex; justify-content: center; margin: 0 0 4px; }
.slot-grid .grid-tick { display: inline-flex; align-items: center; justify-content: center; min-width: 2.2rem; min-height: 2.2rem; margin: 0; cursor: pointer; }
.slot-grid input[type="checkbox"] { width: 1.15rem; height: 1.15rem; margin: 0; }
.autosave-status { color: var(--muted); font-size: .85rem; }
.autosave-status.failed { color: var(--rose-ink); font-weight: 600; }
fieldset[disabled] .slot-grid .grid-tick { cursor: default; opacity: .75; }
@media (max-width: 400px) { .slot-grid thead th { font-size: .66rem; letter-spacing: 0; } .slot-grid th[scope="row"] { font-size: .82rem; } }
.recipe-filter { margin-bottom: 6px; }

/* ---- tasks, shopping, expenses: a summary row that opens in place ---- */
.fold { padding: 0; }
.fold > summary { list-style: none; cursor: pointer; padding: 14px 18px; border-radius: var(--radius); }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary h2 { margin: 0; }
.fold > summary h2::after { content: "›"; margin-left: auto; padding-left: 10px; color: var(--muted); font-size: 1.3rem; line-height: 1; transition: transform .15s; }
.fold[open] > summary h2::after { transform: rotate(90deg); }
.fold > summary:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.fold > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.fold > :not(summary) { margin-left: 18px; margin-right: 18px; }
.fold[open] { padding-bottom: 18px; }
@media (prefers-reduced-motion: reduce) { .fold > summary h2::after { transition: none; } }

/* ================= Apple-like layer (approved mockups: docs/design/web-*.svg) ==========   Soft grey page, white rounded cards, hairlines, large titles, pill controls. It restyles; it adds no behaviour. */
:root { --bg: #f5f5f7; --ink: #1d1d1f; --muted: #6e6e73; --line: #e5e5ea; --radius: 20px; --shadow: none; --fill: #ececf0; --bar: rgb(255 255 255 / .86); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]){ --fill: #2a3236; --bar: rgb(27 33 36 / .86); } }
:root[data-theme="dark"]{ --fill: #2a3236; --bar: rgb(27 33 36 / .86); }
body { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter, "Segoe UI", Roboto, sans-serif; padding-top: 0; }
h1 { font-size: 2.1rem; font-weight: 700; letter-spacing: -.022em; }
.top { margin: 28px 0 22px; }
.top > div { display: flex; flex-direction: column; }
.top > div > h1 { order: 1; }
.top > div > .app-sub { order: 2; margin-top: 4px; }
.top > div > .people { order: 3; }

/* the bar: translucent white, full width, sticky */
.site-nav { position: sticky; top: 0; z-index: 30; margin: 0 -16px 0; padding: 10px 16px; border-bottom: 0; }
/* the full-width translucent band sits behind the bar; the bar itself is not clipped, so the menus can drop below it */
.site-nav::before { content: ""; position: absolute; z-index: -1; top: 0; bottom: 0; left: 50%; width: 100vw; margin-left: -50vw; background: var(--bar); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
body { overflow-x: clip; }
.site-nav .brand { font-weight: 700; }
.main-nav { margin-left: 24px; gap: 4px; }
.nav-link { padding: 6px 14px; border-radius: 99px; font-size: .9rem; }
.nav-link.current { background: var(--fill); color: var(--ink); font-weight: 600; }
.menu-panel { border-radius: 16px; box-shadow: 0 20px 50px rgb(0 0 0 / .16); }

/* cards and buttons */
.card { border-radius: var(--radius); box-shadow: none; }
.card h2 { font-size: 1.1rem; font-weight: 700; letter-spacing: -.01em; }
.btn { border-radius: 99px; }
.btn.primary { box-shadow: none; }

/* pill controls: view switch, period switch, filters */
/* #389 the Day | Week | Month switch: one definition (was a flex row of outlined chips, then restyled below) */
.view-switch { display: inline-flex; gap: 0; margin: 0 0 10px; padding: 3px; background: var(--fill); border: 0; border-radius: 12px; }
.view-switch .chip { --c: var(--accent); --c-ink: var(--ink); padding: 5px 18px; border: 0; border-radius: 9px; background: none; color: var(--seg-off); font-size: .85rem; font-weight: 500; text-decoration: none; }
.view-switch .chip.on { background: var(--seg-thumb); color: var(--seg-on); border-color: var(--accent); font-weight: 600; box-shadow: var(--seg-shadow), var(--seg-rim); }
.month-filter .chip, .task-filter .chip { border: 0; border-radius: 99px; background: var(--fill); }
.month-filter .chip[class*="c-"]:not(.all) { background: color-mix(in srgb, var(--c) 18%, var(--card)); }
.month-filter .chip.on { background: var(--accent); color: var(--on-accent, #fff); border: 0; } /* the selected chip is the accent colour, light and dark */

/* the Shopping and Expenses tiles on Home, and their own pages */
.tile { display: block; padding: 22px; color: var(--ink); text-decoration: none; transition: transform .15s ease, border-color .15s; }
.tile:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--ink) 22%, var(--line)); }
.tile h2 { font-size: .9rem; font-weight: 700; }
.tile .big { margin-top: 14px; font-size: 1.9rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.tile .muted { font-size: .8rem; margin-top: 2px; }
.page-narrow { max-width: 720px; margin: 0 auto; }
.page-wide { max-width: 1120px; margin: 0 auto; }
.panel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.panel-head .arrange-link { margin-left: auto; }
@media (prefers-reduced-motion: reduce) { .tile { transition: none; } }

/* calendar bar: title left; Day/Week/Month, previous/today/next and add on the right */
.top-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.top-nav .view-switch { margin: 0 8px 0 0; }
/* #302 at phone width Day / Week / Month spans the content width, three equal segments, like the person chips and the apps */
@media (max-width: 640px) {
  .top-nav .view-switch { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); flex: 1 1 100%; margin: 0 0 2px; }
  .view-switch .chip { text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 8px 6px; }
}
.top-nav .btn:not(.primary) { background: var(--fill); border-color: transparent; color: var(--ink); }
.month-filter { margin: 0 0 14px; }
.page .card + .card { margin-top: 16px; }

/* recipe from a link or pasted text: the check page */
.source-host { margin: -4px 0 8px; }
.recipe-import .actions { position: sticky; bottom: 0; background: var(--card); padding: 10px 0; }
@media (min-width: 640px) { .recipe-import .actions { position: static; padding: 0; background: none; } }

/* the front page: calm hero, a preview of Home, four plain rows, three steps */
.landing { gap: 48px; padding-top: 2vh; text-align: center; }
.hero { display: grid; gap: 28px; justify-items: center; }
.hero-copy { max-width: 36rem; }
.hero .eyebrow { display: block; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); line-height: 1.06; letter-spacing: -.03em; margin: 8px 0 14px; }
.hero .lead { color: var(--muted); font-size: 1.1rem; margin-inline: auto; }
.hero .actions { justify-content: center; margin-top: 22px; }
.preview { background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: none; background-image: none; transform: none; padding: 18px; text-align: left; max-width: 440px; }
.preview-note { margin: 0; text-align: center; font-size: .75rem; color: var(--muted); }
.features { max-width: 36rem; margin-inline: auto; width: 100%; text-align: left; }
.features ul { display: grid; }
.features li { display: flex; gap: 14px; align-items: flex-start; padding: 16px 0; border-top: 1px solid var(--line); }
.features li:last-child { border-bottom: 1px solid var(--line); }
.features h3 { margin: 0; font-size: 1.05rem; font-weight: 700; text-transform: none; letter-spacing: 0; color: var(--ink); }
.features p { margin: 4px 0 0; color: var(--muted); font-size: .92rem; line-height: 1.5; }
.feature-icon { flex: none; width: 40px; height: 40px; border-radius: 12px; background: color-mix(in srgb, var(--c, var(--accent)) var(--tile-tint, 38%), var(--card)); }
.how .steps-row { gap: 28px; }
.how .steps-row li { background: none; border: 0; padding: 0; align-content: start; }
.how .steps-row li { grid-template-columns: 40px 1fr; column-gap: 12px; row-gap: 8px; align-items: center; }
.how .steps-row .step-no { margin: 0; }
.how .steps-row li > span:not(.step-no) { grid-column: 1 / -1; align-self: start; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .feature-icon { --tile-tint: 32%; } }
:root[data-theme="dark"] .feature-icon { --tile-tint: 32%; }
@media (min-width: 900px) { .hero { grid-template-columns: 1fr; gap: 28px; } }

/* OhAI on Home: one slim capsule */
.ohai-capsule { margin: 0 0 14px; }
.ohai-capsule-form { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 99px; padding: 6px 6px 6px 16px; }
.ohai-capsule-form:focus-within { border-color: var(--accent); }
.ohai-spark { color: var(--accent); font-size: 1.1rem; }
.ohai-capsule-form input[type=text] { flex: 1; min-width: 0; border: 0; background: none; box-shadow: none; padding: 8px 0; font: inherit; font-size: 1rem; color: var(--ink); outline: none; }
.ohai-go { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--fill); color: var(--muted); font-size: 1.1rem; font-weight: 700; cursor: pointer; transition: background-color .15s, color .15s; }
.ohai-capsule-form:has(input:not(:placeholder-shown)) .ohai-go, .ohai-capsule-form:focus-within .ohai-go { background: var(--accent); color: var(--on-accent); }
@media (prefers-reduced-motion: reduce) { .ohai-go { transition: none; } }

/* weather, the iOS way: city and a big light temperature, one muted line, a calm five-day row, page dots */
.wx-city { min-width: 0; }
.wx:not(.wx-swipe) .wx-city + .wx-city { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.wx-swipe .wx-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.wx-swipe .wx-track::-webkit-scrollbar { display: none; }
.wx-swipe .wx-city { flex: 0 0 100%; scroll-snap-align: center; }
.now { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 2px 12px; }
.now .mid { grid-column: 1; grid-row: 1; }
.big-icon { grid-column: 2; grid-row: 1 / span 2; font-size: 3.4rem; align-self: center; }
.now .rt { grid-column: 1; grid-row: 2; display: flex; flex-wrap: wrap; gap: 2px 8px; text-align: left; font-size: .9rem; color: var(--muted); }
.now .rt strong { font-size: .9rem; font-weight: 500; color: var(--muted); }
.wx-city .now .mid h3 { font-size: 1rem; font-weight: 600; color: var(--ink); }
.temp { font-size: 3.6rem; font-weight: 300; line-height: 1; letter-spacing: -.03em; }
.wx-dots { display: flex; justify-content: center; align-items: center; gap: 4px; margin-top: 10px; }
.wx-dots[hidden] { display: none; }
.wx-dot { appearance: none; border: 0; background: none; width: 20px; height: 20px; padding: 0; cursor: pointer; display: grid; place-items: center; }
.wx-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line); transition: background-color .15s; }
.wx-dot[aria-current="true"]::before { background: var(--ink); }
.wx-dot:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 50%; }
@media (prefers-reduced-motion: reduce) { .wx-dot::before { transition: none; } }

/* ---- the element kit, everywhere: soft fields, quiet grey buttons, tinted banners, switches ---- */
input[type=text], input[type=search], input[type=date], input[type=datetime-local], input[type=time], input[type=email], input[type=password],
input[type=number], input[type=url], input[type=tel], select, textarea {
  border: 1px solid transparent; background: var(--fill); border-radius: 12px; transition: border-color .15s, background-color .15s;
}
input[type=text]:focus, input[type=search]:focus, input[type=date]:focus, input[type=datetime-local]:focus, input[type=time]:focus, input[type=email]:focus,
input[type=password]:focus, input[type=number]:focus, input[type=url]:focus, input[type=tel]:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); background: var(--card);
}
.btn:not(.primary) { background: var(--fill); border-color: transparent; font-weight: 600; }
.btn:not(.primary):hover { border-color: transparent; background: color-mix(in srgb, var(--ink) 10%, var(--fill)); }
/* Apple stays black (white on dark) even though it is not .primary: the two rules above would otherwise grey it, and they come later than .btn.apple-btn. */
.btn.apple-btn:not(.primary) { background: #000; border-color: #000; color: #fff; }
.btn.apple-btn:not(.primary):hover { background: #000; border-color: var(--accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.apple-btn:not(.primary), :root:not([data-theme="light"]) .btn.apple-btn:not(.primary):hover { background: #fff; color: #000; } :root:not([data-theme="light"]) .btn.apple-btn:not(.primary) { border-color: #fff; } }
:root[data-theme="dark"] .btn.apple-btn:not(.primary), :root[data-theme="dark"] .btn.apple-btn:not(.primary):hover { background: #fff; color: #000; }
:root[data-theme="dark"] .btn.apple-btn:not(.primary) { border-color: #fff; }
.btn.danger { background: color-mix(in srgb, var(--rose) 14%, var(--card)); color: var(--rose-ink); }
.btn.danger:hover { background: color-mix(in srgb, var(--rose) 22%, var(--card)); }
.btn.plain-text { background: none; color: var(--accent); }
.flash, .banner { border: 0; box-shadow: none; border-radius: 14px; }
.flash.notice { background: color-mix(in srgb, var(--green) 14%, var(--card)); color: var(--green-ink); box-shadow: none; }
.flash.alert { background: color-mix(in srgb, var(--rose) 14%, var(--card)); color: var(--rose-ink); box-shadow: none; }
.banner { background: color-mix(in srgb, var(--accent) 12%, var(--card)); }
.banner.warning { background: color-mix(in srgb, var(--amber) 16%, var(--card)); }

/* an on/off checkbox as an iOS switch: add class="toggle" to the checkbox */
input[type=checkbox].toggle { appearance: none; flex: none; width: 42px; height: 26px; border-radius: 99px; background: var(--line); position: relative; cursor: pointer; margin: 0; transition: background-color .2s; }
input[type=checkbox].toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .25); transition: transform .2s; }
input[type=checkbox].toggle:checked { background: var(--accent); }
input[type=checkbox].toggle:checked::after { transform: translateX(16px); }
input[type=checkbox].toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { input[type=checkbox].toggle, input[type=checkbox].toggle::after { transition: none; } }
.form .check.switch { justify-content: space-between; flex-direction: row-reverse; padding: 10px 0; }

/* list pages: title row with the actions on the right, quiet rows, a "⋯" menu per row */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.page-head h1 { margin-bottom: 0; }
.page-head-actions { display: flex; gap: 8px; margin: 0; }
.row-menu { position: relative; margin-left: auto; flex: none; }
.row-menu-btn { list-style: none; cursor: pointer; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); font-size: 1.3rem; line-height: 1; }
.row-menu-btn::-webkit-details-marker { display: none; }
.row-menu-btn:hover, .row-menu[open] .row-menu-btn { background: var(--fill); color: var(--ink); }
.row-menu-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.row-menu .menu-panel { min-width: 170px; }
.row-menu .menu-panel form.inline { display: block; margin: 0; }
.menu-item.danger-text { color: var(--rose-ink); }

/* form pages: small labelled sections, each an inset soft group; Cancel and Save in one bar */
.form-section { margin: 18px 0 6px; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.form-group { background: var(--bg); border-radius: 14px; padding: 12px 14px 4px; margin-bottom: 8px; }
.form-group .field { margin-bottom: 12px; }
.form-group input[type=text], .form-group input[type=datetime-local], .form-group select { background: var(--card); }
.form .actions { display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: center; gap: 10px; margin-top: 18px; }
.form .actions .spacer { display: none; }
@media (max-width: 520px) { .form .actions { position: sticky; bottom: 0; background: var(--card); padding: 12px 0; border-top: 1px solid var(--line); } }
.tile.shopping:hover { transform: none; }

/* Recipe next steps: "When do you want to make it?" (a day strip, OhAI's pick already chosen) */
.when-card h2 { margin-bottom: 12px; }
.day-strip { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.day-opt { display: block; position: relative; cursor: pointer; }
.day-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.day-chip { display: block; position: relative; text-align: center; background: var(--fill); border-radius: 14px; padding: 8px 0 12px; min-height: 62px; color: var(--ink); }
.day-chip small { display: block; font-size: .72rem; color: var(--muted); }
.day-chip b { display: block; font-size: 1.05rem; font-weight: 600; line-height: 1.25; }
.day-chip .dot, .day-legend .dot { position: absolute; left: 50%; bottom: 5px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--amber); }
.day-legend .dot { position: static; display: inline-block; margin: 0 4px 1px 0; }
.day-opt input:checked + .day-chip { background: var(--accent); color: var(--on-accent); }
.day-opt input:checked + .day-chip small { color: inherit; opacity: .85; }
.day-opt input:checked + .day-chip .dot { background: currentColor; opacity: .8; }
.day-opt input:focus-visible + .day-chip { outline: 2px solid var(--accent); outline-offset: 2px; }
.day-opt input:disabled + .day-chip { opacity: .45; }
.day-opt input:disabled { cursor: not-allowed; }
.day-legend { font-size: .78rem; margin: 10px 2px 0; }
.pick-line { display: flex; gap: 10px; align-items: flex-start; background: color-mix(in srgb, var(--accent) 13%, var(--card)); border-radius: 14px; padding: 11px 13px; margin: 14px 0 0; }
.pick-line .spark { flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-size: .7rem; margin-top: 1px; }
.meal-seg { display: inline-flex; border: 0; background: var(--fill); border-radius: 12px; padding: 3px; margin: 14px 0 0; }
.meal-seg label { position: relative; }
.meal-seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.meal-seg span { display: block; padding: 6px 18px; border-radius: 9px; font-size: .93rem; }
.meal-seg input:checked + span { background: var(--card); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); font-weight: 600; }
.meal-seg input:focus-visible + span { outline: 2px solid var(--accent); }
.meal-seg label.off span { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.when-form .btn.primary { width: 100%; margin-top: 16px; }
.actions-quiet { text-align: center; margin: 10px 0 0; }
.actions-quiet a { color: var(--muted); }
.link-hint .spark { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: .6rem; vertical-align: 1px; }

/* meals: a very narrow phone gets a tighter nav */
@media (max-width: 359px) { .site-nav .main-nav .nav-link { font-size: .7rem; padding: 8px 0; } }
@media (max-width: 699px) { .week-range .range-long { display: none; } }
@media (min-width: 700px) { .week-range .range-short { display: none; } }

/* ---- phone: nothing runs off the edge (OhAI box, People, Account, Calendars) ---- */
@media (max-width: 600px) {
  /* the OhAI box opens under the whole header, inside the screen, not from its button's right edge */
  .site-nav { position: relative; }
  /* rows wrap: name first, then the badges and the address beneath; long words break only when they must */
  .rows li { flex-wrap: wrap; gap: 4px 10px; }
  .rows li > strong { min-width: 0; overflow-wrap: break-word; }
  .rows li > .muted, .rows li > .chip { min-width: 0; overflow-wrap: anywhere; }
  .rows li > .spacer { display: none; }
  .rows.sessions li > strong { flex: 1 1 100%; overflow-wrap: break-word; } /* #386: the device name gets its own line, the address and the button under it */
  .rows.members li > .inline-form { margin-left: 0; }
  .rows.members li > strong { flex: 1 1 100%; overflow-wrap: break-word; word-break: normal; } /* #390: an email gets its own line and breaks only at the @ or the dot it must */
  .rows li > .btn, .rows li > .chip, .rows li > form, .rows li > .row-menu, .rows li > details { margin-left: auto; }
  .source .calendars li strong.grow, .rows.calendars li strong.grow { flex: 1 1 100%; overflow-wrap: break-word; word-break: normal; hyphens: auto; }
  .source header { flex-wrap: wrap; }
}
/* a tick row whose text runs on: the box stays at the first line and the words wrap as one block, not in ragged columns */
.form .check:has(.check-text) { align-items: flex-start; }
.form .check .check-text { min-width: 0; overflow-wrap: break-word; }
.form .check:has(.check-text) input[type=checkbox] { margin-top: .2em; flex: none; }

/* recipe from a link / paste: the ingredients as tidy rows (tick, name, amount), no browser box around them */
.recipe-import fieldset.meal-items { border: 0; padding: 0; margin: 14px 0; min-width: 0; }
.recipe-import .meal-items legend { padding: 0; margin-bottom: 6px; font-weight: 600; }
.recipe-import .checks li { padding: 8px 0; }
.recipe-import .checks label { display: grid; grid-template-columns: 1.4rem minmax(0, 1fr) minmax(5rem, 8rem); gap: 6px 10px; align-items: center; }
.recipe-import .checks label .muted { grid-column: 2 / -1; font-size: .82rem; }
.recipe-import .checks input[type=text] { width: 100%; min-width: 0; font-size: 1rem; padding: 9px 12px; }
@media (max-width: 420px) {
  .recipe-import .checks label { grid-template-columns: 1.4rem minmax(0, 1fr); }
  .recipe-import .checks label input[type=text]:nth-of-type(3) { grid-column: 2; }
}

/* shopping panel: the amount field is wide enough for "0.75 žlica" at 375 and 320; the name takes the first row, amount and Add share the second */
form.quick:not(.shop-bar):has(input[name$="[quantity]"]) input[name$="[quantity]"] { flex: 1 1 8.5rem; }
@media (max-width: 600px) {
  form.quick:not(.shop-bar):has(input[name$="[quantity]"]) { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
  form.quick:not(.shop-bar):has(input[name$="[quantity]"]) input[name$="[name]"] { grid-column: 1 / -1; }
  form.quick:not(.shop-bar):has(input[name$="[quantity]"]) input[type=text] { width: 100%; min-width: 0; font-size: .95rem; padding-left: 9px; padding-right: 9px; }
}
.pick-line[hidden] { display: none; }
.when-weeks { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 8px; }
.when-weeks .when-range { font-weight: 600; text-align: center; min-width: 0; }
.when-weeks .btn.off { opacity: .35; }

/* ---- the food preferences wizard (docs/design/setup-wizard-mockup.html) ---- */
.wizard { max-width: 560px; margin: 0 auto; }
.wiz-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.wiz-card h2 { margin: 0 0 4px; font-size: 1.25rem; }
.wiz-step { margin: 0 0 4px; color: var(--muted); font-size: .82rem; }
.wiz-rows { list-style: none; margin: 10px 0; padding: 0; }
.wiz-rows li { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.wiz-rows li:last-child { border-bottom: 0; }
.wiz-summary li > .muted { flex: 1 1 10rem; min-width: 0; overflow-wrap: anywhere; }
.wiz-eats { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; width: 100%; }
.wiz-check { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; padding: 6px 0; }
.wiz-check input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); flex: none; }
.wiz-consent { background: var(--fill); border-radius: 14px; padding: 12px 14px; margin: 10px 0; }
.wiz-consent p { font-size: .9rem; margin: 0 0 8px; }
.wiz-wait { background: color-mix(in srgb, var(--amber) 16%, var(--card)); color: var(--amber-ink); border-radius: 14px; padding: 12px 14px; }
.wiz-fields { border: 0; padding: 0; margin: 0; min-width: 0; }
.wiz-fields.locked { opacity: .45; pointer-events: none; }
.wiz-kind { border: 0; padding: 0; margin: 12px 0; min-width: 0; display: flex; flex-direction: column; }
.wiz-kind legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
.wiz-kind > input[type=text] { order: 2; width: 100%; font-size: 1rem; padding: 10px 12px; }
.wiz-chips { order: 1; display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.wiz-notice { order: 3; margin: 6px 0 0; font-size: .82rem; color: var(--muted); border-left: 3px solid var(--accent); padding-left: 10px; }
.wiz-suggest { order: 4; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.wiz-chip { position: relative; display: inline-flex; }
.wiz-chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.wiz-chip span, button.wiz-chip { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 99px; background: var(--card); color: var(--ink); font: inherit; font-size: .9rem; }
.wiz-chip input[data-diet]:checked + span::before { content: "\2713"; margin-right: 6px; } /* Off chips reserve no room for the check (Design): a small reflow when one turns on */
.wiz-chip.is-excluded span { opacity: .4; }
.wiz-chip.is-covered span { opacity: .5; }
.wiz-chip.is-excluded input, .wiz-chip.is-covered input { cursor: default; }
.wiz-reasons { order: 1; margin: 0 0 8px; }
.wiz-reason { font-size: .82rem; margin: 2px 0; }
.wiz-chip input:checked + span { background: var(--fill); border-color: var(--accent); font-weight: 600; }
.wiz-chip input:focus-visible + span, button.wiz-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wiz-pick { cursor: pointer; border-style: dashed; }
.wiz-hint { font-size: .82rem; }
.wiz-foot { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.wiz-foot .btn.primary { flex: 2; }
.wiz-foot .btn { min-height: 44px; }
.wiz-foot .btn.quiet { border-color: transparent; background: transparent; color: var(--muted); }
.wiz-foot-stack { flex-direction: column; align-items: stretch; }
.wiz-foot-stack form { display: block; }
.wiz-foot-stack .btn { width: 100%; justify-content: center; }
.wiz-aside, .wiz-removeform { margin: 14px 0 0; }
.wiz-link { background: none; border: 0; padding: 6px 0; color: var(--muted); text-decoration: underline; font: inherit; font-size: .85rem; cursor: pointer; }
.wiz-banner { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin: 0 0 12px; }
.wiz-banner .grow { flex: 1 1 12rem; }
.wiz-banner form { display: inline; margin: 0; }
.wiz-banner .btn.quiet { border-color: transparent; background: transparent; color: var(--muted); }
.wizard [hidden] { display: none !important; }

/* "Find ingredients": the tick on its own line, then name and amount (side by side where there is room), never three ragged columns */
/* #289: one row = box, ingredient, quantity (22px | 1.4fr | 1fr), the same three columns on every width; name and quantity are auto-growing textareas that wrap. #280: the Select all bar. */
.lookup-head, .lookup-rows .lookup-row { display: grid; grid-template-columns: 22px minmax(0, 1.4fr) minmax(0, 1fr); gap: 6px 8px; align-items: start; }
.lookup-head { font-size: .8rem; color: var(--muted); padding: 0 0 2px; }
.lookup-head .lookup-head-use { display: block; width: 22px; height: 1px; overflow: hidden; white-space: nowrap; } /* "Use this" is not shown (it overlapped "Ingredient") but stays in the page, in its own 22 px column */
.lookup-rows .lookup-row > .muted, .lookup-rows .lookup-row > .meal-label { grid-column: 2 / -1; }
.lookup-rows .lookup-row input[type=checkbox] { width: 22px; height: 22px; margin: 6px 0 0; }
.lookup-rows .lookup-row textarea.grow { min-width: 0; width: 100%; resize: none; overflow: hidden; field-sizing: content; font: inherit; font-size: 1rem; }
.list-select-bar { margin: 0 0 6px; }
[data-repeat-details][hidden] { display: none; }

/* the OhAI box at the top of the initials menu */

/* Home, 1100px and up: two columns by kind (home_columns.js moves the widgets; below that, or without the script, nothing changes) */
@media (min-width: 1100px) {
  .grid.two-col { column-count: auto; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
  .grid.two-col > .col { display: grid; gap: 16px; align-content: start; min-width: 0; }
  .grid.two-col .widget { margin-bottom: 0; }
  .grid.two-col .widget[data-widget="weather"], .grid.two-col .widget.wide { column-span: none; }
}
/* the in-page "are you sure?" (confirm_dialog.js) */
.confirm-dialog { border: 1px solid var(--line); border-radius: 18px; padding: 18px; background: var(--card); color: var(--ink); width: min(22rem, calc(100vw - 32px)); box-shadow: 0 20px 50px rgb(0 0 0 / .25); }
.confirm-dialog::backdrop { background: rgb(0 0 0 / .35); }
.confirm-dialog #confirm-question { margin: 0 0 14px; overflow-wrap: anywhere; }
.confirm-dialog #confirm-question strong { display: block; font-weight: 700; }
.confirm-dialog #confirm-question p { margin: 4px 0 0; font-weight: 400; color: var(--muted); }
.confirm-actions { display: flex; gap: 8px; justify-content: space-between; }
.confirm-actions .btn { flex: 1; }
.confirm-actions .btn { min-height: 44px; }

/* Setup wizard, People step: the add row (name and Add on one line, Adult / Child under them), roles on the right, buttons centred */
.wiz-add { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; margin-top: 10px; }
.wiz-add .field { grid-column: 1; grid-row: 1; margin: 0; min-width: 0; }
.wiz-add .field input[type=text] { width: 100%; min-width: 0; font-size: 1rem; padding: 10px 12px; min-height: 44px; }
.wiz-add .btn { grid-column: 2; grid-row: 1; min-height: 44px; }
.wiz-add .wiz-kind { grid-column: 1 / -1; grid-row: 2; border: 0; padding: 0; margin: 0; flex-direction: row; flex-wrap: wrap; gap: 8px; }
.wiz-add .wiz-chip span { min-height: 44px; }
.wiz-people li { flex-wrap: nowrap; justify-content: space-between; }
.wiz-people li > strong { min-width: 0; overflow-wrap: anywhere; }
.wiz-people li > .muted { flex: none; font-size: .78rem; padding: 2px 10px; border-radius: 99px; background: var(--fill); color: var(--accent-ink, var(--muted)); }
.wiz-foot .btn, .wiz-banner .btn { display: inline-flex; align-items: center; justify-content: center; text-align: center; }
.wiz-note { margin: 10px 0 0; font-size: .85rem; }
@media (max-width: 340px) { .wiz-card { padding: 14px 12px; } }

/* Home, as the Android app's Home (docs/design/home-today-mockup.html): greeting, OhAI bar, weather, Agenda, On the menu, To do,
   stacked across the page. Hairline cards, no shadows, colour only for people. */
.home-top { margin: 22px 0 16px; }
.home-top h1 { font-size: clamp(2rem, 1.6rem + 1.6vw, 2.4rem); font-weight: 700; letter-spacing: -.022em; line-height: 1.1; margin: 0; }
.home-today { display: grid; gap: 14px; }
.home-today > * { margin: 0; min-width: 0; }
.home-today .card { box-shadow: none; border: 1px solid var(--line); border-radius: 20px; }
.home-today .ohai-capsule-form { border-radius: 22px; min-height: 60px; padding: 8px 8px 8px 18px; gap: 12px; }
.home-today .ohai-spark { font-size: 1.2rem; color: inherit; }
.home-today .ohai-capsule-form input[type=text] { font-size: 1.05rem; }
.home-today .ohai-go { width: 44px; height: 44px; background: none; color: var(--accent); display: grid; place-items: center; }
.home-today .ohai-go svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.home-today .ohai-capsule-form:has(input:not(:placeholder-shown)) .ohai-go, .home-today .ohai-capsule-form:focus-within .ohai-go { background: var(--accent); color: var(--on-accent); }
/* weather: the forecast picture, the city over a thin big temperature, the words on the right; the five-day row stays on the Weather page */
.home-today .weather { padding: 22px; }
.home-today .weather .forecast, .home-today .weather .rt .muted + .muted { display: none; }
.home-today .weather .now { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 16px; }
.home-today .weather .big-icon { grid-column: 1; grid-row: 1; font-size: 2.6rem; }
.home-today .weather .now .mid { grid-column: 2; grid-row: 1; }
.home-today .weather .now .rt { grid-column: 3; grid-row: 1; display: grid; justify-items: end; text-align: right; gap: 2px; }
.home-today .weather .now .rt strong { color: var(--ink); font-weight: 600; font-size: .95rem; }
.home-today .wx-dot[aria-current="true"]::before { width: 18px; border-radius: 99px; background: var(--accent); }
.home-today .wx-dot:has(+ .wx-dot), .home-today .wx-dot { width: auto; min-width: 20px; }
.home-today .weather .now .mid h3 { color: var(--ink); font-weight: 600; font-size: 1rem; }
.home-today .weather .temp { font-size: 3.1rem; font-weight: 200; line-height: 1; }
/* the three blocks */
.today-block { padding: 18px 22px 10px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 2px; }
.block-head h2 { margin: 0; font-size: 1.06rem; font-weight: 700; text-transform: none; letter-spacing: 0; color: var(--ink); }
.block-head .muted { font-size: .82rem; }
.today-block .empty { margin: 0; padding: 12px 0 10px; }
.today-block .birthday { margin: 8px 0 0; }
.today-rows { list-style: none; margin: 4px 0 0; padding: 0; }
.today-rows > li { display: grid; align-items: center; gap: 0 12px; min-height: 52px; padding: 8px 0; border-top: 1px solid var(--line); }
.today-rows > li:first-child { border-top: 0; }
.today-ev { grid-template-columns: 3.2rem 9px minmax(0, 1fr); }
.today-ev time { color: var(--muted); font-size: .88rem; font-variant-numeric: tabular-nums; }
.today-ev .dot { width: 9px; height: 9px; }
.today-rows .what { display: flex; flex-direction: column; min-width: 0; }
.today-rows .what strong, .today-rows .what > a, .today-rows .what > span:first-child { font-weight: 500; overflow-wrap: anywhere; }
.today-rows .what .muted { font-size: .8rem; }
.today-meal { grid-template-columns: 5.25rem minmax(0, 1fr); }
.today-meal .muted { font-size: .82rem; }
.today-meal strong { font-weight: 600; overflow-wrap: anywhere; }
.today-task { grid-template-columns: auto minmax(0, 1fr) auto; }
.today-task .due { display: block; margin: 0; text-align: left; color: var(--rose-ink); font-size: .8rem; font-weight: 600; }
.today-task.late .tick { border-color: var(--rose-ink); }
.today-task.done .what > * { color: var(--muted); text-decoration: line-through; }
.today-task .chip { margin: 0; }
@media (min-width: 900px) {
  .menu-rows { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0 28px; }
  .menu-rows > li { border-top: 0; }
}

/* Tasks page, in the Home style: the count under the title, an Everyone / Mine switch, one add bar (When and Who open under it
   while you type), the open tasks grouped Late, Today, Later on hairline cards, done ones folded away. */
.tasks-top, .tasks-page { max-width: 720px; margin-inline: auto; }
.tasks-top { margin-bottom: 14px; }
.tasks-top .tasks-count { margin: 4px 0 0; font-size: .95rem; }
.tasks-page { display: grid; gap: 18px; }
.tasks-page > * { margin: 0; min-width: 0; }
/* #389 the segmented control (Month | Year | All, the task filters): ONE definition (it used to be three layers that overrode each other) */
.seg { display: flex; gap: 0; padding: 2px; border: 0; border-radius: 10px; background: var(--fill); }
.seg a { flex: 1; text-align: center; padding: 7px 10px; border: 0; border-radius: 8px; background: none; font-size: .88rem; font-weight: 500; color: var(--seg-off); text-decoration: none; }
.seg a.on { background: var(--seg-thumb); color: var(--seg-on); font-weight: 600; box-shadow: 0 0 0 1px var(--line), var(--seg-rim); }
.tasks-add-bar { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 6px 6px 6px 18px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; }
.tasks-add:focus-within .tasks-add-bar { border-color: var(--accent); }
.tasks-add-bar input[type=text] { flex: 1; min-width: 0; border: 0; background: none; box-shadow: none; padding: 8px 0; font: inherit; font-size: 1.02rem; color: var(--ink); outline: none; }
.tasks-add .ohai-go { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: var(--accent); display: grid; place-items: center; cursor: pointer; }
.tasks-add .ohai-go svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tasks-add:has(input[type=text]:not(:placeholder-shown)) .ohai-go, .tasks-add:focus-within .ohai-go { background: var(--accent); color: var(--on-accent); }
.tasks-add-more { display: none; flex-wrap: wrap; gap: 8px; margin: 10px 0 0 6px; }
.tasks-add:focus-within .tasks-add-more, .tasks-add:has(input[type=text]:not(:placeholder-shown)) .tasks-add-more { display: flex; }
.tasks-add .pill { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 6px 0 14px; border-radius: 99px; background: var(--fill); font-size: .88rem; color: var(--muted); }
.tasks-add .pill input, .tasks-add .pill select { border: 0; background: none; box-shadow: none; font: inherit; font-size: .9rem; color: var(--ink); padding: 6px 4px; min-height: 0; width: auto; }
.tasks-add .pill input[type=date] { width: 8.4rem; padding-right: 0; }
.tasks-add .pill { gap: 2px; padding-left: 12px; }
.tasks-group h2 { margin: 0 0 8px 8px; font-size: .85rem; font-weight: 600; color: var(--muted); text-transform: none; letter-spacing: 0; }
.tasks-group.late h2 { color: var(--rose-ink); }
.tasks-page .card.today-rows { margin: 0; padding: 2px 18px; box-shadow: none; border: 1px solid var(--line); border-radius: 20px; }
.tasks-page .today-task { grid-template-columns: auto minmax(0, 1fr); }
.tasks-page .today-task .grow { font-weight: 500; overflow-wrap: anywhere; }
.tasks-page .today-task .meta { display: flex; align-items: center; gap: 6px; font-size: .8rem; margin-top: 2px; }
.tasks-page .today-task .meta .late-when { color: var(--rose-ink); font-weight: 600; }
.tasks-page .today-task .meta .dot { width: 8px; height: 8px; flex: none; }
.tasks-page .today-task.done .grow { color: var(--muted); text-decoration: line-through; }
.tasks-page > .empty { padding: 8px; }
.tasks-done summary { cursor: pointer; padding: 4px 8px 10px; color: var(--accent); font-size: .92rem; font-weight: 500; list-style: none; }
.tasks-done summary::-webkit-details-marker { display: none; }
.tasks-done { position: relative; }
.tasks-done .when-open, .tasks-done[open] .when-closed { display: none; }
.tasks-done[open] .when-open { display: inline; }
.tasks-done-clear-form { position: absolute; top: -6px; right: 0; margin: 0; }
.tasks-done-clear { background: none; border: 0; padding: 4px 8px 10px; color: var(--accent); font: inherit; font-size: .92rem; font-weight: 500; line-height: 1.4; cursor: pointer; display: inline-flex; align-items: center; min-height: 44px; }

/* Adding or changing a meal, in the Home style (docs/design/meal-page-v2-mockup.html): the back link with the save state, the kind as a
   switch, the name over short rows for recipe, cook and note, and the Ingredients card with the OhAI card first. Everything saves as it
   changes, so only Delete is at the bottom. On a wide screen the meal and its ingredients sit side by side. */
.meal-page { padding-bottom: 32px; }
.meal-page > .meal-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.meal-page .autosave-status { font-size: .85rem; font-weight: 400; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.meal-page .autosave-status[data-state=ok]::before { content: "✓"; color: var(--accent); font-weight: 700; }
.meal-page .autosave-status[data-state=busy]::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: meal-spin .8s linear infinite; }
.meal-page .autosave-status[data-state=failed] { color: var(--rose-ink); }
@keyframes meal-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .meal-page .autosave-status[data-state=busy]::before { animation: none; } }
.meal-page > h1 { margin: 6px 0 0; font-size: 2rem; letter-spacing: -.022em; }
.meal-page > .meal-day { margin: 2px 0 16px; }
.meal-page p.meal-label { margin: 0 0 14px; padding: 10px 14px; border-radius: 14px; text-align: left; background: color-mix(in srgb, var(--rose, #b3261e) 12%, var(--card)); color: var(--rose-ink); }
.meal-page .meal-form { margin: 0; }
.meal-cols { display: grid; gap: 24px; align-items: start; }
.meal-cols > * { min-width: 0; margin: 0; }
.meal-main { display: grid; gap: 24px; }
.meal-page .card { margin: 0; padding: 0; box-shadow: none; border: 1px solid var(--line); border-radius: 20px; }
/* the kind */
.meal-kind { border: 0; margin: 0; padding: 2px; border-radius: 12px; }
.meal-kind label { flex: 1; position: relative; margin: 0; }
.meal-kind input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.meal-kind span { display: block; text-align: center; padding: 8px 10px; border-radius: 10px; font-size: .9rem; color: var(--muted); }
.meal-kind input:checked + span { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--line); }
.meal-kind input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
/* the name and the short rows */
.meal-name { padding: 14px 18px 12px; }
.meal-page .meal-name input[type=text] { width: 100%; border: 0; background: none; box-shadow: none; padding: 2px 0; min-height: 0; font: inherit; font-size: 1.25rem; font-weight: 600; color: var(--ink); outline: none; }
.meal-name .hint { margin: 2px 0 0; }
.meal-row { display: grid; grid-template-columns: 6rem minmax(0, 1fr); gap: 4px 10px; align-items: center; min-height: 52px; margin: 0; padding: 6px 18px; border: 0; border-top: 1px solid var(--line); }
.meal-row > label, .meal-row legend { margin: 0; color: var(--muted); font-size: .9rem; font-weight: 400; }
fieldset.meal-row { display: block; }
fieldset.meal-row legend { float: left; width: 6rem; padding: 0; line-height: 34px; margin-right: 10px; }
.meal-page .meal-row select, .meal-page .meal-row input[type=search], .meal-page .meal-row textarea { width: 100%; border: 0; background: none; box-shadow: none; padding: 6px 0; min-height: 0; font: inherit; color: var(--ink); outline: none; }
.meal-row textarea { resize: none; field-sizing: content; min-height: 1.5em; max-height: 10em; }
.meal-row select:focus-visible, .meal-row input:focus-visible, .meal-row textarea:focus-visible { box-shadow: 0 2px 0 var(--accent); }
.cook-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 0; }
.cook-chip { position: relative; margin: 0; }
.cook-chip input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.cook-chip span { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 99px; background: var(--fill); font-size: .85rem; color: var(--ink); }
.cook-chip .dot { width: 8px; height: 8px; }
.cook-chip input:checked + span { background: color-mix(in srgb, var(--accent) 12%, var(--card)); box-shadow: inset 0 0 0 1.5px var(--accent); font-weight: 600; }
.cook-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.meal-form:has(.meal-kind input:not([value=cooked]):checked) .cooked-only { display: none; }
/* ingredients */
.meal-page .meal-steps { margin-top: 24px; padding: 14px 18px 16px; } /* #331: 24 between cards, content on the card's own edge */
.meal-page .meal-steps h3 { margin: 0 0 6px; font-size: 1.05rem; text-transform: none; letter-spacing: 0; color: var(--ink); }
.meal-ingredients .block-head { align-items: center; padding: 14px 18px 4px; }
.meal-ingredients .block-head h2 .muted { font-weight: 400; font-size: .9rem; }
.meal-ingredients .ingredient-rows { margin: 0; padding: 0 18px; border: 0; }
.meal-ingredients .ingredient-rows legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.meal-ingredients .ingredient-row { margin: 0; padding: 2px 0; border-top: 1px solid var(--line); }
.meal-ingredients .ingredient-row:first-of-type { border-top: 0; }
.meal-page .ingredient-row input[type=text] { border: 0; background: none; box-shadow: none; padding: 10px 0; min-height: 0; font: inherit; color: var(--ink); outline: none; }
.meal-page .ingredient-row input[type=text] + input[type=text] { text-align: right; color: var(--muted); }
.meal-page .ingredient-row input[type=text]:focus-visible { box-shadow: 0 2px 0 var(--accent); }
.meal-ingredients .more-label { display: flex; width: 100%; margin: 0; padding: 0; min-height: 48px; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; color: var(--accent); font-weight: 500; }
.ai-fill { margin: 6px 18px 14px; padding: 16px; border-radius: 16px; background: color-mix(in srgb, var(--accent) 10%, var(--card)); }
.ai-fill strong { display: block; overflow-wrap: anywhere; }
.ai-fill p { margin: 4px 0 12px; color: var(--muted); font-size: .85rem; }
.ai-fill .btn { width: 100%; min-height: 44px; }
.ai-fill.slim { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px 12px 16px; }
.ai-fill.slim .hint { display: block; margin: 2px 0 0; color: var(--muted); font-size: .85rem; }
.ai-fill.slim .btn { width: auto; flex: none; min-height: 38px; padding: 0 16px; }
.ai-fill.is-waiting { display: none; }
.ai-work { display: flex; align-items: center; gap: 12px; }
.ai-work[hidden] { display: none; }
.ai-work::before { content: ""; flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid color-mix(in srgb, var(--accent) 25%, transparent); border-top-color: var(--accent); animation: meal-spin .8s linear infinite; }
.ai-work p { margin: 2px 0 0; }
@media (prefers-reduced-motion: reduce) { .ai-work::before { animation: none; } }
.meal-page .ai-fill ~ .ingredient-rows .ingredient-row:first-of-type { border-top: 0; }
.ingredient-foot { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; padding: 12px 18px 14px; border-top: 1px solid var(--line); }
.ingredient-foot .chip-btn { justify-content: center; min-height: 44px; border-radius: 12px; text-align: center; }
.chip-btn { display: inline-flex; align-items: center; min-height: 34px; padding: 0 14px; border: 0; border-radius: 99px; background: var(--fill); color: var(--ink); font: inherit; font-size: .85rem; font-weight: 500; text-decoration: none; cursor: pointer; }
.ingredient-source { margin: 0; padding: 0 18px 12px; font-size: .85rem; }
/* delete (the Save button is only for a browser without the script) */
.meal-foot { display: grid; gap: 10px; margin-top: 0; }
.meal-delete { display: grid; justify-items: start; gap: 6px; }
.meal-delete[hidden], .meal-page .meal-save[hidden] { display: none; }
.meal-delete .check { font-size: .85rem; color: var(--muted); }
.link-danger { border: 0; background: none; padding: 8px 4px; color: var(--rose-ink); font: inherit; font-weight: 500; cursor: pointer; }
.link-danger:hover { text-decoration: underline; }
.meal-page .meal-save { justify-content: center; margin: 0; }
@media (min-width: 900px) {
  .meal-page { max-width: 1040px; padding-bottom: 24px; }
  .meal-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
}
.meal-page .remove-row { display: grid; place-items: center; padding: 0; line-height: 1; align-self: center; }
.meal-page .remove-row span[aria-hidden] { display: block; line-height: 1; }
.meal-ingredients .more-label { font-size: .95rem; }
@media (max-width: 479px) {
  fieldset.meal-row legend { float: none; width: auto; line-height: 1.4; margin: 6px 0 8px; }
  .meal-kind span { padding: 8px 4px; font-size: .84rem; }
}


/* the plan page in the Home style (docs/design/meals-week-mockup.html): four day cards, each meal one row to tap, three actions and a
   settings gear. Home's Meals card keeps its own slot rows (.meals-today). */
.slider-track > .meal-day { margin: 0; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; box-shadow: none; outline: 0; }
.slider-track > .meal-day.today { border-color: transparent; box-shadow: inset 0 0 0 1.5px var(--accent); border-left: 1px solid transparent; }
.slider-track > .meal-day h2 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0; padding: 16px 18px 8px; font-size: 1.05rem; }
.slider-track > .meal-day .day-note { color: var(--muted); font-size: .82rem; font-weight: 400; }
.slider-track > .meal-day .today-note { color: var(--accent); font-weight: 600; }
.slider-track > .meal-day > .muted { margin: 0; padding: 0 18px 16px; }
.week-slots { list-style: none; margin: 0; padding: 0; }
.week-slot { border-top: 1px solid var(--line); }
.week-slot + .week-slot:not(:has(.week-slot-name)) { border-top: 0; }
.week-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; min-height: 58px; padding: 10px 18px; color: var(--ink); text-decoration: none; }
a.week-row:hover { background: color-mix(in srgb, var(--fill) 55%, transparent); }
a.week-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 4px; }
.week-row > *:not(.chev):not(.plus) { grid-column: 1; min-width: 0; }
.week-slot-name { font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.week-dish { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.week-dish.kind-other { color: var(--muted); font-weight: 500; }
.week-meta { color: var(--muted); font-size: .82rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; }
.week-meta .dot { width: 7px; height: 7px; margin-right: 5px; }
.week-row .week-label { display: inline; margin: 0; padding: 0; background: none; border-radius: 0; color: var(--rose-ink); font-size: .82rem; text-align: left; }
.week-recipe { display: inline-block; margin: -6px 18px 10px; font-size: .82rem; color: var(--accent); }
.week-slot:has(.week-recipe) .week-row { padding-bottom: 6px; }
.week-row .chev { grid-column: 2; grid-row: 1 / span 4; color: var(--muted); font-size: 1.1rem; }
.week-add { color: var(--accent); font-weight: 500; }
.week-row .plus { grid-column: 2; grid-row: 1 / span 2; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--fill); color: var(--accent); font-weight: 600; }
.slider-track > .meal-day .meal-off-note { padding: 0 18px 14px; }
.week-acts { display: flex; align-items: center; gap: 8px; }
.top-nav > .today-link.quiet { background: var(--fill); border-color: transparent; color: var(--ink); font-weight: 600; } /* #399: Today is a pill like the controls beside it */
.shop-link .count { color: var(--muted); font-weight: 400; margin-left: 2px; }
.shop-link.is-off { color: var(--muted); cursor: default; } /* #197 */
/* #331: one component for the action rows of the meal page: a 22 pt tinted icon slot, a 10 pt gap, the label in the accent, medium, at least 48 high */
.action-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 0 18px; border: 0; background: none; color: var(--accent); font: inherit; font-size: 1rem; font-weight: 500; text-align: left; text-decoration: none; cursor: pointer; }
.action-row + .meal-delete, .action-row + .action-row { border-top: 1px solid var(--line); }
.action-row .ar-icon { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: color-mix(in srgb, currentColor 14%, transparent); font-size: 1rem; line-height: 1; }
.action-row.danger { color: var(--rose-ink); }
.action-row.danger:hover { text-decoration: none; }
.meal-page .card.meal-final { padding: 0; margin-top: 24px; overflow: hidden; } /* .card.meal-final: it must beat ".page .card + .card" (16px), or the final card sits closer than the other gaps */
.meal-final[hidden] { display: none; }
.meal-final .meal-delete { display: grid; gap: 0; }
.meal-final .meal-delete .check { padding: 0 18px 12px; }
.meal-final .meal-delete .action-row { border-top: 0; }
.meal-final > .action-row + .meal-delete { border-top: 1px solid var(--line); }
@media (min-width: 700px) { .slider-track { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } }
@media (min-width: 1000px) { .slider-track { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }
@media (max-width: 699px) {
  .week-acts { flex: 1 1 auto; }
  .week-acts > .wide-only { display: none; } .week-acts > .btn.primary { flex: 1 1 0; }
  .slider-track > .meal-day { margin-top: 8px; }
}

/* Trash days (#105): the bins, drawn in their colours. An event the trash-days job made takes the bin's colour like a person's does. */
:root {
  --bin-black: #2b2b2e; --bin-brown: #8a5a34; --bin-yellow: #f2c40f; --bin-blue: #2d6cc4; --bin-edge: rgba(0, 0, 0, .25);
  --bin-black-ink: #2b2b2e; --bin-brown-ink: #7a4f2b; --bin-yellow-ink: #6b5400; --bin-blue-ink: #1f55a3;
}
.c-bin-black  { --c: var(--bin-black);  --c-ink: var(--bin-black-ink); }
.c-bin-brown  { --c: var(--bin-brown);  --c-ink: var(--bin-brown-ink); }
.c-bin-yellow { --c: var(--bin-yellow); --c-ink: var(--bin-yellow-ink); }
.c-bin-blue   { --c: var(--bin-blue);   --c-ink: var(--bin-blue-ink); }
.bin { width: 22px; height: 26px; border-radius: 4px 4px 6px 6px; background: var(--b); box-shadow: inset 0 0 0 1px var(--bin-edge); position: relative; grid-row: 1 / 3; }
.bin::before { content: ""; position: absolute; left: -2px; right: -2px; top: -4px; height: 4px; border-radius: 2px; background: var(--b); box-shadow: inset 0 0 0 1px var(--bin-edge); }
/* A collection day in a list: the trash can in the bin's colour takes the place of "All day" and the person dot (TrashDaysHelper#bin_icon). */
.bin-ic { display: block; flex: none; width: 20px; height: 22px; overflow: visible; }
.bin-ic path, .bin-ic rect { fill: var(--c); stroke: var(--bin-edge); stroke-width: 1; stroke-linejoin: round; }
.bin-ic .h { fill: none; stroke: var(--c); stroke-width: 1.6; }
.bin-ic .g { fill: none; stroke: var(--bin-edge); stroke-width: 1.4; stroke-linecap: round; }
.ev-bin { display: flex; align-items: center; }
.today-ev .ev-bin { grid-column: 1 / span 2; }
.agenda li.is-bin::before { content: none; }
.agenda li.is-bin { align-items: center; }
.agenda li.is-bin .ev-bin { margin-left: -18px; } /* where the person dot sits, so it lines up with the dots above and below */
.chips li.is-bin { background: none; box-shadow: none; align-items: center; } /* the month cell: the can, not a tinted chip */
.chips .bin-ic { width: 11px; height: 12px; }
.cell .dots .bin-ic { width: 9px; height: 10px; } /* on the phone, in place of the colour dot */
.tv-banner .bin-ic { display: inline-block; width: 11px; height: 12px; margin-right: 5px; vertical-align: -1px; }
.b-black { --b: var(--bin-black); } .b-brown { --b: var(--bin-brown); } .b-yellow { --b: var(--bin-yellow); } .b-blue { --b: var(--bin-blue); }
.trash-days { margin-top: 24px; } /* its own card, not part of the settings form above it */
.trash-days .trash-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.trash-days .trash-head h2 { margin: 0; }
.trash-days .trash-offset { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.trash-days .trash-offset label.btn { position: relative; cursor: pointer; }
.trash-days .trash-offset .offset-radio { position: absolute; opacity: 0; width: 1px; height: 1px; }
.trash-days .trash-offset label.btn:focus-within { outline: 2px solid var(--accent, currentColor); outline-offset: 2px; }
.trash-days .ok { color: var(--accent); font-weight: 600; font-size: 13px; }
.trash-days .bins { list-style: none; margin: 14px 0 0; padding: 0; border-top: 1px solid var(--line); }
.trash-days .bins li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 14px; align-items: center; padding: 11px 0 11px 4px; border-bottom: 1px solid var(--line); }
.trash-days .bins .bn { font-weight: 600; grid-column: 2; }
.trash-days .bins .d { grid-column: 2; color: var(--muted); font-size: 13px; }
.trash-days .bins .d b { color: var(--ink); font-weight: 500; }
.trash-days .src { display: flex; gap: 6px; align-items: center; margin-top: 12px; color: var(--muted); font-size: 13px; min-width: 0; }
.trash-days .src span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trash-days .reading { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 14px; border-radius: 14px; background: var(--fill, var(--bg)); }
.trash-days .reading p { font-size: 14px; margin: 0; }
.trash-days .reading small { display: block; color: var(--muted); font-size: 13px; }
.trash-days .spin { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--accent); animation: trash-spin .8s linear infinite; flex: none; }
@keyframes trash-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .trash-days .spin { animation: none; } }
.trash-days .note { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: var(--bg); font-size: 14px; }
.trash-days .note.bad { background: color-mix(in srgb, var(--rose) 10%, var(--card)); }
.trash-days .note b { display: block; margin-bottom: 2px; }
.trash-days .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 16px; }
.trash-days .btn.link { border: 0; background: none; color: var(--accent); padding: 0 6px; }

/* Family settings, grouped like the apps' settings (docs/design/family-settings-mockup.html): a small label over each card, one row
   per setting with its control on the right. Every change saves on its own (settings_form.js); "Saved ✓" sits by the back link. */
.settings-page .settings-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.settings-page .settings-top .eyebrow { margin: 0; text-transform: none; letter-spacing: 0; font-weight: 500; font-size: .9rem; }
.settings-page .settings-top .eyebrow a { color: var(--muted); text-decoration: none; }
.settings-page .settings-top .eyebrow a:hover { color: var(--accent); text-decoration: underline; }
.settings-page .save-state { color: var(--muted); font-size: 13px; text-align: right; }
.settings-page .save-state[data-state=error] { color: var(--rose); }
.settings-page h1 { margin-bottom: 4px; }
.settings-page .set-group { display: block; font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 24px 0 8px 4px; padding: 0; }
.settings-page .set-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.settings-page .set-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.settings-page .set-row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 18px; border-top: 1px solid var(--line); }
.settings-page .set-row:first-child { border-top: 0; }
.settings-page .set-row > label { flex: 1; min-width: 0; margin: 0; font-size: 15px; color: var(--ink); }
.settings-page .set-row > label small { display: block; color: var(--muted); font-size: 13px; }
.settings-page .set-name { width: auto !important; max-width: 55%; text-align: right; border: 0; background: none; font-weight: 500; padding: 8px 0; }
.settings-page .set-name:focus { background: var(--fill); padding: 8px 10px; }
.settings-page select.set-select { width: auto !important; max-width: 55%; min-width: 0; height: 36px; padding: 0 30px 0 12px; border: 0; border-radius: 99px; background-color: var(--fill); font-size: 14px; font-weight: 500; text-overflow: ellipsis; }
.settings-page .currency-open { width: auto; max-width: 55%; min-width: 0; height: 36px; padding: 0 14px; border: 0; border-radius: 99px; background: var(--fill); color: var(--ink); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.settings-page .currency-open[hidden] { display: none; }
/* #332: the searchable currency picker (docs/design/currency-mockup.html) and its confirm */
.currency-picker { border: 1px solid var(--line); border-radius: 18px; padding: 16px; background: var(--card); color: var(--ink); width: min(26rem, calc(100vw - 32px)); max-height: min(80vh, 40rem); box-shadow: 0 20px 50px rgb(0 0 0 / .25); }
.currency-picker[open] { display: flex; flex-direction: column; }
.currency-picker::backdrop { background: rgb(0 0 0 / .35); }
.currency-picker [data-currency-list-view] { display: flex; flex-direction: column; min-height: 0; }
.currency-picker [hidden] { display: none !important; }
.currency-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.currency-search { width: 100%; height: 40px; padding: 0 14px; border: 0; border-radius: 99px; background: var(--fill); color: var(--ink); font: inherit; font-size: 16px; margin-bottom: 8px; }
.currency-list { overflow-y: auto; min-height: 0; flex: 1; margin: 0 -4px; padding: 0 4px; }
.currency-h { margin: 14px 4px 6px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.currency-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 6px 8px; border: 0; border-radius: 12px; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.currency-row:hover, .currency-row:focus-visible { background: var(--fill); }
.currency-sign { flex: none; width: 44px; height: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--fill); font-size: 13px; font-weight: 600; }
.currency-sign.code-only { font-size: 11px; } /* a currency with no sign of its own shows its code, in the same fixed box so every name starts on one edge */
.currency-names { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.currency-names small { color: var(--muted); font-size: 12px; }
.currency-tick { flex: none; font-style: normal; color: var(--accent, var(--ink)); font-weight: 700; }
.currency-none { margin: 14px 4px; color: var(--muted); }
.currency-note { margin: 10px 4px 0; color: var(--muted); font-size: 13px; }
.currency-confirm-title { font-weight: 600; margin: 0 0 8px; overflow-wrap: anywhere; }
.currency-picker [data-currency-confirm-view] p { margin: 0 0 14px; overflow-wrap: anywhere; color: var(--muted); } /* the detail line is muted, as in the shared confirm */
.currency-picker .confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }
.settings-page .set-hint { color: var(--muted); font-size: 13px; margin: 0; padding: 6px 18px 14px; }
.settings-page .set-limit { color: var(--rose-ink); }
.settings-page .set-limit b { display: block; }
.settings-page .set-name.bad { outline: 2px solid var(--rose); border-radius: 8px; }
.settings-page [data-address-blocked] { color: var(--rose-ink); }
.settings-page .set-foot { color: var(--muted); font-size: 13px; margin: 8px 4px 0; }
.settings-page .segmented { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--fill); border-radius: 99px; padding: 3px; margin: 14px 18px 4px; }
.settings-page .segmented label { margin: 0; position: relative; cursor: pointer; }
.settings-page .segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.settings-page .segmented span { display: block; text-align: center; padding: 8px 6px; border-radius: 99px; font-size: 14px; font-weight: 500; color: var(--seg-off); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.settings-page .segmented input:checked + span { background: var(--seg-thumb); color: var(--seg-on); font-weight: 600; box-shadow: 0 0 0 1px var(--line), var(--seg-rim); }
.settings-page .segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.settings-page .actions[hidden] { display: none; }
.settings-page .form > .actions { margin-top: 20px; }
/* Trash days as one of the groups: the title (and its state) over the card */
.settings-page .trash-days { margin-top: 0; }
.settings-page .trash-days .trash-head { align-items: center; margin: 24px 0 8px; }
.settings-page .trash-days .trash-head .set-group { margin: 0 0 0 4px; }
.settings-page .trash-days .trash-head small { margin-right: 4px; }
.settings-page .trash-card { padding: 16px 18px; }
.settings-page .trash-card > :first-child { margin-top: 0; }
.settings-page .trash-card .bins { margin-top: 0; border-top: 0; }
.settings-page .trash-card .bins li:last-child { border-bottom: 0; }
.settings-page .trash-card input[name=address] { width: 100%; }
.settings-page .set-fieldset { margin-top: 24px; }
.settings-page .set-fieldset > legend.set-group { margin-top: 0; float: left; width: 100%; }
.settings-page .set-fieldset > legend.set-group + * { clear: both; }
@media (max-width: 520px) { /* the time zone and language names are long: the control goes under the label */
  .settings-page .set-row.stack { flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
  .settings-page .set-row.stack > label { flex-basis: 100%; }
  .settings-page .set-row.stack select.set-select { max-width: 100%; width: 100% !important; }
  .settings-page .set-row.stack .currency-open { max-width: 100%; width: 100%; text-align: left; }
}

/* #175: the weather icon set is inline SVG sized by the text around it */
.wx-icon { width: 1em; height: 1em; display: inline-block; vertical-align: middle; }

.event-notes { white-space: pre-line; overflow-wrap: anywhere; margin: .2rem 0 0; }

/* Suggested meals (#184): one warning, pinned while the list scrolls; amber unless every row was checked for everyone */
.proposal-warning { position: sticky; top: 0; z-index: 3; padding: .6rem .8rem; border-radius: 10px; margin: .6rem 0; overflow-wrap: anywhere; }
.proposal-warning p { margin: .15rem 0; }
.proposal-warning.is-amber { background: color-mix(in srgb, var(--amber) 22%, var(--card, #fff)); border: 1px solid var(--amber); }
.proposal-warning.is-neutral { background: var(--card, #fff); border: 1px solid var(--line, #ddd); }
.proposal-select { margin: .4rem 0; }
input[type=submit]:disabled { opacity: .5; cursor: not-allowed; }
select:disabled { opacity: .5; cursor: not-allowed; } /* #459: Notifications "How early" while the default reminder is off */

/* #208: the source of a synced event: the calendar's name, outlined; never circular arrows */
.source-tag { display: inline-block; border: 1px solid var(--line, #cfcfcf); border-radius: 999px; padding: 0 .5rem; font-size: .8em; color: var(--muted); }

/* #193 / app-unification § 23: a person's name is never drawn in the person's colour. The name takes the normal text colour; the colour stays as the dot and the
   tint behind it. The contrast of the text on the tint is computed for every colour in both themes in test/lib/chip_contrast_test.rb. */
.month-filter .chip { color: var(--ink); }
.month-filter .chip[class*="c-"]::before { content: ""; display: inline-block; width: .6em; height: .6em; border-radius: 50%; background: var(--c); margin-right: .4em; vertical-align: baseline; }

/* The + on Home cards (#180, #183): a small sheet that opens in place; Save sends the form and comes back to Home */
.plus-sheet { margin: .4rem 0; }
.plus-sheet > summary { list-style: none; cursor: pointer; display: inline-flex; width: 2rem; justify-content: center; }
.plus-sheet > summary::-webkit-details-marker { display: none; }
.plus-sheet[open] > summary { margin-bottom: .5rem; }

/* #189: an event for several people shows a dot per person (the block itself is neutral, c-multi); names follow the dots */
.person-dots { display: inline-flex; gap: 3px; vertical-align: middle; margin-right: .25rem; }
.person-dots .dot { width: .6rem; height: .6rem; }

/* #191: the avatar button shows no list marker, the initials are 14px semibold; the menu has a group label and a version line */
.user-btn::marker { content: ""; }
.user-btn .avatar { font-size: 14px; font-weight: 600; }
.menu-group { margin: .3rem .75rem .1rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.menu-version { margin: .3rem .75rem; font-size: .7rem; }

/* #191: below 640px the avatar opens /<family>/more instead of the popover */
.user-btn-link { display: none; }
@media (max-width: 639px) {
  .user-btn-link { display: grid; border-radius: 50%; }
  .user-btn-link .avatar { width: 32px; height: 32px; font-size: 14px; font-weight: 600; }
  .user-menu { display: none; }
}
.menu-card { display: flex; flex-direction: column; gap: 2px; }
.family-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: .6rem 0; }
.family-card h2 { margin: 0 0 4px; }
.family-people { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.family-rows li { flex-wrap: wrap; }

/* Home cards in the saved order (#262) and their in-place ticks (#263) */
.home-widgets { display: grid; gap: 14px; }
.home-widgets > .widget { margin: 0; min-width: 0; }
.home-widgets .widget > .card { flex: initial; }
.home-widgets.editing .widget { padding-top: 0; }
.head-add { display: inline-flex; align-items: center; gap: 10px; }
.head-add .btn.small { border-radius: 50%; width: 28px; height: 28px; padding: 0; display: inline-grid; place-items: center; }
.shop-rows .qty { margin-left: auto; font-variant-numeric: tabular-nums; }
.shop-rows > li { grid-template-columns: auto 1fr auto; }
.today-rows > li.done .what, .today-rows > li.done .qty { text-decoration: line-through; color: var(--muted); }
.more-row { margin: 6px 0 0; font-size: .92rem; color: var(--accent); }
.week-row.plain { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--accent); font-weight: 500; }
.tick-note { margin: 4px 0; font-size: .85rem; }

/* "Look it up" on a new recipe (#265) */
.recipe-lookup { margin: -4px 0 14px; }
.recipe-lookup .lookup-consent { margin: 6px 0 0; }
.recipe-lookup .lookup-consent:empty { display: none; }
.lookup-box { margin-top: 8px; }
.lookup-banner, .lookup-loading, .lookup-note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 10%, var(--card)); border: 1px solid var(--line); }
.lookup-banner { flex-direction: column; align-items: stretch; }
.lookup-banner p, .lookup-text p { margin: 0; overflow-wrap: break-word; hyphens: manual; word-break: normal; }
.lookup-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.lookup-note .lookup-icon { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: var(--muted); }
.lookup-note.error .lookup-icon { background: var(--rose-ink); }
.lookup-text { min-width: 0; flex: 1; }
.lookup-text .btn { display: block; margin-top: 8px; }
.lookup-loading { align-items: center; }
.lookup-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: lookup-turn .8s linear infinite; }
@keyframes lookup-turn { to { transform: rotate(360deg); } }
.lookup-filled { background: color-mix(in srgb, var(--green) 10%, var(--card)); }
@media (prefers-reduced-motion: reduce) { .lookup-spin { animation: none; } }

/* The expense add row has visible labels (#254): a grid that stacks on a phone width */
/* #382 the add row: every field keeps its own height (the shared .quick rule gives fields flex: 1 1 8rem, which is a HEIGHT in a column), Add sits level with them.
   From 900 px one line; 600 to 900 two lines of three; a phone has the fields in pairs, What / where and Add full width. */
form.quick.expense-add { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; align-items: end; }
form.quick.expense-add .qf { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
form.quick.expense-add .qf label { font-size: .8125rem; color: var(--muted); font-weight: 400; } /* #399 labels: regular, 13 px, muted, as on the recipe and settings forms */
form.quick.expense-add .qf > input, form.quick.expense-add .qf > select { flex: none; width: 100%; min-width: 0; height: 40px; }
form.quick.expense-add .qf-go .btn { height: 40px; width: 100%; }

@media (max-width: 599px) { form.quick.expense-add { grid-template-columns: repeat(2, minmax(0, 1fr)); } form.quick.expense-add .qf-wide, form.quick.expense-add .qf-go { grid-column: 1 / -1; } }
/* #382 the list: fixed columns, so the payers, dates and amounts line up (name takes the rest); a phone has two lines: name and amount, then payer and date under the name */
.expense-list li { display: grid; grid-template-columns: 10px minmax(0, 1fr) 6.5rem 4.5rem 5.5rem; column-gap: 12px; align-items: center; }
.expense-list li .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.expense-list li .person-tag { justify-self: start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.expense-list li .muted, .expense-list li strong { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 599px) {
  .expense-list li { grid-template-columns: 10px minmax(0, 1fr) auto; row-gap: 2px; }
  .expense-list li .dot { grid-row: 1; }
  .expense-list li .grow { grid-column: 2; grid-row: 1; }
  .expense-list li strong { grid-column: 3; grid-row: 1; }
}

/* An empty list is the action (#258) */
.empty-action { margin: 6px 0 2px; font-weight: 600; }
.empty-action .empty-add { color: var(--accent); }
.empty-quiet { margin: 0 0 4px; font-size: .85rem; }

/* #279 Add to shopping: pick the meals, then their ingredients */
.shop-meal-group.dim .check-text { opacity: .5; }
.shop-meal { font-weight: 600; }
.shop-meal.faded, .shop-meal-group + .faded { opacity: .5; }
.undo-bar { margin: 0 0 8px; }

/* #276 What OhAI may read: the approved text as blocks, readable column */
.ai-access { max-width: 66ch; }
.ai-access .state-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.ai-blocks h3 { margin: 14px 0 4px; font-size: .85rem; color: var(--muted); text-transform: none; }
.ai-blocks h3:first-child { margin-top: 0; }
.ai-lines { list-style: none; margin: 0; padding: 0; }
.ai-lines li { padding: 3px 0 3px 22px; position: relative; }
.ai-lines.sent li::before { content: "✓"; position: absolute; left: 0; color: var(--accent, currentColor); }
.ai-lines.not-sent li::before { content: "–"; position: absolute; left: 4px; color: var(--muted); }
.ai-lines.goes li::before { content: "↗"; position: absolute; left: 0; color: var(--muted); }
.ai-lines.warning li::before { content: "!"; position: absolute; left: 6px; font-weight: 700; }
.ai-lines.off li::before { content: "⏻"; position: absolute; left: 0; color: var(--muted); }
.ai-full summary { cursor: pointer; font-weight: 600; }
dialog.ai-turn-on { max-width: min(66ch, calc(100vw - 32px)); border: 1px solid var(--line, #ddd); border-radius: 14px; padding: 18px; }
dialog.ai-turn-on::backdrop { background: rgba(0,0,0,.4); }

/* #286 the Meals week: one stacked row (slot label, name, meta, labels) plus the chevron; even padding, one empty-row pattern, day cards of equal height. */
.slider-track { align-items: stretch; }
.slider-track > .meal-day { display: flex; flex-direction: column; }
.slider-track > .meal-day .meal-off-note { margin-top: auto; }
.week-slots .week-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; min-height: 72px; padding: 12px 16px; overflow-wrap: break-word; hyphens: none; }
.week-slots .week-row > *:not(.chev) { grid-column: 1; display: block; min-width: 0; }
.week-slots .week-row > .week-meta { display: flex; }
.week-slots .week-slot-name { font-size: .7rem; }
.week-slots .week-dish { font-size: 1rem; overflow-wrap: break-word; }
.week-slots .week-meta, .week-slots .week-label { font-size: .82rem; }
.week-slots .chev { grid-column: 2; grid-row: 1 / -1; align-self: center; }
.week-slots .week-add { color: var(--accent); font-weight: 500; text-align: left; }
.week-slots .week-add .plus { display: inline; width: auto; height: auto; background: none; margin-right: 4px; place-items: initial; }
.week-slots .week-recipe { margin: -6px 16px 12px; }
.dot-badge { position: relative; }
.dot-badge::after { content: ""; position: absolute; top: -3px; right: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg, #fff); }
.proposal-kept { font-size: .8rem; color: var(--accent); font-weight: 600; }

/* #339 terms update screen */
.terms-docs { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.terms-doc { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; color: inherit; text-decoration: none; }
.terms-doc small { display: block; color: var(--muted); font-size: 13px; }
.terms-changes { margin: 0 0 16px; font-size: 14px; }
.terms-changes ul { margin: 6px 0 0; padding-left: 20px; color: var(--muted); }
.terms-logout-form { text-align: center; margin-top: 8px; }
.terms-logout { background: none; border: 0; padding: 10px; color: var(--accent); font: inherit; font-weight: 500; cursor: pointer; }

/* #290 step editor (steps_editor.js) */
.steps-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.steps-list > .steps-row { display: grid; grid-template-columns: 24px 1fr 40px 40px; align-items: start; gap: 4px; background: var(--card); border-radius: 10px; }
.steps-list > .steps-row.lift { box-shadow: 0 6px 18px rgb(0 0 0 / .18); outline: 2px dashed color-mix(in srgb, var(--accent) 45%, transparent); }
.steps-n { padding-top: 10px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 14px; }
.steps-list > .steps-row textarea { resize: none; overflow: hidden; min-height: 40px; width: 100%; font: inherit; line-height: 1.4; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: inherit; }
.steps-grip, .steps-del { width: 40px; height: 40px; border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; border-radius: 8px; }
.steps-grip { cursor: grab; touch-action: none; }
.steps-grip:focus-visible, .steps-del:focus-visible { outline: 2px solid var(--accent); }
.steps-add { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 500; cursor: pointer; }
.steps-add b { width: 22px; height: 22px; display: inline-grid; place-items: center; font-size: 20px; }
.steps-add:disabled { color: var(--muted); cursor: default; opacity: .6; }
.steps-count { margin: 4px 0 0; text-align: right; font-size: 12px; color: var(--muted); }
.steps-count.hot { color: var(--rose-ink); }
.steps-limit, .steps-note, .steps-empty { margin: 4px 0; font-size: 13px; }
.steps-toast { display: flex; gap: 14px; align-items: center; margin-top: 8px; padding: 10px 14px; border-radius: 10px; background: var(--ink, #1d1d1f); color: var(--card); width: fit-content; }
.steps-toast[hidden] { display: none; }
.steps-undo { border: 0; background: none; color: inherit; font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }

/* Country card on Home (the unified Country rule) */
.country-card { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin: 0 0 12px; }
.country-card .grow { flex: 1 1 12rem; }
.country-card form { display: inline; margin: 0; }
.country-card .btn.quiet { border-color: transparent; background: transparent; color: var(--muted); }
.country-card small { display: block; color: var(--muted); font-weight: 400; }
.country-icon { font-size: 22px; }
.country-acts { display: flex; gap: 8px; }
@media (max-width: 600px) { .country-acts { flex-basis: 100%; } .country-acts > * { flex: 1; } .country-acts .btn { width: 100%; } }

/* #337 automatic meal suggestions: the sheets, the settings row, My details */
.auto-sheet .auto-h { font-size: 16px; margin: 12px 0 6px; }
.auto-who { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.auto-who li { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); }
.auto-name { font-weight: 600; }
.auto-text { line-height: 1.5; }
.auto-child { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 10px 0; }
.auto-child h3 { margin: 0 0 6px; font-size: 15px; }
.auto-blocks { display: grid; gap: 8px; margin: 12px 0; }
.auto-blocks div { display: grid; grid-template-columns: 90px 1fr; gap: 8px; }
.auto-blocks dt { font-weight: 600; }
.auto-blocks dd { margin: 0; color: var(--muted); }
.auto-row, .auto-mine { margin-top: 16px; }
.auto-result { margin: 8px 0; }
/* #342 the OhAI result page: one centred column, the sentence as a bubble, one card per suggestion with labelled rows */
.ohai-col { max-width: 520px; margin: 0 auto; display: grid; gap: 12px; }
.ohai-bubble { justify-self: end; max-width: 85%; margin: 0; padding: 10px 14px; border-radius: 18px 18px 4px 18px; background: var(--accent); color: #fff; overflow-wrap: anywhere; }
.ohai-reply { margin: 0; }
.ohai-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ohai-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; gap: 6px; min-width: 0; }
.ohai-card.off { opacity: .55; }
.ohai-card.needs-fix { border-color: var(--rose); }
.ohai-head { display: flex; align-items: center; gap: 8px; }
.ohai-kind { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.ohai-tick { margin-left: auto; display: inline-flex; }
.ohai-tick input { width: 22px; height: 22px; }
.ohai-card input.ohai-title, .ohai-title { font: inherit; box-shadow: none; border-radius: 0; font-weight: 700; font-size: 17px; border: 0; padding: 4px 0; background: none; color: var(--ink); width: 100%; border-bottom: 1px solid transparent; }
.ohai-title:focus { border-bottom-color: var(--accent); outline: none; }
.ohai-title.changed { color: var(--green-ink); }
.ohai-rows { display: grid; }
.ohai-row { border-top: 1px solid var(--line); }
.ohai-row > summary { display: grid; grid-template-columns: 96px 1fr auto; gap: 8px; align-items: baseline; padding: 9px 0; cursor: pointer; list-style: none; min-height: 44px; box-sizing: border-box; }
.ohai-row > summary::-webkit-details-marker { display: none; }
.ohai-row .k { color: var(--muted); font-size: 14px; }
.ohai-row .v { overflow-wrap: anywhere; }
.ohai-row .chev { color: var(--muted); transition: transform .15s; }
.ohai-row[open] .chev { transform: rotate(90deg); }
.ohai-row.changed .v { color: var(--green-ink); }
.ohai-row.changed .v::before { content: "● "; font-size: .7em; }
.ohai-row.bad .k, .ohai-row.bad .v { color: var(--rose-ink); }
.ohai-edit { padding: 2px 0 10px; display: grid; gap: 8px; }
.ohai-chips { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 4px; }
.ohai-chip > summary { list-style: none; cursor: pointer; padding: 4px 12px; border: 1px dashed var(--line); border-radius: 99px; color: var(--muted); font-size: 14px; }
.ohai-chip > summary::-webkit-details-marker { display: none; }
.ohai-chip[open] { flex-basis: 100%; }
.ohai-chip.changed > summary { color: var(--green-ink); border-color: var(--green); border-style: solid; }
.ohai-actions { margin-top: 4px; display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex-wrap: wrap; }
.ohai-actions form.inline { display: inline; }
.ohai-look { color: var(--rose-ink); font-size: 14px; margin-right: auto; }
.ohai-message b { display: flex; align-items: center; gap: 8px; }
.ohai-message p { margin: 0; color: var(--muted); }
.ohai-mark { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--fill); font-size: 13px; }
.ohai-message.bad .ohai-mark { background: var(--rose); color: #fff; }
.ohai-more { display: flex; gap: 8px; }
.ohai-more input[type=text] { flex: 1; min-width: 0; }
@media (max-width: 600px) {
  .ohai-actions { flex-direction: column-reverse; align-items: stretch; }
  .ohai-actions .btn.primary, .ohai-actions input[type=submit] { width: 100%; }
  .ohai-actions .btn:not(.primary) { background: none; border: 0; color: var(--accent); }
  .ohai-look { margin: 0; text-align: center; }
}
@media (max-width: 340px) { .ohai-row > summary { grid-template-columns: 72px 1fr auto; } }

/* #344 "Which days?" */
.suggest-dialog { max-width: 420px; width: calc(100% - 32px); border: 0; border-radius: 16px; padding: 18px; background: var(--card); color: var(--ink); }
.suggest-dialog::backdrop { background: rgb(0 0 0 / .35); }
.suggest-close { float: right; }
.chooser-h { margin: 0 0 10px; font-size: 18px; }
.chooser-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.chooser-row { width: 100%; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; min-height: 48px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--fill); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.chooser-row:disabled { opacity: .5; cursor: default; }
.chooser-count { color: var(--muted); font-size: 14px; }
.chooser-custom { margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.chooser-custom > summary { display: flex; justify-content: space-between; gap: 10px; cursor: pointer; list-style: none; }
.chooser-custom > summary::-webkit-details-marker { display: none; }
.chooser-dates { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0 6px; }
.chooser-dates label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.chooser-replace { margin-top: 12px; }
.chooser-grey { margin: 8px 0 0; font-size: 14px; }


/* #353 shared events: an event for several people, drawn by the viewer's own setting. Split colours: the card's tint is split into equal parts with hard edges; Colour bar: a
   bar at the leading edge, split top to bottom. A block too small for the parts (10 px a part across, 8 px a part tall for the bar, under 18 px high) is grey with dots. */
:root { --shared-tint: 22%; }
.shared .parts { position: absolute; display: flex; pointer-events: none; z-index: 0; }
.shared .parts i { flex: 1 1 0; min-width: 0; min-height: 0; }
.shared > :not(.parts) { position: relative; z-index: 1; }
.shared .person-dots, .shared .parts-bar { display: none; }
.shared.look-split { box-shadow: 0 0 0 1px var(--card); background: var(--card); }
.shared.look-split .parts { inset: 0; flex-direction: row; gap: 1px; background: var(--card); }
.shared.look-split .parts i { background: color-mix(in srgb, var(--c, var(--muted)) var(--shared-tint), var(--card)); }
/* #393 day and week grids, option A "soft blend": the parts are the same tints, blurred into one another (no hard edges, no gap), and a 3 px bar split top to bottom marks the people
   at the leading edge. The list and the agenda keep the hard split. A block too small for the parts is grey with dots, as before. */
.blk.shared.look-split { overflow: hidden; }
.blk.shared.look-split .parts { inset: -14px; gap: 0; filter: blur(11px); }
.blk.shared.look-split .parts i { background: color-mix(in srgb, var(--c, var(--muted)) var(--shared-tint), var(--card)); }
.blk.shared.look-split .parts-bar { display: flex; flex-direction: column; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; z-index: 1; pointer-events: none; }
.blk.shared.look-split .parts-bar i { flex: 1 1 0; background: var(--c, var(--muted)); }
.blk.shared.look-split { padding-left: 8px; }
.shared.look-bar { background: var(--card); box-shadow: 0 0 0 1px var(--line); }
.shared.look-bar .parts { left: 0; top: 0; bottom: 0; width: 6px; flex-direction: column; gap: 1px; }
.shared.look-bar .parts i { background: var(--c, var(--muted)); }
.blk.shared { container-type: size; }
.blk.shared.look-bar { padding-left: 10px; }
.tv-list .agenda li.shared { position: relative; overflow: hidden; }
.tv-list .agenda li.shared::before { content: none; }
.tv-list .agenda li.shared.look-bar { padding-left: 14px; }
@container (max-width: 19.9px) { .blk.look-split .parts[data-parts="2"] { display: none; } .blk.look-split .parts-bar[data-parts="2"] { display: none; } .blk.look-split .person-dots[data-parts="2"] { display: inline-flex; } .blk.look-split { background: color-mix(in srgb, var(--muted) 20%, var(--card)); } }
@container (max-height: 15.9px) { .blk.look-bar .parts[data-parts="2"] { display: none; } .blk.look-bar .person-dots[data-parts="2"] { display: inline-flex; } .blk.look-bar { background: color-mix(in srgb, var(--muted) 20%, var(--card)); } }
@container (max-width: 29.9px) { .blk.look-split .parts[data-parts="3"] { display: none; } .blk.look-split .parts-bar[data-parts="3"] { display: none; } .blk.look-split .person-dots[data-parts="3"] { display: inline-flex; } .blk.look-split { background: color-mix(in srgb, var(--muted) 20%, var(--card)); } }
@container (max-height: 23.9px) { .blk.look-bar .parts[data-parts="3"] { display: none; } .blk.look-bar .person-dots[data-parts="3"] { display: inline-flex; } .blk.look-bar { background: color-mix(in srgb, var(--muted) 20%, var(--card)); } }
@container (max-width: 39.9px) { .blk.look-split .parts[data-parts="4"] { display: none; } .blk.look-split .parts-bar[data-parts="4"] { display: none; } .blk.look-split .person-dots[data-parts="4"] { display: inline-flex; } .blk.look-split { background: color-mix(in srgb, var(--muted) 20%, var(--card)); } }
@container (max-height: 31.9px) { .blk.look-bar .parts[data-parts="4"] { display: none; } .blk.look-bar .person-dots[data-parts="4"] { display: inline-flex; } .blk.look-bar { background: color-mix(in srgb, var(--muted) 20%, var(--card)); } }
@container (max-width: 49.9px) { .blk.look-split .parts[data-parts="5"] { display: none; } .blk.look-split .parts-bar[data-parts="5"] { display: none; } .blk.look-split .person-dots[data-parts="5"] { display: inline-flex; } .blk.look-split { background: color-mix(in srgb, var(--muted) 20%, var(--card)); } }
@container (max-height: 39.9px) { .blk.look-bar .parts[data-parts="5"] { display: none; } .blk.look-bar .person-dots[data-parts="5"] { display: inline-flex; } .blk.look-bar { background: color-mix(in srgb, var(--muted) 20%, var(--card)); } }
@container (max-width: 59.9px) { .blk.look-split .parts[data-parts="6"] { display: none; } .blk.look-split .parts-bar[data-parts="6"] { display: none; } .blk.look-split .person-dots[data-parts="6"] { display: inline-flex; } .blk.look-split { background: color-mix(in srgb, var(--muted) 20%, var(--card)); } }
@container (max-height: 47.9px) { .blk.look-bar .parts[data-parts="6"] { display: none; } .blk.look-bar .person-dots[data-parts="6"] { display: inline-flex; } .blk.look-bar { background: color-mix(in srgb, var(--muted) 20%, var(--card)); } }
@container (max-height: 17.9px) { .blk.shared .parts { display: none; } .blk.shared .person-dots { display: inline-flex; } .blk.shared { background: color-mix(in srgb, var(--muted) 20%, var(--card)); } }

/* #371 "Event or task?": one card, two readings side by side, nothing chosen; the chosen one turns green and opens its rows (no script needed: :has) */
.ohai-tiles { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ohai-tile { position: relative; display: flex; cursor: pointer; min-width: 0; } /* batch 10: both tiles the same height */
.ohai-tile .ohai-tile-body { flex: 1; }
.ohai-tile .tile-when { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ohai-tile input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.ohai-tile-body { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--fill); min-height: 78px; box-sizing: border-box; overflow-wrap: anywhere; }
.ohai-tile-body b { font-size: 15px; }
.ohai-tile-body span { font-size: 14px; }
.ohai-tile-body small { color: var(--muted); font-size: 12px; }
.ohai-tile input:focus-visible + .ohai-tile-body { outline: 2px solid var(--accent); outline-offset: 2px; }
.ohai-tile input:checked + .ohai-tile-body { border-color: var(--green); background: color-mix(in srgb, var(--green) 14%, var(--card)); box-shadow: inset 0 0 0 1px var(--green); }
.ohai-tile input:checked + .ohai-tile-body b::before { content: "\2713  "; color: var(--green-ink); }
.ohai-reading { display: none; }
.ohai-reading .ohai-rows { margin-top: 2px; }

/* #372 Family colour page (web). One column of at most 560 px; the Shared events tiles are real buttons with a preview of the same two-person event: "Colour bar" is a plain
   card with a 7 px bar (half and half) down its leading edge, drawn with explicit edges so it shows in every browser. */
.colour-page { max-width: 560px; margin: 0 auto; display: grid; gap: 14px; }
.colour-page .colour-section { display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.colour-page .colour-section h2 { margin: 0; }
.colour-person { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; }
/* #374 the grid: 6 equal columns, so the eleven colours and the picker are always 6 + 6 whatever the width (circles 34 px, the gaps stretch) */
.colour-person .swatch-row { flex: 1 1 100%; display: grid; grid-template-columns: repeat(6, 34px); justify-content: space-between; gap: 12px 0; margin: 4px 0 0; padding: 0; list-style: none; }
.colour-person .swatch-btn, .colour-person .wheel { width: 34px; height: 34px; }
.colour-person .swatch-row li { display: block; padding: 0; border: 0; } /* not the list rows' divider lines */
.colour-person .custom-colour { display: block; }
.colour-twins { margin: 0; }
.only-you { font-size: 12px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; vertical-align: middle; }
.shared-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.shared-tiles form { margin: 0; }
.shared-tile { width: 100%; display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); cursor: pointer; text-align: left; font: inherit; }
.shared-tile.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.shared-tile .tile-name { font-weight: 600; font-size: 14px; }
.tile-event { position: relative; display: block; min-height: 52px; border-radius: 8px; overflow: hidden; background: var(--card); box-shadow: 0 0 0 1px var(--line); }
.tile-event .parts { position: absolute; display: flex; pointer-events: none; }
.tile-event .parts i { flex: 1 1 0; display: block; }
.tile-event.look-split .parts { inset: 0; flex-direction: row; }
.tile-event.look-split .parts i { background: color-mix(in srgb, var(--c, var(--muted)) 30%, var(--card)); }
.tile-event.look-bar .parts { left: 0; top: 0; bottom: 0; width: 7px; flex-direction: column; }
.tile-event.look-bar .parts i { background: var(--c, var(--muted)); }
.tile-event .tile-text { position: relative; display: grid; padding: 8px 10px; }
.tile-event.look-bar .tile-text { padding-left: 16px; }
.tile-event small { color: var(--muted); }
@media (max-width: 380px) { .shared-tiles { grid-template-columns: 1fr; } }

/* #383 the "Suggest a dish" row under the meal name: 12 px below it, the buttons and the note wrap on one flowing line (the row had no rule, so it touched the name) */
.meal-suggest { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.meal-suggest [data-suggest-after] { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.meal-suggest [data-suggest-after][hidden], .meal-suggest [data-suggest-unchecked][hidden] { display: none; }
.meal-suggest .hint { margin: 0; }
.meal-suggest [data-suggest-note] a { margin-left: 4px; }

/* ---- #398 Help: a grouped list, one rounded card per section, rows with a chevron; pills that scroll sideways on a phone ---- */
.help-page { max-width: 680px; }
.help-page .lead { color: var(--muted); margin-bottom: 14px; }
.help-toc { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 8px; padding: 4px 16px 8px; position: sticky; top: 0; z-index: 3; background: var(--bg); scroll-behavior: smooth; }
.help-toc::-webkit-scrollbar { display: none; }
.help-toc .chip { flex: none; text-decoration: none; background: var(--fill); border: 0; color: var(--ink); padding: 7px 14px; font-size: .88rem; font-weight: 500; }
.help-toc .chip.on { background: var(--accent); color: var(--on-accent, #fff); }
.help-section { margin-top: 22px; scroll-margin-top: 4rem; }
.help-section > h2 { font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px 6px; font-weight: 600; }
.help-group { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.help-q { border-top: 1px solid var(--line); scroll-margin-top: 4rem; }
.help-q:first-child { border-top: 0; }
.help-q > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 12px 16px; font-weight: 500; }
.help-q > summary::-webkit-details-marker { display: none; }
.help-q > summary > span { flex: 1; min-width: 0; }
.help-q > summary::after { content: "›"; flex: none; color: var(--muted); font-size: 1.4rem; line-height: 1; transition: transform .15s; }
.help-q[open] > summary::after { transform: rotate(90deg); }
.help-q > summary:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.help-q > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.help-q > p { margin: 0; padding: 0 16px 16px; font-size: .94rem; line-height: 1.55; color: var(--ink); }
.help-still { margin-top: 24px; text-align: center; padding: 22px 18px; }
.help-still h2 { font-size: 1.1rem; margin: 0 0 6px; text-transform: none; letter-spacing: 0; color: var(--ink); }
.help-still p { margin: 0 0 12px; color: var(--muted); }
.help-still p:last-child { margin-bottom: 0; }
@media (prefers-reduced-motion: reduce) { .help-q > summary::after, .help-toc { transition: none; scroll-behavior: auto; } }

/* ---- #398 Privacy and Terms: one reading column, a contents list, hanging numbers (the words are Lovro's own, untouched) ---- */
.page.legal.legal-doc { max-width: 680px; line-height: 1.65; font-size: 1.0625rem; }
.legal-switch { display: inline-flex; gap: 0; padding: 3px; background: var(--fill); border-radius: 12px; margin: 4px 0 10px; }
.legal-switch a { padding: 5px 18px; border-radius: 9px; font-size: .85rem; font-weight: 500; color: var(--seg-off); text-decoration: none; }
.legal-switch a.on { background: var(--seg-thumb); color: var(--seg-on); font-weight: 600; box-shadow: var(--seg-shadow), var(--seg-rim); }
.legal-doc h1 { margin: 6px 0 6px; text-wrap: balance; }
.legal-doc .legal-dates { color: var(--muted); font-size: .9rem; margin: 0 0 18px; }
.legal-doc .legal-dates br { display: none; }
.legal-doc .legal-dates strong { font-weight: 500; }
.legal-doc .legal-dates strong + br + strong::before, .legal-doc .legal-dates strong:last-of-type:not(:first-of-type)::before { content: " · "; white-space: pre; }
.legal-toc { background: var(--card); border: 1px solid var(--line); border-radius: 14px; margin: 0 0 22px; }
.legal-toc > summary { cursor: pointer; padding: 12px 16px; font-weight: 600; font-size: .95rem; list-style: none; }
.legal-toc > summary::-webkit-details-marker { display: none; }
.legal-toc > summary::after { content: " ›"; display: inline-block; color: var(--muted); transition: transform .15s; }
.legal-toc[open] > summary::after { transform: rotate(90deg); }
.legal-toc ol { list-style: none; margin: 0; padding: 0 8px 10px; display: grid; gap: 2px; }
.legal-toc a { display: flex; gap: 10px; padding: 6px 10px; border-radius: 8px; font-size: .9rem; line-height: 1.35; color: var(--muted); text-decoration: none; }
.legal-toc a:hover { color: var(--ink); background: var(--fill); }
.legal-toc a.here { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); font-weight: 600; }
.sec-num { flex: none; width: 2rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.legal-toc .sec-num { width: 1.6rem; }
.legal-text h2 { display: flex; gap: 12px; align-items: baseline; margin: 36px 0 10px; font-size: 1.35rem; text-wrap: balance; scroll-margin-top: 1rem; }
.legal-text h2 .sec-num { width: 2.2rem; font-weight: 500; }
.legal-text h2 .sec-title { flex: 1; min-width: 0; }
.legal-text h3 { margin-top: 22px; font-size: 1.05rem; }
.legal-text p, .legal-text li { overflow-wrap: break-word; }
.legal-text p { margin: 0 0 14px; }
.legal-text ul { margin: 0 0 14px; }
.legal-text a { color: var(--accent); }
.legal-contact { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; margin: 0 0 14px; font-size: .95rem; }
.legal-contact dt { color: var(--muted); }
.legal-contact dd { margin: 0; overflow-wrap: anywhere; }
@media (min-width: 900px) {
  .page.legal.legal-doc { max-width: 980px; display: grid; grid-template-columns: 14rem minmax(0, 680px); column-gap: 44px; align-items: start; }
  .legal-doc > .legal-switch, .legal-doc > h1, .legal-doc > .legal-dates, .legal-doc > .legal-text { grid-column: 2; }
  .legal-doc > .legal-switch { justify-self: start; }
  .legal-doc > .legal-toc { grid-column: 1; grid-row: 1 / span 4; position: sticky; top: 1rem; align-self: start; max-height: calc(100vh - 2rem); overflow: auto; margin-top: 6px; }
  .legal-toc > summary { pointer-events: none; }
  .legal-toc > summary::after { content: none; }
}
@media (prefers-reduced-motion: reduce) { .legal-toc > summary::after { transition: none; } }

/* ---- #398 front page: icons in the four feature squares, a quiet line under the hero buttons, a balanced headline ---- */
.feature-icon { position: relative; }
.feature-icon::before { content: ""; position: absolute; inset: 9px; background: var(--c-ink, var(--c, var(--accent))); -webkit-mask: var(--fi) center / contain no-repeat; mask: var(--fi) center / contain no-repeat; }
.fi-calendar { --fi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='3'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E"); }
.fi-tasks { --fi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M8 12.5l3 3 5-6'/%3E%3C/svg%3E"); }
.fi-meals { --fi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h16a8 8 0 0 1-16 0zM8 8c0-2 2-2 2-4M13 8c0-2 2-2 2-4'/%3E%3C/svg%3E"); }
.fi-ohai { --fi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l1.9 5.1L19 10l-5.1 1.9L12 17l-1.9-5.1L5 10l5.1-1.9zM19 16l.7 1.8L21.5 18.5l-1.8.7L19 21l-.7-1.8-1.8-.7 1.8-.7z'/%3E%3C/svg%3E"); }
.hero h1 { text-wrap: balance; }
.hero .actions + .muted { margin-top: 14px; }
/* ---- #394 the form kit: what the browser used to draw (disclosure triangles, blue checkboxes, raw fieldsets, the file chooser, select arrows) in the app's own look ---- */
/* disclosures: a chevron on the right that turns down when open, instead of the black triangle */
details:not([class]) > summary, .feature-text > summary, .ai-full > summary, .recipe-method > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
details:not([class]) > summary::-webkit-details-marker, .feature-text > summary::-webkit-details-marker, .ai-full > summary::-webkit-details-marker, .recipe-method > summary::-webkit-details-marker { display: none; }
details:not([class]) > summary::after, .feature-text > summary::after, .ai-full > summary::after, .recipe-method > summary::after { content: "›"; flex: none; color: var(--muted); font-size: 1.3rem; line-height: 1; transition: transform .15s; }
details[open]:not([class]) > summary::after, .feature-text[open] > summary::after, .ai-full[open] > summary::after, .recipe-method[open] > summary::after { transform: rotate(90deg); }
.feature-text > summary, .recipe-method > summary { font-size: .9rem; color: var(--muted); padding: 4px 0; }
.ai-full > summary { padding: 4px 0; }
@media (prefers-reduced-motion: reduce) { details > summary::after { transition: none; } }
/* checkboxes and radios take the app's accent (the light blue of dark mode was the browser's) */
input[type=checkbox]:not(.toggle):not(.tick), input[type=radio] { accent-color: var(--accent); width: 1.1rem; height: 1.1rem; flex: none; }
/* a fieldset is a labelled group, not a box with a legend cutting its border */
fieldset.who-chips { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.who-chips > legend { padding: 0; margin-bottom: 8px; font-size: .85rem; font-weight: 600; color: var(--muted); }
fieldset.who-chips .check { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
/* the file chooser: its button looks like the app's quiet button; the "No file chosen" text is muted */
input[type=file] { color: var(--muted); }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; font-size: .85rem; padding: 7px 14px; margin-right: 10px; border: 0; border-radius: 99px; background: var(--fill); color: var(--ink); cursor: pointer; }
input[type=file]::file-selector-button:hover { background: color-mix(in srgb, var(--ink) 10%, var(--fill)); }
/* date and time fields: the same height and padding as the other fields; select arrows with room to the right edge */
input[type=date], input[type=datetime-local], input[type=time] { min-height: 38px; }
select:not([multiple]):not([size]) { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 19px) center, calc(100% - 14px) center; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.tasks-add .pill select { appearance: auto; padding-right: 4px; }
/* the colour circles of the person forms: the same circle grid as the Family colour page (6 columns); the name is for screen readers */
.swatches { display: grid; grid-template-columns: repeat(6, 34px); justify-content: space-between; gap: 12px 0; }
.swatches .swatch { position: relative; display: block !important; width: 34px; height: 34px; font-size: 0 !important; line-height: 0; }
.swatches .swatch input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.swatches .swatch .dot { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--c); }
.swatches .swatch .in-use { display: none; }
.swatches .swatch.used .dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
.swatches .swatch input:checked + .dot { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ink); }
.swatches .swatch input:checked + .dot::after { content: ""; width: 12px; height: 7px; border: solid #fff; border-width: 0 0 2.5px 2.5px; transform: translateY(-2px) rotate(-45deg); }
.swatches .swatch input:focus-visible + .dot { outline: 2px solid var(--accent); outline-offset: 3px; }
.swatches .swatch input[type=color] { z-index: 2; padding: 0; border: 0; }
.swatches .swatch:last-child .dot { background: conic-gradient(#ff3b30, #ffcc00, #34c759, #00c7be, #007aff, #af52de, #ff2d55, #ff3b30); }

/* ---- #395 header at 375: the avatar is not a text link, the five tabs share the line with even gaps ---- */
.user-btn-link, .user-btn-link:hover, .user-btn-link .avatar { text-decoration: none; }
@media (max-width: 600px) { .site-nav .main-nav { justify-content: space-between; } .site-nav .main-nav .nav-link { flex: 1 1 auto; padding: 8px 6px; min-height: 44px; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; } }

/* ---- #396 times never wrap, and a list's time column is as wide as its widest time ("12:00 pm" stays on one line) ---- */
time { white-space: nowrap; }
.agenda li { grid-template-columns: max-content 1fr; }
.agenda li > time { min-width: 3.4rem; }

/* ---- #397 widths and cards ---- */
/* a card inside the page's card is a section with a hairline above it, not a second box */
.page > .card > .card, .page > .card > .colour-page .colour-section { border: 0; box-shadow: none; background: none; border-radius: 0; padding: 16px 0; margin: 0; }
.page > .card > .card + .card, .page > .card > .colour-page .colour-section + .colour-section { border-top: 1px solid var(--line); }
.page > .card > .card:first-child { padding-top: 0; }
.page > .card > .colour-page { gap: 0; max-width: none; }
.page > .card > .colour-page .colour-section:first-child { padding-top: 0; }
/* the Features list in Family settings: padding inside its card and a line between rows */
.feature-row { padding: 14px 16px; border-top: 1px solid var(--line); }
.feature-row:first-child { border-top: 0; }
.feature-row .feature-given, .feature-row .feature-cascade, .feature-row .feature-reask, .feature-row .feature-needs { font-size: .85rem; margin: 6px 0 0; }
.feature-row .feature-reask { color: var(--muted); }
.feature-row .feature-text { margin-top: 8px; }
.feature-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.feature-head > div { flex: 1 1 14rem; min-width: 0; }
.feature-head p.muted { margin: 2px 0 0; font-size: .9rem; }
/* cards that follow each other have room between them (the day grid and the Due card touched) */
.calendar-main > .card + .card, .calendar-main > section + section, .calendar-main .timeview + .card, .calendar-main > .card + section { margin-top: 16px; }

/* ---- #399 People: one row shape (avatar, name over a muted line, menu); the header carries the Family colour button ---- */
.rows li.person-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; }
.person-row .person-main { display: grid; gap: 1px; min-width: 0; }
.person-row .person-main strong { overflow-wrap: anywhere; }
.person-row .person-sub { font-size: .85rem; overflow-wrap: anywhere; }
.person-row .person-main { display: flex; flex-direction: column; }
.page-head { margin-bottom: 8px; }
.page-head + p.muted { margin-top: 6px; }
.page-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- #399 the More page (on a phone, the avatar's list): ONE grouped card like the apps' More: rows with a chevron, a hairline between rows, Log out inside the group ---- */
.more-list { padding: 0; overflow: hidden; }
.more-list hr { border: 0; border-top: 1px solid var(--line); margin: 0; }
.more-list .menu-item { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 12px 16px; border-radius: 0; border-top: 1px solid var(--line); font-size: 1rem; font-weight: 500; }
.more-list > .menu-item:first-child, .more-list > .menu-item:first-child + .menu-item { border-top: 0; }
.more-list .menu-item.menu-card { flex-direction: row; justify-content: space-between; gap: 10px; }
.more-list .menu-item.menu-card > strong { font-weight: 500; flex: none; }
.more-list .menu-item.menu-card > .muted { flex: 1; min-width: 0; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.more-list a.menu-item::after { content: "›"; flex: none; margin-left: auto; color: var(--muted); font-size: 1.3rem; line-height: 1; }
.more-list .menu-item.menu-card::after { margin-left: 0; }
.more-list form.inline { display: block; margin: 0; border-top: 1px solid var(--line); }
.more-list form.inline .menu-item { border-top: 0; }
.more-list .menu-version { margin: 0; padding: 10px 16px 14px; text-align: center; }
/* the menu's own divider is the quiet line, never a bright rule (it was the brightest thing on the page in dark mode) */
.menu-panel hr, .more-list hr { border-color: var(--line); background: none; opacity: 1; }

/* ---- #399 one "whose" form, neutral role badges, targets of 36 px (44 on touch) ---- */
.person-tag { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .85rem; white-space: nowrap; min-width: 0; }
.person-tag .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--muted)); display: inline-block; }
.chip.role-chip { background: var(--fill); color: var(--muted); border: 0; text-transform: capitalize; font-weight: 600; }
.btn.small { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; }
@media (pointer: coarse) { .btn.small { min-height: 44px; } }

/* ---- #399 Home ---- */
.today-block .week-row.plain { padding-left: 0; padding-right: 0; } /* "This week ›" lines up with the rows above it */
.block-head > a.muted.plain { color: var(--accent); font-weight: 500; } /* "All tasks" looks like a link */

/* ---- #399 form pages: one section heading, the groups of "Add someone" with their buttons on the same side ---- */
h2.form-section, .card h2.form-section { margin: 22px 0 8px; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
fieldset.who-option { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
fieldset.who-option > legend { padding: 0; margin: 0 0 4px; font-size: 1rem; font-weight: 600; float: none; width: auto; }
fieldset.who-option .hint { margin: 0 0 10px; }
.form fieldset.who-option .actions { flex-direction: row; justify-content: flex-start; position: static; margin-top: 12px; padding: 0; border-top: 0; background: none; } /* the group's own button, on the left in every group, never the sticky Cancel/Save bar */

/* ---- #399 Tasks and Shopping add bars ---- */
.tasks-add .ohai-go { background: var(--accent); color: var(--on-accent); } /* the filled circle Home uses, always, not a bare arrow until you type */
.quick > input[name$="[quantity]"] { flex: 0 1 6rem; } /* Qty is about 6 rem, not as wide as the item field */

/* ---- #399 recipe edit at 375: the Quantity placeholder fits (6.5 rem), the step rows use the width of the other fields, the step field looks like the others ---- */
@media (max-width: 520px) { .ingredient-rows .ingredient-row { grid-template-columns: minmax(0, 1fr) 6.5rem 1.75rem; } }
.steps-list > .steps-row { grid-template-columns: 22px minmax(0, 1fr) 36px 36px; gap: 2px; background: none; }
.steps-list > .steps-row textarea { background: var(--fill); border: 1px solid transparent; border-radius: 12px; padding: 9px 12px; }
.steps-list > .steps-row textarea:focus { background: var(--card); border-color: var(--accent); outline: none; }
.steps-grip, .steps-del { width: 36px; height: 40px; }
.steps-add b { align-self: center; line-height: 1; }

/* ---- #399 week grid: a title is cut with an ellipsis (two lines at most), and the place line drops out before the title is cut ---- */
.week-grid .blk > a, .week-grid .blk > span.plain { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: break-word; }
@media (max-width: 1100px) { .week-grid .blk > .muted { display: none; } }

/* ---- batch 10 OhAI notice and the Finish-setting-up card: the main button filled, the rest links ---- */
.wiz-ticks { margin: 2px 0 0; font-size: .85rem; }
.ai-access-notice .actions .link-act, .wiz-banner .link-act { background: none; border: 0; padding: 8px 4px; color: var(--accent); font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; }
.ai-access-notice .actions .link-act:hover, .wiz-banner .link-act:hover { text-decoration: underline; }

/* ---- batch 10 Shopping: one add bar at the top (item, thin divider, Qty, round +), like the apps ---- */
form.quick.shop-bar { flex-wrap: nowrap; align-items: center; gap: 0; min-height: 56px; padding: 6px 6px 6px 18px; margin-bottom: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; }
form.quick.shop-bar:focus-within { border-color: var(--accent); }
form.quick.shop-bar > input[type=text] { border: 0; background: none; box-shadow: none; padding: 8px 0; font-size: 1.02rem; outline: none; min-width: 0; flex: 1 1 auto; }
form.quick.shop-bar > input[name$="[quantity]"] { flex: 0 0 5rem; width: 5rem; padding-left: 12px; margin-left: 10px; border-left: 1px solid var(--line); border-radius: 0; font-size: .95rem; }
form.quick.shop-bar .shop-go { flex: none; width: 44px; height: 44px; margin-left: 6px; border: 0; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 1.5rem; line-height: 1; cursor: pointer; display: grid; place-items: center; }

/* ---- batch 10 Expenses list, the shared rule: name and amount on the first line, payer dot / date / category under the name; one grouped list with hairlines ---- */
.expense-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 2px; align-items: start; }
.expense-list li .grow { grid-column: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.expense-list li .amount { grid-column: 2; grid-row: 1; text-align: right; font-variant-numeric: tabular-nums; }
.expense-list li .exp-sub { grid-column: 1 / -1; grid-row: 2; display: flex; align-items: center; gap: 6px; font-size: .85rem; text-align: left; }
.expense-list li .exp-sub .person-tag { display: inline-flex; }

/* ---- batch 10 (#407) dish labels: "Not suitable for ..." is the error red (.meal-label); "Not checked for allergies or diets" is only a muted note ---- */
.meal-note { color: var(--muted); font-size: .85rem; font-weight: 500; }
p.meal-note { margin: 10px 0; text-align: center; }
.meal-page p.meal-note { margin: 0 0 14px; text-align: left; }
.proposal-unchecked-note { color: var(--muted); }

/* ---- batch 10 Account: many small forms on one page, so no form pins its button to the bottom of the screen (it sat on top of the fields): field, helper text, then the button, in normal flow ---- */
.account-page .form .actions { position: static; background: none; border-top: 0; padding: 12px 0 0; margin-top: 12px; }

/* ---- batch 10 compact lists: a shared event has no dot in the time column (its people's dots start the second line) ---- */
.agenda li.c-multi::before { content: none; }
.today-ev .dot.c-multi { visibility: hidden; }

/* ---- batch 10 consent tick (My details, a person's food fields): the text is plain text inside ONE calm box (not grey in grey) and the tick is the app's own, level with its label ---- */
.food-fields .wiz-consent { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.food-fields .wiz-consent .food-consent { background: none; padding: 0; margin: 0 0 10px; }
.food-fields .wiz-check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.food-fields .wiz-check input[type=checkbox] { flex: none; width: 1.3rem; height: 1.3rem; margin: 0; accent-color: var(--accent); }
.food-fields .wiz-check strong { font-weight: 600; }

/* ---- #410 the Week list at phone width: filled cards like the apps (#393/#413). The card is the person's colour tinted into the card colour with a 3 px bar at the leading edge; a shared
   event gets the soft blend and the split bar; Family is grey with no bar; no person dots after the names (they are the second line). ---- */
.tv-list .agenda, .today-rows:has(> .ev-card) { display: grid; gap: 6px; }
:is(.tv-list .agenda, .today-rows) li.ev-card {
  position: relative; overflow: hidden; border-top: 0; border-radius: 10px; padding: 8px 10px 8px 14px;
  background: color-mix(in srgb, var(--c, var(--muted)) 20%, var(--card)); box-shadow: inset 3px 0 0 var(--c, var(--muted));
}
:is(.tv-list .agenda, .today-rows) li.ev-card::before { content: none; }
:is(.tv-list .agenda, .today-rows) li.ev-card.c-family { box-shadow: none; }
:is(.tv-list .agenda, .today-rows) li.ev-card .person-dots { display: none; }
:is(.tv-list .agenda, .today-rows) li.ev-card.is-bin { align-items: center; }
:is(.tv-list .agenda, .today-rows) li.ev-card.is-bin .ev-bin { margin-left: 0; }
:is(.tv-list .agenda, .today-rows) li.ev-card.shared.look-split { box-shadow: none; background: var(--card); }
:is(.tv-list .agenda, .today-rows) li.ev-card.shared.look-split .parts { inset: -14px; gap: 0; filter: blur(11px); }
:is(.tv-list .agenda, .today-rows) li.ev-card.shared.look-split .parts i { background: color-mix(in srgb, var(--c, var(--muted)) var(--shared-tint), var(--card)); }
:is(.tv-list .agenda, .today-rows) li.ev-card.shared.look-split .parts-bar { display: flex; flex-direction: column; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; z-index: 1; pointer-events: none; }
:is(.tv-list .agenda, .today-rows) li.ev-card.shared.look-split .parts-bar i { flex: 1 1 0; background: var(--c, var(--muted)); }
:is(.tv-list .agenda, .today-rows) li.ev-card.shared.look-bar { background: color-mix(in srgb, var(--muted) 12%, var(--card)); box-shadow: none; padding-left: 14px; }
:is(.tv-list .agenda, .today-rows) li.ev-card.shared.look-bar .parts { width: 4px; gap: 0; }

/* ---- #410 the Week grid: a short block (under 46 minutes) is ONE line, the time and then the title cut with an ellipsis, never a title sliced by the block's bottom edge ---- */
.blk.short { display: flex; align-items: center; gap: 4px; padding: 0 6px 0 8px; }
.blk.short time { flex: none; margin-right: 0; }
.blk.short a, .blk.short span.plain { display: block; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blk.short .person-dots { flex: none; }

/* ---- #408 Home To do: the + beside the heading (as Shopping's); its sheet drops under the heading as a card ---- */
.block-head:has(.plus-sheet) { position: relative; }
.head-add .plus-sheet { margin: 0; }
.head-add .plus-sheet[open] > summary { margin-bottom: 0; }
.head-add .plus-sheet > form { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 5; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; box-shadow: 0 8px 24px rgb(0 0 0 / .14); }

/* ---- #408 the Week grid in narrow columns (768): a block's title is cut with an ellipsis and the place line drops out first, never a title broken in the middle of a word ---- */
.blk { container-type: size; }
@container (max-width: 110px) {
  .blk .muted { display: none; }
  .blk a.plain, .blk span.plain { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ---- #408 Meals settings: the grid uses the card's width, the switch sits beside its label, Cancel on the left and Save on the right ---- */
.meals-settings .slot-grid { max-width: none; }
.meals-settings .actions { flex-direction: row; }
.meals-settings .actions .autosave-status { margin-right: auto; }
.form .field.switch-field { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center; }
.form .field.switch-field > .hint { grid-column: 2; margin: 0; }

/* #412 Home Agenda: the same cards, 4 px bar, blocks 6 apart, "This week ›" after a hairline */
.today-rows li.today-ev.ev-card { grid-template-columns: 3.4rem minmax(0, 1fr); min-height: 0; padding: 8px 10px 8px 16px; box-shadow: inset 4px 0 0 var(--c, var(--muted)); }
.today-rows li.today-ev.ev-card.c-family { box-shadow: none; }
.today-rows li.today-ev.ev-card.shared.look-split { box-shadow: none; }
.today-rows li.today-ev.ev-card.shared .parts-bar { width: 4px; }
.today-rows li.today-ev.ev-card .what .muted { color: var(--muted); }
.today-rows li.today-ev.ev-card .ev-bin { grid-column: 1; }
.today-block .week-row.plain { margin-top: 10px; }

/* ---- batch 11 Design fixes ---- */
/* Expenses: "What / where" is its own full-width row at every width */
form.quick.expense-add .qf-wide { grid-column: 1 / -1; }
/* Expenses rows: "Family · 16 Nov", one space before the dot */
.expense-list li .exp-sub { gap: 0; }
.expense-list li .exp-sub .person-tag { margin-right: .28em; }
/* Meals settings: the Save bar stays in the flow, so it never covers the end of the text above it */
.form-flow-actions .actions, .meals-settings .actions { position: static; border-top: 0; background: none; padding: 12px 0 0; }
/* People avatars (the decided rule): light = the person's ink colour with a white initial; dark = the person's colour with a dark initial; no tint, no ring */
.avatar[class*=" c-"] { background: var(--c-ink, var(--c)); color: #fff; box-shadow: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .avatar[class*=" c-"] { background: var(--c); color: #12161b; } }
:root[data-theme="dark"] .avatar[class*=" c-"] { background: var(--c); color: #12161b; }
/* Home on a wide screen: the same centred column as Expenses, People and Meals settings */
.home-col { max-width: 760px; margin-inline: auto; }

/* Home agenda: a title and its second line stay on ONE line each and are cut with an ellipsis (the apps' rule) */
.today-rows li.today-ev.ev-card .what { min-width: 0; }
.today-rows li.today-ev.ev-card .what > strong, .today-rows li.today-ev.ev-card .what > .muted { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; overflow-wrap: normal; }
.today-rows li.today-ev.ev-card .what > strong a { overflow-wrap: normal; }

/* #414: on a phone, Today and + sit in the title row (as in the apps); the view switch is the second row and the arrows the third. The grid is only the phone's: from 521px
   up the toolbar is as it was. (display: contents lets the buttons inside the nav take part in the header's grid.) */
@media (max-width: 520px) {
  header.top.cal-top { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; }
  header.top.cal-top > div:first-child { grid-column: 1; grid-row: 1; min-width: 0; }
  header.top.cal-top > .top-nav, header.top.cal-top > .top-nav > .btn-group { display: contents; }
  .cal-top h1 { font-size: 1.45rem; line-height: 1.2; overflow-wrap: anywhere; } /* #421: a long day title wraps in two short lines, not three tall ones */
  .cal-top .cal-today { grid-column: 2; grid-row: 1; flex: none; }
  .cal-top .cal-add { grid-column: 3; grid-row: 1; flex: none; min-width: 44px; padding-left: 12px; padding-right: 12px; font-size: 0; }
  .cal-top .cal-add::before { content: "+"; font-size: 1.25rem; line-height: 1; }
  .cal-top .view-switch { grid-column: 1 / -1; grid-row: 2; margin: 2px 0 0; }
  .cal-top .cal-prev { grid-column: 1; grid-row: 3; justify-self: start; min-width: 44px; }
  .cal-top .cal-next { grid-column: 3; grid-row: 3; justify-self: end; min-width: 44px; }
}
.proof-step { margin-top: 12px; } /* #463: "Confirm it is you" under a sign-in method */
/* #473: on a phone the Week list opens at today with the week's header (title, Today, +, the switch and the arrows) staying in view above it; a day's section stops below the header when scrolled to. */
@media (max-width: 640px) {
  .week-main > header.top.cal-top { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 8px 0 6px; margin: 0 0 4px; }
  .week-main .tv-list-day { scroll-margin-top: 150px; }
}

/* #421: the Day view on a phone: the date strip and the day's cards (the same list the Week uses); the time grid returns at 768px. */
.day-strip, .day-cards { display: none; }
@media (max-width: 767px) {
  .timeview.day-grid { display: none; }
  .day-cards { display: block; }
  .day-cards .tv-list { display: block; }
  .day-cards .tv-list-day h3 { display: none; } /* the title above already says which day */
  .day-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin: 4px 0 10px; }
  .day-strip-day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 12px; text-decoration: none; color: var(--muted); font-size: .72rem; }
  .day-strip-day strong { font-size: 1rem; color: var(--ink); }
  .day-strip-day.today strong { color: var(--accent); }
  .day-strip-day.on { background: var(--seg-thumb, var(--fill)); box-shadow: var(--seg-shadow, none); }
}

/* #439 My calendars on the Account page */
.my-calendars .source-group { padding: 12px 0; border-top: 1px solid var(--line); }
.my-calendars .source-head { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; } /* #611: the title row never wraps, at every width down to 320 px: the title on the left, Sync and the menu on the right */
.my-calendars .source-head > * { flex-shrink: 0; }
.my-calendars .source-title { flex: 1 1 0; min-width: 0; overflow-wrap: break-word; }
.my-calendars .source-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-top: 2px; }
.my-calendars .error { color: var(--rose-ink); } /* #610: a problem reads red (the partial line stays muted) */
 /* #618: a calendar row is one row at every width: the dot, the name (it may wrap, the error sentence under it), the switch on the right (My calendars only) */
.my-calendars .calendars li { display: flex; flex-wrap: nowrap; align-items: center; gap: 12px; }
.my-calendars .calendars li > .dot, .my-calendars .calendars li > .inline-form { flex-shrink: 0; }
.my-calendars .cal-name { flex: 1 1 0; min-width: 0; overflow-wrap: break-word; display: flex; flex-direction: column; gap: 2px; }
.my-calendars .cal-name .error { display: block; font-size: .85rem; }
.my-calendars .source-meta .muted { font-size: .85rem; }
.my-calendars .source-status { margin: 4px 0 6px; font-size: .85rem; }
.my-calendars .inline-form { display: inline-flex; align-items: center; gap: 8px; }
.my-calendars .provider-grid { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.pause-dialog { border: 0; border-radius: 16px; padding: 20px; max-width: min(92vw, 30rem); background: var(--card); color: var(--ink); box-shadow: 0 10px 40px rgb(0 0 0 / .3); }
.pause-dialog::backdrop { background: rgb(0 0 0 / .45); }
.pause-dialog h3 { margin: 0 0 8px; font-size: 1.1rem; }
.pause-buttons { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.pause-buttons .btn { width: 100%; justify-content: center; text-align: center; }
@media (min-width: 600px) { .pause-buttons { flex-direction: row; justify-content: flex-end; } .pause-buttons .btn { width: auto; } }

/* the dark tint of shared events (#353); kept last in the file: test/lib/member_colours_css_test.rb scans for the theme blocks and must not run into later multi-line rules */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --shared-tint: 34%; } }
:root[data-theme="dark"] { --shared-tint: 34%; }

/* #476: the reminder picker's Custom... amount and unit sit under the choice. */
.reminder-custom { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.reminder-custom[hidden] { display: none; }
.reminder-custom .reminder-amount { width: 6rem; }

/* #253: the quiet "Show N older bought items" row at the very end of the shopping list */
.show-older { display: block; width: 100%; min-height: 44px; margin-top: 4px; padding: 0 12px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--accent); font: inherit; text-align: center; cursor: pointer; }
.show-older:disabled { color: var(--muted); cursor: default; }
.show-older.loading::after { content: ""; display: inline-block; width: 14px; height: 14px; margin-left: 8px; vertical-align: -2px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: show-older-spin .7s linear infinite; }
@keyframes show-older-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .show-older.loading::after { animation: none; } }
