:root {
  --bg: #0f0f0f;
  --text: #e6e6e6;
  --muted: #858585;
  --faint: #5a5a5a;
  --rule: #1f1f1f;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; }
button:hover:not(:disabled) { color: var(--text); }
:focus-visible { outline: 1px solid var(--text); outline-offset: 3px; }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

.head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding: 40px 0 16px;
}
h1 { margin: 0; font-size: 18px; font-weight: 500; }
.stats { margin: 0 0 4px; font-variant-numeric: tabular-nums; }
.stats .stale { color: var(--text); }

.bar { position: sticky; top: 0; z-index: 1; background: var(--bg); }

.tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 10px 0;
}
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  color: var(--text);
  border: 1px solid #2c2c2c;
  border-radius: 6px;
  padding: 5px 10px;
}
.toggle:hover, .toggle[aria-expanded="true"] { border-color: #4a4a4a; }
.toggle .icon { display: inline-flex; color: var(--muted); }
.toggle .val::before { content: "·"; margin-right: 6px; color: var(--faint); }

.controls { display: flex; gap: 8px; margin-left: auto; }

input[type="search"] {
  flex: 1 1 180px;
  min-width: 0;
  font: inherit;
  color: var(--text);
  background: none;
  border: 0;
  padding: 2px 0;
}
input[type="search"]::placeholder { color: var(--faint); }
input[type="search"]:focus { outline: none; }

.panel { padding: 14px 0 16px; border-bottom: 1px solid var(--rule); }
.panel[hidden] { display: none; }
.panel [aria-pressed="true"] { color: var(--text); box-shadow: 0 1px 0 var(--text); }

/* Dates: quick picks plus a month calendar for picking any number of days */
.dates { display: grid; gap: 14px; justify-items: start; }
.presets { display: flex; flex-wrap: wrap; gap: 4px 18px; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; width: 100%; max-width: 320px; text-align: center; }
.cal-grid .dow { color: var(--faint); font-size: 12px; padding-bottom: 4px; }
.cal-grid button {
  position: relative;
  height: 38px;
  border-radius: 4px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.cal-grid button:hover:not(:disabled) { background: var(--rule); }
.cal-grid button:disabled { color: var(--faint); cursor: default; opacity: 0.5; }
.cal-grid button.today { text-decoration: underline; text-underline-offset: 4px; }
.panel .cal-grid button[aria-pressed="true"] { background: var(--text); color: var(--bg); box-shadow: none; }
.cal-grid .mon { position: absolute; top: 1px; left: 0; right: 0; font-size: 11px; line-height: 1; color: var(--muted); }
.cal-grid button[aria-pressed="true"] .mon { color: var(--bg); }

.filters { display: grid; gap: 8px; }
.group { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: baseline; }
.group > div { display: flex; flex-wrap: wrap; gap: 2px 14px; }
.label { color: var(--faint); }

/* Programme */
.films { list-style: none; margin: 0; padding: 0; }

.film {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) auto;
  gap: 8px 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
}
.poster img {
  display: block;
  width: 80px;
  height: 120px;
  object-fit: cover;
  border-radius: 3px;
  background: var(--rule);
}
.title { font-size: 15px; font-weight: 500; }
.title:hover { text-decoration: underline; text-underline-offset: 3px; }
.meta { color: var(--muted); }

.times {
  list-style: none;
  margin: 0;
  padding: 1px 0 0;
  display: grid;
  align-content: start;
  gap: 2px;
  font-variant-numeric: tabular-nums;
}
.time { display: grid; grid-template-columns: 6.5em 4.6em; gap: 14px; white-space: nowrap; }
.time .day { color: var(--muted); }
.time .at { text-align: right; }
a.time:hover .at { text-decoration: underline; text-underline-offset: 3px; }
.time.sold, .time.sold .day { color: var(--faint); }
.time.sold .at { text-decoration: line-through; }

.empty { color: var(--muted); padding: 32px 0; }
.empty button { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

.foot { color: var(--faint); font-size: 12px; padding: 32px 0 48px; }
.foot a { text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 560px) {
  .head { padding-top: 28px; }
  .film { grid-template-columns: 72px minmax(0, 1fr); grid-template-rows: auto 1fr; gap: 8px 14px; }
  .poster img { width: 72px; height: 108px; }
  .poster { grid-row: span 2; }
  .cal-grid { max-width: none; }
}
