.calendar-body { background: var(--paper); min-height: 100vh; }
.calendar-topbar { position: fixed; inset: 0 0 auto; z-index: 5; height: var(--header-height); display: flex; align-items: center; padding: 0 1.25rem 0 calc(var(--detail-rail-width) + 1.25rem); background: var(--paper); border-bottom: var(--line); }
.calendar-brand { display: flex; flex-direction: column; color: var(--ink); text-decoration: none; }
.calendar-brand span { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }
.calendar-brand strong { font-size: 1rem; }
.calendar-page { max-width: 1900px; margin: auto; padding: calc(var(--header-height) + 1.5rem) 1.5rem 3rem calc(var(--detail-rail-width) + 1.5rem); }
.schedule-heading h1 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.05; margin: 0 0 .5rem; }
.schedule-heading p { margin: 0 0 1.5rem; font-size: 1rem; }
.schedule-controls { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.25rem; }
.schedule-controls button, .schedule-controls select { font: inherit; min-height: 44px; border: 1px solid #555; border-radius: 5px; background: white; color: #151515; padding: .5rem .8rem; }
.schedule-controls label { font-size: .875rem; margin-left: .3rem; }
.schedule-controls select { font-weight: 700; max-width: 100%; }
.schedule-controls button { cursor: pointer; transition: background .15s; }
.schedule-controls button:hover:not(:disabled) { background: #f2d40b; }
.schedule-controls button:disabled { opacity: .4; cursor: default; }
.calendar-page :focus-visible { outline: 3px solid #1778ad; outline-offset: 3px; }
.phase-legend { display: flex; flex-wrap: wrap; gap: .65rem 1.25rem; margin-bottom: .75rem; font-size: .875rem; }
.phase-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.phase-legend i { width: 20px; height: 12px; border: 1px solid #15151544; }
.preprod { background: #c4cdd8; }
.filming { background: #1778ad; }
.editing { background: #177e3d; }
.revision { background: #f2d40b; }
.review { background: #524576; }
.closed { background: repeating-linear-gradient(135deg,#ebebeb,#ebebeb 5px,#dedede 5px,#dedede 6px); }
.chart-help, .calendar-note { font-size: .875rem; line-height: 1.6; max-width: 105ch; margin: .75rem 0; }
.timeline-title { font-size: 1.15rem; margin: 1.1rem 0 .65rem; }
.gantt-scroll { overflow: auto; max-height: 67vh; border: 1px solid #555; background: #fff; position: relative; --day: 52px; --label: 225px; }
.gantt-months, .gantt-days, .gantt-row { display: flex; width: max-content; min-width: 100%; }
.gantt-header { width: max-content; min-width: 100%; position: sticky; top: 0; z-index: 4; box-shadow: 0 1px #555; }
.gantt-label { position: sticky; left: 0; z-index: 2; width: var(--label); flex: none; box-sizing: border-box; background: #fff; padding: 1rem; border-right: 1px solid #777; border-bottom: 1px solid #bbb; display: flex; flex-direction: column; justify-content: center; gap: .35rem; white-space: normal; }
.month-band { flex: none; box-sizing: border-box; background: #151515; color: white; padding: .6rem 0; border-right: 2px solid #777; }
.month-band span { position: sticky; left: calc(var(--label) + .75rem); padding: 0 .75rem; font-size: .9rem; font-weight: 700; }
.gantt-months .gantt-corner { padding-block: .6rem; }
.gantt-label strong { font-size: 1rem; }
.gantt-label span, .gantt-label small { font-size: .875rem; line-height: 1.4; }
.gantt-label small { color: #555; }
.gantt-label .crew-name { color: #151515; font-weight: 750; }
.gantt-corner { background: #f7f6f2; font-size: .875rem; justify-content: center; }
.day-header { flex: none; box-sizing: border-box; width: var(--day); background: #f7f6f2; text-align: center; padding: .55rem 0; border-right: 1px solid #ccc; font-size: .875rem; }
.day-header b { display: block; font-size: 1rem; }
.day-header.closed { background: #e4e4e4; color: #555; }
.day-header.today { background: #151515; color: #fff; }
.day-header.monday, .day-cell.monday { border-left: 1px solid #888; }
.gantt-track { position: relative; flex: none; height: 205px; border-bottom: 1px solid #bbb; box-sizing: border-box; }
.day-cell { position: absolute; top: 0; bottom: 0; width: var(--day); box-sizing: border-box; border-right: 1px solid #e4e4e4; }
.day-cell.today { border-left: 2px solid #151515; }
.phase-bar { position: absolute; top: 17px; height: 27px; z-index: 1; }
.phase-bar span { position: sticky; left: calc(var(--label) + .5rem); display: inline-block; padding: 3px 6px; font-size: .875rem; font-weight: 650; color: #fff; white-space: nowrap; }
.phase-bar.preprod span, .phase-bar.revision span { color: #151515; }
.milestone { position: absolute; top: 38px; width: 0; z-index: 2; }
.milestone::before { content: ''; position: absolute; width: 10px; height: 10px; background: #151515; border: 2px solid white; transform: translateX(-50%) rotate(45deg); box-sizing: border-box; }
.milestone::after { content: ''; position: absolute; top: 9px; height: calc(var(--lane) * 44px + 14px); width: 1px; background: #555; }
.milestone-label { position: absolute; top: calc(23px + var(--lane) * 44px); width: 150px; font-size: .875rem; line-height: 1.2; white-space: nowrap; background: #ffffffee; padding: 3px 4px; border-radius: 2px; }
.milestone-label time { font-weight: 700; }
.milestone-label.align-right { right: 0; text-align: right; }
.schedule-details { border-top: 1px solid #bbb; margin-top: 1.5rem; padding-top: 1rem; }
.schedule-details summary { font-weight: 700; cursor: pointer; padding: .5rem 0; }
.episode-detail { padding: 1rem 0; border-bottom: 1px solid #ccc; }
.episode-detail h3 { font-size: 1rem; margin: 0 0 .8rem; }
.episode-detail ul { display: grid; grid-template-columns: repeat(auto-fit,minmax(230px,1fr)); gap: .5rem 1rem; padding: 0; list-style: none; font-size: .875rem; }
.episode-detail time { display: block; font-weight: 700; }
.back-link { display: inline-block; margin-top: 1.5rem; }
@media (max-width: 650px) {
  .calendar-page { padding-right: .75rem; padding-left: calc(var(--detail-rail-width) + .75rem); }
  .gantt-scroll { --label: 150px; max-height: 65vh; }
  .gantt-label { padding: .65rem; }
  .gantt-label strong, .gantt-label span, .gantt-label small { font-size: .875rem; }
  .schedule-controls { gap: .4rem; }
  .schedule-controls label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .schedule-controls button, .schedule-controls select { font-size: .875rem; padding: .5rem; }
}
@media (prefers-reduced-motion: reduce) { .schedule-controls button { transition: none; } }
