/* Week planner: one staff list beside a compact table with spreadsheet-style cells. */
.planner-page .schedule-shell{overflow:clip}
.planner-sheet{display:grid;grid-template-columns:minmax(0,1fr)}
.planner-sidebar{display:grid;gap:10px;align-content:start;padding:12px 15px;border-bottom:1px solid var(--line)}
.planner-sidebar .sidebar-palette{margin:0}
/* Compact week table (planner and view-only roster) so lunch and dinner fit on one screen. */
.compact-roster thead th{padding:9px 11px}
.compact-roster thead th b{font-size:15px;margin-top:3px}
.compact-roster thead th:first-child{width:150px;padding-left:16px}
.compact-roster tbody th[scope=row]{padding:5px 8px 5px 16px;font-size:12.5px}
.compact-roster tbody th small{margin-top:2px}
.compact-roster td{padding:3px 4px;height:40px}
.compact-roster .person{padding:3px 7px;margin-bottom:2px;font-size:13px;line-height:1.35}
.compact-roster .person:last-child{margin-bottom:0}
.compact-roster .period-row th{padding:6px 16px;font-size:13px}
.compact-roster .period-row span{display:none}
/* Row color buttons float at the end of the position cell until needed. */
.compact-roster tbody th[scope=row] .row-color-tools{position:absolute;right:4px;top:50%;transform:translateY(-50%);margin:0;gap:2px;opacity:0;transition:opacity .15s}
.compact-roster tr:hover .row-color-tools,.compact-roster .row-color-tools:focus-within{opacity:1}
.compact-roster .row-color-tools .row-color-control{width:28px;height:28px;border-radius:8px}
.compact-roster .row-color-control svg{width:16px;height:16px}
.compact-roster .row-color-reset{width:24px;height:28px;font-size:16px}
.compact-roster .row-color-reset svg{width:15px;height:15px}

/* Unassigned positions show a dash; "No position this day" shows a cross. */
table td.cell-open.drop-active{background:#e0f0d7!important}
td.cell-open .shift-edit{min-height:32px}
html .empty,html .closed{display:block;text-align:center;padding:7px 2px;font-size:15px;line-height:1.2;color:var(--muted,#8a9585);background:none}
html .closed{font-size:13px;opacity:.75}
/* Keep the screen-reader labels inside the scrolling table so
   they never widen the page on tablets and phones. */
.table-wrap{position:relative}
html .day-people .empty{text-align:right;padding:0}
html .day-people .closed{font-size:11px;opacity:1}
.legend .legend-open,.legend .legend-closed{background:none!important;border:0;font-style:normal;font-weight:700;color:var(--muted,#8a9585);display:inline-flex;align-items:center;justify-content:center;width:auto;height:auto;margin-right:6px}
.sheet-mode td.cell-open.sheet-selected::after{background:color-mix(in srgb,var(--green) 45%,transparent)}
[data-theme=dark] :is(.empty,.closed,.legend-open,.legend-closed){color:#9fb0a6}
.dark-position .empty,.dark-position .closed{color:white}
.planner-sheet .staff-chip{display:flex;align-items:center;gap:4px;white-space:nowrap}
.planner-sheet .owner-palette summary{padding:7px 12px;font-size:13px}
@media (min-width:1100px){
 .planner-sheet{grid-template-columns:240px minmax(0,1fr);align-items:start}
 .planner-sidebar{position:sticky;top:10px;max-height:calc(100vh - 20px);overflow:auto;border-bottom:0;border-right:1px solid var(--line);padding:12px 10px}
 .sidebar-palette{padding:10px}
 .sidebar-palette .palette-description small{display:block;margin-top:3px}
 .sidebar-palette .staff-chips{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
 .sidebar-palette .staff-chip{min-width:0;min-height:34px;justify-content:space-between;gap:3px;padding:5px 6px;font-size:12.5px;overflow:hidden;text-overflow:ellipsis}
 .sidebar-palette .staff-chip .staff-badges svg{width:14px;height:14px}
 .sidebar-palette .owner-palette{grid-column:1/-1}
 .sidebar-palette .unassign-zone{padding:10px;font-size:12px}
}

.sheet-mode td{position:relative;cursor:cell;user-select:none}
.sheet-mode td:focus{outline:none}
.sheet-mode .shift-edit{cursor:cell}
.sheet-mode .shift-edit:hover{box-shadow:none}
.sheet-mode td.sheet-selected::after,.sheet-mode td.sheet-fill-preview::after{content:'';position:absolute;inset:0;background:color-mix(in srgb,var(--green) 13%,transparent);pointer-events:none;z-index:2}
.sheet-mode td.sheet-fill-preview::after{background:color-mix(in srgb,var(--green) 7%,transparent);border:1px dashed var(--green)}
.sheet-mode td.sheet-active{outline:2px solid var(--green);outline-offset:-2px}
.sheet-mode td.sheet-copied::before{content:'';position:absolute;inset:3px;border:2px dashed var(--green);border-radius:4px;pointer-events:none;z-index:2}
.sheet-fill-handle{position:absolute;right:-1px;bottom:-1px;width:9px;height:9px;background:var(--green);border:2px solid #fff;cursor:crosshair;z-index:4}

.sheet-editor{position:absolute;left:0;top:0;width:max(100%,210px);z-index:30}
.sheet-editor input{width:100%;box-sizing:border-box;font:inherit;font-size:14px;padding:8px 9px;border:2px solid var(--green);border-radius:6px;background:#fff;color:inherit;box-shadow:0 8px 20px #1d332a2e}
.sheet-editor input:focus{outline:none}
.sheet-editor ul{list-style:none;margin:4px 0 0;padding:4px;background:#fff;border:1px solid var(--line);border-radius:8px;box-shadow:0 10px 24px #1d332a2e;max-height:270px;overflow:auto}
.sheet-editor ul:empty{display:none}
.sheet-editor li{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:6px 8px;border-radius:5px;font-size:13px;cursor:pointer}
.sheet-editor li[aria-selected=true]{background:color-mix(in srgb,var(--green) 15%,transparent)}
.sheet-editor li small{color:var(--muted);font-size:11px;white-space:nowrap}
.sheet-editor li .flag-warning{color:#a3472f;font-weight:600}
.sheet-editor-error{display:block;margin-top:4px;padding:5px 7px;border-radius:5px;background:#fff5ed;color:#8a3a25;font-size:12px;box-shadow:0 6px 14px #1d332a1f}
.sheet-editor-error:empty{display:none}

.sheet-help{font-size:12px;color:var(--muted);border:1px solid var(--line);border-radius:10px;padding:9px 10px;background:#fafbf8}
.sheet-help summary{cursor:pointer;font-weight:700;color:inherit;display:flex;align-items:center;gap:6px}
.sheet-help summary svg{width:14px;height:14px}
.sheet-help ul{margin:8px 0 0;padding-left:16px;display:grid;gap:5px;line-height:1.45}
.sheet-help kbd{font:inherit;font-size:10.5px;padding:0 4px;border:1px solid var(--line);border-bottom-width:2px;border-radius:4px;background:#fff;color:#33463f}
.sheet-status{margin:0;font-size:12px;color:var(--muted);min-height:1em}
.sheet-status:empty{display:none}
.sheet-status.error{color:#8a3a25;background:#fff5ed;border:1px solid #e8c4b8;padding:8px 9px;border-radius:8px}
.quick-period{margin:4px 0 10px}
.quick-period button{display:inline-flex;align-items:center;gap:6px}
.quick-period svg{width:15px;height:15px}
@media (pointer:coarse){.sheet-help{display:none}}

[data-theme=dark] :is(.sheet-editor input,.sheet-editor ul){background:#1e3027;color:#e0ece5}
[data-theme=dark] :is(.sheet-help){background:#1b2b24}
[data-theme=dark] .sheet-help kbd{background:#23362e;color:#dbe9e0}
[data-theme=dark] :is(.sheet-status.error,.sheet-editor-error){background:#422b29;color:#ffc4b8;border-color:#a36e64}
[data-theme=dark] .sheet-editor li .flag-warning{color:#ffb39f}
[data-theme=dark] .sheet-fill-handle{border-color:#101a18}

@media print{.planner-sidebar,.sheet-fill-handle,.sheet-editor{display:none!important}.planner-sheet{display:block}.sheet-mode td::after,.sheet-mode td::before{display:none}.sheet-mode td.sheet-active{outline:0}}
/* Lunch / Dinner labels stay in view while the table scrolls sideways. */
.period-row .period-label{position:sticky;left:16px;display:inline-flex;align-items:center;max-width:calc(100vw - 64px);white-space:nowrap}
/* Every other position row is light grey so rows are easy to follow. A custom row color still wins. */
.roster-row.row-alt{--row-tint:#f1f3f2}
[data-theme=dark] .roster-row.row-alt{--row-tint:#21312b}
