@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,400&family=DM+Sans:wght@400;500;600;700&display=swap');
:root{color-scheme:light;--pine:#2b2024;--ink:#2b2024;--muted:#6b5a60;--paper:#fbf4ef;--line:#eadcd6;--lime:#f2b8c9;--chip:#f4ece7;--chip-soft:#f3e6e2;--rose:#a23e62;--card-radius:24px;--field-radius:14px;--card-shadow:0 1px 2px color-mix(in srgb, var(--shadow-color) 3.9%, transparent),0 12px 32px color-mix(in srgb, var(--rose) 7.8%, transparent)}

/* ===================================================================================================
   Theme values. Everything a theme may change is defined here, with the default theme's values.
   A theme is a stylesheet that redefines some of these under :root[data-theme="<name>"]
   (see docs/theming.md). Rules elsewhere in this file use these values, never raw colours or fonts.
   =================================================================================================== */
/* Preview tiles in Settings start from these defaults too, so each shows only its own theme. */
:root,
[data-theme-preview] {
  /* Fonts */
  --font-heading: Fraunces, Georgia, 'Times New Roman', serif;
  --font-body: 'DM Sans', system-ui, sans-serif;

  /* Surfaces (--paper, --chip and --chip-soft are set in the palette above) */
  --surface: #fff;              /* cards, menus, pickers, fields */
  --surface-soft: #faf3f0;      /* quiet rows: More details, opened locked action */
  --surface-locked: #fcf8f6;    /* locked fields */
  --tile-surface: #fffdf8;      /* calendar date pages in To-do */
  --tile-line: #e8d8d2;
  --chip-static: #e8e8e8;       /* read-only chips such as Creator */
  --chip-static-ink: #4b4b4b;

  /* Text (--ink and --muted are set in the palette above) */
  --muted-soft: #8a7b80;        /* faint undo arrow */
  --icon-muted: #9a8a8f;        /* no longer used: lock icons take --muted so they reach 3:1 */
  --disabled: #b8aaa8;          /* unavailable actions */
  --on-dark: #fbf4ef;           /* text on --pine surfaces */
  --on-accent: #fff;            /* text on --rose, --danger and other filled buttons */

  /* Accent (--rose, --lime and --pine are set in the palette above) */
  --accent-strong: #8e2f52;     /* icon drawings, tile labels, overdue check circle */

  /* Meaning: keep these recognisable in every theme */
  --danger: #a7352c;            /* delete, overdue stamps, late labels */
  --danger-ink: #8b302b;        /* error text */
  --danger-line: #bd6a61;       /* outline of the Overdue section */
  --danger-soft: #f5dfdb;       /* error backgrounds */
  --danger-tint: #efd1cc;       /* implied month on date pages */
  --notice-surface: #792d26;    /* error snackbar */
  --success: #3f5a46;           /* Attended stamp */
  --flash: #efb3ad;             /* Save pulses this colour when closing with unsaved changes */

  /* Special dates card */
  --feature-surface: #f1ebfa;
  --feature-ink: #5b4a7a;
  --feature-action: #6a4a9c;

  /* Plans card colours: a background, row dividers and an accent (the › by the title) per card.
     Cards default to --surface, so a theme that wants one colour sets none of these. */
  --card-meals-surface: var(--surface);        --card-meals-line: var(--line);        --card-meals-accent: var(--rose);
  --card-chores-surface: var(--surface);       --card-chores-line: var(--line);       --card-chores-accent: var(--rose);
  --card-dates-surface: var(--feature-surface); --card-dates-line: var(--line);       --card-dates-accent: var(--feature-action);
  --card-bills-surface: var(--surface);        --card-bills-line: var(--line);        --card-bills-accent: var(--rose);
  --card-transport-surface: var(--surface);    --card-transport-line: var(--line);    --card-transport-accent: var(--rose);
  --card-outings-surface: var(--surface);      --card-outings-line: var(--line);      --card-outings-accent: var(--rose);
  --card-appointments-surface: var(--surface); --card-appointments-line: var(--line); --card-appointments-accent: var(--rose);

  /* Older category chips */
  --category-bg: #f4e3d3;
  --category-blue: #e5eef9;
  --category-lilac: #efe8f8;

  /* People: one background and text pair per person, in family order */
  --person-0-bg: #f4e3d3; --person-0-ink: #6a3f1c;
  --person-1-bg: #e3ece4; --person-1-ink: #34503b;
  --person-2-bg: #e4e0f3; --person-2-ink: #3d3466;
  --person-3-bg: #f6e0e8; --person-3-ink: #6b3a4a;
  --person-4-bg: #dde9f3; --person-4-ink: #2f4a63;
  --person-5-bg: #f3ecc9; --person-5-ink: #5a4a17;

  /* Top bar */
  --nav-bg: #f1e4dc;
  --nav-label-color: var(--muted);
  --nav-selected-bg: var(--surface);
  --nav-selected-ink: var(--ink);
  --nav-border-color: #e6d4cc;
  --assistant-border: #4a3a40;  /* outline of the dark assistant bar */

  /* Shadows are mixed from this colour */
  --shadow-color: #2b2024;
}

/* The app never pulls to refresh: a downward pull at the top belongs to the page (Chrome reads
   this from either root element). */
html, body { overscroll-behavior-y: none; }

/* Blossom's card colours: peach meals, lilac special dates (from --feature-surface), sage payments,
   sky away from home. Other themes set their own or keep one colour. */
:root:not([data-theme]) {
  --card-meals-surface: #fdeee3;   --card-meals-line: #f4dccb;   --card-meals-accent: #a5502a;
  --card-dates-line: #e2d8f1;
  --card-bills-surface: #e8f2ea;   --card-bills-line: #d3e5d7;   --card-bills-accent: #3f7550;
  --card-outings-surface: #e6f0f8; --card-outings-line: #d0e1ee; --card-outings-accent: #36658c;
}

*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font:calc(15px * var(--font-scale)) var(--font-body);display:grid;grid-template-columns:minmax(0,1fr);min-height:100vh}a{color:inherit;text-decoration:none}button,input,select{font:inherit}button{cursor:pointer;color:inherit}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid var(--rose);outline-offset:3px}
main{width:100%;max-width:1340px;margin:auto;padding:35px clamp(20px,4vw,64px) 48px;align-self:start;margin-top:0}header,.section-head,.chat-header{display:flex;align-items:center;justify-content:space-between;gap:14px}header{margin-bottom:23px}.date{font-size:calc(14px * var(--font-scale));color:var(--muted);margin:0 0 5px}h1,h2,h3,p{margin:0}h1,h2{font-family:var(--font-heading);font-weight:400;font-optical-sizing:auto}h1{font-size:calc(clamp(32px,5vw,54px) * var(--font-scale));letter-spacing:-.01em;line-height:1.05}h2{font-size:calc(23px * var(--font-scale));letter-spacing:0}h3{font-size:calc(16px * var(--font-scale));margin:4px 0}.primary{border:0;border-radius:9px;padding:11px 15px;background:var(--pine);color: var(--on-dark);font-weight:700;white-space:nowrap}#chat-form input{min-width:0;flex:1;border:0;background:transparent;color:var(--ink);padding:9px 2px}
.dashboard{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(0,1fr);align-items:start}.stack{display:grid}.panel{border:1px solid transparent;border-radius:var(--card-radius);background:var(--surface);padding:20px;box-shadow:var(--card-shadow)}.schedule{height:100%}.section-head a,.dinner a{font-size:calc(13px * var(--font-scale));font-weight:700}.section-head a:hover,.dinner a:hover{text-decoration:underline}.timeline,.rows{list-style:none;padding:0;margin:12px 0 0}.timeline li{display:grid;grid-template-columns:75px 1fr;padding:14px 0;border-top:1px solid var(--line);gap:12px}.timeline time{font-size:calc(14px * var(--font-scale));font-weight:700;padding-top:4px}.category{display:inline-block;padding:3px 7px;border-radius:4px;background: var(--category-bg);font-size:calc(11px * var(--font-scale));font-weight:700}.category.blue{background:var(--category-blue)}.category.lilac{background:var(--category-lilac)}small{display:block;color:var(--muted);font-size:calc(13px * var(--font-scale))}.dinner{background:var(--lime);padding:20px 23px;border-radius:13px}.dinner p{font-weight:700;font-size:calc(13px * var(--font-scale))}.dinner h2{font-size:calc(clamp(25px,3vw,39px) * var(--font-scale));line-height:1;letter-spacing:-.045em;margin:9px 0}.dinner a{display:inline-block;margin-top:12px}.remaining{font-size:calc(12px * var(--font-scale));color:var(--muted)}#chat-form{display:flex;gap:8px;border-top:1px solid var(--line);padding-top:8px}
dialog{border:1px solid var(--line);border-radius:var(--card-radius);padding:18px;width:min(95vw,460px);color:var(--ink);margin:auto 20px 20px auto;box-shadow:0 12px 50px color-mix(in srgb, var(--shadow-color) 18.8%, transparent)}dialog::backdrop{background:color-mix(in srgb, var(--shadow-color) 37.6%, transparent)}.chat-header button,.suggestions button{background:var(--paper);border:1px solid var(--line);border-radius:8px;padding:5px 9px}.chat-header button{font-size:calc(20px * var(--font-scale))}#messages{max-height:42vh;overflow:auto;display:grid;gap:8px;margin:14px 0}#messages p{padding:9px 12px;background:var(--paper);border-radius:9px;max-width:94%;white-space:pre-line}#messages .mine{justify-self:end;background:var(--lime)}.suggestions{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:10px}.suggestions button{font-size:calc(12px * var(--font-scale))}
@media(max-width:590px){.dashboard{grid-template-columns:1fr}.panel{padding:16px}dialog{margin:auto auto 8px}.primary{padding:9px 11px}}
.calendar-sections {
  display: grid;
}

:is(.dashboard, .stack, .calendar-sections) {
  gap: var(--card-gap);
}

.calendar-sections > [data-period]:not([data-card-expanded]):not(:has(> [data-card-items] > li)) {
  display: none;
}

.calendar-sections [data-period="overdue"]:has(> [data-card-items] > li) {
  border-color: var(--danger-line);
  box-shadow: inset 0 0 0 1px var(--danger-line), var(--card-shadow);
}

.bottom-controls,
.error-snackbar {
  --control-gutter: max(16px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  position: fixed;
  inset-inline: 0;
  width: min(440px, calc(100% - 2 * var(--control-gutter)));
  margin: 0 auto;
}

.app-header,
.bottom-controls {
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
}

:root {
  --card-gap: 16px;
  --floating-bar-inset: calc(16px + max(env(safe-area-inset-top, 0px), env(safe-area-inset-bottom, 0px)));
  --top-bar-padding-end: 10px;
  --bottom-controls-clearance: calc(76px + var(--floating-bar-inset));
  --tab-height: 42px;
  --tab-bar-padding-block: 5px;
  --nav-border-width: 1px;
  --tab-bar-height: calc(var(--tab-height) + 2 * (var(--tab-bar-padding-block) + var(--nav-border-width)));
}

.app-header {
  /* Line the bar up with the cards' edges: the page padding, plus centring once the page hits its max width. */
  --header-gutter: max(calc(clamp(20px, 4vw, 64px) + max(0px, (100vw - 1340px) / 2)),
    env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  position: fixed;
  inset-block-start: var(--floating-bar-inset);
  inset-inline: var(--header-gutter);
  margin: 0;
  display: grid;
  /* Mockup A: the navigation pill sits at the left, Settings at the right. */
  /* The brand mark, then the navigation pill at the left; Settings at the right. */
  grid-template-columns: auto minmax(0, 440px) 1fr var(--tab-bar-height);
  --header-column-gap: 8px;
  column-gap: var(--header-column-gap);
}

.bottom-controls {
  inset-block-end: var(--floating-bar-inset);
  justify-content: flex-end;
}

.tab-bar,
.assistant-bar {
  border: var(--nav-border-width) solid var(--nav-border-color);
  border-radius: 999px;
  background: var(--pine);
  color: var(--on-dark);
  box-shadow: 0 6px 24px color-mix(in srgb, var(--shadow-color) 20%, transparent);
}

.app-header .tab-bar {
  background: var(--nav-bg);
  color: var(--nav-label-color);
  box-shadow: 0 6px 24px color-mix(in srgb, var(--shadow-color) 12.2%, transparent);
}

.settings-link {
  position: relative;
  grid-column: 4;
  justify-self: end;
  display: grid;
  place-items: center;
  width: var(--tab-bar-height);
  height: var(--tab-bar-height);
  border: var(--nav-border-width) solid var(--nav-border-color);
  border-radius: 50%;
  background: var(--nav-bg);
  color: var(--ink);
  box-shadow: 0 6px 24px color-mix(in srgb, var(--shadow-color) 12.2%, transparent);
}

.tab-bar a,
.settings-link {
  -webkit-tap-highlight-color: transparent;
}

.settings-link svg {
  position: relative;
  width: 50%;
  height: auto;
}

:is(.tab-highlight-track, .settings-highlight-track) {
  position: absolute;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}

.tab-highlight-track { inset: 0; }

.settings-highlight-track {
  inset: var(--tab-bar-padding-block);
  visibility: hidden;
}

.settings-highlight {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--nav-selected-bg);
}

.settings-link:is([data-nav-current], [data-highlight-leaving]) .settings-highlight-track {
  visibility: visible;
}

.assistant-bar {
  position: relative;
  display: grid;
  place-items: center;
  text-align: center;
  width: 100%;
  min-height: 56px;
  padding: 2px clamp(42px, 10vw, 56px);
  font-size: calc(15px * var(--font-scale));
  font-weight: 500;
  letter-spacing: 0.01em;
  /* Mockup A: a deeper, softer float than the tab bar. */
  box-shadow: 0 16px 40px color-mix(in srgb, var(--shadow-color) 25.1%, transparent), 0 2px 6px color-mix(in srgb, var(--shadow-color) 12.2%, transparent);
}

.ask-star,
.ask-mic {
  position: absolute;
  inset-block: 0;
  display: grid;
  place-items: center;
  inline-size: 54px;
}

.ask-star {
  inset-inline-start: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
}

.ask-mic {
  inset-inline-end: 0;
}

.ask-star > svg,
.ask-mic > svg {
  inline-size: 24px;
  block-size: 24px;
}

.ask-star-icon {
  fill: currentColor;
  stroke: var(--pine);
  stroke-width: 1;
  stroke-linejoin: round;
}

.ask-close-icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.ask-star-icon,
.ask-close-icon {
  transition: opacity 200ms ease-out;
}

.ask-star[aria-expanded="true"] .ask-star-icon,
.ask-star[aria-expanded="false"] .ask-close-icon {
  opacity: 0;
}

.tab-bar {
  --tab-icon-size: 24px;
  --tab-icon-start: calc((var(--tab-height) - var(--tab-icon-size)) / 2);
  --tab-label-gap: 3px;
  position: relative;
  grid-column: 2;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  padding: var(--tab-bar-padding-block) 5px;
  font-size: calc(18px * var(--font-scale));
}

.tab-highlight {
  position: absolute;
  inset-block-start: var(--tab-bar-padding-block);
  left: 0;
  height: var(--tab-height);
  border-radius: 999px;
  background: var(--nav-selected-bg);
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .tab-highlight[data-slide] {
    transition: transform 220ms cubic-bezier(.2,.75,.25,1), inline-size 220ms cubic-bezier(.2,.75,.25,1);
  }
}

.tab-bar a {
  --tab-leading-space: calc(var(--tab-icon-start) + var(--tab-icon-size) * var(--tab-icon-end) / 24 + var(--tab-label-gap));
  position: relative;
  display: flex;
  flex: 1 1 calc(var(--tab-leading-space) + var(--tab-label-gap));
  align-items: center;
  min-height: var(--tab-height);
  border-radius: 999px;
  color: var(--nav-label-color);
  font-weight: 600;
  white-space: nowrap;
}

/* Rightmost point of each icon's stroke in its 24-unit viewBox. */
.tab-bar a[href="#calendar"] { --tab-icon-end: 20; }
.tab-bar a[href="#household"] { --tab-icon-end: 22; }
.tab-bar a[href="#lists"] { --tab-icon-end: 21; }

.tab-icon {
  visibility: hidden;
  flex: 1 0 var(--tab-leading-space);
  height: var(--tab-icon-size);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tab-bar a::after {
  content: "";
  flex: 1 0 var(--tab-label-gap);
}
.tab-bar a[hidden] { display: none; }

.tab-label {
  --highlight-start: 0px;
  --highlight-end: 0px;
  background-image: linear-gradient(to right,
    var(--nav-label-color) 0 var(--highlight-start),
    var(--nav-selected-ink) var(--highlight-start) var(--highlight-end),
    var(--nav-label-color) var(--highlight-end));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@media (forced-colors: active) {
  .tab-label { color: inherit; }
}

.tab-bar a[data-nav-current] .tab-icon {
  visibility: visible;
}

.tab-bar a[data-nav-current],
.settings-link[data-nav-current] {
  color: var(--nav-selected-ink);
}

.settings-link[data-nav-current] {
  border-color: var(--nav-border-color);
}

@media (max-width: 400px) {
  .bottom-controls {
    --control-gutter: max(8px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  }
}

@media (max-width: 460px) {
  :root {
    --tab-height: 34px;
  }

  .app-header {
    --header-column-gap: 4px;
    gap: 4px;
  }

  .tab-bar {
    --tab-icon-size: 18px;
    --tab-icon-start: 3px;
    --tab-label-gap: 1px;
    font-size: calc(16px * var(--font-scale));
    padding-inline: 3px;
  }
}

@media (max-width: 360px) {
  :root {
    --tab-height: 30px;
  }

  .app-header {
    --header-column-gap: 2px;
    gap: 2px;
  }

  .tab-bar {
    --tab-icon-size: 15px;
    --tab-icon-start: 1px;
    --tab-label-gap: 0px;
    font-size: calc(14px * var(--font-scale));
    padding-inline: 2px;
  }
}

main {
  padding-block-start: calc(var(--floating-bar-inset) + var(--tab-bar-height) + var(--top-bar-padding-end) + var(--card-gap));
  padding-block-end: var(--bottom-controls-clearance);
}

.error-snackbar {
  top: auto;
  bottom: calc(var(--floating-bar-inset) + var(--ask-bar-height, 54px));
  padding: 0 0 8px;
  overflow: visible;
  clip-path: inset(-24px -24px 0);
  border: 0;
  background: transparent;
  pointer-events: none;
}

.snackbar-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 11px 8px 17px;
  border-radius: 12px;
  background: var(--notice-surface);
  color: var(--on-accent);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--shadow-color) 20%, transparent);
  pointer-events: auto;
}

.snackbar-panel p {
  flex: 1;
  overflow-wrap: anywhere;
}

.snackbar-panel.snackbar-notice {
  background: var(--ink);
}

.snackbar-action {
  flex: none;
  height: 36px;
  padding-inline: 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
}

.snackbar-action:hover {
  background: #ffffff26;
}

.icon-button, .secondary {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
}

.icon-button {
  flex: none;
  width: 38px;
  font-size: calc(21px * var(--font-scale));
  line-height: 1;
}

.secondary {
  padding: 6px 12px;
}

.household-dialog {
  position: fixed;
  margin: auto;
  max-height: calc(100dvh - 32px);
  overflow: auto;
}

#editor-fields {
  display: grid;
  gap: 12px;
  margin-block: 14px;
}

#editor-fields fieldset,
.inline-item-editor fieldset {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--field-radius);
}

#editor-fields legend {
  font-size: calc(16px * var(--font-scale));
}

#editor-fields input {
  width: 100%;
  font: inherit;
  font-size: calc(16px * var(--font-scale));
  color: var(--ink);
}

#editor-fields input,
.inline-item-editor input {
  font-size: calc(18px * var(--font-scale));
  border: 0;
  background: transparent;
  padding: 0;
}

.editor-actions {
  font-size: calc(16px * var(--font-scale));
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.date-display{display:inline-flex;flex-direction:column;align-items:center;gap:3px;flex-shrink:0}
.date-page {
  display: inline-grid;
  min-width: 58px;
  overflow: hidden;
  border: 1px solid var(--tile-line);
  border-radius: 8px;
  background: var(--tile-surface);
  color: var(--ink);
  text-align: center;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--shadow-color) 9.4%, transparent);
  zoom: 0.7;
}
.date-page>.date-month{min-height:18px;background:var(--danger);color: var(--on-accent);padding:3px 5px;font-size:calc(10px * var(--font-scale));font-weight:700;line-height:1.2}
.date-page>.date-number{color:var(--ink);padding:2px 5px 4px;font-size:calc(22px * var(--font-scale));font-weight:800;line-height:1.1;font-variant-numeric:tabular-nums}
.date-display .date-accessible{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
header .date-display{margin-bottom:10px}
.date-display > .date-weekday {
  color: var(--ink);
  font-size: calc(12px * var(--font-scale));
  font-weight: 700;
  text-align: center;
}
header .date[hidden]{display:none}
.date-page > .date-month-implied {
  background: var(--danger-tint);
  border-radius: 7px 7px 0 0;
}
.date-past { position: relative; }
.date-past::after {
  content: "";
  position: absolute;
  inset: 0;
  background: center / 80% 90% no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 24'%3E%3Cpath d='M4 20 Q20 14 44 4' fill='none' stroke='%23243653' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E");
}

.card-item-list:not([hidden]) {
  --card-item-column-gap: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  row-gap: 6px;
  margin-block-start: 12px;
}

[data-card-items][hidden] {
  display: none;
}

.card-item-list[data-card-schedules] {
  grid-template-columns: minmax(0, 1fr) fit-content(min(50%, var(--fit-column-width, 50%)));
  column-gap: var(--card-item-column-gap);
}

.card-item-list > [data-empty-list] {
  grid-column: 1 / -1;
  border: 0;
  padding: 8px;
}

.card-item-list > .card-item-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  column-gap: inherit;
  align-items: stretch;
  background: transparent;
  border: 0;
  padding: 0;
  text-align: start;
}

.card-row-exit {
  position: fixed;
  z-index: 1;
  overflow: clip;
  pointer-events: none;
}

[data-tab-card]:has(> .inline-item-editor) > .card-row-exit {
  display: none;
}

.card-row-exit > .card-item-list {
  margin: 0;
}

.card-row-exit > .card-item-list > .card-item-row {
  border-radius: 9px;
}

:is(.card-item-details, .card-item-copy, .card-item-schedule) {
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

:is(.card-item-details, .card-item-schedule) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  min-block-size: var(--card-item-min-height, 44px);
  padding: var(--card-item-padding-block, 8px) 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  text-align: start;
}

.card-item-details,
.card-item-copy {
  gap: 6px;
}

.card-item-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card-item-schedule {
  justify-items: end;
  gap: 3px;
  color: var(--muted);
  text-align: end;
}

.card-item-row :is(.card-item-details, .card-item-schedule) span:not(.date-accessible) {
  white-space: normal;
}

button.card-item-details > span:first-child,
.card-item-row .card-item-action-label {
  color: var(--ink);
}

.card-item-row .appointment-window-overdue {
  color: var(--rose);
}

.chore-assignment-warning {
  color: var(--rose);
}

:is(.chore-assignment-warning, .completion-timing-note):empty {
  display: none;
}

.card-item-row .person-chip,
.card-item-schedule .date-display {
  max-inline-size: 100%;
}

.card-item-schedule .date-display {
  text-align: center;
}

:is(.card-item-details, .card-item-copy) > small:not(.doer-list, :has(> .person-chip)) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grocery-list {
  --card-item-min-height: 36px;
  --card-item-padding-block: 6px;
}

.grocery-list .card-item-row > .card-item-schedule > span {
  white-space: nowrap;
}

.card-item-details.grocery-item-details {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.grocery-item-details .card-item-copy {
  flex: 1;
}

.person-chip > .person-chip-check {
  color: inherit;
  font-weight: 700;
}

.card-icon {
  display: inline-grid;
  place-items: center;
  inline-size: 1.8em;
  block-size: 1.8em;
  margin-inline-end: 0.45em;
  border-radius: 8px;
  background: var(--paper);
  font-size: 0.85em;
  vertical-align: middle;
}

.panel .card-icon {
  background: transparent;
}

#household-editor {
  inset: auto 0 0;
  width: 100%;
  max-width: none;
  margin: 0 auto;
  border-radius: 16px 16px 0 0;
  padding: 0;
  overflow: hidden;
}

#household-editor[open] {
  display: flex;
  flex-direction: column;
  animation: editor-slide-in 220ms ease-out;
}

@keyframes editor-slide-in {
  from { transform: translateY(100%); }
}

@media (prefers-reduced-motion: reduce) {
  #household-editor[open] { animation: none; }
}

.editable-row {
  cursor: pointer;
}

.item-edit-title {
  align-self: flex-start;
  justify-self: start;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: start;
}

.panel .card-item-row strong,
.panel .item-edit-title {
  font-weight: 400;
}

.grocery-list input[type="checkbox"] {
  flex: 0 0 auto;
  inline-size: 17px;
  block-size: 17px;
  margin: 0;
  accent-color: var(--ink);
  cursor: pointer;
}

:is(.groceries h2, .grocery-title-line) {
  display: flex;
  align-items: center;
}

:is(.groceries h2, .grocery-title-line) > .card-icon {
  flex-shrink: 0;
}

:is(.groceries, .tab-card-preview) .card-icon[hidden] {
  display: none;
}

.item-icon {
  display: inline-grid;
  place-items: center;
  inline-size: 1em;
  block-size: 1em;
  flex: none;
  line-height: 1;
}

.what-icon-picker .picker-options {
  grid-template-columns: repeat(4, max-content);
  overflow: auto;
}

.what-icon-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.what-icon-field > .what-icon-picker {
  flex: none;
  /* A flex box has no line box, so the selected chip sets the picker's height exactly. */
  display: flex;
  align-items: center;
}

.what-icon-field > input {
  min-inline-size: 0;
}

.what-icon-field .item-icon {
  transform: scale(1.5);
}

.what-title-icon {
  margin-inline-end: 0.4em;
  vertical-align: -0.08em;
}

.grocery-title {
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
}

.grocery-title:disabled {
  cursor: default;
}

.grocery-edit-action {
  display: grid;
  flex: 0 0 32px;
  height: 32px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
}

.grocery-edit-action::before {
  content: "";
  width: 18px;
  height: 18px;
  background: currentColor;
  mask: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m3 21 1.4-5.4L16.8 3.2a1.6 1.6 0 0 1 2.3 0l1.7 1.7a1.6 1.6 0 0 1 0 2.3L8.4 19.6 3 21Zm11.9-15.9 4 4M4.4 15.6l4 4' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* The + in the bottom row starts a new list, so the shell card only appears while its editor is open. */
[data-new-shopping-list]:not(:has(.inline-item-editor)) {
  display: none;
}

[data-new-shopping-list] .grocery-edit-action::before {
  background: linear-gradient(currentColor, currentColor) center / 14px 2px no-repeat,
    linear-gradient(currentColor, currentColor) center / 2px 14px no-repeat;
  mask: none;
}

.grocery-title-line:has(.grocery-title:disabled) .grocery-edit-action {
  display: none;
}

.grocery-quantity {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--chip-row-gap) var(--chip-gap);
}

.grocery-quantity-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grocery-quantity-options > button {
  width: 100%;
  justify-content: center;
}

.grocery-quantity-options > button:first-child {
  grid-column: 2;
}

.grocery-draft-error {
  color: var(--danger-ink);
}

.grocery-draft-error[hidden] {
  display: none;
}

.picker-chips,
.doer-list,
.card-item-details > small:has(> .person-chip) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--chip-row-gap) var(--chip-gap);
}

.picker-list-name {
  display: inline-flex;
  align-items: center;
}

.picker-list-conjunction {
  margin-inline-end: var(--chip-gap);
}

.card-item-row .person-chip,
.people-picker .person-chip,
.chore-static-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 4px 12px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb-linear, var(--chip) 75%, var(--pine));
  color: var(--ink);
  font-weight: 400;
}

.card-item-row .person-chip:not(.people-picker .person-chip) {
  background: var(--chip-soft);
}

.people-picker .remove-person {
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--danger);
}

.people-picker button:disabled {
  opacity: 0.5;
  cursor: default;
}

.picker-dropdown summary {
  cursor: pointer;
  list-style: none;
}

.picker-dropdown summary::-webkit-details-marker {
  display: none;
}

.picker-options {
  display: grid;
  justify-items: start;
  gap: var(--chip-row-gap) var(--chip-gap);
  margin-top: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.picker-dropdown {
  position: relative;
  justify-self: start;
  font-size: inherit;
}

.picker-dropdown .picker-options {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: -8px;
  margin-top: 0;
  z-index: 1;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--shadow-color) 14.9%, transparent);
}

.picker-dropdown:not([open]) > .picker-options,
.picker-dropdown > .picker-options:not([data-picker-positioned]) {
  visibility: hidden;
}

.people-picker .person-chip,
.chore-static-chip {
  font: inherit;
  line-height: calc(var(--person-chip-height) - 8px);
  block-size: var(--person-chip-height);
}

.people-picker .person-chip > .picker-dropdown > .picker-options {
  /* Account for the pill padding, dropdown padding, and dropdown border. */
  inset-inline-start: calc(-12px - 8px - 1px);
}

#editor-fields .people-picker {
  font-size: calc(16px * var(--font-scale));
}

.people-picker .person-chip:has(> .remove-person) {
  gap: 0;
  padding-inline-end: 0;
}

.people-picker .remove-person {
  display: grid;
  place-items: center;
  inline-size: 28px;
  block-size: 28px;
  margin-block: -4px;
}

.people-picker .picker-dropdown > summary.add-person-chip,
.chore-editor .add-chore-row {
  display: grid;
  place-items: center;
  inline-size: 28px;
  block-size: 28px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
}

.meal-tile-delete {
  position: absolute;
  inset-block-start: 0;
  inset-inline-end: 0;
  transform: translate(50%, -50%);
  display: grid;
  place-items: center;
  width: clamp(16px, 5vw, 24px);
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid var(--surface);
  border-radius: 50%;
  background: var(--danger);
  color: var(--on-accent);
  line-height: 1;
}

.meal-tile-delete[hidden] {
  display: none;
}

[data-today-badge] .date-page {
  min-width: 0;
  width: 1.4em;
  border-radius: 4px;
}

[data-today-badge] .date-page > .date-month {
  min-height: 5px;
  padding: 0;
}

.people-picker .picker-dropdown > summary.add-person-chip {
  inline-size: var(--person-chip-height);
  block-size: var(--person-chip-height);
}

[data-today-badge] .date-page > .date-number {
  padding: 1px 0 2px;
  font-size: calc(13px * var(--font-scale));
}

.late-stamp {
  display: inline-block;
  transform: rotate(-24deg);
  border: 1px solid currentColor;
  border-radius: 1px;
  mask-image: radial-gradient(circle at 25% 0, transparent 0.7px, black 1px),
    radial-gradient(circle at 80% 100%, transparent 0.9px, black 1.2px),
    radial-gradient(circle at 0 60%, transparent 0.7px, black 1px);
  mask-composite: intersect;
  padding: 1px 2px;
  color: var(--danger);
  font-size: calc(8px * var(--font-scale));
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.04em;
}

.chore-editor,
.chore-editor-group {
  display: grid;
  gap: 8px;
  font-size: calc(13px * var(--font-scale));
}

.chore-editor-group + .chore-editor-group {
  margin-block-start: 8px;
}

.chore-editor-group {
  position: relative;
  padding: 12px 16px;
  border-radius: 18px;
  background: var(--paper);
}

.household-dialog:has(.chore-editor) {
  width: 100%;
  max-width: none;
}

#editor-fields .chore-editor legend,
#editor-fields .chore-editor input,
#editor-fields .chore-editor .people-picker {
  font-size: calc(13px * var(--font-scale));
}

.chore-editor-schedule {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--chip-row-gap) var(--chip-gap);
}

.chip-strip {
  --schedule-fade-left: 0px;
  --schedule-fade-right: 0px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  scroll-padding-inline: 18px;
  mask-image: linear-gradient(to right, transparent, black var(--schedule-fade-left),
    black calc(100% - var(--schedule-fade-right)), transparent);
}

.chip-strip::-webkit-scrollbar {
  display: none;
}

.chip-strip[data-more-left] {
  --schedule-fade-left: 18px;
}

.chip-strip[data-more-right] {
  --schedule-fade-right: 18px;
}

.chip-strip .chip-strip-content {
  width: max-content;
  flex-wrap: nowrap;
  padding: 4px;
}

.chip-strip .picker-dropdown .picker-options[popover] {
  position: fixed;
  inset: auto;
  margin: 0;
}

.chip-strip .picker-options[popover]:not(:popover-open) {
  display: none;
}

.chore-static-chip {
  background: var(--chip-static);
  color: var(--chip-static-ink);
}

.meal-schedule {
  display: flex;
  align-items: center;
  gap: var(--chip-gap);
}

.meal-schedule .chip-strip {
  min-inline-size: 0;
}

.meal-schedule .chip-strip-content {
  padding: 0;
}

.meal-slot-error {
  flex: none;
  background: var(--danger-soft);
  color: var(--danger-ink);
}

.meal-slot-error[hidden] {
  display: none;
}

.chore-refinements {
  display: contents;
}

.chore-refinement-measurement {
  position: absolute;
  inset: 0 auto auto 0;
  visibility: hidden;
}

.chip-picker { white-space: nowrap; }

.people-picker-single-line .person-chip {
  white-space: nowrap;
}

.people-picker-single-line .picker-options {
  max-inline-size: calc(100vw - 16px);
  grid-template-columns: minmax(0, 1fr);
}

.people-picker-single-line .picker-options > .person-chip {
  display: block;
  max-inline-size: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chore-editor .aligned-picker-options {
  width: max-content;
  box-sizing: border-box;
  overflow-y: auto;
}

.chore-description-box {
  position: relative;
  --description-legend-height: 16px;
}

:is(#editor-fields, .inline-item-editor) .chore-description-box fieldset {
  margin: 0;
}

:is(#editor-fields, .inline-item-editor) .chore-description-box legend {
  line-height: var(--description-legend-height);
}

.chore-editor .add-chore-row {
  margin-inline: auto;
}

.chore-editor-group > .meal-tile-delete {
  --chore-delete-size: clamp(16px, 5vw, 24px);
  height: var(--chore-delete-size);
  transform: translate(calc(var(--chore-delete-size) / 2), -50%);
}

.chore-editor-group > .item-delete-confirm {
  width: max-content;
  padding-inline: 8px;
  white-space: nowrap;
  border-radius: 999px;
}

.chore-fields:not([hidden]) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.ride-when > .chip-strip {
  max-inline-size: 100%;
}

.ride-when > .transport-time {
  flex: none;
}

.away-schedule {
  display: grid;
  gap: var(--chip-row-gap);
}

.appointment-pattern[hidden] {
  display: none;
}

.appointment-year-picker {
  font-variant-numeric: tabular-nums;
}

:is(.appointment-when, .ride-when) .transport-time {
  flex-wrap: nowrap;
}

@media (max-width: 375px) {
  .appointment-date-chips summary.person-chip,
  .appointment-year-picker .picker-options > .person-chip {
    padding-inline: 8px;
  }
}

.away-day-part {
  display: grid;
}

.away-day-part > * {
  grid-area: 1 / 1;
  justify-self: start;
}

.away-day-part > [aria-hidden] {
  visibility: hidden;
}

.transport-hour-options {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.transport-minute-options {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  overscroll-behavior: contain;
}

:is(.transport-hour-options, .transport-minute-options) > .person-chip {
  width: 100%;
  justify-content: center;
  padding-inline: 6px;
}

.chore-summary {
  border: 0;
  padding: 0;
  background: transparent;
  text-align: start;
  overflow-wrap: anywhere;
}

.editor-actions[hidden] {
  display: none;
}

.item-editor-actions {
  margin-inline: 2px;
  font-size: inherit;
  flex-wrap: wrap;
}

.item-editor-actions .item-delete-button {
  background: var(--surface);
  margin-inline-end: auto;
  color: var(--danger);
  transition: background-color 150ms, color 150ms;
}

.item-editor-actions .item-delete-confirm {
  background: var(--danger);
  color: var(--on-accent);
}

.editor-actions button:disabled {
  opacity: 0.45;
  cursor: default;
}

:is(.household-dialog:has(.chore-editor), .inline-item-editor) :is(button, legend, input, summary, .person-chip) {
  font-weight: 400;
}

.editor-toggle-card {
  gap: 0;
  padding: 0;
}

.editor-toggle-card > .chore-summary {
  padding: 12px 16px;
  border-radius: inherit;
  font-size: calc(15px * var(--font-scale));
}

.chore-summary :is(small, .person-chip, .recurrence) {
  font-size: inherit;
}

.editor-toggle-card > .chore-fields {
  padding: 0 16px 12px;
}

#editor-form {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  mask-image: linear-gradient(to bottom, transparent, black 12px);
  padding: 0 18px max(20px, env(safe-area-inset-bottom));
}

.editor-drag-handle {
  flex: 0 0 24px;
  display: grid;
  place-items: center;
  width: 100%;
  height: 24px;
  padding: 0;
  border: 0;
  background: var(--surface);
  cursor: grab;
  touch-action: none;
}

.editor-drag-handle:active {
  cursor: grabbing;
}

.editor-drag-handle::before {
  content: "";
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: var(--muted);
}

html:has(#household-editor[open]) {
  overflow: hidden;
}

.chore-editor :is(.special-date-day-options, .chore-month-day-options) {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.special-date-day-picker {
  --day-chip-width: max(var(--person-chip-height), calc(2ch + 10px));
}

.chore-editor .special-date-day-options {
  grid-template-columns: repeat(7, var(--day-chip-width));
  inset-inline-start: auto;
  inset-inline-end: -8px;
}

:is(.special-date-day-options, .chore-month-day-options) > .person-chip {
  width: 100%;
  justify-content: center;
  padding-inline: 5px;
}

.special-date-day-picker summary.person-chip:not(.add-person-chip) {
  inline-size: var(--day-chip-width);
  justify-content: center;
  padding-inline: 5px;
}

.special-date-day-picker :is(summary, .special-date-day-options > button) {
  font-variant-numeric: tabular-nums;
}

.date-weekday-heading {
  justify-self: stretch;
  color: var(--muted);
  font-size: 0.8em;
  text-align: center;
}

.date-shortcuts {
  grid-column: 1 / -1;
  display: flex;
  gap: var(--chip-row-gap) var(--chip-gap);
  justify-self: stretch;
}

.people-picker .date-shortcuts > .person-chip {
  flex: 1;
  justify-content: center;
  background: var(--chip);
}

.chore-month-day-title {
  grid-column: 1 / -1;
  grid-row: 1;
}

.chore-editor .special-date-month-options {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-inline-size: calc(100vw - 16px);
}

.special-date-month-options > .person-chip {
  justify-self: stretch;
  justify-content: center;
  padding-inline: clamp(2px, calc((100vw - 310px) / 6), 12px);
  text-align: center;
}

.people-picker .picker-options > .person-chip[aria-pressed="false"] {
  background: var(--chip);
}

.what-icon-picker .person-chip {
  background: var(--chip);
}

.what-icon-picker .picker-options > .person-chip[aria-pressed="false"] {
  background: var(--paper);
}

.people-picker .special-date-options > .person-chip[aria-current="date"] {
  box-shadow: inset 0 0 0 1px var(--ink);
}

.people-picker .special-date-options > .person-chip[aria-current="date"][aria-pressed="false"] {
  background: var(--surface);
}

.chore-editor .special-date-year-options {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overscroll-behavior: contain;
}

.special-date-year-options[data-picker-max-height] {
  --year-fade-top: 0px;
  --year-fade-bottom: 0px;
  scrollbar-width: none;
  mask-image: linear-gradient(to bottom, transparent, black var(--year-fade-top),
    black calc(100% - var(--year-fade-bottom)), transparent);
}

.special-date-year-options[data-picker-max-height]::-webkit-scrollbar {
  display: none;
}

.special-date-year-options[data-more-above] {
  --year-fade-top: 12px;
}

.special-date-year-options[data-more-below] {
  --year-fade-bottom: 12px;
}

.chore-editor .todo-year-options {
  grid-template-columns: minmax(0, 1fr);
  overflow: clip;
}

.special-date-year-options > .person-chip {
  width: 100%;
  justify-content: center;
  padding-inline: 6px;
}

.reorderable-tab {
  position: relative;
  grid-template-columns: minmax(0, 1fr);
}

[data-tab-card]:not([data-card-expanded]) .tab-card-header {
  user-select: none;
  -webkit-touch-callout: none;
}

[data-tab-card]:not([data-card-expanded]) .tab-card-grip {
  touch-action: none;
}

.tab-card-dragging {
  overflow-anchor: none;
}

.tab-card-lifted {
  display: none;
}

/* A floating copy of the lifted card (card-order.js), placed by inline styles there. */
.tab-card-preview.tab-card-preview {
  position: fixed;
  z-index: 20;
  pointer-events: none;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--shadow-color) 18.8%, transparent);
}

.tab-card-gap {
  border: 1px dashed var(--line);
  border-radius: var(--card-radius);
}

.tab-bar,
#view {
  -webkit-user-select: none;
  user-select: none;
}
/* Keep the first card's top margin (To-do's room for the who-filter tab) inside the view, so the
   view's top is the same on every tab and the swipe peek lines up with the tab it copies. */
#view { display: flow-root; }

/* Vertical scrolling stays with the browser; sideways drags switch tabs (page-swipe.js). */
body:has(> main > #view), main:has(> #view) { touch-action: pan-y pinch-zoom; }
#view.is-page-swiping { will-change: transform; }
/* The sliding page must not widen the document while it is off to one side. */
main:has(> #view.is-page-swiping) { overflow-x: clip; }
/* A still copy of the next tab, peeking in from the edge during a swipe (page-swipe.js). */
.page-peek {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}
.page-peek-view { position: absolute; margin: 0; }
.page-peek-view.is-placeholder :is(button, input, select, .card-footer, .rows, ul, ol, p) { visibility: hidden; }

#view :is(input, textarea, [contenteditable="true"]) {
  -webkit-user-select: text;
  user-select: text;
}

.invite-dialog {
  margin: auto;
}

.invite-dialog input {
  width: 100%;
  padding: 8px;
  margin-block: 8px;
  border: 1px solid var(--line);
  border-radius: var(--field-radius);
}

.invite-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.invite-card img:not([hidden]) {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 12px auto;
}

.invite-card output:not(:empty) {
  display: block;
  margin-block: 8px;
  color: var(--muted);
}

.invite-card > button {
  display: grid;
  place-items: center;
  margin-inline-start: auto;
}

.invite-card > button:disabled {
  opacity: 0.45;
  cursor: default;
}

[data-tab-card="invite-head"] {
  cursor: pointer;
}

/* ---- Share app: an invitation shaped like a ticket (invitations.js, wireShareAppCard) ---- */
/* The wordmark and motto, what it is, and the code on a tear-off stub; the app icon's four colours
   run down its edge. Notches are cut where the stub's dashed line meets the edges. */
.share-ticket {
  --stub: 132px;
  --notch-x: calc(100% - var(--stub));
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--stub);
  margin-block-start: 14px;
  border-radius: 20px;
  background: linear-gradient(160deg, color-mix(in srgb, #ff9330 7%, var(--surface)), color-mix(in srgb, var(--rose) 9%, var(--surface)));
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
  -webkit-mask: radial-gradient(circle at var(--notch-x) 0, transparent 10px, #000 10.5px) top / 100% 51% no-repeat,
    radial-gradient(circle at var(--notch-x) 100%, transparent 10px, #000 10.5px) bottom / 100% 51% no-repeat;
  mask: radial-gradient(circle at var(--notch-x) 0, transparent 10px, #000 10.5px) top / 100% 51% no-repeat,
    radial-gradient(circle at var(--notch-x) 100%, transparent 10px, #000 10.5px) bottom / 100% 51% no-repeat;
}
.share-ticket-bands {
  position: absolute;
  inset: 0 auto 0 0;
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  inline-size: 6px;
}
.share-ticket-bands > :nth-child(1) { background: #ff9330; }
.share-ticket-bands > :nth-child(2) { background: #22c26e; }
.share-ticket-bands > :nth-child(3) { background: #7c5cff; }
.share-ticket-bands > :nth-child(4) { background: #1d9bf0; }
.share-ticket-main {
  display: grid;
  align-content: space-between;
  gap: 16px;
  padding: 18px 14px 16px 20px;
}
.share-ticket-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  font-size: calc(17px * var(--font-scale));
}
.share-ticket-brand :is(.brand-wordmark, .brand-motto) { color: var(--ink); }
/* At larger text sizes the words wrap rather than run under the stub. */
.share-ticket-brand .brand-wordmark { flex-wrap: wrap; }
.share-ticket-brand .brand-motto { white-space: normal; }
.share-ticket-brand .brand-motto { color: var(--muted); }
.share-ticket-main strong {
  font: 400 calc(19px * var(--font-scale))/1.15 var(--font-heading);
}
.share-ticket-stub {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  padding: 14px 12px 12px;
  border-inline-start: 2px dashed var(--line);
  color: var(--muted);
  font-size: calc(12.5px * var(--font-scale));
}
/* The code sits on white, so it scans in every theme; a square keeps its place while it loads. */
.share-ticket-code {
  display: block;
  inline-size: 100%;
  aspect-ratio: 1;
  padding: 7px;
  box-sizing: border-box;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--rose) 8%, transparent);
}
.invite-card .share-ticket-code img:not([hidden]) {
  inline-size: 100%;
  block-size: 100%;
  margin: 0;
}
.share-ticket-actions {
  display: flex;
  gap: 10px;
  margin-block-start: 14px;
}
.share-ticket-actions > button {
  display: inline-flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border: 0;
  border-radius: 999px;
  font: 500 calc(15px * var(--font-scale)) var(--font-body);
  cursor: pointer;
}
.share-ticket-actions > [hidden] { display: none; }
.share-ticket-actions svg { inline-size: 18px; block-size: 18px; }
.share-ticket-share {
  background: var(--rose);
  color: var(--on-accent);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--rose) 25%, transparent);
}
.share-ticket-copy {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.share-ticket-actions > :disabled { opacity: 0.45; cursor: default; }
@media (hover: hover) { .share-ticket-copy:not(:disabled):hover { background: var(--chip); } }

:is(.invite-title, .grocery-title) {
  padding: 0;
  border: 0;
  background: transparent;
  text-align: start;
}

.invite-title { cursor: inherit; }

#invite-fullscreen[open] {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  align-items: center;
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 20px;
  border: 0;
  border-radius: 0;
}

#invite-fullscreen img:not([hidden]) {
  width: min(100%, 65dvh, 480px);
}

#invite-fullscreen .invite-actions {
  justify-content: end;
  align-items: center;
}

/* ---- A member's sign-in pass: an "Admit one" ticket in their colour (invitations.js, data-ticket) ---- */
#invite-fullscreen:not([data-ticket]) :is(.admit-ticket, .admit-close) { display: none; }
#invite-fullscreen[data-ticket] {
  --admit-bg: var(--chip);
  --admit-ink: var(--ink);
}
#invite-fullscreen[data-ticket][open] {
  grid-template-rows: auto 1fr auto auto;
  justify-items: center;
  gap: 16px;
  padding: 16px 24px 24px;
}
/* The heading stays for screen readers; the ticket says whose pass it is. */
#invite-fullscreen[data-ticket] h2 {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
#invite-fullscreen[data-ticket] .admit-close {
  display: grid;
  place-items: center;
  justify-self: end;
  inline-size: 40px;
  block-size: 40px;
  border: 0;
  border-radius: 12px;
  background: var(--admit-bg);
  color: var(--admit-ink);
  cursor: pointer;
}
#invite-fullscreen[data-ticket] .admit-ticket {
  /* Semicircle notches cut into both sides at mid-height. */
  --notch: radial-gradient(circle at 0 50%, transparent 13px, #000 13.5px) left / 51% 100% no-repeat,
    radial-gradient(circle at 100% 50%, transparent 13px, #000 13.5px) right / 51% 100% no-repeat;
  position: relative;
  display: grid;
  justify-items: center;
  align-self: center;
  gap: 12px;
  inline-size: min(100%, 400px);
  padding: 22px 26px 24px;
  border-radius: 18px;
  background: var(--admit-bg);
  color: var(--admit-ink);
  text-align: center;
  -webkit-mask: var(--notch);
  mask: var(--notch);
}
.admit-frame {
  position: absolute;
  inset: 8px;
  border: 1.5px dashed color-mix(in srgb, var(--admit-ink) 40%, transparent);
  border-radius: 12px;
  pointer-events: none;
}
.admit-label {
  font: 700 calc(12px * var(--font-scale))/1 var(--font-body);
  letter-spacing: 0.32em;
  text-transform: uppercase;
}
.admit-name {
  font: 400 calc(40px * var(--font-scale))/1 var(--font-heading);
  overflow-wrap: anywhere;
}
/* The code sits on white, so it scans in every theme; a square keeps its place while it loads. */
.admit-code {
  display: block;
  inline-size: 72%;
  aspect-ratio: 1;
  padding: 10px;
  border-radius: 14px;
  background: #fff;
}
#invite-fullscreen .admit-code img:not([hidden]) {
  display: block;
  inline-size: 100%;
  block-size: 100%;
}
.admit-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 14px;
  font-size: calc(13px * var(--font-scale));
  font-weight: 600;
}
.admit-foot > span + span::before { content: "·"; margin-inline-end: 14px; }
#invite-fullscreen[data-ticket] output {
  color: var(--muted);
  font-size: calc(13px * var(--font-scale));
  text-align: center;
}
/* The pass is only for scanning in person: no buttons under it (Copy link and Share… are in the Invite menu). */
#invite-fullscreen[data-ticket] .invite-actions { display: none; }

#invite-fullscreen[data-share-app] :is([data-member-invite-title], .invite-actions) {
  display: none;
}

/* Family Members: a face badge, the name, and role · birthday; for the family admin, an Invite pill. */
[data-tab-card="family"] .card-item-list > .card-item-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
[data-tab-card="family"] .card-item-row > .card-item-copy {
  flex: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 12px;
  row-gap: 2px;
  align-content: center;
}
[data-tab-card="family"] .card-item-copy > strong { align-self: end; }
[data-tab-card="family"] .card-item-copy > .family-member-role { align-self: start; }
.family-member-badge {
  grid-row: span 2;
  display: grid;
  place-items: center;
  inline-size: 42px;
  block-size: 42px;
  border-radius: 50%;
  background: var(--badge-bg, var(--chip));
  color: var(--badge-ink, var(--ink));
  font: 600 16px/1 var(--font-body);
  letter-spacing: 0.02em;
}
.card-item-row > .family-member-invite {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-inline-end: 4px;
  padding: 7px 12px 7px 9px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: 500 calc(14px * var(--font-scale)) var(--font-body);
  white-space: nowrap;
  cursor: pointer;
}
.card-item-row > .family-member-invite > svg { inline-size: 18px; block-size: 18px; }
.card-item-row > .family-member-invite:is(:hover, [aria-expanded="true"]) { background: var(--chip); }

/* The Invite menu opens right by its pill (placed in invitations.js), over everything else. */
.invite-menu {
  position: fixed;
  z-index: 60;
  display: grid;
  min-inline-size: 190px;
  padding: 5px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--shadow-color) 22%, transparent),
    0 0 0 1px color-mix(in srgb, var(--ink) 7%, transparent);
  transform-origin: top right;
  animation: invite-menu-in 0.14s ease-out;
}
.invite-menu[data-side="above"] { transform-origin: bottom right; }
.invite-menu[hidden] { display: none; }
.invite-menu > button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font: calc(15px * var(--font-scale)) var(--font-body);
  text-align: start;
  cursor: pointer;
}
.invite-menu > button:is(:hover, :focus-visible) { background: var(--chip); outline: none; }
.invite-menu svg { flex: none; inline-size: 19px; block-size: 19px; }
@keyframes invite-menu-in { from { opacity: 0; transform: scale(0.96); } }
@media (prefers-reduced-motion: reduce) { .invite-menu { animation: none; } }

.family-member-role {
  color: var(--muted);
}

:root {
  --font-scale: 1;
  --card-body-size: 15px;
  --card-heading-size: 26px;
  --card-title-chevron-gap: 2px;
  --card-chevron-slot: 20px;
  --card-chevron-size: 18px;
  --person-chip-height: max(28px, calc(20px * var(--font-scale) + 8px));
  --chip-gap: 2px;
  --chip-row-gap: calc(2 * var(--chip-gap));
}

@media (max-width: 590px) {
  :root {
    --card-heading-size: 25px;
  }
}

:root[data-font-size="medium"] {
  --font-scale: 1.12;
}

:root[data-font-size="large"] {
  --font-scale: 1.25;
}

/* Font size: "Aa" at each size in the title face, underlined like the top bar's current page in
   one of the logo's colours (Small orange, Medium green, Large purple); a To-do row under it shows
   the size chosen. */
.font-size-options {
  --size-index: 0;
  --size-accent: var(--brand-orange);
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 14px;
  border-block-end: 1px solid var(--line);
}
.font-size-options:has([data-size="medium"][aria-pressed="true"]) { --size-index: 1; --size-accent: var(--brand-green); }
.font-size-options:has([data-size="large"][aria-pressed="true"]) { --size-index: 2; --size-accent: var(--brand-purple); }
.font-size-options button {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 6px 0 12px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: calc(13px * var(--font-scale));
  cursor: pointer;
}
.font-size-options button[data-size="small"] { --specimen-scale: 1; }
.font-size-options button[data-size="medium"] { --specimen-scale: 1.12; }
.font-size-options button[data-size="large"] { --specimen-scale: 1.25; }
.font-size-specimen {
  font: 400 calc(22px * var(--specimen-scale)) / 1 var(--font-heading);
  color: var(--ink);
  opacity: 0.55;
}
.font-size-options [aria-pressed="true"] { color: var(--ink); font-weight: 700; }
.font-size-options [aria-pressed="true"] .font-size-specimen { opacity: 1; }
/* One underline that slides to the size chosen, changing colour as it goes. Themes that underline
   the top bar in one accent do the same here. */
.font-size-options::after {
  content: "";
  position: absolute;
  inset-block-end: -2.5px;
  inset-inline-start: calc((var(--size-index) + 0.3) * 100% / 3);
  inline-size: calc(0.4 * 100% / 3);
  block-size: 4px;
  border-radius: 4px;
  background: var(--nav-underline, var(--size-accent));
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .font-size-options::after { transition: inset-inline-start 220ms cubic-bezier(.2,.75,.25,1), background-color 220ms ease; }
}
.font-size-preview {
  margin-block-start: 14px;
  padding: 4px 14px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--rose) 4%, var(--surface));
  box-shadow: inset 0 0 0 1px var(--line);
}
.font-size-preview .card-item-list { margin: 0; }

#item-actions {
  inset: auto 0 0;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 16px 16px 0 0;
}

#item-actions[open] {
  display: flex;
  flex-direction: column;
  animation: editor-slide-in 220ms ease-out;
}

.item-action-content {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 18px max(20px, env(safe-area-inset-bottom));
}

#item-actions[data-title-only] #item-action-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-action-buttons {
  display: grid;
  gap: 8px;
  margin-block: 12px;
}

.item-action-buttons > button {
  text-align: start;
}

.item-action-buttons > button:has(.item-action-icon) {
  display: flex;
  align-items: center;
  gap: 0.6em;
}

.item-action-icon {
  flex: 0 0 1.4em;
}

.mark-done-icon {
  display: grid;
  place-items: center;
}

.mark-done-icon::before {
  content: "";
  width: 0.8em;
  height: 0.45em;
  border-inline-start: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-0.1em) rotate(-45deg);
}

.watched-item-title {
  display: flex;
  align-items: center;
  gap: 0.4em;
  overflow-wrap: anywhere;
}

.watch-eye,
.unwatch-eye {
  display: inline-block;
  flex-shrink: 0;
  inline-size: 1.25em;
  block-size: 1.1em;
  background: var(--ink);
  mask: center / contain no-repeat var(--eye-icon);
}

.watch-eye {
  --eye-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 20'%3E%3Cpath d='M2.5 11.5C5 8.2 8.3 6.4 12 6.4s7 1.8 9.5 5.1' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round'/%3E%3Cpath fill-rule='evenodd' d='M12 8.7a4.1 4.1 0 1 0 0 8.2 4.1 4.1 0 0 0 0-8.2zm1.6 1.4a.9.9 0 1 0 0 1.8.9.9 0 0 0 0-1.8z'/%3E%3C/svg%3E");
}

.unwatch-eye {
  --eye-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 20'%3E%3Cmask id='cut' maskUnits='userSpaceOnUse' x='0' y='0' width='24' height='20'%3E%3Cpath fill='white' d='M0 0h24v20H0z'/%3E%3Cpath d='M5 17 19 3' stroke='black' stroke-width='4.4' stroke-linecap='round'/%3E%3C/mask%3E%3Cg mask='url(%23cut)'%3E%3Cpath d='M2.5 11.5C5 8.2 8.3 6.4 12 6.4s7 1.8 9.5 5.1' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round'/%3E%3Ccircle cx='12' cy='12.8' r='4.1'/%3E%3C/g%3E%3Cpath d='M5 17 19 3' stroke='black' stroke-width='2.1' stroke-linecap='round'/%3E%3C/svg%3E");
}

.item-done :is(strong, .item-edit-title) {
  text-decoration: line-through;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  #item-actions[open] { animation: none; }
}

#view [data-tab-card]:not([data-card-expanded]) .card-item-overflow {
  display: none;
}

#view:has([data-card-expanded]) [data-tab-card]:not([data-card-expanded]) {
  display: none;
}
[data-todo-editor-host]:not(:has(> .inline-item-editor)) { display: none; }

body:has(#view [data-card-expanded], #household-editor[open]) .app-header {
  display: none;
}

body:has(#view [data-card-expanded], #household-editor[open]) main {
  padding-block-start: 22px;
}

html:has(#view [data-card-expanded]) {
  overscroll-behavior-y: none;
}

html[data-expanded-card-scroll-locked]:not(:has(.tab-card-dragging)) {
  overflow-y: hidden;
  scrollbar-gutter: stable;
}

html[data-expanded-card-scroll-locked] main {
  position: relative;
  top: var(--expanded-card-center-offset);
}

html[data-expanded-card-scroll-range] {
  overflow-y: auto;
  overflow-anchor: none;
  scrollbar-gutter: stable;
}

html[data-expanded-card-scroll-range] body {
  height: var(--expanded-card-scroll-height);
  min-height: 0;
  overflow: clip;
}

html[data-expanded-card-scroll-range] main {
  position: relative;
  top: calc(-1 * var(--expanded-card-scroll-start));
}

.card-footer:not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  /* Match the item cells' inline padding, so Show more lines up with item text and Add with the date tiles. */
  padding-inline: 8px;
}

/* Sit the footer (Show more/less, Add) closer to the card's bottom edge. */
.panel:has(> .card-footer:not([hidden])) {
  padding-block-end: 6px;
}

.card-footer button,
.item-action-buttons > button,
.inline-item-editor .editor-actions button {
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: var(--ink);
}

.card-footer > button {
  padding-block-end: 14px;
}

.inline-item-editor .editor-actions .item-delete-button {
  color: var(--danger);
}

.item-editor-actions .item-delete-button:has(+ .item-editor-secondary-action) {
  margin-inline-end: 0;
}

.item-editor-secondary-action {
  margin-inline-end: auto;
}

.inline-item-editor .editor-actions {
  gap: 16px;
  font-size: inherit;
}

.inline-item-editor .editor-actions .primary {
  padding-inline: 10px;
}

:is(.card-edit-action, .card-add-action) {
  margin-inline-start: auto;
}

.groceries .card-footer .card-add-action {
  scroll-margin-block-end: var(--bottom-controls-clearance);
}

.tab-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

:is([data-tab-card], .tab-card-preview) {
  font-size: calc(var(--card-body-size) * var(--font-scale));
}

:is([data-tab-card], .tab-card-preview, [data-new-shopping-list]) h2,
#invite-fullscreen[data-share-app] h2 {
  font-size: calc(var(--card-heading-size) * var(--font-scale));
}

[data-tab-card] :is(.card-item-details small, .date-weekday) {
  font-size: inherit;
}

:is([data-tab-card], .tab-card-preview, [data-new-shopping-list]) :is(h2, .invite-title, .grocery-title) {
  min-inline-size: 0;
  max-inline-size: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

[data-tab-card] :is(.invite-title, .grocery-title, .grocery-edit-action):focus-visible {
  outline-offset: -3px;
}

.tab-card-grip,
.card-collapse-action {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.tab-card-grip {
  /* Hovering or pressing the grip raises it, straight up; lifting the card raises it the same way. */
  --grip-lift: translateY(-5px) scale(1.15);
  --grip-lift-shadow: drop-shadow(0 5px 3px color-mix(in srgb, var(--shadow-color) 40%, transparent));
  flex: 0 0 60px;
  width: 60px;
  height: 38px;
  cursor: grab;
}

.card-collapse-action {
  flex: 0 0 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--paper);
}

.tab-card-grip-face {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 9px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 18%, transparent);
  /* The hit target stays in place while the face moves. */
  pointer-events: none;
  transform: var(--grip-transform, none);
  filter: var(--grip-shadow, none);
  transition: transform 250ms cubic-bezier(0.2, 0.8, 0.3, 1.4),
    filter 250ms cubic-bezier(0.2, 0.8, 0.3, 1.4);
}

.tab-card-grip.is-pressed,
.tab-card-preview .tab-card-grip {
  --grip-transform: var(--grip-lift);
  --grip-shadow: var(--grip-lift-shadow);
}


@media (hover: hover) {
  [data-tab-card]:not([data-card-expanded]) > .tab-card-header > .tab-card-grip:hover {
    --grip-transform: var(--grip-lift);
    --grip-shadow: var(--grip-lift-shadow);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tab-card-grip-face {
    transition: none;
  }
}

.tab-card-grip-face::before {
  content: "";
  /* A 3 x 3 grid of dots, one dot per 6 px tile. */
  width: 18px;
  height: 18px;
  background: radial-gradient(circle, currentColor 1.3px, transparent 1.6px) 0 0 / 6px 6px;
}

[data-card-expanded] .tab-card-grip {
  display: none;
}

.card-collapse-action {
  display: none;
  border: 0;
  font-size: calc(24px * var(--font-scale));
  line-height: 1;
}

[data-card-expanded] .card-collapse-action {
  display: grid;
}

.panel:is([data-tab-card="chores"], [data-tab-card="dates"], [data-tab-card="bills"]) {
  position: relative;
}

.inline-item-editor {
  margin-block-start: 12px;
  font-size: inherit;
}

.inline-item-editor fieldset {
  margin-inline: 0;
}

.inline-item-editor input {
  width: 100%;
  color: var(--ink);
  font: inherit;
}


.date-display.appointment-when {
  position: relative;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  max-inline-size: none;
  white-space: nowrap;
}

.appointment-clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: var(--font-heading);
  font-size: calc(18px * var(--font-scale));
  line-height: 1.1;
}

.appointment-meridiem {
  font-family: var(--font-body);
  font-size: calc(12px * var(--font-scale));
  color: var(--muted);
}

.appointment-tile {
  /* Grid, not a flex column, so the card's column fitting measures the tile's own width. */
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 1px;
  inline-size: calc(52px * var(--font-scale));
  block-size: calc(56px * var(--font-scale));
  border-radius: 16px;
  background: var(--chip-soft);
}

.appointment-tile-label {
  color: var(--accent-strong);
  font-size: calc(10px * var(--font-scale));
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.appointment-tile-day {
  font-family: var(--font-heading);
  font-size: calc(22px * var(--font-scale));
  line-height: 1;
}

.appointment-tile-today {
  background: var(--pine);
  color: var(--on-dark);
}

.appointment-tile-today .appointment-tile-label {
  color: var(--lime);
}

.date-display.day-tile-date {
  position: relative;
}

.late-stamp.tile-stamp {
  /* Pressed over the day tile's lower right corner, like a rubber stamp. */
  position: absolute;
  inset: auto -6px -8px auto;
  transform: rotate(-10deg);
  border-width: 1.5px;
  border-radius: 3px;
  padding: 2px 4px 1px;
  /* An opaque fill in the card's background colour, so every stamp reads the same on light and dark tiles,
     and cleanly covers the time or part of day under the tile where it overlaps it. */
  z-index: 1;
  background: var(--surface);
  font-size: calc(9px * var(--font-scale));
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.late-stamp.tile-stamp-attended {
  /* Done (and Attended, Served, Paid): a hand-made check in green ink instead of a stamp. Its elbow
     sits under the middle of the tile, about 10 px below it; the stroke rises over the tile's right
     half. The ink soaks into the tile (multiply); dark themes use a brighter ink (--done-ink). The
     word stays in the markup for anything that reads it, but is not drawn. */
  inset: auto auto -14.6px calc(50% - 18px);
  transform: rotate(-6deg);
  inline-size: 50px;
  block-size: 50px;
  padding: 0;
  border: 0;
  border-radius: 0;
  -webkit-mask: none;
  mask: none;
  background: var(--done-ink) center / 50px no-repeat;
  mix-blend-mode: var(--done-ink-blend, multiply);
  color: transparent;
  font-size: 0;
  pointer-events: none;
}
:root {
  --done-ink: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%2024%2024%27%3E%3Cdefs%3E%3Cfilter%20id%3D%27i%27%20x%3D%27-10%25%27%20y%3D%27-10%25%27%20width%3D%27120%25%27%20height%3D%27120%25%27%3E%3CfeTurbulence%20type%3D%27fractalNoise%27%20baseFrequency%3D%271.6%27%20numOctaves%3D%272%27%20seed%3D%277%27%20result%3D%27n%27/%3E%3CfeDisplacementMap%20in%3D%27SourceGraphic%27%20in2%3D%27n%27%20scale%3D%270.9%27%20result%3D%27d%27/%3E%3CfeTurbulence%20type%3D%27fractalNoise%27%20baseFrequency%3D%272.4%27%20numOctaves%3D%271%27%20seed%3D%273%27%20result%3D%27g%27/%3E%3CfeColorMatrix%20in%3D%27g%27%20values%3D%270%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20-1.6%201.9%27%20result%3D%27m%27/%3E%3CfeComposite%20in%3D%27d%27%20in2%3D%27m%27%20operator%3D%27in%27/%3E%3C/filter%3E%3C/defs%3E%3Cpath%20filter%3D%27url%28%23i%29%27%20fill%3D%27%2317703c%27%20d%3D%27M3.4%2012.9c1-.8%202.1-.5%203%20.5l3.3%203.6c2.7-4.6%206-8.6%2010.5-12.3.7-.5%201.3.1.9.7-4%204.2-7.3%208.7-10%2014.1-.5%201-1.7%201.1-2.4.3L4%2014.7c-.6-.6-.9-1.3-.6-1.8z%27/%3E%3C/svg%3E");
}

.card-item-row .card-item-schedule .late-stamp.tile-stamp {
  white-space: nowrap;
}

/* Plans cards take their own colours (see "Plans card colours" in the theme values). The full-screen
   Payments and rides layout drops the panel background and gives each entry the card colour instead. */
.panel[data-tab-card="meals"] { --card-surface: var(--card-meals-surface); --line: var(--card-meals-line); --card-accent: var(--card-meals-accent); }
.panel[data-tab-card="chores"] { --card-surface: var(--card-chores-surface); --line: var(--card-chores-line); --card-accent: var(--card-chores-accent); }
.panel[data-tab-card="dates"] { --card-surface: var(--card-dates-surface); --line: var(--card-dates-line); --card-accent: var(--card-dates-accent); }
.panel[data-tab-card="bills"] { --card-surface: var(--card-bills-surface); --line: var(--card-bills-line); --card-accent: var(--card-bills-accent); }
.panel[data-tab-card="transport"] { --card-surface: var(--card-transport-surface); --line: var(--card-transport-line); --card-accent: var(--card-transport-accent); }
.panel[data-tab-card="out-of-house"] { --card-surface: var(--card-outings-surface); --line: var(--card-outings-line); --card-accent: var(--card-outings-accent); }
.panel[data-tab-card="appointments"] { --card-surface: var(--card-appointments-surface); --line: var(--card-appointments-line); --card-accent: var(--card-appointments-accent); }
.panel:is([data-tab-card="meals"], [data-tab-card="chores"], [data-tab-card="dates"], [data-tab-card="bills"], [data-tab-card="transport"], [data-tab-card="out-of-house"], [data-tab-card="appointments"]) {
  background: var(--card-surface);
}

/* Special dates: round date badges, as in mockup A. */

.card-item-details.special-date-details {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
}

.special-date-details .card-item-copy {
  flex: 1;
}

.special-date-badge {
  flex: none;
  display: grid;
  justify-items: center;
  align-content: center;
  inline-size: calc(64px * var(--font-scale));
  block-size: calc(64px * var(--font-scale));
  border-radius: 50%;
  background: var(--paper);
}

.special-date-badge-month {
  color: var(--accent-strong);
  font-size: calc(11px * var(--font-scale));
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.special-date-badge-day {
  font-family: var(--font-heading);
  font-size: calc(26px * var(--font-scale));
  line-height: 1;
}

[data-tab-card="dates"] .card-item-copy > small {
  color: var(--feature-ink);
}

[data-tab-card="dates"] .card-add-action {
  color: var(--feature-action);
}

/* Name chips on cards: one pastel per family member (see setPersonColors). Pickers stay neutral
   so selected and unselected states remain clear. */
.card-item-row .person-chip[data-person-color]:not(.people-picker .person-chip) {
  background: var(--person-chip-bg);
  color: var(--person-chip-ink);
}

.person-chip[data-person-color="0"] { --person-chip-bg: var(--person-0-bg); --person-chip-ink: var(--person-0-ink); }
.person-chip[data-person-color="1"] { --person-chip-bg: var(--person-1-bg); --person-chip-ink: var(--person-1-ink); }
.person-chip[data-person-color="2"] { --person-chip-bg: var(--person-2-bg); --person-chip-ink: var(--person-2-ink); }
.person-chip[data-person-color="3"] { --person-chip-bg: var(--person-3-bg); --person-chip-ink: var(--person-3-ink); }
.person-chip[data-person-color="4"] { --person-chip-bg: var(--person-4-bg); --person-chip-ink: var(--person-4-ink); }
.person-chip[data-person-color="5"] { --person-chip-bg: var(--person-5-bg); --person-chip-ink: var(--person-5-ink); }

/* Payments: pattern under the title; a prominent Mark paid pill on the right. */
:is(.card-item-details, .card-item-copy) > small.item-pattern {
  color: var(--muted);
  white-space: normal;
}

.card-item-schedule.tile-action {
  align-content: center;
}

.tile-action-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

[data-card-items]:has(.appointment-when) {
  container: appointment-rows / inline-size;
}

@container appointment-rows (max-width: 430px) {
  .tile-action-row:has(.appointment-when) {
    gap: 6px;
  }

  .tile-action-row .appointment-when {
    flex-direction: column;
    gap: 3px;
  }

  .tile-action-row .appointment-clock {
    flex-direction: row;
    align-items: baseline;
    gap: 3px;
  }
}

.card-item-cta {
  display: grid;
  place-items: center;
  inline-size: 44px;
  block-size: 44px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  color: var(--ink);
}

.card-item-cta > svg {
  inline-size: 20px;
  block-size: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Only the check circle itself highlights on hover, never because the pointer is over the tile. */
.card-item-cta:hover {
  background: var(--chip-soft);
}

.card-item-row .card-item-cta-overdue {
  color: var(--accent-strong);
}

/* A paid installment keeps its title as is; the green "Paid for …" note shows the status. */
[data-tab-card="bills"] .item-done .item-edit-title {
  text-decoration: none;
  opacity: 1;
  color: inherit;
}

/* Done chores and paid payments keep their titles as is; the stamp shows the status. */
[data-tab-card="chores"] .item-done .item-edit-title {
  text-decoration: none;
  color: inherit;
}

/* Faint undo arrow beside a done or paid tile. */
.tile-undo {
  display: grid;
  place-items: center;
  inline-size: 44px;
  block-size: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted-soft);
}

.tile-undo:hover {
  background: var(--chip-soft);
  color: var(--ink);
}

.tile-undo:disabled {
  opacity: 0.5;
}

.tile-undo > svg {
  inline-size: 18px;
  block-size: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* With separate controls, the tile is its own button. */
button.date-display.day-tile-date {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

button.card-item-cta {
  padding: 0;
  background: transparent;
  cursor: pointer;
}

/* Appointment type icons: a deep rose line drawing filling about three quarters of a blush badge. */
.item-icon.item-icon-badge {
  inline-size: 1.6em;
  block-size: 1.6em;
  border-radius: 50%;
  background: var(--chip-soft);
  color: var(--accent-strong);
}

.item-icon-badge > svg {
  inline-size: 74%;
  block-size: 74%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* An icon chip is exactly as tall as every other chip, so picking an icon never changes a
   field's height: the badge fills the chip's content box and the chip drops its block padding. */
.people-picker .person-chip:has(.item-icon-badge),
.chore-static-chip:has(.item-icon-badge) {
  padding-block: 0;
}

.person-chip > .item-icon.item-icon-badge,
.what-icon-field .item-icon.item-icon-badge {
  transform: none;
  inline-size: var(--person-chip-height, 28px);
  block-size: var(--person-chip-height, 28px);
}

/* As a block, the badge sets its summary's height exactly, with no line box around it. */
.what-icon-picker summary > .item-icon-badge {
  display: grid;
}

/* Inside a chip or picker option the chip is the badge, so the drawing can fill most of it. */
:is(.person-chip, .what-icon-field) .item-icon-badge > svg {
  inline-size: 86%;
  block-size: 86%;
  stroke-width: 1.7;
}

/* In the icon picker the round chip already acts as the badge, so drop the inner fill. */
.what-icon-picker .item-icon.item-icon-badge {
  background: transparent;
}

/* Centre a title's icon badge on the middle of the text line, not on its baseline. */
.what-title-icon.item-icon-badge {
  vertical-align: -0.25em;
}

/* ---- Edit dialogs: "More details" row for rarely edited fields ---- */
.optional-fields[hidden] { display: none; }
.optional-fields { display: grid; row-gap: inherit; min-inline-size: 0; }
.optional-fields-moving { overflow: clip; }
.optional-fields-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  inline-size: 100%;
  min-block-size: 40px;
  margin-block: 2px 0;
  padding: 8px 12px;
  border-radius: var(--field-radius);
  background: var(--surface-soft);
  color: var(--muted);
  font: inherit;
  font-size: calc(14px * var(--font-scale));
  text-align: start;
}
.optional-fields-row[hidden] { display: none; }
.optional-fields-toggle {
  position: absolute;
  inset: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
}
@media (any-hover: hover) {
  .optional-fields-row:hover { background: var(--chip); }
}
.optional-fields-row > :not(.optional-fields-toggle) { position: relative; }
.optional-fields-row > :is(.optional-fields-label, .optional-fields-summary, .optional-fields-chevron) { pointer-events: none; }
.optional-fields-label { flex: none; }
.optional-fields-info {
  display: grid;
  flex: 0 0 28px;
  block-size: 24px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  touch-action: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.optional-fields-info[hidden] { display: none; }
.optional-fields-info svg {
  inline-size: 16px;
  block-size: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.optional-fields-summary {
  flex: 1;
  min-inline-size: 0;
  block-size: 1.25em;
  line-height: 1.25;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--ink);
}
.optional-fields-chevron {
  flex: none;
  inline-size: 18px;
  block-size: 18px;
  margin-inline-start: auto;
  fill: none;
  stroke: var(--rose);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 150ms;
}
.optional-fields-toggle[aria-expanded="true"] ~ .optional-fields-chevron { transform: rotate(180deg); }

/* ---- Edit dialogs: footer = ••• menu, Close, Save ---- */
.inline-item-editor .item-editor-actions {
  align-items: center;
  gap: 8px;
  margin-block-start: 6px;
}
.inline-item-editor .item-editor-actions > .item-editor-close,
.inline-item-editor .item-editor-actions > .primary {
  padding: 8px 18px;
  border-radius: 999px;
  font-weight: 400;
}
.inline-item-editor .item-editor-actions > .item-editor-close {
  margin-inline-start: auto;
  background: var(--chip);
  color: var(--ink);
}
.inline-item-editor .item-editor-actions > .primary {
  background: var(--rose);
  color: var(--on-accent);
}
.inline-item-editor .item-editor-actions > .primary:disabled { opacity: 0.4; }

.editor-action-menu { position: relative; }
.editor-action-menu-toggle {
  display: grid;
  place-items: center;
  inline-size: 38px;
  block-size: 38px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--chip);
  color: var(--muted);
}
.inline-item-editor .editor-actions .editor-action-menu-toggle { padding: 0; background: var(--chip); color: var(--muted); }
.editor-action-menu-toggle svg { inline-size: 20px; block-size: 20px; fill: currentColor; }
.editor-action-menu-toggle[aria-expanded="true"] { background: var(--chip-soft); color: var(--rose); }
.editor-action-menu-list {
  position: absolute;
  inset-block-end: calc(100% + 8px);
  inset-inline-start: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  min-inline-size: 200px;
  padding: 6px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--shadow-color) 5.9%, transparent), 0 10px 30px color-mix(in srgb, var(--shadow-color) 16.1%, transparent);
}
.editor-action-menu-list[hidden] { display: none; }
.inline-item-editor .editor-actions .editor-action-menu-item {
  margin: 0;
  padding: 10px 12px;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  text-align: start;
  white-space: nowrap;
}
.inline-item-editor .editor-actions .editor-action-menu-item:hover:not(:disabled) { background: var(--chip); }
.inline-item-editor .editor-actions .editor-action-menu-item.item-delete-button { color: var(--rose); }
.editor-action-menu-item.editor-action-first-destructive:not(:first-child) {
  margin-block-start: 4px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 9px 9px;
}
.inline-item-editor .editor-actions .editor-action-menu-item.item-delete-confirm { background: var(--rose); color: var(--on-accent); }

/* ---- Locked fields, chips and actions ---- */
.lock-icon {
  inline-size: 0.8em;
  block-size: 0.8em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  vertical-align: -0.05em;
}
.editor-lock-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 2px 2px;
  color: var(--muted);
  font-size: calc(14px * var(--font-scale));
  line-height: 1.35;
}
.editor-lock-note[hidden] { display: none; }
.editor-lock-note svg {
  flex: none;
  inline-size: 16px;
  block-size: 16px;
  margin-block-start: 1px;
  fill: none;
  stroke: var(--rose);
  stroke-width: 2;
  stroke-linecap: round;
}
fieldset.field-locked {
  border-style: dashed;
  background: var(--surface-locked);
  cursor: help;
}
fieldset.field-locked > legend { background: transparent; }
fieldset.field-locked > legend .lock-icon { margin-inline-start: 4px; color: var(--muted); }
fieldset.field-locked :is(input, textarea) { color: var(--muted); cursor: help; }
fieldset.field-locked .chore-static-chip { color: var(--muted); }
.chip-locked {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  cursor: help;
}
.chip-locked .lock-icon { color: var(--muted); }
.lock-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: -2px 6px 2px;
  color: var(--muted);
  font-size: calc(13px * var(--font-scale));
  line-height: 1.35;
}
.lock-hint .lock-icon { color: var(--rose); }

.inline-item-editor .editor-actions .editor-action-locked {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  color: var(--disabled);
  cursor: help;
}
.inline-item-editor .editor-actions .editor-action-locked:hover { background: transparent; }
.inline-item-editor .editor-actions .editor-action-locked[aria-expanded="true"] { background: var(--surface-soft); }
.editor-action-locked-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.editor-action-locked-row .lock-icon { color: var(--muted); }
.editor-action-locked-reason {
  max-inline-size: 230px;
  color: var(--muted);
  font-size: calc(12.5px * var(--font-scale));
  line-height: 1.35;
  white-space: normal;
}
.editor-action-locked-reason[hidden] { display: none; }
/* A locked field isn't for typing, so tapping it shouldn't draw an editing outline; keyboard focus shows on the outline instead. */
fieldset.field-locked :is(input, textarea):focus-visible { outline: none; }
fieldset.field-locked:has(:focus-visible) { border-color: var(--lime); border-style: solid; }
.lock-hint { align-items: flex-start; }
.lock-hint .lock-icon { margin-block-start: 0.2em; }

/* Full-screen lists put each entry on its own card and anchor the list to the top. */
[data-card-fullscreen-list][data-card-expanded]:not(:has(> .inline-item-editor)) {
  --expanded-card-align: top;
  --expanded-card-header-surface: var(--paper);
  background: transparent;
  box-shadow: none;
  padding-inline: 0;
}
[data-card-fullscreen-list][data-card-expanded]:not(:has(> .inline-item-editor)) > .card-item-list {
  gap: 10px;
  margin-inline: 0;
}
[data-card-fullscreen-list][data-card-expanded]:not(:has(> .inline-item-editor)) .card-item-row {
  padding: 14px 16px;
  border-radius: 20px;
  background: var(--card-surface, var(--surface));
  box-shadow: 0 1px 2px color-mix(in srgb, var(--shadow-color) 3.9%, transparent), 0 8px 22px color-mix(in srgb, var(--rose) 7.1%, transparent);
}
[data-card-expanded]:has(> [data-card-items]):not(:has(> .inline-item-editor)) {
  /* The scroll range starts half a card gap above the card, whose top border is 1px. */
  --expanded-card-header-inset: calc(var(--card-gap) / 2 + 1px);
  padding-block-start: 0;
}
[data-card-expanded]:has(> [data-card-items]):not(:has(> .inline-item-editor)) > .tab-card-header {
  position: sticky;
  inset-block-start: var(--expanded-card-header-inset);
  z-index: 2;
  padding-block: 16px 10px;
  background: var(--expanded-card-header-surface, var(--surface));
}
html[data-expanded-card-scroll-range] [data-card-expanded]:not(:has(> .inline-item-editor)) > .tab-card-header {
  box-shadow: 0 calc(-1 * var(--expanded-card-header-inset)) 0 var(--expanded-card-header-surface, var(--surface));
}

/* ---- Payments in full screen: sort and filter chips under the pinned header ---- */
.payment-tools { display: none; }
[data-card-fullscreen-list][data-card-expanded]:not(:has(> .inline-item-editor)) > .payment-tools {
  display: block;
  position: sticky;
  inset-block-start: calc(var(--expanded-card-header-inset) + var(--payment-header-height, 58px));
  z-index: 2;
  margin-block-end: 6px;
  background: var(--paper);
}
.payment-tools-row {
  display: flex;
  gap: 6px;
  padding-block: 2px 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.payment-tools-row::-webkit-scrollbar { display: none; }
:is(.payment-chip, .slide-toggle, .meal-view-toggle, .meal-cells-toggle) {
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
}
:is(.slide-toggle, .meal-view-toggle, .meal-cells-toggle) {
  box-shadow: inset 0 0 0 1px var(--line);
}
.payment-chip {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 5px;
  min-block-size: 34px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  font: inherit;
  font-size: calc(13.5px * var(--font-scale));
  white-space: nowrap;
}
.payment-chip svg {
  inline-size: 13px;
  block-size: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.payment-filter-chip[aria-pressed="true"] { border-color: var(--rose); background: var(--rose); color: var(--on-accent); }
.payment-sort-menu {
  position: absolute;
  z-index: 5;
  display: flex;
  flex-direction: column;
  inline-size: 180px;
  padding: 6px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--shadow-color) 5.9%, transparent), 0 10px 30px color-mix(in srgb, var(--shadow-color) 20%, transparent);
}
.payment-sort-menu[hidden] { display: none; }
.payment-sort-menu button {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: start;
}
.payment-sort-menu button:hover { background: var(--chip); }
.payment-sort-menu button[aria-checked="true"] { background: var(--chip); color: var(--rose); }
.payment-sort-menu button[aria-checked="true"]::after { content: "✓"; }
[data-card-fullscreen-list][data-card-expanded] .card-item-list > [data-empty-list] {
  padding: 24px 8px;
  color: var(--muted);
  text-align: center;
}

/* The header handles Back and the bottom bar hosts Add when available. */
[data-card-fullscreen-list][data-card-expanded]:not(:has(> .inline-item-editor)) > .card-footer { display: none; }
/* The primary + shares the bottom row with the assistant bar. */
.plans-add-button,
.plans-add-menu,
.plans-add-scrim { display: none; }
/* The menu is available on To-do and Plans until an editor opens. */
body:has(#view:not(.page-peek-view) :is(.calendar-sections, [data-tab-card="chores"])):not(:has(#view:not(.page-peek-view) .inline-item-editor, #household-editor[open])) .plans-add-button {
  display: grid;
}
/* On Notes the + opens the kinds of note (only List can be made so far). */
body:has(#view:not(.page-peek-view) [data-shopping-lists]):not(:has(#view:not(.page-peek-view) .inline-item-editor)):not(:has(#household-editor[open])) .plans-add-button {
  display: grid;
}
body:has(#view:not(.page-peek-view) [data-shopping-lists]):not(:has(#view:not(.page-peek-view) .inline-item-editor)):not(:has(#household-editor[open])) :is(.plans-add-menu, .plans-add-scrim) {
  display: flex;
}
body:has(#view [data-tab-card="family"][data-card-expanded][data-can-add-member]):not(:has(#view .inline-item-editor)) .plans-add-button {
  display: grid;
}
.member-edit-permission {
  display: flex;
  align-items: center;
  min-block-size: 44px;
  font: inherit;
}
.member-edit-permission label {
  display: flex;
  align-items: center;
  gap: 10px;
}
.member-edit-permission input {
  inline-size: 18px;
  block-size: 18px;
  flex: none;
  margin: 0;
  accent-color: var(--rose);
}
.member-edit-permission .optional-fields-info {
  flex-basis: 44px;
  block-size: 44px;
  color: var(--muted);
}
#member-organizer-help {
  padding: 8px 12px;
  border-radius: var(--field-radius);
  background: var(--surface-soft);
  color: var(--muted);
}
body:has(#view:not(.page-peek-view) :is(.calendar-sections, [data-tab-card="chores"])):not(:has(#view:not(.page-peek-view) .inline-item-editor, #household-editor[open])) :is(.plans-add-menu, .plans-add-scrim) {
  display: flex;
}
.bottom-controls { gap: 10px; }
.bottom-controls > .assistant-bar { flex: 1 1 auto; min-inline-size: 0; }
.plans-add-button {
  position: relative;
  z-index: 2;
  flex: none;
  place-items: center;
  /* Same height as the assistant bar. */
  inline-size: 56px;
  block-size: 56px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--rose);
  color: var(--on-accent);
  box-shadow: 0 16px 40px color-mix(in srgb, var(--rose) 25.1%, transparent), 0 2px 6px color-mix(in srgb, var(--rose) 14.9%, transparent);
  transition: background-color 160ms, box-shadow 160ms, transform 120ms ease-out, scale 160ms ease-out;
}
/* Every primary + grows a little under the pointer: this one, the + on the zero-state cards and the
   circled + after "Add the first …". The growth is its own property, so a press (transform) and a
   theme's shadow still apply. */
@media (hover: hover) {
  .plans-add-button:hover { scale: 1.08; }
}
/* On a touch screen the same growth (and fill) shows while the finger is down. */
.plans-add-button:active { scale: 1.08; }
.plans-add-button:active { transform: scale(0.94); }
.plans-add-button svg {
  inline-size: 26px;
  block-size: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}
:is(.ask-star, .plans-add-button) > svg {
  transform: rotate(var(--menu-icon-rotation, 0deg));
  transition: transform 200ms ease-out;
}
.plans-add-open .plans-add-button { background: var(--ink); box-shadow: 0 6px 16px color-mix(in srgb, var(--shadow-color) 20%, transparent); }
.bottom-controls > .assistant-bar { transition: opacity 180ms; }
.plans-add-open > .assistant-bar { opacity: 0.35; pointer-events: none; }
.stack-menu-scrim {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms;
}
.stack-menu-scrim[data-open] { opacity: 1; pointer-events: auto; }
.stack-menu {
  position: absolute;
  inset-inline-end: 0;
  inset-block-end: calc(100% + 12px);
  z-index: 2;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  inline-size: max-content;
  visibility: hidden;
}
.stack-menu[data-open] { visibility: visible; }
.assistant-attachments-menu {
  display: flex;
  inset-inline: 0 auto;
  align-items: flex-start;
}
.assistant-attachments-menu .stack-menu-item { padding: 6px 16px 6px 6px; }
.stack-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: calc(15px * var(--font-scale));
  white-space: nowrap;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--shadow-color) 5.9%, transparent), 0 6px 18px color-mix(in srgb, var(--shadow-color) 14.9%, transparent);
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  transition: opacity 160ms ease-out, transform 200ms cubic-bezier(.2,.7,.2,1);
}
.stack-menu[data-open] .stack-menu-item { opacity: 1; transform: none; }
/* Pills rise from the trigger one after another, nearest first. */
.stack-menu[data-open] .stack-menu-item:nth-last-child(2) { transition-delay: 25ms; }
.stack-menu[data-open] .stack-menu-item:nth-last-child(3) { transition-delay: 50ms; }
.stack-menu[data-open] .stack-menu-item:nth-last-child(4) { transition-delay: 75ms; }
.stack-menu[data-open] .stack-menu-item:nth-last-child(5) { transition-delay: 100ms; }
.stack-menu[data-open] .stack-menu-item:nth-last-child(6) { transition-delay: 125ms; }
.stack-menu[data-open] .stack-menu-item:nth-last-child(7) { transition-delay: 150ms; }
.stack-menu[data-open] .stack-menu-item:nth-last-child(8) { transition-delay: 175ms; }
@media (max-height: 540px) {
  .plans-add-menu {
    max-block-size: calc(100dvh - var(--bottom-controls-clearance));
    overflow-y: auto;
    overscroll-behavior-y: contain;
  }
}
.stack-menu-item:hover, .stack-menu-item:focus-visible { background: var(--chip); }
/* A kind that can't be made yet: shown, but quiet and inert. */
.stack-menu-item:disabled { color: var(--muted); cursor: default; }
.stack-menu-item:disabled:hover { background: var(--surface); }
.stack-menu-item:disabled .stack-menu-icon { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.stack-menu-item:disabled .stack-menu-icon svg { stroke: var(--muted); opacity: .7; }
.stack-menu-icon {
  display: grid;
  place-items: center;
  inline-size: 34px;
  block-size: 34px;
  border-radius: 50%;
  background: var(--chip-soft);
}
.stack-menu-icon svg {
  inline-size: 19px;
  block-size: 19px;
  fill: none;
  stroke: var(--accent-strong);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
@media (prefers-reduced-motion: reduce) {
  .stack-menu-item, .stack-menu-scrim, .bottom-controls > .assistant-bar,
  :is(.ask-star, .plans-add-button) > svg, .ask-star-icon, .ask-close-icon { transition: none; }
}

/* ---- Plans: the card title opens full screen ---- */
.card-title-opens { display: flex; align-items: center; gap: var(--card-title-chevron-gap); }
[data-tab-card]:not([data-card-expanded]):not(:has(> .inline-item-editor)) .card-title-opens { cursor: pointer; }
.card-open-action {
  display: grid;
  place-items: center;
  inline-size: var(--card-chevron-slot);
  block-size: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--card-accent, var(--rose));
}
.card-open-action::before,
.card-back-action::before {
  content: "";
  flex: none;
  inline-size: var(--card-chevron-size);
  block-size: var(--card-chevron-size);
  background: var(--card-accent, var(--rose));
  mask: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m9 6 6 6-6 6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  transition: transform 150ms ease-out;
}
.card-title-opens:hover .card-open-action::before,
.card-open-action:focus-visible::before { transform: translateX(2px); }
/* On a list card the title opens the list; the pencil to edit it shows in full screen. */
[data-tab-card^="groceries"]:not([data-card-expanded]) .grocery-edit-action,
.tab-card-preview .grocery-edit-action { display: none; }
.grocery-title-line .card-open-action { flex: none; }
[data-card-expanded] .card-open-action,
[data-tab-card]:has(> .inline-item-editor) .card-open-action { display: none; }

/* ---- Top bar: a full-width blush band with text tabs; the active tab is a white pill ---- */
.app-header {
  inset-block-start: 0;
  inset-inline: 0;
  padding: var(--floating-bar-inset) var(--header-gutter) var(--top-bar-padding-end);
  background: var(--nav-bg);
}
.app-header .tab-bar {
  /* No icons: the zero-size icon slot still gives each label its left padding. */
  --tab-icon-size: 0px;
  --tab-icon-start: 0px;
  --tab-label-gap: 14px;
  justify-content: flex-start;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding-inline: 0;
}
.app-header .tab-bar a { flex: none; font-weight: 500; }
.app-header .tab-highlight { box-shadow: 0 1px 3px color-mix(in srgb, var(--shadow-color) 10.2%, transparent); }
.app-header .settings-link {
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
}
.app-header .settings-link svg { width: 26px; }
/* Like a selected tab: the theme's selected ink on the selected highlight.
   :root outranks the themes' resting colour (:root[data-theme] .settings-link). */
:root .app-header .settings-link[data-nav-current] { color: var(--nav-selected-ink); }
.app-header .settings-highlight { box-shadow: 0 1px 3px color-mix(in srgb, var(--shadow-color) 10.2%, transparent); }
/* The tab bar hugs its tabs. */
.app-header .tab-bar {
  justify-self: start;
  inline-size: max-content;
  max-inline-size: 100%;
}

/* The highlight flies between a tab and the Settings cog as one piece, morphing pill <-> disk. */
.nav-flyer {
  position: absolute;
  border-radius: 999px;
  background: var(--nav-selected-bg);
  box-shadow: 0 1px 3px color-mix(in srgb, var(--shadow-color) 10.2%, transparent);
  pointer-events: none;
}
.settings-link[data-highlight-arriving] .settings-highlight-track { visibility: hidden; }
.tab-highlight[data-awaiting] { opacity: 0; }

/* ---- Top bar in the logo's colours: the band's lower edge carries the four colours, and the current
   page is marked by an underline in its own one (To-do orange, Plans green, Notes purple, Settings
   blue) that slides between them, changing colour as it goes. Names are set like card titles. ---- */
:root {
  --brand-orange: #ff9330;
  --brand-green: #22c26e;
  --brand-purple: #7c5cff;
  --brand-blue: #1d9bf0;
  /* The current page's name and icon on the band, with no pill behind them. Themes with a dark band
     and a dark selected ink set their own. */
  --nav-current-ink: var(--nav-selected-ink);
}
.app-header { --nav-selected-ink: var(--nav-current-ink); --nav-accent: var(--brand-orange); }
.app-header:has(.tab-bar [href="#household"][data-nav-current]) { --nav-accent: var(--brand-green); }
.app-header:has(.tab-bar [href="#lists"][data-nav-current]) { --nav-accent: var(--brand-purple); }
.app-header:has(.settings-link[data-nav-current]) { --nav-accent: var(--brand-blue); }
.app-header-band {
  position: absolute;
  inset: auto 0 0;
  block-size: 4px;
  background: linear-gradient(90deg, var(--brand-orange) 0 25%, var(--brand-green) 25% 50%,
    var(--brand-purple) 50% 75%, var(--brand-blue) 75%);
  pointer-events: none;
}
/* --nav-fit (app.js) shrinks the names and their gaps together when the bar is too narrow for them. */
.app-header .tab-bar {
  --tab-label-gap: calc(16px * var(--nav-fit, 1));
  font-size: calc(18px * var(--font-scale) * var(--nav-fit, 1));
}
.app-header .tab-label { font-family: var(--font-heading); font-size: 1.12em; }
.app-header .tab-bar a[data-nav-current] { font-weight: 700; }
/* Each tab keeps its bold width, so choosing one neither nudges its neighbours nor resizes the
   highlight mid-flight (a resize would cut the slide or the flight to Settings short). */
.app-header .tab-label { display: inline-grid; }
.app-header .tab-label::after {
  content: attr(data-label);
  grid-area: 1 / 1;
  block-size: 0;
  overflow: hidden;
  visibility: hidden;
  font-weight: 700;
}
/* The highlight, the cog's disk and the flying piece between them are now just an underline. */
.app-header :is(.tab-highlight, .settings-highlight),
.app-header .nav-flyer { background: transparent; box-shadow: none; }
.app-header :is(.tab-highlight, .nav-flyer)::after,
.app-header .settings-link::after {
  content: "";
  position: absolute;
  inset: auto 22% -2px;
  block-size: 4px;
  border-radius: 4px;
  /* Themes with an edge of their own drop the band and underline every page in their accent. */
  background: var(--nav-underline, var(--nav-accent));
  transition: background-color 220ms ease;
}
.app-header .settings-link::after {
  /* Under the cog's disk, which sits inside the link by the bar's padding. */
  inset-inline: calc(var(--tab-bar-padding-block) + (100% - 2 * var(--tab-bar-padding-block)) * 0.22);
  inset-block-end: calc(var(--tab-bar-padding-block) - 2px);
  visibility: hidden;
}
.app-header .settings-link[data-nav-current]:not([data-highlight-arriving])::after { visibility: visible; }
/* The logo sits halfway between the band's edge and "To-do". */
.app-header .brand-mark { translate: 8px 0; }

/* ---- Bottom row: spans the page like the cards, with the + anchored at the right end ---- */
.bottom-controls {
  --row-gutter: max(calc(clamp(20px, 4vw, 64px) + max(0px, (100vw - 1340px) / 2)),
    env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  inset-inline: var(--row-gutter);
  width: auto;
  margin: 0;
}
/* The bar stretches until it reaches 560 px; past that it stops and the bar and + stay centred together. */
.bottom-controls { justify-content: center; }
.bottom-controls > .assistant-bar {
  flex: 0 1 560px;
}
/* The label never wraps: when the full name doesn't fit on one line, the bar switches to the short one
   (app.js measures it, so it follows the bar's width and the chosen text size). */
.ask-label {
  min-inline-size: 0;
  max-inline-size: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ask-label-short,
.assistant-bar.ask-label-compact .ask-label-long { display: none; }
.assistant-bar.ask-label-compact .ask-label-short { display: inline; }

/* The original palette, repeated for preview tiles (the page gets it from the first :root rule). */
[data-theme-preview] {
  /* The tile's poster: artwork and the colour of the theme name on it. */
  --preview-art: radial-gradient(circle at 78% 22%, #ffffff66 0 14%, transparent 15%), radial-gradient(circle at 18% 70%, #f2b8c999 0 18%, transparent 19%), radial-gradient(circle at 90% 85%, #a23e6255 0 22%, transparent 23%), linear-gradient(160deg, #f6dce4, #e9a9bd);
  --preview-ink: #5a1f36;
  --pine: #2b2024; --ink: #2b2024; --muted: #6b5a60; --paper: #fbf4ef; --line: #eadcd6;
  --lime: #f2b8c9; --chip: #f4ece7; --chip-soft: #f3e6e2; --rose: #a23e62;
  --card-radius: 24px; --field-radius: 14px;
  --card-shadow: 0 1px 2px color-mix(in srgb, var(--shadow-color) 3.9%, transparent), 0 12px 32px color-mix(in srgb, var(--rose) 7.8%, transparent);
}

/* The dark assistant bar keeps its own outline colour (the shared bar rule above uses the top bar's). */
.assistant-bar { border-color: var(--assistant-border); }

/* ---- Settings: App theme. Each tile is a small poster drawn with its theme's own values and artwork. ---- */
.theme-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 20px);
  margin-block-start: 14px;
}
.theme-tile {
  position: relative;
  /* Each poster scales its contents to its own width (cqi = 1% of the tile's width). */
  container-type: inline-size;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
  /* Measured here, outside the preview, so the ring uses the current theme's colours. */
  --accent-ring: var(--rose);
  --ring-gap: var(--surface);
  transition: transform 150ms;
}
.theme-tile:focus-visible { outline: none; }
.theme-thumb {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 3px solid transparent;
  border-radius: clamp(14px, 7cqi, 24px);
  background: var(--preview-art);
  color: var(--preview-ink);
  font-family: var(--font-body);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--shadow-color) 15%, transparent), 0 6px 16px color-mix(in srgb, var(--shadow-color) 14%, transparent);
  transition: box-shadow 150ms;
  text-align: start;
}
/* Hovering enlarges the whole tile, so the selected tile's check stays on its corner. */
@media (hover: hover) {
  .theme-tile:hover { z-index: 1; transform: scale(1.04); }
}
.theme-tile[aria-checked="true"] .theme-thumb,
.theme-tile:focus-visible .theme-thumb {
  box-shadow: 0 0 0 2px var(--ring-gap), 0 0 0 4px var(--accent-ring);
}
.theme-ad-copy {
  display: grid;
  align-content: start;
  gap: clamp(3px, 2cqi, 8px);
  padding: clamp(10px, 8cqi, 26px) clamp(9px, 8cqi, 26px) 0;
}
.theme-ad-name {
  font-family: var(--font-heading);
  font-size: clamp(14px, 15cqi, 44px);
  line-height: 1;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 8px color-mix(in srgb, var(--shadow-color) 18%, transparent);
}
.theme-ad-tag {
  font-size: clamp(10px, 6cqi, 15px);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.85;
}
/* A little product shot: a card with a date tile and the +, sitting at the bottom of the poster. */
.theme-ad-product {
  display: flex;
  align-items: center;
  gap: clamp(6px, 4cqi, 14px);
  margin: 0 clamp(7px, 6cqi, 20px) clamp(7px, 6cqi, 20px);
  padding: clamp(6px, 4.5cqi, 14px);
  border-radius: calc(var(--card-radius) / 3 + 2px);
  background: var(--surface);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--shadow-color) 22%, transparent);
}
.theme-thumb-tile {
  display: grid;
  place-items: center;
  flex: none;
  inline-size: clamp(20px, 15cqi, 44px);
  block-size: clamp(22px, 16.5cqi, 48px);
  border-radius: clamp(5px, 3.5cqi, 10px);
  background: var(--chip-soft);
  color: var(--accent-strong);
  font: 600 clamp(9px, 7cqi, 20px)/1 var(--font-heading);
}
.theme-ad-lines { display: grid; gap: clamp(3px, 2.5cqi, 7px); flex: 1; min-inline-size: 0; }
.theme-ad-lines i { display: block; block-size: clamp(3px, 2cqi, 6px); border-radius: 99px; background: var(--ink); opacity: 0.75; }
.theme-ad-lines i + i { inline-size: 65%; background: var(--muted); opacity: 0.5; }
.theme-thumb-plus {
  display: grid;
  place-items: center;
  flex: none;
  inline-size: clamp(18px, 13cqi, 40px);
  block-size: clamp(18px, 13cqi, 40px);
  border-radius: 50%;
  background: var(--rose);
  color: var(--on-accent);
  font: 600 clamp(13px, 9cqi, 26px)/1 var(--font-body);
}
.theme-tile-check {
  /* On the tile's corner, over the ring, so it never covers the theme name. */
  position: absolute;
  inset: -7px -7px auto auto;
  z-index: 1;
  display: none;
  place-items: center;
  inline-size: 20px;
  block-size: 20px;
  border-radius: 50%;
  background: var(--accent-ring);
  color: var(--on-accent);
  box-shadow: 0 0 0 2px var(--ring-gap);
}
.theme-tile[aria-checked="true"] .theme-tile-check { display: grid; }
.theme-tile-check svg { inline-size: 12px; block-size: 12px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

/* A time such as 8:15 never breaks across lines (the shared row rule above lets schedule text wrap). */
.card-item-row .card-item-schedule .appointment-when .appointment-clock { white-space: nowrap; }

/* ---- Plans rows: the job on the left, when it happens on the right (cadence, days or date, time) ---- */
.plan-when {
  display: grid;
  justify-items: end;
  text-align: end;
  line-height: 1.25;
}
.card-item-row .card-item-schedule .plan-when > span {
  white-space: nowrap;
}
.card-item-row .card-item-schedule .plan-cadence {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--card-accent, var(--accent-strong));
  font-size: calc(11px * var(--font-scale));
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.plan-cadence svg {
  inline-size: 11px;
  block-size: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.card-item-row .card-item-schedule .plan-when-main {
  margin-block-start: 2px;
  color: var(--ink);
  font-family: var(--font-heading);
  font-size: calc(16px * var(--font-scale));
}
.card-item-row .card-item-schedule .plan-when-sub {
  color: var(--muted);
  font-size: calc(12.5px * var(--font-scale));
}
.card-item-details > .plan-meta {
  margin-block-start: -3px;
}

/* ---- Card edges: row text lines up with the card title, and right-hand tiles with the grip. Rows keep
   their 8px inner padding for the tap highlight, so the list reaches 8px into the card's padding. ---- */
.panel > .card-item-list,
.panel > .card-footer {
  margin-inline: -8px;
}
.payment-chip[hidden],
.payment-sort-menu button[hidden] {
  display: none;
}

/* ---- Slide toggle: two options on a track, with a thumb that slides to the chosen one ---- */
.slide-toggle {
  position: relative;
  display: inline-grid;
  flex: none;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
}
.slide-toggle-thumb {
  position: absolute;
  inset-block: 3px;
  inset-inline-start: 3px;
  inline-size: calc(50% - 3px);
  border-radius: 999px;
  background: var(--nav-bg);
  box-shadow: 0 1px 3px color-mix(in srgb, var(--shadow-color) 18%, transparent);
  transition: transform 220ms cubic-bezier(.3, .7, .2, 1);
}
.slide-toggle[data-mode="past"] .slide-toggle-thumb {
  transform: translateX(100%);
}
.slide-toggle button {
  position: relative;
  min-inline-size: 58px;
  min-block-size: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: calc(13.5px * var(--font-scale));
  transition: color 220ms;
}
.slide-toggle button[aria-checked="true"] {
  color: var(--nav-label-color);
  font-weight: 600;
}
@media (prefers-reduced-motion: reduce) {
  .slide-toggle-thumb { transition: none; }
}

/* A skipped occurrence is settled, not late: its stamp is quiet. */
.late-stamp.tile-stamp-skipped {
  color: var(--muted);
}
/* Reserve the bold width, so the toggle keeps its size whichever side is chosen. */
.slide-toggle button::after {
  content: attr(data-label);
  display: block;
  block-size: 0;
  overflow: hidden;
  visibility: hidden;
  font-weight: 600;
}

/* ---- Card titles: one line, the full width up to the grip, fading out when they don't fit ---- */
:is([data-tab-card], .tab-card-preview, [data-new-shopping-list]) :is(h2, .invite-title, .grocery-title) {
  text-overflow: clip;
}
.section-head > h2.card-title-opens {
  flex: 0 1 auto;
}
.card-title-opens :is([data-card-title], [data-invite-title]) {
  min-inline-size: 0;
  overflow: hidden;
  white-space: nowrap;
}
.card-title-opens .card-open-action {
  flex: none;
}
[data-title-overflows] {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 2.5em), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 2.5em), transparent);
}
/* Give the title as much of the row as possible: a slim › and a small gap before the grip. */
.section-head:has(> h2.card-title-opens) {
  gap: 8px;
}
/* ---- Brand: fixed colours and type, never themed (docs/brand.md) ---- */
@font-face {
  font-family: "Brand";
  src: url("brand-fonts/nunito-latin-800-normal.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: "Brand";
  src: url("brand-fonts/nunito-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
.brand-mark {
  grid-column: 1;
  display: block;
  inline-size: var(--tab-height);
  block-size: var(--tab-height);
  /* The same space after the mark as before it: the To-do pill sits a gutter away. */
  margin-inline-end: calc(var(--header-gutter) - var(--header-column-gap));
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
}
.brand-mark img { display: block; inline-size: 100%; block-size: 100%; }
.brand-dev-badge {
  display: grid;
  place-items: center;
  inline-size: 100%;
  block-size: 100%;
  border-radius: 8px;
  background: var(--ink);
  color: var(--surface);
  font: 800 11px / 1 "Brand", system-ui, sans-serif;
  letter-spacing: 0.05em;
}
.brand-mark:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.brand-wordmark,
.welcome-sheet h1 {
  font-family: "Brand", "Nunito", system-ui, sans-serif;
  font-weight: 800;
  color: #22252e;
}
.brand-wordmark {
  display: inline-flex;
  /* A fifth of a space between the words. */
  gap: 0.055em;
  letter-spacing: 0;
  line-height: 1.05;
}
.brand-motto {
  display: block;
  font-family: "Brand", "Nunito", system-ui, sans-serif;
  font-weight: 600;
  /* At this size the motto runs the width of the wordmark above it. */
  font-size: 0.6655em;
  line-height: 1.2;
  white-space: nowrap;
  color: #22252e;
}
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand-lockup img { flex: none; }
.brand-lockup > span { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; font-size: 22px; }
/* About: the logo and motto on a warm panel with the release and version, edged with the logo's
   four colours; then Support, User Agreement and the publisher as rows, each with an icon tinted in
   one of the four. The words take the theme's ink, so the panel works on dark cards too. */
.about-hero {
  position: relative;
  margin-block-start: 14px;
  overflow: hidden;
  border-radius: 20px;
  background: color-mix(in srgb, var(--brand-orange) 6%, var(--surface));
  box-shadow: inset 0 0 0 1px var(--line);
}
/* Holding the panel reloads the app: it sinks a little while held, and the band sweeps in. */
.about-hero {
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 200ms ease;
}
.about-hero[data-holding] { transform: scale(.97); transition: transform 1500ms cubic-bezier(.3, 0, .4, 1); }
.about-hero[data-holding] .about-band { animation: about-band-sweep 1500ms linear; transform-origin: left; }
.about-hero[data-refreshing] { opacity: .6; }
@keyframes about-band-sweep { from { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .about-hero[data-holding] { transform: none; } }
.about-hero .brand-lockup { padding: 18px 18px 14px; }
.about-hero .brand-lockup img { inline-size: 60px; block-size: 60px; }
.about-hero .brand-lockup > span { font-size: calc(21px * var(--font-scale)); }
.about-hero .brand-wordmark { color: var(--ink); flex-wrap: wrap; }
.about-hero .brand-motto { color: var(--muted); white-space: normal; }
.about-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0 18px 18px; }
.about-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--chip);
  font-size: calc(13px * var(--font-scale));
}
.about-release::before { content: ""; inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--brand-orange); }
.about-band {
  position: absolute;
  inset: auto 0 0;
  block-size: 4px;
  background: linear-gradient(90deg, var(--brand-orange) 0 25%, var(--brand-green) 25% 50%,
    var(--brand-purple) 50% 75%, var(--brand-blue) 75%);
}
.about-rows { display: grid; margin: 6px 0 0; padding: 0; list-style: none; }
.about-rows li + li { border-block-start: 1px solid var(--line); }
.about-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 2px;
  color: var(--ink);
  text-decoration: none;
}
.about-row strong { display: block; font-weight: 500; font-size: calc(15px * var(--font-scale)); }
.about-row small { overflow-wrap: anywhere; }
.about-icon {
  display: grid;
  place-items: center;
  inline-size: 36px;
  block-size: 36px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--about-accent) 14%, var(--surface));
  color: var(--about-accent);
}
.about-icon svg { inline-size: 19px; block-size: 19px; }
.about-go { color: var(--muted); }
.about-go svg { inline-size: 18px; block-size: 18px; stroke-width: 2; }
@media (hover: hover) { a.about-row:hover .about-go { color: var(--ink); } }
/* The invitation dialog's lockup keeps its own paper backing, whatever the theme. */
.invite-dialog .brand-lockup {
  padding: 14px 18px;
  border-radius: 18px;
  background: #f6f1ea;
  width: fit-content;
  max-width: 100%;
}
.invite-dialog .brand-lockup { margin: 0 auto 14px; }
.invite-dialog .brand-lockup > span { font-size: 20px; }
.invite-dialog .brand-lockup img { width: 52px; height: 52px; }

/* Splash: shown until the first render, then fades. Hides itself if the script never runs. */
.brand-splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: #f6f1ea;
  animation: brand-splash-out 300ms ease 6s forwards;
  transition: opacity 300ms ease, visibility 0s linear 300ms;
}
.brand-splash .brand-wordmark { font-size: 34px; }
.brand-splash .brand-motto { font-size: calc(34px * 0.6655); margin-top: -12px; }
.brand-splash[data-done] { opacity: 0; visibility: hidden; pointer-events: none; }
@keyframes brand-splash-out { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .brand-splash { transition: none; } }

/* ---- Full screen header: the chevron and title share a Back button. Editors keep their × close. ---- */
.card-back-action {
  display: none;
  align-items: center;
  gap: var(--card-title-chevron-gap);
  min-inline-size: 0;
  min-block-size: 36px;
  padding: 0;
  padding-inline-start: 7px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: start;
}
.card-back-title {
  overflow: hidden;
  white-space: nowrap;
}
[data-tab-card][data-card-expanded]:not(:has(> .inline-item-editor)) > .tab-card-header {
  justify-content: flex-start;
  column-gap: var(--card-title-chevron-gap);
}
[data-card-expanded]:not(:has(> .inline-item-editor)) > .tab-card-header .card-back-action,
#invite-fullscreen[data-share-app] .card-back-action {
  display: inline-flex;
}
[data-card-expanded]:not(:has(> .inline-item-editor)) > .tab-card-header:has(.card-back-action) > .card-collapse-action,
[data-card-expanded]:not(:has(> .inline-item-editor)) > .tab-card-header h2:has(> .card-back-action) > :is([data-card-title], .card-icon) {
  display: none;
}
.card-back-action::before {
  margin-inline-end: calc((var(--card-chevron-slot) - var(--card-chevron-size)) / 2);
  transform: scaleX(-1);
}
.card-back-action:is(:hover, :focus-visible)::before {
  transform: translateX(-2px) scaleX(-1);
}
@media (prefers-reduced-motion: reduce) {
  .card-open-action::before,
  .card-back-action::before {
    transition: none;
  }
}
[data-tab-card^="groceries"][data-card-expanded]:not(:has(> .inline-item-editor)) .grocery-title-line {
  flex: 1 1 auto;
  min-inline-size: 0;
  /* The title button truncates its text and the pencil can extend into the gutter. */
  overflow: visible;
}
[data-tab-card^="groceries"] .card-back-action {
  flex: 1 1 auto;
}
[data-tab-card^="groceries"][data-card-expanded]:not(:has(> .inline-item-editor)) .grocery-edit-action {
  flex-basis: 36px;
  height: 36px;
  margin-inline: auto -8px;
}

/* ---- Items inside a card: a hairline between neighbouring items, so a two-line item doesn't run into the next.
   Compact cards count only the items on show; full-screen cards whose items are their own cards keep their gaps. ---- */
[data-tab-card]:not([data-card-expanded]) > .card-item-list,
[data-tab-card][data-card-expanded]:not([data-card-fullscreen-list]) > .card-item-list {
  row-gap: 0;
}
[data-tab-card]:not([data-card-expanded]) > .card-item-list > .card-item-row:not(.card-item-overflow) ~ .card-item-row:not(.card-item-overflow),
[data-tab-card][data-card-expanded]:not([data-card-fullscreen-list]) > .card-item-list > .card-item-row ~ .card-item-row {
  margin-block-start: 6px;
  padding-block-start: 6px;
  border-block-start: 1px solid color-mix(in srgb, var(--ink) 25%, transparent);
}

/* ---- Meal plan in full screen: List / Calendar switch in the header, and the four-week calendar ---- */
:is(.meal-view-toggle, .meal-cells-toggle) {
  display: inline-flex;
  flex: none;
  gap: 2px;
  padding: 3px;
}
.meal-view-toggle { margin-inline-start: auto; }
:is(.meal-view-toggle, .meal-cells-toggle)[hidden],
[data-tab-card]:has(> .inline-item-editor) .meal-view-toggle { display: none; }
:is(.meal-view-toggle, .meal-cells-toggle) button {
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  transition: background-color 160ms, color 160ms;
}
.meal-view-toggle button { inline-size: 36px; block-size: 30px; padding: 0; }
.meal-view-toggle svg {
  inline-size: 18px;
  block-size: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.meal-cells-toggle button {
  min-block-size: 26px;
  padding: 0 11px;
  font-size: calc(12.5px * var(--font-scale));
  font-weight: 600;
}
:is(.meal-view-toggle, .meal-cells-toggle) button[aria-checked="true"] {
  background: var(--nav-bg);
  color: var(--nav-label-color);
  box-shadow: 0 1px 3px color-mix(in srgb, var(--shadow-color) 18%, transparent);
}

/* In calendar view the list, the Upcoming / History toggle and the sort chip step aside; the filters stay. */
[data-meal-calendar] > .card-item-list,
[data-meal-calendar] > .payment-tools :is(.slide-toggle, .payment-sort-chip),
[data-plan-calendar] > .card-item-list,
[data-plan-calendar] > .payment-tools :is(.slide-toggle, .payment-sort-chip),
[data-tab-card]:has(> .inline-item-editor) > .meal-calendar { display: none; }

.meal-calendar { padding-block-end: var(--bottom-controls-clearance); }
.meal-calendar-bar { margin-block: 4px 8px; }
.meal-calendar-range { display: inline-block; font-weight: 600; color: var(--ink); }
.meal-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}
.meal-calendar-weekday {
  padding-block-end: 2px;
  color: var(--muted);
  font-size: calc(11px * var(--font-scale));
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: center;
}
.meal-calendar-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-inline-size: 0;
  min-block-size: 74px;
  padding: 5px 3px;
  border: 0;
  border-radius: 12px;
  background: var(--card-surface, var(--surface));
  color: var(--ink);
  font: inherit;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--shadow-color) 6%, transparent);
}
.meal-calendar-day.is-past {
  background: color-mix(in srgb, var(--card-surface, var(--surface)) 50%, var(--paper));
}
.meal-calendar-day.is-past > :not(.meal-calendar-date) { opacity: 0.5; }
.meal-calendar-day.is-past .meal-calendar-date { color: var(--muted); }
/* An outline paints over the meal bands, so the selected tile keeps its full border. */
.meal-calendar-day[aria-pressed="true"] { outline: 2px solid var(--ink); outline-offset: -2px; }
.meal-calendar-date {
  align-self: flex-start;
  margin-inline-start: 3px;
  padding-inline: 4px;
  border-radius: 999px;
  font-size: calc(12px * var(--font-scale));
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.meal-calendar-day[aria-current="date"] {
  background: color-mix(in srgb, var(--card-accent, var(--rose)) 14%, var(--card-surface, var(--surface)));
}
.meal-calendar-day[aria-current="date"] .meal-calendar-date {
  background: var(--card-accent, var(--rose));
  color: var(--on-accent, #fff);
}
/* Lunch and dinner share the tile below the date: rounded blocks almost the tile's full width. */
/* Both modes share one tile height: the tallest a text tile gets (two dish names of two lines each),
   so switching between Icons and Text never moves the grid. It follows the font size setting. */
.meal-calendar-grid { --meal-tile-height: calc(24px + 66.3px * var(--font-scale)); }
.meal-calendar-day { min-block-size: var(--meal-tile-height); }
.meal-calendar-grid[data-cells="icons"] .meal-calendar-day { padding: 4px 2px 2px; gap: 2px; }
.meal-calendar-icon {
  display: grid;
  flex: none;
  align-self: stretch;
  place-items: center;
  /* Half the tile below the date (the first block tucks 4 px under it). */
  block-size: calc(9px + 24.15px * var(--font-scale));
  border-radius: 10px;
  background: var(--chip);
  font-size: 19px;
}
/* The emoji nearly fills its block. */
.meal-calendar-icon .item-icon { inline-size: 28px; block-size: 28px; font-size: 26px; line-height: 1; }
.meal-calendar-icon.is-blank { visibility: hidden; }
/* The first icon tucks a little under the date. */
.meal-calendar-date { position: relative; z-index: 1; }
.meal-calendar-date + .meal-calendar-icon { margin-block-start: -4px; }
.meal-calendar-grid[data-cells="icons"] .meal-calendar-date { margin-inline-start: 5px; }
.meal-calendar-name {
  display: -webkit-box;
  align-self: stretch;
  overflow: hidden;
  padding: 2px 3px;
  border-radius: 6px;
  background: var(--chip);
  color: var(--ink);
  font-size: calc(10.5px * var(--font-scale));
  line-height: 1.15;
  text-align: start;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.meal-calendar-name.is-skipped { text-decoration: line-through; }
.meal-calendar-icon.is-skipped { opacity: 0.45; }
:is(.meal-calendar-icon, .meal-calendar-name, .meal-day-icon)[data-person-color="0"] { background: var(--person-0-bg); color: var(--person-0-ink); }
:is(.meal-calendar-icon, .meal-calendar-name, .meal-day-icon)[data-person-color="1"] { background: var(--person-1-bg); color: var(--person-1-ink); }
:is(.meal-calendar-icon, .meal-calendar-name, .meal-day-icon)[data-person-color="2"] { background: var(--person-2-bg); color: var(--person-2-ink); }
:is(.meal-calendar-icon, .meal-calendar-name, .meal-day-icon)[data-person-color="3"] { background: var(--person-3-bg); color: var(--person-3-ink); }
:is(.meal-calendar-icon, .meal-calendar-name, .meal-day-icon)[data-person-color="4"] { background: var(--person-4-bg); color: var(--person-4-ink); }
:is(.meal-calendar-icon, .meal-calendar-name, .meal-day-icon)[data-person-color="5"] { background: var(--person-5-bg); color: var(--person-5-ink); }

.meal-day-card {
  margin-block-start: 12px;
  padding: 16px 18px 8px;
  border-radius: 20px;
  background: var(--card-surface, var(--surface));
  box-shadow: 0 1px 2px color-mix(in srgb, var(--shadow-color) 3.9%, transparent), 0 8px 22px color-mix(in srgb, var(--rose) 7.1%, transparent);
}
.meal-day-card h3 {
  margin: 0 0 2px;
  color: var(--ink);
  font-size: calc(16px * var(--font-scale));
  font-weight: 600;
}
.meal-day-note { margin: 0 0 6px; color: var(--muted); font-size: calc(13px * var(--font-scale)); }
.meal-day-row {
  display: flex;
  align-items: center;
  gap: 12px;
  inline-size: 100%;
  padding: 10px 0;
  border: 0;
  border-block-start: 1px solid color-mix(in srgb, var(--ink) 25%, transparent);
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: start;
}
.meal-day-card h3 + .meal-day-row,
.meal-day-note + .meal-day-row { border-block-start: 0; }
.meal-day-icon {
  display: grid;
  flex: none;
  place-items: center;
  inline-size: 36px;
  block-size: 36px;
  border-radius: 50%;
  background: var(--chip);
  font-size: 18px;
}
.meal-day-icon .item-icon { inline-size: 20px; block-size: 20px; font-size: 18px; line-height: 1; }
.meal-day-icon.is-empty {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ink) 30%, transparent);
  color: var(--muted);
}
.meal-day-main { flex: 1; min-inline-size: 0; }
.meal-day-dish { display: block; }
.meal-day-add { color: var(--card-accent, var(--rose)); font-weight: 600; }
.meal-day-when { flex: none; text-align: end; }
.meal-day-when strong { display: block; font-weight: 500; }
.meal-day-status {
  color: var(--card-accent, var(--rose));
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: calc(10.5px * var(--font-scale));
}

/* ---- Meal icons: drawn line icons that fill more of their badge than the task icons ---- */
.item-icon-badge.item-icon-large > svg {
  inline-size: 88%;
  block-size: 88%;
  stroke-width: 1.6;
}
:is(.person-chip, .what-icon-field) .item-icon-badge.item-icon-large > svg {
  inline-size: 96%;
  block-size: 96%;
  stroke-width: 1.5;
}
/* In the calendar and the day card the cook's colour is the badge: the drawing sits on it in the cook's ink. */
:is(.meal-calendar-icon, .meal-day-icon) .item-icon.item-icon-badge {
  background: transparent;
  color: inherit;
}
/* The drawing is cropped to its own outline (its viewBox hugs the lines' centres) and grows until its
   2 px line is 1 px from its block's edges, top and bottom or left and right, whichever it reaches first:
   the box sits 2 px inside the block and the line's outer half spills 1 px past it. */
/* A plain block, so the drawing's 100% resolves against this exact size. */
.meal-calendar-icon .item-icon.item-icon-badge {
  display: block;
  margin: auto;
  inline-size: calc(100% - 4px);
  block-size: calc(5px + 24.15px * var(--font-scale));
}
.meal-calendar-icon .item-icon-badge.item-icon-large > svg {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  stroke-width: 2;
  overflow: visible;
}
.meal-calendar-icon .item-icon-badge > svg * { vector-effect: non-scaling-stroke; }
.meal-day-icon .item-icon.item-icon-badge { inline-size: 32px; block-size: 32px; }
.meal-calendar-icon:not([data-person-color]),
.meal-day-icon:not([data-person-color]) { color: var(--accent-strong); }

/* Meal icons in the editor (the What chip and the icon picker): the drawing is fitted to its round chip.
   Its viewBox is the smallest circle around the lines' centres, set 2 px inside the chip, so the 2 px line
   comes to 1 px from the chip's edge. */
.item-icon.item-icon-badge.item-icon-fit { display: block; padding: 2px; }
:is(.person-chip, .what-icon-field) .item-icon-badge.item-icon-fit > svg {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  stroke-width: 2;
  overflow: visible;
}
.item-icon-fit > svg * { vector-effect: non-scaling-stroke; }

/* ---- Item icons in rows: a column of their own at the left of the left cell, centred on its lines ---- */
:is(.card-item-details, .card-item-copy).has-row-icon {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 10px;
  align-content: center;
}
.has-row-icon > :not(.what-title-icon) { grid-column: 2; }
.has-row-icon > .what-title-icon {
  grid-column: 1;
  align-self: center;
  margin: 0;
  vertical-align: baseline;
}

/* ---- Parts of day in To-do: under the date tile, stacked; the right cell centres on the row ---- */
.day-tile-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}
.day-tile-anchor { position: relative; display: inline-flex; }
/* The lines sit just under the tile, in the same place whether or not the row is stamped; a stamp, which hangs
   off the tile's corner, covers the start of the first line with its opaque fill. */
.day-part-labels {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  margin-block-start: 4px;
  color: var(--muted);
  font-size: calc(12px * var(--font-scale));
  line-height: 1.25;
  white-space: nowrap;
}
.card-item-row > .card-item-schedule {
  align-self: stretch;
  align-content: center;
}

/* ---- Swipe to remove (list items): the row slides over a band that names the action ---- */
.swipe-row { touch-action: pan-y; }
.card-item-list.has-swiping-row { position: relative; overflow: clip; }
.swipe-row.is-swiping {
  position: relative;
  z-index: 1;
  border-radius: 9px;
  background: var(--card-surface, var(--surface));
  transform: translateX(var(--swipe-x, 0px));
  transition: transform var(--swipe-ease, 0ms) ease-out;
}
/* Let go before the threshold and the row springs home, overshooting a touch. */
.swipe-row.is-springing { transition-timing-function: cubic-bezier(.3, 1.6, .5, 1); }
.swipe-band {
  /* Placed and rounded like the row it lies under (swipe-remove.js). */
  position: absolute;
  z-index: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-inline: 16px;
  background: color-mix(in srgb, var(--rose) 16%, var(--card-surface, var(--surface)));
  color: var(--rose);
  font-weight: 600;
  font-size: calc(14px * var(--font-scale));
  transition: background-color 120ms, color 120ms;
}
.swipe-band[data-side="end"] { flex-direction: row-reverse; }
.swipe-band svg {
  inline-size: 20px;
  block-size: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 140ms;
}
.swipe-band.is-free { background: var(--rose); color: var(--on-accent, #fff); }
.swipe-band.is-free svg { transform: scale(1.2); }

/* ---- Swipe to postpone (postpone-swipe.js) ---- */
.postpone-row { touch-action: pan-y; }
/* The row's list clips the row as it slides, leaving room for the band's rounded ends. */
.card-item-list.has-postpone-row { position: relative; clip-path: inset(-100vh -10px); }
.postpone-row.is-postpone-swiping {
  position: relative;
  z-index: 1;
  border-radius: 9px;
  background: var(--postpone-row-surface, var(--card-surface, var(--surface)));
  translate: var(--postpone-x, 0px) 0;
  transition: translate var(--postpone-ease, 0ms) var(--postpone-curve, ease-out);
}
.postpone-band {
  /* Placed and rounded like the row it lies under (postpone-swipe.js). */
  --postpone-hue: color-mix(in srgb, color-mix(in srgb, var(--brand-blue) 45%, var(--muted)) 78%, var(--ink));
  --postpone-solid: var(--postpone-hue);
  position: absolute;
  z-index: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-inline: 16px;
  background: color-mix(in srgb, var(--postpone-hue) 14%, var(--card-surface, var(--surface)));
  color: var(--postpone-hue);
  font-family: var(--font-body);
  transition: background-color 120ms, color 120ms;
}
html[data-theme="midnight"] .postpone-band {
  --postpone-hue: color-mix(in srgb, var(--brand-blue) 55%, var(--ink));
  --postpone-solid: color-mix(in srgb, var(--brand-blue) 42%, var(--surface));
}
.postpone-band.is-snapped { background: var(--postpone-solid); color: #fff; }
.postpone-band[data-blocked] { background: var(--chip); color: var(--muted); }
.postpone-icon { position: relative; display: grid; flex: none; place-items: center; inline-size: 36px; block-size: 36px; }
.postpone-clock { inline-size: 22px; block-size: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.postpone-ring { position: absolute; inset: 0; display: none; rotate: -90deg; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; }
.postpone-ring > circle:first-child { stroke-opacity: .3; }
.postpone-band.is-snapped .postpone-ring { display: block; }
/* "Postpone / to Tue 1 Dec": drawn as a button from the start; it works once the row stays open. */
.postpone-action {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  column-gap: 8px;
  padding: 8px 12px 8px 16px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 14%, transparent);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, currentColor 50%, transparent);
  color: inherit;
  font: inherit;
  text-align: start;
  white-space: nowrap;
  pointer-events: none;
  transition: scale 90ms, background-color 90ms;
}
.postpone-band.is-snapped .postpone-action { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, currentColor 55%, transparent), 0 2px 8px rgb(0 0 0 / .15); }
.postpone-title { grid-column: 1; font-weight: 600; font-size: calc(15px * var(--font-scale)); }
.postpone-date { grid-column: 1; font-size: calc(13px * var(--font-scale)); opacity: .85; }
.postpone-chevron { grid-area: 1 / 2 / span 2; inline-size: 18px; block-size: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.postpone-band[data-blocked] .postpone-action { padding: 0; background: none; box-shadow: none; }
.postpone-band[data-blocked] .postpone-chevron { display: none; }
.card-item-list:has(> .postpone-row.is-postpone-parked) .postpone-action { pointer-events: auto; cursor: pointer; }
.postpone-action:active { scale: .95; background: color-mix(in srgb, currentColor 30%, transparent); }

/* ---- Close buttons: a drawn × centred exactly in the rounded square (the text glyph sits off-centre) ---- */
.card-collapse-action,
#close-chat { font-size: 0; }
#close-chat {
  display: grid;
  place-items: center;
  inline-size: 36px;
  block-size: 36px;
  padding: 0;
}
.card-collapse-action,
#close-chat { position: relative; }
/* Placed absolutely, so the hidden "×" text can't share the grid and nudge it off-centre. */
/* A plain selector list, not :is(), so #close-chat lends no extra weight to the card buttons' rule. */
.card-collapse-action::before,
#close-chat::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  inline-size: 14px;
  block-size: 14px;
  background: currentColor;
  mask: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M1.5 1.5l11 11M12.5 1.5l-11 11' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* ---- Folding a card to its title row (card-fold.js). Folded, it matches the strip shown while dragging. ---- */
.card-fold {
  flex: none;
  display: grid;
  place-items: center;
  inline-size: 28px;
  block-size: 28px;
  margin-inline: -6px -4px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.card-fold + h2 { margin-inline-end: auto; }
/* To-do and saved list cards show progress after the title, open or folded and in full screen. The title keeps
   its full width: the summary takes only the space left over, and when the ring doesn't fit there it
   wraps onto a second line that the fixed height hides, rather than cutting the title short. */
.card-fold-summary {
  --fold-done: var(--card-accent, var(--rose));
  --fold-empty: color-mix(in srgb, var(--ink) 12%, transparent);
  display: none;
  flex: 1 1 0;
  min-inline-size: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  block-size: 26px;
  overflow: hidden;
}
[data-card-progress] > .tab-card-header > .card-fold-summary:not(:empty) { display: flex; }
/* A lone flex item never wraps, so an empty first item gives the ring something to wrap after. */
.card-fold-summary::before { content: ""; block-size: 26px; }
[data-card-progress] > .tab-card-header:has(> .card-fold-summary:not(:empty)) > h2 { margin-inline-end: 0; }
.fold-progress-ring {
  flex: none;
  inline-size: 25.3px;
  block-size: 25.3px;
  fill: var(--fold-empty);
}
.fold-progress-ring > .is-done,
.fold-progress-ring > .is-complete { fill: var(--fold-done); }
.fold-progress-ring > .ring-check {
  fill: none;
  stroke: var(--on-accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Plans cards show four weeks, Sunday first, as a small calendar beside the title, open or folded but
   not in full screen. Like the To-do progress, it uses only the space the title leaves and steps
   aside (wraps out of sight) rather than cutting the title short. */
.plan-bead {
  display: flex;
  flex: 1 1 0;
  min-inline-size: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  row-gap: 8px;
  /* Closer to the title than the header's gap: the dots sit 6px from it. */
  margin-inline-start: -8px;
  block-size: 36px;
  overflow: hidden;
}
.plan-bead::before { content: ""; block-size: 36px; }
.tab-card-header:has(> .plan-bead) > h2 { margin-inline-end: 0; }
[data-card-expanded] > .tab-card-header > .plan-bead { display: none; }
.tab-card-grip-face:has(> .plan-bead) {
  padding: 3px 6px 0;
  background: linear-gradient(var(--card-accent, var(--rose)) 3px, transparent 3px),
    color-mix(in srgb, var(--ink) 6%, var(--card-surface, var(--surface)));
}
.tab-card-grip-face:has(> :is(.plan-bead, .card-fold-summary:not(:empty)))::before { content: none; }
.tab-card-grip-face > .plan-bead {
  display: block;
  flex: none;
  block-size: auto;
  margin: 0;
  overflow: visible;
}
.tab-card-grip-face > .plan-bead::before { content: none; }
.tab-card-grip-face > .plan-bead > .plan-bead-grid { margin: 0; }
/* Each day is a 6px cell holding a dot: a grey speck when empty, then 3, 4 and 6px for 1, 2 and 3+ (whole pixels keep them round). */
.plan-bead-grid {
  display: grid;
  grid-template: repeat(4, 6px) / repeat(7, 6px);
  gap: 1px;
  /* 24px clear of the grip, with the header's own gap; 2px spare on the left for today's ring. */
  margin-inline: 2px 12px;
}
.plan-bead-grid > i {
  display: grid;
  place-items: center;
  border-radius: 50%;
}
.plan-bead-grid > i::before {
  content: "";
  inline-size: 2px;
  block-size: 2px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ink) 22%, transparent);
}
.plan-bead-grid > [data-count]::before { background: var(--success); }
.plan-bead-grid > [data-count="1"]::before { inline-size: 3px; block-size: 3px; }
.plan-bead-grid > [data-count="2"]::before { inline-size: 4px; block-size: 4px; }
.plan-bead-grid > [data-count="3"]::before { inline-size: 6px; block-size: 6px; }
.plan-bead-grid > [data-past] { opacity: 0.35; }
.plan-bead-grid > [data-today] {
  outline: 1px solid var(--ink);
  outline-offset: 0.5px;
}
.tab-card-grip-face > .card-fold-summary:not(:empty) {
  display: flex;
  flex: none;
  block-size: auto;
  overflow: visible;
}
.tab-card-grip-face > .card-fold-summary::before { content: none; }
[data-card-expanded]:not(:has(> .inline-item-editor)) > .tab-card-header > .tab-card-grip:has(.card-fold-summary:not(:empty)) {
  display: grid;
  cursor: default;
}
[data-card-expanded] .tab-card-grip-face {
  box-shadow: none;
}
@media (hover: hover) {
  .card-fold:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
}
.card-fold svg {
  inline-size: 18px;
  block-size: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 300ms cubic-bezier(.25,.75,.35,1);
}
.card-fold[aria-expanded="false"] svg { transform: rotate(-90deg); }
[data-card-expanded] .card-fold,
[data-tab-card]:has(> .inline-item-editor) .card-fold { display: none; }
.panel[data-tab-card][data-card-folded]:not([data-card-expanded]) { padding-block: 16px; }
.panel[data-tab-card][data-card-folded]:not([data-card-expanded]) > :not(.tab-card-header) { display: none; }
.panel[data-tab-card][data-card-folded]:not([data-card-expanded]) > .tab-card-header { margin-block-end: 0; }
@media (prefers-reduced-motion: reduce) {
  .card-fold svg { transition: none; }
}

/* A one-off's date tile in a Plans row lines up with the timing text of the rows around it. */
button.date-display.plan-date-tile { padding-inline-end: 8px; }

/* ---- Calendar view of the other Plans cards: the meal calendar's grid. A day holds an entry before noon and one
   from noon, each in its own block; a busier day spreads up to four blocks evenly down the day, overlapping like
   fanned cards. ---- */
/* Blocks are inset 4 px from the day's edges, so their corners are the day's radius less 4 px: one centre of
   curvature for both. */
.plan-calendar .meal-calendar-grid[data-cells="icons"] .meal-calendar-day { --day-inset: 4px; padding: var(--day-inset); gap: 4px; }
.plan-calendar-deck > :is(.meal-calendar-icon, .meal-calendar-name) { border-radius: calc(12px - var(--day-inset)); }
.plan-calendar-deck {
  --deck-block: calc(9px + 24.15px * var(--font-scale));
  position: relative;
  display: block;
  flex: none;
  align-self: stretch;
  block-size: var(--deck-block);
}
.plan-calendar-deck[data-count="0"] { visibility: hidden; }
.plan-calendar-deck[data-layout="spread"] { flex: 1; block-size: auto; min-block-size: calc(var(--deck-block) * 2 + 4px); }
.plan-calendar-deck > * {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  /* A 2 px outline in the day's colour, so overlapping blocks stay distinct. */
  box-shadow: 0 0 0 2px var(--card-surface, var(--surface)), 0 1px 3px color-mix(in srgb, var(--shadow-color) 22%, transparent);
}
.plan-calendar-deck[data-layout="spread"] > * {
  inset: auto 0;
  inset-block-start: calc((100% - var(--deck-block)) * var(--deck-index) / var(--deck-last));
  block-size: var(--deck-block);
}
.plan-calendar-deck > .meal-calendar-name { display: block; }
.plan-calendar-text {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
/* The meal icons' rule, with more room: the drawing, cropped to its outline, sits 3 px inside its block and grows
   until its 2 px line is 2 px from the block's edges, top and bottom or left and right. */
.plan-calendar-deck > .meal-calendar-icon .item-icon.item-icon-badge {
  display: block;
  margin: auto;
  inline-size: calc(100% - 6px);
  block-size: calc(var(--deck-block) - 6px);
}
.plan-calendar-deck > .meal-calendar-icon .item-icon-badge > svg {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  stroke-width: 2;
  overflow: visible;
}
.plan-calendar-deck > .meal-calendar-icon .item-icon-badge > svg * { vector-effect: non-scaling-stroke; }

/* The calendar grids take sideways swipes (four weeks back or forward); vertical scrolling stays with the page. */
.meal-calendar-grid { touch-action: pan-y pinch-zoom; }
/* The neighbouring weeks, revealed at the edge during a swipe: laid over the calendar's own range and grid. */
.meal-calendar { position: relative; }
.calendar-reveal {
  position: absolute;
  inset: 0 0 auto;
  z-index: 1;
  pointer-events: none;
}
main:has(.meal-calendar.is-swiping) { overflow-x: clip; }
/* The calendar's own label bar lets its top margin pass through the calendar; the copy's must not add one. */
.calendar-reveal > .meal-calendar-bar { margin-block-start: 0; }

/* Show the invitation welcome page on its own while the link is checked and the family is set up. */
html[data-invite-page] body > :is(.brand-splash, .app-header, main:not(#invite-welcome), .bottom-controls) {
  display: none;
}

.invite-welcome:not([hidden]) {
  display: grid;
  place-items: center;
  min-block-size: 100svh;
  padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.welcome-sheet {
  container-type: inline-size;
  width: min(100%, 442px);
  padding: clamp(22px, 6vw, 40px);
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--surface);
  box-shadow: var(--card-shadow);
}

.welcome-mark {
  display: block;
  margin-block-end: 22px;
}

.welcome-sheet h1 {
  font-size: calc(clamp(29px, 6vw, 42px) * var(--font-scale));
  line-height: 1.1;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.welcome-sheet .brand-wordmark {
  display: flex;
  margin-block-start: 4px;
  font-size: min(1em, 11cqi);
  white-space: nowrap;
}

.welcome-sheet h1:focus {
  outline: none;
}

.welcome-status:not(:empty) {
  margin-block-start: 20px;
  color: var(--muted);
}

#welcome-form:not([hidden]) {
  display: grid;
  gap: 8px;
  margin-block-start: 26px;
}

#welcome-form label:not(:first-child) {
  margin-block-start: 8px;
}

#welcome-form input:not([type="checkbox"]) {
  min-inline-size: 0;
  min-block-size: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--field-radius);
  background: var(--paper);
  color: var(--ink);
  font-size: max(16px, 1em);
}

.welcome-agreement:not([hidden]) {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-block-size: 28px;
  margin-block-start: 12px;
  line-height: 1.5;
}

.welcome-agreement input {
  inline-size: 18px;
  block-size: 18px;
  margin: 2px 0 0;
  accent-color: var(--pine);
}

.welcome-agreement a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

#welcome-form .primary {
  min-block-size: 46px;
  margin-block-start: 12px;
  border-radius: var(--field-radius);
  white-space: normal;
}

#welcome-form .primary:disabled {
  opacity: .6;
}

.welcome-error:empty {
  display: none;
}

.welcome-error:not(:empty) {
  margin-block-start: 4px;
  color: var(--ink);
}

[data-welcome-retry] {
  margin-block-start: 16px;
}

/* ---- Plans: Start planning / Continue planning (plans-start.js) ---- */
/* Plan cards with nothing in them wait behind the carousel, unless open in full screen or editing. */
[data-tab-card][data-plans-unused]:not([data-card-expanded]):not(:has(> .inline-item-editor)) { display: none; }
#view:has([data-card-expanded]) .plans-start { display: none; }
.plans-start {
  grid-column: 1 / -1;
  /* The cards' stacking order stays inside the card, under the bottom bar and other fixed layers. */
  isolation: isolate;
  overflow: hidden;
  padding-block-end: 22px;
}
.plans-start > .tab-card-header { min-block-size: 36px; }
.plans-start h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: calc(var(--card-heading-size) * var(--font-scale));
}
.plans-start-close {
  display: grid;
  place-items: center;
  flex: none;
  inline-size: 28px;
  block-size: 28px;
  margin-inline-start: -4px;
  padding: 0;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.plans-start-close svg { inline-size: 16px; block-size: 16px; }
.plans-start-close[hidden] { display: none; }
@media (hover: hover) { .plans-start-close:hover { background: var(--chip); color: var(--ink); } }
.plans-start-stage {
  position: relative;
  block-size: 252px;
  margin: 14px -20px 0;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.plans-start-card {
  --card-size: 232px;
  position: absolute;
  inset-block-start: 4px;
  inset-inline-start: 50%;
  display: grid;
  /* A set band for the picture keeps the main icon in the same place on every card; only larger
     text sizes squeeze it, so the words never run into it. */
  grid-template-rows: minmax(0, 104px) 1fr;
  row-gap: 8px;
  box-sizing: border-box;
  inline-size: var(--card-size);
  block-size: var(--card-size);
  padding: 22px 20px 20px;
  border-radius: 26px;
  background: var(--type-surface);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--shadow-color) 5%, transparent),
    0 12px 28px color-mix(in srgb, var(--type-accent) 18%, transparent),
    inset 0 0 0 1px color-mix(in srgb, var(--type-accent) 10%, transparent);
  color: var(--ink);
  cursor: grab;
  will-change: transform;
}
.plans-start-art { position: relative; display: grid; place-items: center; }
/* Three small bubbles around the main icon, each a different size and lightly tinted. */
.plans-start-bubble {
  position: absolute;
  display: grid;
  place-items: center;
  inline-size: var(--bubble, 30px);
  block-size: var(--bubble, 30px);
  border-radius: 50%;
  background: color-mix(in srgb, var(--type-accent) 9%, var(--type-surface));
  color: color-mix(in srgb, var(--type-accent) 70%, var(--type-surface));
}
.plans-start-bubble svg { inline-size: 58%; block-size: 58%; }
.plans-start-bubble:nth-child(1) { --bubble: 32px; inset: 14% auto auto 13%; }
.plans-start-bubble:nth-child(2) { --bubble: 26px; inset: 2% 17% auto auto; }
.plans-start-bubble:nth-child(3) { --bubble: 22px; inset: auto 12% 16% auto; }
.plans-start-disc {
  display: grid;
  place-items: center;
  inline-size: 72px;
  block-size: 72px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--type-accent) 13%, var(--type-surface));
  color: var(--type-accent);
}
.plans-start-disc svg { inline-size: 38px; block-size: 38px; }
/* The title takes the card's width; the caption under it stops well clear of the + beside it. */
.plans-start-caption { display: grid; gap: 4px; align-content: end; min-block-size: 0; }
.plans-start-caption span { padding-inline-end: 54px; }
.plans-start-caption strong { font: 400 calc(19px * var(--font-scale))/1.15 var(--font-heading); }
.plans-start-caption span { color: var(--muted); font-size: calc(12.5px * var(--font-scale)); line-height: 1.3; }
.plans-start-add {
  position: absolute;
  inset: auto 12px 12px auto;
  display: grid;
  place-items: center;
  inline-size: 44px;
  block-size: 44px;
  padding: 0;
  /* An outline in the type's colour, so the card's one action stays light. */
  border: 2px solid var(--type-accent);
  border-radius: 50%;
  background: transparent;
  color: var(--type-accent);
  cursor: pointer;
  transition: background-color 160ms, border-color 160ms, color 160ms, scale 160ms ease-out, box-shadow 160ms;
}
.plans-start-add svg { inline-size: 22px; block-size: 22px; stroke-width: 2.2; }
/* Hovered on the card in front, the + takes the bottom bar's + colours and grows like it. */
@media (hover: hover) {
  .plans-start-card:not([aria-hidden="true"]) .plans-start-add:hover {
    border-color: var(--rose);
    background: var(--rose);
    color: var(--on-accent);
    scale: 1.1;
    box-shadow: 0 10px 22px color-mix(in srgb, var(--rose) 28%, transparent);
  }
}
.plans-start-card:not([aria-hidden="true"]) .plans-start-add:active {
  border-color: var(--rose);
  background: var(--rose);
  color: var(--on-accent);
  scale: 1.1;
  box-shadow: 0 10px 22px color-mix(in srgb, var(--rose) 28%, transparent);
}
.plans-start-index { display: flex; justify-content: center; gap: 6px; margin-block-start: 18px; }
.plans-start-index > button {
  position: relative;
  display: grid;
  place-items: center;
  inline-size: 30px;
  block-size: 30px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.plans-start-index svg { inline-size: 16px; block-size: 16px; }
.plans-start-index > [aria-current] {
  background: var(--type-accent);
  color: var(--on-accent);
}
/* "Or use the + button below", its + drawn as a small copy of the bottom bar's button. */
.plans-start-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: calc(13.5px * var(--font-scale));
}
.plans-start-hint-plus {
  display: inline-grid;
  place-items: center;
  inline-size: 22px;
  block-size: 22px;
  border-radius: 50%;
  background: var(--rose);
  color: var(--on-accent);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--rose) 35%, transparent);
}
.plans-start-hint-plus svg { inline-size: 13px; block-size: 13px; stroke-width: 2.6; }
/* ---- To-do: the who-filter tab (who-filter.js) ---- */
.who-filter-wheel-surface {
  overflow: hidden auto;
  overscroll-behavior-y: contain;
  overflow-anchor: none;
  scrollbar-width: none;
  margin-inline: -20px;
  padding-inline: 20px;
  margin-block-end: calc(-1 * var(--who-wheel-space, 0px));
}
.who-filter-wheel-track::after {
  content: "";
  display: block;
  block-size: var(--who-wheel-range);
}
.who-filter-wheel-content {
  display: flow-root;
  position: sticky;
  top: 0;
}
#view:has([data-card-expanded]) .who-filter-wheel-surface,
#view:has([data-card-expanded]) .who-filter-wheel-track,
#view:has([data-card-expanded]) .who-filter-wheel-content { display: contents; }
#view:has([data-card-expanded]) .who-filter-wheel-track::after { display: none; }
/* Clip behind the bar and span the viewport so the moving tab can travel below its resting box. */
.who-filter-mask {
  position: fixed;
  bottom: 0;
  z-index: 1;
  clip-path: inset(0 -40px 0);
  pointer-events: none;
}
.who-filter {
  position: relative;
  top: var(--who-scroll, 0px);
  pointer-events: auto;
  border-radius: 0 0 var(--card-radius) var(--card-radius);
  transform: translateY(var(--who-y, -100%));
  transition: transform var(--who-ease, 0ms) cubic-bezier(.2, .8, .3, 1);
}
/* Extend the surface behind the bar without adding height to the measured tab. */
.who-filter::before {
  content: "";
  position: absolute;
  inset: -100dvh 0 0;
  z-index: -1;
  pointer-events: none;
  border-radius: inherit;
  background: color-mix(in srgb, var(--who-tint, var(--surface)) 55%, var(--surface));
  box-shadow: var(--card-shadow);
}
.who-filter[data-curve="spring"],
.calendar-sections.who-filter-room { transition-timing-function: cubic-bezier(.2, .86, .32, 1); }
main:has(> #view:not(:has([data-card-expanded])) > .who-filter-mask[data-can-pull]) {
  touch-action: pan-down pinch-zoom;
}

#view:has([data-card-expanded]) .who-filter-mask { display: none; }
/* Room to scroll the tab away on a short To-do (who-filter.js sets the amount). */
main:has(> #view > .who-filter-mask):not(:has(#view [data-card-expanded])) {
  min-block-size: calc(100lvh + var(--who-stow-room, 0px));
}
/* While a swipe slides the view, the view frames this fixed layer; shift it back to where it sits under the bar. */
#view.is-page-swiping > .who-filter-mask { translate: calc(-1 * var(--swipe-origin-x, 0px)) calc(-1 * var(--swipe-origin-y, 0px)); }
/* The family's faces with their names under them, spread evenly across the tab (equal space before,
   between and after). When they don't fit they keep a 12 px gap and scroll sideways, with a fade on
   whichever side has more. Every face shows its person's colour, faded; the chosen one is full
   strength, a touch larger, and ringed in the logo's four colours. */
.who-filter-faces {
  --fade-before: 0px;
  --fade-after: 0px;
  display: flex;
  gap: 12px;
  /* The bottom padding is more than the 14 px sliver a stowed tab shows (who-filter.js `peek`), so
     no name's descender peeks out under the bar. */
  padding: 12px 14px 17px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 14px;
  scrollbar-width: none;
  -webkit-mask: linear-gradient(90deg, transparent, #000 var(--fade-before), #000 calc(100% - var(--fade-after)), transparent);
  mask: linear-gradient(90deg, transparent, #000 var(--fade-before), #000 calc(100% - var(--fade-after)), transparent);
}
.who-filter-faces::-webkit-scrollbar { display: none; }
.who-filter-faces[data-more-before] { --fade-before: 18px; }
.who-filter-faces[data-more-after] { --fade-after: 28px; }
.who-filter-faces button {
  display: grid;
  flex: none;
  justify-items: center;
  gap: 3px;
  margin-inline-start: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: 500 calc(12px * var(--font-scale)) var(--font-body);
  scroll-snap-align: start;
  cursor: pointer;
}
.who-filter-faces button:last-child { margin-inline-end: auto; }
.who-filter-faces button > span:last-child {
  max-inline-size: 7em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.who-filter-faces [aria-pressed="true"] { color: var(--ink); font-weight: 700; }
.who-filter-face {
  position: relative;
  display: grid;
  place-items: center;
  inline-size: 34px;
  block-size: 34px;
  border-radius: 50%;
  background: var(--face-bg, var(--chip));
  color: var(--face-ink, var(--ink));
  font: 600 13px/1 var(--font-body);
  opacity: .6;
  transition: opacity 160ms, scale 160ms;
}
.who-filter-faces [aria-pressed="true"] .who-filter-face { opacity: 1; scale: 1.08; }
/* The chosen face's ring takes the logo's four colours. */
.who-filter-faces [aria-pressed="true"] .who-filter-face::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: conic-gradient(from -45deg, var(--brand-orange) 0 25%, var(--brand-green) 0 50%,
    var(--brand-purple) 0 75%, var(--brand-blue) 0);
  -webkit-mask: radial-gradient(closest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  mask: radial-gradient(closest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
}
/* The cards make room under the tab, keeping the usual card gap, and follow a pull down. */
.calendar-sections.who-filter-room {
  margin-block-start: var(--who-room, 0px);
  overflow-anchor: none;
  /* Only while pulled: a transform would also catch the fixed copies cards make (a lifted card). */
  transform: var(--who-pull, none);
  transition-property: transform;
  transition-duration: var(--who-ease, 0ms);
}
#view:has([data-card-expanded]) .calendar-sections.who-filter-room { margin-block-start: 0; transform: none; }

/* A done row on its way out of Overdue (fadeDoneOverdueRows in app.js): it fades, then closes up. */
.card-row-leaving { pointer-events: none; }
/* Only while closing up, so the done check over the tile's corner isn't cut off while it fades. */
.card-row-leaving.is-closing { overflow: hidden; }

/* ---- To-do: the 7 days / This week and 30 days / month switch (renderTodoRangeHeader in app.js) ---- */
/* A small swap mark after the title (the title itself switches too). */
.todo-range-swap {
  display: inline-grid;
  place-items: center;
  flex: none;
  inline-size: 24px;
  block-size: 24px;
  margin-inline-start: 6px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  /* Quieter than the title: a faint disc and a light mark, both firming up on hover. */
  background: color-mix(in srgb, var(--chip) 35%, transparent);
  color: color-mix(in srgb, var(--muted) 42%, transparent);
  vertical-align: middle;
  cursor: pointer;
  transition: background-color 160ms, color 160ms;
}
.todo-range-swap svg { inline-size: 14px; block-size: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .todo-range-swap:hover { background: var(--chip); color: var(--ink); } }

.card-item-details > small.starter-todo-instructions { white-space: normal; }

/* ---- To-do: the introduction while nothing is due (todo-start.js) ---- */
/* It shares the Plans carousel's look (the plans-start classes); these are its differences. */
.calendar-sections[data-todo-intro] > [data-period]:not([data-card-expanded]) { display: none; }
.todo-start-lede { margin-block-start: 4px; color: var(--muted); font-size: calc(13.5px * var(--font-scale)); }
.todo-start .plans-start-index { margin-block-start: 14px; }
.todo-start .plans-start-stage { block-size: 264px; }
.todo-start-card {
  --card-size: 244px;
  --type-surface: var(--surface);
  --type-accent: var(--rose);
  /* The icon and the example row keep one place on every card, and the words start under them. */
  grid-template-rows: 124px 1fr;
}
.todo-start-card[data-step="overdue"] { --type-surface: color-mix(in srgb, var(--danger-soft) 45%, var(--surface)); --type-accent: var(--danger); }
.todo-start-card[data-step="plans"] { --type-surface: var(--feature-surface); --type-accent: var(--feature-action); }
/* Each icon in the row above takes its card's colour when it is the one in front. */
.todo-start .plans-start-index > button { --type-accent: var(--rose); }
.todo-start .plans-start-index > [data-step="overdue"] { --type-accent: var(--danger); }
.todo-start .plans-start-index > [data-step="plans"] { --type-accent: var(--feature-action); }
.todo-start-card .plans-start-caption { align-content: start; padding-block-start: 6px; }
.todo-start-card .plans-start-caption span { padding-inline-end: 0; }
.todo-start-art { position: relative; }
.todo-start-disc {
  position: absolute;
  inset: 0 auto auto 0;
  display: grid;
  place-items: center;
  inline-size: 46px;
  block-size: 46px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--type-accent) 13%, var(--type-surface));
  color: var(--type-accent);
}
.todo-start-disc svg { inline-size: 28px; block-size: 28px; }
/* The example row, drawn small inside a white strip like a slice of its card. */
.todo-start-row, .todo-start-flow {
  position: absolute;
  inset: 52px 0 auto;
  block-size: 72px;
  margin: 0;
}
.todo-start-row {
  display: grid;
  align-items: center;
  padding: 0 8px 0 10px;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--type-accent) 14%, transparent);
  overflow: hidden;
}
/* The row at 70%, its title and line under it kept to one line each. */
.todo-start-row { --card-item-column-gap: 14px; margin: 0; }
.todo-start-row > li { zoom: .7; }
.todo-start-row .card-item-details > * { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.todo-start-flow { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--type-accent); }
.todo-start-flow span {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--type-accent) 18%, transparent);
  color: var(--ink);
  font-size: calc(12.5px * var(--font-scale));
}
.todo-start-flow svg { inline-size: 16px; block-size: 16px; }
.todo-start-pager { display: flex; align-items: center; justify-content: space-between; margin-block-start: 12px; padding-inline: 4px; }
.todo-start-count { color: var(--muted); font-size: calc(13.5px * var(--font-scale)); }
.todo-start-next {
  padding: 8px 18px;
  border: 1.5px solid var(--rose);
  border-radius: 999px;
  background: transparent;
  color: var(--rose);
  font: 500 calc(14px * var(--font-scale)) var(--font-body);
}
.todo-start-next.todo-start-go { background: var(--rose); color: var(--on-accent); }

/* ---- Notes: the introduction while nothing is on a list (lists-start.js) ---- */
/* One card like a Start planning card standing still; the lists wait behind it unless an editor is open. */
[data-lists-intro] [data-shopping-lists] > [data-tab-card]:not([data-card-expanded]):not(:has(.inline-item-editor)) { display: none; }
[data-lists-intro]:has(.inline-item-editor) > .lists-start { display: none; }
.lists-start-card {
  --card-size: 272px;
  --type-surface: var(--surface);
  --type-accent: var(--rose);
  position: relative;
  inset: auto;
  margin: 16px auto 0;
  transform: none;
  cursor: default;
  /* The icon, then the example list under it; the words start under both. */
  grid-template-rows: 160px 1fr;
}
.lists-start-card .plans-start-caption { align-content: start; padding-block-start: 6px; }
.lists-start-art { position: relative; }
.lists-start-rows {
  position: absolute;
  inset: 52px 0 auto;
  block-size: 108px;
  align-content: center;
  margin: 0;
  padding: 0 12px;
  row-gap: 0;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--type-accent) 14%, transparent);
  overflow: hidden;
}
.lists-start-rows > li { zoom: .75; }
.lists-start-rows > li + li { border-block-start: 1px solid var(--line); }

/* ---- Reminders (reminder.js) ---- */
/* On someone else's To-do: a soft blue circle with a paper plane, over the date tile's right edge
   (app.js places it), the tile moved 13 px left to make room. A ring in the card's colour parts the two. */
.has-reminder { position: relative; }
.has-reminder > :is(.tile-action, .card-item-schedule) { margin-inline-end: 13px; }
.reminder-send {
  --reminder-hue: color-mix(in srgb, var(--brand-blue) 45%, var(--muted));
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  inline-size: 36px;
  block-size: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--reminder-hue) 16%, var(--surface));
  color: var(--reminder-hue);
  box-shadow: 0 0 0 2px var(--card-surface, var(--surface));
  cursor: pointer;
}
.reminder-send svg { translate: -1px .5px; }
@media (hover: hover) { .reminder-send:hover { background: color-mix(in srgb, var(--reminder-hue) 26%, var(--surface)); } }

/* The page a reminder link opens: the app's chrome stays hidden. */
html[data-reminder-page] body > :is(.app-header, main:not(.reminder-main), .bottom-controls) { display: none !important; }
html[data-reminder-page] body { display: block; }
.reminder-main { min-block-size: 100dvh; max-width: none; margin: 0; padding: 0; }
.reminder-page {
  display: flex;
  flex-direction: column;
  min-block-size: 100dvh;
  box-sizing: border-box;
  max-inline-size: 560px;
  margin-inline: auto;
  padding-block-end: calc(22px + env(safe-area-inset-bottom, 0px));
  color: var(--ink);
}
.reminder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 22px 14px;
  background: var(--nav-bg);
  border-block-end: 4px solid transparent;
  border-image: linear-gradient(90deg, var(--brand-orange) 0 25%, var(--brand-green) 0 50%, var(--brand-purple) 0 75%, var(--brand-blue) 0) 1;
}
.reminder-brand { display: flex; align-items: center; gap: 8px; color: inherit; font-weight: 700; font-size: 14px; white-space: nowrap; text-decoration: none; }
.reminder-sent-by { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; text-align: end; }
.reminder-sender-face {
  display: grid;
  flex: none;
  place-items: center;
  inline-size: 28px;
  block-size: 28px;
  border-radius: 50%;
  background: var(--person-bg, var(--chip));
  color: var(--person-ink, var(--ink));
  font: 600 11px/1 var(--font-body);
}
/* The card sits in the middle of the space between the header and the bottom actions. */
.reminder-middle { display: flex; flex: 1; flex-direction: column; justify-content: center; gap: 14px; padding-block: 18px; }
.reminder-card {
  margin: 0 20px;
  padding: 20px;
  border-radius: var(--card-radius);
  background: var(--surface);
  box-shadow: var(--card-shadow);
}
.reminder-kind { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
.reminder-kind svg, .reminder-details dt { color: var(--rose); }
.reminder-top { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: start; margin-block-start: 12px; }
.reminder-repeat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--rose);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.reminder-top h1 { margin: 6px 0 0; font: 400 calc(28px * var(--font-scale))/1.12 var(--font-heading); }
.reminder-details { display: grid; gap: 14px; margin: 20px 0 0; padding-block-start: 16px; border-block-start: 1px solid var(--line); }
.reminder-details > div { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; }
.reminder-details dd { margin: 0; font-size: calc(15px * var(--font-scale)); line-height: 1.35; }
.reminder-details small { display: block; margin-block-start: 2px; color: var(--muted); font-size: calc(13px * var(--font-scale)); }
.reminder-who { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.reminder-person {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px 3px 3px;
  border-radius: 999px;
  background: var(--person-bg, var(--chip));
  color: var(--person-ink, var(--ink));
  font-weight: 600;
  font-size: 14px;
}
.reminder-person > span {
  display: grid;
  place-items: center;
  inline-size: 24px;
  block-size: 24px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--person-ink, var(--ink)) 14%, transparent);
  font-size: 11px;
}
.reminder-actions { display: grid; gap: 10px; margin: 0 20px; }
.reminder-more { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; }
.reminder-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-block-size: 52px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  font: 600 calc(16px * var(--font-scale)) var(--font-body);
  cursor: pointer;
}
.reminder-button.primary { background: var(--rose); color: var(--on-accent, #fff); }
.reminder-button.secondary { background: var(--chip); color: var(--ink); }
.reminder-button[hidden] { display: none; }
.reminder-note { margin: 0 20px; padding: 14px 16px; border-radius: 20px; background: var(--chip); color: var(--muted); font-size: 14px; text-align: center; }
.reminder-foot { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; text-align: center; line-height: 1.4; }
.reminder-foot a { color: var(--rose); font-weight: 600; }
.reminder-done {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 20px;
  background: color-mix(in srgb, #2f8f5b 12%, var(--surface));
}
.reminder-done > svg { box-sizing: border-box; inline-size: 34px; block-size: 34px; padding: 6px; border-radius: 50%; background: var(--surface); color: #2f8f5b; }
.reminder-done small { display: block; margin-block-start: 2px; color: var(--muted); font-size: 13px; }
.reminder-undo { border: 0; background: none; color: var(--rose); font: 600 15px var(--font-body); cursor: pointer; }
.reminder-message { display: grid; justify-items: center; gap: 12px; max-inline-size: 360px; margin: 0 auto; padding: 22vh 24px 0; text-align: center; }
.reminder-message h1 { margin: 6px 0 0; font: 400 26px/1.15 var(--font-heading); }
.reminder-message p { margin: 0; color: var(--muted); }
.reminder-message a { color: var(--rose); font-weight: 600; }

/* "Send a reminder": a full-screen sheet with a small live preview of the page. */
.reminder-sender {
  inline-size: 100vw;
  max-inline-size: none;
  block-size: 100dvh;
  max-block-size: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  box-shadow: none;
  overflow-y: auto;
}
.reminder-sender[open] { display: flex; flex-direction: column; }
.reminder-sender-top {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 14px 10px;
  background: var(--nav-bg);
}
.reminder-sender-top h1 { margin: 0; text-align: center; font: 400 21px var(--font-heading); }
.reminder-sender-close { display: grid; place-items: center; inline-size: 40px; block-size: 40px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--ink); cursor: pointer; }
.reminder-preview {
  position: relative;
  flex: none;
  inline-size: 172px;
  block-size: 306px;
  margin: 14px auto 0;
  overflow: hidden;
  border-radius: 26px;
  background: var(--paper);
  box-shadow: 0 0 0 7px var(--surface), 0 0 0 8px var(--line), 0 14px 34px color-mix(in srgb, var(--shadow-color) 18%, transparent);
}
.reminder-preview-page { position: absolute; inset: 0 auto auto 0; inline-size: 390px; transform: scale(.441); transform-origin: 0 0; pointer-events: none; }
.reminder-preview-page .reminder-page { min-block-size: 694px; }
.reminder-preview-caption { margin: 10px 0 0; color: var(--muted); font-size: 12.5px; text-align: center; }
.reminder-sender-panel {
  margin: 14px 20px 0;
  padding: 4px 16px;
  border-radius: var(--card-radius);
  background: var(--surface);
  box-shadow: var(--card-shadow);
}
.reminder-sender-panel h3 { margin: 12px 0 2px; color: var(--muted); font: 600 12px var(--font-body); letter-spacing: .06em; text-transform: uppercase; }
.reminder-option { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-block-start: 1px solid var(--line); font-size: 15px; cursor: pointer; }
.reminder-sender-panel h3 + .reminder-option { border-block-start: 0; }
.reminder-option > span:first-child { display: grid; color: var(--muted); }
.reminder-option-words { display: grid; flex: 1; }
.reminder-option small { color: var(--muted); font-size: 12.5px; }
.reminder-option.is-unavailable .reminder-option-words > span { color: color-mix(in srgb, var(--ink) 45%, transparent); }
.reminder-switch {
  appearance: none;
  position: relative;
  flex: none;
  inline-size: 44px;
  block-size: 26px;
  margin: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 18%, transparent);
  cursor: pointer;
  transition: background-color 160ms;
}
.reminder-switch::after {
  content: "";
  position: absolute;
  inset: 3px auto 3px 3px;
  inline-size: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px #0003;
  transition: translate 160ms;
}
.reminder-switch:checked { background: var(--rose); }
.reminder-switch:checked::after { translate: 18px 0; }
.reminder-switch:disabled { opacity: .45; cursor: default; }
.reminder-expiry {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 12px 0 14px;
  border-block-start: 1px solid var(--line);
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.35;
}
.reminder-expiry svg { flex: none; margin-block-start: 1px; }
.reminder-expiry b { color: var(--ink); font-weight: 600; }
.reminder-sender-actions {
  position: sticky;
  inset-block-end: 0;
  display: grid;
  grid-auto-flow: column;
  grid-template-columns: 1fr;
  grid-auto-columns: auto;
  gap: 10px;
  margin-block-start: auto;
  padding: 14px 20px calc(22px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(transparent, var(--paper) 30%);
}
.reminder-sender-actions .secondary { padding-inline: 16px; }

/* Postpone, from the reminder page: a small dialog with the new date. */
.reminder-postpone {
  inline-size: min(90vw, 340px);
  margin: auto;
  padding: 20px;
  border: 0;
  border-radius: var(--card-radius);
  background: var(--surface);
  color: var(--ink);
}
.reminder-postpone h2 { margin: 0 0 14px; font: 400 22px var(--font-heading); }
.reminder-postpone input { box-sizing: border-box; inline-size: 100%; padding: 12px; border: 1px solid var(--line); border-radius: var(--field-radius, 10px); background: var(--paper); color: var(--ink); font: inherit; }
.reminder-postpone-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-block-start: 16px; }

/* ---- Sharing a list (app.js) ---- */
/* The pencil and the share button beside it: the same soft blue disc as the To-do tab's reminder button. */
[data-card-expanded] .grocery-title-line :is(.grocery-edit-action, .grocery-share-action) {
  --share-hue: color-mix(in srgb, var(--brand-blue) 45%, var(--muted));
  display: grid;
  flex: 0 0 36px;
  place-items: center;
  inline-size: 36px;
  block-size: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--share-hue) 16%, var(--surface));
  color: var(--share-hue);
  cursor: pointer;
}
[data-card-expanded] .grocery-title-line .grocery-share-action { margin-inline-start: 8px; }
.grocery-share-action svg { translate: -1px .5px; }
.grocery-share-action { display: none; }
@media (hover: hover) {
  [data-card-expanded] .grocery-title-line :is(.grocery-edit-action, .grocery-share-action):hover {
    background: color-mix(in srgb, var(--share-hue) 26%, var(--surface));
  }
}
/* In full screen, the ticked items (they come last) start under a small heading. */
[data-card-expanded] [data-card-items] > li[data-ticked-heading] { position: relative; margin-block-start: 34px; overflow: visible; }
[data-card-expanded] [data-card-items] > li[data-ticked-heading]::after {
  content: attr(data-ticked-heading);
  position: absolute;
  inset: -26px auto auto 6px;
  color: var(--muted);
  font: 600 12px var(--font-body);
  letter-spacing: .06em;
  text-transform: uppercase;
  pointer-events: none;
}

/* The page a shared list's link opens: the list in full screen under the share header, in place of the top
   bar, and an "Add an item" field in place of the assistant bar. */
html[data-list-share] body > .app-header,
html[data-list-share] .bottom-controls > .assistant-bar,
html[data-list-share] [data-card-expanded] :is(.grocery-edit-action, .grocery-share-action) { display: none !important; }
html[data-list-share] [data-card-expanded] .card-back-action { pointer-events: none; }
html[data-list-share] [data-card-expanded] .card-back-action::before { visibility: hidden; }
/* The list's pinned title row sits under the share header. */
html[data-list-share] { --list-share-header-height: calc(var(--floating-bar-inset) + var(--tab-bar-height) + var(--top-bar-padding-end)); }
html[data-list-share] [data-tab-card][data-card-expanded] { margin-block-start: var(--list-share-header-height); }
html[data-list-share] [data-card-expanded]:has(> [data-card-items]):not(:has(> .inline-item-editor)) {
  --expanded-card-header-inset: calc(var(--list-share-header-height) + var(--card-gap) / 2 + 1px);
}
.list-share-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 3;
  box-sizing: border-box;
  block-size: var(--list-share-header-height);
  padding-block: var(--floating-bar-inset) var(--top-bar-padding-end);
  font-family: var(--font-body);
  color: var(--ink);
}
/* Fills the gap between the share header and the pinned title row, so rows scrolling under it don't peek through. */
html[data-list-share] .list-share-header { box-shadow: 0 calc(var(--card-gap) / 2 + 1px) 0 var(--paper); }
.list-share-add {
  flex: 1 1 auto;
  min-inline-size: 0;
  block-size: 56px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--card-shadow);
  color: var(--muted);
  font: calc(16px * var(--font-scale)) var(--font-body);
  text-align: start;
  cursor: text;
}
.list-share-add { display: none; }
html[data-list-share] .list-share-add { display: block; }
