* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  background: #080d1a;
  color: #e2e8f0;
  padding: 36px 40px 48px;
}

.page { max-width: 1180px; margin: 0 auto; }

/* ── Header ── */
.header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; padding-bottom: 20px;
  border-bottom: 1px solid #1e2d45;
}
.header-left h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.3px; color: #f8fafc; }
.header-left p  { font-size: 12px; color: #475569; margin-top: 4px; }
.header-badge {
  background: #172554; color: #93c5fd;
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
  padding: 6px 14px; border-radius: 20px; border: 1px solid #1e40af;
}

/* ── Layout ── */
.layout { display: grid; grid-template-columns: 220px 1fr; gap: 22px; align-items: start; }
@media (max-width: 820px) { .layout { grid-template-columns: 1fr; } }

/* ── Sidebar (cinema + film filters) ── */
.sidebar {
  position: sticky; top: 20px;
  max-height: calc(100vh - 40px); overflow-y: auto;
}
.sidebar-panels { display: flex; flex-direction: column; gap: 14px; }
.filters-toggle { display: none; }
.rail {
  background: #0d1525; border: 1px solid #1e2d45; border-radius: 10px;
  padding: 8px; flex: none;
}
.rail-label {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.2px; color: #334155; padding: 8px 10px 6px;
}
.select-all-btn {
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: #60a5fa; background: transparent; border: none; padding: 2px 5px;
  cursor: pointer; border-radius: 4px; flex: none;
}
.select-all-btn:hover { background: #1e3a5f; color: #93c5fd; }
.select-all-btn:focus-visible { outline: 2px solid #60a5fa; outline-offset: 1px; }

.swatch {
  width: 9px; height: 9px; border-radius: 50%; flex: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2);
}
.cinema-item, .film-item, .format-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  border-radius: 7px; color: #cbd5e1; font-size: 13px; padding: 8px 10px;
  cursor: pointer; user-select: none;
}
.cinema-item:hover, .film-item:hover, .format-item:hover { background: #16213a; }
.cinema-item.checked, .film-item.checked, .format-item.checked { background: #1e293b; color: #f8fafc; font-weight: 600; }
.cinema-item input[type="checkbox"], .film-item input[type="checkbox"], .format-item input[type="checkbox"] {
  appearance: none; width: 15px; height: 15px; flex: none;
  border: 1.5px solid #334155; border-radius: 4px; background: #0d1525;
  cursor: pointer; position: relative;
}
.cinema-item input[type="checkbox"]:checked, .film-item input[type="checkbox"]:checked, .format-item input[type="checkbox"]:checked {
  background: #2563eb; border-color: #2563eb;
}
.cinema-item input[type="checkbox"]:checked::after, .film-item input[type="checkbox"]:checked::after, .format-item input[type="checkbox"]:checked::after {
  content: ""; position: absolute; left: 4px; top: 1px;
  width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.cinema-item input[type="checkbox"]:focus-visible, .film-item input[type="checkbox"]:focus-visible, .format-item input[type="checkbox"]:focus-visible { outline: 2px solid #60a5fa; outline-offset: 1px; }
.cinema-name { flex: 1; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cinema-count { font-size: 11px; color: #64748b; }
.cinema-item.checked .cinema-count { color: #93c5fd; }
.film-item .cinema-name, .format-item .cinema-name { font-size: 12.5px; }

.only-btn {
  display: none; flex: none;
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: #60a5fa; background: transparent; border: none; padding: 2px 5px;
  cursor: pointer; border-radius: 4px;
}
.only-btn:hover { background: #1e3a5f; color: #93c5fd; }
.cinema-item:hover .only-btn, .film-item:hover .only-btn, .format-item:hover .only-btn,
.cinema-item:focus-within .only-btn, .film-item:focus-within .only-btn, .format-item:focus-within .only-btn { display: inline-block; }
/* Touch has no hover - show "only" permanently rather than hiding it behind an
   interaction that can't happen (Pixel/phone/tablet users would never see it). */
@media (hover: none) {
  .only-btn { display: inline-block; }
}
.film-empty { padding: 10px; font-size: 12px; color: #475569; }

/* ── Week nav ──
   Mirrors cal's control (prev / picker / today / next) so the two apps'
   date navigation behaves the same, restyled for cine's darker palette. */
/* Capped so it lines up with the 7 day chips below rather than stretching
   the full width of the board, which left the picker looking oversized. */
.week-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; max-width: 520px; }
.week-bar .date-jump { flex: 1; justify-content: center; }
.wk-btn {
  flex: none; width: 38px; height: 32px; border: 1px solid #1e2d45; background: #0d1525;
  color: #94a3b8; border-radius: 9px; font-size: 17px; font-weight: 700; line-height: 1;
  cursor: pointer; font-family: inherit;
}
.wk-btn:hover { color: #e2e8f0; border-color: #f59e0b; }
.wk-btn:focus-visible { outline: 2px solid #f59e0b; outline-offset: 1px; }
/* Auto-width because it holds a word, not a chevron. */
.wk-today { width: auto; padding: 0 12px; font-size: 11.5px; letter-spacing: 0.02em; }
.date-jump {
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
  background: #0d1525; border: 1px solid #1e2d45; border-radius: 9px; padding: 5px 9px;
}
.date-jump input[type="date"] {
  border: none; background: transparent; color: #e2e8f0; font-family: inherit;
  font-size: 11.5px; font-weight: 600; cursor: pointer; padding: 0; color-scheme: dark;
  width: 100%;
}
.date-jump input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: 0.6; filter: invert(1); }

/* ── Day strip ── */
.days { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 16px; }
.day-chip {
  flex: none; background: #0d1525; border: 1px solid #1e2d45; border-radius: 9px;
  padding: 8px 14px 7px; cursor: pointer; text-align: center; min-width: 64px; font-family: inherit;
  color: #e2e8f0;
}
.day-chip .dow {
  display: block; font-size: 10px; letter-spacing: 0.6px; text-transform: uppercase; color: #64748b;
}
.day-chip .dom { display: block; font-size: 17px; font-weight: 700; margin-top: 2px; }
.day-chip.active { border-color: #f59e0b; background: #16213a; }
.day-chip.active .dow { color: #f59e0b; }
.day-chip:focus-visible { outline: 2px solid #60a5fa; outline-offset: 1px; }

/* ── Listings panel ── */
.panel { background: #0d1525; border: 1px solid #1e2d45; border-radius: 10px; overflow: hidden; }
.panel-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding: 14px 16px 10px; border-bottom: 1px solid #1e2d45;
}
.panel-head h2 { font-size: 15.5px; font-weight: 700; color: #f8fafc; }
.panel-head .meta { font-size: 12px; color: #64748b; display: flex; align-items: center; gap: 8px; }
.updating {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; color: #93c5fd; background: #172554;
  border: 1px solid #1e40af; border-radius: 20px; padding: 2px 9px 2px 7px;
}
.updating .spin {
  width: 7px; height: 7px; border-radius: 50%;
  border: 1.5px solid #60a5fa; border-top-color: transparent;
  animation: spin 0.7s linear infinite;
}
@media (prefers-reduced-motion: reduce) { .updating .spin { animation: none; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* Ruler and rows live in one scroll container so they always move together
   horizontally - previously they scrolled independently and could each
   overflow the page width on narrow screens. */
.timeline-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.timeline-inner { min-width: 900px; }
.ruler {
  display: grid; padding: 6px 16px 4px 16px; color: #64748b; font-size: 10.5px;
  border-bottom: 1px solid #1e2d45;
}
.ruler span { border-left: 1px solid #1e2d45; padding-left: 4px; }

.rows { padding: 8px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.row { position: relative; height: 34px; }
.track { position: relative; height: 100%; background: #101a30; border-radius: 6px; }
.bar {
  position: absolute; top: 2px; bottom: 2px; border-radius: 6px;
  display: flex; align-items: center; gap: 6px; padding: 0 8px;
  font-size: 11.5px; color: #fff; overflow: visible; white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.25);
}
.bar .fmt {
  font-size: 9px; letter-spacing: 0.02em; background: rgba(0,0,0,0.3);
  border-radius: 4px; padding: 1px 4px; flex: none;
}
.bar .cin {
  font-size: 9px; font-weight: 700; letter-spacing: 0.03em; flex: none;
  background: rgba(255,255,255,0.22); border-radius: 4px; padding: 1px 4px;
}
.bar .nm { font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.6); }
.bar .tm { flex: none; opacity: 0.9; font-size: 10.5px; }

/* A bookable showtime renders the bar as a real <a> to the film's Cineworld
   page, so it needs the link defaults stripped back to the div's appearance. */
a.bar { text-decoration: none; cursor: pointer; }
a.bar:hover { box-shadow: inset 0 0 0 1px rgba(0,0,0,0.25), 0 0 0 2px rgba(255,255,255,0.55); }
a.bar:focus-visible { outline: 2px solid #60a5fa; outline-offset: 2px; }

.empty { padding: 40px 20px 48px; text-align: center; color: #64748b; }
.empty .glyph { font-size: 26px; display: block; margin-bottom: 8px; opacity: 0.6; }
.empty b { color: #e2e8f0; }

.footnote { margin-top: 16px; font-size: 11.5px; color: #475569; }
.footnote code { background: #16213a; padding: 1px 5px; border-radius: 4px; }

::-webkit-scrollbar { height: 8px; width: 8px; }
::-webkit-scrollbar-thumb { background: #1e2d45; border-radius: 4px; }

/* ── Mobile (phones) ──────────────────────────────────────────────────────── */
@media (max-width: 820px) {
  body { padding: 18px 14px 32px; }
  .layout { gap: 16px; }
  .header { flex-wrap: wrap; gap: 12px; margin-bottom: 18px; padding-bottom: 16px; }
  .header-left h1 { font-size: 19px; }

  /* Filters collapse behind a toggle so the timeline - the actual content -
     isn't buried under three checkbox lists on first scroll. */
  .sidebar { position: static; max-height: none; overflow-y: visible; }
  .filters-toggle {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    background: #0d1525; border: 1px solid #1e2d45; border-radius: 10px;
    padding: 13px 16px; margin-bottom: 12px;
    color: #e2e8f0; font-size: 13.5px; font-weight: 700; font-family: inherit;
    cursor: pointer;
  }
  .filters-toggle .chevron { color: #64748b; transition: transform 0.15s ease; }
  .filters-toggle[aria-expanded="true"] .chevron { transform: rotate(180deg); }
  .sidebar-panels { display: none; }
  .sidebar-panels.open { display: flex; }

  /* Bigger tap targets throughout the filter lists and day strip. */
  .cinema-item, .film-item, .format-item { padding: 11px 10px; font-size: 14.5px; }
  .cinema-item input[type="checkbox"], .film-item input[type="checkbox"], .format-item input[type="checkbox"] {
    width: 19px; height: 19px;
  }
  .cinema-item input[type="checkbox"]:checked::after, .film-item input[type="checkbox"]:checked::after, .format-item input[type="checkbox"]:checked::after {
    left: 6px; top: 2px; width: 5px; height: 10px;
  }
  .only-btn { display: inline-block; font-size: 11px; padding: 5px 8px; }
  .select-all-btn { font-size: 11px; padding: 4px 7px; }
  .day-chip { padding: 10px 15px 9px; min-width: 52px; }

  .panel-head { padding: 12px 14px 10px; }
  .timeline-inner { min-width: 700px; }
  .rows, .ruler { padding-left: 12px; padding-right: 12px; }
}
