.ms-pt-timeline{min-width:0;--hour:76px}
.ms-timeline-head,.ms-timeline-legend{display:flex;align-items:center;justify-content:space-between;gap:8px 14px;flex-wrap:wrap}
.ms-timeline-head h2{margin:0 0 5px}
.ms-timeline-head p{margin:0 0 6px;font-size:.9rem}
.ms-timeline-nav{display:flex;gap:6px}
.ms-timeline-nav button{width:44px;min-height:44px;padding:0;font-size:1.55rem}
.ms-timeline-legend{justify-content:flex-start;margin:10px 0;font-size:.8rem;color:var(--muted)}
.ms-timeline-legend span{display:flex;align-items:center;gap:5px}
.ms-timeline-legend i{width:10px;height:10px;border-radius:3px;background:var(--accent)}
.ms-timeline-legend span:nth-child(2) i{background:var(--muted)}
.ms-timeline-legend button{margin-left:auto;font-size:.8rem;padding:5px 9px}
.ms-timeline-grid{display:grid;grid-template-columns:42px repeat(2,minmax(0,1fr));gap:0 8px;padding-bottom:9px}
.ms-timeline-date{display:grid;gap:2px;min-width:0;padding:9px 3px 12px}
.ms-timeline-date span{font-size:.77rem;color:var(--muted)}
.ms-timeline-hours,.ms-timeline-day{position:relative;height:calc(var(--hours)*var(--hour));min-width:0}
.ms-timeline-hours span{position:absolute;left:0;transform:translateY(-50%);font-size:.72rem;color:var(--muted);font-variant-numeric:tabular-nums}
.ms-timeline-day{border-bottom:1px solid var(--line);background:repeating-linear-gradient(to bottom,var(--line) 0 1px,transparent 1px calc(var(--hour)/2),color-mix(in srgb,var(--line) 55%,transparent) calc(var(--hour)/2) calc(var(--hour)/2 + 1px),transparent calc(var(--hour)/2 + 1px) var(--hour))}
.ms-timeline-slot{position:absolute;left:0;width:100%;min-height:0;padding:0;border:0;border-radius:4px;background:transparent}
.ms-timeline-slot:focus-visible{outline-offset:-2px;background:var(--soft)}
@media(hover:hover){.ms-timeline-slot:hover{background:var(--soft)}}
.ms-timeline-day button.ms-timeline-event{position:absolute;z-index:1;left:calc(var(--lane)*100%/var(--lanes));width:calc(100%/var(--lanes) - 2px);min-height:0;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:1px;overflow:hidden;padding:0 4px 0 7px;border:0;border-left:3px solid var(--accent);border-radius:5px;text-align:left;line-height:1.12;background:var(--soft);color:var(--ink)}
.ms-timeline-day button.is-blocked{border-left-color:var(--muted);background:var(--line)}
.ms-timeline-event strong,.ms-timeline-event small{display:block;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ms-timeline-event strong{font-size:.8rem}
.ms-timeline-event small{font-size:.68rem}
.ms-timeline-now{position:absolute;z-index:2;left:0;right:0;border-top:2px solid var(--accent);pointer-events:none}
.ms-timeline-actions{display:flex;flex-wrap:wrap;gap:8px}
@media(max-width:500px){
 .ms-pt-timeline{padding:14px;--hour:80px}
 .ms-timeline-grid{grid-template-columns:33px repeat(2,minmax(0,1fr));column-gap:5px}
 .ms-timeline-event strong{font-size:.75rem}
}

.ms-timeline-options{display:flex;gap:8px 14px;justify-content:space-between;align-items:center;flex-wrap:wrap;margin:12px 0}
.ms-timeline-views{display:flex;gap:6px}
.ms-timeline-views button{padding:7px 13px;min-height:44px}
.ms-timeline-views button[aria-pressed=true],.ms-week-strip button[aria-pressed=true]{background:var(--soft);border-color:var(--accent);font-weight:700}
.ms-timeline-period{margin:0;font-size:.85rem;color:var(--muted)}
.ms-week-strip{display:none}
.ms-pt-timeline.is-week .ms-timeline-grid{grid-template-columns:42px repeat(7,minmax(0,1fr));column-gap:5px}
.ms-pt-timeline.is-week .ms-timeline-date.is-today strong{color:var(--accent)}
@media(max-width:970px){
 .ms-pt-timeline.is-week .ms-timeline-grid{grid-template-columns:36px minmax(0,1fr)}
 .ms-pt-timeline.is-week :is(.ms-timeline-day,.ms-timeline-date):not(.is-selected){display:none}
 .ms-week-strip{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:3px}
 .ms-week-strip button{display:grid;justify-items:center;align-content:center;min-width:0;min-height:62px;gap:2px;padding:3px 0;font-size:.72rem;border-radius:9px}
 .ms-week-strip button strong{font-size:.95rem}
 .ms-week-strip button small{display:flex;align-items:center;gap:3px;color:var(--muted)}
 .ms-week-strip button small i{width:5px;height:5px;border-radius:50%;background:var(--muted)}
}

#modal.ms-agenda-sheet{position:fixed;inset:auto 0 0;margin:0 auto;width:min(100%,520px);max-height:85dvh;overflow:auto;border-radius:24px 24px 0 0;padding:24px 20px calc(22px + env(safe-area-inset-bottom));overscroll-behavior:contain}
#modal.ms-agenda-sheet h2{margin-top:0}
#modal.ms-agenda-sheet .ms-agenda-sheet-time{font-weight:650;color:var(--accent)}
#modal.ms-agenda-sheet .ms-timeline-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}
#modal.ms-agenda-sheet .ms-timeline-actions button{min-height:44px}
#modal.ms-agenda-sheet .ms-timeline-actions [data-close]{grid-column:1/-1}
.ms-agenda-save-status{margin:12px 0 0;font-weight:600}
.ms-agenda-save-status.is-error{color:var(--accent)}
@media(max-width:360px){#modal.ms-agenda-sheet .ms-timeline-actions{grid-template-columns:1fr}}

/* React owns the session cards; retain the existing responsive grid. */
.ms-react-session-list{display:contents}
.session-entry .student-actions{display:flex;flex-wrap:wrap;gap:8px}
.session-entry h3,.session-entry .note{overflow-wrap:anywhere}
@media(max-width:600px){
 .library-grid:has(>[data-react-session-list]){grid-template-columns:minmax(0,1fr)}
 .session-entry .student-actions button{flex:1;min-width:120px}
}
.agenda-toolbar .ms-week-nav{display:flex;align-items:center;justify-content:space-between;gap:8px;grid-column:1/-1;flex-wrap:wrap}.ms-week-nav button{min-width:44px;min-height:44px}.agenda-toolbar .agenda-segments{display:flex;flex-wrap:wrap}.agenda-toolbar .agenda-segments button{flex:1 1 auto}
