/* Calendar surface: week-spanning events and an independent date dialog. */
.note-list-tools{display:flex;gap:8px;flex-wrap:wrap;margin:6px 0}.note-list-tools button{min-height:44px;font-size:14px}.note-checklist label{display:flex;align-items:flex-start;gap:10px;padding:8px 0;overflow-wrap:anywhere}.note-checklist input{flex-shrink:0}.note-checklist input:checked+span{text-decoration:line-through;color:var(--muted)}
/* Keep dialog controls above Android system bars; scroll only the detail body. */
#editor,#calendar-day-dialog{--dialog-top:var(--safe-area-inset-top,env(safe-area-inset-top,0px));--dialog-bottom:var(--safe-area-inset-bottom,env(safe-area-inset-bottom,0px));box-sizing:border-box;max-height:calc(100dvh - var(--dialog-top) - var(--dialog-bottom) - 24px);inset:var(--dialog-top) 0 var(--dialog-bottom);margin:auto;overflow-wrap:anywhere}
#editor.event-detail[open]{display:flex;flex-direction:column;padding:0;overflow:hidden}
#editor.event-detail .dialog-head{position:static;margin:0;padding:16px 20px;flex-shrink:0}
.event-detail-body{min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:18px 20px;overflow-wrap:anywhere}
#editor.event-detail>.dialog-actions{margin:0;padding:12px 20px;flex-shrink:0;border-top:1px solid var(--line);flex-wrap:wrap}
#editor.event-detail>.dialog-actions button{min-height:44px}
#calendar-day-dialog .day-dialog-list{touch-action:pan-y pinch-zoom}
@media(max-width:720px){
 #editor,#calendar-day-dialog{max-height:calc(100dvh - var(--dialog-top) - var(--dialog-bottom) - 24px)!important;max-width:calc(100vw - 24px)}
 #calendar-day-dialog .day-dialog-head{padding:12px 14px}
 #calendar-day-dialog footer{padding:10px 14px}
}
.calendar-layout{grid-template-columns:minmax(0,1fr)}
.calendar-details{display:block}.calendar-details .selected-day{display:none}.calendar-details .calendar-side{padding:14px 18px}.calendar-side summary{cursor:pointer;font-size:14px;font-weight:600}.calendar-side[open] label{display:inline-flex;margin:14px 18px 4px 0}
.span-week{display:grid;grid-template-columns:repeat(var(--cols,7),minmax(0,1fr));grid-template-rows:34px repeat(3,27px) 29px;position:relative;border-bottom:1px solid var(--line);padding-bottom:8px}
.span-day{grid-row:1/-1;border:0;border-right:1px solid var(--line);border-radius:0;background:transparent;display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start;padding:5px 8px;min-width:0}
.span-day>span:first-child{font-size:13px;border-radius:50%;width:25px;height:25px;display:grid;place-items:center}
.span-day.is-selected{background:color-mix(in srgb,var(--blue) 10%,var(--surface))}
.span-day.is-today>span:first-child{background:var(--blue);color:#fff}
.span-day.is-other>span:first-child{opacity:.5}
.span-event{z-index:1;min-width:0;align-self:center;text-align:left;border:0;margin:1px 3px;padding:4px 7px;font-size:12px;height:25px;line-height:17px;border-radius:4px;overflow:hidden}
.span-event span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.span-event.is-all-day{background:var(--color);color:#fff;text-shadow:0 1px 2px #0005}
.span-event.is-timed{background:transparent;color:var(--ink);border-left:4px solid var(--color)}
.calendar-more{z-index:1;align-self:center;text-align:left;min-width:0;border:0;background:transparent;font-size:12px;padding:4px 8px;color:var(--blue);border-radius:5px;white-space:nowrap}
.calendar-more:hover{background:color-mix(in srgb,var(--blue) 12%,var(--surface))}
.mobile-count{display:none}
#calendar-day-dialog{padding:0;width:min(540px,calc(100vw - 24px));max-height:calc(100dvh - 32px);overflow:hidden;border-radius:20px}
#calendar-day-dialog[open]{display:flex;flex-direction:column}
.day-dialog-head{display:flex;justify-content:space-between;align-items:center;padding:20px 22px 14px;gap:10px;flex-shrink:0}
.day-dialog-head h2{margin:0 0 4px;font-size:20px}.day-dialog-head span{font-size:13px;color:var(--muted)}
.day-dialog-head button{font-size:25px;border:0;min-width:44px;min-height:44px;padding:0}
.day-navigation{display:flex;gap:6px;padding:0 20px 14px;border-bottom:1px solid var(--line);flex-shrink:0}
.day-navigation input{min-width:0;flex:1;width:0;padding:8px;font-size:14px}.day-navigation button{font-size:12px;padding:8px;white-space:nowrap}
.day-dialog-list{overflow-y:auto;min-height:0;padding:0 20px 16px;overscroll-behavior:contain}
.day-group h3{font-size:13px;margin:18px 0 10px;color:var(--muted)}
.day-entry{display:block;width:100%;text-align:left;margin:8px 0;padding:14px;border:0;border-left:4px solid var(--color);border-radius:10px;color:var(--ink)}
.day-entry strong{display:block;font-size:16px;line-height:1.5;overflow-wrap:anywhere}.day-entry small{display:block;margin-top:6px;color:var(--muted)}
.all-day-entry{background:color-mix(in srgb,var(--color) 17%,var(--surface))}.timed-entry{background:var(--surface);border-radius:3px}
#calendar-day-dialog footer{padding:14px 20px;border-top:1px solid var(--line);flex-shrink:0}#calendar-day-dialog footer button{width:100%;min-height:44px}
@media(min-width:721px){.calendar-toolbar{position:sticky;top:var(--topbar-height,79px);left:auto;right:auto;padding:10px 0;width:100%;z-index:12}.content>.heading{position:static}.main{overflow:visible}.content{overflow:visible}}

/* Readable calendar controls and dates */
.calendar-toolbar button,.calendar-toolbar strong{font-size:16px!important;min-height:44px}
.calendar-grid .weekday{font-size:15px!important;font-weight:700}
.calendar-grid .day-cell,.calendar-grid .day-cell button{font-size:16px!important}
.live-clock{font-size:16px!important;font-weight:700}
.time-entry input[type=number]{appearance:auto;-moz-appearance:auto;min-width:58px;font-size:18px;height:44px}
.calendar-toolbar .calendar-info{font-size:14px;color:#38527e;padding:10px 14px;border:1px solid #b8c8df;border-radius:10px;background:#eef4fc}
@media(max-width:720px){.live-clock{font-size:18px!important}.calendar-toolbar{gap:6px}.calendar-toolbar .calendar-info{display:block;width:100%;text-align:center}.calendar-toolbar button{font-size:15px!important}.calendar-grid .day-cell{font-size:17px!important}}
@media(max-width:720px){
 .calendar-toolbar{position:relative!important;inset:auto!important;padding:6px 0!important;width:100%!important}
 .span-week{grid-template-rows:30px 36px;min-height:68px;padding:0}.span-day{padding:4px;align-items:center}.span-day .mobile-count{display:block;font-size:11px;color:var(--blue);margin-top:5px}
 .span-event,.span-week .calendar-more{display:none}
 .calendar-layout{display:block}.calendar-layout>.panel{width:100%}.calendar-grid .weekday{font-size:12px}
 #calendar-day-dialog{width:calc(100vw - 24px);max-height:calc(100dvh - 36px)}.day-dialog-head{padding:16px}.day-dialog-head h2{font-size:18px}.day-navigation{padding:0 14px 12px}.day-dialog-list{padding:0 14px 12px}.day-entry strong{font-size:16px}
}

.calendar-toolbar .calendar-info{flex:0 1 auto;min-width:220px;white-space:nowrap;writing-mode:horizontal-tb!important;display:inline-block!important}@media(max-width:720px){.calendar-toolbar .calendar-info{width:100%;min-width:0;white-space:normal;text-align:center}}


.calendar-legend{display:flex;flex-wrap:wrap;gap:10px 14px;align-items:center;padding:12px 14px;border-top:1px solid #d8e1ef;border-bottom:1px solid #d8e1ef;color:#30486d;font-size:14px;font-weight:600;background:#f7faff}.calendar-legend span{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}.calendar-legend .dot{width:10px;height:10px;border-radius:50%;background:var(--color);display:inline-block}@media(max-width:720px){.calendar-legend{gap:8px 12px;font-size:13px;padding:10px 8px}}


@media(max-width:720px){.span-week{grid-template-rows:30px repeat(3,30px) 28px;min-height:150px;padding-bottom:4px}.span-event{display:block;font-size:11px;height:26px;padding:3px 4px;margin:1px 2px}.span-week .calendar-more{display:block;font-size:11px}.span-day{align-items:flex-start;padding:4px 3px}.span-day>span:first-child{font-size:15px}.span-day .mobile-count{display:none}}

.content:has(.calendar-heading){padding-top:16px;max-width:none}
.calendar-heading{display:flex;align-items:center;gap:18px;flex-wrap:wrap;margin:0 0 14px}
.calendar-heading h1{margin:0;font-size:26px;flex-shrink:0}
.calendar-account{margin-left:auto;display:flex;flex-direction:column;gap:4px;font-size:12px;overflow-wrap:anywhere}
.calendar-backup{position:relative;font-size:13px}
.calendar-backup summary{cursor:pointer;white-space:nowrap}
.calendar-backup[open]{max-width:330px}
.calendar-backup p{margin:10px 0}
.content .calendar-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;position:sticky;top:var(--topbar-height);left:auto;right:auto;width:100%;padding:8px 0;margin:0 0 12px;z-index:12;background:var(--bg);box-shadow:none}
.calendar-period,.calendar-actions{display:flex;align-items:center;gap:6px;min-width:0}
.calendar-period strong{display:flex;align-items:center;justify-content:center;white-space:nowrap;margin:0;line-height:1.2;min-width:118px}
.calendar-actions{flex-wrap:wrap}
.calendar-toolbar .calendar-sync-line{width:100%;margin:0;font-size:12px;color:var(--muted);line-height:1.5;min-height:18px}
.calendar-toolbar .calendar-legend{display:flex;flex-flow:row wrap;align-items:center;gap:4px 12px;width:100%;min-width:0;padding:6px 0;background:transparent;border:0}
.calendar-toolbar .calendar-legend button{display:inline-flex;align-items:center;gap:6px;flex:0 0 auto;white-space:nowrap;writing-mode:horizontal-tb;border:0;background:transparent;font-size:12px!important;min-height:28px;padding:3px 0}
.calendar-legend button[aria-pressed=false]{opacity:.4;text-decoration:line-through}
.event-times{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.event-times[hidden]{display:none}
.event-times label{display:grid;gap:8px}
.event-times input{min-width:0;font-size:18px}
.all-day-toggle{display:flex;gap:10px;align-items:center;font-size:16px}
#task-form .dialog-actions{flex-wrap:wrap}
#task-form .dialog-actions small{flex-basis:100%;text-align:right}
@media(max-width:720px){
 .content:has(.calendar-heading){padding:12px 8px 100px}
 .calendar-heading{gap:6px;margin:0 0 10px}
 .calendar-heading h1{font-size:22px}
 .calendar-account{flex:1;min-width:0;font-size:11px;display:flex;flex-direction:row;align-items:center;gap:6px;white-space:nowrap}
 .calendar-account small{font-size:10px}
 .calendar-backup{margin-left:auto;font-size:11px}
 .content .calendar-toolbar{display:flex;flex-direction:column;align-items:stretch;gap:6px;padding:0!important;margin:0 0 8px}
 .calendar-period{display:grid;grid-template-columns:36px minmax(0,1fr) 36px 50px;width:100%}
 .calendar-period strong{min-width:0}
 .calendar-period button,.calendar-actions>button{padding:6px;font-size:12px!important;min-height:36px}
 .calendar-actions{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px}
 .calendar-actions .segmented{flex:1}
 .calendar-actions .segmented button{flex:1;min-height:32px;font-size:13px!important;padding:5px 10px;white-space:nowrap}
 .calendar-actions [data-action=google-open]{flex:1}
 .calendar-actions [data-action=sync-now]{flex:0 0 auto;white-space:nowrap}
 .calendar-toolbar .calendar-legend{flex-wrap:nowrap;overflow-x:auto;padding:4px 0;gap:12px}
 .span-week{grid-template-rows:28px repeat(3,23px) 26px;min-height:130px}
 .span-event{font-size:11px!important;height:21px;padding:2px 3px;margin:1px;line-height:17px}
 .span-day{padding:3px 2px}
 .calendar-more{font-size:12px;padding:3px 4px;overflow:hidden}
 .calendar-more .more-label{display:none}
 .calendar-side{display:block}
}
.color-mode-controls{display:flex;align-items:center;gap:10px}
.color-mode-controls select{flex:1;min-width:0}
.color-mode-controls input[type=color]{flex:0 0 44px;opacity:1}
.reminder-calculator{display:grid;gap:12px}
.reminder-row{display:grid;grid-template-columns:85px minmax(0,1fr);align-items:center;gap:12px;font-size:14px}
.reminder-row>select,.reminder-row>input{width:100%;max-width:180px}
.reminder-row .time-entry{margin:0;min-width:0}
.reminder-hint{margin-left:97px;line-height:1.6}
.editor-top-actions{display:flex;gap:6px;margin-left:auto;align-items:center}
#editor .dialog-head .editor-top-actions button{font-size:14px;padding:8px 12px;min-height:38px;border:1px solid var(--line);border-radius:8px}
#editor .dialog-head{gap:10px}
.priority-badge{display:inline-flex;align-items:center;gap:4px;white-space:nowrap;font-size:12px;font-weight:600}
.priority-badge .icon{width:20px;height:20px}
.priority-badge.priority-high{color:#d32f45}
.priority-badge.priority-medium{color:#a96400}
.priority-badge.priority-low{color:#3479b6}
.priority-badge .icon{fill:currentColor;fill-opacity:.15}
.span-day:nth-child(7n+1)>span:first-child,.span-day.is-holiday>span:first-child{color:#d23d52}
.span-day[data-date="2026-09-24"]>span:first-child,.span-day[data-date="2026-09-25"]>span:first-child,.span-day[data-date="2026-09-26"]>span:first-child{color:#d23d52}
@media(max-width:720px){
 #editor .dialog-head h2{font-size:17px;white-space:nowrap}
 #editor .dialog-head .editor-top-actions button{font-size:12px;padding:6px;min-height:36px}
 #editor .dialog-head{gap:4px}
 .editor-top-actions{gap:4px}
 .reminder-row{grid-template-columns:64px minmax(0,1fr);gap:8px;font-size:12px}
 .reminder-hint{margin-left:72px;font-size:11px}
 .reminder-row .time-entry{gap:3px;flex-wrap:nowrap}
 .reminder-row .time-entry select{width:61px;min-width:0;padding:7px 2px}
 .reminder-row .time-entry input{width:42px;min-width:0;padding:7px 2px}
 .priority-badge{font-size:11px}
}

@media(max-width:720px){.reminder-row .reminder-actions{display:flex;gap:4px;min-width:0}.reminder-row .reminder-actions input{width:48px;max-width:48px}.reminder-row .reminder-actions button{font-size:11px;padding:6px 5px}.calendar-layout{overflow-x:hidden}.calendar-grid,.calendar-layout .panel{max-width:100%;overflow:hidden}}
.calendar-layout{touch-action:pan-y;overscroll-behavior-x:contain}
/* Capacitor supplies these CSS variables when Android draws edge-to-edge. */
@media(max-width:720px){
 .topbar{padding-top:calc(10px + var(--safe-area-inset-top,env(safe-area-inset-top,0px)))!important;height:auto!important}
 .mobile-nav{height:calc(76px + var(--safe-area-inset-bottom,env(safe-area-inset-bottom,0px)))!important;padding-bottom:calc(6px + var(--safe-area-inset-bottom,env(safe-area-inset-bottom,0px)))!important;align-items:stretch}
 .content,.content:has(.calendar-heading){padding-bottom:calc(110px + var(--safe-area-inset-bottom,env(safe-area-inset-bottom,0px)))!important}
 .calendar-heading{display:flex;flex-wrap:wrap;align-items:flex-start}
 .calendar-heading h1{width:100%;margin-bottom:4px}
 .calendar-account{flex:1 1 100%;flex-direction:column;align-items:flex-start;white-space:normal;overflow-wrap:anywhere;line-height:1.6}
 .calendar-account span,.calendar-account small{max-width:100%}
 .calendar-backup{margin-left:0}
 .calendar-legend{max-width:100%;flex-wrap:wrap!important;overflow-wrap:anywhere}
 .top-actions .live-clock{font-size:13px!important;min-width:0}
 .mobile-nav button{min-width:0;flex:1;padding-left:3px;padding-right:3px}
 #toast,.update-banner{bottom:calc(84px + var(--safe-area-inset-bottom,env(safe-area-inset-bottom,0px)))}
}

/* Korean date annotations occupy their own row above personal events. */
.span-week{grid-template-rows:78px repeat(3,27px) 29px}
.lunar-date{font-size:11px;color:var(--muted);line-height:19px;white-space:nowrap}
.holiday-label{font-size:11px;color:#be3346;line-height:18px;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;min-height:18px}
.span-day.is-holiday>span:first-child,.span-day.is-sunday>span:first-child{color:#be3346}
.span-day.is-saturday:not(.is-holiday)>span:first-child{color:#315fe9}
.span-day.is-today>span:first-child{color:#fff}
.calendar-source-note{font-size:12px;color:var(--muted);padding:12px 16px;margin:0;line-height:1.7}
.agenda-day small{display:inline-block;font-weight:400;margin-left:8px}
.daily-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:20px 24px;border-bottom:1px solid var(--line)}
.daily-heading h2{font-size:20px;margin:0}.daily-heading p{font-size:13px;color:var(--muted);margin:8px 0 0}
.daily-heading button{white-space:nowrap}
.daily-all-day{display:grid;grid-template-columns:68px minmax(0,1fr);padding:14px 12px;gap:8px;border-bottom:1px solid var(--line);font-size:13px}
.daily-all-day>span{color:var(--muted);text-align:center;padding-top:7px}
.daily-all-event{display:block;width:100%;text-align:left;background:var(--color);color:#fff;border:0;margin:3px 0;padding:7px 12px;overflow-wrap:anywhere}
.daily-scroll{height:600px;max-height:65vh;overflow-y:auto;overscroll-behavior:contain;position:relative}
.daily-timeline{position:relative;height:1440px;margin:14px 12px 18px 80px}
.daily-hour{position:absolute;width:100%;height:60px;border-top:1px solid var(--line)}
.daily-hour>span{position:absolute;right:calc(100% + 12px);top:-9px;font-size:12px;color:var(--muted)}
.daily-slot{position:absolute;inset:0;width:100%;border:0;border-radius:0;background:transparent;padding:0}
.daily-slot:hover{background:color-mix(in srgb,var(--blue) 7%,transparent)}
.daily-events{position:absolute;inset:0;pointer-events:none}
.daily-event{position:absolute;pointer-events:auto;z-index:2;min-width:0;text-align:left;border:0;border-left:4px solid var(--color);background:color-mix(in srgb,var(--color) 20%,var(--surface));color:var(--ink);padding:2px 7px;overflow:hidden;border-radius:5px;line-height:1.3}
.daily-event strong,.daily-event small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}
.daily-event small{font-size:11px;margin-top:3px}
.daily-now{position:absolute;left:0;right:0;border-top:2px solid #e34343;z-index:3;pointer-events:none}
.daily-now:before{content:'';position:absolute;left:-5px;top:-5px;width:8px;height:8px;border-radius:50%;background:#e34343}
.day-date-meta{font-size:12px;color:var(--muted);margin:6px 0}.day-dialog-head h2{line-height:1.3}
#calendar-day-dialog footer{display:flex;gap:8px}#calendar-day-dialog footer button{width:auto;flex:1;font-size:13px}
@media(max-width:720px){
 .span-week{grid-template-rows:74px repeat(3,30px) 28px}
 .lunar-date,.holiday-label{font-size:10px;line-height:18px}
 .daily-heading{padding:15px 12px}.daily-heading h2{font-size:16px}.daily-heading button{font-size:12px;padding:8px}
 .daily-all-day{grid-template-columns:44px minmax(0,1fr)}.daily-timeline{margin-left:58px;margin-right:6px}
 .daily-hour>span{right:calc(100% + 8px);font-size:11px}.daily-event{padding:2px 4px}
}
.event-times .time-entry{display:flex;flex-wrap:nowrap;gap:4px;min-width:0}
.event-times .time-entry select{min-width:64px;width:68px;padding:8px 4px}
.event-times .time-entry input[type=number]{min-width:0;width:54px;padding:8px 4px;font-size:16px}
@media(max-width:600px){.event-times{grid-template-columns:1fr}}
/* Month view occupies the available viewport, independent of event counts. */
@media(min-width:0px){
 body.month-fit{height:100dvh;overflow:hidden}
 .month-fit .shell{height:100dvh;min-height:0}
 .month-fit .main{height:100dvh;min-height:0;display:flex;flex-direction:column;overflow:hidden}
 .month-fit .topbar{position:relative;flex-shrink:0}
 .month-fit .content{flex:1;min-height:0;display:flex;flex-direction:column;padding:8px 16px!important;margin:0;max-width:none;width:100%;overflow:hidden}
 .month-fit .content>.calendar-toolbar{position:relative;top:auto;flex-shrink:0;flex-wrap:nowrap;gap:8px;padding:0 0 8px;margin:0;z-index:30}
 .month-fit .calendar-period,.month-fit .calendar-actions{flex-shrink:0;gap:4px}
 .month-fit .calendar-toolbar button,.month-fit .calendar-toolbar strong{font-size:13px!important;min-height:36px;padding:7px 9px}
 .month-fit .calendar-layout{flex:1;min-height:0;display:flex}
 .month-fit .calendar-layout>.panel{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;margin:0}
 .month-fit .calendar-grid{flex-shrink:0}
 .month-fit .calendar-grid .weekday{padding:5px;height:28px;font-size:12px}
 .month-fit .span-month{flex:1;min-height:0;display:flex;flex-direction:column}
 .month-fit .span-week{flex:1;min-height:0;padding:0;grid-template-rows:34px repeat(var(--visible-lanes,3),24px) 22px;overflow:hidden}
 .month-fit .span-day{display:block;position:relative;text-align:left;padding:2px 5px}
 .month-fit .span-day>span:first-child{display:inline-grid;width:22px;height:22px;font-size:12px}
 .month-fit .span-day .lunar-date{display:inline;margin-left:4px;font-size:10px}
 .month-fit .span-day .holiday-label{display:block;position:absolute;top:22px;left:5px;right:3px;font-size:10px;line-height:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .month-fit .span-event{height:22px;font-size:12px;line-height:18px;padding:1px 5px;margin:1px 2px}
 .month-fit .calendar-more{height:22px;padding:1px 5px;font-size:11px}
 .month-fit .calendar-source-note{flex-shrink:0;font-size:10px;line-height:16px;padding:0 8px;margin:0;height:16px;white-space:nowrap;overflow:hidden}
 .month-options{margin-left:auto;flex-shrink:0;font-size:13px}
 .month-options>summary{cursor:pointer;white-space:nowrap;padding:8px;border:1px solid var(--line);border-radius:8px}
 .month-options-body{position:absolute;right:0;top:42px;width:min(600px,80vw);max-height:70dvh;overflow:auto;padding:16px;background:var(--surface);border:1px solid var(--line);border-radius:12px;box-shadow:0 8px 30px #0002}
 .month-options-body .calendar-heading h1{font-size:18px}
 .month-options-body .calendar-legend{flex-wrap:wrap}
 .month-options-body .calendar-details{display:block}
}
@media(min-width:721px) and (max-width:1150px){
 .month-fit .sidebar{width:190px;padding:16px 8px}.month-fit .shell{grid-template-columns:190px 1fr}
 .month-fit .calendar-actions>button{display:none}
 .month-fit .month-options-body .calendar-actions>button{display:inline-block}
}
@media(min-width:0px){
 .month-fit .span-week{grid-template-rows:34px repeat(var(--visible-lanes,3),24px) minmax(22px,1fr)}
 .month-fit .span-day>span:first-child{position:absolute;top:2px;left:5px}
 .month-fit .span-day .lunar-date{position:absolute;top:7px;left:30px;margin:0;line-height:14px}
 .month-fit .calendar-more{align-self:start}
}
@media(min-width:0px){
 .month-fit .month-legend{display:flex;flex:0 0 auto;gap:4px 12px;align-items:center;flex-wrap:nowrap;overflow-x:auto;min-height:30px;margin:0 0 4px;padding:0 2px}
 .month-fit .month-legend button{display:inline-flex;align-items:center;gap:5px;white-space:nowrap;flex-shrink:0;border:0;background:transparent;padding:4px 0;font-size:12px;min-height:26px}
 .month-fit .month-legend button[aria-pressed=false]{opacity:.45;text-decoration:line-through}
}
/* Mobile full-month layout with Android system insets. */
@media(max-width:720px){
 body.month-fit{--month-nav:calc(64px + var(--safe-area-inset-bottom,env(safe-area-inset-bottom,0px)))}
 .month-fit .main{padding-bottom:var(--month-nav)}
 .month-fit .topbar{min-height:0!important;display:flex!important;flex-wrap:nowrap!important;padding:calc(6px + var(--safe-area-inset-top,env(safe-area-inset-top,0px))) 10px 6px!important;gap:8px}
 .month-fit .topbar .search,.month-fit .topbar .live-clock,.month-fit .topbar .connection{display:none!important}
 .month-fit .top-actions{margin-left:auto;gap:4px}
 .month-fit .content{padding:6px!important;padding-bottom:0!important}
 .month-fit .content>.calendar-toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px;padding:0 0 4px}
 .month-fit .calendar-period{grid-column:1/-1;grid-template-columns:34px minmax(0,1fr) 34px 48px}
 .month-fit .calendar-actions{width:auto;display:flex}
 .month-fit .calendar-actions>.segmented{width:100%}
 .month-fit .calendar-toolbar button{min-height:34px;padding:5px 8px}
 .month-fit .month-options{margin:0;font-size:12px}
 .month-fit .month-options>summary{padding:8px 5px}
 .month-fit .month-options-body{top:100%;width:calc(100vw - 12px);max-height:65dvh;z-index:45}
 .month-fit .month-options-body .calendar-actions{flex-wrap:wrap}
 .month-fit .month-options-body .month-legend{flex-wrap:wrap!important;height:auto}
 .month-fit .span-day{padding:2px}
 .month-fit .span-day>span:first-child{left:2px;font-size:12px}
 .month-fit .span-day .lunar-date{left:24px;top:7px;font-size:8px}
 .month-fit .span-day .holiday-label{left:2px;font-size:9px}
 .month-fit .span-event{font-size:10px;padding:1px 2px}
 .month-fit .calendar-more{font-size:10px;padding:1px 2px;min-width:0;overflow:hidden;white-space:nowrap}
 .month-fit .calendar-source-note{font-size:8px;padding:0 3px}
 .month-fit .mobile-nav{height:var(--month-nav)!important}
}
@media(max-width:720px){.month-fit .top-actions{width:auto;flex:0 0 auto}.month-fit .mobile-home{flex-shrink:0}}
