/* Calendar owns the width; details never squeeze the month. */
@media(max-width:900px){.overview-layout .calendar-head #memo-density{font-size:10px;padding:2px 6px;min-height:30px;white-space:nowrap;flex-shrink:0}.overview-layout .calendar-footer{display:none}.overview-layout .day-num{align-self:flex-start!important}}
.day.weekend-day,.day.holiday-day{background:#53678312!important}.day.weekend-day.selected,.day.holiday-day.selected{background:#53678320!important;outline:2px solid #7289d4;outline-offset:-2px}
.day-memo[data-color=blue]{color:#263e88;background:#d8e4ff}.day-memo[data-color=green]{color:#215941;background:#dceee2}.day-memo[data-color=purple]{color:#623a8a;background:#e8dcf7;opacity:1}
.task-row.done,.task-row.done .task-name{color:#623a8a;background:#eee5f8}.done .check-circle{background:#e5d5f4;border-color:#b693d4;color:#623a8a}.done-count{color:#623a8a;background:#e8dcf7;border-radius:4px;padding:0 2px}.status-preview{padding:4px 9px;border-left:4px solid var(--task-color);background:#fff9;border-radius:6px;font-size:12px}.done-toggle{color:#623a8a}
main.calendar-overview{max-width:none;padding:14px 18px 28px}
.calendar-overview .page-title{margin:0 0 10px;align-items:center}
.calendar-overview .page-title .eyebrow,.calendar-overview .page-title .sub{display:none}
.calendar-overview h1{font-size:23px}
.overview-layout{display:block!important}
.overview-layout .calendar-panel{position:static;width:100%;padding:12px;display:grid;grid-template-columns:1fr 1fr;gap:6px 16px;border-radius:20px}
.overview-layout .calendar-view-bar{margin:0;grid-column:2;grid-row:1;justify-content:flex-end}
.overview-layout .calendar-head{margin:0;grid-column:1;grid-row:1;padding:0;gap:10px}
.overview-layout .month-name small{display:none}
.overview-layout .weekdays,.overview-layout .month-grid,.overview-layout .calendar-footer,.overview-layout .holiday-footnote{grid-column:1/-1}
.overview-layout .weekdays{padding:6px 0 1px}
.overview-layout .month-grid{gap:3px}
.overview-layout .day{padding:4px;gap:2px;min-height:70px;border-radius:8px}
.overview-layout .day-num{height:22px;width:24px;font-size:12px}
.overview-layout .day-memos{gap:2px}
.overview-layout .day-memo{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;white-space:normal;overflow-wrap:anywhere;line-height:1.35;font-size:13px;padding:2px 3px;letter-spacing:-.3px}
.overview-layout .memo-number{display:none}
.overview-layout .all-memos .day-memo{-webkit-line-clamp:unset}
.overview-layout .holiday-label{white-space:normal;line-height:1.3;font-size:11px}
.overview-layout .calendar-footer{margin:3px 0 0;padding:5px 0 0;justify-content:space-between}
.overview-layout .holiday-footnote{margin:0;font-size:9px}
.overview-layout .collapse-month{display:none}
#day-details{width:min(540px,calc(100vw - 24px));max-width:none;max-height:88dvh;padding:12px;border:1px solid #ffffffc9;border-radius:24px;overflow:auto}
#day-details::backdrop{background:#23335a45;backdrop-filter:blur(3px)}
#day-details .day-panel{border:0;box-shadow:none;min-height:0;margin-top:8px;padding:14px}
#close-day{display:block;margin-left:auto;min-height:40px}
@media(max-width:900px){
 body:has(.calendar-overview) .topbar{height:36px}main.calendar-overview{padding-top:3px!important}.calendar-overview .page-title{display:none}.overview-layout .calendar-panel{padding-top:4px!important;gap:2px 6px!important}.overview-layout .weekdays{padding:2px 0!important}.overview-layout .day-num{height:18px!important;width:20px!important;font-size:11px!important}.overview-layout .day{gap:1px!important;padding:2px!important}.overview-layout .day-memos{gap:1px!important}.overview-layout .day-memo{font-size:11px!important;line-height:1.3!important;padding:0 2px!important}.overview-layout .calendar-panel:not(.weekly):not(.all-memos) .month-grid{height:calc(100dvh - 170px);grid-template-rows:repeat(5,minmax(0,1fr));gap:2px}.overview-layout .calendar-panel.six-weeks:not(.weekly):not(.all-memos) .month-grid{grid-template-rows:repeat(6,minmax(0,1fr))}.overview-layout .calendar-panel:not(.weekly):not(.all-memos) .day{min-height:0!important;overflow:hidden}.overview-layout .calendar-panel:not(.weekly) .day .holiday-label{position:absolute;left:23px;right:2px;top:3px;white-space:nowrap;font-size:9px;line-height:14px}.overview-layout .holiday-footnote{display:none}.overview-layout .calendar-footer{padding-top:3px!important;margin:0!important}.overview-layout .calendar-footer .chip{min-height:28px;padding:3px 6px}.overview-layout .memo-overflow{font-size:10px;padding:1px;line-height:12px}.mobile-nav{bottom:3px;padding:3px 6px!important;border-radius:17px}.mobile-nav button{min-height:42px!important;padding:2px!important}.mobile-nav .nav-icon{height:23px}.mobile-nav .ui-icon{height:20px}.calendar-overview .calendar-head .month-actions button{min-height:32px}.calendar-overview .month-name{font-size:16px}
}
@media(max-width:539px){.overview-layout .calendar-panel:not(.weekly):not(.all-memos) .month-grid{height:calc(100dvh - 204px)}}
@media(min-width:901px){.sidebar{width:174px;padding:24px 10px}.workspace{margin-left:174px}.topbar{height:56px;padding:0 20px}}
@media(max-width:900px){main.calendar-overview{padding:8px 6px 90px}.calendar-overview .page-title{margin:0 5px 6px}.calendar-overview h1{font-size:20px}.overview-layout .calendar-panel{padding:8px 5px;gap:5px 7px;border-radius:16px}.overview-layout .day{padding:3px 2px;min-height:60px}.overview-layout .day-memo{font-size:11px;padding:1px 2px}.overview-layout .month-name{font-size:17px}.overview-layout .calendar-view-bar{gap:4px}.overview-layout .view-switch{padding:2px}.overview-layout .view-switch button{padding:5px 9px;min-height:32px}.overview-layout .calendar-view-bar input{width:120px}.topbar{height:48px;padding:0 14px}.overview-layout .holiday-label{font-size:10px}}
@media(max-width:539px){.overview-layout .calendar-panel{grid-template-columns:1fr}.overview-layout .calendar-head{grid-column:1;grid-row:1}.overview-layout .calendar-view-bar{grid-column:1;grid-row:2;justify-content:space-between}.overview-layout .day-memo{font-size:10px;line-height:1.3}.overview-layout .day-num{height:20px}.overview-layout .month-grid{gap:2px}.overview-layout .day{padding:2px 1px}.overview-layout .holiday-label{font-size:9px}#day-details{max-height:85dvh;padding:8px}}
/* Desktop typography: a little denser without shrinking mobile text or hit targets. */
@media(min-width:901px){
 body{font-size:14px}
 h1{font-size:28px}h2{font-size:21px}h3{font-size:16px}
 .calendar-overview h1{font-size:21px}
 .month-name,.weekly .month-name{font-size:18px}
 .day-panel h2{font-size:19px}
 .task-name{font-size:14px}
 #task-title{font-size:18px}
 .nav-item{font-size:13px}
 .overview-layout .day-memo{font-size:12px}
}
/* A week is seven vertical lists, with no three-item summary limit. */
.overview-layout .week-columns{grid-column:1/-1;min-width:0;overflow-x:auto;overscroll-behavior-x:contain;border-radius:8px}
.overview-layout .weekly .weekdays{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:3px}
.overview-layout .weekly .month-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));grid-template-rows:auto;gap:3px;align-items:stretch}
.overview-layout .weekly .day{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;min-height:clamp(260px,calc(100dvh - 250px),720px);gap:6px!important}
.overview-layout .weekly .day-num{flex-shrink:0;align-self:flex-start}
.overview-layout .weekly .day:nth-child(n) .day-num:after{content:none}
.overview-layout .weekly .day-memos{gap:5px!important}
.overview-layout .weekly .day-memo{-webkit-line-clamp:unset;line-height:1.4!important;padding:3px!important}
.week-swipe-hint{display:none}
@media(min-width:901px){.overview-layout .weekly .day{min-height:clamp(260px,calc(100dvh - 320px),720px)}}
@media(max-width:539px){
 .overview-layout .weekly .weekdays,.overview-layout .weekly .month-grid{min-width:0;gap:1px}
 .overview-layout .weekly{padding-inline:2px}
 .overview-layout .weekly .day{padding:2px 0!important;border-radius:5px;gap:3px!important}
 .overview-layout .weekly .day-memos{gap:3px!important}
 .overview-layout .weekly .day-memo{font-size:11px!important;letter-spacing:-.4px;line-height:1.4!important;padding:2px 1px!important;border-left-width:2px;border-radius:3px;word-break:normal;overflow-wrap:anywhere}
}

/* Explicit editing remains reachable on touch devices. */
.task-row .edit-task{display:block;flex-shrink:0;min-width:40px;min-height:40px;padding:4px;color:#3657a3;font-size:12px;background:#e4ebff80}
.routine-card{flex-wrap:wrap}.routine-card>div:nth-child(2){min-width:0;flex:1}.routine-card h3{overflow-wrap:anywhere}
@media(min-width:901px){
 body{font-size:12.67px}h1{font-size:26.67px}h2{font-size:19.67px}h3{font-size:14.67px}
 .calendar-overview h1{font-size:19.67px}.month-name,.weekly .month-name{font-size:16.67px}
 .day-panel h2{font-size:17.67px}.task-name{font-size:12.67px}#task-title{font-size:16.67px}
 .nav-item{font-size:11.67px}.overview-layout .day-memo{font-size:10.67px}
}
@media(max-width:900px){body{font-size:13.67px}.task-name{font-size:13.67px}}

/* Daily progress and lunar date stay visible above notes. */
.calendar-panel{touch-action:pan-y pinch-zoom}
.day-heading{display:flex;align-items:center;justify-content:space-between;width:100%;gap:1px}
.day-progress{font-size:10px;line-height:16px;color:#5e4680;white-space:nowrap;font-variant-numeric:tabular-nums}
.lunar-date{display:block;align-self:flex-start;font-size:10px;line-height:13px;color:#66748a;white-space:nowrap}
.selected-lunar{font-size:12px;color:#66748a}.completed-tasks h3{font-size:13px;margin:6px 0 9px;color:#623a8a}
.task-row.done .task-name,.memo-done{text-decoration:none!important;opacity:1!important}.task-row.done .task-name{color:#623a8a!important}
.overview-layout .day .holiday-label{position:static!important;white-space:normal!important}
@media(max-width:539px){.day-progress{font-size:9px}.lunar-date{font-size:9px;line-height:12px}}
