:root {
  color-scheme: light;
  --bg: #f3f0e9;
  --card: #fffdf8;
  --text: #201c18;
  --muted: #746b61;
  --line: #e7dfd3;
  --accent: #9f2f13;
  --gold: #9a6b1d;
  --accent-soft: #f0e7dc;
  --danger: #a33a35;
  --shadow: 0 18px 50px rgb(52 43 31 / 8%);

  /* Per-user identity palette — must stay in lockstep with
     shared/enums.ts USER_COLORS + the iOS Theme tones. Each user gets one
     `(bg, fg)` pair at account creation; clients render their avatar / slot
     tint by reading the user's `color` field from the API response. */
  --user-sage-bg: #DCEBD9;   --user-sage-fg: #4A6A47;
  --user-amber-bg: #F1E6CB;  --user-amber-fg: #6F5118;
  --user-clay-bg: #F1DCD0;   --user-clay-fg: #8E4A2E;
  --user-cool-bg: #BFDBFE;   --user-cool-fg: #1E3A8A;
  --user-plum-bg: #E9D9E8;   --user-plum-fg: #6E3B6A;
  --user-rose-bg: #FBCFE8;   --user-rose-fg: #9D174D;
  --user-peach-bg: #F4D9C6;  --user-peach-fg: #80471F;
  --user-gold-bg: #EDE2B7;   --user-gold-fg: #7C5A1E;
  --user-mint-bg: #CFE9DD;   --user-mint-fg: #376A55;
  --user-teal-bg: #CEE4E6;   --user-teal-fg: #355F65;
  --user-indigo-bg: #D7D9EE; --user-indigo-fg: #444B82;
  --user-mauve-bg: #E0D5E9;  --user-mauve-fg: #5A4274;

  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* User-color application — wrap an element's bg + fg in the picked tint.
   Used by Avatar and any element that wants the per-user identity color
   (e.g. the schedule slot background). The `--accent` override the chip
   classes (.mini-avatar, .post-avatar, …) inherit gets replaced when one of
   these classes is present. */
.user-color-sage   { background: var(--user-sage-bg)   !important; color: var(--user-sage-fg)   !important; }
.user-color-amber  { background: var(--user-amber-bg)  !important; color: var(--user-amber-fg)  !important; }
.user-color-clay   { background: var(--user-clay-bg)   !important; color: var(--user-clay-fg)   !important; }
.user-color-cool   { background: var(--user-cool-bg)   !important; color: var(--user-cool-fg)   !important; }
.user-color-plum   { background: var(--user-plum-bg)   !important; color: var(--user-plum-fg)   !important; }
.user-color-rose   { background: var(--user-rose-bg)   !important; color: var(--user-rose-fg)   !important; }
.user-color-peach  { background: var(--user-peach-bg)  !important; color: var(--user-peach-fg)  !important; }
.user-color-gold   { background: var(--user-gold-bg)   !important; color: var(--user-gold-fg)   !important; }
.user-color-mint   { background: var(--user-mint-bg)   !important; color: var(--user-mint-fg)   !important; }
.user-color-teal   { background: var(--user-teal-bg)   !important; color: var(--user-teal-fg)   !important; }
.user-color-indigo { background: var(--user-indigo-bg) !important; color: var(--user-indigo-fg) !important; }
.user-color-mauve  { background: var(--user-mauve-bg)  !important; color: var(--user-mauve-fg)  !important; }

* { box-sizing: border-box; }
html { width: 100%; max-width: 100%; overflow-x: clip; }
body { width: 100%; max-width: 100%; margin: 0; overflow-x: clip; background: var(--bg); color: var(--text); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.gate-view { min-height: 100svh; display: grid; place-items: center; padding: 20px; }
.gate-card { display: grid; gap: 16px; width: min(420px, 100%); padding: 24px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.gate-card h1 { font-size: clamp(2.4rem, 12vw, 4rem); }
.page-shell { width: min(1080px, 100%); margin: 0 auto; padding: clamp(18px, 4vw, 36px); padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
.top-bar { position: relative; display: flex; align-items: center; justify-content: center; gap: 16px; padding-right: 42px; margin-bottom: 14px; }
.top-bar-leading { position: absolute; left: 0; top: 50%; transform: translateY(-50%); display: flex; align-items: center; gap: 8px; }
.care-profile-switcher { position: relative; }
.care-profile-trigger { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: white; font-weight: 650; color: var(--text); cursor: pointer; }
.care-profile-trigger:hover { background: #fffaf2; }
.care-profile-chip { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-weight: 700; font-size: 0.9rem; }
.care-profile-options { min-width: 180px; left: 0; right: auto; }
.care-profile-option { gap: 8px; }


/* Per-page recipient segment picker. A pill container with a chip per recipient;
   each chip carries a colored initial avatar + the recipient's name. The active
   chip floats on a white-card background; inactive chips are flush with the
   container's tinted background. Shared by the Appts, Medications, Contacts, and
   Meals pages (RecipientFilterRow). Sized tight to keep vertical real-estate low. */
.recipient-segment-picker { display: inline-flex; align-self: flex-start; width: fit-content; gap: 2px; padding: 3px; background: #f4ece0; border-radius: 999px; }
/* Adjacent gap: the appointments page renders the picker directly above the
   .appointment-toolbar (no parent grid `gap` separates them), so they touch
   without this. Medications/Contacts pages live in a grid container that
   already supplies its own gap — they're untouched. */
.recipient-segment-picker + .appointment-toolbar { margin-top: 12px; }
.recipient-segment-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px 3px 3px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-weight: 650; cursor: pointer; line-height: 1; }
.recipient-segment-chip:hover { color: var(--text); }
.recipient-segment-chip.active { background: white; color: var(--text); font-weight: 800; box-shadow: 0 1px 2px rgb(68 45 25 / 8%); }
.recipient-segment-avatar { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 0.72rem; font-weight: 800; }
.recipient-segment-name { font-size: 0.9rem; }

/* Recipient picker in the create/edit dialog renders through FormFields' kind:
   'select' (the shared FancySelect — same one duration / contact-type / meal-portion
   use). Only the read-only edit-mode chip needs its own framing. */
.recipient-picker-readonly { padding: 10px 12px; background: #fffaf2; border: 1px solid #d7c8bc; border-radius: 12px; }
.view-nav { justify-self: center; display: flex; gap: 4px; padding: 4px; background: #fffaf2; border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 1px 0 rgb(0 0 0 / 4%); }
.nav-button { border: 0; border-radius: 999px; padding: 10px 14px; background: transparent; color: var(--text); font-weight: 650; }
.nav-button.active { background: var(--text); color: white; }
.nav-label-short { display: none; }
.user-pill { position: absolute; right: 0; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; gap: 8px; min-width: 0; padding: 0; border: 0; background: transparent; color: var(--text); font-size: 0.9rem; }
.bottom-nav { position: fixed; left: 0; right: auto; bottom: 0; z-index: 50; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; width: 100dvw; max-width: 100dvw; border-top: 1px solid var(--line); padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: #fffdf8; box-shadow: 0 -10px 28px rgb(52 43 31 / 9%); transform: translateZ(0); }
.bottom-nav-button { display: grid; justify-items: center; gap: 4px; border: 0; border-radius: 12px; padding: 4px 2px; background: transparent; color: var(--muted); font-size: 0.68rem; }
.bottom-nav-button svg { width: 18px; height: 18px; }
.bottom-nav-button.active { color: var(--accent); }
.more-menu-backdrop { position: fixed; inset: 0; z-index: 60; background: rgb(20 18 16 / 42%); backdrop-filter: blur(2px); }
.more-menu-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; display: grid; gap: 14px; border-radius: 20px 20px 0 0; padding: 10px 14px calc(18px + env(safe-area-inset-bottom)); background: #fffdf8; transform: translateY(105%); transition: transform 180ms ease; box-shadow: 0 -20px 40px rgb(20 18 16 / 18%); }
.more-menu-sheet.open { transform: translateY(0); }
.more-menu-handle { justify-self: center; width: 34px; height: 3px; border-radius: 999px; background: #ddd5c9; }
.more-menu-options { display: flex; gap: 8px; flex-wrap: wrap; }
.more-menu-option { display: grid; justify-items: center; align-content: center; gap: 8px; width: 84px; height: 80px; border: 0; border-radius: 10px; background: #eee6d8; color: var(--text); font-size: 0.8rem; }
.more-menu-option > span:first-child { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #fffdf8; }
.more-menu-option svg { width: 18px; height: 18px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.avatar { display: grid; place-items: center; flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; background: #f1c5a6; color: var(--accent); font-weight: 800; font-size: 0.75rem; text-transform: uppercase; }

.hero { padding: clamp(24px, 5vw, 38px) 4px 24px; }
.compact-hero { padding-bottom: 18px; }
.eyebrow { margin: 0 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.22em; font-size: 0.68rem; font-weight: 800; }
h1 { margin: 0; font: 500 clamp(2.5rem, 7vw, 4.9rem)/0.98 Georgia, "Times New Roman", serif; letter-spacing: -0.055em; }
h1 .headline-count { color: var(--accent); font-style: italic; }
.muted { color: var(--muted); }
.hero .muted { margin-top: 10px; }

.home-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.95fr); gap: 18px; align-items: start; }
.home-main-column { display: grid; gap: 18px; min-width: 0; }
.home-main-column > .card { min-width: 0; }
.link-button { border: 0; padding: 0; background: transparent; color: var(--accent); font-weight: 800; text-align: left; text-decoration: underline; text-underline-offset: 2px; }
.card, .day-card { background: color-mix(in srgb, var(--card) 92%, white); border: 1px solid rgb(231 223 211 / 70%); border-radius: 16px; box-shadow: var(--shadow); }
.card { padding: clamp(18px, 3vw, 24px); }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
h2 { margin: 0; font-size: 1rem; line-height: 1.2; }
.section-heading .muted { margin: 6px 0 0; font-size: 0.86rem; }
.hidden { display: none !important; }

.icon-button, .secondary-button { border: 1px solid var(--line); border-radius: 999px; padding: 9px 13px; background: #fffaf2; color: var(--text); font-weight: 750; }
.shift-unclaim-button { padding: 5px 9px; color: var(--danger); font-size: 0.72rem; line-height: 1; }
.coverage-list, .shift-list, .schedule { display: grid; gap: 0; }
.schedule { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.coverage-row, .shift-row { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 20px 0; border-top: 1px solid var(--line); }
.coverage-row { grid-template-columns: 54px minmax(0, 1fr); }
.coverage-row { min-height: 98px; }
.coverage-row:first-child, .shift-row:first-child { border-top: 0; }
.date-chip { width: 54px; border: 0; background: transparent; text-align: center; line-height: 1; text-transform: uppercase; letter-spacing: 0.16em; color: var(--muted); font-size: 0.62rem; }
.date-chip strong { display: block; margin: 4px 0 0; color: var(--text); font: 500 1.55rem/0.9 Georgia, serif; letter-spacing: -0.04em; text-transform: none; }
.coverage-row .date-chip { align-self: center; }
.slot-chip-list { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center; }
.coverage-slot-cell { position: relative; display: grid; justify-items: center; min-width: 96px; }
.coverage-slot-cell small { position: absolute; top: calc(100% + 5px); left: 50%; transform: translateX(-50%); color: #3e7a4d; font-size: 0.68rem; font-weight: 800; line-height: 1; text-align: center; white-space: nowrap; }
.coverage-claim-button small { position: static; transform: none; color: inherit; font-size: 0.68rem; }
.appointment-chip { line-height: 0.95; padding-block: 5px; font-size: 0.72rem; }
.appointment-chip small { display: block; }
.appointment-chip-unclaimed { background: #fff0ef; border-color: #efc0bc; color: var(--text); }
.coverage-slot-cell .coverage-unclaimed-label { color: var(--danger); font-size: 0.58rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.06em; }
.slot-chip { display: inline-flex; align-items: center; justify-content: center; text-align: center; border: 1px solid var(--line); border-radius: 999px; padding: 8px 13px; background: #fffaf2; color: var(--text); font-size: 0.84rem; }
.slot-chip-filled { border-color: #b8d8bf; background: #e8f4eb; color: #265d34; cursor: default; }
button.slot-chip:hover, .icon-button:hover, .secondary-button:not(:disabled):hover { border-color: #d7cab9; background: white; }
.secondary-button:disabled { opacity: 0.45; cursor: not-allowed; background: #fffaf2; color: var(--muted); }
.meals-date-toolbar .secondary-button:not(:disabled):hover,
.calendar-toolbar .secondary-button:not(:disabled):hover { background: #fffaf2; }
.empty-state { padding: 24px 0; color: var(--muted); }

.shift-row { grid-template-columns: 48px minmax(0, 1fr) auto; }
.activity-feed { display: grid; gap: 0; }
.activity-item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; padding: 14px 0; border-top: 1px solid var(--line); }
.activity-item:first-child { border-top: 0; }
.activity-token { min-width: 78px; border-radius: 999px; padding: 5px 9px; text-align: center; font-size: 0.68rem; font-weight: 900; }
/* Activity-feed chip COLORS — one rule covering every ACTIVITY_ACTIONS value
   (shared/enums.ts). Each feed chip is rendered as `activity-token activity-<action>`
   by features/feed/feedView.js; this block color-codes all 27 actions. The action set
   is pinned to the vocabulary by server/test/activityChipStyles.test.ts — the CSS
   sibling of the server's compile-checked ACTIVITY registry (server/src/activity.ts)
   and the web feed's feedFrontend-pinned ACTIVITY_ROWS (features/feed/feedItem.js) — so
   a new action with no chip color fails the build instead of shipping an uncolored pill.
   Grouped by the semantic palette; each class targets a disjoint chip, so rule order is
   irrelevant (no two action classes co-occur on one element). */
/* green — create / add / positive */
.activity-claimed, .activity-joined, .activity-participant_added,
.activity-meal_logged, .activity-meal_edited,
.activity-contact_added, .activity-contact_updated,
.activity-medication_added, .activity-medication_updated, .activity-medication_taken,
.activity-bp_recorded { background: #e8f4eb; color: #265d34; }
/* red — delete / remove / reverse */
.activity-unclaimed, .activity-left, .activity-participant_removed, .activity-comment_deleted,
.activity-meal_deleted,
.activity-contact_deleted, .activity-medication_deleted, .activity-medication_unmarked,
.activity-bp_deleted { background: #f8dddd; color: var(--danger); }
/* blue — assignment / hydration / bp edit */
.activity-assigned, .activity-bp_edited { background: #e9eef8; color: #2e4d85; }
.activity-hydration_updated { background: #e7f1fb; color: #24577e; }
/* accent — comment */
.activity-commented { background: var(--accent-soft); color: var(--accent); }
/* gold — meal day note */
.activity-meal_note_updated { background: #fff0d8; color: var(--gold); }
/* neutral — profile rename (also the generic fallback chip) */
.activity-renamed { background: #fffaf2; color: var(--muted); border: 1px solid var(--line); }
.activity-item strong { font-size: 0.94rem; }
.activity-slot, .activity-time { margin-top: 3px; color: var(--muted); font-size: 0.82rem; }
.activity-time { opacity: 0.78; }
.shift-title { display: flex; align-items: center; gap: 8px; font-weight: 750; }
.shift-note { margin-top: 6px; color: var(--muted); font: italic 0.9rem Georgia, serif; }
.calendar-toolbar { display: flex; justify-content: flex-end; gap: 8px; margin: 0 0 8px; }
.calendar-toolbar .secondary-button { width: auto; padding-block: 6px; font-size: 0.82rem; line-height: 1; }
.calendar-toolbar .secondary-button:disabled { opacity: 0.45; cursor: not-allowed; }
.calendar-card { margin-top: 0; overflow: visible; }
#calendar-view { padding-bottom: calc(160px + env(safe-area-inset-bottom)); }
.appointments-card { margin-top: 16px; }
#appointments-view.appointments-card { margin-top: 0; margin-bottom: calc(160px + env(safe-area-inset-bottom)); }
.appointment-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.appointment-add-button { display: grid; place-items: center; flex: 0 0 auto; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 999px; padding: 0 0 2px; background: #fffaf2; color: var(--text); font-size: 1.55rem; font-weight: 850; line-height: 1; }
.appointment-add-button:hover { border-color: #d7cab9; background: white; }
.segment-picker { display: inline-flex; gap: 4px; margin: 0 0 10px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: #fffaf2; }
.appointment-toolbar .segment-picker { margin: 0; }
.segment-button { border: 0; border-radius: 999px; padding: 8px 12px; background: transparent; color: var(--text); font-weight: 800; }
.segment-button.active { background: var(--text); color: white; }
.appointment-item { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.appointment-actions { display: flex; gap: 8px; margin-top: 0; align-items: center; }
.appointment-notes { margin: 6px 0 0; color: var(--muted); font-size: 0.9rem; line-height: 1.35; white-space: pre-wrap; }
.appointment-doctor { margin-top: 2px; color: var(--text); font-size: 0.92rem; font-weight: 600; }
.appointment-confirm-copy { margin: 0; color: var(--text); font-weight: 800; line-height: 1.35; }
.appointment-actions .menu-item { width: auto; padding-inline: 12px; }
.calendar-cell-open small { display: block; margin-top: 3px; color: var(--muted); font-size: 0.72rem; }
.appointment-unclaimed-label { display: block; margin: -1px 0 5px; color: var(--danger); font-size: 0.5rem; font-style: normal; font-weight: 900; line-height: 1; text-transform: uppercase; letter-spacing: 0.06em; }
.appointment-cell-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-size: 0.74rem; font-weight: 750; line-height: 1.05; }
.open-cell-label { font-size: 0.58rem; font-weight: 400; }
.calendar-scroll-hint { display: none; margin: 0 0 10px; color: var(--muted); font-size: 0.78rem; font-weight: 750; text-align: right; }
.calendar-grid-wrap { position: relative; overflow-x: auto; padding-bottom: 4px; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.calendar-grid-wrap::after { content: ""; position: sticky; right: 0; display: block; float: right; width: 28px; height: 1px; margin-top: -1px; pointer-events: none; box-shadow: -18px 0 24px 20px var(--card); }
.calendar-grid { display: grid; grid-template-columns: 92px repeat(var(--day-count), minmax(118px, 1fr)); gap: 5px; min-width: 920px; }
.calendar-corner { position: sticky; left: 0; z-index: 3; display: flex; align-items: center; padding: 14px 10px; background: var(--card); color: var(--muted); text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.68rem; font-weight: 800; }
.calendar-day-head { display: grid; grid-template-columns: 1fr auto; align-items: start; min-height: 58px; border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; background: #ece5da; color: var(--text); text-align: left; }
.calendar-day-head span { color: var(--muted); text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.58rem; font-weight: 850; }
.calendar-day-head strong { grid-column: 1; font: 500 1.55rem/1 Georgia, serif; }
.calendar-day-head em { color: var(--accent); text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.52rem; font-style: normal; font-weight: 900; }
.calendar-day-head.today { background: var(--text); color: white; border-color: var(--text); }
.calendar-day-head.today span { color: #c8bfb3; }
.calendar-shift-label { position: sticky; left: 0; z-index: 2; display: flex; align-items: center; min-height: 58px; padding: 10px; background: var(--card); color: var(--muted); font-size: 0.86rem; }
.calendar-cell { min-height: 58px; border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: #fffaf2; color: var(--muted); text-align: left; }
.calendar-cell-open { display: flex; align-items: center; justify-content: center; text-align: center; }
.calendar-cell-open:hover { border-color: #d7cab9; background: white; }
.calendar-cell-appointment-open { background: #fff0ef; border-color: #efc0bc; color: var(--text); padding-top: 6px; }
.calendar-cell-appointment-open:hover { background: #fff6f5; border-color: #df9d98; }
.calendar-cell-filled { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: center; background: #dcefdc; border-color: #c5e0c7; color: var(--text); cursor: pointer; }
.calendar-cell-appointment-claimed { background: #e7f1fb; border-color: #bdd7ef; }
.calendar-cell-filled:hover { border-color: #95c89c; }
.calendar-cell-appointment-claimed:hover { border-color: #8fbce3; background: #edf6ff; }
.calendar-avatar { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #bce2c1; color: #2d7040; font-size: 0.62rem; font-weight: 900; text-transform: uppercase; }
.calendar-cell-appointment-claimed .calendar-avatar { background: #a9cfee; color: #24577e; }
.calendar-cell-copy { min-width: 0; }
.calendar-cell-copy div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.83rem; }
.hourly-day { display: grid; gap: 14px; }
.hourly-day-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.hourly-day-heading span { color: var(--muted); text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.68rem; font-weight: 850; }
.hourly-day-heading strong { font: 500 1.6rem/1 Georgia, serif; }
.hourly-slot-list { display: grid; gap: 8px; }
.hourly-group-heading { margin: 12px 0 2px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.68rem; }
.hourly-slot-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: center; width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fffaf2; color: var(--text); text-align: left; }
.hourly-slot-row:hover { border-color: #d7cab9; background: white; }
.hourly-slot-covered { background: #e8f4eb; border-color: #c5e0c7; }
.hourly-slot-appointment { background: #e7f1fb; border-color: #bdd7ef; }
.hourly-slot-open { color: var(--muted); }
.hourly-slot-time { color: var(--text); font-weight: 850; }
.hourly-slot-body { display: grid; gap: 3px; min-width: 0; }
.hourly-slot-body small { color: var(--muted); font-size: 0.8rem; }
.claim-range-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.claim-time-select .fancy-select-trigger, .claim-person-select .fancy-select-trigger, .appointment-duration-select .fancy-select-trigger, .contact-type-select .fancy-select-trigger { background: #fffaf2; font-weight: 800; }
.claim-time-select .fancy-select-options, .claim-person-select .fancy-select-options, .appointment-duration-select .fancy-select-options, .contact-type-select .fancy-select-options { max-height: 260px; overflow-y: auto; }
.claim-person-field, .claim-comment-field { margin-top: 12px; }
#claim-appointment-details { margin-top: 16px; }
.claim-time-option:disabled { opacity: 0.35; cursor: not-allowed; }
.multi-calendar { --hour-row-height: 58px; display: grid; grid-template-columns: repeat(var(--day-count), minmax(180px, 1fr)); column-gap: 12px; row-gap: 8px; min-width: 640px; overflow-x: auto; }
.multi-calendar-day { display: grid; grid-template-rows: 58px auto; min-width: 0; }
.multi-calendar-day-hospitalized .multi-calendar-day-head { background: #fde2e2; border-radius: 8px 8px 0 0; padding: 0 6px 10px; border-bottom-color: #f5b5b5; }
.calendar-hospitalization-mark { font-size: 0.85em; margin-left: 4px; vertical-align: middle; }
.multi-calendar-day-head { display: flex; align-items: end; justify-content: space-between; gap: 8px; min-height: 58px; padding: 0 0 10px; border-bottom: 1px solid var(--line); }
.multi-calendar-day-head > div { display: grid; gap: 4px; min-width: 0; }
.multi-calendar-day-head span { color: var(--muted); text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.62rem; font-weight: 850; }
.multi-calendar-day-head strong { font: 500 1.28rem/1 Georgia, serif; }
.day-add-time-button { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 999px; padding: 0 0 2px; background: #fffaf2; color: var(--text); font-size: 1.35rem; font-weight: 850; line-height: 1; white-space: nowrap; }
.day-add-time-button:hover { border-color: #d7cab9; background: white; }
.multi-calendar-block-grid { display: grid; grid-template-rows: repeat(13, var(--hour-row-height)); gap: 6px; padding-top: 6px; }
.calendar-claim-block { position: relative; display: grid; align-content: start; gap: 2px; min-height: 0; width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: #fffaf2; color: var(--text); text-align: left; overflow: hidden; }
.calendar-block-header { display: flex; align-items: center; gap: 6px; min-width: 0; }
.calendar-block-header .calendar-block-time { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-block-meta { display: flex; align-items: center; gap: 6px; min-width: 0; }
.calendar-claim-block:hover { border-color: #d7cab9; background: white; }
.calendar-claim-block-covered { background: #e8f4eb; border-color: #c5e0c7; }
.calendar-claim-block-open { color: var(--muted); }
.calendar-claim-block-appointment { background: #e7f1fb; border-color: #bdd7ef; }
.calendar-block-time { color: var(--muted); font-size: 0.72rem; font-weight: 850; }
.calendar-claim-block strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9rem; line-height: 1.08; }
.calendar-claim-block small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 0.74rem; line-height: 1; }
.calendar-block-icons { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; color: var(--muted); font-size: 0.76rem; line-height: 1; letter-spacing: -0.16em; }
.calendar-block-recipient { justify-self: start; padding: 1px 6px; border-radius: 999px; font-size: 0.65rem; font-weight: 800; letter-spacing: normal; line-height: 1.1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comment-indicator { display: inline-block; margin-top: 4px; margin-right: 4px; color: var(--muted); font-style: normal; font-size: 0.82rem; line-height: 1; }
.day-card { padding: 18px 20px; scroll-margin-top: 24px; margin-bottom: 14px; }
.day-card h3 { margin: 0 0 8px; font: 500 1.35rem Georgia, serif; }
.slot { display: grid; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.slot:first-of-type { border-top: 0; }
.slot-main { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.slot-title { font-weight: 800; }
.reserved { color: var(--muted); }
.slot-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center; }
.reserve-button, .quick-reserve-button { border: 0; border-radius: 999px; padding: 10px 14px; background: var(--text); color: white; font-weight: 800; }
.reserve-button:disabled { opacity: 0.65; cursor: wait; }
.danger-button { background: var(--danger); color: white; }
.field-label { display: grid; gap: 6px; color: var(--muted); font-size: 0.9rem; font-weight: 700; }
input, textarea, select { width: 100%; max-width: 100%; border: 1px solid #d7c8bc; border-radius: 12px; padding: 10px; color: var(--text); background: white; }
.slot-menu { position: relative; }
.slot-menu summary { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 999px; background: #fffaf2; border: 1px solid var(--line); color: var(--text); font-size: 1.35rem; font-weight: 900; cursor: pointer; list-style: none; }
.slot-menu summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; min-width: 150px; padding: 6px; background: white; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 35px rgb(68 45 25 / 18%); }
.menu-item { width: 100%; border: 0; border-radius: 10px; padding: 10px 12px; background: transparent; color: var(--text); text-align: left; font-weight: 750; }
.menu-item:hover { background: var(--accent-soft); }
.unclaim-button { color: var(--danger); }
.name-dialog { width: min(420px, calc(100% - 32px)); border: 0; border-radius: 22px; padding: 0; overflow: visible; box-shadow: 0 24px 70px rgb(68 45 25 / 28%); margin-top: max(12px, env(safe-area-inset-top)); margin-bottom: max(12px, env(safe-area-inset-bottom)); max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
.color-picker { border: 0; padding: 14px 0 6px; margin: 0; }
.color-picker legend { padding: 0 4px 8px; font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.color-picker-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.color-swatch { width: 38px; height: 38px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; display: grid; place-items: center; font-size: 0.9rem; font-weight: 900; padding: 0; }
.color-swatch.selected { border-color: var(--accent); }
#claim-confirm-dialog, #claim-appointment-confirm-dialog { margin-top: 8svh; margin-bottom: auto; }
.name-dialog::backdrop { background: rgb(47 42 37 / 45%); }
.name-card { display: flex; flex-direction: column; gap: 16px; padding: 20px; max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); background: var(--card); border-radius: 22px; }
.form-dialog-body { display: flex; flex-direction: column; gap: 16px; overflow-y: auto; min-height: 0; }
.name-card input { width: 100%; max-width: 100%; min-width: 0; }
.toggle-field { display: flex; align-items: center; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: 0.9rem; }
.toggle-field[hidden] { display: none; }
.toggle-field span { display: grid; gap: 3px; }
.toggle-field strong { color: var(--text); }
.toggle-field small { display: block; color: var(--muted); }
.toggle-field input { width: auto; flex: 0 0 auto; }
.meal-delete-card, .meal-time-card { gap: 14px; }
.meal-delete-card #meal-delete-copy { margin: 0; line-height: 1.4; }
.easter-egg-dialog { width: min(360px, calc(100% - 32px)); }
.easter-egg-card { position: relative; padding: 14px; }
.easter-egg-close { position: absolute; top: 8px; right: 8px; z-index: 1; }
.easter-egg-gif { display: block; width: 100%; border-radius: 16px; }
.reservation-drawer { position: fixed; inset: 0; z-index: 20; overflow: hidden; pointer-events: none; }
.reservation-drawer.open { pointer-events: auto; }
.drawer-backdrop { position: absolute; inset: 0; background: rgb(47 42 37 / 0%); transition: background 160ms ease; }
.reservation-drawer.open .drawer-backdrop { background: rgb(47 42 37 / 38%); }
.drawer-card { position: absolute; top: 0; right: 0; display: flex; flex-direction: column; gap: 18px; width: min(420px, 92vw); height: 100%; padding: 24px; background: var(--card); box-shadow: -18px 0 50px rgb(52 43 31 / 18%); transform: translateX(100%); transition: transform 180ms ease; overflow-y: auto; }
.reservation-drawer.open .drawer-card { transform: translateX(0); }
.drawer-card .section-heading, .name-card .section-heading { align-items: flex-start; flex-direction: row; margin-bottom: 2px; }
.drawer-card .section-heading > div, .name-card .section-heading > div { min-width: 0; }
.drawer-card h2, .name-card h2 { font: 700 1.15rem/1.12 ui-sans-serif, system-ui, sans-serif; letter-spacing: -0.03em; }
.drawer-close-button { display: flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 34px; height: 34px; padding: 0 0 2px; border: 1px solid var(--line); border-radius: 999px; background: #fffaf2; color: var(--text); font-size: 1.2rem; font-weight: 800; line-height: 1; }
.drawer-card .field-label { gap: 8px; }
.participants-section, .slot-comments-section { display: grid; gap: 10px; }
.participants-section h3, .slot-comments-section h3 { margin: 0; font-size: 0.92rem; }
.participant-list, .comment-list { display: grid; gap: 8px; }
.participant-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 12px; background: #fffaf2; font-weight: 750; }
.compact-empty { padding: 4px 0; margin: 0; font-size: 0.86rem; }
.comment-row { display: grid; gap: 5px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 12px; background: #fffaf2; }
.comment-row p { margin: 0; white-space: pre-wrap; }
.comment-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 0.78rem; }
.comment-actions { display: flex; gap: 10px; }
.comment-edit-textarea { width: 100%; min-height: 86px; resize: vertical; }
.comment-edit-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.comment-edit-actions .secondary-button, .comment-edit-actions .reserve-button { width: 100%; }
#participant-add-button, #comment-post-button { width: 100%; }
.drawer-appointment-details { display: grid; gap: 5px; padding: 12px; border: 1px solid #c5e0c7; border-radius: 14px; background: #e8f4eb; color: var(--text); }
.drawer-appointment-details .eyebrow { margin: 0; color: #2d7040; }
.drawer-appointment-details span { color: var(--muted); font-size: 0.9rem; }
.drawer-card input, .drawer-card textarea { min-height: auto; padding: 12px; font-size: 1rem; }
.fancy-select { position: relative; }
.fancy-select-trigger { display: flex; align-items: center; justify-content: space-between; width: 100%; border: 1px solid #d7c8bc; border-radius: 12px; padding: 12px; background: white; color: var(--text); font-size: 1rem; font-weight: 650; line-height: 1.2; }
.fancy-select-trigger span:last-child { display: flex; align-items: center; justify-content: center; line-height: 1; }
.fancy-select-options { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; display: none; padding: 6px; background: white; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 35px rgb(68 45 25 / 18%); }
.fancy-select.open .fancy-select-options { display: grid; gap: 4px; }
.fancy-select-option { display: flex; align-items: center; justify-content: space-between; width: 100%; border: 0; border-radius: 10px; padding: 10px 12px; background: transparent; color: var(--text); text-align: left; font-weight: 750; }
.fancy-select-option:hover, .fancy-select-option.selected { background: var(--accent-soft); }
.drawer-card textarea { resize: vertical; }
.inline-unclaim-button { justify-self: start; width: auto; border: 1px solid var(--line); border-radius: 999px; padding: 7px 11px; background: #fffaf2; color: var(--danger); font-size: 0.78rem; font-weight: 800; }
.drawer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: center; margin-top: auto; padding-top: 12px; }
/* FormDialog footer: anchored at the bottom of the card by `margin-top: auto` (flex)
   and visually separated from the scrolled body above by a top border. The body
   above scrolls; the footer doesn't move. */
.name-dialog .drawer-actions { flex-shrink: 0; padding-top: 12px; border-top: 1px solid var(--line); }
.drawer-actions-single { grid-template-columns: 1fr; }
.drawer-actions .reserve-button, .drawer-actions .secondary-button { width: 100%; }

@media (max-width: 820px) {
  .top-bar { justify-content: center; }
  .view-nav { justify-self: auto; }
  .home-grid { grid-template-columns: 1fr; }
  .coverage-row { grid-template-columns: 46px minmax(0, 1fr); }
  .shift-row { grid-template-columns: 46px minmax(0, 1fr) auto; }
  .shift-unclaim-button { grid-column: auto; justify-self: end; align-self: center; white-space: nowrap; }
  .slot-chip-list { grid-column: 2; justify-content: flex-start; }
}

@media (max-width: 560px) {
  .gate-view { align-items: start; padding-top: 16svh; }
  .page-shell { padding: 16px; padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
  .top-bar { display: none; }
  .brand-name { white-space: normal; }
  .view-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; border-radius: 22px; }
  .nav-button { min-width: 0; padding: 8px 6px; font-size: 0.84rem; }
  .nav-label-full { display: none; }
  .nav-label-short { display: inline; }
  .user-pill { top: 0; right: 0; transform: none; }
  .signed-in-label { display: none; }
  .hero { padding-top: 28px; }
  .section-heading { align-items: start; flex-direction: row; }
  .calendar-scroll-hint { display: block; }
  .calendar-card { padding-inline: 16px; }
  .calendar-grid { grid-template-columns: 82px repeat(var(--day-count), minmax(118px, 118px)); min-width: max-content; }
  .multi-calendar { grid-template-columns: repeat(var(--day-count), minmax(150px, 150px)); column-gap: 10px; min-width: max-content; }
  .coverage-row { grid-template-columns: 40px 1fr; gap: 8px 12px; align-items: center; }
  .slot-chip-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; justify-content: stretch; width: 100%; }
  .coverage-slot-cell { min-width: 0; width: 100%; }
  .slot-chip { width: 100%; padding-inline: 6px; font-size: 0.76rem; }
  .slot-main { align-items: stretch; flex-direction: column; }
  .slot-actions { justify-content: flex-start; }
  .quick-reserve-button, .secondary-button, .reserve-button { width: 100%; }
  .shift-unclaim-button { width: auto; min-width: 0; padding: 5px 9px; }
  #refresh-button { width: 34px; height: 34px; padding: 0; display: grid; place-items: center; flex: 0 0 auto; }
  .slot-menu { align-self: flex-start; }
  .menu-panel { left: 0; right: auto; }
}

.meals-view { display: grid; gap: 18px; width: 100%; max-width: 100%; min-width: 0; overflow-x: clip; }
.meals-view > * { max-width: 100%; min-width: 0; }
.meals-date-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; width: 100%; max-width: 100%; min-width: 0; }
.meals-date-toolbar > .secondary-button { width: auto; padding-block: 6px; font-size: 0.82rem; line-height: 1; }
.meals-date-toolbar > .secondary-button:first-child { grid-column: 2; grid-row: 1; }
.meals-date-toolbar > .secondary-button:last-child { grid-column: 3; grid-row: 1; }
.meals-date-strip { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; overflow: visible; min-width: 0; }
.meal-date-button { min-width: 0; border: 0; border-radius: 12px; padding: 11px 6px; background: #ede5d8; color: var(--text); text-align: center; }
.meal-date-button span { display: block; color: var(--muted); text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.58rem; font-weight: 850; }
.meal-date-button strong { display: block; margin-top: 3px; font: 500 1.35rem/1 Georgia, serif; }
.meal-date-button em { display: block; margin-top: 4px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.52rem; font-style: normal; font-weight: 900; }
.meal-date-button.selected { background: var(--text); color: white; }
.meal-date-button.selected span, .meal-date-button.selected em { color: #d9d0c4; }
.meals-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.9fr); grid-template-areas: "dose hydration" "vital-bp hydration" "meals note"; gap: 18px; align-items: start; width: 100%; }
.medication-dose-card { grid-area: dose; width: 100%; }
.meals-card { grid-area: meals; width: 100%; }
.hydration-card { grid-area: hydration; width: 100%; }
.vital-day-log-bp { grid-area: vital-bp; width: 100%; }
.meal-note-card { grid-area: note; width: 100%; }
.vital-day-log .section-heading { margin-bottom: 8px; }
.vital-day-log-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.vital-day-log-row { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fffaf2; }
.vital-day-log-time { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--muted); font-size: 0.85rem; }
.vital-day-log-value { font-weight: 700; color: var(--text); }
.vital-day-log-actions { display: inline-flex; gap: 8px; }
.vital-day-log-empty { margin: 0 0 12px; }
.vital-day-log-status { margin: 0 0 12px; }
.vital-day-log-form { display: grid; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
/* Two rows on narrow widths (time alone, then the 3 vital numbers share a
   row); auto-fit lets desktop widen them into one row when room allows. The
   3-column floor for the vital fields keeps systolic / diastolic / pulse all
   visible on phones — they share `vital-day-log-field-vital`. */
.vital-day-log-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.vital-day-log-fields-vitals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.vital-day-log-field { display: grid; gap: 4px; font-size: 0.78rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.vital-day-log-field input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--text); font-size: 0.95rem; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 0; }
.vital-day-log-form-actions { display: flex; gap: 8px; justify-content: flex-end; }
/* Match the hydration "Add a glass" button: same compact font + padding. */
.vital-day-log-form-actions .reserve-button { font-size: 0.86rem; padding-block: 9px; }
#meal-sections { display: grid; gap: 0; }
.meal-section { display: grid; grid-template-columns: 38px minmax(0, 1fr); column-gap: 10px; row-gap: 12px; padding: 16px 0; border-top: 1px solid var(--line); }
.meal-section:first-child { border-top: 0; padding-top: 0; }
.meal-section-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: #d9f0dc; color: #2d7040; font-size: 0.86rem; }
.meal-section-icon .lucide-icon { width: 16px; height: 16px; }
.meal-section-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 0; }
.meal-section-heading h3 { margin: 0; font: 500 1.08rem/1.1 Georgia, serif; }
.meal-section-heading small { color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.66rem; }
.meal-add-button, .meal-edit-button, .meal-delete-button { border: 0; background: transparent; color: var(--muted); font-size: 0.78rem; }
.meal-log-list { grid-column: 1 / -1; display: grid; gap: 10px; }
.meal-log-card { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 9px; padding: 10px 12px; border-radius: 10px; background: #f7f0e6 !important; }
.meal-log-time { color: var(--muted); font: 0.68rem/1.15 ui-monospace, SFMono-Regular, Menlo, monospace; }
.meal-log-main { display: grid; gap: 10px; min-width: 0; }
.meal-log-body strong { font-size: 0.9rem; }
.meal-log-body p { margin: 4px 0 0; color: var(--muted); font: italic 0.86rem Georgia, serif; }
.meal-log-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; color: var(--muted); font-size: 0.72rem; }
.mini-avatar { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #ffd8c2; color: var(--accent); font-size: 0.52rem; font-weight: 900; }
.portion-badge { --portion-fill: 0%; display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 10px; font-size: 0.7rem; font-weight: 800; }
.portion-badge::before { content: ""; width: 28px; height: 3px; border-radius: 999px; background: linear-gradient(to right, currentColor 0 var(--portion-fill), color-mix(in srgb, currentColor 18%, transparent) var(--portion-fill) 100%); }
.portion-all { --portion-fill: 100%; background: #dff1dc; color: #2d7040; }
.portion-most { --portion-fill: 80%; background: #dff1dc; color: #2d7040; }
.portion-half { --portion-fill: 50%; background: #ffe2a9; color: #815b06; }
.portion-few-bites { --portion-fill: 25%; background: #ffd9a6; color: #805107; }
.portion-refused { --portion-fill: 0%; background: #ffd7cf; color: #a33a35; }
.meal-log-footer { display: flex; justify-content: space-between; gap: 10px; align-items: center; color: var(--muted); font-size: 0.72rem; }
.meal-log-actions { display: flex; gap: 6px; align-items: center; }
.meal-log-logger { display: inline-flex; justify-content: flex-end; align-items: center; gap: 6px; min-width: 0; text-align: right; }
.meal-log-form { display: grid; gap: 10px; width: 100%; padding: 12px; border: 1px solid var(--text); border-radius: 12px; background: #f7f0e6; }
.meal-form-header, .meal-form-footer, .meal-form-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.meal-form-header span { color: var(--muted); text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.62rem; font-weight: 850; }
.meal-form-header button { border: 0; background: transparent; color: var(--muted); font-size: 1.1rem; }
.meal-description-input { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: white; padding: 10px 12px; }
.meal-description-input:focus { outline: 2px solid color-mix(in srgb, var(--accent) 28%, transparent); border-color: color-mix(in srgb, var(--accent) 38%, var(--line)); }
.meal-portion-options { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.portion-choice { border-radius: 999px; padding: 7px 10px; background: #ede5d8; color: var(--text); font-size: 0.7rem; }
.portion-choice input { display: none; }
.portion-choice.selected, .portion-choice:has(input:checked) { background: #dff1dc; color: #2d7040; }
.portion-choice-half.selected, .portion-choice-few-bites.selected,
.portion-choice-half:has(input:checked), .portion-choice-few-bites:has(input:checked) { background: #ffe2a9; color: #815b06; }
.portion-choice-refused.selected, .portion-choice-refused:has(input:checked) { background: #ffd7cf; color: #a33a35; }
.meal-form-row { align-items: stretch; }
.meal-form-row .meal-note-input { flex: 1 1 auto; min-height: 76px; resize: vertical; font-size: 12px !important; line-height: 1.3; }
.meal-time-field { display: block; flex: 0 0 82px; align-self: flex-start; cursor: pointer; }
.meal-time-input { display: none; }
.meal-time-button { width: 100%; border: 1px solid #d7c8bc; border-radius: 12px; padding: 10px 5px; background: white; color: var(--text); text-align: center; font-size: 12px !important; line-height: 1.2; cursor: pointer; }
.meal-time-picker-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.meal-form-footer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.meal-form-footer small { min-width: 0; color: var(--muted); font-size: 0.78rem; white-space: nowrap; }
.meal-form-footer > div { display: flex; gap: 8px; align-items: center; }
.meal-form-footer .secondary-button, .meal-form-footer .reserve-button { width: auto; min-width: 72px; padding: 8px 13px; line-height: 1; font-size: 0.9rem; }
.hydration-heading { margin-bottom: 8px; }
.hydration-heading #hydration-meta { margin: 6px 0 0; }
.hydration-glasses { display: grid; grid-template-columns: repeat(8, minmax(22px, 1fr)); gap: clamp(4px, 2.2vw, 10px); margin: 16px 0; }
.hydration-glass-button { display: grid; gap: 4px; justify-items: center; justify-self: center; border: 0; padding: 0; background: transparent; color: var(--muted); font-size: 0.68rem; }
.hydration-glass-button span { display: block; width: 22px; height: 30px; border: 1px solid #b8ab9c; border-radius: 4px 4px 8px 8px; background: linear-gradient(to top, #2b91bd 0 var(--fill, 0%), transparent var(--fill, 0%)); }
.hydration-glass-button.filled span { --fill: 78%; }
.hydration-footer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: center; }
.hydration-footer .reserve-button { width: 100%; font-size: 0.86rem; padding-block: 9px; }
#meal-day-note-meta, #hydration-meta, #hydration-updated-meta { margin-top: 0; font-size: 0.82rem; }
#hydration-updated-meta { margin: 0; text-align: right; }
/* The meal/hydration/note activity-feed chip colors moved into the consolidated
   "Activity-feed chip COLORS" palette block near the feed styles above (one home for
   all 24 action chips, pinned by server/test/activityChipStyles.test.ts). */
@media (max-width: 760px) {
  .meals-date-toolbar { grid-template-columns: minmax(0, 1fr) auto auto; overflow: clip; }
  .meals-date-toolbar > .secondary-button { width: auto; min-width: 0; }
  .meals-date-strip { gap: 6px; }
  .meal-date-button { padding: 10px 3px; border-radius: 10px; }
  .meal-date-button strong { font-size: 1.16rem; }
  .meal-date-button span { font-size: 0.52rem; letter-spacing: 0.12em; }
  .meal-date-button em { font-size: 0.48rem; letter-spacing: 0.08em; }
  .meals-layout { display: flex; flex-direction: column; align-items: stretch; }
  .medication-dose-card { order: 1; }
  .vital-day-log-bp { order: 2; }
  .hydration-card { order: 3; }
  .meals-card { order: 4; }
  .meal-note-card { order: 5; }
  .meal-log-card { grid-template-columns: 36px minmax(0, 1fr); }
  .meal-log-footer { grid-column: auto; }
  .meal-log-form { margin-left: 0; width: 100%; }
}

.posts-panel { display: grid; gap: 12px; }
.posts-heading-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 8px 4px 4px; }
.posts-heading-row h1 { font-size: clamp(2rem, 8vw, 3.2rem); }
.posts-heading-row .muted { margin: 6px 0 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.78rem; letter-spacing: 0.16em; }
.new-post-button { width: auto; padding-inline: 18px; white-space: nowrap; font-weight: 500; }
.post-composer-trigger { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; border: 0; border-radius: 999px; padding: 12px 14px; background: var(--card); color: var(--muted); text-align: left; box-shadow: var(--shadow); }
.post-composer-image { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; background: #ede5d8; color: var(--text); }
.post-composer-image svg { width: 18px; height: 18px; }
.posts-list { display: grid; gap: 14px; }
.post-card { display: grid; gap: 13px; padding: 18px 20px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); }
.post-card-header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.post-avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #d9f0dc; color: #265d34; font-weight: 900; font-size: 0.78rem; }
.post-card:nth-child(3n+1) .post-avatar { background: #ffd8c2; color: var(--accent); }
.post-card:nth-child(3n+2) .post-avatar { background: #c9f0f5; color: #19636f; }
.post-card:nth-child(3n+3) .post-avatar { background: #e7c4ef; color: #723783; }
.post-card-author strong { display: block; font: 500 1.08rem/1.1 Georgia, serif; }
.post-card-author strong span { display: inline-block; margin-left: 5px; border-radius: 999px; padding: 2px 6px; background: #ede5d8; color: var(--muted); font: 800 0.52rem/1 ui-sans-serif, system-ui; text-transform: uppercase; }
.post-card-author small { display: block; margin-top: 4px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.64rem; letter-spacing: 0.08em; }
.post-menu { display: flex; gap: 6px; }
.post-menu button, .post-comments-toggle, .post-react-button { border: 0; background: transparent; color: var(--text); }
.post-menu button { color: var(--muted); font-size: 0.72rem; }
.post-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.46; }
.post-body a, .post-comment a { color: var(--accent); font-weight: 800; text-decoration: underline; text-underline-offset: 2px; }
.post-photo-grid { display: grid; overflow: hidden; border-radius: 8px; gap: 2px; }
.post-photo-grid-one { grid-template-columns: 1fr; }
.post-photo-grid-two, .post-photo-grid-many { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.post-photo-button { display: block; min-height: 160px; border: 0; padding: 0; background: #ede5d8; overflow: hidden; }
.post-photo-button img { display: block; width: 100%; height: 100%; object-fit: cover; }
.post-social-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 20px; color: var(--muted); font-size: 0.76rem; }
.post-social-summary > span, .post-social-summary > button { display: inline-flex; align-items: center; min-height: 20px; min-width: 0; }
.post-social-summary > :last-child { justify-self: end; text-align: right; }
.post-action-wrap { position: relative; }
.post-action-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: center; border-top: 1px solid var(--line); padding-top: 10px; }
.post-react-button, .post-comments-toggle { display: inline-flex; justify-content: center; align-items: center; gap: 6px; width: 100%; min-height: 34px; padding: 6px 8px; font-weight: 500; line-height: 1; }
.post-comments-toggle svg { width: 15px; height: 15px; }
.post-react-button.active { color: #b11711; font-size: 1.08rem; }
.post-react-button.popover-open, .post-comment-action.comments-open { border-radius: 8px; background: #efe8dc; }
.post-reaction-popover { position: absolute; left: 14px; bottom: calc(100% + 9px); z-index: 3; display: flex; gap: 11px; align-items: center; padding: 8px 13px; border: 1px solid rgb(231 223 211 / 80%); border-radius: 999px; background: #fffdf8; box-shadow: 0 16px 34px rgb(52 43 31 / 16%); }
.post-reaction-option { position: relative; display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 999px; padding: 0; background: transparent; color: var(--muted); }
.post-reaction-option.selected { color: #8b1f0d; }
.post-reaction-option.selected::before { content: ''; position: absolute; inset: 0; border-radius: 999px; background: #eadfce; }
.post-reaction-option.selected::before { transform: translate(1px, 2px) }
.post-reaction-option.selected[data-reaction="love"]::before { transform: translate(1px, 0px) }
.post-reaction-option span { position: relative; z-index: 1; display: grid; place-items: center; width: 100%; height: 100%; font-size: 1.20rem; line-height: 1; transform: translateY(-0.5px); }
.post-reaction-option[data-reaction="praying"] span { transform: translate(0.5px, 1px); }
.post-comments { display: grid; gap: 11px; padding-top: 10px; border-top: 1px solid var(--line); }
.post-comment { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 9px; align-items: start; }
.post-comment .mini-avatar, .post-comment-form .mini-avatar { width: 22px; height: 22px; background: #ffd8c2; }
.post-comment-content { min-width: 0; }
.post-comment-bubble { width: 100%; border-radius: 4px 14px 14px; padding: 9px 12px; background: #f0e9df; }
.post-comment-bubble strong { display: block; margin-bottom: 3px; font-size: 0.75rem; }
.post-comment-bubble p { margin: 0; color: var(--text); font-size: 0.82rem; line-height: 1.32; overflow-wrap: anywhere; }
.post-comment-meta { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; justify-content: flex-start; margin: 4px 0 0; color: var(--muted); font-size: 0.64rem; text-align: left; }
.post-comment-meta .link-button { color: var(--accent); font-size: 0.64rem; font-weight: 800; text-decoration: none; }
.post-comment-form { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 9px; align-items: center; }
.post-comment-input-wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; border-radius: 999px; background: #eee6d8; overflow: hidden; }
.post-comment-input-wrap input { border: 0; outline: 0; box-shadow: none; background: transparent; font-size: 0.82rem; }
.post-comment-input-wrap input:focus { outline: 0; box-shadow: none; }
.post-comment-input-wrap:focus-within { box-shadow: none; }
.post-comment-input-wrap button { display: grid; place-items: center; width: 32px; height: 32px; margin-right: 3px; border: 0; border-radius: 50%; background: #16130f; color: white; }
.post-comment-input-wrap button:disabled { background: #bdb4a8; }
.post-comment-edit-form { min-width: min(250px, 100%); }
.post-comment-edit-wrap { display: grid; gap: 7px; }
.post-comment-edit-wrap input { width: 100%; border: 0; border-radius: 14px; padding: 9px 12px; outline: 0; box-shadow: none; background: #eee6d8; font-size: 0.82rem; }
.post-comment-edit-actions { display: flex; gap: 10px; justify-content: flex-end; }
.post-comment-edit-actions .link-button { font-size: 0.68rem; font-weight: 700; }
.post-dialog-card textarea { resize: vertical; }
.contact-dialog-card { overscroll-behavior: contain; }
.post-photo-picker { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px; background: #fffaf2; font-weight: 800; }
.post-photo-picker input { display: none; }
.post-photo-preview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.post-photo-preview-item { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 10px; background: #ede5d8; }
.post-photo-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.post-photo-remove-button { position: absolute; top: 5px; right: 5px; width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgb(32 28 24 / 78%); color: white; }
.contacts-view { display: grid; gap: 14px; }
.contacts-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-width: 0; }
.contacts-heading-row h1 { margin: 0 0 4px; font-size: clamp(1.8rem, 7vw, 2.35rem); letter-spacing: -0.04em; }
.contacts-heading-row .muted { margin: 6px 0 0; overflow-wrap: anywhere; font-size: 0.8rem; }
.new-contact-button { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border: 0; border-radius: 999px; background: var(--text); color: white; font-size: 1.2rem; line-height: 1; }
.contacts-search-field { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; background: #fffdf8; color: var(--muted); box-shadow: 0 7px 20px rgb(52 43 31 / 4%); }
.contacts-search-field svg { width: 13px; height: 13px; }
.contacts-search-field input { min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 0.78rem; line-height: 1.2; }
.contact-type-filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.contact-type-filters::-webkit-scrollbar { display: none; }
.contact-filter-chip { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; background: #fffdf8; color: var(--text); font-size: 0.78rem; }
.contact-filter-chip.active { border-color: var(--text); background: var(--text); color: white; }
.contact-filter-chip small { opacity: 0.65; }
.contacts-list { display: grid; gap: 18px; }
.contact-group { display: grid; gap: 10px; }
.contact-group-heading { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 8px; align-items: center; color: var(--muted); text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.6rem; }
.contact-group-heading small { justify-self: end; letter-spacing: 0; font-size: 0.7rem; }
.lucide-icon { display: block; width: 1em; height: 1em; flex: 0 0 auto; }
.contact-group-icon { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 7px; background: #dff2e1; color: #347345; letter-spacing: 0; }
.contact-group-list { display: grid; gap: 10px; }
.contact-card { position: relative; display: grid; gap: 10px; border: 1px solid var(--line); border-radius: 14px; padding: 16px 8px 12px 14px; background: #fffdf8; box-shadow: 0 10px 26px rgb(52 43 31 / 5%); overflow: visible; }
.contact-accent { position: absolute; inset: 0 auto 0 0; width: 3px; border-radius: 14px 0 0 14px; background: #4d8a59; }
.contact-card-header { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; }
.contact-kind-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: #dff2e1; color: #347345; font-size: 0.85rem; }
.contact-title-block { min-width: 0; }
.contact-title-block h3 { margin: 0; font-size: 0.95rem; line-height: 1.12; }
.contact-title-block p { margin: 2px 0 0; color: var(--muted); font-size: 0.74rem; }
.contact-action-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px; gap: 3px; }
.contact-action-button, .contact-menu-button { display: flex; align-items: center; gap: 7px; justify-content: flex-start; min-height: 37px; border: 0; border-radius: 7px; padding: 9px 10px; background: #eee6d8; color: var(--text); font-size: 0.78rem; font-weight: 750; text-decoration: none; }
.contact-action-button .lucide-icon { width: 14px; height: 14px; }
.contact-action-button.disabled { opacity: 0.5; }
.contact-menu { position: relative; }
.contact-menu-button { justify-content: center; width: 36px; padding-inline: 0; letter-spacing: 1px; }
.contact-menu-popover { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; display: grid; gap: 4px; min-width: 160px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #fffdf8; box-shadow: 0 15px 35px rgb(20 18 16 / 16%); }
.contact-menu-popover button { display: flex; align-items: center; gap: 10px; border: 0; border-radius: 8px; padding: 9px 10px; background: transparent; color: var(--text); text-align: left; font-size: 0.82rem; }
.contact-menu-popover button:hover { background: #f2ece2; }
.contact-menu-popover .danger { color: var(--danger); }
.contact-detail-list { display: grid; gap: 9px; padding: 10px 1px 0; border-top: 1px dashed var(--line); }
.contact-detail-list div { display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 10px; align-items: start; }
.contact-detail-list span { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.56rem; }
.contact-detail-list span .lucide-icon { width: 10px; height: 10px; stroke-width: 1.8; }
.contact-detail-list p, .contact-detail-list a { margin: 0; color: var(--text); font-size: 0.78rem; line-height: 1.35; overflow-wrap: anywhere; }
.contact-detail-list a { text-decoration: underline; text-underline-offset: 2px; }
.contact-photo-button { width: 100%; height: 120px; border: 0; border-radius: 10px; padding: 0; background: #ede5d8; overflow: hidden; }
.contact-photo-button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.contact-updated { display: flex; align-items: center; gap: 7px; margin-top: 3px; padding-top: 8px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 0.68rem; }
.contact-updated .mini-avatar { width: 15px; height: 15px; font-size: 0.42rem; background: #dff2e1; color: #347345; }
.contact-photo-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
@media (max-width: 520px) { .contacts-heading-row { align-items: center; } .contact-card { padding-right: 7px; } }

.post-gallery-dialog { position: fixed; inset: 0; width: 100dvw; height: 100dvh; max-width: none; max-height: none; margin: 0; border: 0; padding: 0; overflow: hidden; background: rgb(20 18 16 / 94%); }
.post-gallery-dialog::backdrop { background: rgb(20 18 16 / 94%); }
.post-gallery-dialog img { position: fixed; inset: 0; max-width: 100dvw; max-height: 100dvh; margin: auto; object-fit: contain; }
.post-gallery-close { position: fixed; z-index: 4; top: max(14px, env(safe-area-inset-top)); right: max(14px, env(safe-area-inset-right)); background: rgb(255 250 242 / 94%); }
.post-gallery-nav { position: fixed; z-index: 3; top: 50dvh; transform: translateY(-50%); width: 44px; height: 44px; border: 0; border-radius: 999px; background: rgb(255 250 242 / 88%); font-size: 2rem; }
.post-gallery-prev { left: max(18px, env(safe-area-inset-left)); }
.post-gallery-next { right: max(18px, env(safe-area-inset-right)); }
@media (max-width: 560px) {
  .posts-heading-row { align-items: end; }
  .new-post-button { font-size: 0.82rem; padding: 9px 14px; }
  .post-card { padding: 18px 20px; }
  .post-photo-button { min-height: 160px; }
}

.shifts-panel .section-heading { margin-bottom: 18px; }
.shifts-heading { align-items: flex-start; }
.shifts-all-button { color: var(--muted); font-size: 0.76rem; font-weight: 500; text-decoration: none; }
.home-shift-row { grid-template-columns: 48px minmax(0, 1fr); gap: 14px; padding: 14px 0; }
.home-shift-row .date-chip { width: 48px; }
.home-shift-row .date-chip strong { font-size: 1.3rem; }
.home-shift-row .shift-title { font-family: Georgia, "Times New Roman", serif; font-size: 0.98rem; font-weight: 500; }
.home-shift-row .shift-note { margin-top: 2px; font-size: 0.72rem; }
.post-body { font-size: 0.9rem; }

.medications-view { display: grid; gap: 16px; }
.medications-heading-block { display: grid; gap: 6px; }
.medications-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-width: 0; }
.medications-heading-row h1 { margin: 0; font-size: clamp(1.8rem, 7vw, 2.35rem); letter-spacing: -0.04em; }
.medications-heading-block .muted { margin: 0; overflow-wrap: anywhere; font-size: 0.8rem; }
.medications-list { display: grid; gap: 12px; }
.medication-card { display: grid; gap: 12px; padding: 14px; border: 1px solid #eadfce; border-radius: 16px; background: #fffdf8; box-shadow: 0 8px 22px rgb(52 43 31 / 5%); }
.medication-card-top { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; }
.medication-card-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #f1eadf; color: var(--text); }
.medication-card-icon .lucide-icon { width: 16px; height: 16px; }
.medication-card-main { min-width: 0; display: grid; gap: 10px; }
.medication-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.medication-card h3 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.05rem; font-weight: 500; letter-spacing: -0.01em; }
.medication-dosage { margin: 4px 0 0; color: var(--text); font-size: 0.74rem; font-weight: 500; }
.medication-menu { position: relative; }
.medication-menu-button { border: 0; padding: 0 2px; background: transparent; color: var(--muted); font-size: 0.7rem; font-weight: 900; line-height: 1; letter-spacing: 0.08em; }
.medication-menu-popover { position: absolute; right: 0; top: 16px; z-index: 5; display: grid; min-width: 78px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: #fffdf8; box-shadow: 0 10px 22px rgb(52 43 31 / 12%); }
.medication-menu-popover button { border: 0; border-radius: 7px; padding: 6px 8px; background: transparent; text-align: left; font-size: 0.72rem; font-weight: 800; color: var(--text); }
.medication-menu-popover button:hover { background: #f4eddf; }
.medication-menu-popover .danger { color: #a13d2d; }
.medication-schedule-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.medication-schedule-pill { display: inline-flex; align-items: baseline; gap: 5px; border: 1px solid #e4d9c8; border-radius: 999px; padding: 4px 8px; background: #fffdf8; color: var(--text); font-size: 0.72rem; font-weight: 800; }
.medication-schedule-pill small { color: var(--muted); font-size: 0.62rem; font-weight: 600; }
.medication-schedule-pill.optional { background: #f5efe6; color: var(--muted); }
.medication-description { margin: 2px 0 0; color: var(--text); font-size: 0.8rem; }
.medication-notes { margin: -4px 0 0; color: var(--muted); font-family: Georgia, "Times New Roman", serif; font-style: italic; font-size: 0.78rem; }
.medication-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid #eadfce; padding-top: 8px; font-size: 0.68rem; }
.medication-refill { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 800; }
.medication-refill.urgent { color: #ad2d20; }
.medication-refill.muted { color: var(--muted); }
.medication-updated { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); white-space: nowrap; }
.app-message-card { gap: 16px; }
.app-message-body { margin: 0; color: var(--muted); font-weight: 700; line-height: 1.45; }
.app-message-card .reserve-button { width: 100%; }
.medication-dialog-card .drawer-actions .reserve-button { font-size: 0.9rem; line-height: 1.05; }
.medication-schedule-options { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(54px, 0.72fr) minmax(54px, 0.72fr); gap: 8px; }
.medication-schedule-options label { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; min-height: 38px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: #fffaf0; font-size: 0.78rem; line-height: 1; font-weight: 800; white-space: nowrap; }
.medication-schedule-options label span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.medication-schedule-options input { width: auto; max-width: none; flex: 0 0 auto; }
.medication-schedule-options .medication-optional-toggle { background: #f5efe6; }
.medication-schedule-options label:has(input:disabled) { opacity: 0.55; }
.medication-dose-card { display: grid; gap: 22px; }
.today-medications-card { padding: 22px; border-radius: 14px; background: #fffdf8; }
.today-medications-heading { display: grid; gap: 4px; }
.today-medications-heading h2 { margin: 0; font-size: 1rem; font-weight: 800; }
.today-medications-heading .muted { margin: 0; font-size: 0.78rem; }
.medication-dose-sections { display: grid; gap: 17px; }
.medication-dose-section { display: grid; gap: 8px; }
.medication-dose-section-label { display: flex; align-items: center; gap: 7px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.22em; font: 700 0.56rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.medication-dose-section-label span { display: inline-grid; place-items: center; letter-spacing: 0; }
.medication-dose-section-label svg { width: 9px; height: 9px; stroke-width: 2; }
.medication-dose-list { display: grid; gap: 0; }
.medication-dose-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 33px; border-bottom: 1px solid #ece3d6; }
.medication-dose-row:last-child { border-bottom: 0; }
.medication-dose-check { display: flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 999px; border: 1px solid #d8ccb9; padding: 0; background: #fffdf8; color: #fff; line-height: 0; text-align: center; }
.medication-dose-check .check-icon { width: 11px; height: 11px; display: block; }
.medication-dose-check.taken { border-color: #2f6a3d; background: #2f6a3d; }
.medication-dose-name { min-width: 0; color: var(--text); font-size: 0.84rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.medication-dose-right { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: min(42vw, 150px); color: var(--muted); font: 0.68rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
.medication-dose-dosage { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.medication-dose-giver { display: inline-flex; align-items: center; gap: 5px; color: #2f6a3d; font-size: 0.62rem; }
.medication-dose-giver .mini-avatar { width: 15px; height: 15px; background: #cce7c8; color: #2f6a3d; font-size: 0.45rem; }
@media (max-width: 520px) {
  .medication-card { padding: 12px; }
  .medication-card-footer { align-items: flex-start; }
  .medication-updated { white-space: normal; text-align: right; justify-content: flex-end; }
}
.post-reaction-summary-button { border: 0; padding: 0; background: transparent; color: var(--muted); font-size: inherit; text-align: left; }
.post-reaction-summary-button:hover { color: var(--text); }
.reaction-details-dialog { width: min(346px, calc(100% - 44px)); }
.reaction-details-card { display: grid; gap: 0; padding: 16px 0 14px; overflow: hidden; background: var(--card); border-radius: 14px; }
.reaction-details-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 18px 10px; }
.reaction-details-heading h2 { font: 500 1.08rem/1.1 Georgia, "Times New Roman", serif; }
.reaction-details-heading .drawer-close-button { width: 24px; height: 24px; border: 0; background: transparent; color: var(--muted); font-size: 1rem; }
.reaction-details-tabs { display: flex; align-items: center; gap: 18px; padding: 0 18px 12px; border-bottom: 1px solid var(--line); }
.reaction-details-tab { display: inline-flex; align-items: center; gap: 5px; border: 0; border-radius: 999px; padding: 2px 0; background: transparent; color: var(--text); font-size: 0.76rem; }
.reaction-details-tab span:first-child { font-weight: 700; }
.reaction-details-tab strong { display: grid; place-items: center; min-width: 17px; height: 17px; border-radius: 999px; padding: 0 5px; background: #eee6d8; color: var(--muted); font-size: 0.62rem; }
.reaction-details-tab.active strong { background: var(--text); color: white; }
.reaction-details-list { display: grid; padding: 10px 18px 0; }
.reaction-details-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 6px 0; }
.reaction-details-avatar { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 50%; background: #ffd8c2; color: var(--accent); font-size: 0.74rem; font-weight: 900; text-transform: uppercase; }
.reaction-details-row:nth-child(3n+2) .reaction-details-avatar { background: #c9f0f5; color: #19636f; }
.reaction-details-row:nth-child(3n+3) .reaction-details-avatar { background: #e7c4ef; color: #723783; }
.reaction-details-row strong { font-size: 0.82rem; }
.reaction-details-emoji { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 0; background: transparent; font-size: 1.2rem; }
