:root {
  --ink: #14213a;
  --muted: #718097;
  --line: #e8edf4;
  --canvas: #f6f8fb;
  --white: #fff;
  --primary: #5b4ff1;
  --primary-dark: #493bd8;
  --primary-soft: #efedff;
  --pink: #ef6b8a;
  --pink-soft: #fde9ee;
  --blue: #4c91f7;
  --blue-soft: #eaf3ff;
  --mint: #54b98a;
  --mint-soft: #e7f6ef;
  --yellow: #f4b740;
  --yellow-soft: #fff4d7;
  --shadow: 0 16px 44px rgba(35, 52, 84, .08);
  --shadow-soft: 0 5px 18px rgba(35, 52, 84, .055);
  --radius: 20px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: ui-rounded, "Arial Rounded MT Bold", var(--font);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; color: var(--ink); font-family: var(--font); font-size: 15px; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3, .brand { font-family: var(--display); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(91, 79, 241, .25); outline-offset: 2px; }

.app-body { min-height: 100vh; background: var(--canvas); }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 224px minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: 224px; display: flex; flex-direction: column; background: rgba(255,255,255,.98); border-right: 1px solid var(--line); padding: 32px 16px 16px; }
.sidebar-close { display: none; }
.mobile-nav-backdrop { display: none; }
.brand { display: inline-flex; align-items: center; gap: 10px; padding: 3px 8px; font-size: 20px; font-weight: 800; letter-spacing: -.7px; }
.brand > span:last-child > span { color: var(--primary); }
.brand-sun { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 10px; color: #f3a71a; background: linear-gradient(145deg, #fff6c4 38%, #ded9ff 40%); font-size: 18px; }
.main-nav { display: grid; gap: 7px; margin-top: 42px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 45px; padding: 0 13px; border: 0; border-radius: 13px; background: transparent; color: #607088; font-weight: 600; cursor: pointer; text-align: left; }
.nav-item > span { width: 20px; color: #75869e; font-size: 18px; text-align: center; }
.nav-item:hover { background: #f7f8fd; color: var(--ink); }
.nav-item.active { color: var(--primary); background: linear-gradient(100deg, #f0eeff, #f8f8ff); }
.nav-item.active > span { color: var(--primary); }
.sidebar-bottom { display: grid; gap: 6px; margin-top: auto; }
.together-card { margin-top: 7px; padding: 15px 11px; border-radius: 15px; background: linear-gradient(155deg, #f6f3ff, #fff); text-align: center; border: 1px solid #eeebff; }
.together-card strong { display: block; font-size: 12px; line-height: 1.45; }
.together-card > span { display: block; margin-top: 9px; color: var(--primary); font-size: 11px; font-weight: 700; }
.together-card > button { width: 100%; min-height: 34px; margin-top: 9px; padding: 0 8px; border: 0; border-radius: 10px; color: var(--primary); background: var(--primary-soft); cursor: pointer; font-size: 11px; font-weight: 800; }
.together-card > button:hover { background: #e4e0ff; }
.together-faces { margin-bottom: 8px; font-size: 18px; letter-spacing: -7px; transform: translateX(-3px); }
.main-content { grid-column: 2; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 25; height: 92px; display: grid; grid-template-columns: minmax(220px,1fr) auto minmax(360px,1fr); align-items: center; gap: 22px; padding: 0 clamp(22px, 2.5vw, 42px); background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(16px); }
.greeting { display: flex; align-items: center; gap: 12px; }
.greeting > span { font-size: 24px; }
.greeting strong { display: block; font-family: var(--display); font-size: 17px; }
.greeting small { display: block; margin-top: 3px; color: var(--muted); }
.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 11px; }
.top-date-navigation h1 { font-size: 19px; }
.global-search { position: relative; width: min(184px, 14vw); }
.global-search > span { position: absolute; left: 13px; top: 50%; z-index: 1; transform: translateY(-50%); color: var(--muted); }
.global-search input { min-height: 43px; padding-left: 35px; border-radius: 13px; background: #fbfcfe; }
.family-avatars { display: flex; align-items: center; padding: 4px; border: 1px solid var(--line); border-radius: 22px; background: white; }
.mini-avatar { display: grid; place-items: center; width: 29px; height: 29px; margin-left: -3px; overflow: hidden; border: 3px solid white; border-radius: 50%; color: white; background: var(--member); cursor: pointer; font-size: 10px; font-weight: 800; }
.mini-avatar:first-child { margin-left: 0; }
.weather-pill { display: flex; align-items: center; gap: 7px; height: 43px; padding: 0 12px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.weather-pill small { color: var(--muted); }
.icon-btn, .avatar-button { position: relative; display: grid; place-items: center; width: 43px; height: 43px; border: 1px solid var(--line); border-radius: 13px; background: #fff; cursor: pointer; }
.avatar-button { overflow: hidden; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); background: var(--avatar); color: white; font-weight: 800; }
.primary-btn, .soft-btn, .today-btn, .text-btn { border: 0; cursor: pointer; font-weight: 700; }
.primary-btn { min-height: 43px; padding: 0 18px; border-radius: 12px; color: white; background: linear-gradient(135deg, #6558f6, #4c3fe5); box-shadow: 0 7px 17px rgba(80, 65, 229, .18); white-space: nowrap; }
.primary-btn:hover { background: var(--primary-dark); transform: translateY(-1px); }
.primary-btn.wide { width: 100%; }
.soft-btn { min-height: 39px; padding: 0 14px; border-radius: 11px; color: var(--primary); background: var(--primary-soft); }
.text-btn { padding: 5px; color: var(--primary); background: transparent; }
.view { display: none; padding: 20px clamp(22px, 2.5vw, 42px) 48px; animation: viewIn .24s ease both; }
.view.active { display: block; }
@keyframes viewIn { from { opacity: 0; transform: translateY(4px); } }

.calendar-toolbar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; min-height: 58px; }
.calendar-toolbar .member-filter-nav { min-width: 0; justify-self: end; }
.calendar-toolbar .member-filters { justify-content: flex-end; margin: 0; }
.segmented { width: max-content; display: flex; gap: 2px; padding: 5px; border-radius: 13px; background: #eef2f7; }
.segmented button { min-width: 72px; height: 37px; padding: 0 14px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; cursor: pointer; font-weight: 600; }
.segmented button.active { color: var(--primary); background: white; box-shadow: var(--shadow-soft); }
.date-navigation { display: flex; align-items: center; justify-content: center; gap: 14px; }
.date-navigation h1 { min-width: 156px; margin: 0; font-size: 22px; text-align: center; }
.date-navigation button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 23px; cursor: pointer; }
.today-btn { justify-self: end; min-height: 38px; padding: 0 14px; border-radius: 10px; color: var(--primary); background: var(--primary-soft); }
.member-filter-nav { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; max-width: 100%; }
.member-filters { display: flex; gap: 8px; min-width: 0; margin: 13px 0; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: none; scroll-behavior: smooth; }
.member-filters::-webkit-scrollbar { display: none; }
.filter-scroll-button { display: none; }
.filter-chip { flex: 0 0 auto; display: flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 13px; border: 1px solid var(--line); border-radius: 11px; background: white; color: #536178; cursor: pointer; font-weight: 600; }
.filter-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--primary)); }
.filter-chip.active { color: var(--primary); border-color: #dcd7ff; background: var(--primary-soft); }
.week-summary { display: grid; grid-template-columns: 1.2fr repeat(3, 1fr); min-height: 78px; margin-bottom: 15px; padding: 13px 19px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow-soft); }
.summary-item { display: flex; align-items: center; gap: 12px; padding: 0 20px; border-left: 1px solid var(--line); }
.summary-item:first-child { border-left: 0; padding-left: 0; }
.summary-item strong { display: block; font-size: 21px; }
.summary-item span, .summary-item small { color: var(--muted); }
.summary-item:first-child strong { color: var(--primary); font-size: 14px; }
.summary-bar { width: min(130px, 100%); height: 5px; margin-top: 7px; overflow: hidden; border-radius: 4px; background: #eef1f6; }
.summary-bar i { display: block; width: var(--progress); height: 100%; border-radius: inherit; background: var(--bar, var(--primary)); }
.progress-ring { display: grid; place-items: center; width: 47px; height: 47px; border-radius: 50%; background: conic-gradient(var(--primary) 0 67%, #edf0f5 67%); }
.progress-ring::after { content: ''; width: 35px; height: 35px; border-radius: 50%; background: #fff; }
.calendar-layout { display: grid; grid-template-columns: minmax(650px, 1fr) 304px; gap: 18px; }
.calendar-card, .today-rail, .panel { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-soft); }
.calendar-card { min-width: 0; overflow: hidden; }
.weekday-row { display: grid; grid-template-columns: repeat(7, 1fr); height: 43px; border-bottom: 1px solid var(--line); color: #64738a; font-size: 11px; font-weight: 700; }
.weekday-row span { display: grid; place-items: center; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: repeat(5, minmax(112px, 1fr)); min-height: 610px; }
.calendar-grid.week-grid { grid-template-rows: minmax(500px,1fr); }
.calendar-grid.agenda-grid { display: grid; grid-template-columns: 1fr; align-content: start; gap: 8px; min-height: 610px; padding: 16px; }
.calendar-grid.year-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: none; gap: 12px; min-height: 610px; padding: 16px; background: var(--canvas); }
.year-month { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.year-month h2 { margin: 0 0 12px; font-size: 14px; }
.year-weekdays, .year-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.year-weekdays { margin-bottom: 5px; color: var(--muted); font-size: 8px; font-weight: 800; text-align: center; }
.year-day { position: relative; display: grid; place-items: center; min-width: 0; aspect-ratio: 1; border: 0; border-radius: 7px; color: var(--ink); background: transparent; cursor: pointer; font-size: 9px; }
.year-day:hover { background: var(--primary-soft); }
.year-day.empty { cursor: default; }
.year-day.has-events::after { content: ''; position: absolute; bottom: 2px; width: 3px; height: 3px; border-radius: 50%; background: var(--primary); }
.year-day.today { color: #fff; background: var(--primary); font-weight: 800; }
.year-day.today::after { background: #fff; }
.year-day.selected:not(.today) { outline: 1px solid var(--primary); color: var(--primary); font-weight: 800; }
.agenda-row { display: grid; grid-template-columns: 62px 1fr auto auto; align-items: center; gap: 14px; width: 100%; padding: 13px 16px; border: 1px solid var(--line); border-left: 5px solid var(--event-color); border-radius: 13px; background: var(--event-bg); cursor: pointer; text-align: left; }
.agenda-row .agenda-day { display: grid; color: var(--muted); font-size: 10px; text-align: center; text-transform: uppercase; }
.agenda-row .agenda-day b { color: var(--ink); font-size: 21px; }
.agenda-row strong, .agenda-row small { display: block; }
.agenda-row small { margin-top: 4px; color: var(--muted); }
.agenda-row > i { color: var(--muted); font-size: 22px; font-style: normal; }
.empty-state { padding: 60px 20px; color: var(--muted); text-align: center; }
.day-cell { position: relative; min-width: 0; padding: 10px 8px 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; cursor: pointer; }
.day-cell:nth-child(7n) { border-right: 0; }
.day-cell:nth-last-child(-n+7) { border-bottom: 0; }
.day-cell.outside { background: #fbfcfd; color: #bdc5d1; }
.day-cell.today { z-index: 2; outline: 1.5px solid var(--primary); outline-offset: -1.5px; background: #fbfaff; }
.day-cell.selected:not(.today) { z-index: 1; box-shadow: inset 0 0 0 1.5px #d9d5ff; background: #fdfcff; }
.date-button { display: block; width: 100%; padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; }
.date-number { display: grid; place-items: center; width: 23px; height: 23px; margin-bottom: 6px; border-radius: 50%; font-size: 12px; font-weight: 700; }
.mobile-event-count { display: none; }
.today .date-number { background: var(--primary); color: white; }
.events-stack { display: grid; gap: 4px; }
.event-pill { width: 100%; min-width: 0; padding: 6px 7px; border: 0; border-radius: 8px; background: var(--event-bg); cursor: pointer; text-align: left; }
.event-media-thumb { position: relative; display: grid; place-items: center; float: right; width: 35px; height: 33px; margin-left: 5px; overflow: hidden; border-radius: 6px; color: white; background: #20293a; }
.event-media-thumb img, .event-media-thumb video { width: 100%; height: 100%; object-fit: cover; }
.event-media-thumb > i { position: absolute; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: rgba(20,33,58,.72); font-size: 8px; font-style: normal; }
.event-media-thumb > b { position: absolute; right: 2px; bottom: 2px; padding: 1px 4px; border-radius: 5px; background: rgba(20,33,58,.78); font-size: 8px; }
.event-pill strong { display: block; overflow: hidden; color: #263248; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.event-pill strong::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: var(--event-color); vertical-align: 1px; }
.event-pill small { display: block; margin: 2px 0 0 11px; color: #607087; font-size: 9px; }
.more-events { color: var(--primary); font-size: 10px; font-weight: 700; }
.today-rail { min-width: 0; padding: 22px 17px; }
.mobile-day-agenda { display: none; }
.today-rail-head { display: flex; align-items: center; justify-content: space-between; }
.today-rail h2 { margin: 0; font-size: 18px; }
.today-date-block { display: flex; align-items: center; justify-content: space-between; margin: 32px 0 23px; }
.today-date-block strong { display: block; font-family: var(--display); font-size: 21px; }
.today-date-block span { color: var(--muted); font-size: 12px; }
.mini-ring { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: conic-gradient(var(--primary) 0 67%, #edf0f5 67%); font-size: 11px; font-weight: 800; }
.mini-ring::before { content: ''; position: absolute; width: 44px; height: 44px; border-radius: 50%; background: white; }
.mini-ring b { z-index: 1; }
.rail-label { margin-bottom: 9px; color: var(--muted); font-size: 11px; }
.agenda-list { display: grid; gap: 9px; }
.agenda-item { display: flex; gap: 11px; width: 100%; padding: 11px; border: 1px solid var(--line); border-radius: 13px; background: #fff; cursor: pointer; text-align: left; }
.agenda-item > span:nth-child(2) { min-width: 0; flex: 1; }
.agenda-media-thumb { float: none; flex: 0 0 48px; width: 48px; height: 42px; margin-left: auto; border-radius: 9px; }
.agenda-icon { display: grid; place-items: center; flex: 0 0 34px; height: 34px; border-radius: 10px; background: var(--event-bg); }
.agenda-item strong, .agenda-item small { display: block; }
.agenda-item strong { margin-bottom: 3px; font-size: 12px; }
.agenda-item small { color: var(--muted); font-size: 10px; }
.agenda-item i { display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; background: var(--event-color); }
.meal-card { margin-top: 22px; padding: 14px; border-radius: 15px; background: linear-gradient(135deg, #fff5db, #fffaf0); }
.meal-card span { color: #9c752b; font-size: 11px; }
.meal-card strong { display: block; margin: 7px 0 3px; }
.meal-card small { color: var(--muted); }

.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 11px 0 25px; }
.page-heading h1 { margin: 6px 0 8px; font-size: 32px; letter-spacing: -1.3px; }
.page-heading p { margin: 0; color: var(--muted); }
.eyebrow { color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.myday-hero { min-height: 150px; display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 17px; padding: 26px 30px; overflow: hidden; border-radius: 22px; color: white; background: linear-gradient(120deg, #5749e8, #7267f3 60%, #9991ff); box-shadow: 0 15px 32px rgba(81, 67, 220, .22); }
.myday-hero h2 { margin-bottom: 7px; font-size: 26px; }
.myday-hero p { max-width: 600px; margin: 0; color: rgba(255,255,255,.78); }
.hero-progress { display: grid; place-items: center; flex: 0 0 94px; height: 94px; border-radius: 50%; background: conic-gradient(#fff var(--done), rgba(255,255,255,.2) 0); }
.hero-progress::before { content: ''; position: absolute; width: 73px; height: 73px; border-radius: 50%; background: #7064ef; }
.hero-progress b { z-index: 1; font-size: 20px; }
.task-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.task-column { padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: white; }
.task-column h2 { display: flex; align-items: center; justify-content: space-between; margin: 0 0 14px; font-size: 15px; text-transform: capitalize; }
.task-column h2 span { color: var(--muted); font-family: var(--font); font-size: 11px; font-weight: 500; }
.task-list { display: grid; gap: 9px; }
.task-item { display: flex; align-items: center; width: 100%; min-height: 55px; border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.task-toggle { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; min-height: 55px; padding: 9px 10px; border: 0; background: transparent; cursor: pointer; text-align: left; }
.task-edit { align-self: stretch; flex: 0 0 38px; border: 0; border-left: 1px solid var(--line); color: var(--primary); background: #faf9ff; cursor: pointer; font-size: 16px; }
.task-edit:hover { background: var(--primary-soft); }
.task-check { display: grid; place-items: center; flex: 0 0 25px; height: 25px; border: 1.5px solid #ccd4e0; border-radius: 8px; color: white; }
.task-item.done .task-check { border-color: var(--mint); background: var(--mint); }
.task-item.done strong { color: #8e99aa; text-decoration: line-through; }
.task-copy { min-width: 0; flex: 1; }
.task-copy strong, .task-copy small { display: block; }
.task-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.task-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; text-transform: capitalize; }
.star-value { flex: 0 0 auto; padding: 4px 7px; border-radius: 8px; color: #a87818; background: var(--yellow-soft); font-size: 10px; font-weight: 800; }
.pulse-card { margin-top: 16px; padding: 21px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(120deg, #fff, #f8f6ff); }
.pulse-card h2 { margin-bottom: 6px; font-size: 17px; }
.pulse-card p { color: var(--muted); }
.mood-row { display: flex; gap: 8px; flex-wrap: wrap; }
.mood-button { min-width: 86px; height: 42px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.mood-button:hover, .mood-button.active { border-color: #cfc9ff; background: var(--primary-soft); }
.reward-summary { display: flex; align-items: center; gap: 20px; margin-bottom: 18px; padding: 24px; border-radius: 20px; background: linear-gradient(120deg, #fff5d7, #fffaf0); border: 1px solid #f9e5ad; }
.reward-summary .big-star { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 20px; background: white; font-size: 30px; box-shadow: var(--shadow-soft); }
.reward-summary h2 { margin: 0; font-size: 28px; }
.reward-summary p { margin: 3px 0 0; color: #917338; }
.reward-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.reward-card { padding: 23px; border: 1px solid var(--line); border-radius: 19px; background: white; box-shadow: var(--shadow-soft); }
.reward-card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.reward-card-head > span { font-size: 31px; }
.reward-edit { min-height: 31px; padding: 0 10px; border: 1px solid #e2deff; border-radius: 9px; color: var(--primary); background: #f7f6ff; cursor: pointer; font-size: 11px; font-weight: 700; }
.reward-edit:hover, .reward-edit:focus-visible { border-color: #cfc9ff; background: var(--primary-soft); }
.reward-card h2 { margin: 18px 0 6px; font-size: 16px; }
.reward-card p { color: var(--muted); }
.reward-card button { width: 100%; }
.reward-card .reward-edit { width: auto; }
.meal-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin-bottom: 16px; }
.meal-day { position: relative; min-height: 170px; padding: 15px 13px 50px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.meal-day.today { border-color: #cbc4ff; background: #fbfaff; }
.meal-day .day-name { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.meal-day .day-date { float: right; font-weight: 800; }
.meal-emoji { display: grid; place-items: center; width: 43px; height: 43px; margin: 24px 0 12px; border-radius: 13px; background: var(--yellow-soft); font-size: 21px; }
.meal-day strong { display: block; font-size: 12px; }
.meal-day small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.meal-empty { display: grid; place-items: center; min-height: 92px; color: var(--muted); font-size: 11px; text-align: center; }
.meal-edit { position: absolute; right: 11px; bottom: 11px; display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 10px; border: 1px solid #e2deff; border-radius: 9px; color: var(--primary); background: #f7f6ff; cursor: pointer; font-size: 10px; font-weight: 700; line-height: 1; }
.meal-edit span { font-size: 13px; }
.meal-edit:hover, .meal-edit:focus-visible { border-color: #cfc9ff; background: var(--primary-soft); transform: translateY(-1px); }
.meal-add { width: 100%; min-height: 92px; border: 0; border-radius: 11px; color: var(--primary); background: transparent; cursor: pointer; font-size: 11px; }
.meal-add:hover, .meal-add:focus-visible { background: var(--primary-soft); }
.content-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.content-grid.two-thirds { grid-template-columns: 2fr 1fr; }
.panel { padding: 21px; }
.panel.full { grid-column: 1 / -1; }
.panel > h2, .panel-heading h2 { margin: 0; font-size: 17px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 17px; }
.panel-heading p { margin: 4px 0 0; color: var(--muted); }
.recipe-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.recipe-card { position: relative; min-width: 0; padding: 15px; border: 1px solid transparent; border-radius: 13px; color: var(--ink); background: var(--canvas); cursor: pointer; font: inherit; text-align: left; transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.recipe-card:hover { border-color: #dcd7ff; transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.recipe-card span { font-size: 24px; }
.recipe-card strong { display: block; margin: 12px 0 4px; font-size: 12px; }
.recipe-card small { display: block; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.recipe-card i { position: absolute; top: 13px; right: 13px; display: grid; place-items: center; width: 27px; height: 27px; border-radius: 8px; color: var(--primary); background: #fff; font-size: 11px; font-style: normal; opacity: 0; transition: opacity .18s ease; }
.recipe-card:hover i, .recipe-card:focus-visible i { opacity: 1; }
.recipe-empty { grid-column: 1 / -1; padding: 25px; border: 1px dashed var(--line); border-radius: 13px; color: var(--muted); text-align: center; }
.recipe-empty strong, .recipe-empty small { display: block; }
.recipe-empty strong { color: var(--ink); }
.recipe-empty small { margin: 5px 0 14px; }
.recipe-modal { width: min(620px, calc(100vw - 30px)); }
.fridge-panel { background: linear-gradient(145deg, #eefaf5, #fff); }
.fridge-panel .large-icon { font-size: 35px; }
.fridge-panel h2 { margin-top: 16px; }
.fridge-panel p { color: var(--muted); line-height: 1.6; }
#fridgeResult { margin-top: 14px; color: #3c8065; font-size: 12px; font-weight: 700; }
.lists-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.list-card { min-height: 280px; padding: 20px; border: 1px solid var(--line); border-top: 4px solid var(--list-color); border-radius: 18px; background: white; box-shadow: var(--shadow-soft); }
.list-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.list-card h2 { margin: 0; font-size: 16px; }
.list-card-head span { color: var(--muted); font-size: 11px; }
.list-items { display: grid; gap: 7px; }
.list-item-row { display: flex; align-items: center; gap: 8px; width: 100%; border-bottom: 1px solid #f0f3f7; }
.list-item { display: flex; flex: 1 1 auto; align-items: center; gap: 10px; min-width: 0; min-height: 39px; padding: 8px 0; cursor: pointer; }
.list-item input { flex: 0 0 18px; width: 18px; height: 18px; min-height: 18px; margin: 0; padding: 0; accent-color: var(--primary); }
.list-item > span { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.list-item.done span { color: #9aa4b3; text-decoration: line-through; }
.list-item-edit { flex: 0 0 30px; width: 30px; height: 30px; margin-left: auto; border: 0; border-radius: 8px; color: var(--primary); background: transparent; cursor: pointer; opacity: .55; }
.list-item-row:hover .list-item-edit, .list-item-edit:focus-visible { background: var(--primary-soft); opacity: 1; }
.add-list-item { display: flex; gap: 7px; margin-top: 14px; }
.add-list-item input { width: 100%; min-width: 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; }
.add-list-item button { border: 0; color: var(--primary); background: transparent; cursor: pointer; font-size: 18px; }
.family-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.family-card { display: flex; flex-direction: column; align-items: center; padding: 20px 12px 14px; border: 1px solid var(--line); border-radius: 17px; background: white; text-align: center; box-shadow: var(--shadow-soft); }
.family-avatar { display: grid; place-items: center; width: 55px; height: 55px; margin: 0 auto 12px; overflow: hidden; border: 5px solid color-mix(in srgb, var(--member) 18%, white); border-radius: 50%; color: white; background: var(--member); font-size: 18px; font-weight: 800; }
.family-card strong { display: block; }
.family-card small { color: var(--muted); text-transform: capitalize; }
.family-card .stars { display: inline-block; margin-top: 10px; padding: 5px 8px; border-radius: 8px; color: #a87818; background: var(--yellow-soft); font-size: 10px; font-weight: 700; }
.family-email { display: block; max-width: 100%; margin-top: 5px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.family-card-spacer { flex: 1 0 12px; }
.family-edit-btn { width: 100%; min-height: 35px; border: 0; border-radius: 10px; color: var(--primary); background: var(--primary-soft); cursor: pointer; font-weight: 700; }
.family-edit-btn:hover { background: #e5e1ff; }
.countdown-row, .pulse-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.countdown-row:first-child, .pulse-row:first-child { border-top: 0; }
.editable-family-row { width: 100%; border-right: 0; border-bottom: 0; border-left: 0; color: inherit; background: transparent; text-align: left; cursor: pointer; }
.editable-family-row:hover { margin-inline: -8px; width: calc(100% + 16px); padding-inline: 8px; border-radius: 11px; background: var(--canvas); }
.editable-family-row i { color: var(--primary); font-size: 15px; font-style: normal; opacity: 0; }
.editable-family-row:hover i, .editable-family-row:focus-visible i { opacity: 1; }
.family-empty { margin: 16px 0 4px; line-height: 1.5; }
.countdown-row > span { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 11px; background: var(--primary-soft); }
.countdown-row div, .pulse-row div { flex: 1; }
.countdown-row strong, .countdown-row small, .pulse-row strong, .pulse-row small { display: block; }
.countdown-row small, .pulse-row small { color: var(--muted); }
.countdown-row b { color: var(--primary); font-size: 12px; }
.pulse-face { font-size: 24px; }
.soft-label { padding: 5px 8px; border-radius: 8px; color: var(--muted); background: var(--canvas); font-size: 10px; }
.memory-stage { position: relative; min-height: 300px; display: flex; align-items: center; padding: 44px; overflow: hidden; border-radius: 24px; color: white; background: linear-gradient(125deg, #172443, #31446a 60%, #5a5ddd); box-shadow: var(--shadow); }
.memory-stage h2 { margin: 10px 0; font-size: 34px; }
.memory-stage p { color: rgba(255,255,255,.7); }
.memory-stage .soft-btn { background: white; }
.memory-date { color: #cfd5ff; font-size: 11px; letter-spacing: .15em; }
.memory-orbit { position: absolute; right: 8%; width: 260px; height: 240px; }
.memory-orbit span { position: absolute; display: grid; place-items: center; border: 6px solid rgba(255,255,255,.85); border-radius: 26px; background: #f6ebc8; box-shadow: 0 20px 40px rgba(0,0,0,.24); font-size: 56px; }
.memory-orbit span:nth-child(1) { inset: 4px 69px 65px 0; transform: rotate(-7deg); }
.memory-orbit span:nth-child(2) { inset: 63px 2px 10px 118px; transform: rotate(8deg); }
.memory-orbit span:nth-child(3) { inset: 131px 104px 0 37px; transform: rotate(-2deg); }
.memory-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 15px; }
.memory-card { display: flex; align-items: center; gap: 15px; padding: 18px; border-radius: 16px; background: var(--memory); }
.memory-card span { font-size: 28px; }
.memory-card h3 { margin: 0; font-size: 14px; }
.memory-card small { color: var(--muted); }
.photo-memory-card { min-width: 0; padding: 10px; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow-soft); }
.photo-memory-card img { flex: 0 0 92px; width: 92px; height: 70px; border-radius: 11px; object-fit: cover; }
.photo-memory-card div { min-width: 0; }
.photo-memory-card h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-upload-modal { width: min(520px, calc(100vw - 30px)); }
.photo-upload-modal input[type="file"] { padding: 8px; background: var(--canvas); }
.photo-upload-modal .form-help { margin: 7px 0 14px; }
.photo-upload-modal [type="submit"]:disabled { cursor: wait; opacity: .65; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.settings-grid label { display: grid; gap: 6px; margin-top: 16px; color: #526077; font-size: 12px; font-weight: 700; }
.field-row { display: flex; gap: 11px; }
.field-row > label { flex: 1; }
input, select, textarea { width: 100%; min-height: 43px; padding: 10px 12px; border: 1px solid #dfe5ed; border-radius: 10px; color: var(--ink); background: #fff; }
textarea { min-width: 0; max-width: 100%; resize: vertical; }
.toggle-row { display: flex !important; align-items: center; justify-content: space-between; gap: 20px; margin-top: 22px !important; }
.toggle-row strong, .toggle-row small { display: block; }
.toggle-row small { margin-top: 3px; color: var(--muted); font-weight: 400; }
.toggle-row input { width: 44px; min-height: 24px; accent-color: var(--primary); }
.integration-row, .device-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.integration-row:first-of-type { margin-top: 14px; }
.settings-panel-copy { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.integration-row div, .device-row div { flex: 1; }
.integration-row strong, .integration-row small, .device-row strong, .device-row small { display: block; }
.integration-row small, .device-row small { color: var(--muted); }
.integration-icon { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 10px; color: white; font-weight: 800; }
.integration-icon.google { background: #4285f4; }.integration-icon.apple { background: #20293a; }.integration-icon.outlook { background: #1675d1; }
.integration-actions { flex: 0 0 auto !important; display: flex; align-items: center; gap: 7px; }
.integration-actions .soft-btn { min-height: 35px; }
.disconnect-calendar { color: #a74459; font-size: 11px; }
.device-row > span { font-size: 29px; }.device-row i { padding: 6px 9px; border-radius: 8px; color: #33815f; background: var(--mint-soft); font-size: 10px; font-style: normal; }
.login-background-settings { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); align-items: center; gap: 28px; }
.login-background-settings p { margin: 6px 0 0; color: var(--muted); }
.login-background-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.login-background-fields label small { color: var(--muted); font-weight: 400; line-height: 1.45; }
.login-background-preview { height: 170px; padding: 5px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: var(--shadow-soft); }
.login-background-preview img { width: 100%; height: 100%; border-radius: 11px; object-fit: cover; }
.settings-save { justify-self: start; }
.settings-danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 28px; border-color: #ffd5dc; background: linear-gradient(135deg, #fff, #fff7f8); }
.settings-danger-zone h2 { margin: 4px 0 6px; }
.settings-danger-zone p { max-width: 720px; margin: 0; color: var(--muted); line-height: 1.55; }
.settings-danger-zone small { display: block; margin-top: 10px; color: #a63149; font-weight: 700; }
.settings-danger-zone .danger-btn { flex: 0 0 auto; }
.settings-danger-zone .danger-btn:disabled { cursor: not-allowed; opacity: .45; }

.modal-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(22, 31, 49, .34); backdrop-filter: blur(3px); }
.modal { z-index: 90; width: min(550px, calc(100vw - 30px)); padding: 24px; border: 0; border-radius: 20px; color: var(--ink); background: white; box-shadow: 0 30px 80px rgba(26, 36, 56, .25); }
.event-modal { width: min(720px, calc(100vw - 30px)); }
.modal::backdrop { background: rgba(22, 31, 49, .34); backdrop-filter: blur(3px); }
.modal form > label { display: grid; gap: 7px; margin-top: 14px; color: #536178; font-size: 12px; font-weight: 700; }
.modal .field-row label { margin-top: 14px; }
.modal-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.modal-head h2 { margin: 4px 0 0; }
.close-btn { width: 35px; height: 35px; border: 0; border-radius: 9px; background: var(--canvas); cursor: pointer; font-size: 23px; }
.modal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.modal-actions > button, .modal-actions > .primary-btn, .modal-actions > .soft-btn, .modal-actions > .danger-btn, .modal-actions > .danger-confirm-btn { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; min-height: 43px; }
.modal-spacer { flex: 1; }
.danger-btn { min-height: 39px; padding: 0 14px; border: 0; border-radius: 11px; color: #ae3851; background: #fff0f3; cursor: pointer; font-weight: 700; }
.event-media-field small { color: var(--muted); font-weight: 400; line-height: 1.45; }
.event-media-field input[type="file"] { padding: 8px; background: var(--canvas); }
.event-media-gallery { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-top: 12px; }
.event-media-item { position: relative; min-width: 0; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--canvas); }
.event-media-item img, .event-media-item video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #152036; object-fit: cover; }
.event-media-item figcaption { padding: 8px 10px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.event-media-item > button { position: absolute; top: 7px; right: 7px; display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 9px; color: #a63149; background: rgba(255,255,255,.94); cursor: pointer; font-size: 20px; box-shadow: var(--shadow-soft); }
.event-media-item.pending { border-style: dashed; }
.event-media-empty { grid-column: 1 / -1; margin: 0; padding: 14px; border: 1px dashed #d9e0ea; border-radius: 12px; color: var(--muted); background: var(--canvas); font-size: 11px; text-align: center; }
.member-form-intro { display: flex; align-items: center; gap: 13px; margin: 18px 0 2px; padding: 13px; border-radius: 14px; background: var(--canvas); }
.member-form-intro p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.member-form-avatar { display: grid; place-items: center; flex: 0 0 46px; height: 46px; overflow: hidden; border: 5px solid color-mix(in srgb,var(--member) 18%,white); border-radius: 50%; color: white; background: var(--member); font-weight: 800; }
.member-photo-field small { color: var(--muted); font-weight: 400; }
.member-photo-field input[type="file"] { padding: 8px; background: var(--canvas); }
.member-quick-modal { width: min(440px, calc(100vw - 30px)); }
.quick-member-profile { display: flex; align-items: center; gap: 17px; margin-top: 22px; padding: 20px; border-radius: 17px; background: linear-gradient(135deg, var(--canvas), #fff); }
.quick-member-avatar { display: grid; place-items: center; flex: 0 0 70px; height: 70px; overflow: hidden; border: 7px solid color-mix(in srgb,var(--member) 17%,white); border-radius: 50%; color: white; background: var(--member); font-size: 21px; font-weight: 800; box-shadow: var(--shadow-soft); }
.mini-avatar img, .avatar-button img, .family-avatar img, .member-form-avatar img, .quick-member-avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.quick-member-profile strong, .quick-member-profile div > span { display: block; }
.quick-member-profile strong { font-family: var(--display); font-size: 16px; }
.quick-member-profile div > span { margin-top: 6px; color: var(--muted); font-size: 12px; }
.member-modal input[type="color"] { min-height: 43px; padding: 5px; cursor: pointer; }
.form-help { margin: 11px 0 0; color: var(--muted); font-size: 11px; }
[hidden] { display: none !important; }
.danger-modal { width: min(590px,calc(100vw - 30px)); }
.compact-danger-modal { width: min(520px,calc(100vw - 30px)); }
.danger-hero { display: flex; align-items: center; gap: 14px; padding: 17px; border: 1px solid #ffd5dc; border-radius: 16px; background: linear-gradient(135deg,#fff1f4,#fff8f9); }
.danger-hero > span { display: grid; place-items: center; flex: 0 0 46px; height: 46px; border-radius: 14px; color: white; background: #d94b67; font-size: 24px; font-weight: 800; }
.danger-hero h2 { margin: 3px 0 0; font-size: 22px; }
.danger-hero .eyebrow { color: #bd3e58; }
.danger-copy { margin: 19px 0 10px; color: #536178; }
.impact-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.impact-list li { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.impact-list strong { min-width: 34px; padding: 5px 8px; border-radius: 8px; color: #a63149; background: #fff0f3; text-align: center; }
.impact-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: var(--primary); background: var(--primary-soft); }
.impact-icon.tasks { color: #33815f; background: var(--mint-soft); }.impact-icon.pulse { color: #c64362; background: var(--pink-soft); }.impact-icon.rewards { color: #a87818; background: var(--yellow-soft); }
.retained-note { margin-top: 11px; padding: 11px 13px; border-radius: 11px; color: #536178; background: var(--canvas); font-size: 11px; line-height: 1.5; }
.danger-phrase-field { display: grid; gap: 8px; margin-top: 18px; color: #536178; font-size: 12px; font-weight: 700; }
.danger-phrase-field strong { color: #a63149; letter-spacing: .04em; }
.danger-phrase-field input { border-color: #efb6c2; }
.delete-block-reason { margin: 12px 0 0; padding: 11px 13px; border-radius: 11px; color: #8b5b18; background: #fff6df; font-size: 12px; font-weight: 700; }
.danger-confirm-btn { min-height: 41px; padding: 0 16px; border: 0; border-radius: 11px; color: white; background: #cf3f5c; cursor: pointer; font-weight: 800; }
.danger-confirm-btn:hover { background: #b9324d; }.danger-confirm-btn:disabled { cursor: not-allowed; opacity: .45; }
.profile-signout { display: inline-flex; align-items: center; }
.screensaver-modal { width: 100vw; max-width: none; height: 100vh; max-height: none; margin: 0; padding: 8vw; border: 0; color: white; background: radial-gradient(circle at 75% 30%, #6d70e5, transparent 28%), linear-gradient(135deg,#16233f,#34496e 65%,#5d60d9); }
.screensaver-modal::backdrop { background: #111a30; }
.screensaver-modal > div { display: grid; align-content: center; height: 100%; }
.screensaver-modal span { color: #d7dcff; letter-spacing: .2em; }
.screensaver-modal h2 { max-width: 760px; margin: 18px 0; font-size: clamp(48px,8vw,110px); line-height: 1; }
.screensaver-modal p { color: rgba(255,255,255,.72); font-size: 18px; }
.screensaver-close { position: absolute; top: 28px; right: 28px; width: 48px; height: 48px; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; color: white; background: rgba(255,255,255,.1); cursor: pointer; font-size: 28px; }
.side-modal { position: fixed; inset: 0 0 0 auto; height: 100vh; max-height: none; margin: 0; border-radius: 24px 0 0 24px; }
.muted { color: var(--muted); }
.inbox-list { display: grid; gap: 8px; margin-top: 20px; }
.inbox-item { padding: 13px; border: 1px solid var(--line); border-radius: 12px; }
.inbox-item strong, .inbox-item small { display: block; }
.inbox-item small { margin-top: 4px; color: var(--muted); }
.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 120; display: grid; gap: 8px; }
.toast { min-width: 250px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); animation: toastIn .25s ease; }
.toast.error { border-color: #f6c8d2; color: #a6324c; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
.mobile-bar { display: none; }

.child-mode { --primary: #5c55dc; --primary-dark: #4841c5; --primary-soft: #efefff; }
.child-mode .sidebar { background: linear-gradient(180deg, #fff, #fbfaff); }
.child-mode .topbar .weather-pill { background: #fffaf0; }
.child-mode .today-rail { background: linear-gradient(180deg, #fff, #fbfaff); }
.child-mode .page-heading h1 { font-size: 38px; }

.login-body { min-height: 100vh; background: white; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.05fr) minmax(480px, .95fr); }
.login-story { position: relative; display: flex; flex-direction: column; min-height: 100vh; padding: 43px clamp(36px, 5vw, 74px); overflow: hidden; color: white; background: #f8f7ff; }
.login-hero-image { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 47%; transform-origin: center; animation: loginImageDrift 18s ease-in-out infinite alternate; }
.login-story::after { content: ''; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(24,22,46,.52) 0%, rgba(24,22,46,.24) 58%, rgba(24,22,46,.08) 100%), linear-gradient(0deg, rgba(13,18,33,.58) 0%, rgba(13,18,33,.12) 52%, rgba(13,18,33,.22) 100%); }
.login-story > :not(.login-hero-image) { position: relative; z-index: 2; }
.login-story .brand { color: white; text-shadow: 0 2px 16px rgba(15,20,36,.28); }
.login-story .brand > span:last-child > span { color: #d9d5ff; }
.login-story .eyebrow { color: #f4dca4; text-shadow: 0 2px 12px rgba(15,20,36,.3); }
.brand-large { padding: 0; font-size: 25px; animation: loginReveal .65s .05s cubic-bezier(.2,.7,.2,1) both; }
.story-copy { max-width: 600px; margin-top: 13vh; animation: loginReveal .75s .14s cubic-bezier(.2,.7,.2,1) both; }
.story-copy h1 { max-width: 580px; margin: 14px 0 17px; font-size: clamp(45px, 5vw, 72px); line-height: 1.03; letter-spacing: -3px; }
.story-copy h1 { text-shadow: 0 3px 24px rgba(15,20,36,.32); }
.story-copy p { max-width: 530px; color: rgba(255,255,255,.84); font-size: 18px; line-height: 1.65; text-shadow: 0 2px 14px rgba(15,20,36,.3); }
.login-preview { width: min(540px, 100%); display: grid; gap: 8px; margin-top: 32px; padding: 17px; border: 1px solid rgba(255,255,255,.28); border-radius: 20px; background: rgba(18,25,42,.38); box-shadow: 0 25px 60px rgba(11,15,29,.2); backdrop-filter: blur(18px); animation: loginReveal .75s .26s cubic-bezier(.2,.7,.2,1) both; }
.preview-date { display: flex; justify-content: space-between; padding: 4px 3px 10px; }
.preview-date span { color: rgba(255,255,255,.7); font-size: 12px; }
.preview-item { display: grid; grid-template-columns: 52px 1fr 28px; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; }
.preview-item.pink { background: var(--pink-soft); }.preview-item.blue { background: var(--blue-soft); }.preview-item.mint { background: var(--mint-soft); }
.preview-item { animation: loginRowIn .55s cubic-bezier(.2,.7,.2,1) both, loginPlanGlow 6s ease-in-out infinite; }
.preview-item:nth-child(2) { animation-delay: .48s, 1.25s; }.preview-item:nth-child(3) { animation-delay: .57s, 3.25s; }.preview-item:nth-child(4) { animation-delay: .66s, 5.25s; }
.preview-item span { color: #58677d; font-size: 11px; }.preview-item strong { color: var(--ink); font-size: 13px; }.preview-item i { display: grid; place-items: center; height: 28px; border-radius: 50%; color: white; background: var(--pink); font-style: normal; font-size: 10px; animation: loginAvatarPulse 6s ease-in-out infinite; }
.preview-item:nth-child(2) i { animation-delay: 1.25s; }.preview-item:nth-child(3) i { animation-delay: 3.25s; }.preview-item:nth-child(4) i { animation-delay: 5.25s; }
.preview-item.blue i { background: var(--blue); }.preview-item.mint i { background: var(--mint); }
.story-foot { margin-top: auto; margin-bottom: 0; color: rgba(255,255,255,.76); font-size: 12px; text-shadow: 0 2px 12px rgba(15,20,36,.35); animation: loginReveal .7s .42s cubic-bezier(.2,.7,.2,1) both; }
.login-panel { position: relative; isolation: isolate; display: grid; place-items: center; padding: 40px; overflow: hidden; background: linear-gradient(145deg, #f8f7ff 0%, #fff 52%, #fff8ea 100%); }
.login-panel::before { content: ''; position: absolute; inset: 0; z-index: 1; background: radial-gradient(circle at 88% 12%, rgba(244,183,64,.18), transparent 28%), radial-gradient(circle at 8% 88%, rgba(91,79,241,.12), transparent 32%); }
.login-panel-image { display: none; position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; }
.login-card { position: relative; z-index: 2; width: min(430px, 100%); padding: clamp(28px, 3vw, 42px); border: 1px solid rgba(255,255,255,.72); border-radius: 24px; background: rgba(255,255,255,.88); box-shadow: 0 30px 70px rgba(31,25,57,.24); backdrop-filter: blur(16px); animation: loginCardIn .8s .1s cubic-bezier(.2,.75,.2,1) both; }
.login-card h2 { margin: 8px 0; font-size: 34px; letter-spacing: -1.2px; }
.login-card .primary-btn { background-size: 180% 180%; animation: loginButtonGlow 5s 1.1s ease-in-out infinite; }
@keyframes loginReveal { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes loginRowIn { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: translateX(0); } }
@keyframes loginPlanGlow { 0%,26%,100% { filter: saturate(1) brightness(1); box-shadow: 0 0 0 rgba(20,31,55,0); } 8%,17% { filter: saturate(1.08) brightness(1.025); box-shadow: 0 10px 25px rgba(14,24,44,.2); } }
@keyframes loginAvatarPulse { 0%,26%,100% { transform: scale(1); } 10%,16% { transform: scale(1.13); } }
@keyframes loginCardIn { from { opacity: 0; transform: translateY(20px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes loginImageDrift { from { transform: scale(1.025) translate3d(-.35%, -.2%, 0); } to { transform: scale(1.065) translate3d(.45%, .25%, 0); } }
@keyframes loginButtonGlow { 0%,100% { background-position: 15% 50%; box-shadow: 0 7px 17px rgba(80,65,229,.18); } 50% { background-position: 85% 50%; box-shadow: 0 10px 25px rgba(80,65,229,.3); } }
.auth-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin: 28px 0 20px; padding: 5px; border-radius: 13px; background: #f0f3f7; }
.auth-switch button { height: 42px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; cursor: pointer; font-weight: 700; }
.auth-switch button.active { color: var(--primary); background: white; box-shadow: var(--shadow-soft); }
.auth-form { display: none; }
.auth-form.active { display: grid; gap: 15px; animation: viewIn .2s ease; }
.auth-form label { display: grid; gap: 7px; color: #526077; font-size: 12px; font-weight: 700; }
.auth-form input, .auth-form select { min-height: 49px; }
.auth-form .primary-btn { min-height: 51px; margin-top: 4px; }
.demo-note, .privacy-note { margin: 0; color: var(--muted); font-size: 11px; text-align: center; }
.privacy-note { margin-top: 26px; }
.form-error { margin-bottom: 14px; padding: 11px 13px; border-radius: 10px; color: #a8374f; background: #fff0f3; font-size: 12px; }
.mobile-brand { display: none; }
.install-shell { display: grid; grid-template-columns: 1fr; }
.install-shell .login-panel { min-height: 100vh; }
.install-shell .login-card { width: min(520px, 100%); }
.install-brand { display: block; margin-bottom: 34px; }
.install-link { display: inline-flex; align-items: center; justify-content: center; margin-top: 18px; }

@media (max-width: 1180px) {
  .topbar { grid-template-columns: 1fr auto auto; }
  .global-search, .family-avatars { display: none; }
  .calendar-layout { grid-template-columns: 1fr; }
  .today-rail { display: none; }
  .mobile-day-agenda { display: block; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-soft); }
  .calendar-card:has(.agenda-grid) + .mobile-day-agenda, .calendar-card:has(.year-grid) + .mobile-day-agenda { display: none; }
  .calendar-grid { min-height: 590px; }
  .week-summary { grid-template-columns: repeat(4, 1fr); }
  .meal-week { grid-template-columns: repeat(4, 1fr); }
  .family-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1400px) and (min-width: 1181px) {
  .global-search { display: none; }
}

@media (max-width: 900px) {
  html { scrollbar-gutter: stable; }
  .app-shell { display: block; }
  .sidebar { z-index: 42; width: min(86vw, 320px); visibility: hidden; pointer-events: none; transform: translateX(-100%); transition: transform .24s ease, visibility 0s linear .24s; box-shadow: var(--shadow); }
  .sidebar.open { visibility: visible; pointer-events: auto; transform: translateX(0); transition-delay: 0s; }
  .sidebar-close { position: absolute; top: 24px; right: 17px; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 12px; color: var(--primary); background: var(--primary-soft); cursor: pointer; font-size: 26px; line-height: 1; }
  .mobile-nav-backdrop { position: fixed; inset: 0 0 0 min(86vw, 320px); z-index: 41; display: block; border: 0; background: rgba(20,33,58,.36); backdrop-filter: blur(2px); }
  .mobile-nav-backdrop[hidden] { display: none; }
  .mobile-nav-open { overflow: hidden; }
  .main-content { width: 100%; }
  .mobile-bar { position: sticky; top: 0; z-index: 28; height: 63px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(12px); }
  .mobile-bar button { width: 39px; height: 39px; border: 0; border-radius: 11px; background: var(--primary-soft); color: var(--primary); font-size: 23px; line-height: 1; }
  .mobile-nav-open #mobileMenu { position: fixed; top: 12px; right: 18px; z-index: 44; box-shadow: 0 7px 20px rgba(35,52,84,.16); }
  .topbar { position: static; height: 72px; display: flex; padding: 0 18px; }
  .top-date-navigation { display: none; }
  .topbar .greeting small, .weather-pill small, .top-actions .primary-btn span { display: none; }
  .top-actions .primary-btn { width: 43px; padding: 0; font-size: 0; }
  .top-actions .primary-btn::after { content: '+'; font-size: 23px; }
  .view { padding: 19px 18px 45px; }
  .week-summary { grid-template-columns: 1fr 1fr; }
  .summary-item { min-height: 65px; border-top: 1px solid var(--line); }
  .summary-item:nth-child(2) { border-top: 0; }
  .calendar-card { overflow: hidden; }
  .weekday-row, .calendar-grid { min-width: 0; }
  .task-columns, .reward-grid, .lists-grid { grid-template-columns: 1fr 1fr; }
  .content-grid, .content-grid.two-thirds, .settings-grid { grid-template-columns: 1fr; }
  .panel.full { grid-column: auto; }
  .login-shell { grid-template-columns: 1fr; }
  .login-story { display: none; }
  .login-panel { min-height: 100vh; padding: 28px; background: #f8f7ff; }
  .login-panel-image { display: block; object-position: 58% center; }
  .login-panel::before { background: linear-gradient(rgba(35,27,61,.34), rgba(44,31,28,.28)); }
  .login-background-settings { grid-template-columns: 1fr; }
  .login-background-fields { grid-template-columns: 1fr; }
  .mobile-brand { display: block; margin-bottom: 55px; }
}

@media (max-width: 620px) {
  .weather-pill { display: none; }
  .topbar { height: 64px; gap: 8px; padding: 0 12px; }
  .main-content:has(#view-calendar.active) .greeting { display: none; }
  .main-content:has(#view-calendar.active) .top-date-navigation { display: flex; gap: 5px; }
  .top-date-navigation h1 { min-width: 104px; font-size: 16px; }
  .top-date-navigation button { width: 36px; height: 36px; }
  .top-actions { gap: 8px; margin-left: auto; }
  .top-actions .icon-btn { display: none; }
  .greeting strong { max-width: 150px; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
  .view { padding: 16px 12px 38px; }
  .calendar-toolbar { grid-template-columns: minmax(0,1fr) auto; gap: 10px; padding: 4px 0 12px; }
  .calendar-toolbar .member-filter-nav { grid-column: 1 / -1; grid-row: 2; grid-template-columns: 38px minmax(0, 1fr) 38px; gap: 6px; width: 100%; justify-self: stretch; }
  .calendar-toolbar .member-filters { justify-content: start; margin: 0; scroll-padding-inline: 4px; }
  .filter-scroll-button { display: grid; place-items: center; width: 38px; height: 42px; padding: 0; border: 1px solid var(--line); border-radius: 11px; color: var(--primary); background: #fff; cursor: pointer; font-size: 24px; box-shadow: var(--shadow-soft); }
  .filter-scroll-button:disabled { opacity: .35; cursor: default; box-shadow: none; }
  .segmented { grid-column: 1 / -1; grid-row: 1; width: 100%; }
  .segmented button { flex: 1; min-width: 0; }
  .date-navigation { justify-content: start; }
  .date-navigation h1 { min-width: 125px; font-size: 18px; }
  .today-btn { grid-column: 1 / -1; grid-row: 3; width: 100%; min-height: 44px; }
  .week-summary { display: grid; grid-template-columns: 1fr 1fr; min-height: 0; padding: 8px; overflow: visible; }
  .summary-item { min-height: 64px; padding: 8px 10px; border: 0; border-top: 1px solid var(--line); }
  .summary-item:nth-child(-n+2) { border-top: 0; }
  .summary-item:nth-child(odd) { border-right: 1px solid var(--line); }
  .weekday-row { height: 36px; font-size: 10px; }
  .calendar-grid { grid-template-rows: repeat(5, minmax(62px, auto)); min-height: 0; }
  .calendar-grid.week-grid { grid-template-rows: minmax(92px, auto); min-height: 0; }
  .day-cell { min-height: 62px; padding: 4px 2px; }
  .date-button { display: flex; min-height: 53px; align-items: center; flex-direction: column; justify-content: center; border-radius: 9px; }
  .date-number { width: 28px; height: 28px; margin: 0; font-size: 13px; }
  .mobile-event-count { display: grid; place-items: center; min-width: 17px; height: 17px; margin-top: 1px; padding: 0 4px; border-radius: 9px; color: var(--primary); background: var(--primary-soft); font-size: 9px; font-weight: 800; }
  .mobile-event-count:empty { visibility: hidden; }
  .day-cell .events-stack { display: none; }
  .mobile-day-agenda { padding: 16px; border-radius: 16px; }
  .mobile-agenda-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
  .mobile-agenda-head span { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
  .mobile-agenda-head h2 { margin: 2px 0 0; font-size: 20px; }
  .mobile-agenda-head > b { padding: 6px 9px; border-radius: 9px; color: var(--primary); background: var(--primary-soft); font-size: 11px; }
  .mobile-day-agenda .primary-btn { width: 100%; margin-top: 14px; }
  .page-heading { align-items: start; flex-direction: column; }
  .page-heading h1 { font-size: 28px; }
  .page-heading > .primary-btn { width: 100%; min-height: 46px; }
  .myday-hero { padding: 22px; }
  .myday-hero h2 { font-size: 20px; }
  .hero-progress { flex-basis: 72px; height: 72px; }.hero-progress::before { width: 56px; height: 56px; }.hero-progress b { font-size: 15px; }
  .task-columns, .reward-grid, .lists-grid, .family-grid, .memory-grid { grid-template-columns: 1fr; }
  .meal-week { grid-template-columns: 1fr 1fr; }
  .reward-summary { align-items: flex-start; flex-direction: column; }
  .recipe-grid { grid-template-columns: 1fr; }
  .memory-stage { padding: 28px; }
  .memory-stage h2 { font-size: 27px; }
  .memory-orbit { display: none; }
  .field-row { flex-direction: column; gap: 0; }
  .settings-danger-zone { align-items: stretch; flex-direction: column; gap: 18px; }
  .settings-danger-zone .danger-btn { width: 100%; }
  .integration-row, .device-row { align-items: flex-start; flex-wrap: wrap; }
  .integration-actions { flex-basis: 100% !important; }
  .modal { max-height: calc(100dvh - 20px); padding: 20px; overflow-y: auto; }
  .modal-actions { align-items: stretch; flex-wrap: wrap; }
  .modal-actions .modal-spacer { display: none; }
  .modal-actions button, .modal-actions .primary-btn, .modal-actions .soft-btn { min-height: 44px; }
  .event-media-gallery { grid-template-columns: 1fr; }
}

@media (max-width: 360px) {
  .top-actions > .primary-btn { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.two-factor-settings { display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.security-heading { display: flex; align-items: flex-start; gap: 14px; }
.security-heading h2 { margin: 0 0 5px; }
.security-heading p { max-width: 720px; margin: 0 0 9px; color: var(--muted); }
.security-icon { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; border-radius: 13px; color: var(--primary); background: var(--primary-soft); font-weight: 900; }
.security-actions { display: flex; align-items: center; gap: 11px; flex: 0 0 auto; }
.security-status { padding: 7px 11px; border-radius: 999px; color: var(--muted); background: #f1f3f7; font-size: 12px; font-weight: 800; }
.security-status.enabled { color: #18704c; background: #e5f6ee; }
.setup-steps { margin: 16px 0; padding-left: 22px; color: var(--muted); line-height: 1.65; }
.authenticator-key { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 16px 0 20px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #f8f8fc; }
.authenticator-key code { overflow-wrap: anywhere; color: var(--text); font-size: 15px; font-weight: 800; letter-spacing: .1em; }
.success-callout { display: flex; flex-direction: column; gap: 5px; padding: 15px; border-radius: 14px; color: #155f42; background: #e8f7ef; }
.recovery-codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 18px 0; }
.recovery-codes code { padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #f8f8fc; text-align: center; font-weight: 800; letter-spacing: .08em; }
.two-factor-login .login-panel { width: 100%; min-height: 100vh; }
.two-factor-login .login-card { width: min(100%, 520px); }

@media (max-width: 620px) {
  .two-factor-settings { align-items: stretch; flex-direction: column; }
  .security-actions { flex-wrap: wrap; }
  .security-actions button { flex: 1; }
  .authenticator-key { align-items: flex-start; flex-direction: column; }
  .recovery-codes { grid-template-columns: 1fr; }
}
