/* Give the timetable the remaining viewport, with one scroll area for the grid. */
.workspace:has(.schedule-workspace){height:100dvh;min-height:0;overflow:hidden}
.workspace #main:has(.schedule-workspace){display:flex;flex-direction:column;min-height:0;max-width:none;padding:12px 24px 8px}
.workspace:has(.schedule-workspace)>.footer{display:none}
.page-heading:has(+.schedule-workspace){flex-wrap:nowrap;gap:12px;margin-bottom:8px;flex-shrink:0}
.page-heading:has(+.schedule-workspace) .eyebrow,.page-heading:has(+.schedule-workspace) p{display:none}
.page-heading:has(+.schedule-workspace) h1{font-size:1.55rem;line-height:1.2;margin:0}
.page-heading:has(+.schedule-workspace) .button{min-height:38px;padding:7px 12px;font-size:var(--text-caption)}
.schedule-workspace{display:flex;flex-direction:column;min-height:0;flex:1}
.schedule-workspace+.info-line{flex-shrink:0;margin:7px 0 0;font-size:var(--text-caption);line-height:1.35}
.schedule-workspace .schedule-toolbar{padding:6px 14px;flex-wrap:wrap;gap:8px 16px;flex-shrink:0}
.schedule-workspace .week-navigation{padding:0;width:auto;flex:1;gap:8px;justify-content:flex-start}
.schedule-workspace .week-navigation>.inline-actions{gap:10px}
.schedule-workspace .week-navigation strong{font-size:var(--text-small)}
.schedule-workspace .week-navigation .icon-button{min-width:34px;min-height:34px}
.schedule-workspace .select-label select{padding-top:7px;padding-bottom:7px;min-height:36px}
.schedule-workspace .document-action{min-height:36px;padding:6px 10px;font-size:var(--text-caption)}
.schedule-workspace .document-action .icon{width:18px;height:18px}
.schedule-workspace .schedule-scroll{flex:1;min-height:0;max-height:none;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--theme-accent-border,#89af99) transparent;scroll-padding:76px 0 0 90px}
.schedule-workspace .schedule-grid{grid-template-columns:88px repeat(5,minmax(150px,1fr));grid-template-rows:max-content;min-width:840px;min-height:100%}
.schedule-workspace .schedule-day,.schedule-workspace .schedule-corner{position:sticky;top:0;z-index:3;background:var(--theme-surface,#fff);border-bottom:1px solid var(--theme-line,#e2e9e2);box-shadow:0 2px 4px var(--theme-shadow,#27453512)}
.schedule-workspace .schedule-day{border-top:3px solid transparent;padding:4px 7px;min-height:0;color:inherit}
.schedule-day-heading{display:flex;align-items:center;justify-content:center;gap:8px;line-height:1.25}
.schedule-workspace .schedule-day strong{margin:0;font-size:1.15rem;line-height:1.2;font-weight:600}
.schedule-workspace .schedule-day small{display:block;margin-top:3px;font-size:var(--text-caption);line-height:1.35;color:var(--theme-muted,#738577)}
.schedule-workspace .schedule-today-label{display:inline-flex;align-items:center;justify-content:center;width:max-content;margin:3px auto 0;padding:1px 7px;border-radius:5px;background:var(--theme-accent,#236b53);color:var(--theme-on-accent,#fff);font-size:var(--text-caption);font-weight:650;line-height:1.35;letter-spacing:0;text-transform:none}
.schedule-workspace .schedule-day.current{background:var(--theme-selected,#eaf3ed);border-top-color:var(--theme-accent,#236b53);box-shadow:inset 1px 0 var(--theme-accent-border,#89af99),inset -1px 0 var(--theme-accent-border,#89af99),0 2px 4px var(--theme-shadow,#27453512)}
.schedule-workspace .schedule-cell.current{background:var(--theme-selected,#eaf3ed);box-shadow:inset 1px 0 var(--theme-accent-border,#89af99),inset -1px 0 var(--theme-accent-border,#89af99)}
.schedule-workspace .schedule-time{position:sticky;left:0;z-index:2;background:var(--theme-surface,#fff);box-shadow:1px 0 var(--theme-line,#e2e9e2);min-height:0;padding:10px 7px}
.schedule-workspace .schedule-time span{margin-top:4px;font-size:.72rem;line-height:1.35}
.schedule-workspace .schedule-time-range{white-space:nowrap}
.schedule-workspace .schedule-corner{left:0;z-index:4;display:flex;align-items:center;justify-content:center;padding:7px;font-size:var(--text-caption)}
.schedule-workspace .schedule-cell{padding:3px;min-height:0;gap:4px}
.schedule-workspace .schedule-lesson{min-height:0;flex:1;padding:5px 7px;gap:2px;border-radius:7px}
.schedule-workspace .schedule-lesson strong{font-size:var(--text-small);line-height:1.25;overflow-wrap:anywhere}
.schedule-workspace .schedule-lesson-details{display:flex;align-items:baseline;gap:7px;font-size:var(--text-caption);line-height:1.25;opacity:.85}
.schedule-workspace .schedule-lesson-details>span{font:inherit;opacity:1}
.schedule-workspace .schedule-teacher{min-width:0;flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.schedule-workspace .schedule-room{flex-shrink:0}
.schedule-workspace .schedule-lesson-meta{display:flex;align-items:center;justify-content:space-between;gap:5px;font-size:var(--text-caption);line-height:1.25;opacity:.85;margin-top:auto}
.schedule-workspace .schedule-lesson-meta span{font:inherit;opacity:1}
.schedule-workspace .schedule-assignment{display:inline-flex;flex-shrink:0}
.schedule-workspace .schedule-assignment .icon{width:15px;height:15px}
.schedule-workspace .schedule-lesson:focus-visible{outline:2px solid var(--theme-accent,#236b53);outline-offset:1px}
@media(max-width:1100px){
  .workspace #main:has(.schedule-workspace){padding:12px 14px 8px}
  .schedule-workspace .schedule-toolbar{gap:8px;padding:8px 10px}
  .schedule-workspace .schedule-toolbar>.select-label{font-size:0;gap:0}
}
@media(max-width:760px){
  .workspace #main:has(.schedule-workspace){padding:10px 8px 8px}
  .page-heading:has(+.schedule-workspace){margin-bottom:8px}
  .page-heading:has(+.schedule-workspace) h1{font-size:1.35rem}
  .page-heading:has(+.schedule-workspace) .button{font-size:0;padding:8px;width:38px;gap:0}
  .page-heading:has(+.schedule-workspace) .button>.icon{width:20px;height:20px}
  .schedule-workspace .week-navigation>.inline-actions{gap:4px}
  .schedule-workspace .document-actions{gap:4px;flex-wrap:nowrap}
  .schedule-workspace .document-action{width:36px;min-width:36px;padding:8px;gap:0}
  .schedule-workspace .document-action>span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  .schedule-workspace .select-label{order:3;margin-left:auto}
  .schedule-workspace+.info-line{font-size:.7rem}
}
