:root {
  --primary:#5662d9; --primary-dark:#444cbd; --ink:#20263b; --muted:#747d94;
  --line:#e7eaf3; --surface:#ffffff; --back:#f5f7fc; --soft:#eef0ff;
  --shadow:0 6px 26px rgba(42,51,101,.06);
  font-family: ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
  color:var(--ink); background:var(--back); font-synthesis:none;
}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;min-height:100vh}
button,input,select,textarea{font:inherit}button{cursor:pointer;touch-action:manipulation}button:disabled{opacity:.55;cursor:wait}
[hidden]{display:none!important}h1,h2,h3,p{margin:0}h1,h2,h3{letter-spacing:-.04em}
.muted{color:var(--muted);line-height:1.55} .wide{width:100%}
:where(button,input,select,textarea):focus-visible{outline:3px solid #a4afff;outline-offset:2px}
button.primary,button.secondary,button.quiet,button.square,button.danger{border:1px solid transparent;border-radius:13px;padding:12px 16px;min-height:44px;font-size:14px;font-weight:700}
button.primary{background:var(--primary);color:white;box-shadow:0 3px 10px #5662d928}button.primary:hover{background:var(--primary-dark)}
button.secondary{background:var(--soft);color:var(--primary)}
button.quiet,button.square{background:#fff;border-color:var(--line);color:var(--ink)}button.quiet:hover,button.square:hover{background:#f7f8ff}
button.danger{color:#bc3540;background:#fcebef}
label{display:flex;flex-direction:column;gap:8px;margin:18px 0 0;font-size:13px;font-weight:700}
input:not([type=checkbox]),select,textarea{width:100%;min-height:45px;border:1px solid #dfe3ef;background:white;border-radius:12px;padding:11px 13px;color:var(--ink);font-size:16px}
textarea{resize:vertical} form>.primary{margin-top:22px}
.panel{background:white;border:1px solid var(--line);border-radius:24px;box-shadow:var(--shadow);padding:30px}
.app-logo,.brandmark{width:48px;height:48px;border-radius:15px;background:var(--primary);color:white;display:grid;place-items:center;box-shadow:0 5px 12px #5662d932}
.app-logo.small{width:44px;height:44px;font-size:26px;margin:0 0 20px}
.landing,.onboarding{min-height:100dvh;padding:24px;display:grid;place-items:center}
.auth-shell{width:min(100%,420px);text-align:center}
.auth-shell>.app-logo{margin:0 auto 22px}.auth-shell h1{font-size:32px}.welcome-message{margin-top:7px;margin-bottom:28px}
.account-panel{text-align:left}.account-panel h2{font-size:24px;margin-top:6px}.account-panel .muted{font-size:14px;margin:6px 0 22px}
.tabs{display:flex;gap:3px;background:#f0f2f9;border-radius:13px;padding:4px;margin-bottom:24px}
.tab{flex:1;border:0;border-radius:10px;background:transparent;color:var(--muted);min-height:43px;font-size:13px;font-weight:700}
.tab.active{background:white;color:var(--primary);box-shadow:0 1px 6px #25294b15}
.family-panel{width:min(100%,470px)}.family-panel h1{font-size:30px}.family-panel>.muted{margin-top:8px;margin-bottom:25px}
.textbutton{border:0;background:transparent;color:var(--primary);font-weight:700;display:block;margin:18px auto 0;padding:10px}
.notice{padding:12px;background:#fff2d4;border-radius:12px;color:#855d16;font-size:13px;margin-bottom:20px}
.app{width:min(100%,1600px);margin:auto;padding:28px clamp(20px,3vw,46px) 44px}
.topbar{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:30px}
.brand{display:flex;align-items:center;gap:13px}.brandmark{width:42px;height:42px;border-radius:14px;flex:none}
.brand-kicker{display:block;color:var(--primary);font-size:10px;font-weight:800;letter-spacing:.13em;margin-bottom:3px}
.brand h1{font-size:21px;line-height:1.22}.top-actions{display:flex;gap:9px}
.profile-button{display:block;border:0;background:transparent;padding:0}
#wallButton,#signOutButton{display:none}
.profile-button span{width:41px;height:41px;background:var(--soft);border:2px solid #dfe2ff;color:var(--primary);font-size:15px;font-weight:800;display:grid;place-items:center;border-radius:50%}
.app-content{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:20px;align-items:start}
.calendar-section,.sidebar{background:var(--surface);border:1px solid var(--line);border-radius:23px;box-shadow:var(--shadow)}
.calendar-section{padding:24px 25px 26px}.sidebar{padding:26px;min-height:450px;scroll-margin-top:15px}
.toolbar{display:flex;align-items:center;justify-content:space-between;gap:15px;flex-wrap:wrap}
.toolbar h2{font-size:29px;font-weight:800}.toolbar-actions{display:flex;align-items:center;gap:7px}
.toolbar .square{padding:5px;min-width:44px;font-size:25px;line-height:1}.toolbar .quiet{padding:9px 12px}
.legend{display:flex;gap:7px;flex-wrap:wrap;margin:24px 0 20px}
.legend-chip{display:flex;align-items:center;gap:7px;font-size:12px;font-weight:650;color:#586179;background:#f5f6fb;border-radius:22px;padding:7px 11px}
.dot{width:9px;height:9px;display:inline-block;border-radius:50%;flex:none}
.month-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:1px;background:var(--line);border:1px solid var(--line);border-radius:13px;overflow:hidden}
.weekday{background:#f8f9fc;color:#9199a9;font-size:11px;letter-spacing:.05em;font-weight:750;text-align:center;padding:13px 2px}
.day{background:white;min-height:108px;text-align:left;border:0;padding:9px 7px;display:flex;flex-direction:column;align-items:stretch;gap:5px;position:relative;transition:background .15s;color:var(--ink)}
.day:hover{background:#f8f9ff}.day.outside{background:#fbfcfe;color:#bdc3d0}.day.selected{background:#f0f2ff}.day.today .day-number{background:var(--primary);color:white}
.day-number{display:grid;place-items:center;align-self:flex-start;width:29px;height:29px;border-radius:50%;font-size:12px;font-weight:750}
.day.selected .day-number:not(.today .day-number){color:var(--primary)}
.event-pill{font-size:11px;line-height:1.25;font-weight:650;background:color-mix(in srgb,var(--event-color,#5662d9) 13%,white);border-radius:5px;border-left:3px solid var(--event-color,#5662d9);padding:4px 5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.more-pill{font-size:10px;color:#737a90;font-weight:650}.event-dots{display:none}
.section-label{font-size:10px;letter-spacing:.12em;font-weight:800;color:#8d94a7}
.sidebar-heading h2{font-size:22px;margin-top:7px}.agenda{margin:23px 0 18px;min-height:200px}
.agenda-item{border:1px solid var(--line);background:#fafbff;border-radius:14px;padding:13px;display:flex;gap:12px;margin-bottom:9px;cursor:pointer}
.agenda-item:focus-visible{outline:3px solid #b2b8ff}
.agenda-line{width:4px;flex:none;border-radius:5px}.agenda-item h3{font-size:14px;letter-spacing:0;font-weight:750;margin:1px 0 4px}
.agenda-item p{font-size:12px;color:#6c748a;line-height:1.5}.agenda-item .notes{margin-top:5px;white-space:pre-wrap;word-break:break-word}
.empty-state{background:#f8f9fd;border:1px dashed #dbe0ec;border-radius:13px;padding:29px 16px;text-align:center;color:#80889e;font-size:13px}
.modal{width:min(480px,calc(100vw - 26px));max-height:min(90dvh,820px);overflow-y:auto;padding:24px;border:1px solid var(--line);background:#fff;color:var(--ink);border-radius:23px;box-shadow:0 20px 100px #1b225b35}
.modal::backdrop{background:#151c3995}.modal-head{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:20px}.modal-head h2{font-size:23px}.modal-head .square{font-size:24px;font-weight:400;min-width:42px;padding:6px;line-height:1}
.modal .muted{font-size:14px}.form-row{display:flex;gap:12px}.form-row>label{flex:1;min-width:0}
.toggle-row{display:flex;align-items:center;gap:8px;height:45px;color:#5f6982;font-size:13px;font-weight:550}.toggle-row input{accent-color:var(--primary);width:19px;height:19px}
.dialog-actions{display:flex;align-items:center;gap:7px;margin-top:20px;flex-wrap:wrap}.dialog-actions .grow{flex:1}
.settings-actions{display:grid;gap:8px}.settings-item{width:100%;min-height:52px;text-align:left;border:1px solid var(--line);background:#fbfcff;border-radius:13px;color:var(--ink);font-size:14px;font-weight:650;padding:14px 16px;display:flex;align-items:center;justify-content:space-between}.settings-item span{font-size:23px;color:#9aa1b3}.settings-item.signout{color:#bb3347}
.toast{position:fixed;z-index:1000;bottom:20px;left:50%;transform:translateX(-50%);max-width:calc(100vw - 32px);background:#252d52;color:white;padding:13px 18px;font-size:13px;line-height:1.4;border-radius:13px;box-shadow:0 12px 40px #12152e44;text-align:center}
.mobile-add,.bottom-nav{display:none}
/* Wall layout is available from Account, but not advertised as a feature in the normal UI. */
.app.wall-mode{max-width:none}.wall-mode .top-actions #inviteButton,.wall-mode .top-actions #signOutButton,.wall-mode .desktop-add,.wall-mode #addSelectedDay,.wall-mode .mobile-add,.wall-mode .bottom-nav{display:none!important}.wall-mode .app-content{grid-template-columns:minmax(0,1fr) 320px}.wall-mode .day{min-height:clamp(125px,12vh,210px)}.wall-mode .month-grid{min-height:70vh}.wall-mode .event-pill{font-size:13px}
@media(max-width:1040px){.app-content{grid-template-columns:minmax(0,1fr)}.sidebar{min-height:0}.agenda{min-height:0}}
@media(max-width:760px){
  :root{--back:#f7f8fc}
  .app{padding:0 0 calc(104px + env(safe-area-inset-bottom))}
  .topbar{position:sticky;top:0;z-index:30;background:#fff;padding:calc(11px + env(safe-area-inset-top)) 19px 13px;margin:0 0 10px;border-bottom:1px solid var(--line)}
  .brandmark{width:38px;height:38px;border-radius:12px}.brand h1{font-size:18px}.brand-kicker{font-size:9px}
  .top-actions{display:none}.profile-button{display:block}.app-content{display:block}
  .calendar-section{padding:18px 13px 15px;border:0;border-radius:0;box-shadow:none;background:transparent}
  .toolbar{display:flex;align-items:center;gap:8px}.toolbar h2{font-size:25px;white-space:nowrap}
  .toolbar-actions{gap:4px;margin-left:auto}.toolbar-actions .square{font-size:23px;min-width:36px;min-height:38px;padding:2px;border-color:transparent;background:transparent}
  .toolbar-actions .quiet{font-size:12px;min-height:36px;padding:7px 9px;background:white}
  .desktop-add{display:none}
  .legend{margin:16px -1px 14px;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;padding:1px 0 4px}.legend::-webkit-scrollbar{display:none}
  .legend-chip{font-size:11px;padding:7px 10px;white-space:nowrap;flex:none}
  .month-grid{gap:0;background:transparent;border:0;border-radius:0;overflow:visible}
  .weekday{border:0;background:transparent;font-size:10px;font-weight:750;padding:9px 0 12px;color:#939bad}
  .day{min-height:62px;padding:6px 0 7px;display:flex;align-items:center;gap:6px;justify-content:flex-start;border-radius:13px;background:transparent}
  .day:hover{background:#f0f1ff}.day.outside{background:transparent;color:#c1c6d4}
  .day.selected{background:var(--soft)}.day.selected .day-number{color:var(--primary)}
  .day.today .day-number{background:var(--primary);color:white}
  .day.selected.today .day-number{color:white}
  .day-number{align-self:center;width:32px;height:32px;border-radius:50%;font-size:13px}
  .event-pill,.more-pill{display:none}.event-dots{display:flex;justify-content:center;align-items:center;gap:3px;height:5px}
  .event-dots i{display:block;width:5px;height:5px;border-radius:50%}
  .sidebar{scroll-margin-top:87px;border:0;border-radius:18px;background:white;box-shadow:none;padding:22px 20px 23px;margin:0 12px 12px;min-height:190px}
  .sidebar-heading h2{font-size:21px}.agenda{margin:17px 0 11px}.agenda-item{padding:13px}.empty-state{padding:21px 12px}
  #addSelectedDay{display:none}
  .mobile-add{display:grid;place-items:center;position:fixed;right:18px;bottom:calc(90px + env(safe-area-inset-bottom));z-index:51;width:55px;height:55px;border-radius:18px;border:0;background:var(--primary);color:white;font-size:33px;font-weight:350;box-shadow:0 8px 22px #5662d95c}
  .bottom-nav{position:fixed;bottom:0;left:0;right:0;z-index:50;display:grid;grid-template-columns:repeat(4,1fr);padding:7px 8px calc(6px + env(safe-area-inset-bottom));background:#fff;border-top:1px solid var(--line);box-shadow:0 -5px 22px #2229460d}
  .nav-item{background:transparent;border:0;min-height:52px;color:#959cb1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-size:10px;font-weight:700;padding:5px 2px}
  .nav-item svg{height:22px;width:22px}.nav-item.active{color:var(--primary)}
  .modal{border-radius:23px;padding:22px}.modal::backdrop{background:#171d3fa1}
  .landing,.onboarding{padding:18px;align-items:center}.panel{padding:22px;border-radius:21px}.auth-shell h1{font-size:29px}
  .wall-mode .app-content{display:grid;grid-template-columns:minmax(0,1fr) 300px;overflow-x:auto;min-width:930px}.wall-mode .month-grid{min-width:0}.wall-mode .day{min-height:135px}.wall-mode .event-pill{display:block}.wall-mode .event-dots{display:none}
}
@media(max-width:375px){.brand h1{font-size:16px}.toolbar h2{font-size:21px}.toolbar-actions .square{min-width:30px}.toolbar-actions .quiet{padding:6px}.day{min-height:57px}.day-number{width:29px;height:29px}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*{transition:none!important}}
