:root {
  --bg: #f2f0ea;
  --panel: #faf9f5;
  --panel-2: #edf1ed;
  --panel-3: #f6f4ee;
  --text: #34423e;
  --muted: #74807b;
  --line: #d9ded9;
  --brand: #55766a;
  --brand-2: #6f8f84;
  --brand-deep: #34584c;
  --accent: #c38b68;
  --accent-soft: #f0e1d7;
  --lavender: #ddd7eb;
  --blue-soft: #dbe8ed;
  --gold-soft: #f0e6c9;
  --danger: #a55252;
  --danger-soft: #f6e1df;
  --shadow: 0 18px 45px rgba(42, 65, 58, 0.07);
  --radius: 22px;
  --radius-sm: 14px;
}

html[data-theme="dark"], html.theme-dark {
  --bg: #18201f;
  --panel: #222c2a;
  --panel-2: #2a3733;
  --panel-3: #1d2725;
  --text: #edf3f0;
  --muted: #a9b7b1;
  --line: #3a4743;
  --brand: #86a89a;
  --brand-2: #6f9586;
  --brand-deep: #b4d3c7;
  --accent: #d8a485;
  --accent-soft: #47352f;
  --lavender: #3c3748;
  --blue-soft: #31444b;
  --gold-soft: #49412c;
  --danger: #e18b8b;
  --danger-soft: #482d2d;
  --shadow: 0 18px 45px rgba(0,0,0,.20);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
body { min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: var(--brand-deep); }

.app-shell { display: grid; grid-template-columns: 292px minmax(0,1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px 18px; background: var(--panel-3); border-right: 1px solid var(--line); overflow-y: auto; z-index: 30; }
.brand-wrap { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.brand-mark { width: 48px; height: 48px; display:grid; place-items:center; border-radius:16px; background: var(--brand-deep); color:#fff; font-weight:800; letter-spacing:.4px; }
.brand-copy { display:flex; flex-direction:column; min-width:0; }
.brand-copy strong { font-size: 17px; }
.brand-copy span { color: var(--muted); font-size: 12px; margin-top: 2px; }

.child-switcher { margin: 14px 0 18px; padding: 14px; background: var(--panel); border:1px solid var(--line); border-radius: 18px; }
.child-switcher label { display:block; color:var(--muted); font-size:11px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; margin-bottom:8px; }
.child-switcher select { width:100%; border:1px solid var(--line); border-radius:12px; background:var(--panel-3); color:var(--text); padding:10px 12px; }
.child-switcher .switcher-meta { display:flex; justify-content:space-between; align-items:center; margin-top:8px; font-size:12px; color:var(--muted); }
.child-switcher button { background:none; border:0; color:var(--brand-deep); font-weight:700; padding:0; }

nav { display:flex; flex-direction:column; gap:6px; }
.nav-btn { width:100%; border:0; background:transparent; color:var(--muted); display:flex; align-items:center; gap:12px; padding:11px 12px; border-radius:13px; text-align:left; font-weight:650; }
.nav-btn .nav-icon { width:25px; text-align:center; font-size:16px; opacity:.9; }
.nav-btn:hover { background:var(--panel); color:var(--text); }
.nav-btn.active { background:var(--panel); color:var(--brand-deep); box-shadow:0 6px 20px rgba(42,65,58,.035); }
.nav-btn .mini-count { margin-left:auto; min-width:26px; padding:2px 7px; text-align:center; border-radius:999px; background:var(--panel-2); color:var(--muted); font-size:11px; }

.privacy-card { margin-top:20px; border-radius:18px; background:var(--brand-deep); color:#fff; padding:15px; }
.privacy-card strong { display:block; font-size:13px; }
.privacy-card span { display:block; font-size:11px; line-height:1.5; opacity:.85; margin-top:4px; }

.main { min-width:0; }
.topbar { position:sticky; top:0; z-index:20; padding:20px 28px 16px; background:color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); display:flex; align-items:flex-start; justify-content:space-between; gap:20px; border-bottom:1px solid color-mix(in srgb, var(--line) 80%, transparent); }
.topbar-left { display:flex; gap:12px; align-items:flex-start; }
.eyebrow { color:var(--accent); font-size:11px; font-weight:850; letter-spacing:.14em; margin-bottom:5px; }
h1 { font-size:28px; margin:0; line-height:1.15; }
.topbar p { margin:7px 0 0; color:var(--muted); font-size:13px; max-width:720px; }
.top-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.icon-btn, .soft-btn, .primary-btn, .secondary-btn, .danger-btn, .ghost-btn { border-radius:12px; border:1px solid var(--line); padding:10px 13px; font-weight:750; }
.icon-btn { border:0; background:var(--panel); color:var(--text); width:42px; height:42px; padding:0; font-size:20px; }
.soft-btn, .secondary-btn { background:var(--panel); color:var(--text); }
.primary-btn { background:var(--brand-deep); color:#fff; border-color:var(--brand-deep); }
.ghost-btn { background:transparent; color:var(--brand-deep); }
.danger-btn { background:var(--danger-soft); color:var(--danger); border-color:transparent; }
.demo-pill { border-radius:999px; padding:9px 12px; font-size:12px; font-weight:800; white-space:nowrap; background:var(--accent-soft); color:var(--text); }
.demo-pill.full { background:var(--panel-2); color:var(--brand-deep); }

.content { padding: 22px 28px 34px; max-width: 1540px; margin:0 auto; }
.footer { padding: 8px 28px 26px; color:var(--muted); font-size:11px; text-align:center; }

.hero-card { display:grid; grid-template-columns:minmax(0,1.5fr) minmax(260px,.8fr); gap:18px; padding:26px; background:linear-gradient(135deg, var(--brand-deep), var(--brand)); color:#fff; border-radius:28px; box-shadow:var(--shadow); overflow:hidden; position:relative; }
.hero-card::after { content:""; width:240px; height:240px; border-radius:50%; background:rgba(255,255,255,.08); position:absolute; right:-60px; top:-100px; }
.hero-card h2 { font-size:34px; margin:4px 0 8px; }
.hero-card p { max-width:640px; margin:0; line-height:1.6; opacity:.9; }
.hero-badges { display:flex; gap:8px; flex-wrap:wrap; margin-top:18px; }
.hero-badge { border:1px solid rgba(255,255,255,.24); background:rgba(255,255,255,.10); padding:7px 10px; border-radius:999px; font-size:11px; font-weight:750; }
.hero-side { align-self:stretch; display:flex; flex-direction:column; justify-content:space-between; gap:14px; padding:18px; border-radius:20px; background:rgba(255,255,255,.10); border:1px solid rgba(255,255,255,.16); }
.hero-side .big-number { font-size:34px; font-weight:850; }
.hero-side small { opacity:.78; }

.grid { display:grid; gap:16px; }
.grid-2 { grid-template-columns:repeat(2,minmax(0,1fr)); }
.grid-3 { grid-template-columns:repeat(3,minmax(0,1fr)); }
.grid-4 { grid-template-columns:repeat(4,minmax(0,1fr)); }
.section-gap { margin-top:18px; }

.card { background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); padding:18px; box-shadow:0 8px 24px rgba(42,65,58,.028); min-width:0; }
.card.soft { background:var(--panel-2); }
.card.accent { background:var(--accent-soft); }
.card.blue { background:var(--blue-soft); }
.card.lavender { background:var(--lavender); }
.card.gold { background:var(--gold-soft); }
.card-header { display:flex; justify-content:space-between; align-items:flex-start; gap:10px; margin-bottom:14px; }
.card-header h2, .card-header h3 { margin:0; }
.card-header h2 { font-size:20px; }
.card-header h3 { font-size:16px; }
.card-header p { margin:4px 0 0; color:var(--muted); font-size:12px; }
.kpi { display:flex; flex-direction:column; gap:5px; }
.kpi .label { color:var(--muted); font-size:12px; font-weight:700; }
.kpi .value { font-size:27px; font-weight:850; }
.kpi .sub { color:var(--muted); font-size:11px; }

.quick-grid { display:grid; grid-template-columns:repeat(6,minmax(110px,1fr)); gap:10px; }
.quick-action { border:1px solid var(--line); background:var(--panel); color:var(--text); border-radius:17px; padding:15px 11px; display:flex; flex-direction:column; align-items:center; gap:7px; font-weight:750; }
.quick-action:hover { transform:translateY(-1px); border-color:var(--brand); }
.quick-action span:first-child { font-size:22px; }
.quick-action small { color:var(--muted); font-weight:600; }

.stat-row { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:11px 0; border-bottom:1px solid var(--line); }
.stat-row:last-child { border-bottom:0; }
.stat-row strong { font-size:13px; }
.stat-row span { color:var(--muted); font-size:12px; }

.list { display:flex; flex-direction:column; gap:10px; }
.list-item { border:1px solid var(--line); border-radius:16px; background:var(--panel-3); padding:13px 14px; display:flex; align-items:flex-start; gap:12px; }
.list-item .item-icon { width:36px; height:36px; flex:0 0 auto; border-radius:12px; display:grid; place-items:center; background:var(--panel-2); }
.list-item .item-body { min-width:0; flex:1; }
.list-item .item-title { font-size:13px; font-weight:800; }
.list-item .item-meta { color:var(--muted); font-size:11px; margin-top:3px; line-height:1.45; }
.list-item .item-actions { display:flex; gap:6px; align-items:center; }
.small-btn { border:1px solid var(--line); background:var(--panel); color:var(--text); border-radius:10px; padding:7px 9px; font-size:11px; font-weight:750; }
.small-btn.danger { color:var(--danger); background:var(--danger-soft); border-color:transparent; }

.table-wrap { overflow:auto; border:1px solid var(--line); border-radius:16px; }
table { width:100%; border-collapse:collapse; min-width:780px; background:var(--panel); }
th, td { text-align:left; padding:11px 12px; border-bottom:1px solid var(--line); font-size:12px; vertical-align:top; }
th { color:var(--muted); font-size:10px; text-transform:uppercase; letter-spacing:.06em; background:var(--panel-3); position:sticky; top:0; }
tr:last-child td { border-bottom:0; }

.badge { display:inline-flex; align-items:center; gap:5px; padding:5px 8px; border-radius:999px; font-size:10px; font-weight:800; background:var(--panel-2); color:var(--text); }
.badge.green { background:#dcece5; color:#315e4e; }
.badge.orange { background:var(--accent-soft); color:#7a4c33; }
.badge.lilac { background:var(--lavender); color:#554d6b; }
.badge.red { background:var(--danger-soft); color:var(--danger); }
html[data-theme="dark"] .badge.green, html.theme-dark .badge.green { background:#2f4a40; color:#c9e8dc; }
html[data-theme="dark"] .badge.orange, html.theme-dark .badge.orange { color:#f0c1a5; }
html[data-theme="dark"] .badge.lilac, html.theme-dark .badge.lilac { color:#ddd5ef; }

.progress { height:9px; border-radius:999px; background:var(--line); overflow:hidden; }
.progress > span { display:block; height:100%; background:var(--brand); border-radius:999px; }
.progress-label { display:flex; justify-content:space-between; align-items:center; gap:10px; font-size:11px; margin-top:7px; color:var(--muted); }

.filters { display:flex; gap:10px; flex-wrap:wrap; align-items:flex-end; margin-bottom:14px; }
.field { display:flex; flex-direction:column; gap:6px; min-width:0; }
.field.grow { flex:1; }
.field label { font-size:11px; font-weight:800; color:var(--muted); }
.field input, .field select, .field textarea { width:100%; border:1px solid var(--line); background:var(--panel-3); color:var(--text); border-radius:12px; padding:10px 11px; outline:none; }
.field textarea { min-height:90px; resize:vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color:var(--brand); box-shadow:0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent); }
.form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.form-grid .span-2 { grid-column:1 / -1; }
.form-actions { display:flex; gap:8px; justify-content:flex-end; margin-top:16px; flex-wrap:wrap; }
.help { color:var(--muted); font-size:11px; line-height:1.5; }

.empty { text-align:center; padding:30px 18px; color:var(--muted); border:1px dashed var(--line); border-radius:16px; background:var(--panel-3); }
.empty strong { display:block; color:var(--text); margin-bottom:5px; }

.timeline { position:relative; display:flex; flex-direction:column; gap:14px; }
.timeline::before { content:""; position:absolute; left:17px; top:7px; bottom:8px; width:2px; background:var(--line); }
.timeline-item { position:relative; display:grid; grid-template-columns:36px 1fr; gap:12px; }
.timeline-dot { width:36px; height:36px; border-radius:50%; z-index:1; display:grid; place-items:center; background:var(--panel-2); border:4px solid var(--panel); }
.timeline-body { padding:8px 0 2px; }
.timeline-body strong { font-size:13px; }
.timeline-body p { margin:4px 0 0; color:var(--muted); font-size:11px; line-height:1.45; }

.calendar-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:6px; }
.calendar-head { color:var(--muted); text-align:center; font-size:10px; font-weight:800; padding:6px; }
.calendar-day { min-height:94px; border:1px solid var(--line); border-radius:13px; padding:8px; background:var(--panel-3); }
.calendar-day.outside { opacity:.35; }
.calendar-day.today { border-color:var(--brand); }
.calendar-date { font-size:11px; font-weight:800; margin-bottom:5px; }
.calendar-event { font-size:9px; padding:4px 5px; border-radius:7px; background:var(--panel-2); margin-top:4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.report-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin:14px 0; }
.report-box { border:1px solid var(--line); border-radius:15px; padding:13px; background:var(--panel-3); }
.report-box strong { display:block; font-size:20px; }
.report-box span { color:var(--muted); font-size:10px; }

.modal { position:fixed; inset:0; z-index:100; display:none; place-items:center; padding:20px; background:rgba(14,25,22,.48); backdrop-filter:blur(6px); }
.modal.open { display:grid; }
.modal-card { width:min(720px,100%); max-height:90vh; overflow:auto; background:var(--panel); border:1px solid var(--line); border-radius:24px; padding:24px; box-shadow:var(--shadow); position:relative; }
.modal-close { position:absolute; top:13px; right:13px; width:35px; height:35px; border:1px solid var(--line); border-radius:11px; background:var(--panel-3); color:var(--text); font-size:20px; }
.modal h2 { margin:0 42px 6px 0; }
.modal .intro { color:var(--muted); font-size:12px; margin:0 42px 18px 0; line-height:1.5; }

.toast-stack { position:fixed; z-index:150; right:18px; bottom:18px; display:flex; flex-direction:column; gap:8px; }
.toast { background:var(--brand-deep); color:white; border-radius:14px; padding:11px 14px; box-shadow:var(--shadow); font-size:12px; max-width:340px; animation:toastin .2s ease; }
.toast.error { background:#783f3f; }
@keyframes toastin { from { transform:translateY(8px); opacity:0; } to { transform:none; opacity:1; } }

.scrim { display:none; }
.mobile-only { display:none; }
.close-sidebar { margin-left:auto; }

@media (max-width: 1200px) {
  .grid-4 { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .quick-grid { grid-template-columns:repeat(3,minmax(110px,1fr)); }
  .report-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

@media (max-width: 900px) {
  .mobile-only { display:inline-grid; place-items:center; }
  .app-shell { grid-template-columns:1fr; }
  .sidebar { position:fixed; left:0; top:0; width:min(320px,86vw); transform:translateX(-105%); transition:transform .22s ease; box-shadow:var(--shadow); }
  .sidebar.open { transform:translateX(0); }
  .scrim { position:fixed; inset:0; z-index:25; background:rgba(12,20,18,.36); }
  .scrim.open { display:block; }
  .topbar { padding:16px 18px; }
  .content { padding:18px; }
  .hero-card { grid-template-columns:1fr; }
  .grid-3 { grid-template-columns:1fr 1fr; }
  .footer { padding-inline:18px; }
}

@media (max-width: 640px) {
  h1 { font-size:24px; }
  .topbar { align-items:center; }
  .topbar p { display:none; }
  .eyebrow { display:none; }
  .hide-small { display:none; }
  .top-actions { gap:5px; }
  .soft-btn, .primary-btn { padding:9px 10px; font-size:11px; }
  .demo-pill { position:fixed; left:50%; bottom:12px; transform:translateX(-50%); z-index:60; box-shadow:var(--shadow); }
  .content { padding-bottom:64px; }
  .hero-card { padding:20px; }
  .hero-card h2 { font-size:28px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns:1fr; }
  .quick-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .form-grid { grid-template-columns:1fr; }
  .form-grid .span-2 { grid-column:auto; }
  .report-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .calendar-day { min-height:72px; padding:5px; }
  .calendar-event { font-size:8px; padding:3px; }
  .modal { padding:10px; align-items:end; }
  .modal-card { width:100%; max-height:92vh; border-radius:24px 24px 14px 14px; }
}

@media print {
  .sidebar, .topbar, .footer, .no-print, .item-actions, .filters, button { display:none !important; }
  .app-shell { display:block; }
  .content { padding:0; max-width:none; }
  .card, .hero-card { box-shadow:none; break-inside:avoid; }
  body { background:white; color:black; }
}

/* Child profile photos */
.switcher-child { display:flex; align-items:center; gap:10px; margin:0 0 10px; min-width:0; }
.switcher-child > div { min-width:0; display:flex; flex-direction:column; gap:2px; }
.switcher-child strong { font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.switcher-child span:not(.child-avatar) { color:var(--muted); font-size:10px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.child-avatar { flex:0 0 auto; display:grid; place-items:center; overflow:hidden; border-radius:50%; background:linear-gradient(145deg,var(--panel-2),var(--blue-soft)); border:1px solid color-mix(in srgb,var(--line) 78%, transparent); color:var(--brand-deep); font-weight:850; letter-spacing:.02em; box-shadow:0 5px 16px rgba(42,65,58,.07); }
.child-avatar img { width:100%; height:100%; display:block; object-fit:cover; }
.child-avatar.sm { width:42px; height:42px; font-size:15px; }
.child-avatar.md { width:56px; height:56px; font-size:20px; }
.child-avatar.lg { width:76px; height:76px; font-size:26px; }
.child-avatar.xl { width:88px; height:88px; font-size:30px; }
.child-avatar.xxl { width:124px; height:124px; font-size:40px; }
.child-avatar.fallback { background:linear-gradient(145deg,var(--panel-2),var(--accent-soft)); }

.hero-profile-line { display:flex; align-items:center; gap:16px; margin-bottom:10px; }
.hero-avatar { border:2px solid rgba(255,255,255,.42); box-shadow:0 10px 24px rgba(0,0,0,.12); background:rgba(255,255,255,.15); color:#fff; }
.hero-profile-line h2 { margin-top:2px; }

.child-profile-card { position:relative; }
.child-profile-head { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:14px; margin-bottom:14px; }
.child-profile-title { min-width:0; }
.child-profile-title h3 { margin:0; font-size:18px; display:flex; align-items:center; flex-wrap:wrap; gap:6px; }
.child-profile-title p { margin:5px 0 0; color:var(--muted); font-size:12px; }
.child-edit-btn { align-self:start; position:relative; z-index:2; }
.selectable-child-card { cursor:pointer; transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease,background .18s ease; }
.selectable-child-card:hover { transform:translateY(-2px); border-color:color-mix(in srgb,var(--brand) 42%, var(--line)); box-shadow:0 12px 28px rgba(42,65,58,.10); background:color-mix(in srgb,var(--panel) 96%, var(--brand-soft)); }
.selectable-child-card:active { transform:translateY(0); }
.selectable-child-card:focus-visible { outline:3px solid color-mix(in srgb,var(--brand) 26%, transparent); outline-offset:3px; }
.active-child-card { border-color:color-mix(in srgb,var(--brand) 30%, var(--line)); }
.profile-select-hint { margin-top:14px; padding-top:12px; border-top:1px solid var(--line); display:flex; align-items:center; justify-content:space-between; gap:12px; color:var(--brand-deep); font-weight:800; font-size:12px; }
.profile-select-hint span:last-child { font-size:18px; line-height:1; transition:transform .18s ease; }
.selectable-child-card:hover .profile-select-hint span:last-child { transform:translateX(3px); }

.profile-photo-editor { display:flex; align-items:center; gap:18px; border:1px solid var(--line); border-radius:18px; padding:14px; background:var(--panel-3); margin-bottom:14px; }
.photo-preview-wrap { flex:0 0 auto; }
.photo-editor-copy { min-width:0; display:flex; flex-direction:column; gap:5px; }
.photo-editor-copy > strong { font-size:14px; }
.photo-editor-copy > span { color:var(--muted); font-size:11px; line-height:1.5; max-width:480px; }
.photo-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:5px; align-items:center; }
.file-btn { display:inline-flex; align-items:center; justify-content:center; cursor:pointer; }
.is-hidden { display:none !important; }

@media (max-width: 640px) {
  .hero-profile-line { align-items:flex-start; gap:12px; }
  .hero-avatar { width:60px !important; height:60px !important; font-size:21px !important; }
  .profile-photo-editor { align-items:flex-start; }
  .child-avatar.xxl { width:92px; height:92px; font-size:30px; }
  .child-profile-head { grid-template-columns:auto minmax(0,1fr); }
  .child-edit-btn { grid-column:2; justify-self:start; }
  .child-avatar.xl { width:72px; height:72px; font-size:25px; }
}


/* Theme controls */
.theme-toggle-group { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:14px; }
.theme-option { min-height:52px; border:1px solid var(--line); border-radius:14px; background:var(--panel-3); color:var(--text); display:flex; align-items:center; justify-content:center; gap:9px; font-weight:800; transition:background .18s ease,border-color .18s ease,box-shadow .18s ease,transform .18s ease; }
.theme-option:hover { border-color:var(--brand); transform:translateY(-1px); }
.theme-option.active { background:var(--brand-deep); border-color:var(--brand-deep); color:#fff; box-shadow:0 8px 22px rgba(42,65,58,.14); }
html[data-theme="dark"] .theme-option.active, html.theme-dark .theme-option.active { color:#15201d; background:var(--brand-deep); }
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea, html.theme-dark input, html.theme-dark select, html.theme-dark textarea { color-scheme:dark; }
html[data-theme="light"] input, html[data-theme="light"] select, html[data-theme="light"] textarea, html.theme-light input, html.theme-light select, html.theme-light textarea { color-scheme:light; }

/* Dark-theme contrast fixes for branded surfaces */
html[data-theme="dark"] .brand-mark, html.theme-dark .brand-mark,
html[data-theme="dark"] .privacy-card, html.theme-dark .privacy-card,
html[data-theme="dark"] .primary-btn, html.theme-dark .primary-btn { background:#355c50; border-color:#355c50; color:#fff; }
html[data-theme="light"] .hero-card, html.theme-light .hero-card { background:linear-gradient(135deg,#426459,#628176); color:#fff; }
html[data-theme="dark"] .hero-card, html.theme-dark .hero-card { background:linear-gradient(135deg,#29463d,#496b5f); color:#fff; }
html[data-theme="dark"] .demo-pill.full, html.theme-dark .demo-pill.full { color:#cbe1d8; }
html[data-theme="dark"] .nav-btn.active, html.theme-dark .nav-btn.active { box-shadow:0 6px 20px rgba(0,0,0,.16); }
html[data-theme="dark"] .card, html.theme-dark .card { box-shadow:0 8px 24px rgba(0,0,0,.10); }
body, .sidebar, .topbar, .card, .list-item, button, input, select, textarea { transition:background-color .18s ease,color .18s ease,border-color .18s ease; }

/* =========================================================
   TracklyApp Editorial Wellness Premium UI — 2026-09-04
   Inspired by the approved warm sage / botanical concept.
   Functionality is unchanged; this block only refines UI.
   ========================================================= */
:root {
  --radius: 24px;
  --radius-sm: 15px;
}

h1,
.hero-card h2,
.card-header h2,
.card-header h3,
.modal h2 {
  font-family: Georgia, "Times New Roman", ui-serif, serif;
  letter-spacing: -.02em;
}

h1 { font-size: 31px; font-weight: 700; }
.card-header h2 { font-size: 22px; }
.card-header h3 { font-size: 17px; }

.app-shell { grid-template-columns: 286px minmax(0,1fr); }
.sidebar { padding: 24px 19px; }
.brand-wrap { gap: 13px; margin-bottom: 20px; }
.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  box-shadow: 0 8px 24px rgba(52,88,76,.11);
}
.brand-copy strong { font-size: 18px; letter-spacing: -.015em; }
.brand-copy span { font-size: 11px; }

.child-switcher { border-radius: 20px; padding: 15px; }
.child-switcher select { min-height: 44px; }
.nav-btn { min-height: 45px; border-radius: 14px; padding: 11px 13px; }
.nav-btn .nav-icon { opacity:.78; }
.nav-btn .mini-count { min-width: 24px; padding: 3px 7px; }

.topbar { padding: 22px 30px 18px; }
.topbar p { font-size: 12px; }
.eyebrow { letter-spacing:.16em; }
.icon-btn, .soft-btn, .primary-btn, .secondary-btn, .danger-btn, .ghost-btn {
  border-radius: 14px;
  min-height: 42px;
}
.primary-btn { box-shadow: 0 8px 20px rgba(54,92,80,.10); }
.demo-pill { padding: 10px 14px; }

.content { padding: 24px 30px 38px; max-width: 1460px; }
.footer { padding-bottom: 30px; }

.hero-card {
  border-radius: 30px;
  padding: 30px;
  gap: 26px;
}
.hero-card h2 { font-size: 36px; line-height:1.08; }
.hero-card p { font-size: 14px; line-height: 1.72; }
.hero-badge { padding: 8px 11px; }
.hero-side { border-radius: 22px; padding: 20px; }
.hero-side .big-number { font-family: Georgia, "Times New Roman", serif; font-size: 38px; }

.card { border-radius: 24px; padding: 20px; }
.section-gap { margin-top: 20px; }
.quick-grid { gap: 12px; }
.quick-action {
  border-radius: 19px;
  min-height: 132px;
  padding: 19px 12px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background-color .18s ease;
}
.quick-action span:first-child { font-size: 24px; }
.quick-action > span:nth-child(2) { font-family: Georgia, "Times New Roman", serif; font-size: 16px; }
.quick-action small { font-size: 11px; }
.quick-action:hover { transform: translateY(-3px); }

.kpi { min-height: 93px; justify-content:center; position:relative; z-index:1; }
.kpi .label { font-size: 11px; }
.kpi .value { font-family: Georgia, "Times New Roman", serif; font-size: 30px; }
.card.soft, .card.blue, .card.lavender, .card.gold { position:relative; overflow:hidden; }

.list-item { border-radius: 18px; padding: 14px; }
.list-item .item-icon { border-radius: 13px; }
.stat-row { padding: 13px 0; }
.progress { height: 8px; }
.modal-card { border-radius: 28px; }

/* ---------- Approved light / Editorial Wellness ---------- */
html[data-theme="light"], html.theme-light {
  --bg: #f7f4ed;
  --panel: #fffdf9;
  --panel-2: #eef0e5;
  --panel-3: #faf7f0;
  --text: #2d352f;
  --muted: #767a71;
  --line: #e4e0d6;
  --brand: #7d8c62;
  --brand-2: #95a17c;
  --brand-deep: #65794b;
  --accent: #ad7e58;
  --accent-soft: #f4e9da;
  --lavender: #eee8e5;
  --blue-soft: #e8eff0;
  --gold-soft: #f7edda;
  --shadow: 0 18px 50px rgba(66,70,55,.075);
}

html[data-theme="light"] body, html.theme-light body {
  background:
    radial-gradient(circle at 82% 9%, rgba(210,218,198,.26), transparent 25%),
    linear-gradient(180deg,#f8f5ef 0%,#f5f1e8 100%);
}

html[data-theme="light"] .sidebar, html.theme-light .sidebar {
  background:
    linear-gradient(rgba(252,250,245,.94), rgba(252,250,245,.94)),
    url('botanical.svg') left -72px bottom -52px / 230px auto no-repeat;
  border-right-color:#e9e4da;
}
html[data-theme="light"] .brand-mark, html.theme-light .brand-mark {
  background: linear-gradient(145deg,#6d8363,#4f715c);
  border-color:transparent;
}
html[data-theme="light"] .child-switcher, html.theme-light .child-switcher {
  background:rgba(255,253,249,.84);
  border-color:#e3ded3;
  box-shadow: 0 10px 28px rgba(83,78,60,.035);
}
html[data-theme="light"] .child-switcher select, html.theme-light .child-switcher select {
  background:#fffdf9;
  border-color:#e1ddd3;
}
html[data-theme="light"] .nav-btn, html.theme-light .nav-btn { color:#656d66; }
html[data-theme="light"] .nav-btn:hover, html.theme-light .nav-btn:hover {
  background:#f0efe7;
  color:#36443c;
}
html[data-theme="light"] .nav-btn.active, html.theme-light .nav-btn.active {
  background:linear-gradient(90deg,#e8ebe0,#f0f0e9);
  color:#4c684f;
  box-shadow:none;
}
html[data-theme="light"] .nav-btn .mini-count, html.theme-light .nav-btn .mini-count {
  background:#ebede4;
  color:#687066;
}
html[data-theme="light"] .privacy-card, html.theme-light .privacy-card {
  background:linear-gradient(145deg,#f0f1e7,#e9eddf);
  color:#3d513e;
  border:1px solid #dfe4d6;
  box-shadow:none;
}

html[data-theme="light"] .topbar, html.theme-light .topbar {
  background:color-mix(in srgb,#f8f5ef 92%,transparent);
  border-bottom-color:#e7e2d8;
  box-shadow: 0 8px 30px rgba(94,87,66,.025);
}
html[data-theme="light"] .soft-btn, html.theme-light .soft-btn,
html[data-theme="light"] .secondary-btn, html.theme-light .secondary-btn {
  background:#fffdf9;
  border-color:#dfdbd0;
  box-shadow:0 6px 18px rgba(75,72,61,.035);
}
html[data-theme="light"] .primary-btn, html.theme-light .primary-btn {
  background:#667b4e;
  border-color:#667b4e;
}
html[data-theme="light"] .demo-pill, html.theme-light .demo-pill {
  background:#f4eadc;
  color:#4c4a42;
}

html[data-theme="light"] .hero-card, html.theme-light .hero-card {
  color:#28332c;
  background:
    linear-gradient(90deg,rgba(247,247,238,.98) 0%,rgba(241,244,231,.96) 64%,rgba(231,237,219,.92) 100%);
  border:1px solid #dfe3d7;
  box-shadow:0 22px 55px rgba(83,86,66,.09);
}
html[data-theme="light"] .hero-card::before, html.theme-light .hero-card::before {
  content:"";
  position:absolute;
  right:-8px;
  bottom:-42px;
  width:250px;
  height:290px;
  background:url('botanical.svg') center/contain no-repeat;
  opacity:.48;
  pointer-events:none;
}
html[data-theme="light"] .hero-card::after, html.theme-light .hero-card::after {
  width:260px;
  height:260px;
  right:-90px;
  top:-100px;
  background:rgba(255,255,255,.36);
}
html[data-theme="light"] .hero-card .eyebrow, html.theme-light .hero-card .eyebrow { color:#73845e !important; }
html[data-theme="light"] .hero-card p, html.theme-light .hero-card p { opacity:.84; }
html[data-theme="light"] .hero-avatar, html.theme-light .hero-avatar {
  border:3px solid rgba(255,255,255,.92);
  box-shadow:0 10px 25px rgba(82,82,62,.13);
}
html[data-theme="light"] .hero-badge, html.theme-light .hero-badge {
  background:rgba(255,255,255,.48);
  border-color:#cad2c0;
  color:#52634e;
  backdrop-filter: blur(5px);
}
html[data-theme="light"] .hero-side, html.theme-light .hero-side {
  position:relative;
  z-index:1;
  background:rgba(255,253,249,.72);
  border-color:rgba(190,199,182,.74);
  box-shadow:0 12px 34px rgba(67,73,57,.08);
  backdrop-filter: blur(8px);
}
html[data-theme="light"] .hero-side small, html.theme-light .hero-side small { opacity:.72; }
html[data-theme="light"] .hero-side .progress, html.theme-light .hero-side .progress { background:#dce2d4 !important; }
html[data-theme="light"] .hero-side .progress > span, html.theme-light .hero-side .progress > span { background:#82946a !important; }

html[data-theme="light"] .card, html.theme-light .card {
  background:rgba(255,253,249,.94);
  border-color:#e2ded5;
  box-shadow:0 12px 34px rgba(74,72,57,.045);
}
html[data-theme="light"] .quick-action, html.theme-light .quick-action {
  background:#fffdf9;
  border-color:#e4e0d7;
  box-shadow:0 8px 20px rgba(84,78,59,.025);
}
html[data-theme="light"] .quick-action:nth-child(1), html.theme-light .quick-action:nth-child(1) { background:linear-gradient(160deg,#f8f4e7,#fffaf2); color:#7f702c; }
html[data-theme="light"] .quick-action:nth-child(2), html.theme-light .quick-action:nth-child(2) { background:linear-gradient(160deg,#f1f2e4,#fbfaf4); color:#65774f; }
html[data-theme="light"] .quick-action:nth-child(3), html.theme-light .quick-action:nth-child(3) { background:linear-gradient(160deg,#eaf0f1,#f9fbfa); color:#527080; }
html[data-theme="light"] .quick-action:nth-child(4), html.theme-light .quick-action:nth-child(4) { background:linear-gradient(160deg,#f5e9df,#fff8f1); color:#95664e; }
html[data-theme="light"] .quick-action:nth-child(5), html.theme-light .quick-action:nth-child(5) { background:linear-gradient(160deg,#edf0ef,#fbfbf8); color:#556f70; }
html[data-theme="light"] .quick-action:nth-child(6), html.theme-light .quick-action:nth-child(6) { background:linear-gradient(160deg,#fbf0df,#fffaf1); color:#9a702f; }
html[data-theme="light"] .quick-action small, html.theme-light .quick-action small { color:#706f68; }
html[data-theme="light"] .quick-action:hover, html.theme-light .quick-action:hover {
  border-color:#cfd4c6;
  box-shadow:0 14px 28px rgba(79,75,61,.075);
}

html[data-theme="light"] .card.soft, html.theme-light .card.soft {
  background:
    url('botanical.svg') right -42px bottom -76px / 150px auto no-repeat,
    linear-gradient(145deg,#f1f3e8,#f7f6ee);
}
html[data-theme="light"] .card.blue, html.theme-light .card.blue {
  background:
    radial-gradient(circle at 72% 78%,rgba(255,255,255,.72),transparent 24%),
    linear-gradient(145deg,#e7eff1,#f2f5f4);
}
html[data-theme="light"] .card.lavender, html.theme-light .card.lavender {
  background:
    radial-gradient(circle at 80% 92%,rgba(205,194,216,.28),transparent 34%),
    linear-gradient(145deg,#eee8e7,#f6f1ed);
}
html[data-theme="light"] .card.gold, html.theme-light .card.gold {
  background:
    url('botanical.svg') right -64px bottom -90px / 140px auto no-repeat,
    linear-gradient(145deg,#f8edda,#fcf6e9);
}

html[data-theme="light"] .list-item, html.theme-light .list-item {
  background:#fbfaf6;
  border-color:#e5e0d7;
}
html[data-theme="light"] .list-item .item-icon, html.theme-light .list-item .item-icon {
  background:#edf1e7;
  color:#617653;
}
html[data-theme="light"] .progress > span, html.theme-light .progress > span { background:#7f9267; }
html[data-theme="light"] .progress, html.theme-light .progress { background:#e0e4da; }
html[data-theme="light"] .badge.green, html.theme-light .badge.green { background:#e4efe7; color:#4f765d; }

html[data-theme="light"] .modal-card, html.theme-light .modal-card {
  background:#fffdf9;
  border-color:#e3ded4;
  box-shadow:0 28px 80px rgba(66,62,50,.16);
}
html[data-theme="light"] .field input, html.theme-light .field input,
html[data-theme="light"] .field select, html.theme-light .field select,
html[data-theme="light"] .field textarea, html.theme-light .field textarea {
  background:#fbfaf6;
  border-color:#e2ddd2;
}

/* Keep the premium character on dark mode without changing its logic. */
html[data-theme="dark"] .hero-card, html.theme-dark .hero-card {
  background:linear-gradient(135deg,#263f37,#44695b);
}
html[data-theme="dark"] .card, html.theme-dark .card,
html[data-theme="dark"] .quick-action, html.theme-dark .quick-action {
  border-color:#3a4743;
}
html[data-theme="dark"] .quick-action:hover, html.theme-dark .quick-action:hover {
  box-shadow:0 12px 26px rgba(0,0,0,.16);
}

@media (max-width: 1200px) {
  .app-shell { grid-template-columns: 274px minmax(0,1fr); }
  .hero-card { padding:26px; }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns:1fr; }
  .content { padding:20px; }
  .hero-card { padding:24px; }
}

@media (max-width: 640px) {
  h1 { font-size:26px; }
  .content { padding:16px 14px 70px; }
  .topbar { padding:15px 14px; }
  .hero-card { border-radius:24px; padding:20px; }
  .hero-card h2 { font-size:29px; }
  .quick-action { min-height:112px; }
  .card { padding:17px; border-radius:20px; }
}


/* =========================================================
   TracklyApp Premium Dark Glass palette — approved 2026-09-04
   Keeps the existing layout and functionality; dark mode only.
   ========================================================= */
html[data-theme="dark"], html.theme-dark {
  --bg: #091414;
  --panel: #132A27;
  --panel-2: #173330;
  --panel-3: #0D1B1A;
  --text: #F2F3EE;
  --muted: #B8C2BC;
  --line: rgba(255,255,255,.08);
  --brand: #4FA07F;
  --brand-2: #6AB092;
  --brand-deep: #7FD6AE;
  --accent: #E7B39A;
  --accent-soft: #3A2E29;
  --lavender: #3B3150;
  --blue-soft: #243E4B;
  --gold-soft: #4A3A24;
  --danger: #E89A9A;
  --danger-soft: #402A2A;
  --shadow: 0 20px 54px rgba(0,0,0,.30);
}

html[data-theme="dark"] body, html.theme-dark body {
  background:
    radial-gradient(circle at 80% 8%, rgba(79,160,127,.10), transparent 30%),
    radial-gradient(circle at 18% 70%, rgba(73,121,105,.07), transparent 26%),
    linear-gradient(180deg,#091414 0%,#0B1716 100%);
}

html[data-theme="dark"] .sidebar, html.theme-dark .sidebar {
  background:
    radial-gradient(circle at 8% 2%, rgba(79,160,127,.13), transparent 24%),
    linear-gradient(180deg,#102320 0%,#0D1D1B 100%);
  border-right-color:rgba(255,255,255,.075);
  box-shadow:14px 0 44px rgba(0,0,0,.10);
}

html[data-theme="dark"] .brand-mark, html.theme-dark .brand-mark {
  background:linear-gradient(145deg,#3E846B,#205648);
  border:1px solid rgba(127,214,174,.16);
  color:#F7FAF6;
  box-shadow:0 9px 28px rgba(79,160,127,.18);
}

html[data-theme="dark"] .child-switcher, html.theme-dark .child-switcher {
  background:rgba(19,42,39,.74);
  border-color:rgba(255,255,255,.10);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.025), 0 12px 28px rgba(0,0,0,.08);
  backdrop-filter:blur(12px);
}
html[data-theme="dark"] .child-switcher select, html.theme-dark .child-switcher select {
  background:#0F211E;
  border-color:rgba(255,255,255,.10);
  color:#F2F3EE;
}
html[data-theme="dark"] .child-switcher button, html.theme-dark .child-switcher button { color:#7FD6AE; }

html[data-theme="dark"] .nav-btn, html.theme-dark .nav-btn { color:#B8C2BC; }
html[data-theme="dark"] .nav-btn:hover, html.theme-dark .nav-btn:hover {
  background:rgba(79,160,127,.09);
  color:#F2F3EE;
}
html[data-theme="dark"] .nav-btn.active, html.theme-dark .nav-btn.active {
  background:linear-gradient(90deg,rgba(34,84,70,.82),rgba(24,60,52,.68));
  color:#EAFBF3;
  border:1px solid rgba(127,214,174,.28);
  box-shadow:0 0 0 1px rgba(127,214,174,.05), 0 8px 24px rgba(0,0,0,.16), inset 0 0 22px rgba(79,160,127,.08);
}
html[data-theme="dark"] .nav-btn .mini-count, html.theme-dark .nav-btn .mini-count {
  background:rgba(255,255,255,.065);
  color:#C6D2CC;
}

html[data-theme="dark"] .privacy-card, html.theme-dark .privacy-card {
  background:linear-gradient(145deg,rgba(35,78,67,.88),rgba(25,58,51,.92));
  border:1px solid rgba(127,214,174,.18);
  color:#F2F3EE;
  box-shadow:0 14px 30px rgba(0,0,0,.10);
}

html[data-theme="dark"] .topbar, html.theme-dark .topbar {
  background:rgba(9,20,20,.82);
  border-bottom-color:rgba(255,255,255,.07);
  box-shadow:0 10px 34px rgba(0,0,0,.08);
  backdrop-filter:blur(18px) saturate(115%);
}
html[data-theme="dark"] .eyebrow, html.theme-dark .eyebrow { color:#E7B39A; }

html[data-theme="dark"] .soft-btn, html.theme-dark .soft-btn,
html[data-theme="dark"] .secondary-btn, html.theme-dark .secondary-btn,
html[data-theme="dark"] .icon-btn, html.theme-dark .icon-btn {
  background:rgba(19,42,39,.88);
  border-color:rgba(255,255,255,.10);
  color:#F2F3EE;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.025);
}
html[data-theme="dark"] .primary-btn, html.theme-dark .primary-btn {
  background:linear-gradient(145deg,#4FA07F,#3D8068);
  border-color:#4FA07F;
  color:#F8FCF9;
  box-shadow:0 10px 26px rgba(79,160,127,.18);
}
html[data-theme="dark"] .primary-btn:hover, html.theme-dark .primary-btn:hover { background:linear-gradient(145deg,#5BAA89,#458A70); }
html[data-theme="dark"] .ghost-btn, html.theme-dark .ghost-btn { color:#7FD6AE; border-color:rgba(127,214,174,.20); }
html[data-theme="dark"] .demo-pill, html.theme-dark .demo-pill {
  background:rgba(109,72,53,.46);
  color:#F0D4C5;
  border:1px solid rgba(231,179,154,.10);
}

html[data-theme="dark"] .hero-card, html.theme-dark .hero-card {
  color:#F2F3EE;
  background:
    radial-gradient(circle at 96% 0%,rgba(127,214,174,.08),transparent 28%),
    linear-gradient(135deg,rgba(25,63,56,.96),rgba(13,39,37,.97));
  border:1px solid rgba(127,214,174,.19);
  box-shadow:0 24px 60px rgba(0,0,0,.26), inset 0 1px 0 rgba(255,255,255,.035);
}
html[data-theme="dark"] .hero-card::before, html.theme-dark .hero-card::before {
  content:"";
  position:absolute;
  right:-20px;
  bottom:-58px;
  width:300px;
  height:330px;
  background:url('botanical.svg') center/contain no-repeat;
  opacity:.075;
  filter:saturate(.7) brightness(1.4);
  pointer-events:none;
}
html[data-theme="dark"] .hero-card::after, html.theme-dark .hero-card::after {
  background:rgba(127,214,174,.045);
}
html[data-theme="dark"] .hero-card .eyebrow, html.theme-dark .hero-card .eyebrow { color:#F0B99F !important; }
html[data-theme="dark"] .hero-badge, html.theme-dark .hero-badge {
  color:#DDE8E2;
  background:rgba(7,21,20,.28);
  border-color:rgba(255,255,255,.13);
  backdrop-filter:blur(8px);
}
html[data-theme="dark"] .hero-side, html.theme-dark .hero-side {
  background:rgba(16,35,33,.62);
  border-color:rgba(255,255,255,.12);
  box-shadow:0 14px 36px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.025);
  backdrop-filter:blur(12px);
}
html[data-theme="dark"] .hero-side .progress, html.theme-dark .hero-side .progress { background:rgba(242,243,238,.20) !important; }
html[data-theme="dark"] .hero-side .progress > span, html.theme-dark .hero-side .progress > span {
  background:linear-gradient(90deg,#F0C2A8,#E7A48C) !important;
  box-shadow:0 0 18px rgba(231,179,154,.16);
}

html[data-theme="dark"] .card, html.theme-dark .card {
  background:linear-gradient(145deg,rgba(19,42,39,.92),rgba(15,34,32,.94));
  border-color:rgba(255,255,255,.085);
  box-shadow:0 15px 38px rgba(0,0,0,.15), inset 0 1px 0 rgba(255,255,255,.018);
  backdrop-filter:blur(10px);
}
html[data-theme="dark"] .card.soft, html.theme-dark .card.soft {
  background:linear-gradient(145deg,#24443D,#1C3934);
}
html[data-theme="dark"] .card.blue, html.theme-dark .card.blue {
  background:linear-gradient(145deg,#243E4B,#1C343F);
}
html[data-theme="dark"] .card.lavender, html.theme-dark .card.lavender {
  background:linear-gradient(145deg,#3B3150,#302A41);
}
html[data-theme="dark"] .card.gold, html.theme-dark .card.gold {
  background:linear-gradient(145deg,#4A3A24,#3B3021);
}
html[data-theme="dark"] .card.soft::after, html.theme-dark .card.soft::after,
html[data-theme="dark"] .card.blue::after, html.theme-dark .card.blue::after,
html[data-theme="dark"] .card.lavender::after, html.theme-dark .card.lavender::after,
html[data-theme="dark"] .card.gold::after, html.theme-dark .card.gold::after {
  content:"";
  position:absolute;
  inset:auto -32px -42px auto;
  width:120px;
  height:120px;
  border-radius:50%;
  background:rgba(255,255,255,.025);
  pointer-events:none;
}

html[data-theme="dark"] .quick-action, html.theme-dark .quick-action {
  background:linear-gradient(160deg,rgba(24,54,49,.88),rgba(13,31,29,.94));
  border-color:rgba(255,255,255,.095);
  color:#EEF4F0;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.02);
}
html[data-theme="dark"] .quick-action:nth-child(1), html.theme-dark .quick-action:nth-child(1) { color:#BDE8C9; }
html[data-theme="dark"] .quick-action:nth-child(2), html.theme-dark .quick-action:nth-child(2) { color:#9EE4C4; }
html[data-theme="dark"] .quick-action:nth-child(3), html.theme-dark .quick-action:nth-child(3) { color:#D7F0E2; }
html[data-theme="dark"] .quick-action:nth-child(4), html.theme-dark .quick-action:nth-child(4) { color:#F0B592; }
html[data-theme="dark"] .quick-action:nth-child(5), html.theme-dark .quick-action:nth-child(5) { color:#A9DDBB; }
html[data-theme="dark"] .quick-action:nth-child(6), html.theme-dark .quick-action:nth-child(6) { color:#F0B99F; }
html[data-theme="dark"] .quick-action small, html.theme-dark .quick-action small { color:#B8C2BC; }
html[data-theme="dark"] .quick-action:hover, html.theme-dark .quick-action:hover {
  border-color:rgba(127,214,174,.24);
  box-shadow:0 14px 34px rgba(0,0,0,.20), 0 0 22px rgba(79,160,127,.055);
}

html[data-theme="dark"] .list-item, html.theme-dark .list-item,
html[data-theme="dark"] .report-box, html.theme-dark .report-box,
html[data-theme="dark"] .calendar-day, html.theme-dark .calendar-day {
  background:rgba(12,31,29,.72);
  border-color:rgba(255,255,255,.085);
}
html[data-theme="dark"] .list-item .item-icon, html.theme-dark .list-item .item-icon {
  background:rgba(79,160,127,.11);
  color:#A9E0C6;
}
html[data-theme="dark"] .stat-row, html.theme-dark .stat-row { border-bottom-color:rgba(255,255,255,.075); }
html[data-theme="dark"] .progress, html.theme-dark .progress { background:rgba(242,243,238,.13); }
html[data-theme="dark"] .progress > span, html.theme-dark .progress > span { background:linear-gradient(90deg,#4FA07F,#7FD6AE); }
html[data-theme="dark"] .badge.green, html.theme-dark .badge.green { background:rgba(79,160,127,.16); color:#AEE6CB; }
html[data-theme="dark"] .badge.orange, html.theme-dark .badge.orange { background:rgba(231,179,154,.14); color:#F2C7B2; }

html[data-theme="dark"] .field input, html.theme-dark .field input,
html[data-theme="dark"] .field select, html.theme-dark .field select,
html[data-theme="dark"] .field textarea, html.theme-dark .field textarea,
html[data-theme="dark"] input, html.theme-dark input,
html[data-theme="dark"] select, html.theme-dark select,
html[data-theme="dark"] textarea, html.theme-dark textarea {
  background:#0D211E;
  border-color:rgba(255,255,255,.10);
  color:#F2F3EE;
}
html[data-theme="dark"] input:focus, html.theme-dark input:focus,
html[data-theme="dark"] select:focus, html.theme-dark select:focus,
html[data-theme="dark"] textarea:focus, html.theme-dark textarea:focus {
  border-color:rgba(127,214,174,.45);
  box-shadow:0 0 0 3px rgba(79,160,127,.10);
}

html[data-theme="dark"] .modal, html.theme-dark .modal { background:rgba(2,10,9,.66); }
html[data-theme="dark"] .modal-card, html.theme-dark .modal-card {
  background:linear-gradient(145deg,#132A27,#0F211F);
  border-color:rgba(255,255,255,.10);
  box-shadow:0 30px 90px rgba(0,0,0,.48);
}
html[data-theme="dark"] .modal-close, html.theme-dark .modal-close { background:#0E211E; border-color:rgba(255,255,255,.09); }
html[data-theme="dark"] .theme-option, html.theme-dark .theme-option { background:#0E211E; border-color:rgba(255,255,255,.09); }
html[data-theme="dark"] .theme-option.active, html.theme-dark .theme-option.active {
  background:linear-gradient(145deg,#4FA07F,#3F836B);
  border-color:#4FA07F;
  color:#071511;
  box-shadow:0 9px 26px rgba(79,160,127,.18);
}
html[data-theme="dark"] .toast, html.theme-dark .toast { background:#285F4E; color:#F7FBF8; border:1px solid rgba(127,214,174,.12); }

/* =========================================================
   Premium experience modules · schema v8
   ========================================================= */
html[data-font-scale="small"] { font-size: 14px; }
html[data-font-scale="default"] { font-size: 16px; }
html[data-font-scale="large"] { font-size: 18px; }

body.reduced-motion *, body.reduced-motion *::before, body.reduced-motion *::after {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  scroll-behavior: auto !important;
  transition-duration: .001ms !important;
}
body.high-readability { line-height: 1.62; }
body.high-readability .card,
body.high-readability .list-item,
body.high-readability .field input,
body.high-readability .field select,
body.high-readability .field textarea { border-width: 2px; }
body.high-readability .help,
body.high-readability .item-meta,
body.high-readability .kpi .sub { opacity: 1; }

.card, .quick-action, .primary-btn, .secondary-btn, .small-btn, .nav-btn {
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease, opacity .18s ease;
}
.primary-btn:hover, .secondary-btn:hover, .small-btn:hover { transform: translateY(-1px); }
.card:hover { border-color: color-mix(in srgb, var(--brand) 20%, var(--line)); }

.hero-action { color: inherit; cursor:pointer; font:inherit; }
.hero-action:hover { background: rgba(255,255,255,.18); transform:translateY(-1px); }

.weekly-overview { overflow:hidden; position:relative; }
.weekly-overview::after { content:""; position:absolute; width:220px; height:220px; right:-75px; bottom:-110px; background:url('botanical.svg') center/contain no-repeat; opacity:.05; pointer-events:none; }
.premium-metric-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.premium-metric-grid > div { border:1px solid var(--line); border-radius:16px; padding:14px; background:var(--panel-3); display:flex; flex-direction:column; gap:3px; }
.premium-metric-grid strong { font-size:25px; line-height:1; }
.premium-metric-grid span { color:var(--muted); font-size:11px; }

.insight-strip { display:grid; grid-template-columns:1fr 1fr 1fr; gap:12px; }
.insight-strip > div { min-width:0; border:1px solid var(--line); border-radius:16px; padding:14px; background:var(--panel-3); display:flex; flex-direction:column; gap:6px; }
.insight-strip span, .insight-detail span { color:var(--muted); font-size:11px; }
.insight-strip strong, .insight-detail strong { font-size:14px; line-height:1.35; overflow-wrap:anywhere; }
.insight-detail { display:grid; grid-template-columns:minmax(130px,.7fr) minmax(0,1.3fr); gap:18px; align-items:start; padding:13px 0; border-bottom:1px solid var(--line); }
.insight-detail:last-of-type { border-bottom:0; }

.quick-care-card { position:relative; overflow:hidden; }
.quick-care-card::after { content:""; position:absolute; width:180px; height:180px; right:-55px; bottom:-65px; background:url('botanical.svg') center/contain no-repeat; opacity:.055; pointer-events:none; }
.quick-care-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; position:relative; z-index:1; }
.quick-care-grid > div { border:1px solid var(--line); border-radius:15px; padding:12px; background:var(--panel-3); display:flex; flex-direction:column; gap:6px; }
.quick-care-grid strong { font-size:11px; text-transform:uppercase; letter-spacing:.04em; }
.quick-care-grid span { color:var(--muted); font-size:11px; line-height:1.45; }
.profile-premium-actions { margin-top:14px; padding-top:12px; border-top:1px solid var(--line); display:flex; gap:8px; align-items:center; justify-content:space-between; flex-wrap:wrap; }

.achievement-grid { display:grid; gap:8px; }
.achievement-item { display:grid; grid-template-columns:36px minmax(0,1fr); gap:10px; align-items:center; padding:10px 12px; border:1px solid var(--line); border-radius:14px; background:var(--panel-3); }
.achievement-item > span { width:34px; height:34px; display:grid; place-items:center; border-radius:11px; background:var(--gold-soft); color:var(--text); }
.achievement-item div { display:flex; flex-direction:column; min-width:0; }
.achievement-item strong { font-size:12px; }
.achievement-item small { color:var(--muted); margin-top:2px; }

.pinned-item, .search-result, .calendar-event-card, .calendar-modal-item { width:100%; border:1px solid var(--line); background:var(--panel-3); color:var(--text); border-radius:15px; padding:12px; display:flex; align-items:center; gap:11px; text-align:left; }
.pinned-item:hover, .search-result:hover, .calendar-event-card:hover { border-color:var(--brand); transform:translateY(-1px); box-shadow:0 8px 22px rgba(42,65,58,.06); }
.pinned-item > span:nth-child(2) { min-width:0; flex:1; display:flex; flex-direction:column; }
.pinned-item small { color:var(--muted); margin-top:2px; }
.pin-btn.active { background:var(--gold-soft); color:var(--text); border-color:color-mix(in srgb,var(--accent) 32%,var(--line)); }
.table-actions { display:flex; gap:5px; align-items:center; flex-wrap:wrap; }

.check-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.check-card { display:flex; gap:10px; align-items:flex-start; border:1px solid var(--line); border-radius:15px; padding:12px; background:var(--panel-3); cursor:pointer; }
.check-card input { margin-top:3px; accent-color:var(--brand-deep); }
.check-card span { display:flex; flex-direction:column; gap:2px; }
.check-card strong { font-size:12px; }
.check-card small { color:var(--muted); font-size:10px; }

/* Visual routine board */
.routine-card { overflow:hidden; }
.routine-steps { display:flex; flex-direction:column; gap:7px; margin-top:12px; }
.routine-step { display:grid; grid-template-columns:auto 30px minmax(0,1fr) auto; align-items:center; gap:8px; padding:10px; border:1px solid var(--line); border-radius:13px; background:var(--panel); }
.routine-step.dragging { opacity:.45; border-style:dashed; }
.routine-step.status-done { background:color-mix(in srgb,var(--panel) 78%, var(--panel-2)); }
.routine-step.status-help { border-color:color-mix(in srgb,var(--accent) 40%, var(--line)); }
.routine-step.status-skipped { opacity:.62; }
.drag-handle { color:var(--muted); cursor:grab; user-select:none; letter-spacing:-3px; }
.step-number { width:29px; height:29px; display:grid; place-items:center; border-radius:10px; background:var(--panel-2); font-size:11px; font-weight:800; }
.step-copy { display:flex; flex-direction:column; min-width:0; }
.step-copy strong { font-size:12px; }
.step-copy small { color:var(--muted); font-size:10px; margin-top:2px; }
.step-status-btn { border:1px solid var(--line); background:var(--panel-3); color:var(--text); border-radius:10px; padding:7px 9px; font-size:10px; font-weight:800; white-space:nowrap; }
.step-status-btn.status-done { background:var(--panel-2); color:var(--brand-deep); }
.step-status-btn.status-help { background:var(--accent-soft); }
.step-status-btn.status-skipped { opacity:.7; }

/* Premium calendar */
.calendar-shell { overflow:hidden; }
.calendar-toolbar { display:flex; justify-content:space-between; gap:18px; align-items:flex-start; margin-bottom:18px; }
.calendar-toolbar h2 { margin:0; font-size:24px; }
.calendar-toolbar p { color:var(--muted); margin:4px 0 0; font-size:12px; }
.calendar-actions { display:flex; gap:7px; align-items:center; flex-wrap:wrap; justify-content:flex-end; }
.view-toggle { display:inline-flex; border:1px solid var(--line); border-radius:12px; padding:3px; background:var(--panel-3); }
.view-toggle button { border:0; border-radius:9px; padding:7px 10px; background:transparent; color:var(--muted); font-weight:750; }
.view-toggle button.active { background:var(--panel); color:var(--text); box-shadow:0 4px 12px rgba(42,65,58,.06); }
.calendar-weekdays { display:grid; grid-template-columns:repeat(7,1fr); gap:6px; margin-bottom:6px; }
.calendar-weekdays span { text-align:center; color:var(--muted); font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:.06em; }
.calendar-month-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:6px; }
.calendar-month-grid .calendar-day { min-height:130px; text-align:left; display:flex; flex-direction:column; gap:7px; color:var(--text); }
.calendar-date-number { font-weight:850; font-size:12px; }
.calendar-day-events { display:flex; flex-direction:column; gap:4px; min-width:0; }
.calendar-day-events small { color:var(--muted); font-size:9px; }
.calendar-chip { display:block; max-width:100%; padding:4px 6px; border-radius:7px; font-size:9px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; background:var(--panel-2); }
.calendar-chip.therapy { background:var(--lavender); }
.calendar-chip.appointment { background:var(--gold-soft); }
.calendar-chip.school-iep { background:var(--blue-soft); }
.calendar-chip.active-goal { background:var(--panel-2); }
.calendar-week-grid { display:grid; grid-template-columns:repeat(7,minmax(150px,1fr)); gap:8px; overflow-x:auto; padding-bottom:4px; }
.calendar-week-day { border:1px solid var(--line); border-radius:16px; background:var(--panel-3); min-height:300px; overflow:hidden; }
.calendar-week-day.today { border-color:var(--brand); }
.calendar-week-head { width:100%; border:0; border-bottom:1px solid var(--line); background:transparent; color:var(--text); padding:11px; display:flex; justify-content:space-between; align-items:center; }
.calendar-week-head span { width:29px; height:29px; border-radius:10px; display:grid; place-items:center; background:var(--panel-2); font-weight:800; }
.calendar-week-events { padding:8px; display:flex; flex-direction:column; gap:7px; }
.calendar-event-card { padding:9px; align-items:flex-start; }
.calendar-event-card > div { min-width:0; display:flex; flex-direction:column; }
.calendar-event-card strong { font-size:10px; }
.calendar-event-card small { color:var(--muted); font-size:9px; line-height:1.35; margin-top:2px; }
.calendar-legend { display:flex; flex-wrap:wrap; gap:14px; margin-top:13px; color:var(--muted); font-size:10px; }
.calendar-legend span { display:flex; align-items:center; gap:5px; }
.calendar-legend .dot { width:8px; height:8px; border-radius:50%; background:var(--panel-2); }
.calendar-legend .dot.appointment { background:var(--gold-soft); }
.calendar-legend .dot.therapy { background:var(--lavender); }
.calendar-legend .dot.school { background:var(--blue-soft); }
.calendar-legend .dot.goal { background:var(--brand-2); }
.calendar-legend .dot.daily { background:var(--accent); }
.calendar-modal-item { margin-bottom:7px; }

/* Insights */
.mini-bars { height:150px; display:grid; grid-template-columns:repeat(7,1fr); gap:8px; align-items:end; padding:12px 4px 2px; border-bottom:1px solid var(--line); }
.mini-bar-col { height:100%; display:flex; flex-direction:column; justify-content:flex-end; align-items:center; gap:5px; }
.mini-bar { width:min(28px,70%); border-radius:8px 8px 3px 3px; background:linear-gradient(180deg,var(--brand-2),var(--brand-deep)); min-height:8px; }
.mini-bar-col small { color:var(--muted); font-size:9px; }
.chart-label { margin:14px 0 0; font-size:11px; color:var(--muted); }
.goal-insight-list { display:flex; flex-direction:column; gap:9px; }
.goal-insight-row { display:grid; grid-template-columns:minmax(0,1fr) minmax(180px,.7fr); gap:18px; align-items:center; border:1px solid var(--line); border-radius:15px; padding:12px; background:var(--panel-3); }
.goal-insight-row > div:first-child { display:flex; flex-direction:column; gap:3px; }
.goal-insight-row small { color:var(--muted); }
.goal-insight-progress { display:grid; grid-template-columns:1fr auto; gap:10px; align-items:center; }

/* Search */
.search-controls { display:grid; grid-template-columns:minmax(0,2fr) minmax(200px,.7fr); gap:12px; }
.search-field input { font-size:15px; }
.search-count { color:var(--muted); font-size:11px; font-weight:750; margin-bottom:8px; }
.search-results { display:flex; flex-direction:column; gap:8px; }
.search-result { display:grid; grid-template-columns:38px minmax(0,1fr) auto; }
.search-result-copy { min-width:0; display:flex; flex-direction:column; gap:2px; }
.search-result-copy strong { font-size:13px; }
.search-result-copy small { color:var(--brand-deep); font-size:10px; }
.search-result-copy > span { color:var(--muted); font-size:11px; line-height:1.4; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* Reports and meeting prep */
.report-mode-tabs { display:inline-flex; padding:4px; border:1px solid var(--line); border-radius:14px; background:var(--panel-3); margin-bottom:14px; }
.report-mode-tabs button { border:0; background:transparent; color:var(--muted); padding:9px 13px; border-radius:10px; font-weight:800; }
.report-mode-tabs button.active { background:var(--brand-deep); color:#fff; }
.premium-report { padding:0; overflow:hidden; }
.report-cover { min-height:190px; padding:26px; display:flex; justify-content:space-between; align-items:center; gap:20px; background:linear-gradient(135deg,color-mix(in srgb,var(--panel-2) 86%,var(--brand) 14%),var(--panel)); border-bottom:1px solid var(--line); position:relative; overflow:hidden; }
.report-cover::after { content:""; position:absolute; width:240px; height:240px; right:85px; bottom:-130px; background:url('botanical.svg') center/contain no-repeat; opacity:.09; pointer-events:none; }
.report-cover h2 { font-size:34px; margin:4px 0; }
.report-cover p { margin:0; font-size:15px; }
.report-cover span { color:var(--muted); font-size:11px; }
.report-avatar { position:relative; z-index:1; }
.premium-report > .report-summary, .premium-report > .report-section, .premium-report > .grid, .premium-report > .report-highlight-grid, .premium-report > .meeting-focus-grid { margin-left:22px; margin-right:22px; }
.report-highlight-grid, .meeting-focus-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-top:16px; }
.report-highlight-grid > div, .meeting-focus-grid > div { border:1px solid var(--line); border-radius:14px; padding:12px; background:var(--panel-3); display:flex; flex-direction:column; gap:4px; }
.report-highlight-grid span, .meeting-focus-grid span { color:var(--muted); font-size:10px; }
.report-highlight-grid strong, .meeting-focus-grid strong { font-size:16px; overflow-wrap:anywhere; }
.report-section { margin-top:20px !important; }
.report-section h3 { margin:0 0 10px; }
.report-record { border:1px solid var(--line); border-radius:14px; padding:11px; background:var(--panel-3); margin-top:8px; }
.report-record p { color:var(--muted); font-size:10px; line-height:1.5; margin:5px 0 0; }
.report-goal { display:grid; grid-template-columns:1fr auto; gap:10px; border-bottom:1px solid var(--line); padding:10px 0; }
.report-goal:last-child { border-bottom:0; }
.report-goal div { display:flex; flex-direction:column; }
.report-goal small { color:var(--muted); margin-top:2px; }
.report-goal > span { font-weight:850; }
.report-disclaimer { margin:22px; padding:14px; border-radius:14px; background:var(--panel-3); color:var(--muted); font-size:10px; line-height:1.5; }
.meeting-notes { margin-top:14px; }
.meeting-question-list { margin:0; padding-left:22px; }
.meeting-question-list li { padding:5px 0; line-height:1.45; }
.meeting-notes-output { color:var(--text); line-height:1.7; }

/* Accessibility + onboarding */
.setting-switch { display:flex; gap:10px; align-items:flex-start; padding:12px 0; border-bottom:1px solid var(--line); cursor:pointer; }
.setting-switch:last-child { border-bottom:0; }
.setting-switch input { margin-top:3px; accent-color:var(--brand-deep); }
.setting-switch span { display:flex; flex-direction:column; gap:2px; }
.setting-switch strong { font-size:12px; }
.setting-switch small { color:var(--muted); font-size:10px; }
.onboarding { text-align:center; padding:12px 6px 2px; }
.onboarding-step { color:var(--muted); font-size:10px; font-weight:850; letter-spacing:.08em; text-transform:uppercase; }
.onboarding-icon { width:74px; height:74px; margin:18px auto 14px; display:grid; place-items:center; border-radius:24px; background:linear-gradient(145deg,var(--panel-2),var(--blue-soft)); color:var(--brand-deep); font-size:31px; box-shadow:var(--shadow); }
.onboarding h2 { margin:0; }
.onboarding p { color:var(--muted); max-width:500px; margin:10px auto 18px; line-height:1.65; }
.onboarding-dots { display:flex; justify-content:center; gap:6px; margin-bottom:16px; }
.onboarding-dots span { width:7px; height:7px; border-radius:50%; background:var(--line); }
.onboarding-dots span.active { width:22px; border-radius:999px; background:var(--brand-deep); }
.premium-empty { min-height:130px; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; gap:6px; border:1px dashed color-mix(in srgb,var(--line) 78%,var(--brand) 22%); border-radius:16px; padding:20px; background:color-mix(in srgb,var(--panel-3) 90%,transparent); }
.empty-icon { width:38px; height:38px; display:grid; place-items:center; border-radius:13px; background:var(--panel-2); color:var(--brand-deep); margin-bottom:2px; }
.premium-empty strong { font-size:13px; }
.premium-empty > span:last-child { color:var(--muted); font-size:11px; max-width:380px; line-height:1.5; }

html[data-theme="dark"] .weekly-overview::after,
html.theme-dark .weekly-overview::after,
html[data-theme="dark"] .quick-care-card::after,
html.theme-dark .quick-care-card::after,
html[data-theme="dark"] .report-cover::after,
html.theme-dark .report-cover::after { opacity:.035; filter:brightness(1.6) saturate(.65); }
html[data-theme="dark"] .report-cover, html.theme-dark .report-cover { background:linear-gradient(135deg,rgba(36,68,61,.72),rgba(13,33,30,.92)); }
html[data-theme="dark"] .pinned-item, html.theme-dark .pinned-item,
html[data-theme="dark"] .search-result, html.theme-dark .search-result,
html[data-theme="dark"] .calendar-event-card, html.theme-dark .calendar-event-card,
html[data-theme="dark"] .routine-step, html.theme-dark .routine-step { background:rgba(12,31,29,.72); border-color:rgba(255,255,255,.085); }

@media (max-width: 1100px) {
  .premium-metric-grid, .report-highlight-grid, .meeting-focus-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .insight-strip { grid-template-columns:1fr; }
  .calendar-toolbar { flex-direction:column; }
  .calendar-actions { justify-content:flex-start; }
  .calendar-month-grid .calendar-day { min-height:110px; }
}

@media (max-width: 700px) {
  .premium-metric-grid, .quick-care-grid, .check-grid, .report-highlight-grid, .meeting-focus-grid { grid-template-columns:1fr; }
  .search-controls { grid-template-columns:1fr; }
  .calendar-weekdays { display:none; }
  .calendar-month-grid { grid-template-columns:1fr; }
  .calendar-month-grid .calendar-day { min-height:auto; flex-direction:row; align-items:flex-start; }
  .calendar-day.outside { display:none; }
  .calendar-date-number { width:32px; height:32px; flex:0 0 auto; border-radius:10px; display:grid; place-items:center; background:var(--panel-2); }
  .calendar-day-events { flex:1; }
  .routine-step { grid-template-columns:auto 30px minmax(0,1fr); }
  .step-status-btn { grid-column:3; justify-self:start; }
  .goal-insight-row { grid-template-columns:1fr; }
  .report-cover { align-items:flex-start; }
  .report-cover h2 { font-size:28px; }
  .report-avatar { width:64px !important; height:64px !important; }
}

@media print {
  .report-mode-tabs, .meeting-notes, #saveMeetingNotes { display:none !important; }
  #reportOutput { margin-top:0 !important; }
  .premium-report { border:0 !important; padding:0 !important; }
  .premium-report .card, .premium-report section { break-inside:avoid; }
  .report-cover { background:#f2f4ef !important; color:#1f2c28 !important; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
  .report-summary, .report-highlight-grid, .meeting-focus-grid { break-inside:avoid; }
}
.routine-card .card-header h3 { display:flex; align-items:center; gap:8px; }
.routine-icon { width:34px; height:34px; display:inline-grid; place-items:center; border-radius:11px; background:var(--panel-2); color:var(--brand-deep); font-size:17px; flex:0 0 auto; }

@media (max-width: 640px) {
  .topbar { gap:8px; padding:12px; }
  .topbar-left { flex:1 1 auto; min-width:0; align-items:center; }
  .topbar-left > div:last-child { min-width:0; flex:1; }
  #pageTitle { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%; font-size:22px; }
  .top-actions { flex:0 0 auto; flex-wrap:nowrap; }
}
@media (max-width: 480px) {
  #quickLogBtn { width:42px; height:42px; padding:0; font-size:0; display:grid; place-items:center; }
  #quickLogBtn::after { content:'+'; font-size:22px; line-height:1; }
  .top-actions .soft-btn { width:42px; height:42px; padding:0; display:grid; place-items:center; }
}
@media (max-width: 480px) {
  .demo-pill { display:none !important; }
}

/* UI-style report upgrade */
.ui-report .report-ui-body { padding:22px; }
.ui-report .report-cover-badges { display:flex; gap:8px; flex-wrap:wrap; margin-top:12px; }
.ui-report .report-chip { display:inline-flex; align-items:center; padding:6px 10px; border-radius:999px; font-size:10px; font-weight:800; letter-spacing:.02em; border:1px solid var(--line); background:color-mix(in srgb,var(--panel) 88%, transparent); color:var(--brand-deep); }
.ui-report .report-kpi-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin-top:2px; }
.ui-report .compact-kpis { grid-template-columns:repeat(4,minmax(0,1fr)); }
.ui-report .report-kpi { border:1px solid var(--line); border-radius:18px; padding:14px; background:var(--panel); display:flex; gap:12px; align-items:flex-start; min-height:104px; box-shadow:0 8px 22px rgba(16,26,20,.04); }
.ui-report .report-kpi-icon { width:38px; height:38px; border-radius:14px; display:grid; place-items:center; font-size:18px; font-weight:900; flex:0 0 auto; background:rgba(255,255,255,.4); color:var(--brand-deep); }
.ui-report .report-kpi-copy { display:flex; flex-direction:column; gap:3px; }
.ui-report .report-kpi strong { font-size:26px; line-height:1; }
.ui-report .report-kpi span { font-size:12px; font-weight:800; }
.ui-report .report-kpi small { font-size:10px; color:var(--muted); line-height:1.4; }
.ui-report .report-kpi.sage { background:color-mix(in srgb,var(--brand) 14%, var(--panel)); }
.ui-report .report-kpi.sky { background:color-mix(in srgb,var(--blue-soft) 34%, var(--panel)); }
.ui-report .report-kpi.peach { background:color-mix(in srgb,var(--accent-soft) 60%, var(--panel)); }
.ui-report .report-kpi.lavender { background:color-mix(in srgb,var(--lavender) 40%, var(--panel)); }
.ui-report .report-kpi.mint { background:color-mix(in srgb,var(--brand-2) 18%, var(--panel)); }
.ui-report .report-kpi.sand { background:color-mix(in srgb,var(--gold-soft) 48%, var(--panel)); }
.ui-report .report-insight-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin-top:14px; }
.ui-report .report-insight-card { border:1px solid var(--line); border-radius:18px; background:var(--panel); padding:16px; min-height:124px; display:flex; flex-direction:column; justify-content:flex-start; }
.ui-report .report-insight-card.wide { background:linear-gradient(135deg,color-mix(in srgb,var(--panel-2) 82%,var(--brand) 18%),var(--panel)); }
.ui-report .report-insight-card h4 { margin:4px 0 8px; font-size:18px; }
.ui-report .report-insight-card p { margin:0; color:var(--muted); line-height:1.6; }
.ui-report .report-ui-grid { margin-top:16px !important; align-items:start; }
.ui-report .report-panel { border:1px solid var(--line); border-radius:20px; background:var(--panel); padding:18px; box-shadow:0 8px 22px rgba(16,26,20,.04); min-height:100%; }
.ui-report .report-panel.span-2 { grid-column:1/-1; }
.ui-report .report-panel-head { margin-bottom:14px; }
.ui-report .report-panel-head h3 { margin:0 0 4px; font-size:24px; }
.ui-report .report-panel-head p { margin:0; color:var(--muted); font-size:11px; line-height:1.5; }
.ui-report .report-goal-card { border:1px solid var(--line); border-radius:16px; background:var(--panel-3); padding:14px; margin-top:10px; }
.ui-report .report-goal-top { display:grid; grid-template-columns:1fr auto; gap:10px; align-items:start; }
.ui-report .report-goal-top small { color:var(--muted); display:block; margin-top:3px; }
.ui-report .report-goal-top > span { font-weight:900; font-size:17px; }
.ui-report .progress.compact { margin-top:10px; height:9px; }
.ui-report .report-goal-card p { margin:10px 0 0; color:var(--muted); font-size:11px; line-height:1.5; }
.ui-report .report-timeline { display:flex; flex-direction:column; gap:12px; }
.ui-report .report-timeline-item { display:grid; grid-template-columns:18px 1fr; gap:12px; align-items:flex-start; }
.ui-report .report-timeline-dot { width:12px; height:12px; border-radius:50%; background:var(--brand); margin-top:4px; box-shadow:0 0 0 5px color-mix(in srgb,var(--brand) 18%,transparent); }
.ui-report .report-timeline-item strong { display:block; font-size:12px; margin-bottom:3px; }
.ui-report .report-timeline-item span { color:var(--muted); line-height:1.55; display:block; }
.ui-report .report-list-card { border:1px solid var(--line); border-radius:16px; background:var(--panel-3); padding:14px; margin-top:10px; }
.ui-report .report-list-card.compact { padding:13px; }
.ui-report .report-list-header { display:flex; justify-content:space-between; gap:10px; align-items:flex-start; margin-bottom:5px; }
.ui-report .report-list-header strong { font-size:13px; }
.ui-report .report-list-header span { color:var(--muted); font-size:10px; text-align:right; }
.ui-report .report-list-card p { margin:5px 0 0; font-size:11px; line-height:1.55; color:var(--text); }
.ui-report .report-list-card small { display:block; margin-top:5px; color:var(--muted); font-size:10px; line-height:1.45; }
.ui-report .report-subgroup + .report-subgroup { margin-top:16px; }
.ui-report .report-subgroup h4 { margin:0 0 8px; font-size:15px; }
.ui-report .report-checklist { display:grid; gap:10px; }
.ui-report .report-checklist > div { display:flex; justify-content:space-between; gap:16px; padding:11px 0; border-bottom:1px solid var(--line); }
.ui-report .report-checklist > div:last-child { border-bottom:0; }
.ui-report .report-checklist span { color:var(--muted); text-align:right; }
.ui-report .report-disclaimer { margin:18px 0 0; }

html[data-theme="dark"] .ui-report .report-chip,
html.theme-dark .ui-report .report-chip { background:rgba(255,255,255,.04); color:var(--text); }
html[data-theme="dark"] .ui-report .report-kpi,
html.theme-dark .ui-report .report-kpi,
html[data-theme="dark"] .ui-report .report-insight-card,
html.theme-dark .ui-report .report-insight-card,
html[data-theme="dark"] .ui-report .report-panel,
html.theme-dark .ui-report .report-panel,
html[data-theme="dark"] .ui-report .report-goal-card,
html.theme-dark .ui-report .report-goal-card,
html[data-theme="dark"] .ui-report .report-list-card,
html.theme-dark .ui-report .report-list-card { box-shadow:0 10px 24px rgba(0,0,0,.16); }
html[data-theme="dark"] .ui-report .report-insight-card.wide,
html.theme-dark .ui-report .report-insight-card.wide { background:linear-gradient(135deg,rgba(36,68,61,.68),rgba(14,28,26,.96)); }

@media (max-width: 1100px) {
  .ui-report .report-kpi-grid, .ui-report .compact-kpis, .ui-report .report-insight-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 700px) {
  .ui-report .report-ui-body { padding:16px; }
  .ui-report .report-kpi-grid, .ui-report .compact-kpis, .ui-report .report-insight-grid { grid-template-columns:1fr; }
  .ui-report .report-kpi { min-height:auto; }
  .ui-report .report-list-header, .ui-report .report-checklist > div { flex-direction:column; align-items:flex-start; }
  .ui-report .report-checklist span { text-align:left; }
}

@media print {
  .ui-report .report-ui-body { padding:16px !important; }
  .ui-report .report-kpi, .ui-report .report-insight-card, .ui-report .report-panel, .ui-report .report-goal-card, .ui-report .report-list-card { background:#fff !important; box-shadow:none !important; break-inside:avoid; }
  .ui-report .report-kpi.sage { background:#f1f5ef !important; }
  .ui-report .report-kpi.sky { background:#eef4f8 !important; }
  .ui-report .report-kpi.peach { background:#faf1eb !important; }
  .ui-report .report-kpi.lavender { background:#f1ecf8 !important; }
  .ui-report .report-kpi.mint { background:#edf5f0 !important; }
  .ui-report .report-kpi.sand { background:#f7f1e4 !important; }
}

/* Child profile actions */
.child-card-actions { display:flex; align-items:center; gap:7px; align-self:start; position:relative; z-index:3; }
.child-card-actions .small-btn { white-space:nowrap; }
@media (max-width: 640px) {
  .child-card-actions { grid-column:2; justify-self:start; flex-wrap:wrap; }
  .child-edit-btn { grid-column:auto; justify-self:auto; }
}

/* Embedded user manual card */
.manual-card { position:relative; overflow:hidden; }
.manual-card::after { content:"?"; position:absolute; right:24px; top:18px; width:46px; height:46px; border-radius:16px; display:grid; place-items:center; font-family:Georgia,serif; font-size:24px; font-weight:800; color:var(--brand-deep); background:var(--panel-2); opacity:.8; pointer-events:none; }
.manual-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:14px; }
.manual-link { display:inline-flex; align-items:center; justify-content:center; text-decoration:none; width:auto; }
@media (max-width:700px){ .manual-actions { flex-direction:column; } .manual-link { width:100%; } .manual-card::after { display:none; } }
