/* KinMosaic modern interface layer.
   Kept separate from the legacy stylesheet so this redesign is easy to review
   and remove without disturbing application behavior. */
:root {
  --ink: #17211f;
  --muted: #66736f;
  --line: #dfe7e4;
  --paper: #f4f7f6;
  --white: #ffffff;
  --card: #ffffff;
  --surface: #ffffff;
  --teal: #24796f;
  --dark-teal: #195f57;
  --soft-blue: #e9f4f2;
  --modern-shadow: 0 1px 2px rgba(20, 42, 37, .04), 0 12px 32px rgba(20, 42, 37, .06);
  --modern-shadow-hover: 0 2px 4px rgba(20, 42, 37, .05), 0 18px 42px rgba(20, 42, 37, .1);
  --content-max: 1480px;
  --sidebar-width: 276px;
}

/* Shared shopping and reminder lists */
.lists-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px;align-items:start}.list-suggestions{margin-bottom:22px;padding:20px 22px;border:1px solid var(--border,#dce6e3);border-radius:22px;background:var(--card,#fff)}.list-suggestions header{display:flex;align-items:center;justify-content:space-between}.list-suggestions h2{margin:.15rem 0 .8rem}.suggestion-chips{display:flex;gap:10px;overflow:auto;padding:2px 2px 8px}.product-suggestion{display:grid;grid-template-columns:42px minmax(120px,1fr);grid-template-rows:auto auto;column-gap:10px;min-width:215px;padding:10px;text-align:left;color:inherit;background:var(--surface,#f7faf9);border:1px solid var(--border,#dce6e3);border-radius:15px;cursor:pointer}.product-suggestion img,.product-suggestion>span{grid-row:1/3;width:42px;height:42px;object-fit:contain;border-radius:9px;background:#fff;display:grid;place-items:center}.product-suggestion small{color:var(--muted,#65746f)}.family-list-card{background:var(--card,#fff);border:1px solid var(--border,#dce6e3);border-radius:24px;box-shadow:0 14px 34px rgba(25,63,58,.08);overflow:hidden}.family-list-card>header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:22px 24px;border-bottom:1px solid var(--border,#dce6e3)}.family-list-card>header>div{display:flex;align-items:center;gap:14px}.family-list-card h2{margin:0;font-size:1.35rem}.family-list-card header p{margin:2px 0 0;color:var(--muted,#65746f)}.list-type-icon{display:grid;place-items:center;width:44px;height:44px;border-radius:14px;background:rgba(35,132,118,.12);font-size:1.25rem}.family-list-items{padding:8px 20px 18px}.family-list-item{display:grid;grid-template-columns:34px minmax(0,1fr) auto 34px;align-items:center;gap:10px;padding:13px 2px;border-bottom:1px solid var(--border,#e3ebe8)}.list-item-details{display:grid;grid-template-columns:42px minmax(0,1fr);align-items:center;gap:10px;width:100%;padding:0;border:0;background:transparent;color:inherit;text-align:left;cursor:pointer}.list-item-details:not(:has(img)){grid-template-columns:minmax(0,1fr)}.family-list-item img,.product-preview img{width:42px;height:42px;border-radius:10px;object-fit:contain;background:#fff}.family-list-item strong,.family-list-item small,.family-list-item em{display:block}.family-list-item small{margin-top:3px;color:var(--muted,#65746f)}.family-list-item em{margin-top:4px;color:var(--accent,#278679);font-size:.8rem;font-style:normal;font-weight:750}.family-list-item.completed strong{text-decoration:line-through;color:var(--muted,#65746f)}.list-check{width:30px;height:30px;border:2px solid var(--accent,#278679);border-radius:50%;background:transparent;color:white;font-weight:800}.completed .list-check{background:var(--accent,#278679)}.claim-list-item{padding:7px 9px;border:1px solid var(--accent,#278679);border-radius:10px;background:transparent;color:var(--accent,#278679);font-weight:750;cursor:pointer}.claim-list-item.active{background:var(--accent,#278679);color:white}.delete-list-item{border:0;background:transparent;color:var(--muted,#65746f);font-size:1.5rem;cursor:pointer}.completed-list-items{margin-top:10px}.completed-list-items summary{padding:10px 2px;color:var(--muted,#65746f);font-weight:700;cursor:pointer}.list-empty{display:flex;flex-direction:column;align-items:center;text-align:center;padding:34px 12px;color:var(--muted,#65746f)}.list-empty strong{color:var(--text,#17221f);margin-bottom:4px}.barcode-fieldset{border:1px solid var(--border,#dce6e3);border-radius:16px;padding:15px;margin:4px 0}.barcode-fieldset legend{font-weight:750;padding:0 6px}.barcode-entry{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:8px}.rapid-scan-option{margin:12px 0 0}.barcode-scanner{margin-top:12px}.scanner-viewport{position:relative;overflow:hidden;border-radius:14px;background:#111}.barcode-scanner video{display:block;width:100%;max-height:300px;min-height:220px;object-fit:cover}.scan-guide{position:absolute;left:9%;right:9%;top:31%;height:38%;border:3px solid #fff;border-radius:16px;box-shadow:0 0 0 999px rgba(0,0,0,.3),0 0 18px rgba(65,221,194,.75);pointer-events:none}.scan-guide:before,.scan-guide:after{content:"";position:absolute;left:8%;right:8%;height:2px;background:#42d8c0;box-shadow:0 0 8px #42d8c0}.scan-guide:before{top:18%}.scan-guide:after{bottom:18%}.scanner-controls{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:10px}.scanner-controls label{display:flex;align-items:center;gap:8px;margin:0}.scanner-controls input{width:130px}.barcode-scanner p{text-align:center;margin:8px 0}.product-preview{display:flex;align-items:center;gap:12px;margin-top:12px;padding:10px;border-radius:12px;background:rgba(35,132,118,.09)}.product-preview small{display:block;color:var(--muted,#65746f)}.product-detail-hero{display:grid;grid-template-columns:minmax(180px,42%) 1fr;gap:24px;align-items:center;margin:14px 0 22px}.product-detail-image{display:grid;place-items:center;min-height:260px;padding:18px;border:1px solid var(--border,#dce6e3);border-radius:22px;background:#fff}.product-detail-image img{width:100%;height:260px;object-fit:contain}.product-detail-image span{font-size:4rem}.product-detail-summary h2{margin:.25rem 0 .45rem;font-size:2rem}.product-detail-summary p{margin:.2rem 0;color:var(--muted,#65746f)}.product-detail-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:16px}.product-detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.product-detail-field{padding:14px 16px;border:1px solid var(--border,#dce6e3);border-radius:15px;background:var(--surface,#f7faf9)}.product-detail-field strong,.product-detail-field span{display:block}.product-detail-field strong{margin-bottom:4px;font-size:.78rem;letter-spacing:.06em;text-transform:uppercase;color:var(--muted,#65746f)}.product-detail-field.wide{grid-column:1/-1}.product-detail-loading{padding:12px 0;color:var(--muted,#65746f)}
@media(max-width:850px){.lists-grid{grid-template-columns:1fr}.family-list-item{grid-template-columns:34px minmax(0,1fr) auto}.delete-list-item{grid-column:3}.claim-list-item{grid-column:2;justify-self:start}.barcode-entry{grid-template-columns:1fr 1fr}.barcode-entry input{grid-column:1/-1}.product-detail-hero{grid-template-columns:1fr}.product-detail-image{min-height:210px}.product-detail-image img{height:210px}.product-detail-grid{grid-template-columns:1fr}.product-detail-field.wide{grid-column:auto}}

html { background: var(--paper); scroll-behavior: smooth; }
body { min-width: 320px; font-size: 16px; line-height: 1.5; text-rendering: optimizeLegibility; }
button, input, select, textarea { font: inherit; }
button { min-height: 44px; }

.app-shell { grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.sidebar {
  width: var(--sidebar-width);
  padding: 26px 20px 22px;
  background: color-mix(in srgb, var(--white) 92%, var(--paper));
  border-color: var(--line);
  box-shadow: 6px 0 24px rgba(25, 55, 49, .025);
}
.brand { gap: 12px; padding: 0 8px; font-size: 22px; letter-spacing: -.03em; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; font-size: 23px; box-shadow: 0 7px 18px rgba(36, 121, 111, .2); }
.workspace-picker { margin: 28px 0 20px; padding: 12px; border-radius: 14px; background: var(--white); }
.family-avatar, .user-avatar { width: 38px; height: 38px; font-size: 12px; }
.workspace-picker small, .user-card small { font-size: 10px; }
.workspace-picker strong { font-size: 14px; }
nav { gap: 5px; }
.nav-item { min-height: 46px; padding: 11px 13px; border-radius: 12px; font-size: 14px; font-weight: 600; gap: 14px; transition: background .18s ease, color .18s ease, transform .18s ease; }
.nav-item span { width: 20px; font-size: 19px; }
.nav-item:hover { transform: translateX(2px); }
.nav-item:hover, .nav-item.active { background: var(--soft-blue); color: var(--dark-teal); }
.user-card { padding-top: 20px; gap: 11px; }
.user-card strong { font-size: 13px; }

main { grid-column: 2; }
.topbar { height: 80px; padding: 0 clamp(24px, 4vw, 64px); gap: 12px; background: color-mix(in srgb, var(--paper) 86%, transparent); border-color: var(--line); }
.global-search { max-width: 620px; position: relative; }
.global-search > span { left: 17px; font-size: 20px; color: var(--muted); }
.global-search input { width: 100%; min-height: 46px; padding: 11px 18px 11px 48px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); color: var(--ink); font-size: 15px; box-shadow: 0 1px 2px rgba(20, 42, 37, .03); }
.global-search input:focus { border-color: color-mix(in srgb, var(--teal) 60%, var(--line)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--teal) 12%, transparent); outline: none; }
.icon-button { width: 44px; height: 44px; border-radius: 13px; color: var(--ink); cursor: pointer; }
.invite-button, .primary-button, .secondary-button, .danger-button { min-height: 44px; border-radius: 12px; padding: 11px 17px; font-size: 14px; font-weight: 700; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.invite-button:hover, .primary-button:hover, .secondary-button:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(25, 95, 87, .13); }

.page#home-page, .feature-page, .health-page, .placeholder-page, .settings-page, .caregiver-page {
  width: min(100%, var(--content-max));
  margin-inline: auto;
  padding: 52px clamp(24px, 4vw, 64px) 80px;
}
.placeholder-page { max-width: var(--content-max); }
.welcome-row, .feature-heading, .health-heading, .settings-heading { align-items: flex-end; gap: 24px; }
.welcome-row h1, .feature-heading h1, .health-heading h1, .settings-heading h1, .placeholder-page h1 { font-size: clamp(32px, 3vw, 44px); line-height: 1.1; letter-spacing: -.045em; }
.welcome-row > div > p:last-child, .feature-heading > div > p:last-child, .health-heading > div > p:last-child, .settings-heading > div > p:last-child, .placeholder-page > p { max-width: 720px; margin-top: 11px; font-size: 16px; line-height: 1.55; }
.eyebrow { margin-bottom: 9px; font-size: 11px; line-height: 1.3; letter-spacing: .14em; }

.overview-grid { grid-template-columns: minmax(0, 1.45fr) minmax(340px, .8fr); gap: 22px; margin-top: 32px; align-items: start; }
.side-stack { gap: 22px; }
.today-card, .care-card, .update-card, .child-card, .member-list, .mini-calendar, .agenda, .profile-card, .note-card, .notes-toolbar, .health-content, .expense-home-card, .home-handoffs-card, .school-card, .contact-card, .settings-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--modern-shadow);
}
.today-card { min-height: 410px; padding: 28px 30px 22px; }
.care-card, .update-card { padding: 25px; }
.card-header h2, .section-heading h2 { font-size: 21px; letter-spacing: -.02em; }
.text-button { min-height: 36px; padding: 6px 8px; border-radius: 9px; font-size: 14px; }
.timeline-item { grid-template-columns: 52px 3px 40px minmax(0, 1fr) 26px; min-height: 96px; gap: 16px; }
.time strong { font-size: 16px; }
.time span { font-size: 11px; }
.event-icon, .reminder-icon { width: 40px; height: 40px; border-radius: 11px; font-size: 16px; }
.event-info strong, .reminder strong { font-size: 16px; }
.event-info > span, .reminder span { font-size: 14px; }
.child-chip { font-size: 12px; }
.reminder { grid-template-columns: 40px minmax(0, 1fr) 30px; padding-top: 19px; }
.update-author strong { font-size: 15px; }
.update-author span { font-size: 13px; }
blockquote { padding: 16px 18px; border-left-width: 3px; border-radius: 8px; font-size: 15px; }
.children-section { margin-top: 44px; }
.section-heading { margin-bottom: 18px; }
.children-grid { gap: 22px; }
.child-card { padding: 25px; transition: transform .2s ease, box-shadow .2s ease; }
.child-card:hover { transform: translateY(-2px); box-shadow: var(--modern-shadow-hover); }
.child-main { grid-template-columns: 56px minmax(0, 1fr) 24px; gap: 15px; }
.child-avatar { width: 56px; height: 56px; font-size: 20px; }
.child-main h3 { font-size: 18px; }
.child-main p { font-size: 14px; }
.quick-links { margin-top: 23px; padding-top: 18px; }
.quick-links button { min-height: 54px; grid-template-columns: 22px 1fr; font-size: 15px; }
.quick-links span { font-size: 12px; }
.quick-links strong { font-size: 13px; }

.security-home-notice, .family-setup-banner { border-radius: 18px; padding: 18px 20px; }
.security-home-notice strong, .family-setup-banner strong { font-size: 16px; }
.security-home-notice p, .family-setup-banner span { font-size: 14px; }
.home-handoffs-card { padding: 25px; }
.home-handoff-list article { padding: 16px; border-radius: 13px; }
.home-handoff-list strong { font-size: 15px; }
.home-handoff-list small { font-size: 13px; }

.calendar-toolbar, .notes-toolbar, .contact-toolbar, .expense-toolbar, .school-toolbar { margin-top: 30px; }
.calendar-layout { gap: 22px; }
.calendar-day { min-height: 112px; padding: 11px; }
.calendar-day > span { font-size: 13px; }
.calendar-event { padding: 7px; font-size: 11px; }
.agenda { padding: 26px; }
.agenda h2 { font-size: 20px; }
.agenda-item h3 { font-size: 14px; }
.agenda-item p { font-size: 13px; }
.profile-directory, .notes-grid, .contacts-grid, .school-grid { gap: 20px; }
.profile-hero h2 { font-size: 19px; }
.profile-hero p, .profile-facts small { font-size: 12px; }
.profile-facts strong { font-size: 14px; }
.note-card { padding: 24px; }
.note-meta strong { font-size: 13px; }
.note-meta > span:last-child, .note-category { font-size: 11px; }
.note-card > p { font-size: 16px; }

.modal-backdrop { padding: 24px; background: rgba(14, 25, 22, .58); backdrop-filter: blur(4px); }
.modal { width: min(540px, 100%); max-height: calc(100dvh - 48px); overflow: auto; padding: 34px; border: 1px solid color-mix(in srgb, var(--line) 80%, transparent); border-radius: 22px; box-shadow: 0 28px 90px rgba(9, 27, 23, .24); }
.modal h2 { font-size: 27px; letter-spacing: -.025em; }
.modal > p:not(.eyebrow) { font-size: 15px; }
.modal label { margin-top: 18px; font-size: 14px; }
.modal input, .modal select, .modal textarea, .profile-modal input, .profile-modal select, .profile-modal textarea { min-height: 48px; padding: 12px 14px; border-radius: 11px; font-size: 16px; }
.modal textarea, .profile-modal textarea { min-height: 108px; }
.modal-close { width: 44px; height: 44px; top: 13px; right: 14px; border-radius: 50%; }
.modal-submit { margin-top: 26px; }
.quick-add-grid { gap: 14px; }
.quick-add-grid button { min-height: 94px; padding: 17px; border-radius: 15px; }
.quick-add-grid strong { font-size: 15px; }
.quick-add-grid small { font-size: 13px; }
.toast { right: 24px; bottom: 24px; max-width: min(440px, calc(100vw - 32px)); padding: 15px 19px; border-radius: 12px; font-size: 14px; }

.notification-panel { top: 72px; border-radius: 18px; box-shadow: 0 24px 70px rgba(14, 31, 27, .22); }
.notification-item strong { font-size: 14px; }
.notification-item small { font-size: 12px; }

html[data-theme="dark"] {
  --ink: #edf5f2;
  --muted: #a8b6b1;
  --line: #34423e;
  --paper: #111816;
  --white: #1b2421;
  --card: #1b2421;
  --surface: #1b2421;
  --soft-blue: #243d38;
  --modern-shadow: 0 1px 2px rgba(0,0,0,.2), 0 14px 34px rgba(0,0,0,.18);
}
html[data-theme="dark"] .sidebar { background: #151e1b; }
html[data-theme="dark"] .topbar { background: rgba(17, 24, 22, .88); }
html[data-theme="dark"] .global-search input { background: #1b2421; border-color: var(--line); }
html[data-theme="dark"] .icon-button, html[data-theme="dark"] .secondary-button { background: #1b2421; border-color: var(--line); }

/* Website appearance themes. */
html[data-theme="coastal"] { --ink:#15313b;--muted:#5f7580;--line:#cfe1e7;--paper:#eef6f8;--white:#fff;--card:#fff;--surface:#fff;--teal:#177d91;--dark-teal:#0f6072;--soft-blue:#dff1f5;--blue:#4b9fc0;--modern-shadow:0 1px 2px rgba(14,72,88,.04),0 14px 34px rgba(14,72,88,.08) }
html[data-theme="coastal"] .sidebar { background:radial-gradient(circle at 14% -80%,rgba(112,203,217,.38),transparent 32%),linear-gradient(100deg,#0f5361 0%,#176f80 55%,#0f5361 100%) }
html[data-theme="coastal"] .topbar { background:color-mix(in srgb,#eef6f8 88%,transparent) }
html[data-theme="coastal"] .brand-mark { color:#103c47;background:linear-gradient(145deg,#bcecf1,#71c5d1) }
html[data-theme="sunset"] { --ink:#392821;--muted:#7b6860;--line:#ead9cd;--paper:#fbf3ec;--white:#fffdfb;--card:#fffdfb;--surface:#fffdfb;--teal:#bd654f;--dark-teal:#994a39;--soft-blue:#f8e5dc;--coral:#d56850;--yellow:#d69d43;--modern-shadow:0 1px 2px rgba(91,45,31,.04),0 14px 34px rgba(91,45,31,.08) }
html[data-theme="sunset"] .sidebar { background:radial-gradient(circle at 14% -80%,rgba(244,178,127,.36),transparent 32%),linear-gradient(100deg,#713c30 0%,#9b4f3d 55%,#713c30 100%) }
html[data-theme="sunset"] .topbar { background:color-mix(in srgb,#fbf3ec 88%,transparent) }
html[data-theme="sunset"] .brand-mark { color:#5b2b21;background:linear-gradient(145deg,#ffe0ca,#e8a06d) }
html[data-theme="lavender"] { --ink:#30293d;--muted:#70677e;--line:#e0d8e9;--paper:#f6f2fa;--white:#fffefe;--card:#fffefe;--surface:#fffefe;--teal:#765c9c;--dark-teal:#5d437f;--soft-blue:#ece4f5;--purple:#8b6db2;--modern-shadow:0 1px 2px rgba(68,48,91,.04),0 14px 34px rgba(68,48,91,.08) }
html[data-theme="lavender"] .sidebar { background:radial-gradient(circle at 14% -80%,rgba(202,176,230,.34),transparent 32%),linear-gradient(100deg,#493562 0%,#654b82 55%,#493562 100%) }
html[data-theme="lavender"] .topbar { background:color-mix(in srgb,#f6f2fa 88%,transparent) }
html[data-theme="lavender"] .brand-mark { color:#3d2c52;background:linear-gradient(145deg,#eadcf7,#bca2d8) }

.appearance-settings-card { grid-column:1/-1 }
.appearance-heading { display:flex;align-items:flex-start;justify-content:space-between;gap:18px }
.current-theme-chip { flex:0 0 auto;padding:7px 11px;border-radius:999px;background:var(--soft-blue);color:var(--dark-teal);font-size:12px;font-weight:700 }
.theme-gallery { display:grid;grid-template-columns:repeat(5,minmax(135px,1fr));gap:14px;margin-top:22px }
.theme-choice { min-width:0;padding:11px;border:1px solid var(--line);border-radius:16px;background:var(--white);color:var(--ink);text-align:left }
.theme-choice:hover { border-color:var(--teal);transform:translateY(-2px);box-shadow:var(--modern-shadow) }
.theme-choice.selected { border-color:var(--teal);box-shadow:0 0 0 3px color-mix(in srgb,var(--teal) 15%,transparent) }
.theme-choice strong,.theme-choice small { display:block;padding-inline:3px }
.theme-choice strong { margin-top:10px;font-size:14px }
.theme-choice small { margin-top:3px;color:var(--muted);font-size:11px;line-height:1.35 }
.theme-preview { display:grid;grid-template-columns:28% 1fr;grid-template-rows:18px 1fr;gap:6px;height:88px;padding:8px;overflow:hidden;border-radius:10px;background:var(--preview-paper) }
.theme-preview i { display:block;border-radius:5px;background:var(--preview-card) }
.theme-preview i:first-child { grid-row:1/3;background:var(--preview-nav) }
.theme-preview i:nth-child(2) { background:var(--preview-accent) }
.theme-preview-light { --preview-paper:#f4f7f6;--preview-card:#fff;--preview-nav:#dceae7;--preview-accent:#24796f }
.theme-preview-dark { --preview-paper:#111816;--preview-card:#27322e;--preview-nav:#1b2421;--preview-accent:#5fa79d }
.theme-preview-coastal { --preview-paper:#eaf4f7;--preview-card:#fff;--preview-nav:#cce6ed;--preview-accent:#177d91 }
.theme-preview-sunset { --preview-paper:#fbf1e9;--preview-card:#fffdfb;--preview-nav:#f2d9c8;--preview-accent:#bd654f }
.theme-preview-lavender { --preview-paper:#f5f0f9;--preview-card:#fff;--preview-nav:#e2d7ee;--preview-accent:#765c9c }
@media(max-width:1050px){.theme-gallery{grid-template-columns:repeat(3,minmax(135px,1fr))}}
@media(max-width:620px){.appearance-heading{flex-direction:column}.theme-gallery{grid-template-columns:repeat(2,minmax(0,1fr))}.theme-choice:last-child{grid-column:1/-1}}

@media (max-width: 1100px) {
  :root { --sidebar-width: 88px; }
  .sidebar { width: var(--sidebar-width); padding: 24px 13px; }
  .brand { justify-content: center; padding: 0; }
  .brand span:last-child, .workspace-picker span:not(.family-avatar), .nav-item:not(.active) { font-size: 0; }
  .workspace-picker, .nav-item { justify-content: center; }
  .nav-item { padding-inline: 10px; }
  .nav-item span { font-size: 19px; }
  .sidebar-bottom .user-card > span:not(.user-avatar), .user-card button { display: none; }
  .overview-grid { grid-template-columns: 1fr; }
  .side-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .app-shell { display: block; }
  main { display: block; }
  .topbar { min-height: 70px; height: auto; padding: 12px 16px; flex-wrap: wrap; }
  .mobile-menu { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; border-radius: 12px; }
  .global-search { order: 3; flex: 1 0 100% !important; max-width: none; }
  .global-search input { min-height: 44px; }
  .invite-button { width: 44px; padding: 0; font-size: 0; }
  .invite-button::before { content: '+'; font-size: 22px; }
  .page#home-page, .feature-page, .health-page, .placeholder-page, .settings-page, .caregiver-page { padding: 32px 16px 64px; }
  .welcome-row, .feature-heading, .health-heading, .settings-heading { align-items: flex-start; flex-direction: column; gap: 18px; }
  .welcome-row h1, .feature-heading h1, .health-heading h1, .settings-heading h1, .placeholder-page h1 { font-size: 30px; }
  .welcome-row .primary-button, .feature-heading .primary-button { width: 100%; }
  .overview-grid { margin-top: 24px; gap: 16px; }
  .side-stack { grid-template-columns: 1fr; gap: 16px; }
  .today-card, .care-card, .update-card { padding: 21px 18px; border-radius: 17px; }
  .today-card { min-height: 0; }
  .timeline-item { grid-template-columns: 45px 3px 36px minmax(0, 1fr); gap: 10px; }
  .timeline-item > .more { display: none; }
  .children-grid, .profile-directory, .notes-grid, .contacts-grid, .school-grid { grid-template-columns: 1fr; gap: 15px; }
  .quick-links { grid-template-columns: 1fr 1fr; gap: 8px; }
  .quick-links button { border: 0; border-radius: 10px; background: var(--paper); padding: 10px; }
  .calendar-layout { grid-template-columns: 1fr; }
  .calendar-day { min-height: 76px; padding: 6px; }
  .calendar-event { font-size: 9px; padding: 5px; }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal { width: 100%; max-height: calc(100dvh - 20px); padding: 28px 20px calc(24px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; }
  .modal h2 { padding-right: 42px; font-size: 24px; }
  .quick-add-grid { grid-template-columns: 1fr; }
  .notification-panel { position: fixed; top: 78px; right: 10px; left: 10px; width: auto; max-height: calc(100dvh - 90px); }
  html.mobile-nav-open .sidebar { width: min(86vw, 330px); padding: 24px 18px 20px; }
}

/* Readability pass: keep essential information comfortably legible without
   relying on browser zoom. These rules intentionally come last so older,
   compact component styles cannot shrink text back down. */
body { font-size: 20px; line-height: 1.6; }
.app-shell { --sidebar-width: 300px; }
.brand { font-size: 25px; }
.workspace-picker strong { font-size: 17px; }
.workspace-picker small,
.user-card small { font-size: 14px; }
.user-card strong { font-size: 16px; }
.nav-item,
.more-navigation summary { font-size: 18px; }
.global-search input { font-size: 18px; }
.invite-button,
.primary-button,
.secondary-button,
.danger-button,
.text-button { font-size: 17px; }
.eyebrow { font-size: 14px; }
.welcome-row > div > p:last-child,
.feature-heading > div > p:last-child,
.health-heading > div > p:last-child,
.settings-heading > div > p:last-child,
.caregiver-banner > div > p:last-child,
.placeholder-page > p { font-size: 20px; }
.card-header h2,
.section-heading h2,
.agenda h2,
.health-panel-heading h2 { font-size: 25px; }
.page p:not(.eyebrow),
.page li,
.page td,
.page th { font-size: 18px; line-height: 1.6; }
.page small,
.modal small { font-size: 16px; line-height: 1.5; }
.page label,
.modal label { font-size: 17px; }
.page input,
.page select,
.page textarea,
.modal input,
.modal select,
.modal textarea { font-size: 18px; }
.event-info strong,
.reminder strong,
.home-handoff-list strong,
.notification-item strong,
.agenda-item h3,
.health-record h3,
.note-meta strong,
.profile-facts strong { font-size: 18px; }
.event-info > span,
.reminder span,
.update-author span,
.home-handoff-list small,
.notification-item small,
.agenda-item p,
.health-record p,
.health-record p span,
.note-meta > span:last-child,
.note-category,
.profile-hero p,
.profile-facts small { font-size: 16px; }
.child-chip,
.time span,
.calendar-day > span { font-size: 15px; }
.calendar-event { font-size: 15px; line-height: 1.4; }
.note-card > p,
blockquote { font-size: 18px; }
.health-empty h3,
.notification-empty strong { font-size: 18px; }
.health-empty p,
.notification-empty small { font-size: 17px; }
.modal > p:not(.eyebrow),
.modal > .modal-content > p:not(.eyebrow),
.guided-tour-copy { font-size: 18px; }
.onboarding-intent{display:grid;gap:8px;margin:18px 0;padding:14px 16px;border:1px solid var(--border,#dce6e3);border-radius:16px}.onboarding-intent legend{padding:0 6px;font-weight:800}.onboarding-intent label{display:flex;align-items:center;gap:10px;margin:0;padding:8px;border-radius:10px}.onboarding-intent label:has(input:checked){background:rgba(35,132,118,.1)}
.toast { font-size: 17px; }

.connection-state{position:fixed;z-index:10000;top:16px;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:9px;max-width:min(620px,calc(100vw - 28px));padding:11px 16px;border:1px solid var(--border);border-radius:999px;background:var(--surface);color:var(--text);box-shadow:0 10px 30px rgba(20,45,40,.16);font-size:15px}.connection-state[hidden]{display:none}.connection-state-dot{width:10px;height:10px;border-radius:50%;background:#2f9e73;flex:none}.connection-state.offline .connection-state-dot,.connection-state.error .connection-state-dot{background:#cf5c4b}.connection-state.syncing .connection-state-dot{background:#d79b32;animation:connection-pulse 1s ease-in-out infinite}.connection-state>span:last-child{color:var(--muted)}@keyframes connection-pulse{50%{opacity:.3;transform:scale(.75)}}
@media(max-width:680px){.connection-state{top:10px;border-radius:16px;align-items:flex-start;flex-wrap:wrap}.connection-state>span:last-child{flex-basis:100%;padding-left:19px}}
.product-alternatives{margin-top:18px;padding:18px;border-radius:18px;background:var(--surface-subtle,#f4f7f6)}.product-alternatives h3{margin:0 0 10px}.product-alternatives>div{display:flex;justify-content:space-between;gap:20px;padding:10px 0;border-top:1px solid var(--border)}.product-alternatives span{color:var(--muted);text-align:right}

@media (max-width: 700px) {
  body { font-size: 18px; }
  .app-shell { --sidebar-width: 276px; }
  .nav-item,
  .more-navigation summary { font-size: 17px; }
  .welcome-row > div > p:last-child,
  .feature-heading > div > p:last-child,
  .health-heading > div > p:last-child,
  .settings-heading > div > p:last-child,
  .caregiver-banner > div > p:last-child { font-size: 18px; }
  .page p:not(.eyebrow),
  .page li { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Modern UI v2: a deliberately distinct visual system, not just a spacing pass. */
@media (min-width: 1101px) {
  .sidebar {
    color: #eef7f4;
    background:
      radial-gradient(circle at 15% 8%, rgba(100, 200, 183, .2), transparent 27%),
      linear-gradient(180deg, #153d37 0%, #102e2a 100%);
    border-right: 0;
    box-shadow: 12px 0 36px rgba(10, 45, 39, .14);
  }
  .sidebar .brand, .sidebar .workspace-picker, .sidebar .user-card,
  .sidebar .workspace-picker strong, .sidebar .user-card strong { color: #f7fbfa; }
  .sidebar .brand-mark { background: #8bd7c9; color: #123a34; }
  .sidebar .workspace-picker {
    background: rgba(255, 255, 255, .09);
    border-color: rgba(255, 255, 255, .13);
  }
  .sidebar .workspace-picker small, .sidebar .user-card small { color: #a9c8c1; }
  .sidebar .family-avatar, .sidebar .user-avatar { background: #d9f2ec; color: #195f57; }
  .sidebar .nav-item { color: #bdd4cf; }
  .sidebar .nav-item:hover { background: rgba(255, 255, 255, .08); color: #fff; }
  .sidebar .nav-item.active {
    background: #f4fbf9;
    color: #174f47;
    box-shadow: 0 8px 22px rgba(4, 24, 21, .2);
  }
  .sidebar .user-card { border-color: rgba(255, 255, 255, .13); }
  .sidebar .user-card button { color: #bdd4cf; }
}

.topbar {
  background: color-mix(in srgb, var(--white) 92%, transparent);
  box-shadow: 0 1px 0 rgba(22, 54, 48, .04);
}

#home-page .welcome-row {
  position: relative;
  overflow: hidden;
  min-height: 214px;
  padding: clamp(28px, 4vw, 52px);
  border: 1px solid color-mix(in srgb, var(--teal) 16%, var(--line));
  border-radius: 28px;
  background:
    radial-gradient(circle at 82% 20%, rgba(139, 215, 201, .52), transparent 25%),
    radial-gradient(circle at 95% 95%, rgba(104, 150, 201, .2), transparent 36%),
    linear-gradient(135deg, #e7f5f1 0%, #f8fbfa 62%, #edf4fa 100%);
  box-shadow: 0 22px 60px rgba(21, 75, 66, .1);
}
#home-page .welcome-row::after {
  content: '';
  position: absolute;
  width: 190px;
  height: 190px;
  right: 7%;
  top: 50%;
  border: 34px solid rgba(255, 255, 255, .42);
  border-radius: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}
#home-page .welcome-row > * { position: relative; z-index: 1; }
#home-page .welcome-row h1 { max-width: 760px; font-size: clamp(38px, 4vw, 58px); }
#home-page .welcome-row > div > p:last-child { color: #526e68; font-size: 17px; }
#home-page .welcome-row .primary-button { box-shadow: 0 12px 28px rgba(25, 95, 87, .24); }

#home-page .security-home-notice,
#home-page .family-setup-banner { margin-top: 18px; }
#home-page .overview-grid { margin-top: 26px; }
#home-page .today-card,
#home-page .care-card,
#home-page .update-card,
#home-page .child-card,
#home-page .expense-home-card,
#home-page .home-handoffs-card {
  border-color: color-mix(in srgb, var(--teal) 10%, var(--line));
  box-shadow: 0 14px 38px rgba(24, 61, 54, .075);
}
#home-page .today-card { background: linear-gradient(180deg, var(--card), color-mix(in srgb, var(--card) 94%, var(--soft-blue))); }
#home-page .card-header, #home-page .section-heading { padding-bottom: 4px; }
#home-page .card-header h2, #home-page .section-heading h2 { font-size: 24px; }
#home-page .care-card, #home-page .update-card { min-height: 218px; }
#home-page .children-section { padding-top: 8px; }

html[data-theme="dark"] #home-page .welcome-row {
  background:
    radial-gradient(circle at 82% 20%, rgba(66, 143, 130, .34), transparent 27%),
    linear-gradient(135deg, #1d3b35 0%, #172622 68%, #1b2d34 100%);
  border-color: #36564f;
}
html[data-theme="dark"] #home-page .welcome-row > div > p:last-child { color: #b5cac4; }

@media (max-width: 700px) {
  #home-page .welcome-row { min-height: 0; padding: 26px 22px; border-radius: 22px; }
  #home-page .welcome-row::after { width: 120px; height: 120px; right: -54px; top: 25%; border-width: 22px; }
  #home-page .welcome-row h1 { font-size: 34px; }
  #home-page .welcome-row > div > p:last-child { font-size: 16px; }
}

/* Modern UI v3: top-navigation application shell. */
.app-shell { display: block; min-height: 100vh; }
main { grid-column: auto; }

@media (min-width: 701px) {
  :root { --sidebar-width: 100%; }
  .sidebar {
    position: sticky;
    inset: 0 0 auto;
    z-index: 50;
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    height: 76px;
    padding: 0 clamp(20px, 3.2vw, 52px);
    color: #eef7f4;
    background:
      radial-gradient(circle at 14% -80%, rgba(139, 215, 201, .32), transparent 32%),
      linear-gradient(100deg, #123a34 0%, #174b43 55%, #123a34 100%);
    border: 0;
    box-shadow: 0 12px 34px rgba(9, 45, 39, .14);
  }
  .sidebar .brand { flex: 0 0 auto; padding: 0; color: #fff; }
  .sidebar .brand span:last-child { display: inline; font-size: 21px; }
  .sidebar .brand-mark { width: 38px; height: 38px; background: #9be0d3; color: #123a34; }
  .sidebar .workspace-picker {
    flex: 0 0 auto;
    min-width: 0;
    margin: 0 16px 0 24px;
    padding: 8px 10px;
    color: #f7fbfa;
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .13);
  }
  .sidebar .workspace-picker .family-avatar { width: 32px; height: 32px; }
  .sidebar .workspace-picker small { color: #b6d0ca; }
  .sidebar .workspace-picker strong { color: #fff; }
  .sidebar .primary-navigation {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 3px;
  }
  .sidebar .nav-item {
    width: auto;
    min-height: 42px;
    padding: 9px 11px;
    color: #c8dcd7;
    white-space: nowrap;
  }
  .sidebar .nav-item span { width: auto; font-size: 17px; }
  .sidebar .nav-item:hover { color: #fff; background: rgba(255, 255, 255, .08); transform: translateY(-1px); }
  .sidebar .nav-item.active { color: #174f47; background: #f5fbf9; box-shadow: 0 7px 20px rgba(4, 24, 21, .18); }
  .sidebar-bottom { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; margin: 0 0 0 8px; }
  .sidebar .user-card { margin: 0; padding: 0 0 0 10px; border: 0; }
  .sidebar .user-card > span:nth-child(2) { display: none; }
  .sidebar .user-card button { display: block; color: #c8dcd7; }
  .more-navigation { position: relative; }
  .more-navigation summary {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 42px;
    padding: 9px 12px;
    border-radius: 12px;
    color: #c8dcd7;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
  }
  .more-navigation summary::-webkit-details-marker { display: none; }
  .more-navigation summary:hover, .more-navigation[open] summary { color: #fff; background: rgba(255, 255, 255, .09); }
  .more-navigation-menu {
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(190px, 1fr));
    gap: 5px;
    width: 420px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--card);
    box-shadow: 0 24px 70px rgba(9, 35, 30, .22);
  }
  .more-navigation-menu .nav-item { width: 100%; color: var(--ink); }
  .more-navigation-menu .nav-item:hover { color: var(--dark-teal); background: var(--soft-blue); transform: none; }
  .more-navigation-menu .nav-item.active { color: #fff; background: var(--teal); }
  .topbar {
    top: 76px;
    height: 70px;
    padding: 0 clamp(24px, 4vw, 64px);
    background: color-mix(in srgb, var(--white) 94%, transparent);
  }
}

@media (max-width: 1180px) and (min-width: 701px) {
  .sidebar .workspace-picker { display: none; }
  .sidebar .nav-item { padding-inline: 9px; font-size: 13px; }
  .sidebar .nav-item span { display: none; }
}

@media (max-width: 820px) and (min-width: 701px) {
  .sidebar .brand span:last-child { display: none; }
  .sidebar .primary-navigation { justify-content: flex-start; }
}

@media (max-width: 700px) {
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 100;
    display: flex;
    width: min(88vw, 350px);
    height: 100dvh;
    padding: 24px 18px;
    overflow-y: auto;
    color: #eef7f4;
    background: linear-gradient(180deg, #123a34, #102e2a);
    transform: translateX(-106%);
    transition: transform .22s ease;
  }
  html.mobile-nav-open .sidebar { width: min(88vw, 350px); transform: translateX(0); }
  .sidebar .brand { justify-content: flex-start; color: #fff; }
  .sidebar .workspace-picker { margin: 24px 0 18px; color: #fff; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.13); }
  .sidebar .workspace-picker strong { color: #fff; }
  .sidebar .workspace-picker small { color: #b6d0ca; }
  .sidebar .primary-navigation { display: grid; gap: 4px; }
  .sidebar .nav-item { justify-content: flex-start; width: 100%; color: #c8dcd7; font-size: 14px; }
  .sidebar .nav-item.active { color: #174f47; background: #f5fbf9; }
  .sidebar-bottom { display: grid; gap: 8px; margin-top: 8px; }
  .more-navigation summary { display: none; }
  .more-navigation-menu { display: grid; gap: 4px; }
  .sidebar .user-card { border-color: rgba(255,255,255,.13); }
  .sidebar .user-card strong { color: #fff; }
  .sidebar .user-card small { color: #b6d0ca; }
  .sidebar .user-card button { color: #c8dcd7; }
  .topbar { top: 0; }
}

/* Stronger editorial hierarchy across feature pages. */
.feature-heading, .health-heading, .settings-heading, .caregiver-banner {
  padding: clamp(24px, 3vw, 38px);
  border: 1px solid color-mix(in srgb, var(--teal) 14%, var(--line));
  border-radius: 24px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--soft-blue) 72%, var(--card)), var(--card));
}
.feature-heading h1, .health-heading h1, .settings-heading h1, .caregiver-banner h1 { font-size: clamp(34px, 3.4vw, 50px); }
.settings-grid, .profile-directory, .notes-grid, .contacts-grid, .school-grid { margin-top: 26px; }

html[data-theme="dark"] .sidebar { background: linear-gradient(180deg, #0d2925, #091f1c); }
html[data-theme="dark"] .more-navigation-menu { background: #1b2421; }
html[data-theme="dark"] .feature-heading,
html[data-theme="dark"] .health-heading,
html[data-theme="dark"] .settings-heading,
html[data-theme="dark"] .caregiver-banner { background: linear-gradient(135deg, #203a34, #1b2421); }

/* Unified dialog and form system. All website pop-outs share one viewport-safe shell. */
[hidden] { display: none !important; }

.modal-backdrop {
  z-index: 1000;
  align-items: center;
  justify-items: center;
  padding: clamp(12px, 3vw, 32px);
  overflow: hidden;
  overscroll-behavior: contain;
}

.modal-backdrop > .modal {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  width: min(620px, 100%);
  max-height: calc(100dvh - clamp(24px, 6vw, 64px));
  padding: 0;
  overflow: hidden;
  scrollbar-gutter: auto;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 30px 100px rgba(8, 29, 25, .28);
}

.modal-backdrop > .modal.modal-scroll,
.modal-backdrop > .modal.profile-modal,
.modal-backdrop > .modal.child-overview-modal,
.modal-backdrop > .modal.pending-handoff-review { width: min(720px, 100%); }

.modal > .modal-content {
  min-height: 0;
  padding: clamp(28px, 4vw, 42px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.modal > .modal-close {
  position: absolute;
  z-index: 5;
  top: 22px;
  right: 22px;
  float: none;
  display: grid;
  place-items: center;
  width: 48px;
  min-width: 48px;
  height: 48px;
  margin: 0;
  padding: 0 0 3px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 8px 24px rgba(20, 30, 27, .13);
  font-size: 30px;
  font-weight: 400;
  line-height: 1;
}

.modal > .modal-content > .eyebrow,
.modal > .modal-content > h2,
.modal > .modal-content > .profile-modal-header { padding-right: 68px; }
.modal > .modal-content > .eyebrow { margin: 0 0 8px; }
.modal > .modal-content > h2 { margin: 0 0 10px; }
.modal > .modal-content > p:not(.eyebrow) { margin: 0 0 22px; color: var(--muted); }

.modal > .modal-content > label,
.modal > .modal-content > .form-row,
.modal > .modal-content > fieldset,
.modal > .modal-content > .reimbursement-fields,
.modal > .modal-content > .voice-form-assistant { margin-top: 22px; }
.modal .form-row { gap: 16px; }
.modal .form-row > label { min-width: 0; margin-top: 0; }
.modal label { gap: 9px; margin-top: 18px; color: var(--ink); }
.modal input,
.modal select,
.modal textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
}
.modal textarea { min-height: 112px; resize: vertical; }
.modal input[type="checkbox"],
.modal input[type="radio"] { width: auto; min-height: auto; padding: 0; }
.modal .checkbox-label { flex-direction: row; align-items: flex-start; }
.modal .modal-submit { min-height: 50px; margin-top: 28px; }

.voice-form-assistant { padding: 22px; gap: 16px; border-radius: 16px; }
.voice-assist-heading { align-items: flex-start; }
.voice-record { flex: 0 0 auto; min-width: 150px; min-height: 48px; }
.voice-transcript { min-height: 130px; }
.voice-draft-preview { padding: 18px; border-radius: 14px; }
.voice-draft-preview[hidden] { display: none !important; }

/* Preserve the specialized profile and confirmation layouts inside the shared shell. */
.profile-modal > .modal-content { padding: 0; }
.profile-modal .profile-modal-header { padding: 34px 38px 22px; }
.profile-modal .profile-modal-content { padding: 24px 38px; overflow: visible; }
.profile-modal .profile-modal-actions { padding: 18px 38px; }
.profile-modal fieldset { border-radius: 16px; }
.profile-modal .form-grid { gap: 18px; }

.confirm-modal > .modal-content { padding: 38px; text-align: center; }
.confirm-modal .confirm-icon { margin-bottom: 18px; }
.confirm-modal .modal-content > p:not(.eyebrow) {
  max-width: 34ch;
  margin: 12px auto 0;
}
.confirm-modal .confirm-actions { gap: 12px; margin-top: 26px; }

/* Normalize supporting form groups that previously kept page-specific spacing. */
.modal fieldset,
.modal .address-fields,
.modal .reimbursement-fields {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--paper) 72%, var(--surface));
}
.modal fieldset { margin-inline: 0; }
.modal legend,
.modal .field-group-title { padding-inline: 6px; color: var(--ink); }
.modal .address-fields > :first-child,
.modal .reimbursement-fields > :first-child { margin-top: 0; }
.modal .address-fields > :last-child,
.modal .reimbursement-fields > :last-child { margin-bottom: 0; }

/* Keep page toolbars and card controls on the same sizing rhythm as dialogs. */
.calendar-toolbar button,
.notes-toolbar button,
.contact-toolbar button,
.expense-toolbar button,
.school-toolbar button { min-height: 44px; }
.calendar-toolbar select,
.notes-toolbar select,
.notes-toolbar input,
.contact-toolbar select,
.expense-toolbar select,
.expense-toolbar input,
.school-toolbar select {
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 11px;
  font-size: 14px;
}

@media (max-width: 700px) {
  .modal-backdrop { align-items: end; padding: 0; }
  .modal-backdrop > .modal,
  .modal-backdrop > .modal.modal-scroll,
  .modal-backdrop > .modal.profile-modal,
  .modal-backdrop > .modal.child-overview-modal,
  .modal-backdrop > .modal.pending-handoff-review {
    width: 100%;
    max-height: calc(100dvh - max(8px, env(safe-area-inset-top)));
    border-radius: 24px 24px 0 0;
  }
  .modal > .modal-content { padding: 28px 20px calc(28px + env(safe-area-inset-bottom)); }
  .modal > .modal-close { top: 18px; right: 18px; width: 48px; height: 48px; }
  .modal > .modal-content > .eyebrow,
  .modal > .modal-content > h2,
  .modal > .modal-content > .profile-modal-header { padding-right: 62px; }
  .modal .form-row { grid-template-columns: 1fr; gap: 18px; }
  .voice-assist-heading,
  .voice-assist-actions { align-items: stretch; flex-direction: column; }
  .voice-record,
  .voice-fill,
  .voice-draft-preview .voice-apply { width: 100%; }
  .profile-modal .profile-modal-header { padding: 28px 20px 18px; }
  .profile-modal .profile-modal-content { padding: 20px; }
  .profile-modal .profile-modal-actions { padding: 16px 20px calc(16px + env(safe-area-inset-bottom)); }
  .confirm-modal > .modal-content { padding: 32px 22px calc(28px + env(safe-area-inset-bottom)); }
}

/* Account actions live behind the signed-in user's avatar. */
.account-navigation { position: relative; }
.account-navigation > summary { display: grid; width: 44px; height: 44px; place-items: center; padding: 0; border: 0; border-radius: 50%; list-style: none; cursor: pointer; transition: background-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.account-navigation > summary::-webkit-details-marker { display: none; }
.account-navigation > summary:hover, .account-navigation[open] > summary { background: rgba(255,255,255,.1); box-shadow: 0 0 0 3px rgba(255,255,255,.08); transform: translateY(-1px); }
.account-navigation > summary:focus-visible { outline: 3px solid color-mix(in srgb, var(--green) 72%, white); outline-offset: 3px; }
.account-navigation > summary .user-avatar { width: 40px; height: 40px; }
.account-navigation-menu { position: absolute; top: calc(100% + 14px); right: 0; z-index: 120; display: grid; gap: 5px; width: 250px; padding: 10px; border: 1px solid var(--line); border-radius: 17px; background: var(--card); box-shadow: 0 24px 70px rgba(9,35,30,.25); }
.account-menu-identity { display: grid; gap: 3px; margin: 0 3px 5px; padding: 9px 10px 13px; border-bottom: 1px solid var(--line); }
.account-menu-identity strong { color: var(--ink); font: 700 14px Manrope; }
.account-menu-identity small { color: var(--muted); font-size: 11px; letter-spacing: 0; }
.sidebar .account-navigation-menu .account-menu-item { display: flex; width: 100%; min-height: 44px; align-items: center; justify-content: flex-start; gap: 11px; padding: 10px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font: 700 13px 'DM Sans'; text-align: left; }
.sidebar .account-navigation-menu .account-menu-item span { width: 20px; color: var(--teal); font-size: 17px; text-align: center; }
.sidebar .account-navigation-menu .account-menu-item:hover { background: var(--soft-blue); color: var(--dark-teal); transform: none; }
.sidebar .account-navigation-menu .account-sign-out { color: #a84f3d; }
.sidebar .account-navigation-menu .account-sign-out span { color: #b35b49; }
html[data-theme="dark"] .account-navigation-menu { background: #222927; border-color: #3a4440; box-shadow: 0 24px 70px rgba(0,0,0,.5); }
@media(max-width:620px) { .account-navigation-menu { top: auto; right: auto; bottom: calc(100% + 12px); left: 0; } .sidebar .user-card { padding-left: 0; } }

/* Larger primary navigation and account controls. */
@media (min-width: 1181px) {
  .sidebar .nav-item,
  .more-navigation summary { min-height: 48px; padding: 10px 13px; font-size: 18px; }
  .sidebar .nav-item span { font-size: 21px; }
}
.account-navigation > summary { width: 54px; height: 54px; }
.account-navigation > summary:hover,
.account-navigation[open] > summary { background: transparent; box-shadow: none; }
.account-navigation > summary .user-avatar {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  overflow: visible;
  font-size: 14px;
  line-height: 1;
  border: 3px solid rgba(255,255,255,.13);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.account-navigation > summary:hover .user-avatar,
.account-navigation[open] > summary .user-avatar {
  border-color: rgba(255,255,255,.34);
  box-shadow: 0 0 0 4px rgba(155,224,211,.12);
  transform: translateY(-1px);
}
.account-navigation-menu { width: 290px; padding: 13px; }
.account-menu-identity strong { font-size: 18px; }
.account-menu-identity small { font-size: 15px; }
.sidebar .account-navigation-menu .account-menu-item {
  min-height: 54px;
  gap: 14px;
  padding: 13px 15px;
  font-size: 18px;
}
.sidebar .account-navigation-menu .account-menu-item span { width: 24px; font-size: 21px; }

@media (max-width: 1180px) and (min-width: 701px) {
  .sidebar .nav-item,
  .more-navigation summary { font-size: 15px; }
}

@media (max-width: 700px) {
  .sidebar .nav-item { min-height: 50px; font-size: 18px; }
  .account-navigation > summary { width: 52px; height: 52px; }
  .account-navigation > summary .user-avatar { width: 46px; height: 46px; }
}
/* Receipt-to-list review */
.receipt-fieldset{margin-top:1rem;border:1px solid var(--line);border-radius:18px;padding:1rem}.receipt-fieldset>p{margin:.25rem 0 .8rem;color:var(--muted)}.receipt-actions{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap}.receipt-actions input{flex:1;min-width:220px}.receipt-suggestions{margin-top:.75rem}.receipt-review{display:grid;gap:.55rem}.receipt-review label{display:grid;grid-template-columns:auto 1fr;align-items:center;gap:.65rem}.receipt-review label input:not([type=checkbox]){width:100%}.receipt-review .primary-button{margin-top:.5rem}.muted-copy{color:var(--muted)}

.shared-child-selection { margin: 20px 0; padding: 16px; border: 1px solid var(--border, #cbd5d2); border-radius: 16px; display:flex; flex-wrap:wrap; gap:12px; }
.shared-child-selection label { display:flex; align-items:center; gap:10px; padding:10px; margin:0; }
.shared-child-selection input[type=checkbox] { width:22px; height:22px; flex:none; }
.shared-child-selection p { flex-basis:100%; margin:0; }
.individual-care-details { border:1px solid var(--border,#cbd5d2); border-radius:16px; padding:16px; margin:16px 0; }
.individual-care-details summary { cursor:pointer; font-weight:700; padding:8px 0; }
.pending-handoff-details p,.care-handoff p { white-space:pre-line; overflow-wrap:anywhere; }

/* Family-first care landing and directory: shared information once. */
.family-care-hero{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:32px;border-radius:24px;background:var(--surface,#fff);border:1px solid #bddbd5;margin-bottom:28px}
.family-care-hero h2{font-size:clamp(28px,2.5vw,40px);margin:8px 0}
.family-care-layout{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(280px,1fr);gap:28px;align-items:start}
.family-child-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr));gap:18px}
.family-child-card,.family-care-panel{padding:24px;border-radius:22px;background:var(--surface,#fff);border:1px solid #d8e5e2;margin-bottom:22px;min-width:0}
.family-child-card header{display:flex;gap:16px;align-items:center}
.family-child-card header h3{margin:0;font-size:24px}
.family-child-card header p{margin:6px 0}
.family-child-card button{margin-top:12px;width:100%}
.family-allergy-alert{color:#a64e22;font-weight:650}
.family-handoff-row{display:flex;gap:18px;align-items:center;justify-content:space-between;padding:18px 0;border-bottom:1px solid #d8e5e2}
.family-contact-row{display:flex;flex-direction:column;gap:7px;padding:18px 0;border-bottom:1px solid #d8e5e2;overflow-wrap:anywhere}
.family-care-panel select{display:block;min-height:48px;margin:10px 0;width:100%}
.family-care-privacy{font-size:16px;color:var(--muted,#63716d)}
.contacts-grid .contact-card{border-radius:22px;padding:26px;gap:18px;align-items:start}
.contacts-grid .contact-card small{display:block;background:#e5f3ef;color:#245d53;padding:8px 12px;border-radius:10px;margin-top:14px}
@media(max-width:900px){.family-care-layout{grid-template-columns:1fr}.family-care-hero{align-items:stretch;flex-direction:column}.family-handoff-row{align-items:stretch;flex-direction:column}}

/* Align family care cards in shared rows instead of independent stacks. */
.caregiver-content:has(.family-care-layout){max-width:none}
.family-care-layout{grid-template-areas:"essentials schedule" "handoffs contacts";align-items:stretch}
.family-care-column{display:contents}
.family-essentials-panel{grid-area:essentials}
.family-handoffs-panel{grid-area:handoffs}
.family-schedule-panel{grid-area:schedule}
.family-contacts-panel{grid-area:contacts}
.family-care-layout .family-care-panel{margin:0;border-color:var(--line)}
.family-care-layout .family-care-panel>h2{margin:0 0 20px;line-height:1.25}
.family-care-layout .family-child-card{margin:0;padding:20px;border-color:var(--line)}
.family-care-hero{border-color:var(--line)}
.family-care-layout .family-handoff-row:last-child,.family-care-layout .family-contact-row:last-child{border-bottom:0}
.family-care-layout .family-handoff-row,.family-care-layout .family-contact-row{border-color:var(--line)}
@media(max-width:900px){.family-care-layout{grid-template-areas:"essentials" "schedule" "handoffs" "contacts"}}

/* Lists: consistent spacing, card edges and theme-aware dividers. */
.lists-page .lists-grid{margin-top:24px;align-items:stretch}
.lists-page .list-suggestions:not([hidden]){margin-top:24px}
.lists-page .family-list-card{min-width:0;display:flex;flex-direction:column;border-color:var(--line);background:var(--surface)}
.lists-page .family-list-card>header{border-color:var(--line);gap:16px}
.lists-page .family-list-card>header>div{min-width:0}
.lists-page .family-list-items{flex:1}
.lists-page .family-list-item{border-color:var(--line)}
.lists-page .family-list-item:last-child{border-bottom:0}
.lists-page .list-empty strong{color:var(--ink)}
.lists-page .list-check{width:30px;height:30px;min-width:30px;min-height:30px;aspect-ratio:1;padding:0;align-self:center}
.lists-page .list-item-details{min-width:0}
.lists-page .list-item-details>span{min-width:0;overflow-wrap:anywhere}
.lists-page .family-list-card>header .add-to-list{flex-shrink:0}
