/* =========================================
   SCHEDULE CALENDAR — epic 0060.
   Every selector in this file starts with .schedule-calendar (a test
   asserts it). Google Calendar's day view is the reference: hours down,
   courts across, proportional cards, same-start split / staggered cascade.
   Card colour comes from the legend via --cat (an index 0–7) or
   --cat-override (a bracket's own hex); --cat-neutral:1 = outside the key.
   ========================================= */

.schedule-calendar {
  --schedule-calendar-strong: var(--cat-neutral);
  --schedule-calendar-soft: var(--cat-neutral-soft);
  position: relative;
  margin-top: var(--sp-3);
}

/* ── Toolbar ── */
/* Pins to the top of the page scroller (.main-container) once scrolled
   past. The grid's column header pins beneath it via a JS translate,
   because it sits inside the horizontally scrolling viewport where CSS
   sticky cannot follow the page scroll. */
.schedule-calendar__sticky {
  position: sticky;
  top: 0;
  z-index: 25;
  padding: var(--sp-2) 0;
  background: var(--bg);
}
.schedule-calendar__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-3);
}
.schedule-calendar__sticky .schedule-calendar__legend { margin: var(--sp-2) 0 0; }
.schedule-calendar__toolbar .go-date-selector { margin-bottom: 0; min-width: 320px; }
/* The HQ strip may jump to empty dates (allow_empty): those cells are
   plain but clickable; dates with games keep Go's dot styling. */
.schedule-calendar .go-cal__cell--empty { cursor: pointer; color: var(--ink-2); }
.schedule-calendar .go-cal__cell--empty:hover { background: var(--bg-2); }
.schedule-calendar__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
}
.schedule-calendar__seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  overflow: hidden;
  background: var(--surface);
}
.schedule-calendar__seg-btn {
  padding: 0.35rem 0.85rem;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: var(--text-sm);
  cursor: pointer;
}
.schedule-calendar__seg-btn.is-active { background: var(--accent); color: var(--white); }
.schedule-calendar__ctl {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--text-sm);
  color: var(--ink-2);
}
.schedule-calendar__select {
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  font: inherit;
  font-size: var(--text-sm);
}
.schedule-calendar__check input { accent-color: var(--accent); }
/* On/off switch (the form editor's pattern) */
.schedule-calendar__switch-label { position: relative; cursor: pointer; user-select: none; }
.schedule-calendar__switch { position: absolute; opacity: 0; width: 1px; height: 1px; }
.schedule-calendar__switch-track {
  position: relative;
  display: inline-block;
  width: 30px; height: 17px;
  border-radius: var(--r-pill);
  background: var(--ink-4);
  transition: background 0.15s;
}
.schedule-calendar__switch-track::after {
  content: "";
  position: absolute;
  top: 1.5px; left: 1.5px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--white);
  transition: left 0.15s;
}
.schedule-calendar__switch:checked + .schedule-calendar__switch-track { background: var(--accent); }
.schedule-calendar__switch:checked + .schedule-calendar__switch-track::after { left: 14.5px; }
.schedule-calendar__switch:focus-visible + .schedule-calendar__switch-track { box-shadow: var(--focus-ring); }
.schedule-calendar__zoom { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-pill); overflow: hidden; }
.schedule-calendar__zoom-btn {
  width: 30px; height: 28px;
  border: 0; background: var(--surface); color: var(--ink-2);
  font-size: 1rem; line-height: 1; cursor: pointer;
}
.schedule-calendar__zoom-btn:hover { background: var(--bg-2); }
.schedule-calendar__zoom-btn + .schedule-calendar__zoom-btn { border-left: 1px solid var(--line); }
.schedule-calendar__pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink-2);
  font-size: var(--text-sm);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.schedule-calendar__pill::-webkit-details-marker { display: none; }
.schedule-calendar__pill--warn { border-color: var(--danger); color: var(--danger-dark); background: var(--danger-soft); }
.schedule-calendar__picker, .schedule-calendar__conflicts { position: relative; }
.schedule-calendar__menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 30;
  min-width: 260px;
  max-height: 60vh;
  overflow: auto;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
}
.schedule-calendar__menu-item {
  display: block;
  padding: 0.35rem 0;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line-2);
}
.schedule-calendar__menu-item:last-child { border-bottom: 0; }
.schedule-calendar__menu-item:hover { color: var(--accent); }
.schedule-calendar__picker-toggle { display: flex; gap: 0.4rem; align-items: center; font-weight: 600; }
.schedule-calendar__picker-hint { margin: 0.25rem 0 0.5rem; color: var(--ink-3); font-size: var(--text-xs); }
.schedule-calendar__picker-group { margin-top: 0.4rem; }
.schedule-calendar__picker-facility { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); margin-bottom: 0.15rem; }
.schedule-calendar__picker-item { display: flex; gap: 0.4rem; align-items: center; padding: 0.15rem 0 0.15rem 0.5rem; }
.schedule-calendar__picker-item input:disabled + * { color: var(--ink-3); }
.schedule-calendar__notice { font-size: var(--text-xs); color: var(--warning-dark); }

/* ── Legend strip (§4.10) ── */
.schedule-calendar__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: var(--sp-2);
}
.schedule-calendar__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink-2);
  font: inherit;
  font-size: var(--text-xs);
  cursor: pointer;
}
.schedule-calendar__chip.is-dim { opacity: 0.4; }
.schedule-calendar__chip--neutral { cursor: default; --cat-neutral: 1; }
.schedule-calendar__swatch {
  width: 10px; height: 10px; border-radius: 3px;
  background: var(--schedule-calendar-strong);
}

/* ── Grid ── */
/* Natural height: the page scrolls, the viewport scrolls sideways only. */
.schedule-calendar__viewport {
  position: relative;
  overflow-x: auto;
  min-height: 320px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}
/* The table is block flow: head and body are stacked rows, each its own
   grid with the same columns (a grid table would place them as cells). */
.schedule-calendar__table { position: relative; display: block; min-width: max-content; }
/* Pinned beneath the toolbar by a JS translate (see pinHead): CSS sticky
   cannot follow the page scroll from inside the horizontal scroller. */
.schedule-calendar__head {
  position: relative;
  z-index: 20;
  display: grid;
  align-content: start;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  will-change: transform;
}
.schedule-calendar__head.is-pinned { box-shadow: 0 2px 6px rgba(17, 24, 39, 0.08); }
.schedule-calendar__gutter-head { position: sticky; left: 0; z-index: 21; background: var(--surface-2); }
.schedule-calendar__facility {
  padding: 0.35rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-align: center;
  border-left: 1px solid var(--line-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.schedule-calendar__court {
  padding: 0.3rem 0.6rem 0.45rem;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
  text-align: center;
  border-left: 1px solid var(--line-2);
  border-top: 1px solid var(--line-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.schedule-calendar__court--none { color: var(--ink-3); font-style: italic; }
.schedule-calendar__body { position: relative; display: grid; }
.schedule-calendar__gutter {
  position: sticky;
  left: 0;
  z-index: 10;
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.schedule-calendar__hour {
  position: absolute;
  right: 6px;
  transform: translateY(-50%);
  font-size: var(--text-xs);
  color: var(--ink-3);
  white-space: nowrap;
}
.schedule-calendar__col {
  position: relative;
  border-left: 1px solid var(--line-2);
  background-image:
    repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px var(--px-hour)),
    repeating-linear-gradient(to bottom, transparent 0 calc(var(--px-hour) / 2), var(--line-2) calc(var(--px-hour) / 2) calc(var(--px-hour) / 2 + 1px), transparent calc(var(--px-hour) / 2 + 1px) var(--px-hour));
}
.schedule-calendar__col--none { background-color: var(--bg-2); }
.schedule-calendar__now-line {
  position: absolute;
  left: 0; right: 0;
  height: 0;
  border-top: 2px solid var(--danger);
  z-index: 9;
  pointer-events: none;
}
.schedule-calendar__now-dot {
  position: absolute;
  right: -5px;
  width: 10px; height: 10px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--danger);
  z-index: 11;
}

/* ── Cards (§4.5) ── */
.schedule-calendar__card {
  --schedule-calendar-strong: var(--cat-override, var(--schedule-calendar-cat-strong, var(--cat-neutral)));
  --schedule-calendar-soft: var(--schedule-calendar-cat-soft, var(--cat-neutral-soft));
  position: absolute;
  box-sizing: border-box;
  display: block;
  overflow: hidden;
  padding: 1px 4px 1px 6px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--schedule-calendar-strong);
  border-radius: var(--r-sm);
  background: var(--schedule-calendar-soft);
  color: var(--ink);
  font-size: var(--text-xs);
  line-height: 16px;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.08);
  cursor: pointer;
}
.schedule-calendar__card:hover { box-shadow: var(--shadow); z-index: 6 !important; }
.schedule-calendar__card:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.schedule-calendar__card.is-played { opacity: 0.6; }
.schedule-calendar__card.is-played .schedule-calendar__badges { opacity: 1; }
/* Epic 0064 §3.2: a host's already-persisted games (the scheduler review) — read-only, dashed. */
.schedule-calendar__card.is-persisted { border-style: dashed; opacity: 0.7; cursor: default; background: var(--bg-2); }
.schedule-calendar__card.is-highlight { box-shadow: 0 0 0 3px var(--accent); z-index: 7 !important; }
/* Epic 0064 §5.5: a host's slot pick — the source card is tinted, the targets dashed. */
.schedule-calendar__card.is-pick-source { background: var(--accent-light); border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); z-index: 7 !important; }
.schedule-calendar__card.is-pick-target { outline: 2px dashed var(--accent); outline-offset: 1px; }
.schedule-calendar__card.is-dim { opacity: 0.18; }
.schedule-calendar__card.is-conflict, .schedule-calendar__ghost.is-conflict { box-shadow: inset 0 0 0 1.5px var(--danger); border-color: var(--danger); }
.schedule-calendar__card.is-noend { border-bottom-style: dashed; }
.schedule-calendar__card.is-flash { animation: schedule-calendar-flash 1.2s ease-out; }
@keyframes schedule-calendar-flash {
  0%   { box-shadow: 0 0 0 4px var(--accent); }
  100% { box-shadow: 0 1px 2px rgba(17, 24, 39, 0.08); }
}
.schedule-calendar__card--match { background: color-mix(in srgb, var(--schedule-calendar-soft) 60%, var(--surface)); }
.schedule-calendar__line1, .schedule-calendar__line2, .schedule-calendar__line3 {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  height: 16px;
  white-space: nowrap;
  overflow: hidden;
}
.schedule-calendar__line2, .schedule-calendar__line3 { color: var(--ink-2); }
.schedule-calendar__teams { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.schedule-calendar__badges { flex: 0 0 auto; display: inline-flex; gap: 0.2rem; margin-left: auto; }
.schedule-calendar__badge {
  display: inline-flex;
  align-items: center;
  padding: 0 4px;
  border-radius: 3px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 14px;
}
.schedule-calendar__badge--live { background: var(--danger); color: var(--white); }
.schedule-calendar__badge--final { background: var(--success-soft); color: var(--success-dark); }
.schedule-calendar__badge--warn { color: var(--warning-dark); font-size: 0.8rem; padding: 0; }
.schedule-calendar__badge--note { color: var(--warning); padding: 0; }
.schedule-calendar__badge--note svg { width: 12px; height: 12px; }
.schedule-calendar__part { color: var(--ink-3); font-style: italic; }
.schedule-calendar__team-row { display: flex; align-items: center; gap: 0.3rem; height: 16px; white-space: nowrap; overflow: hidden; }
.schedule-calendar__team-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.schedule-calendar__pts { flex: 0 0 auto; min-width: 1.2em; text-align: right; }
.schedule-calendar__pts.is-win { font-weight: 700; }
.schedule-calendar__icon {
  flex: 0 0 auto;
  width: 14px; height: 14px;
  border-radius: 3px;
  object-fit: cover;
}
.schedule-calendar__icon--letter {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--white); font-size: 0.6rem; font-weight: 700;
}

/* Stacked identical windows (§4.7) */
.schedule-calendar__card--stack { padding-bottom: 2px; }
.schedule-calendar__stack { display: flex; flex-direction: column; }
.schedule-calendar__stack-row {
  display: flex; align-items: center; gap: 0.3rem;
  height: 16px; padding-left: 4px;
  border-top: 1px dashed var(--line);
  color: var(--ink-2); text-decoration: none; white-space: nowrap; overflow: hidden;
}
.schedule-calendar__stack-row:hover { color: var(--accent); }

/* Match lanes and dot row (§4.6): the lanes are the card's body below the
   header lines, the games mapped proportionally into that space. */
.schedule-calendar__lanes { position: relative; display: block; pointer-events: none; }
.schedule-calendar__lane {
  position: absolute;
  left: 0; right: 0;
  box-sizing: border-box;
  display: flex; align-items: center; gap: 0.3rem;
  padding: 0 4px;
  border: 1px solid color-mix(in srgb, var(--schedule-calendar-strong) 35%, transparent);
  border-radius: 3px;
  background: color-mix(in srgb, var(--schedule-calendar-soft) 70%, var(--surface));
  color: var(--ink-2);
  font-size: 0.68rem;
  line-height: 14px;
  white-space: nowrap; overflow: hidden;
}
.schedule-calendar__lane.is-played { opacity: 0.6; }
.schedule-calendar__lane.is-conflict { border-color: var(--danger); }
.schedule-calendar__dots { display: inline-flex; gap: 3px; align-items: center; }
.schedule-calendar__dot {
  width: 7px; height: 7px; border-radius: 50%;
  border: 1px solid var(--schedule-calendar-strong);
  background: transparent;
}
.schedule-calendar__dot.is-won { background: var(--schedule-calendar-strong); }
.schedule-calendar__dot.is-lost { background: var(--line); border-color: var(--line); }
.schedule-calendar__dot.is-live { animation: schedule-calendar-pulse 1.2s infinite; border-color: var(--danger); }
@keyframes schedule-calendar-pulse { 50% { opacity: 0.3; } }

/* Sibling link bar (§4.7) */
.schedule-calendar__link-bar {
  position: absolute;
  left: 1px;
  width: 3px;
  border-radius: 2px;
  background: var(--schedule-calendar-cat-strong, var(--cat-neutral));
  opacity: 0.7;
  z-index: 1;
  pointer-events: none;
}
.schedule-calendar__col:has(.schedule-calendar__card[data-match-id]:hover) .schedule-calendar__card[data-match-id] { outline: 1px dashed var(--ink-3); }

/* Ghosts (§4.8) */
.schedule-calendar__ghost {
  position: absolute;
  box-sizing: border-box;
  display: block;
  overflow: hidden;
  padding: 1px 4px 1px 6px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink-4);
  border-radius: var(--r-sm);
  background: repeating-linear-gradient(135deg, var(--bg-2) 0 4px, var(--bg-3) 4px 6px);
  color: var(--ink-2);
  font: inherit;
  font-size: var(--text-xs);
  line-height: 16px;
  text-align: left;
  cursor: pointer;
}
.schedule-calendar__popover {
  position: absolute;
  z-index: 40;
  max-width: 320px;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
  color: var(--ink-2);
}
.schedule-calendar__popover-title { font-weight: 600; color: var(--ink); }
.schedule-calendar__popover-note { margin-top: 0.3rem; color: var(--ink-3); font-size: var(--text-xs); white-space: pre-wrap; }
/* Go mounts sit under the page's own date strip; no sticky chrome of their own. */
.schedule-calendar--go .schedule-calendar__sticky { position: static; padding-top: 0; }
.schedule-calendar__popover a { display: inline-block; margin-top: 0.4rem; color: var(--accent); }

/* Colour index → tokens (0–7 from the categorical palette) */
.schedule-calendar__card[style*="--cat:0"], .schedule-calendar__chip[style*="--cat:0"], .schedule-calendar__link-bar[style*="--cat:0"] { --schedule-calendar-cat-strong: var(--cat-1); --schedule-calendar-cat-soft: var(--cat-1-soft); }
.schedule-calendar__card[style*="--cat:1"], .schedule-calendar__chip[style*="--cat:1"], .schedule-calendar__link-bar[style*="--cat:1"] { --schedule-calendar-cat-strong: var(--cat-2); --schedule-calendar-cat-soft: var(--cat-2-soft); }
.schedule-calendar__card[style*="--cat:2"], .schedule-calendar__chip[style*="--cat:2"], .schedule-calendar__link-bar[style*="--cat:2"] { --schedule-calendar-cat-strong: var(--cat-3); --schedule-calendar-cat-soft: var(--cat-3-soft); }
.schedule-calendar__card[style*="--cat:3"], .schedule-calendar__chip[style*="--cat:3"], .schedule-calendar__link-bar[style*="--cat:3"] { --schedule-calendar-cat-strong: var(--cat-4); --schedule-calendar-cat-soft: var(--cat-4-soft); }
.schedule-calendar__card[style*="--cat:4"], .schedule-calendar__chip[style*="--cat:4"], .schedule-calendar__link-bar[style*="--cat:4"] { --schedule-calendar-cat-strong: var(--cat-5); --schedule-calendar-cat-soft: var(--cat-5-soft); }
.schedule-calendar__card[style*="--cat:5"], .schedule-calendar__chip[style*="--cat:5"], .schedule-calendar__link-bar[style*="--cat:5"] { --schedule-calendar-cat-strong: var(--cat-6); --schedule-calendar-cat-soft: var(--cat-6-soft); }
.schedule-calendar__card[style*="--cat:6"], .schedule-calendar__chip[style*="--cat:6"], .schedule-calendar__link-bar[style*="--cat:6"] { --schedule-calendar-cat-strong: var(--cat-7); --schedule-calendar-cat-soft: var(--cat-7-soft); }
.schedule-calendar__card[style*="--cat:7"], .schedule-calendar__chip[style*="--cat:7"], .schedule-calendar__link-bar[style*="--cat:7"] { --schedule-calendar-cat-strong: var(--cat-8); --schedule-calendar-cat-soft: var(--cat-8-soft); }
.schedule-calendar__card[style*="--cat-neutral:1"], .schedule-calendar__link-bar[style*="--cat-neutral:1"] { --schedule-calendar-cat-strong: var(--cat-neutral); --schedule-calendar-cat-soft: var(--cat-neutral-soft); }
.schedule-calendar__chip[style*="--cat-override"] .schedule-calendar__swatch { background: var(--cat-override); }
/* A value with its own configured colour (a bracket) colours the whole
   card from it — border AND fill — instead of the palette slot it happens
   to occupy in the legend (Kyle: cards did not match the bracket colours). */
.schedule-calendar__card[style*="--cat-override"],
.schedule-calendar__link-bar[style*="--cat-override"] {
  --schedule-calendar-cat-strong: var(--cat-override);
  --schedule-calendar-cat-soft: color-mix(in srgb, var(--cat-override) 16%, var(--surface));
}
.schedule-calendar__chip { --schedule-calendar-strong: var(--schedule-calendar-cat-strong, var(--cat-neutral)); }
/* Played cards keep the key's colour on the border only (§4.10). */
.schedule-calendar__card.is-played { background: var(--bg-2); }

/* ── Editing gestures (§6) ── */
.schedule-calendar__card.is-movable { cursor: grab; touch-action: pan-y; }
.schedule-calendar__card.is-dragging { cursor: grabbing; opacity: 0.9; box-shadow: var(--shadow-lg); z-index: 8 !important; pointer-events: none; }
.schedule-calendar__card.is-resizing { z-index: 8 !important; }
.schedule-calendar__card.is-saving { opacity: 0.55; }
.schedule-calendar__card.is-saving::after {
  content: "Saving…";
  position: absolute; right: 4px; bottom: 2px;
  font-size: 0.6rem; color: var(--ink-3);
}
/* Epic 0064 §5.4: a host-provided actions menu on run cards (payload.card_menu). */
.schedule-calendar__kebab {
  position: absolute;
  top: 1px; right: 1px;
  width: 18px; height: 18px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--ink-3);
  font: inherit;
  font-size: 0.95rem;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
  z-index: 2;
}
.schedule-calendar__kebab:hover { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.schedule-calendar__card:has(.schedule-calendar__kebab) .schedule-calendar__badges { margin-right: 16px; }
.schedule-calendar__resize {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 7px;
  cursor: ns-resize;
}
.schedule-calendar__resize::after {
  content: "";
  position: absolute; left: 50%; bottom: 2px;
  width: 22px; height: 2px; margin-left: -11px;
  border-radius: 2px;
  background: var(--ink-4);
  opacity: 0;
  transition: opacity 0.1s;
}
.schedule-calendar__card:hover .schedule-calendar__resize::after { opacity: 0.8; }
.schedule-calendar__draw {
  position: absolute;
  left: 2px; right: 2px;
  box-sizing: border-box;
  padding: 1px 6px;
  border: 1.5px dashed var(--accent);
  border-radius: var(--r-sm);
  background: var(--accent-subtle);
  color: var(--accent-dark);
  font-size: var(--text-xs);
  line-height: 16px;
  white-space: nowrap; overflow: hidden;
  z-index: 7;
  pointer-events: none;
}
.schedule-calendar__draw--arm { border-style: solid; }
.schedule-calendar__tooltip {
  position: absolute;
  z-index: 50;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  background: var(--ink);
  color: var(--white);
  font-size: var(--text-xs);
  white-space: nowrap;
  pointer-events: none;
}
.schedule-calendar.is-armed .schedule-calendar__col { cursor: crosshair; }
.schedule-calendar.is-armed .schedule-calendar__card { pointer-events: none; }
.schedule-calendar__unsched-chip.is-movable { cursor: grab; touch-action: pan-x pan-y; }
.schedule-calendar__unsched-chip.is-dragging { opacity: 0.5; }
.schedule-calendar__unscheduled.is-drop-target { border-color: var(--accent); background: var(--accent-subtle); }

/* ── Hosted mounts (playoff viewer / editor, §7) ── */
.schedule-calendar__daynav { display: inline-flex; align-items: center; gap: 0.4rem; }
.schedule-calendar__daynav-btn {
  width: 30px; height: 28px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink-2);
  font-size: 1rem; line-height: 1; cursor: pointer;
}
.schedule-calendar__daynav-btn:disabled { opacity: 0.4; cursor: default; }
.schedule-calendar__daynav-label { font-weight: 600; color: var(--ink); font-size: var(--text-sm); }
.schedule-calendar--hosted .schedule-calendar__sticky { background: var(--surface); }
.schedule-calendar__band {
  position: absolute;
  left: 0; right: 0;
  background: var(--accent-subtle);
  border-top: 1px dashed var(--accent);
  border-bottom: 1px dashed var(--accent);
  z-index: 0;
  pointer-events: none;
}
.schedule-calendar__lane.is-synthetic { border-style: dashed; }

/* ── Unscheduled strip ── */
.schedule-calendar__unscheduled {
  margin-top: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.schedule-calendar__unsched-title { font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 0.3rem; }
.schedule-calendar__unsched-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.schedule-calendar__unsched-chip {
  display: inline-flex;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--text-xs);
  text-decoration: none;
}
.schedule-calendar__unsched-chip:hover { border-color: var(--accent); color: var(--accent); }

/* ── Empty states ── */
.schedule-calendar__empty {
  padding: var(--sp-6) var(--sp-4);
  text-align: center;
  color: var(--ink-3);
  font-size: var(--text-sm);
}
.schedule-calendar__empty--overlay {
  position: absolute;
  left: 0; right: 0; top: 96px;
  pointer-events: none;
}
.schedule-calendar__empty a { pointer-events: auto; }
.schedule-calendar__noscript { color: var(--ink-3); font-size: var(--text-sm); }

/* ── View modal (§5) ── */
.schedule-calendar-modal { max-width: 640px; }
.schedule-calendar-modal__header { align-items: flex-start; }
.schedule-calendar-modal__heading { min-width: 0; }
.schedule-calendar-modal__kicker { font-size: var(--text-xs); color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 2px; }
.schedule-calendar-modal__kicker-link { text-transform: none; letter-spacing: 0; color: var(--accent); }
.schedule-calendar-modal__tools { display: flex; align-items: center; gap: 0.4rem; margin-left: auto; }
.schedule-calendar-modal__pencil {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  color: var(--ink-2); text-decoration: none; font-size: 0.9rem;
}
.schedule-calendar-modal__pencil:hover { color: var(--accent); border-color: var(--accent); }
.schedule-calendar-modal__scoreboard {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.schedule-calendar-modal__side { display: flex; align-items: center; gap: 0.5rem; min-width: 0; font-weight: 600; }
.schedule-calendar-modal__side--a { justify-content: flex-start; }
.schedule-calendar-modal__side--b { justify-content: flex-end; text-align: right; }
.schedule-calendar-modal__team { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.schedule-calendar-modal__score { display: flex; align-items: center; gap: 0.5rem; font-size: var(--text-xl); font-weight: 700; }
.schedule-calendar-modal__score .game-cell__input { width: 3.2em; font-size: var(--text-lg); text-align: center; }
.schedule-calendar-modal__dash { color: var(--ink-3); }
.schedule-calendar-modal__locked { font-variant-numeric: tabular-nums; }
.schedule-calendar-modal__leader { font-weight: 800; }
.schedule-calendar-modal__live { font-size: var(--text-xs); font-weight: 700; color: var(--white); background: var(--danger); padding: 0 6px; border-radius: 3px; }
.schedule-calendar-modal__live-score { font-variant-numeric: tabular-nums; }
.schedule-calendar-modal__conflict-note { margin: 0.5rem 0 0; color: var(--warning-dark); font-size: var(--text-sm); }
.schedule-calendar-modal__details {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.35rem var(--sp-3);
  margin: var(--sp-3) 0;
  font-size: var(--text-sm);
}
.schedule-calendar-modal__details dt { color: var(--ink-3); }
.schedule-calendar-modal__details dd { margin: 0; color: var(--ink); }
.schedule-calendar-modal__notes { white-space: pre-wrap; }
.schedule-calendar-modal__conflict { color: var(--danger-dark); }
.schedule-calendar-modal__footer { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; }
.schedule-calendar-modal__games td, .schedule-calendar-modal__games th { white-space: nowrap; }
.schedule-calendar-modal__row-link { color: var(--accent); text-decoration: none; font-size: 1.1rem; padding: 0 0.4rem; }
.schedule-calendar-modal__edit-games td { vertical-align: middle; }
.schedule-calendar-modal__edit-games .bulk-form-input, .schedule-calendar-modal__edit-games .bulk-form-select { width: auto; min-width: 0; font-size: var(--text-sm); }
.schedule-calendar-modal__muted { color: var(--ink-3); }
.schedule-calendar-modal__hint { margin: 0.5rem 0 0; color: var(--ink-3); font-size: var(--text-xs); }
.schedule-calendar-modal__error { margin-top: var(--sp-3); padding: 0.5rem 0.75rem; border-radius: var(--r-sm); background: var(--danger-soft); color: var(--danger-dark); font-size: var(--text-sm); }

/* ── Narrow HQ windows: toolbar wraps to two rows (§4.11) ── */
@media (max-width: 1100px) {
  .schedule-calendar__toolbar { flex-direction: column; align-items: stretch; }
  .schedule-calendar__toolbar .go-date-selector { max-width: none; }
}
