.outlook-month-grid.calendar-span-month,.factory-month-grid.calendar-span-month{display:block!important;grid-template-rows:none;min-width:0}
.calendar-span-week{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));position:relative;min-width:0}
.calendar-span-week>.outlook-day,.calendar-span-week>.factory-day{position:relative;min-width:0;min-height:160px;padding-top:calc(42px + var(--calendar-span-space,0px));box-sizing:border-box}
/* Outrank calendar-mode's legacy padding shorthand. Dates, range lanes and
   individual events must occupy separate vertical bands at every breakpoint. */
.app-shell.calendar-mode .outlook-month-grid.calendar-span-month .calendar-span-week>.outlook-day,
.outlook-month-grid.calendar-span-month .calendar-span-week>.outlook-day{padding:calc(42px + var(--calendar-span-space,0px)) 8px 10px;height:auto;align-self:stretch}
.outlook-month-grid.calendar-span-month .outlook-event{height:auto!important;min-height:48px!important;box-sizing:border-box;margin:4px 0 0;flex-shrink:0;color:var(--text)}
.outlook-month-grid.calendar-span-month .calendar-more{font-size:13px;line-height:1.5;margin-top:4px}
/* Keep seven readable columns; overflow belongs to the calendar, not the app. */
.calendar-page:not(.project-alternative-mode) .outlook-month-panel{min-width:0;max-width:100%}
.outlook-month-panel:has(.calendar-span-month)>.outlook-weekdays,
.outlook-month-panel .outlook-month-grid.calendar-span-month{min-width:840px}
.calendar-span-week .outlook-day-number,.calendar-span-week>.factory-day>span:first-child{position:absolute;top:10px;left:10px}
.calendar-span-overlay{position:absolute;left:0;right:0;top:42px;display:grid;grid-template-columns:repeat(7,minmax(0,1fr));grid-auto-rows:34px;pointer-events:none;z-index:2}
.calendar-span-bar{display:flex;align-items:center;justify-content:flex-start;gap:7px;min-width:0;height:30px;margin:0 3px;padding:4px 9px;border:1px solid color-mix(in srgb,var(--span-color,#2f8bd5) 48%,var(--line));border-left:4px solid var(--span-color,#2f8bd5);border-radius:6px;background:color-mix(in srgb,var(--span-color,#2f8bd5) 16%,var(--surface));color:var(--text);font:inherit;font-size:14px;line-height:1.3;text-align:left;pointer-events:auto;cursor:pointer;overflow:hidden;box-sizing:border-box}
.calendar-span-bar strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:inherit}.calendar-span-bar small{flex-shrink:0;border-radius:4px;padding:2px 5px;background:var(--span-color,#2f8bd5);color:white;font-size:11px}.calendar-span-bar.continues-before{margin-left:0;border-left:0;border-top-left-radius:0;border-bottom-left-radius:0}.calendar-span-bar.continues-after{margin-right:0;border-top-right-radius:0;border-bottom-right-radius:0}.calendar-span-bar:focus-visible{outline:3px solid var(--primary);outline-offset:1px}.calendar-span-bar .span-continuation{flex-shrink:0;font-size:12px}
@media(max-width:600px){.calendar-span-week>.outlook-day,.calendar-span-week>.factory-day{min-height:120px}.calendar-span-bar{font-size:13px;padding-inline:5px;gap:4px}.calendar-span-bar small{font-size:10px}.factory-calendar-shell .factory-month-grid.calendar-span-month{min-width:720px}}
/* One-day cards and range bars share the same title, badge and row metrics. */
.calendar-span-month .calendar-span-overlay{grid-auto-rows:38px}
.calendar-span-month .calendar-span-bar,.calendar-span-month .factory-event-card.compact{height:34px;min-height:34px;font-size:16px;line-height:1.3;padding:5px 7px;gap:6px}
.calendar-span-month .calendar-span-bar strong,.calendar-span-month .factory-event-card.compact b{font-size:16px;font-weight:700;line-height:1.3}
.calendar-span-month .factory-event-card.compact{grid-template-columns:auto minmax(0,1fr);align-items:center;margin-bottom:4px}
.calendar-span-month .calendar-span-bar small,.calendar-span-month .factory-event-card.compact span{display:inline-block;font-size:12px;font-weight:750;line-height:1.25;padding:2px 5px}
.calendar-span-month .outlook-event .outlook-event-title{font-size:16px!important;line-height:1.3!important}
.calendar-span-month .outlook-event .outlook-event-time{font-size:12px!important;line-height:1.3!important}
.calendar-span-month .factory-day>span:first-child,.calendar-span-month .outlook-day-number{font-size:16px;font-weight:700}
.factory-weekdays>span,.outlook-weekdays>span{font-size:14px;font-weight:700}
.factory-calendar-shell{max-height:78vh;max-height:78dvh;overflow:auto;position:relative;overscroll-behavior:contain}
.factory-calendar-shell .factory-weekdays{position:sticky;top:0;z-index:6;background:var(--surface);border-bottom:1px solid var(--line)}
.calendar-page:not(.project-alternative-mode) .outlook-month-panel{max-height:78vh;max-height:78dvh;overflow:auto;position:relative;overscroll-behavior:contain}
.outlook-month-panel .outlook-weekdays{position:sticky;top:0;z-index:6;background:var(--surface);border-bottom:1px solid var(--line)}
.factory-weekdays>span:first-child,.outlook-weekdays>span:first-child,.calendar-span-week>.factory-day:first-child>span:first-child,.calendar-span-week>.outlook-day:first-child>.outlook-day-number{color:#d93648}
@media(prefers-color-scheme:dark){.factory-weekdays>span:first-child,.outlook-weekdays>span:first-child,.calendar-span-week>.factory-day:first-child>span:first-child,.calendar-span-week>.outlook-day:first-child>.outlook-day-number{color:#ff8594}}
/* Include landscape phones/tablets, not only narrow portrait viewports. */
@media(max-width:1000px),(hover:none) and (pointer:coarse){
 .factory-calendar-shell .factory-weekdays,.outlook-month-panel .outlook-weekdays,
 .calendar-page .horizontal-timeline-dates,.calendar-page .horizontal-timeline-dates>span,.calendar-page .horizontal-timeline-label,
 #factory-schedule-page .horizontal-timeline-dates,#factory-schedule-page .horizontal-timeline-dates>span,#factory-schedule-page .horizontal-timeline-label{position:static;top:auto;left:auto;box-shadow:none}
 /* No separate vertically trapped calendar pane: the whole page scrolls.
    Horizontal overflow stays local so seven columns remain readable. */
 .calendar-page:not(.project-alternative-mode) .outlook-month-panel,
 .factory-calendar-shell,
 #calendar-page.project-alternative-mode .horizontal-timeline-scroll,
 #factory-schedule-page .horizontal-timeline-scroll{max-height:none;height:auto;overflow-x:auto;overflow-y:visible;overscroll-behavior:auto}
 .app-shell.calendar-mode .main-content>.mobile-app-bar,
 .app-shell:has(#factory-schedule-page:not([hidden])) .main-content>.mobile-app-bar{position:static;top:auto}
}
