/* Load after seasonal.css. Calendar viewport fit and readable typography. */
.calendar-panel .event{font-size:clamp(13px,1.25vw,25px);font-weight:700;line-height:1.25;min-width:0;max-width:100%}
.calendar-panel .num,.calendar-panel .day.today .num{font-size:clamp(18px,1.65vw,32px);font-weight:800;line-height:1.1}
.calendar-panel .weekdays div{font-size:clamp(12px,1vw,20px);font-weight:800}
.calendar-panel .more-events{font-size:clamp(12px,1vw,20px);font-weight:650}
.calendar-panel .cal-head h2{font-weight:700}
@media (min-width:700px) and (orientation:landscape){
 body,body.tv-view{height:100vh;height:100dvh;min-height:0;overflow:hidden;padding:1vh 1vw}
 header{padding:4px 10px;gap:10px;min-height:0}
 header h1,.tv-view h1{font-size:clamp(25px,2.5vw,48px)}
 header .brand-kicker{display:none}
 header .family-motto{margin-top:3px;font-size:clamp(12px,1vw,20px)}
 .season-art{height:48px}.season-art svg{height:34px}
 main,.tv-view main{flex:1 1 0;min-height:0;max-width:none;width:100%;margin:0;grid-template-columns:minmax(0,1.9fr) minmax(230px,.8fr);grid-template-rows:minmax(0,1fr);padding:4px 6px;gap:9px}
 .calendar-panel{height:100%;min-height:0;padding:8px;overflow:hidden}
 .cal-head{flex:none;padding:3px 6px;flex-wrap:nowrap}
 .cal-head .actions{flex-wrap:nowrap;width:auto}
 .cal-head button{padding:5px 9px}
 .weekdays{flex:none;margin-top:4px;padding-bottom:0}
 .weekdays div{padding:3px 0}
 .days{flex:1 1 0;min-height:0;gap:4px}
 .day{min-height:0;min-width:0;padding:4px;overflow:hidden}
 .day .event{margin-top:3px;padding:2px 3px}
 #note{flex:none;font-size:11px;margin:4px 0 0;line-height:1.15}
 .side{min-height:0;overflow:auto;display:flex;flex-direction:column;gap:8px}
 .side>.panel{flex:none}.side .photo-panel{flex:1 0 100px}.side .photo{min-height:40px}
 .footer{flex:none;padding:3px 8px;gap:5px;flex-wrap:wrap}
 .footer,.hub-tools,.hub-tools button{font-size:11px}
 .hub-tools{gap:5px}.hub-tools a,.hub-tools button{padding:3px 5px}
}
@media(max-width:699px){
 body{height:auto;min-height:100vh;min-height:100dvh;overflow:auto}
 main{width:100%;min-width:0;grid-template-columns:minmax(0,1fr)}
 .calendar-panel{min-height:0;height:72vh;height:72svh;min-width:0}
 .calendar-panel .days{flex:1 1 0;min-height:0;gap:2px}
 .calendar-panel .day{min-height:0;padding:3px;min-width:0}
 .calendar-panel .event{font-size:12px;font-weight:700;padding:2px;white-space:nowrap}
 .calendar-panel .num,.calendar-panel .day.today .num{font-size:17px}
 .calendar-panel .weekdays div{font-size:10px;letter-spacing:0}
 .calendar-panel .more-events{font-size:11px}
 header .family-brand{flex-shrink:1;min-width:0}
}
/* Keep overflow counts beside the date instead of clipping the event below it. */
.calendar-panel .day{position:relative}
.calendar-panel .more-events{position:absolute;top:4px;right:4px;margin:0}
.calendar-panel .day.today .num{width:1.2em;height:1.2em;line-height:1.2}
@media(min-width:700px) and (orientation:landscape) and (max-height:600px){
 .calendar-panel .day{padding:2px}
 .calendar-panel .event{line-height:1.1;padding:1px 2px;margin-top:2px}
 .calendar-panel .more-events{font-size:11px;top:3px;right:3px}
}
@media(max-width:699px){.calendar-panel .more-events{font-size:10px;top:3px;right:2px}}

/* Preserve the full dashboard beside the calendar on landscape TVs. */
@media(min-width:700px) and (orientation:landscape){
 main,.tv-view main{display:grid;grid-template-columns:minmax(0,1.9fr) minmax(230px,.9fr);overflow:visible}
 .side{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1.35fr) minmax(0,1fr) auto;overflow:hidden;gap:6px}
 .side>.panel{min-height:0;padding:7px;overflow:auto}
 .side .photo-panel{display:flex;flex-direction:column;overflow:hidden}
 .side .photo{height:0;flex:1;min-height:0}
 .side h3{font-size:18px;margin:0 0 4px}
 .side .widget{padding:5px}.side .widget strong{font-size:10px;margin-bottom:2px}.side .widget span{font-size:12px}
 .side .widgets{gap:5px}.side .agenda{margin-bottom:4px}.side .agenda-item{font-size:12px;padding:4px 6px;margin-bottom:3px}
 .side .photo-panel small{display:none}.side .photo-caption{font-size:11px;margin-top:3px}.side .photo-caption button{padding:3px 7px}
 .side .preferences-panel .actions{display:flex;flex-wrap:nowrap;gap:4px}
 .side .preferences-panel select{width:100%;min-width:0;flex:1;font-size:11px;padding:4px}
 .side .preferences-panel button{font-size:11px;padding:4px;flex:none}
 .side #addBirthday{margin-top:3px;font-size:11px}
 .calendar-panel .event{font-size:clamp(13px,1.25vw,25px)}
 .calendar-panel .more-events{font-size:10px}
 .day:focus-visible{outline:3px solid var(--accent);outline-offset:-3px;box-shadow:inset 0 0 0 3px var(--accent)}
}
#pageQr{text-align:center;width:min(92vw,420px)}#pageQr img{display:block;width:min(240px,65vw);height:auto;margin:16px auto;background:white}#pageQr a{color:var(--accent);font-weight:700}
dialog.hub-dialog-fallback[open]{position:fixed;z-index:10000;inset:5vh 0 auto;margin:auto;max-height:90vh;overflow:auto;box-shadow:0 0 0 100vmax #0009}
@media(min-width:700px) and (max-height:650px) and (orientation:landscape){
 header{padding-top:4px;padding-bottom:4px}
 .side{grid-template-rows:minmax(0,2.6fr) minmax(75px,1fr) auto}
 .side .widget span{font-size:11px;line-height:1.2}
 .side .widget{padding:4px}
 .side .agenda-item{font-size:11px;padding:3px 5px;margin-bottom:2px}
 .side h3{font-size:16px}
}
@media(min-width:700px) and (max-height:650px) and (orientation:landscape){
 .side .weather-footer{margin-top:0;gap:3px;flex-wrap:nowrap}
 .side .weather-footer small{display:none}
 .side .weather-footer a{font-size:8px}
 .side #refreshWeather{padding:0 3px;font-size:12px}
 .side #weatherDetails{font-size:9px;line-height:1.15;margin:2px 0}
 .side .widget strong{font-size:9px;line-height:1.15}
 .side .widget span{display:block;font-size:10px;line-height:1.15}
 .side #addBirthday{font-size:10px;padding:0}
}

/* Keep controls in the footer and devote the sidebar to daily info and photos. */
.footer .hub-tools{display:flex;flex-wrap:wrap;align-items:center;gap:5px;opacity:1}
.footer #theme{font-size:11px;max-width:195px;padding:3px 5px;border-radius:6px}
.footer #settings{white-space:nowrap}
@media(min-width:700px) and (orientation:landscape){
 body header{padding:2px 10px;gap:10px}
 header h1,.tv-view header h1{font-size:clamp(24px,2.2vw,40px)}
 header .family-motto{font-size:clamp(10px,.85vw,15px);margin:2px 0 0}
 header .season-art{height:54px;max-width:600px}
 header .season-art svg{height:54px;opacity:1}
 header .season-art span{display:none}
 header .clock{font-size:clamp(18px,1.7vw,28px)}
 header .clock small{font-size:11px}
 .side{grid-template-rows:auto minmax(0,1fr)}
 .side .today-panel{padding:6px 7px;max-height:none;overflow:visible}
 .side .photo-panel{min-height:0}
 .side .photo{min-height:0;height:0;object-fit:cover}
 .side h3{font-size:17px}
 .side .agenda-item{padding:3px 6px;margin-bottom:2px}
 .side .widget{padding:4px}
 .side .widget strong{margin-bottom:1px}
 .footer{display:flex;align-items:center;justify-content:space-between;gap:4px 10px;padding:3px 8px}
 .footer .legend{font-size:10px;gap:7px}
 .footer .hub-tools{font-size:10px;justify-content:flex-end}
 .footer .hub-tools a,.footer .hub-tools button,.footer #theme{font-size:10px;padding:3px 5px}
}
@media(max-width:699px){
 body header{padding:8px 12px}
 header .brand-kicker{display:none}
 .footer{gap:8px;padding:8px 12px}
 .footer .hub-tools{justify-content:flex-start}
 .footer .hub-tools button,.footer .hub-tools a,.footer #theme{min-height:32px}
}

@media(min-width:700px) and (orientation:landscape){.footer .hub-tools{width:100%;gap:4px;justify-content:flex-start}.footer #theme{max-width:165px}.footer #authStatus{margin-right:8px}}
@media(min-width:700px) and (orientation:landscape){.footer .legend{max-width:none;width:100%}}

/* Slightly calmer calendar type; keep the stronger weight for readability. */
.calendar-panel .event{font-size:clamp(12px,1.15vw,23px)}
.calendar-panel .num,.calendar-panel .day.today .num{font-size:clamp(17px,1.5vw,29px)}
.calendar-panel .weekdays div{font-size:clamp(11px,.92vw,18px)}
@media(max-width:699px){.calendar-panel .event{font-size:11px}.calendar-panel .num,.calendar-panel .day.today .num{font-size:16px}.calendar-panel .weekdays div{font-size:10px}}
header{position:relative;isolation:isolate}
header>.family-brand,header>.header-right,header>.season-art{position:relative;z-index:1}
header>.holiday-lights{position:absolute;inset:0;z-index:0;pointer-events:none;overflow:hidden;opacity:.8}
.holiday-lights svg{width:100%;height:100%;display:block;overflow:visible}
.twinkle-bulb{animation:bulb-twinkle 5s ease-in-out infinite;filter:drop-shadow(0 0 4px currentColor)}
@keyframes bulb-twinkle{0%,100%{opacity:.45;filter:drop-shadow(0 0 2px currentColor)}50%{opacity:1;filter:drop-shadow(0 0 7px currentColor)}}
@media(prefers-reduced-motion:reduce){.twinkle-bulb{animation:none;opacity:.8}}

/* Keep QR and pairing code together, including small TV browser viewports. */
#tvDialog{width:min(94vw,760px);max-height:94vh;max-height:94dvh;padding:18px 22px}
#tvDialog h2{font-size:24px;margin:0 0 12px}
.tv-setup-grid{display:grid;grid-template-columns:220px minmax(0,1fr);gap:22px;align-items:center}
#tvDialog .tv-qr img{width:220px;height:220px;max-width:100%;margin:0 auto 6px;background:white}
#tvDialog .tv-qr strong{display:block;font-size:14px}#tvDialog .tv-qr small{display:block;margin-top:3px;font-size:12px}
#tvDialog ol{font-size:16px;line-height:1.35;margin:0 0 12px;padding-left:20px}
#tvDialog li{margin-bottom:8px}
#tvDialog .tv-code-label{font-size:11px;font-weight:700;letter-spacing:.12em;text-align:center;margin:8px 0 3px}
#tvDialog #tvCode{font-size:30px;font-weight:750;letter-spacing:.15em;text-align:center;margin:0 0 8px;overflow-wrap:anywhere}
#tvDialog .tv-setup-note{font-size:13px;line-height:1.35;margin:0}
#tvDialog>.actions{margin-top:14px;gap:7px}
#tvDialog>.actions button{font-size:14px;padding:8px 12px}
@media(max-width:560px){#tvDialog{padding:16px}.tv-setup-grid{grid-template-columns:1fr;gap:12px}#tvDialog .tv-qr img{width:180px;height:180px}#tvDialog h2{font-size:21px}#tvDialog ol{font-size:14px}#tvDialog>.actions button{font-size:12px;padding:8px}}
