/* Compact overview and distinct calendar navigation across all schemes. */
:root .stats{gap:10px;margin-bottom:16px}
:root .stat-card{min-height:62px;padding:8px 14px;gap:10px}
:root .stat-icon{width:30px;height:30px;border-radius:6px}
:root .stat-icon svg{width:20px;height:20px}
:root .stat-title{font-size:10px;line-height:1.3}
:root .stat-value{font-size:23px;line-height:1.15;margin-top:2px}
:root .stat-value small{font-size:10px;margin-left:5px}
:root .calendar-toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:12px;padding-top:12px;padding-bottom:12px}
:root .date-navigation{justify-self:start;min-width:0;gap:10px}
:root .calendar-toolbar>.month-label{justify-self:center;text-align:center;min-width:0;margin:0;max-width:100%;font-size:18px;line-height:1.3}
:root .calendar-toolbar>.view-switch{justify-self:end;margin:0;width:auto}
:root .month-jump-bar{padding-top:10px;padding-bottom:10px;border-top:1px solid var(--scheme-line,var(--brand-line));border-bottom:1px solid var(--scheme-line,var(--brand-line))}
:root .month-shortcuts{gap:6px;padding:0 0 3px}
:root .month-shortcuts button{height:32px;min-width:66px;padding:0 9px;justify-content:center;text-align:center;border-radius:6px;font-size:11px;border:1px solid var(--scheme-line,var(--brand-line))}
:root .month-shortcuts button:not(.active){background:var(--scheme-panel,var(--bg));color:var(--scheme-text,var(--ink))}
:root .month-shortcuts button:not(.active):hover{background:color-mix(in srgb,var(--scheme-accent,var(--green)) 12%,var(--scheme-panel,var(--bg)));border-color:var(--scheme-accent,var(--green))}
:root .filter-toolbar{padding-top:12px}
@media(max-width:1100px){
  :root .calendar-toolbar{grid-template-columns:1fr 1fr;gap:10px}
  :root .calendar-toolbar>.month-label{grid-column:1/-1;grid-row:1;font-size:17px}
  :root .date-navigation{grid-column:1;grid-row:2}
  :root .calendar-toolbar>.view-switch{grid-column:2;grid-row:2}
}
@media(max-width:560px){
  :root .stats{gap:7px;margin-bottom:12px}
  :root .stat-card{min-height:56px;padding:7px 10px}
  :root .stat-value{font-size:21px}
  :root .stat-icon{display:none}
  :root .calendar-toolbar{padding:10px 12px;column-gap:6px}
  :root .calendar-toolbar>.month-label{font-size:16px}
  :root .date-navigation{gap:5px}
  :root .today-button{padding-inline:6px}
  :root .calendar-toolbar>.view-switch button{padding:5px 6px;font-size:10px;white-space:nowrap}
  :root .month-jump-bar{padding:9px 12px;gap:8px}
  :root .month-shortcuts button{height:34px}
}

/* Header responds to the actual free width, including a collapsed sidebar. */
.app-shell{container:planner / inline-size}
:root .topbar{display:grid;grid-template-columns:minmax(100px,max-content) minmax(0,1fr) max-content max-content;grid-template-areas:"crumb totals action controls";align-items:center;gap:12px;min-height:66px;height:auto;padding:10px 20px}
:root .topbar>*{min-width:0}
:root .topbar .breadcrumb{grid-area:crumb;gap:6px;font-size:10px;white-space:normal;overflow-wrap:anywhere}
:root .topbar .stats{grid-area:totals;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;margin:0;min-width:0}
:root .topbar .stat-card{display:flex;min-width:0;min-height:34px;padding:0 9px;border:0;border-left:1px solid var(--scheme-line,var(--brand-line));border-radius:0;background:none;box-shadow:none;overflow:visible;gap:7px;align-items:center}
:root .topbar .stat-card::after{display:none}
:root .topbar .stat-card>div{min-width:0}
:root .topbar .stat-title{font-size:9px;line-height:1.3;white-space:normal;overflow-wrap:anywhere}
:root .topbar .stat-value{display:flex;flex-wrap:wrap;align-items:baseline;gap:1px 5px;font-size:17px;line-height:1.2;margin-top:2px;letter-spacing:-.5px}
:root .topbar .stat-value small{display:inline;font-size:9px;font-weight:400;letter-spacing:0;margin:0;overflow-wrap:anywhere}
:root .topbar .stat-icon{display:grid;place-items:center;position:static;width:24px;height:28px;min-width:24px;flex-shrink:0;border-radius:5px}
:root .topbar .stat-icon svg{width:16px!important;height:16px!important}
:root .topbar #editModeToggle{grid-area:action;font-size:10px;white-space:nowrap;padding:8px 10px;gap:5px;min-height:34px;justify-self:end;max-width:100%}
:root .topbar #editModeToggle svg{width:14px;height:14px}
:root .topbar-right{grid-area:controls;display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:8px;min-width:0;max-width:100%}
:root .topbar .theme-preset{width:164px;min-width:0;max-width:100%;font-size:10px}
:root .topbar .theme-toggle{width:30px;min-width:30px;padding:0;justify-content:center}
:root .topbar .theme-toggle-label,:root .topbar .demo-label{display:none}
:root .topbar .save-indicator{font-size:0;gap:0;flex-shrink:0}
:root .topbar .save-indicator i{width:6px;height:6px}
@container planner (max-width:1180px){
  :root .topbar{grid-template-columns:minmax(0,1fr) max-content;grid-template-areas:"crumb controls" "totals action";gap:10px 12px;padding:10px 16px}
  :root .topbar .stat-card:first-child{border-left:0;padding-left:0}
}
@container planner (max-width:700px){
  :root .topbar{grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-areas:"crumb controls" "totals totals" "action action";padding:10px 12px}
  :root .topbar #editModeToggle{font-size:11px}
  :root .topbar .theme-preset{width:148px}
  :root .topbar .stat-card{padding-inline:6px;gap:5px}
}
@container planner (max-width:460px){
  :root .topbar{grid-template-columns:minmax(0,1fr);grid-template-areas:"crumb" "controls" "totals" "action";gap:10px}
  :root .topbar-right{justify-content:flex-start}
  :root .topbar .stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 0}
  :root .topbar .stat-card:nth-child(odd){border-left:0;padding-left:0}
  :root .topbar #editModeToggle{width:100%;justify-self:stretch}
}

/* Viewing is the default on every page load. Filters and navigation stay usable. */
body[data-edit-mode="view"] :is(#newMachine,#newPart,#undoButton,#redoButton,#journalUndo,#journalRedo,[data-journal-undo],[data-journal-redo],.machine-drag-handle,[data-edit-machine],[data-edit-part],[data-person-drag],[data-person-action="employee"],[data-person-action="period"],[data-person-action="undo"],[data-person-action="redo"],[data-person-action="local"],.resize-handle,.event-handle,.event-resize,.person-edit-button){display:none!important}
body[data-edit-mode="view"] :is(.event,.day-cell,[data-person-cell],[data-person-edit-employee],[data-person-period],[data-person-vac-month]){cursor:default!important;touch-action:auto}
body[data-edit-mode="view"] .person-department em{display:none}
:root .topbar #editModeToggle[aria-pressed="true"]{box-shadow:0 0 0 2px var(--scheme-text,var(--ink));}
