/**
 * Michel-OS design system (Agent L).
 *
 * UI_RESPONSIVE_SPEC §5 asks for premium rather than pastel: deep navy and
 * midnight, ivory and cream, graphite, restrained metallic gold, subtle glass.
 * The whole palette is defined once as tokens below and nothing else in this
 * file writes a raw colour, so re-theming is a change to one block.
 *
 * Three rules this file holds itself to:
 *
 *   1. Gold is an accent, never a surface. It marks one thing per screen —
 *      today, the next event, the primary action. A gold button next to a gold
 *      badge next to a gold border is how "premium" turns into "gaudy".
 *   2. Nothing is conveyed by colour alone (§8). Every state that has a colour
 *      also has a shape, an icon, or a word.
 *   3. Layouts are intentional per breakpoint (§1), not one layout stretched.
 *      The phone grid, the tablet rail and the desktop sidebar are three
 *      different arrangements of the same components.
 */

/* ========================================================== 1. tokens */

:root {
  /* Ink — the deep end of the palette. */
  --midnight:      #0a0f1c;
  --navy:          #101a2e;
  --navy-raised:   #16233c;
  --navy-line:     #22314c;
  --graphite:      #2b3242;

  /* Light — ivory and cream, never pure white; pure white against midnight
     is harsher than paper and reads as a bug report, not a family calendar. */
  --ivory:         #f5f2ea;
  --cream:         #e8e2d4;
  --muted:         #a8b0c0;
  --faint:         #6d7689;

  /* Gold — restrained. Two stops only, so it cannot sprawl. */
  --gold:          #c9a227;
  --gold-bright:   #e3c14f;
  --gold-dim:      rgba(201, 162, 39, 0.16);

  /* Meaning. Each is paired with an icon or a word wherever it is used. */
  --alert:         #e2574c;
  --alert-dim:     rgba(226, 87, 76, 0.14);
  --warn:          #e0913a;
  --warn-dim:      rgba(224, 145, 58, 0.14);
  --good:          #4fae7d;
  --good-dim:      rgba(79, 174, 125, 0.14);
  --info:          #5b8fd6;
  --info-dim:      rgba(91, 143, 214, 0.14);

  /* Glass. A blur plus a hairline, not a translucent grey box. */
  --glass:         rgba(22, 35, 60, 0.72);
  --glass-line:    rgba(245, 242, 234, 0.09);
  --glass-blur:    saturate(150%) blur(18px);

  /* Type. One family, system-first: a web font is a network round trip
     between the family and their own schedule. */
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-numeric: ui-rounded, -apple-system, 'SF Pro Rounded', 'Segoe UI', sans-serif;

  --step--1: clamp(0.78rem, 0.76rem + 0.1vw, 0.84rem);
  --step-0:  clamp(0.94rem, 0.90rem + 0.2vw, 1.02rem);
  --step-1:  clamp(1.10rem, 1.02rem + 0.4vw, 1.28rem);
  --step-2:  clamp(1.36rem, 1.20rem + 0.8vw, 1.75rem);
  --step-3:  clamp(1.70rem, 1.40rem + 1.5vw, 2.50rem);

  /* Space — a 4px scale, so nothing is 13px by accident. */
  --s1: 0.25rem;  --s2: 0.5rem;   --s3: 0.75rem;  --s4: 1rem;
  --s5: 1.5rem;   --s6: 2rem;     --s7: 3rem;     --s8: 4rem;

  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  /* Two shadows. More than two and depth stops meaning anything. */
  --lift:  0 1px 2px rgba(0,0,0,0.30), 0 6px 18px rgba(0,0,0,0.26);
  --lift-high: 0 2px 6px rgba(0,0,0,0.34), 0 20px 44px rgba(0,0,0,0.40);

  /* §8: 44px-ish touch targets, as a token so no control can forget. */
  --touch: 44px;

  /* How much of a list row the trailing chip/avatar cluster may claim. It is a
     token because the phone has to give the title more of the row than the
     desktop does, and the two grids that use it must agree. */
  --entry-meta-w: 9.5rem;

  --nav-h: 4.25rem;
  --rail-w: 5.5rem;
  --sidebar-w: 16rem;
  --shell-max: 82rem;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --fast: 140ms;
  --slow: 260ms;

  color-scheme: dark;
}

/**
 * The light theme is opt-in, not automatic.
 *
 * The visual direction in §5 is a dark one; a `prefers-color-scheme: light`
 * auto-switch would hand half the family a design nobody approved. This exists
 * for daylight legibility on a kitchen tablet and is chosen deliberately.
 */
[data-theme='light'] {
  --midnight:    #eceadf;
  --navy:        #f5f2ea;
  --navy-raised: #ffffff;
  --navy-line:   #d9d3c4;
  --graphite:    #d2ccbd;
  --ivory:       #16233c;
  --cream:       #2b3242;
  --muted:       #56607a;
  --faint:       #7c8598;
  --gold:        #9a7b12;
  --gold-bright: #b08f1b;
  --gold-dim:    rgba(154, 123, 18, 0.14);
  --glass:       rgba(255, 255, 255, 0.78);
  --glass-line:  rgba(22, 35, 60, 0.10);
  --lift:  0 1px 2px rgba(30,28,20,0.10), 0 6px 18px rgba(30,28,20,0.09);
  --lift-high: 0 2px 6px rgba(30,28,20,0.12), 0 20px 44px rgba(30,28,20,0.14);
  color-scheme: light;
}

/* ========================================================== 2. reset */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  /* The header is sticky; without this an anchor jump lands underneath it. */
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.55;
  color: var(--ivory);
  background:
    radial-gradient(1100px 640px at 82% -12%, rgba(201,162,39,0.09), transparent 62%),
    radial-gradient(900px 620px at -8% 8%, rgba(91,143,214,0.10), transparent 58%),
    var(--midnight);
  background-attachment: fixed;
  /* iOS Safari otherwise scrolls the page behind the fixed bottom nav. */
  overscroll-behavior-y: none;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 620; letter-spacing: -0.012em; }
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
p  { margin: 0 0 var(--s3); }
ul, ol { margin: 0; padding: 0; list-style: none; }

img, svg { display: block; max-width: 100%; }

a { color: var(--gold-bright); text-decoration-thickness: 1px; text-underline-offset: 2px; }

button, input, select, textarea { font: inherit; color: inherit; }

/**
 * §8: a visible focus ring, everywhere, always.
 *
 * `:focus-visible` rather than `:focus` so a mouse click does not leave a ring
 * behind — which is the reason people disable focus rings, and the reason
 * keyboard users then cannot see where they are.
 */
:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/** §8: reduced motion is honoured properly — transitions collapse, not break. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/** Visible to a screen reader, invisible on screen. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/** The first thing keyboard focus reaches, so the nav can be skipped. */
.skip-link {
  position: absolute; left: var(--s3); top: -100%; z-index: 100;
  padding: var(--s3) var(--s4);
  background: var(--navy-raised); color: var(--ivory);
  border: 1px solid var(--gold); border-radius: var(--radius);
  transition: top var(--fast) var(--ease);
}
.skip-link:focus { top: var(--s3); }

/* ========================================================== 3. shell */

.shell { display: flex; flex-direction: column; min-height: 100dvh; }

.shell__body {
  flex: 1;
  width: 100%;
  max-width: var(--shell-max);
  margin-inline: auto;
  padding: var(--s4) var(--s4) calc(var(--nav-h) + env(safe-area-inset-bottom) + var(--s5));
}

/* -- top bar -------------------------------------------------------- */

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s4);
  padding-top: calc(var(--s3) + env(safe-area-inset-top));
  background: var(--glass);
  border-bottom: 1px solid var(--glass-line);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}

.topbar__title { font-size: var(--step-1); font-weight: 640; letter-spacing: -0.015em; }
.topbar__spacer { flex: 1; }

.topbar__back {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--touch); height: var(--touch);
  margin-inline-start: calc(var(--s2) * -1);
  border: 0; background: none; color: var(--cream); cursor: pointer;
  border-radius: var(--radius-pill);
}
.topbar__back:hover { background: rgba(245,242,234,0.07); }

/* -- bottom navigation (phone) --------------------------------------- */

.tabbar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--glass);
  border-top: 1px solid var(--glass-line);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}

.tabbar__item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; min-height: var(--nav-h);
  color: var(--muted); text-decoration: none; font-size: 0.66rem; letter-spacing: 0.01em;
  border: 0; background: none; cursor: pointer;
  transition: color var(--fast) var(--ease);
}
.tabbar__item[aria-current='page'] { color: var(--gold-bright); }

/* The current tab is marked by a dot as well as a colour — §8 again. */
.tabbar__item[aria-current='page']::after {
  content: ''; width: 4px; height: 4px; border-radius: 50%;
  background: var(--gold-bright);
}

.tabbar__icon { width: 22px; height: 22px; stroke-width: 1.6; }

/** The centre "Add" tab, raised out of the bar. */
.tabbar__item--primary .tabbar__icon {
  width: 46px; height: 46px; padding: 11px; margin-top: -14px;
  color: var(--midnight);
  background: linear-gradient(160deg, var(--gold-bright), var(--gold));
  border-radius: var(--radius-pill);
  box-shadow: var(--lift);
}
.tabbar__item--primary { color: var(--cream); }

/* -- rail (tablet) and sidebar (desktop) ----------------------------- */

.sidenav { display: none; }

/* ========================================================== 4. home */

.brief {
  position: relative;
  padding: var(--s5) var(--s4);
  margin-bottom: var(--s5);
  background: linear-gradient(155deg, var(--navy-raised), var(--navy) 68%);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--lift);
  overflow: hidden;
}

/* One gold hairline along the top edge — the accent, used once. */
.brief::before {
  content: ''; position: absolute; inset-inline: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.brief__greeting { font-size: var(--step-2); margin-bottom: var(--s1); }
.brief__date { color: var(--muted); font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.08em; }

/**
 * Four figures across on anything wider than a very small phone, two-by-two
 * below that.
 *
 * `minmax(0, 1fr)` rather than a minimum width: with a floor of 4.5rem the
 * fourth column overflowed its own box at 390px and clipped the word
 * "CONFLICTS" — the one figure on the row that most needs to be readable.
 */
.brief__stats {
  display: grid; gap: var(--s2);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: var(--s4);
}
@media (max-width: 22.5rem) {
  .brief__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.stat {
  min-width: 0;
  padding: var(--s3) var(--s2);
  background: rgba(245,242,234,0.045);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  text-align: center;
}
.stat__value { display: block; font-family: var(--font-numeric); font-size: var(--step-2); font-weight: 680; font-variant-numeric: tabular-nums; }
/**
 * One line, never broken mid-word.
 *
 * These are four columns on a 390px phone, so there is room for about seven
 * characters. Wrapping produced "REMINDER / S", which is worse than either
 * fitting or truncating — so the labels themselves are short (see home.js) and
 * this refuses to break them.
 */
.stat__label {
  display: block; color: var(--muted);
  font-size: 0.64rem; line-height: 1.3;
  text-transform: uppercase; letter-spacing: 0.03em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stat--alert .stat__value { color: var(--alert); }
.stat--gold  .stat__value { color: var(--gold-bright); }

/* -- mini-app grid ---------------------------------------------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s4) var(--s3);
}

.tile {
  display: flex; flex-direction: column; align-items: center; gap: var(--s2);
  padding: var(--s2) var(--s1);
  color: var(--cream); text-decoration: none; text-align: center;
  border-radius: var(--radius);
  transition: transform var(--fast) var(--ease);
  /* iOS shows a grey flash on tap; the scale below is the feedback instead. */
  -webkit-tap-highlight-color: transparent;
}
.tile:active { transform: scale(0.955); }

.tile__art {
  position: relative;
  width: 100%; max-width: 5.5rem; aspect-ratio: 1;
  border-radius: var(--radius-lg);
  background: linear-gradient(155deg, var(--navy-raised), var(--navy));
  border: 1px solid var(--navy-line);
  box-shadow: var(--lift);
  overflow: hidden;
}
.tile__art img { width: 100%; height: 100%; object-fit: contain; }

.tile:hover .tile__art { border-color: var(--gold-dim); }

.tile__label { font-size: 0.78rem; line-height: 1.25; font-weight: 520; }

/** A count of things needing attention, on the corner of a tile. */
.tile__badge {
  position: absolute; top: 6px; inset-inline-end: 6px;
  min-width: 21px; height: 21px; padding: 0 5px;
  display: grid; place-items: center;
  font-family: var(--font-numeric); font-size: 0.7rem; font-weight: 700;
  color: var(--ivory); background: var(--alert);
  border-radius: var(--radius-pill);
  box-shadow: 0 0 0 2px var(--navy);
}

/**
 * Artwork awaiting final approval is marked in the UI, not only in a document.
 * ASSET_MAP.md says placeholders must not ship silently as final; a note in a
 * markdown file is silent, a corner tag on the tile is not.
 *
 * A corner tag rather than a full-width band across the bottom: nine of the
 * thirteen tiles currently carry this, and a band that wide stopped reading as
 * a note about the art and started reading as part of the design. The word is
 * still there — a coloured corner alone would convey it by colour only, which
 * UI_RESPONSIVE_SPEC §8 forbids — and the full sentence is on the tile's
 * `title` and in a screen-reader-only span beside the label.
 */
.tile__art--placeholder::after {
  content: 'DRAFT';
  position: absolute; top: 5px; inset-inline-start: 5px;
  padding: 1px 5px;
  font-size: 0.47rem; font-weight: 700; letter-spacing: 0.08em;
  color: var(--midnight); background: var(--gold-bright);
  border-radius: var(--radius-pill);
}

/* ========================================================== 5. cards */

.card {
  padding: var(--s4);
  background: var(--navy-raised);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius);
  box-shadow: var(--lift);
}

.card + .card { margin-top: var(--s3); }

.card__head {
  display: flex; align-items: baseline; gap: var(--s3);
  margin-bottom: var(--s3);
}
.card__title { font-size: var(--step-1); }
.card__meta { margin-inline-start: auto; color: var(--muted); font-size: var(--step--1); font-variant-numeric: tabular-nums; }

.section { margin-bottom: var(--s6); }
.section__head { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s3); }
.section__title { font-size: var(--step-1); }
.section__action { margin-inline-start: auto; }

/* -- an event or shift in a list -------------------------------------- */

.entry {
  display: grid;
  /* The last track is capped rather than `auto`. A max-content track sized to a
     clash chip plus four avatars wins every fight against a `1fr` sibling, and
     the title column is what loses — it collapses to one word per line. */
  grid-template-columns: 4.25rem minmax(0, 1fr) minmax(0, var(--entry-meta-w));
  align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s4);
  background: var(--navy-raised);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius);
  text-align: start; width: 100%;
  color: inherit; text-decoration: none;
  cursor: pointer;
}
.entry + .entry { margin-top: var(--s2); }

.entry__time {
  font-family: var(--font-numeric); font-variant-numeric: tabular-nums;
  font-size: var(--step--1); color: var(--muted); line-height: 1.25;
}
.entry__time strong { display: block; color: var(--ivory); font-size: var(--step-0); font-weight: 640; }

.entry__title { font-weight: 560; }
.entry__sub { color: var(--muted); font-size: var(--step--1); }

/** The next thing happening. The one gold element on the home screen. */
.entry--next { border-color: var(--gold); background: linear-gradient(120deg, var(--gold-dim), var(--navy-raised) 42%); }

/* Conflicts get a colour AND a left bar AND the word — never colour alone. */
.entry--conflict { border-inline-start: 3px solid var(--alert); }

/* ========================================================== 6. controls */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: var(--touch); padding: 0 var(--s4);
  font-size: var(--step-0); font-weight: 580;
  color: var(--ivory);
  background: rgba(245,242,234,0.07);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-pill);
  /* `.btn` is used on <a> as often as on <button>; without this the global
     anchor underline draws straight through every link-shaped button. */
  text-decoration: none;
  cursor: pointer;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover:not(:disabled) { background: rgba(245,242,234,0.12); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn--primary {
  color: var(--midnight);
  background: linear-gradient(160deg, var(--gold-bright), var(--gold));
  border-color: transparent;
  box-shadow: var(--lift);
}
.btn--primary:hover:not(:disabled) { background: linear-gradient(160deg, #eccf67, var(--gold-bright)); }

.btn--quiet { background: none; border-color: transparent; color: var(--muted); }
.btn--quiet:hover:not(:disabled) { color: var(--ivory); background: rgba(245,242,234,0.07); }

.btn--danger { color: var(--alert); border-color: var(--alert-dim); background: var(--alert-dim); }

.btn--block { width: 100%; }

/* -- fields ----------------------------------------------------------- */

.field { display: block; margin-bottom: var(--s4); }
.field__label { display: block; margin-bottom: var(--s2); font-size: var(--step--1); font-weight: 560; color: var(--cream); }
.field__hint { margin-top: var(--s2); font-size: var(--step--1); color: var(--faint); }

.input, .select, .textarea {
  width: 100%; min-height: var(--touch);
  padding: var(--s3);
  color: var(--ivory);
  background: var(--midnight);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-sm);
  transition: border-color var(--fast) var(--ease);
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--graphite); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--gold); outline-offset: 1px; }
.textarea { min-height: 6rem; resize: vertical; }

.input::placeholder, .textarea::placeholder { color: var(--faint); }

/* An invalid field is outlined AND carries a message — §8. */
.field--invalid .input, .field--invalid .select, .field--invalid .textarea { border-color: var(--alert); }
.field__error { margin-top: var(--s2); font-size: var(--step--1); color: var(--alert); }

/* -- chips / badges ---------------------------------------------------- */

.chip {
  display: inline-flex; align-items: center; gap: var(--s1);
  padding: 3px var(--s3);
  font-size: var(--step--1); font-weight: 560;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  white-space: nowrap;
}
.chip--alert { color: var(--alert); background: var(--alert-dim); border-color: var(--alert-dim); }
.chip--warn  { color: var(--warn);  background: var(--warn-dim);  border-color: var(--warn-dim); }
.chip--good  { color: var(--good);  background: var(--good-dim);  border-color: var(--good-dim); }
.chip--info  { color: var(--info);  background: var(--info-dim);  border-color: var(--info-dim); }
.chip--gold  { color: var(--gold-bright); background: var(--gold-dim); border-color: var(--gold-dim); }
.chip--quiet { color: var(--muted); background: rgba(245,242,234,0.06); }

/** A person, in their colour, with their initial — never colour alone. */
.who {
  display: inline-grid; place-items: center;
  width: 1.7rem; height: 1.7rem;
  font-size: 0.72rem; font-weight: 700; color: var(--midnight);
  background: var(--cream);
  border-radius: var(--radius-pill);
  box-shadow: 0 0 0 1px var(--navy);
}

.who-row { display: flex; flex: 0 0 auto; }
.who-row .who + .who { margin-inline-start: -0.45rem; }
/* "+2" is a count, so it does not take a member colour to be mistaken for one. */
.who--more { background: var(--graphite); color: var(--navy); font-variant-numeric: tabular-nums; }

/* ========================================================== 7. states */

/**
 * §9 requires five states on every major page. They are components rather
 * than per-page markup so that no screen can quietly ship with four of them.
 */

.state {
  display: flex; flex-direction: column; align-items: center; gap: var(--s3);
  padding: var(--s7) var(--s4);
  text-align: center;
  color: var(--muted);
}
.state__title { color: var(--ivory); font-size: var(--step-1); }
.state__body { max-width: 32ch; }

.state--error .state__title { color: var(--alert); }
.state--denied .state__title { color: var(--warn); }

/** The loading skeleton. Shape first, so the page does not jump when it fills. */
.skeleton {
  background: linear-gradient(90deg, rgba(245,242,234,0.05) 25%, rgba(245,242,234,0.11) 37%, rgba(245,242,234,0.05) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s var(--ease) infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

.skeleton--line { height: 0.85rem; margin-bottom: var(--s2); }
.skeleton--entry { height: 4.25rem; margin-bottom: var(--s2); border-radius: var(--radius); }
.skeleton--tile { aspect-ratio: 1; border-radius: var(--radius-lg); }

/** A transient message. Announced politely, so it does not interrupt. */
.toast-rail {
  position: fixed; z-index: 60;
  inset-inline: var(--s4);
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + var(--s3));
  display: flex; flex-direction: column; gap: var(--s2);
  pointer-events: none;
}
.toast {
  padding: var(--s3) var(--s4);
  background: var(--glass); color: var(--ivory);
  border: 1px solid var(--glass-line); border-radius: var(--radius);
  box-shadow: var(--lift-high);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  pointer-events: auto;
  animation: rise var(--slow) var(--ease);
}
.toast--error { border-inline-start: 3px solid var(--alert); }
.toast--good  { border-inline-start: 3px solid var(--good); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ========================================================== 8. sheet */

/**
 * A bottom sheet on a phone, a centred dialog from tablet up (§2, §3).
 * One component, two arrangements — not two components.
 */
.sheet {
  position: fixed; inset: 0; z-index: 70;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(6, 10, 20, 0.62);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.sheet[hidden] { display: none; }

.sheet__panel {
  width: 100%; max-height: 92dvh; overflow-y: auto;
  padding: var(--s5) var(--s4) calc(var(--s5) + env(safe-area-inset-bottom));
  background: var(--navy);
  border-top: 1px solid var(--navy-line);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--lift-high);
  animation: sheet-up var(--slow) var(--ease);
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }

.sheet__grip {
  width: 2.5rem; height: 4px; margin: 0 auto var(--s4);
  background: var(--graphite); border-radius: var(--radius-pill);
}
.sheet__title { margin-bottom: var(--s4); font-size: var(--step-2); }

/* ========================================================== 9. tables */

/**
 * §2 forbids dense desktop tables on a phone, so a table becomes a stack of
 * labelled rows below the tablet breakpoint. `data-label` on each cell carries
 * the header text down with it.
 */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th {
  padding: var(--s2) var(--s3);
  font-size: var(--step--1); font-weight: 600; text-align: start;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em;
  border-bottom: 1px solid var(--navy-line);
}
.table td { padding: var(--s3); border-bottom: 1px solid var(--navy-line); }
.table .num { text-align: end; font-family: var(--font-numeric); }

@media (max-width: 47.9375rem) {
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table thead { display: none; }
  .table tr {
    margin-bottom: var(--s2); padding: var(--s2) var(--s3);
    background: var(--navy-raised);
    border: 1px solid var(--navy-line); border-radius: var(--radius);
  }
  .table td { display: flex; gap: var(--s3); border: 0; padding: var(--s1) 0; }
  .table td::before {
    content: attr(data-label);
    flex: 0 0 8rem; color: var(--muted); font-size: var(--step--1);
  }
  .table .num { text-align: start; }
}

/* ========================================================== 10. money */

/**
 * Money is always tabular and never wraps mid-figure. A column of prices that
 * does not line up is a column people re-read.
 */
.money { font-family: var(--font-numeric); font-variant-numeric: tabular-nums; white-space: nowrap; }
.money--neg { color: var(--alert); }
.money--pos { color: var(--good); }

/* ================================================ 11. breakpoints */

/**
 * Three intentional layouts, not one stretched (§1).
 *
 *   < 48rem   phone      3-column grid, bottom tab bar
 *   48–74rem  tablet     5-column grid, left rail, two-column dashboards
 *   ≥ 74rem   desktop    labelled sidebar, wider content, side panels
 */

/* -- tablet ------------------------------------------------------------ */
@media (min-width: 48rem) {
  .shell { flex-direction: row; }

  .tabbar { display: none; }

  .sidenav {
    position: sticky; top: 0; z-index: 30;
    display: flex; flex-direction: column; gap: var(--s2);
    flex: 0 0 var(--rail-w);
    height: 100dvh; padding: var(--s4) var(--s2);
    background: var(--glass);
    border-inline-end: 1px solid var(--glass-line);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
  }

  .sidenav__item {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; min-height: 3.5rem; padding: var(--s2);
    color: var(--muted); text-decoration: none; font-size: 0.66rem;
    border: 0; background: none; cursor: pointer;
    border-radius: var(--radius);
  }
  .sidenav__item:hover { background: rgba(245,242,234,0.07); color: var(--ivory); }
  .sidenav__item[aria-current='page'] { color: var(--gold-bright); background: var(--gold-dim); }
  .sidenav__icon { width: 22px; height: 22px; stroke-width: 1.6; }
  .sidenav__label { display: block; }

  .shell__body { padding: var(--s5) var(--s5) var(--s7); }

  .grid { grid-template-columns: repeat(5, 1fr); gap: var(--s5) var(--s4); }
  .tile__art { max-width: 6rem; }

  .toast-rail { inset-inline: auto var(--s5); bottom: var(--s5); width: min(24rem, 40vw); }

  /* Master/detail: the list and the thing selected from it, side by side. */
  .split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s4); align-items: start; }
  .split--wide-detail { grid-template-columns: minmax(0, 22rem) minmax(0, 1fr); }

  .dash { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }

  /* A sheet becomes a centred dialog rather than sliding from the bottom. */
  .sheet { align-items: center; }
  .sheet__panel {
    width: min(34rem, 92vw); max-height: 84dvh;
    border-radius: var(--radius-lg);
    border: 1px solid var(--navy-line);
    animation-name: fade-in;
  }
  .sheet__grip { display: none; }
  @keyframes fade-in { from { opacity: 0; transform: scale(0.985); } to { opacity: 1; transform: none; } }
}

/* -- desktop ----------------------------------------------------------- */
@media (min-width: 74rem) {
  .sidenav { flex-basis: var(--sidebar-w); padding: var(--s5) var(--s3); }
  .sidenav__item {
    flex-direction: row; justify-content: flex-start; gap: var(--s3);
    min-height: var(--touch); padding: var(--s2) var(--s3);
    font-size: var(--step-0);
  }

  .shell__body { padding: var(--s6) var(--s6) var(--s8); }

  .grid { grid-template-columns: repeat(6, 1fr); }

  .dash--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .split--wide-detail { grid-template-columns: minmax(0, 26rem) minmax(0, 1fr); }

  /* A detail panel beside the list rather than over it. */
  .panel {
    position: sticky; top: var(--s5);
    max-height: calc(100dvh - var(--s8));
    overflow-y: auto;
  }
}

/* -- very small phones (320px) ------------------------------------------ */
@media (max-width: 22.5rem) {
  /* Below this the 3-column grid puts labels on three lines. Two columns keeps
     the tiles legible instead of technically fitting. */
  .grid { grid-template-columns: repeat(2, 1fr); }
  .shell__body { padding-inline: var(--s3); }
  .entry { grid-template-columns: 3.5rem 1fr; }
  .entry > :last-child:not(.entry__title):not(.entry__time) { grid-column: 1 / -1; }
}

/* -- print --------------------------------------------------------------- */
@media print {
  .topbar, .tabbar, .sidenav, .toast-rail, .btn { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .entry { border-color: #ccc; box-shadow: none; }
}

/* ========================================================= 12. utility */

.stack > * + * { margin-top: var(--s3); }
.row { display: flex; align-items: center; gap: var(--s3); }
.row--wrap { flex-wrap: wrap; }
.row--end { justify-content: flex-end; }
.push { margin-inline-start: auto; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.tiny { font-size: var(--step--1); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }

/* ========================================================================
   13. Warm editorial redesign

   Presentation-only layer approved August 2026. The existing domain/API
   engine is intentionally untouched. These overrides preserve the original
   component contract while changing its visual language, motion, and skins.
   ======================================================================== */

:root {
  --midnight: #f7f1e8;
  --navy: #fbf7f0;
  --navy-raised: #fffdf9;
  --navy-line: #e7dccd;
  --graphite: #c9bcab;

  --ivory: #211f1c;
  --cream: #403a34;
  --muted: #756d64;
  --faint: #9a9187;

  --gold: #c59b67;
  --gold-bright: #d5b486;
  --gold-dim: rgba(197, 155, 103, 0.16);

  --alert: #b85f50;
  --alert-dim: rgba(184, 95, 80, 0.12);
  --warn: #be7b25;
  --warn-dim: rgba(190, 123, 37, 0.12);
  --good: #6f9872;
  --good-dim: rgba(111, 152, 114, 0.14);
  --info: #607fa6;
  --info-dim: rgba(96, 127, 166, 0.12);

  --glass: rgba(255, 253, 249, 0.9);
  --glass-line: rgba(71, 59, 46, 0.10);
  --glass-blur: saturate(125%) blur(20px);

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-display: Georgia, 'Times New Roman', Times, serif;
  --font-numeric: ui-rounded, -apple-system, 'SF Pro Rounded', 'Segoe UI', sans-serif;

  --radius-sm: 14px;
  --radius: 20px;
  --radius-lg: 28px;
  --lift: 0 1px 2px rgba(92, 67, 43, 0.04), 0 10px 26px rgba(92, 67, 43, 0.09);
  --lift-high: 0 4px 10px rgba(92, 67, 43, 0.08), 0 28px 58px rgba(92, 67, 43, 0.15);
  --nav-h: 4.6rem;

  --season-a: transparent;
  --season-b: transparent;
  --season-c: transparent;
  /* Classic has no wallpaper. Each skin below sets one. */
  --season-motif: none;
  --season-tile: 260px;
  /* How strongly the wallpaper reads. It comes down as the viewport grows —
     see the breakpoint note under `body::before`. */
  --season-motif-strength: 0.5;

  color-scheme: light;
}

/**
 * The seasonal skins.
 *
 * Each one moves three things: the canvas it is all sitting on, the hairline
 * that separates the cards from it, and the corner washes. The canvas is what
 * makes a skin read as a skin — three translucent gradients over an unchanged
 * ivory measured out at roughly one part in 255, which is a change nobody can
 * see on a phone in daylight.
 *
 * What they deliberately do NOT do is repaint the gold. It is the primary
 * action colour on every screen — the Add button, the submit, the next event —
 * and a red one in December is a different product, not a seasonal skin. Gold
 * moves only far enough to sit correctly on the season's canvas.
 */
html[data-skin='christmas'] {
  --season-motif: url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22260%22%20height%3D%22260%22%20viewBox%3D%220%200%20260%20260%22%3E%3Cg%20fill%3D%22none%22%20stroke%3D%22%232f5741%22%20stroke-width%3D%221.1%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20opacity%3D%221%22%3E%3Cg%20transform%3D%22translate%2838%2052%29%20rotate%28-14%29%20scale%281%29%22%3E%3Cpath%20d%3D%22M0%20-20%20L0%2020%20M0%20-13%20L-8%20-8%20M0%20-13%20L8%20-8%20M0%20-6%20L-9%200%20M0%20-6%20L9%200%20M0%201%20L-8%207%20M0%201%20L8%207%20M0%208%20L-6%2013%20M0%208%20L6%2013%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate%28178%2034%29%20rotate%2811%29%20scale%280.8%29%22%3E%3Cpath%20d%3D%22M0%20-20%20L0%2020%20M0%20-13%20L-8%20-8%20M0%20-13%20L8%20-8%20M0%20-6%20L-9%200%20M0%20-6%20L9%200%20M0%201%20L-8%207%20M0%201%20L8%207%20M0%208%20L-6%2013%20M0%208%20L6%2013%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate%28112%20158%29%20rotate%28-5%29%20scale%280.9%29%22%3E%3Cpath%20d%3D%22M0%20-20%20L0%2020%20M0%20-13%20L-8%20-8%20M0%20-13%20L8%20-8%20M0%20-6%20L-9%200%20M0%20-6%20L9%200%20M0%201%20L-8%207%20M0%201%20L8%207%20M0%208%20L-6%2013%20M0%208%20L6%2013%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate%28232%20128%29%20rotate%2819%29%20scale%280.72%29%22%3E%3Cpath%20d%3D%22M0%20-20%20L0%2020%20M0%20-13%20L-8%20-8%20M0%20-13%20L8%20-8%20M0%20-6%20L-9%200%20M0%20-6%20L9%200%20M0%201%20L-8%207%20M0%201%20L8%207%20M0%208%20L-6%2013%20M0%208%20L6%2013%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate%28150%2096%29%20rotate%280%29%20scale%280.85%29%22%3E%3Cpath%20d%3D%22M0%20-9%20L0%209%20M-7.8%20-4.5%20L7.8%204.5%20M-7.8%204.5%20L7.8%20-4.5%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate%2858%20190%29%20rotate%280%29%20scale%280.7%29%22%3E%3Cpath%20d%3D%22M0%20-9%20L0%209%20M-7.8%20-4.5%20L7.8%204.5%20M-7.8%204.5%20L7.8%20-4.5%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate%28216%20210%29%20rotate%280%29%20scale%280.6%29%22%3E%3Cpath%20d%3D%22M0%20-9%20L0%209%20M-7.8%20-4.5%20L7.8%204.5%20M-7.8%204.5%20L7.8%20-4.5%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate%2896%2016%29%20rotate%280%29%20scale%280.5%29%22%3E%3Cpath%20d%3D%22M0%20-9%20L0%209%20M-7.8%20-4.5%20L7.8%204.5%20M-7.8%204.5%20L7.8%20-4.5%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E);
  --midnight: #eef1e9;
  --navy: #f7f6ef;
  --navy-line: #dae0d2;
  --season-a: rgba(38, 88, 63, 0.30);
  --season-b: rgba(150, 44, 40, 0.18);
  --season-c: rgba(206, 172, 116, 0.28);
  --gold: #bd8f5c;
  --gold-bright: #d0aa79;
}

html[data-skin='halloween'] {
  --season-motif: url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22260%22%20height%3D%22260%22%20viewBox%3D%220%200%20260%20260%22%3E%3Cg%20fill%3D%22none%22%20stroke%3D%22%235c4763%22%20stroke-width%3D%221.1%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20opacity%3D%221%22%3E%3Cg%20transform%3D%22translate%2846%2058%29%20rotate%28-8%29%20scale%281%29%22%3E%3Cpath%20d%3D%22M-14%2018%20C%20-6%206%2C%20-2%20-4%2C%204%20-18%20M-8%208%20L-17%202%20M-4%200%20L6%20-6%20M-11%2014%20L-19%2011%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate%28186%20168%29%20rotate%28172%29%20scale%280.85%29%22%3E%3Cpath%20d%3D%22M-14%2018%20C%20-6%206%2C%20-2%20-4%2C%204%20-18%20M-8%208%20L-17%202%20M-4%200%20L6%20-6%20M-11%2014%20L-19%2011%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate%28124%20226%29%20rotate%2814%29%20scale%280.7%29%22%3E%3Cpath%20d%3D%22M-14%2018%20C%20-6%206%2C%20-2%20-4%2C%204%20-18%20M-8%208%20L-17%202%20M-4%200%20L6%20-6%20M-11%2014%20L-19%2011%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate%28168%2044%29%20rotate%280%29%20scale%280.9%29%22%3E%3Cpath%20d%3D%22M4.5%20-11%20a%2011%2011%200%201%200%200%2022%20a%207%207%200%201%201%200%20-22%20z%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate%2852%20168%29%20rotate%280%29%20scale%280.62%29%22%3E%3Cpath%20d%3D%22M4.5%20-11%20a%2011%2011%200%201%200%200%2022%20a%207%207%200%201%201%200%20-22%20z%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate%28238%20118%29%20rotate%280%29%20scale%280.55%29%22%3E%3Cpath%20d%3D%22M0%20-9%20L0%209%20M-7.8%20-4.5%20L7.8%204.5%20M-7.8%204.5%20L7.8%20-4.5%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate%28104%20120%29%20rotate%280%29%20scale%280.42%29%22%3E%3Cpath%20d%3D%22M0%20-9%20L0%209%20M-7.8%20-4.5%20L7.8%204.5%20M-7.8%204.5%20L7.8%20-4.5%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E);
  --midnight: #f3ece4;
  --navy: #faf5ee;
  --navy-line: #e2d6c8;
  --season-a: rgba(86, 55, 93, 0.30);
  --season-b: rgba(190, 106, 30, 0.26);
  --season-c: rgba(66, 54, 47, 0.18);
  --gold: #b07c3c;
  --gold-bright: #c7954f;
}

html[data-skin='valentines'] {
  --season-motif: url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22260%22%20height%3D%22260%22%20viewBox%3D%220%200%20260%20260%22%3E%3Cg%20fill%3D%22none%22%20stroke%3D%22%239c5a66%22%20stroke-width%3D%221.1%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20opacity%3D%221%22%3E%3Cg%20transform%3D%22translate%2840%2054%29%20rotate%28-16%29%20scale%281%29%22%3E%3Cpath%20d%3D%22M-2%2020%20C%20-1%208%2C%200%20-4%2C%203%20-18%22%2F%3E%3Cpath%20d%3D%22M-1%2012%20c%20-7%20-1%20-10%20-6%20-8%20-10%20c%205%200%208%205%208%2010%20z%22%2F%3E%3Cpath%20d%3D%22M0%204%20c%207%20-1%2010%20-6%208%20-10%20c%20-5%200%20-8%205%20-8%2010%20z%22%2F%3E%3Cpath%20d%3D%22M1%20-4%20c%20-6%20-1%20-9%20-5%20-7%20-9%20c%204%200%207%204%207%209%20z%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate%28180%20160%29%20rotate%2812%29%20scale%280.85%29%22%3E%3Cpath%20d%3D%22M-2%2020%20C%20-1%208%2C%200%20-4%2C%203%20-18%22%2F%3E%3Cpath%20d%3D%22M-1%2012%20c%20-7%20-1%20-10%20-6%20-8%20-10%20c%205%200%208%205%208%2010%20z%22%2F%3E%3Cpath%20d%3D%22M0%204%20c%207%20-1%2010%20-6%208%20-10%20c%20-5%200%20-8%205%20-8%2010%20z%22%2F%3E%3Cpath%20d%3D%22M1%20-4%20c%20-6%20-1%20-9%20-5%20-7%20-9%20c%204%200%207%204%207%209%20z%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate%28240%2044%29%20rotate%28-6%29%20scale%280.7%29%22%3E%3Cpath%20d%3D%22M-2%2020%20C%20-1%208%2C%200%20-4%2C%203%20-18%22%2F%3E%3Cpath%20d%3D%22M-1%2012%20c%20-7%20-1%20-10%20-6%20-8%20-10%20c%205%200%208%205%208%2010%20z%22%2F%3E%3Cpath%20d%3D%22M0%204%20c%207%20-1%2010%20-6%208%20-10%20c%20-5%200%20-8%205%20-8%2010%20z%22%2F%3E%3Cpath%20d%3D%22M1%20-4%20c%20-6%20-1%20-9%20-5%20-7%20-9%20c%204%200%207%204%207%209%20z%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate%28150%2088%29%20rotate%28-8%29%20scale%280.85%29%22%3E%3Cpath%20d%3D%22M0%2011%20C%20-7%204%2C%20-11%200%2C%20-11%20-4%20a%205.6%205.6%200%200%201%2011%20-2.4%20a%205.6%205.6%200%200%201%2011%202.4%20c%200%204%20-4%208%20-11%2015%20z%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate%2862%20196%29%20rotate%2812%29%20scale%280.68%29%22%3E%3Cpath%20d%3D%22M0%2011%20C%20-7%204%2C%20-11%200%2C%20-11%20-4%20a%205.6%205.6%200%200%201%2011%20-2.4%20a%205.6%205.6%200%200%201%2011%202.4%20c%200%204%20-4%208%20-11%2015%20z%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate%28212%20226%29%20rotate%28-4%29%20scale%280.55%29%22%3E%3Cpath%20d%3D%22M0%2011%20C%20-7%204%2C%20-11%200%2C%20-11%20-4%20a%205.6%205.6%200%200%201%2011%20-2.4%20a%205.6%205.6%200%200%201%2011%202.4%20c%200%204%20-4%208%20-11%2015%20z%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E);
  --midnight: #f8eeec;
  --navy: #fdf6f4;
  --navy-line: #ebd8d6;
  --season-a: rgba(178, 88, 104, 0.26);
  --season-b: rgba(214, 156, 162, 0.30);
  --season-c: rgba(201, 151, 117, 0.22);
  --gold: #c2848a;
  --gold-bright: #d5a3a6;
}

html[data-skin='spring'] {
  --season-motif: url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22260%22%20height%3D%22260%22%20viewBox%3D%220%200%20260%20260%22%3E%3Cg%20fill%3D%22none%22%20stroke%3D%22%235b7a55%22%20stroke-width%3D%221.1%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20opacity%3D%221%22%3E%3Cg%20transform%3D%22translate%2838%2050%29%20rotate%28-12%29%20scale%281%29%22%3E%3Cpath%20d%3D%22M0%2020%20L0%20-18%22%2F%3E%3Cpath%20d%3D%22M0%2010%20c%20-8%20-1%20-11%20-7%20-9%20-11%20c%206%200%209%206%209%2011%20z%22%2F%3E%3Cpath%20d%3D%22M0%201%20c%208%20-1%2011%20-7%209%20-11%20c%20-6%200%20-9%206%20-9%2011%20z%22%2F%3E%3Cpath%20d%3D%22M0%20-8%20c%20-6%20-1%20-9%20-5%20-7%20-9%20c%205%200%207%205%207%209%20z%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate%28178%20150%29%20rotate%2810%29%20scale%280.85%29%22%3E%3Cpath%20d%3D%22M0%2020%20L0%20-18%22%2F%3E%3Cpath%20d%3D%22M0%2010%20c%20-8%20-1%20-11%20-7%20-9%20-11%20c%206%200%209%206%209%2011%20z%22%2F%3E%3Cpath%20d%3D%22M0%201%20c%208%20-1%2011%20-7%209%20-11%20c%20-6%200%20-9%206%20-9%2011%20z%22%2F%3E%3Cpath%20d%3D%22M0%20-8%20c%20-6%20-1%20-9%20-5%20-7%20-9%20c%205%200%207%205%207%209%20z%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate%28120%20232%29%20rotate%28-6%29%20scale%280.72%29%22%3E%3Cpath%20d%3D%22M0%2020%20L0%20-18%22%2F%3E%3Cpath%20d%3D%22M0%2010%20c%20-8%20-1%20-11%20-7%20-9%20-11%20c%206%200%209%206%209%2011%20z%22%2F%3E%3Cpath%20d%3D%22M0%201%20c%208%20-1%2011%20-7%209%20-11%20c%20-6%200%20-9%206%20-9%2011%20z%22%2F%3E%3Cpath%20d%3D%22M0%20-8%20c%20-6%20-1%20-9%20-5%20-7%20-9%20c%205%200%207%205%207%209%20z%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate%28160%2048%29%20rotate%280%29%20scale%280.85%29%22%3E%3Cpath%20d%3D%22M0%20-14.5%20c%205.4%200%208.8%208.8%208.8%2014.4%20a%208.8%208.8%200%200%201%20-17.6%200%20c%200%20-5.6%203.4%20-14.4%208.8%20-14.4%20z%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate%2856%20172%29%20rotate%280%29%20scale%280.65%29%22%3E%3Cpath%20d%3D%22M0%20-14.5%20c%205.4%200%208.8%208.8%208.8%2014.4%20a%208.8%208.8%200%200%201%20-17.6%200%20c%200%20-5.6%203.4%20-14.4%208.8%20-14.4%20z%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate%28238%20206%29%20rotate%280%29%20scale%280.55%29%22%3E%3Cpath%20d%3D%22M0%20-14.5%20c%205.4%200%208.8%208.8%208.8%2014.4%20a%208.8%208.8%200%200%201%20-17.6%200%20c%200%20-5.6%203.4%20-14.4%208.8%20-14.4%20z%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E);
  --midnight: #eff3ea;
  --navy: #f8faf4;
  --navy-line: #dbe3d5;
  --season-a: rgba(116, 154, 111, 0.28);
  --season-b: rgba(146, 126, 182, 0.22);
  --season-c: rgba(214, 184, 128, 0.26);
  --gold: #a8944f;
  --gold-bright: #bfab68;
}

body {
  color: var(--ivory);
  background:
    radial-gradient(46rem 30rem at 100% 0%, var(--season-a), transparent 66%),
    radial-gradient(44rem 30rem at 0% 18%, var(--season-b), transparent 65%),
    radial-gradient(36rem 24rem at 50% 100%, var(--season-c), transparent 72%),
    var(--midnight);
  background-attachment: fixed;
}

/**
 * The seasonal wallpaper.
 *
 * A repeating tile of engraved botanical line work, fixed so it stays put while
 * the schedule scrolls over it. It sits on its own layer under the content and
 * over the body's washes, and Classic leaves it `none`.
 *
 * This replaced four decorative dots pinned to the viewport corners — at three
 * corners out of four they sat behind a card, so most of that flourish was
 * never visible at all.
 *
 * The tiles are inline SVG data URIs (the CSP allows `img-src data:`), so a
 * skin costs no extra request and nothing to cache-bust on deploy.
 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: var(--season-motif-strength);
  background-image: var(--season-motif);
  background-repeat: repeat;
  background-size: var(--season-tile) var(--season-tile);
}

/**
 * The wallpaper gets quieter as the screen gets bigger.
 *
 * The tile is discreet on a phone, where cards cover most of the width and only
 * the gutters show it. The same tile on a desktop puts five times as many
 * motifs on screen against far more bare canvas — and the section headings sit
 * directly on that canvas with no card behind them, so the pattern was drawing
 * through "Morning Brief" and "Next up".
 *
 * Only the strength moves. Growing the tile instead was tried and is worse: it
 * thins the motifs out but draws each one larger, which is more conspicuous on
 * a tablet, not less — and it breaks the one thing holding the four seasons
 * together, which is that they are all drawn at the same size by the same hand.
 */
@media (min-width: 48rem) {
  :root { --season-motif-strength: 0.22; }
}

@media (min-width: 74rem) {
  :root { --season-motif-strength: 0.16; }
}

h1, h2, h3, .topbar__title, .brief__greeting, .tile__label,
.card__title, .entry__title, .shopping-item__name,
.business-hero__title, .assistant-action-title {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.025em;
}

.shell__body {
  padding: var(--s4) var(--s4) calc(7.4rem + env(safe-area-inset-bottom));
}

/* Page header becomes editorial rather than app-chrome heavy. */
.topbar {
  position: relative;
  top: auto;
  padding: clamp(1.6rem, 4vw, 2.75rem) var(--s4) var(--s2);
  padding-top: calc(clamp(1.6rem, 4vw, 2.75rem) + env(safe-area-inset-top));
  background: transparent;
  border: 0;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.topbar__title {
  font-size: clamp(2.5rem, 8vw, 4.4rem);
  line-height: 0.98;
  color: var(--ivory);
}

.topbar__back,
.topbar .btn--quiet {
  color: var(--cream);
  background: rgba(255,255,255,0.45);
  border: 1px solid var(--navy-line);
  box-shadow: 0 5px 18px rgba(92, 67, 43, 0.05);
}

body[data-route='/'] .topbar { display: none; }
body[data-route='/'] .shell__body { padding-top: calc(var(--s4) + env(safe-area-inset-top)); }

/* Floating warm navigation. */
.tabbar {
  inset-inline: var(--s3);
  bottom: calc(var(--s2) + env(safe-area-inset-bottom));
  padding: var(--s1) var(--s2);
  min-height: var(--nav-h);
  background: rgba(255, 253, 249, 0.93);
  border: 1px solid rgba(121, 96, 70, 0.12);
  border-radius: 28px;
  box-shadow: var(--lift-high);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}

.tabbar__item {
  position: relative;
  min-height: var(--nav-h);
  color: #3b3732;
  font-size: 0.70rem;
  transition: color var(--fast) var(--ease), transform var(--fast) var(--ease), background var(--fast) var(--ease);
}

.tabbar__item[aria-current='page'] { color: var(--gold); }
.tabbar__item[aria-current='page']::after {
  width: 4px;
  height: 4px;
  background: currentColor;
  bottom: 4px;
}

.tabbar__item--primary {
  justify-self: center;
  align-self: center;
  width: 4.5rem;
  height: 4.5rem;
  min-height: 4.5rem;
  margin-top: -1.7rem;
  color: var(--ivory);
  background: linear-gradient(145deg, var(--gold-bright), var(--gold));
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(135, 93, 50, 0.22), 0 0 0 7px rgba(247, 241, 232, 0.78);
}

.tabbar__item--primary .tabbar__icon {
  width: 20px;
  height: 20px;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.tabbar__item--primary .tabbar__label {
  font-family: var(--font-display);
  font-size: 0.92rem;
}

.tabbar__item--primary:active { transform: scale(0.96); }

/**
 * The Add button keeps its ink when it IS the current page.
 *
 * `.tabbar__item[aria-current='page']` sets the active tab gold, and an
 * attribute selector outranks the plain `.tabbar__item--primary` class — so on
 * `/add` the one filled gold button painted its label and icon gold on gold and
 * effectively vanished. It is the most-pressed control in the app, invisible on
 * exactly the screen it takes you to.
 */
.tabbar__item--primary[aria-current='page'] { color: var(--ivory); }
/* The dot under a tab marks the current one; on the filled button the fill
   already says that, and a dark dot on gold just reads as a smudge. */
.tabbar__item--primary[aria-current='page']::after { display: none; }

/* Home */
.brief {
  padding: clamp(1.8rem, 6vw, 2.8rem) clamp(1.35rem, 5vw, 2rem);
  margin-bottom: clamp(2rem, 7vw, 3rem);
  background: rgba(255, 253, 249, 0.86);
  border: 1px solid rgba(121, 96, 70, 0.12);
  border-radius: 30px;
  box-shadow: var(--lift);
}
.brief::before { display: none; }
.brief__greeting {
  max-width: 11ch;
  margin-bottom: 1rem;
  font-size: clamp(2.55rem, 10vw, 4.6rem);
  line-height: 0.98;
  color: var(--ivory);
}
.brief__date {
  color: #675f57;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.10em;
}
.brief__stats {
  gap: 0;
  margin-top: 2.2rem;
}
.stat {
  min-height: 5.2rem;
  padding: .7rem .35rem;
  background: transparent;
  border: 0;
  border-radius: 0;
}
.stat + .stat { border-inline-start: 1px solid var(--navy-line); }
.stat__value {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 7vw, 2.7rem);
  font-weight: 400;
  color: var(--ivory);
}
.stat__label {
  margin-top: .15rem;
  color: #5e5750;
  font-size: .68rem;
  letter-spacing: .05em;
}

.home-launcher { margin-bottom: clamp(2.2rem, 7vw, 3.5rem); }
.home-grid { gap: 1.9rem .65rem; }
.tile {
  gap: .55rem;
  padding: 0;
  color: var(--ivory);
  transition: transform var(--slow) var(--ease);
}
.tile:active { transform: scale(.97); }
.tile__art {
  max-width: 6.1rem;
  background: transparent;
  border: 0;
  border-radius: 22px;
  box-shadow: none;
  overflow: hidden;
}
.tile__art img { object-fit: contain; border-radius: inherit; }
/* The Shia Baby tile no longer takes a special class — it draws from the same
   manifest as the other twelve. The circular crop and drop shadow here existed
   to tidy an opaque square; the artwork is transparent now and needs neither. */
.tile__label {
  max-width: 7.3rem;
  color: var(--ivory);
  font-size: clamp(.93rem, 3.6vw, 1.08rem);
  line-height: 1.05;
}
.tile__art--placeholder::after {
  top: 3px;
  inset-inline-start: 3px;
  padding: 1px 5px;
  color: #6f5536;
  background: rgba(250, 235, 210, .92);
  border: 1px solid rgba(151, 111, 64, .20);
  font-size: .40rem;
}

/* Shared surfaces */
.card {
  background: rgba(255, 253, 249, 0.88);
  border: 1px solid rgba(121, 96, 70, 0.11);
  border-radius: 24px;
  box-shadow: var(--lift);
}
.card + .card { margin-top: var(--s4); }
.card__head { align-items: center; }
.card__title { font-size: clamp(1.35rem, 5vw, 1.8rem); }
.card__meta { color: var(--muted); }
.section { margin-bottom: 2rem; }
.section__title { font-size: clamp(1.55rem, 5.8vw, 2.05rem); }

.entry {
  min-height: 5.2rem;
  background: rgba(255, 253, 249, .90);
  border: 1px solid rgba(121, 96, 70, .10);
  border-radius: 22px;
  box-shadow: 0 8px 22px rgba(92, 67, 43, 0.07);
  transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.entry:active { transform: scale(.992); }
.entry:hover { border-color: rgba(197,155,103,.34); box-shadow: 0 12px 28px rgba(92, 67, 43, 0.10); }
.entry__time strong { color: var(--ivory); }
.entry__title { display: block; font-size: clamp(1.15rem, 4.5vw, 1.55rem); line-height: 1.1; }
.entry__sub { display: block; margin-top: .2rem; }
.entry__sub--alert {
  color: var(--alert);
  /* The engine's explanation restates the event's title, time and date — all of
     which are already in this row. Two lines is enough to say which kind of
     clash it is; the full sentence stays in the row's tooltip and on the event
     screen. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.entry__eyebrow {
  display: block;
  margin-bottom: .2rem;
  color: #8a7a63;
  font-family: var(--font);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.entry__meta {
  display: flex; align-items: center; gap: .4rem; justify-content: flex-end; flex-wrap: wrap;
  min-width: 0;
}
.entry__chevron { color: #8a8177; font-size: 1.8rem; line-height: 1; }
.entry__art-slot { display: grid; place-items: center; width: 3.7rem; height: 3.7rem; }
.entry__art { width: 3.7rem; max-width: 3.7rem; height: 3.7rem; border-radius: 16px; overflow: hidden; }
.entry__art .tile__art { width: 3.7rem; height: 3.7rem; max-width: none; }
.schedule-entry, .miniapp-entry {
  grid-template-columns: 3.8rem 4.1rem minmax(0, 1fr) minmax(0, var(--entry-meta-w));
}
.entry--next { border-color: rgba(197,155,103,.42); background: linear-gradient(120deg, rgba(245,229,207,.62), rgba(255,253,249,.96) 48%); }

/* Controls */
.btn {
  color: var(--ivory);
  background: rgba(255, 253, 249, .72);
  border-color: rgba(121, 96, 70, .16);
  border-radius: 16px;
  box-shadow: 0 5px 16px rgba(92, 67, 43, .05);
  transition: transform var(--fast) var(--ease), background var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.btn:hover:not(:disabled) { background: rgba(255, 253, 249, .98); box-shadow: var(--lift); }
.btn:active:not(:disabled) { transform: scale(.98); }
/**
 * Ink on gold, not white on gold.
 *
 * The label is ~15px at weight 580 — normal text, so WCAG asks 4.5:1. Near-white
 * on the champagne gold gave 2.45, which is the single worst contrast in the
 * app and sits on its most-pressed control. Dark ink on the same gold gives
 * 6.46 without touching the brand colour; the alternative was darkening gold to
 * a bronze until white cleared 4.5, which loses the champagne entirely.
 *
 * This is also what the original design did before the warm editorial layer
 * flipped it — section 6 still says `color: var(--midnight)`.
 */
.btn--primary {
  color: var(--ivory);
  background: linear-gradient(145deg, var(--gold-bright), var(--gold));
  border-color: rgba(137, 96, 53, .14);
  box-shadow: 0 10px 26px rgba(137, 96, 53, .18);
}
.btn--primary:hover:not(:disabled) { background: linear-gradient(145deg, #dfc296, #c89e69); }
.btn--quiet { color: #665e56; background: rgba(255,255,255,.28); border-color: transparent; box-shadow: none; }
.btn--quiet:hover:not(:disabled) { color: var(--ivory); background: rgba(255,255,255,.56); }
.btn--danger { color: var(--alert); border-color: rgba(184,95,80,.18); background: rgba(184,95,80,.08); }

.field__label { color: #625b53; font-weight: 600; }
.input, .select, .textarea {
  color: var(--ivory);
  background: rgba(255, 253, 249, .62);
  border-color: #ddd1c2;
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
.input:hover, .select:hover, .textarea:hover { border-color: #cbbca9; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(197,155,103,.10); }
.input::placeholder, .textarea::placeholder { color: #9e958a; }

.chip { font-weight: 600; }
.chip--quiet { color: #746b62; background: #f0ebe4; border-color: #e7dfd6; }
.chip--gold { color: #8b642f; background: #f8ecd9; border-color: #ead6b7; }

.who { color: #332f2a; box-shadow: 0 0 0 1px rgba(121,96,70,.14); }

.state { color: var(--muted); }
.state__title { color: var(--ivory); font-family: var(--font-display); font-weight: 500; }
.skeleton {
  background: linear-gradient(90deg, rgba(164,143,119,.07) 25%, rgba(255,255,255,.65) 37%, rgba(164,143,119,.07) 63%);
  background-size: 400% 100%;
}

.toast {
  background: rgba(255,253,249,.96);
  color: var(--ivory);
  border-color: rgba(121,96,70,.12);
}
.sheet { background: rgba(53, 42, 31, .28); }
.sheet__panel { background: #fffdf9; border-color: #e5d9ca; }
.sheet__grip { background: #d3c6b5; }

/* Schedule */
.schedule-toolbar { margin-bottom: 1.5rem; }
.schedule-toolbar__head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .8rem; }
.page-kicker {
  margin: 0;
  color: #655d55;
  font-size: .78rem;
  font-weight: 650;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.schedule-mode-tabs { display: flex; gap: .2rem; overflow-x: auto; padding: .15rem; }
.schedule-mode {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: .42rem .65rem;
  color: #776e64;
  text-decoration: none;
  font-size: .72rem;
  font-weight: 600;
  border-radius: 999px;
  white-space: nowrap;
}
.schedule-mode--active { color: #7d5e36; background: #f2e4d2; }
.schedule-week {
  display: grid;
  /* `minmax(3.2rem, …)` puts the week over 390px wide, so Sunday sat off the
     edge behind a scrollbar. The days share whatever width there is instead. */
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: .15rem;
  padding: .55rem;
  margin-bottom: .9rem;
  background: rgba(255,253,249,.82);
  border: 1px solid rgba(121,96,70,.10);
  border-radius: 21px;
  box-shadow: var(--lift);
}
.schedule-day {
  min-width: 0;
  padding: .55rem .2rem;
  color: #5f5850;
  text-decoration: none;
  text-align: center;
  border-radius: 14px;
}
.schedule-day--selected { color: #654a2f; background: #f3e6d6; }
.schedule-day__weekday, .schedule-day__date { display: block; }
.schedule-day__weekday {
  font-size: clamp(.6rem, 2.4vw, .68rem); font-weight: 700; text-transform: uppercase;
}
.schedule-day__date {
  margin-top: .15rem; font-size: clamp(.63rem, 2.5vw, .72rem);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.schedule-filters { display: flex; gap: .55rem; flex-wrap: wrap; align-items: center; }
.schedule-filter { min-width: 8.5rem; flex: 1 1 9rem; }
.schedule-filters .select, .schedule-filters .input { background: rgba(255,253,249,.72); }
.schedule-add { margin-inline-start: auto; font-weight: 650; }

/* Compose / Add */
.compose-kicker { margin: .2rem 0 .9rem .2rem; }
.compose-form { display: grid; gap: 1.15rem; }
/* A grid item's automatic minimum size is its max-content width, so the
   horizontally scrolling mini-app picker inside this card used to push the
   whole page to 785px on a 390px phone. The overflow has to be allowed to
   scroll rather than to grow, and that takes an explicit zero minimum on every
   box between the picker and the grid. */
.compose-form > * { min-width: 0; }
.compose-form-card { padding: 1.25rem; min-width: 0; }
.compose-form-card .field { padding-bottom: .9rem; margin-bottom: .85rem; border-bottom: 1px solid #eadfd3; }
.compose-form-card .field:last-child { border-bottom: 0; }
.compose-people { margin: .3rem 0 1rem; padding: 1rem 0 .25rem; border-top: 1px solid #eadfd3; border-bottom: 1px solid #eadfd3; }
/* The responsible picker follows the chips; without this it butts against them. */
.compose-people .field { margin-top: 1rem; }
.compose-subtitle { margin-bottom: .65rem; font-size: 1.25rem; }
.compose-people__list { display: flex; gap: .5rem; flex-wrap: wrap; }
.compose-person { display: flex; align-items: center; gap: .5rem; min-height: var(--touch); padding: .4rem .85rem; background: #f6efe6; border-radius: 999px; cursor: pointer; }
/* A 13px browser-default checkbox inside a 44px pill is a target people miss
   even though the label around it is tappable. */
.compose-person input[type='checkbox'] { width: 1.15rem; height: 1.15rem; accent-color: var(--gold); }
.compose-person:has(input:checked) { background: #f5e6d2; box-shadow: inset 0 0 0 1px rgba(197,155,103,.45); }
.compose-picker-section { min-width: 0; overflow: hidden; }
.compose-picker-section .page-kicker { margin-bottom: .65rem; }
.compose-miniapps {
  display: flex; gap: .65rem; overflow-x: auto;
  padding: .35rem .1rem .5rem;
  scroll-snap-type: x proximity;
  /* The row scrolls; a scrollbar that only appears on hover is not a hint, so
     the last tile is deliberately allowed to peek past the edge. */
  scrollbar-width: thin;
}
.compose-miniapp {
  flex: 0 0 7rem;
  min-height: 7.5rem;
  padding: .65rem .4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  color: var(--ivory);
  background: rgba(255,253,249,.80);
  border: 1px solid #eadfd3;
  border-radius: 20px;
  scroll-snap-align: start;
  box-shadow: 0 5px 16px rgba(92,67,43,.05);
}
/* Selected is a filled tile with a ring, not a border tint — at a glance across
   a scrolling row a 1px colour change is not a selection state. */
.compose-miniapp--selected {
  border-color: var(--gold);
  background: #fbf1e3;
  box-shadow: 0 0 0 2px rgba(197,155,103,.28), var(--lift);
}
.compose-miniapp__art { width: 3.6rem; height: 3.6rem; }
.compose-miniapp__image, .compose-miniapp__image .tile__art { width: 3.6rem; height: 3.6rem; }
.compose-miniapp__label { font-family: var(--font-display); font-size: .92rem; }
.compose-submit { min-height: 3.6rem; font-family: var(--font-display); font-size: 1.25rem; }

/* Assistant */
.assistant-intro, .assistant-prompt-card, .assistant-result { padding: 1.25rem; }
.assistant-intro__body { display: grid; grid-template-columns: 5.2rem 1fr; gap: 1rem; align-items: center; }
.assistant-orb { width: 5rem; height: 5rem; display: grid; place-items: center; position: relative; color: #b88649; background: #f8efe3; border-radius: 999px; }
.assistant-orb span:first-child { font-size: 2rem; }
.assistant-orb span:last-child { position: absolute; right: 1rem; top: 1rem; font-size: .8rem; }
.assistant-intro__copy { color: #6f675e; margin: 0; }
.assistant-prompt-card { margin-top: 1rem; }
.assistant-prompt-card .field__label { font-family: var(--font-display); font-size: 1.45rem; color: var(--ivory); }
.assistant-prompt-card .textarea { min-height: 9rem; background: rgba(255,255,255,.48); }
.assistant-submit { min-height: 3.4rem; font-family: var(--font-display); font-size: 1.2rem; }
.assistant-status-row { display: flex; gap: .4rem; flex-wrap: wrap; margin: .7rem 0; }
.assistant-applied-row { display: grid; grid-template-columns: 3.5rem 1fr; gap: .9rem; align-items: start; }
.assistant-check { width: 3.2rem; height: 3.2rem; display: grid; place-items: center; color: var(--ivory); background: linear-gradient(145deg, var(--gold-bright), var(--gold)); border-radius: 999px; }
.assistant-action-title { margin: 0 0 .35rem; font-size: 1.4rem; }
.assistant-working { display: flex; align-items: center; gap: .7rem; }
.assistant-sparkles { color: var(--gold); font-size: 1.4rem; animation: assistant-pulse 1.2s var(--ease) infinite alternate; }
.assistant-errors { color: var(--alert); }
@keyframes assistant-pulse { from { transform: scale(.9) rotate(-5deg); opacity: .55; } to { transform: scale(1.08) rotate(5deg); opacity: 1; } }

/* Shopping */
.shopping-page { display: grid; gap: 1rem; }
.shopping-add { padding: 1.35rem; }
.shopping-add .card__title { font-size: clamp(1.8rem, 7vw, 2.35rem); }
.shopping-add__form .btn { min-height: 3.4rem; font-family: var(--font-display); font-size: 1.2rem; }

/* Aisle headings. Small and quiet — they organise the list, they are not
   competing with the things on it. */
.shopping-aisle + .shopping-aisle { margin-top: 1.4rem; }
.shopping-aisle__title {
  margin: 0 0 .55rem .35rem;
  color: #655d55;
  font-family: var(--font);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.shopping-aisle--done { opacity: .7; }

.shopping-list { display: grid; gap: .6rem; }
.shopping-item {
  display: grid;
  grid-template-columns: 3.2rem minmax(0,1fr) auto;
  gap: .85rem;
  align-items: center;
  /* Was 8rem tall with a 2rem serif name — a poster per banana. A list you tick
     your way down wants to show a whole aisle at once. */
  min-height: 4.4rem;
  padding: .7rem .9rem;
  background: rgba(255,253,249,.90);
  border: 1px solid rgba(121,96,70,.10);
  border-radius: 24px;
  box-shadow: var(--lift);
  transition: transform var(--slow) var(--ease), opacity var(--slow) var(--ease);
}
.shopping-item__art { width: 3.1rem; height: 3.1rem; display: grid; place-items: center; color: #8a6a44; background: #f7eee1; border-radius: 14px; }
.shopping-item__name { margin: 0; font-size: clamp(1.1rem, 4.4vw, 1.35rem); line-height: 1.15; }
.shopping-item__qty { margin: .1rem 0 0; color: #756d64; font-size: .85rem; font-variant-numeric: tabular-nums; }
.shopping-item__store { margin: .1rem 0 0; color: #978e84; font-size: .75rem; }
.shopping-item__state { align-self: center; }
.shopping-item__buy {
  min-width: 5.2rem; min-height: var(--touch); padding-inline: var(--s3); justify-content: center;
  color: #85602f; border-color: rgba(197, 155, 103, .45); background: rgba(255, 253, 249, .9);
}
.shopping-item__buy:hover:not(:disabled) { color: #6d4d24; background: #f8efe1; }
.shopping-item--bought { opacity: .78; }
.shopping-item--bought .shopping-item__name { text-decoration: line-through; text-decoration-color: rgba(117,109,100,.5); }
.shopping-item--bought .shopping-item__art { color: var(--good); background: var(--good-dim); }

/* A segmented control. Four sections that fit the width they are given rather
   than a row of pills whose last item hangs off the edge of a phone. */
.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: .2rem;
  padding: .25rem;
  margin-bottom: 1.2rem;
  background: rgba(255, 253, 249, .72);
  border: 1px solid rgba(121, 96, 70, .12);
  border-radius: 999px;
  box-shadow: 0 5px 16px rgba(92, 67, 43, .05);
}
.segmented__item {
  display: flex; align-items: center; justify-content: center;
  min-height: 2.7rem;
  padding: .3rem .4rem;
  color: #776e64;
  font-size: clamp(.74rem, 3vw, .86rem);
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  border-radius: 999px;
  transition: color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.segmented__item:hover { color: var(--ivory); background: rgba(242, 228, 210, .55); }
/* Not colour alone: the selected tab is also the only filled one. */
.segmented__item--active { color: #7d5e36; background: #f2e4d2; font-weight: 700; }

/* Shia Baby */
.business-hero {
  padding: 1.4rem;
  margin-bottom: 1.8rem;
  background: rgba(255,253,249,.90);
  border: 1px solid rgba(121,96,70,.10);
  border-radius: 26px;
  box-shadow: var(--lift);
}
.business-hero__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.business-hero__title { margin: 0; font-size: clamp(2rem, 8vw, 2.8rem); }
/**
 * The hero bear.
 *
 * `cover` cropped the artwork's edges and the shadow drew a disc behind it —
 * both were tuned for an opaque square. The bear is transparent now, so it sits
 * whole (`contain`) on a soft cream disc that keeps the round treatment without
 * a shadow hanging off nothing.
 */
.business-bear {
  width: 5.6rem; height: 5.6rem;
  padding: .3rem;
  object-fit: contain;
  background: radial-gradient(circle at 50% 45%, #fdf7ee, #f4ece0);
  border: 1px solid rgba(121, 96, 70, .10);
  border-radius: 999px;
}
.business-metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); margin-top: 1.2rem; }
.business-metric { min-width: 0; padding: .5rem .25rem; text-align: center; }
.business-metric + .business-metric { border-inline-start: 1px solid #eadfd3; }
.business-metric__value { display: block; font-family: var(--font-display); font-size: clamp(1.65rem, 6vw, 2.2rem); font-weight: 400; }
.business-metric__label { display: block; margin-top: .15rem; color: #6f675e; font-size: .62rem; line-height: 1.25; text-transform: uppercase; letter-spacing: .06em; }
.business-list-row, .business-shift-row, .business-warning {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  gap: .9rem;
  align-items: center;
  min-height: 4.6rem;
  padding: .8rem 1rem;
  margin-bottom: .55rem;
  background: rgba(255,253,249,.88);
  border: 1px solid rgba(121,96,70,.10);
  border-radius: 20px;
  box-shadow: 0 6px 18px rgba(92,67,43,.05);
}
.business-list-row__main { display: flex; flex-direction: column; gap: .1rem; }
.business-avatar { width: 2.8rem; height: 2.8rem; display: grid; place-items: center; font-family: var(--font-display); font-size: 1.1rem; background: #f1e6d8; border-radius: 999px; }
.business-warning { grid-template-columns: 2.5rem 1fr; color: #4e463f; }
.business-warning__icon { width: 2.2rem; height: 2.2rem; display: grid; place-items: center; color: var(--warn); border: 2px solid var(--warn); border-radius: 10px; font-weight: 800; }
.business-publish-link { margin: .7rem 0 1.25rem; min-height: 3.5rem; font-family: var(--font-display); font-size: 1.15rem; }
.business-inventory-pulse { margin-top: 1rem; }
body[data-miniapp='shia-baby'] .topbar__title { color: #1c2e54; }

/* Mini-app pages */
.miniapp-actions { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: 1rem; }
.miniapp-actions .page-kicker { flex: 1; }
.miniapp-add { white-space: nowrap; }
body[data-miniapp='hubby-work'] .topbar__title { max-width: 11ch; }
body[data-miniapp='hubby-work'] .entry__eyebrow { color: #596b89; }

/* Household — the invitation code, which has to be readable and copyable. */
.invite-card { border-color: rgba(197, 155, 103, .32); }
.invite-code {
  margin-top: .9rem;
  padding: .9rem 1rem;
  background: #f8efe1;
  border: 1px solid rgba(197, 155, 103, .32);
  border-radius: 16px;
}
.invite-code__value {
  margin: 0 0 .5rem;
  /* A token read character by character needs a face that tells 0 from O. */
  font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
  font-size: .82rem;
  line-height: 1.5;
  color: #4a4038;
  overflow-wrap: anywhere;
  user-select: all;
}
.invite-code .btn { margin-top: .75rem; }

/* Settings */
.settings-card, .appearance-card { margin-bottom: 1rem; }
.settings-link { grid-template-columns: 1fr auto; min-height: 3.8rem; box-shadow: none; border-radius: 16px; }
.settings-link__chevron { font-size: 1.5rem; color: #8c8277; }

/* Motion: gentle and optional. */
[data-view] > * { animation: editorial-view-in 220ms var(--ease) both; }
.card, .entry, .shopping-item, .business-list-row, .business-warning, .business-shift-row { animation: editorial-card-in 260ms var(--ease) both; }
@keyframes editorial-view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes editorial-card-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* The home screen's two reading columns. One column on a phone; side by side
   once there is width for two, so the brief and the schedule are both above the
   fold instead of the schedule living under 900px-wide two-line cards. */
.home__columns { display: grid; gap: 0 var(--s5); }
.home__column > .section:last-child { margin-bottom: 0; }

/* Tablet and desktop keep the light editorial system while preserving the
   existing rail/sidebar responsive architecture. */
@media (min-width: 48rem) {
  .sidenav {
    background: rgba(255,253,249,.90);
    border-color: rgba(121,96,70,.10);
  }
  .sidenav__item { color: #766d63; }
  .sidenav__item:hover { color: var(--ivory); background: #f5ede3; }
  .sidenav__item[aria-current='page'] { color: #7c5b31; background: #f2e4d2; }
  .shell__body { padding: var(--s5) var(--s5) var(--s7); }
  .topbar { padding-inline: var(--s5); }
  /* §3 asks for a 4–5 column icon grid on a tablet, across the width it has —
     a 3-wide grid capped at 34rem left half an iPad empty beside it. */
  .home-grid { grid-template-columns: repeat(5, 1fr); }
  .business-hero { padding: 1.8rem; }
}

@media (min-width: 62rem) {
  /* The brief is the wider of the two: its cards carry sentences, the schedule
     carries rows. */
  .home__columns { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
  /* The greeting no longer needs the phone's 11ch wrap once it has a column. */
  .brief__greeting { max-width: 18ch; }
}

@media (min-width: 74rem) {
  .sidenav { background: rgba(255,253,249,.93); }
  .topbar { padding-inline: var(--s6); }
  .home-grid { grid-template-columns: repeat(9, 1fr); }
  .shell__body { padding: var(--s6) var(--s6) var(--s8); }
  /* A card holding two lines does not need 900px. Keeping the measure sane is
     the difference between a dashboard and a stretched phone screen. */
  .home__column .card p, .home__column .entry__main { max-width: 62ch; }
}

@media (max-width: 30rem) {
  :root { --entry-meta-w: 7.6rem; }
  .schedule-toolbar__head { align-items: flex-start; flex-direction: column; }
  .schedule-mode-tabs { width: 100%; }
  .schedule-entry, .miniapp-entry { grid-template-columns: 3.5rem minmax(0,1fr) minmax(0, var(--entry-meta-w)); }
  .schedule-entry > .entry__time, .miniapp-entry > .entry__time { display: none; }
  .shopping-item { grid-template-columns: 3.5rem minmax(0,1fr) auto; gap: .7rem; }
  .shopping-item__art { width: 3.4rem; height: 3.4rem; }
  .business-metrics { grid-template-columns: repeat(2, 1fr); gap: .35rem 0; }
  .business-metric:nth-child(3) { border-inline-start: 0; border-top: 1px solid #eadfd3; padding-top: .75rem; }
  .business-metric:nth-child(4) { border-top: 1px solid #eadfd3; padding-top: .75rem; }
  .assistant-intro__body { grid-template-columns: 4.3rem 1fr; }
  .assistant-orb { width: 4.1rem; height: 4.1rem; }
}

/* 320px. There is no width here for a title column AND a chip-and-avatars
   column side by side — squeezing them together is what wrapped titles three
   deep. The trailing cluster drops onto its own line under the title instead,
   and the chevron goes: the whole row is the button, so it was decoration
   competing for the scarcest space on the smallest screen. */
@media (max-width: 22.5rem) {
  .entry, .schedule-entry, .miniapp-entry { grid-template-columns: 3.2rem minmax(0, 1fr); }
  .entry__meta { grid-column: 2; justify-content: flex-start; margin-top: .15rem; }
  .entry__chevron { display: none; }
  .schedule-filters .schedule-add { width: 100%; margin-inline-start: 0; }
}

@media (prefers-reduced-motion: reduce) {
  [data-view] > *, .card, .entry, .shopping-item, .business-list-row, .business-warning, .business-shift-row,
  .assistant-sparkles { animation: none !important; }
  .btn, .tile, .entry, .tabbar__item { transition: none !important; }
}
