/* AirForge Pro: Schedule page (contract G.3, G.4). Owner: ui-features.
 * Scoped to .sched (the weekly grid) and the pro-sch-* classes that pro/ui/schedule.js adds. */

/* ---- light only: no dark cell, band or chip ---- */
.sched.pro-sch .c {
  background: var(--line2);
  color: #16203a;
}
.sched.pro-sch .c[style*="--pro-sch-c"] {
  background: color-mix(in srgb, var(--pro-sch-c) 24%, #ffffff);
  box-shadow: inset 4px 0 0 var(--pro-sch-c);
  padding-left: 9px;
  color: #16203a;
}
.sched.pro-sch .c.faded { opacity: .62; }
.sched.pro-sch .c .dj { background: #ffffff; color: #16203a; box-shadow: 0 0 0 1px var(--line); }
.chip.on.pro-sch-on {
  background: var(--accent-soft);
  color: #16203a;
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

/* ---- sticky: day names under the page header, hours on the left ---- */
.sched.pro-sch > span:first-child,
.sched.pro-sch .h {
  position: sticky;
  top: var(--pro-sch-top, var(--pro-top, var(--af-topbar-h, 0px)));
  z-index: 4;
  background: var(--panel);
}
.sched.pro-sch .h { box-shadow: 0 1px 0 var(--line); border-radius: 0; }
.sched.pro-sch .h:hover { background: var(--line2); }
.sched.pro-sch .hr {
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--panel);
}
.sched.pro-sch .hr:hover { background: var(--line2); }
.sched.pro-sch > span:first-child { left: 0; z-index: 5; }
/* The grid's card is a sideways-scroll box (.tw). A scroll box would trap the sticky day row, so from 600 px wide
 * (tablets and half-screen windows too) the box is opened up and the day row sticks to the page, under the page header. */
@media (min-width: 600px) {
  .card.tw:has(> .sched.pro-sch) { overflow: visible; max-height: none; }
  /* the week may get a little narrower than its usual 640 px so it always fits the card (tablets, half screens,
     and the widths where the left rail takes room): no sideways scroll, so the day row can stick to the page */
  .card.tw:has(> .sched.pro-sch) > .sched.pro-sch { min-width: 0 !important; }
}
/* Phones: the week does not fit, so the card stays a scroll box, now in both directions and no taller than the window:
 * the day row sticks to the TOP OF THE BOX while the hours scroll under it (and the hour column to its left). */
@media (max-width: 599.98px) {
  .card.tw:has(> .sched.pro-sch) {
    overflow: auto;
    max-height: max(260px, calc(100vh - var(--pro-stick, var(--pro-top, var(--af-topbar-h, 0px))) - 20px));
    padding-top: 0;
  }
  .card.tw:has(> .sched.pro-sch) > .sched.pro-sch > span:first-child,
  .card.tw:has(> .sched.pro-sch) > .sched.pro-sch .h { top: 0; }
}
