:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --text: #1c1b19;
  --muted: #6b6862;
  --line: #e4e1da;
  --chip: #ecebe6;
  --chip-on: #1c1b19;
  --chip-on-text: #ffffff;
  --accent: #d2481d;
  --ok: #2f7d4f;
  --warn: #b7791f;
  --err: #c0392b;
  --shadow: 0 1px 2px rgb(0 0 0 / 6%), 0 4px 14px rgb(0 0 0 / 5%);
  --c-music: #6d4fd8;
  --c-comedy: #d79b12;
  --c-theatre: #c2384a;
  --c-dance: #d14f9a;
  --c-festival: #e06a1b;
  --c-arts: #1a8c86;
  --c-family: #3b8f3e;
  --c-sport: #2d6cc0;
  --c-other: #7a7670;
  --c-community: #8a8f99;
  /* History charts: categorical slots validated against the white surface. */
  --s1: #2a78d6;
  --s2: #eb6834;
  --s3: #1baf7a;
  --s4: #eda100;
  --s5: #e87ba4;
  --s6: #008300;
  --s7: #4a3aa7;
  --s-other: #b9b6ae;
  --s-none: #d6d3cc;
  --grid: #eceae5;
  --axis: #c3c2b7;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141412;
    --surface: #1e1d1b;
    --text: #efede8;
    --muted: #a19d95;
    --line: #2f2e2b;
    --chip: #2a2926;
    --chip-on: #efede8;
    --chip-on-text: #141412;
    --accent: #ff7a4d;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%);
    /* Dark steps of the same hues, validated against the dark surface. */
    --s1: #3987e5;
    --s2: #d95926;
    --s3: #199e70;
    --s4: #c98500;
    --s5: #d55181;
    --s6: #008300;
    --s7: #9085e9;
    --s-other: #6b6862;
    --s-none: #44423e;
    --grid: #2c2b28;
    --axis: #45433f;
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

.muted {
  color: var(--muted);
}

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 16px 8px;
  max-width: 1280px;
  margin: 0 auto;
}

.top h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.02em;
}

.top p {
  margin: 2px 0 0;
}

.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

button {
  font: inherit;
  cursor: pointer;
}

#refresh {
  border: 0;
  border-radius: 999px;
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

#refresh:disabled {
  opacity: 0.6;
  cursor: progress;
}

.sources {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px 8px;
  font-size: 12.5px;
  color: var(--muted);
}

.source::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: 1px;
  background: var(--muted);
}

.source.ok::before {
  background: var(--ok);
}
.source.skipped::before {
  background: var(--warn);
}
.source.error::before {
  background: var(--err);
}
.source.running::before {
  background: var(--accent);
  animation: pulse 1s infinite alternate;
}

@keyframes pulse {
  to {
    opacity: 0.25;
  }
}

.filters {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 10px 16px;
}

.filter-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 3px 0;
}

.filter-label {
  flex: 0 0 64px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.chip {
  border: 0;
  border-radius: 999px;
  padding: 5px 11px;
  background: var(--chip);
  color: var(--text);
  font-size: 13.5px;
  white-space: nowrap;
}

.chip .n {
  margin-left: 5px;
  font-size: 12px;
  opacity: 0.6;
}

.chip[aria-pressed='true'] {
  background: var(--chip-on);
  color: var(--chip-on-text);
}

.chip:disabled {
  opacity: 0.4;
  cursor: default;
}

.chip.group {
  font-weight: 600;
}

#search {
  flex: 1;
  max-width: 420px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 8px 16px 64px;
}

.day h2 {
  position: sticky;
  top: var(--filters-height, 170px);
  z-index: 1;
  margin: 16px 0 6px;
  padding: 6px 0;
  background: var(--bg);
  font-size: 17px;
  letter-spacing: -0.01em;
}

.day h2 .n {
  margin-left: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  min-width: 0;
}

.poster {
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--cat, var(--c-other));
  overflow: hidden;
  position: relative;
}

.poster img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.poster .initials {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgb(255 255 255 / 85%);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px 12px;
  flex: 1;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-size: 12.5px;
  color: var(--muted);
}

.meta time {
  font-weight: 700;
  color: var(--text);
}

.cat {
  color: var(--cat);
  font-weight: 600;
}

.card h3 {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.card h3 a {
  color: inherit;
  text-decoration: none;
}

.card h3 a:hover {
  text-decoration: underline;
}

.venue {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.tag {
  font-size: 11.5px;
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--chip);
}

.tag.warn {
  background: color-mix(in srgb, var(--warn) 22%, transparent);
}

.foot {
  margin-top: auto;
  padding-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.foot a {
  color: var(--muted);
}

.empty {
  margin: 48px auto;
  max-width: 420px;
  text-align: center;
  color: var(--muted);
}

[data-cat='music'] { --cat: var(--c-music); }
[data-cat='comedy'] { --cat: var(--c-comedy); }
[data-cat='theatre'] { --cat: var(--c-theatre); }
[data-cat='dance'] { --cat: var(--c-dance); }
[data-cat='festival'] { --cat: var(--c-festival); }
[data-cat='arts'] { --cat: var(--c-arts); }
[data-cat='family'] { --cat: var(--c-family); }
[data-cat='sport'] { --cat: var(--c-sport); }
[data-cat='other'] { --cat: var(--c-other); }
[data-cat='community'] { --cat: var(--c-community); }

@media (max-width: 640px) {
  .top h1 {
    font-size: 22px;
  }
  .filters {
    position: static;
  }
  .filter-row {
    flex-direction: column;
    gap: 4px;
  }
  .filter-label {
    flex: none;
  }
  #search {
    max-width: none;
    width: 100%;
  }
  .day h2 {
    top: 0;
  }
  .grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  /* Compact rows on phones: thumbnail left, text right. */
  .card {
    flex-direction: row;
  }
  .poster {
    flex: 0 0 96px;
    aspect-ratio: auto;
    min-height: 96px;
  }
  .poster .initials {
    font-size: 24px;
  }
  .body {
    padding: 8px 10px 10px;
  }
}

/* ---------- tabs ---------- */

.tabs {
  display: flex;
  gap: 4px;
  margin: 6px 0 2px;
}

.tabs a {
  padding: 4px 12px;
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  background: var(--chip);
}

.tabs a[aria-current='page'] {
  background: var(--chip-on);
  color: var(--chip-on-text);
}

body[data-view='history'] #sources,
body[data-view='history'] .filters,
body[data-view='history'] #results,
body[data-view='history'] .actions,
body[data-view='history'] #summary {
  display: none;
}

/* ---------- History ---------- */

.history {
  max-width: 1280px;
  margin: 0 auto;
  padding: 4px 16px 64px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.h-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 8px 0 12px;
  border-bottom: 1px solid var(--line);
}

.h-search {
  position: relative;
  flex: 1 1 320px;
  max-width: 520px;
}

#h-search,
.h-filter input,
.h-filter select,
.h-range select,
.h-unplaced input {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

#h-search {
  width: 100%;
  border-radius: 999px;
  padding: 8px 16px;
}

.h-suggest {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 6px 0;
}

.h-suggest-kind {
  padding: 6px 14px 2px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.h-suggest-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 14px;
  color: var(--text);
  text-decoration: none;
}

.h-suggest-item:hover,
.h-suggest-item[aria-selected='true'] {
  background: var(--chip);
}

.h-suggest-item.all {
  border-top: 1px solid var(--line);
  margin-top: 4px;
  color: var(--muted);
}

.h-range {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--muted);
}

.h-check {
  display: flex;
  align-items: center;
  gap: 4px;
}

.h-nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.h-nav a {
  padding: 5px 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
}

.h-nav a[aria-current='page'] {
  background: var(--chip);
  font-weight: 600;
}

.h-jobbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  font-size: 13.5px;
}

.h-jobbar .h-btn {
  margin-left: auto;
}

.h-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1s infinite alternate;
}

.h-page {
  transition: opacity 0.15s;
}

.h-page.loading {
  opacity: 0.55;
}

.h-head {
  margin: 18px 0 12px;
}

.h-head h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.02em;
}

.h-head p {
  margin: 3px 0 0;
}

.h-crumbs {
  font-size: 13px;
  color: var(--muted);
}

.h-crumbs a,
.h-head a {
  color: inherit;
}

.h-dis {
  font-size: 16px;
  font-weight: 500;
}

.h-sub {
  font-size: 12.5px;
  margin-top: 2px;
}

.h-note {
  font-size: 12.5px;
  margin: 2px 0 8px;
}

.h-warn {
  padding: 8px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--warn) 16%, transparent);
  font-size: 13.5px;
}

.err {
  color: var(--err);
}

.h-greviews li + li {
  margin-top: 10px;
}

.h-quote {
  margin: 3px 0 0;
  font-size: 13.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.h-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.h-tile {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 12px 14px;
}

.h-tile-label {
  font-size: 12.5px;
  color: var(--muted);
}

.h-tile-value {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.h-tile-value.long {
  font-size: 18px;
  line-height: 1.6;
}

.h-tile-sub {
  font-size: 12px;
}

.h-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr));
  align-items: start;
  gap: 14px;
}

.h-card {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin-bottom: 14px;
  min-width: 0;
}

.h-card h3 {
  margin: 0 0 8px;
  font-size: 15.5px;
}

.h-card h3.h-gap {
  margin-top: 16px;
}

.h-chart {
  width: 100%;
  min-height: 40px;
}

.h-zones {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
}

.h-zone {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--chip);
  color: var(--text);
  text-decoration: none;
}

.h-zone:hover {
  background: color-mix(in srgb, var(--chip) 70%, var(--line));
}

.h-zone span {
  font-size: 12.5px;
}

.h-list {
  margin: 0;
  padding-left: 22px;
}

.h-list li {
  padding: 3px 0;
}

.h-list a,
.h-events a,
.viz-barlist a {
  color: var(--text);
}

.h-pill {
  margin-left: 6px;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--chip);
  color: var(--muted);
}

.h-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.h-chip {
  border: 0;
  border-radius: 999px;
  padding: 4px 11px;
  background: var(--chip);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}

.h-chip.on {
  background: var(--chip-on);
  color: var(--chip-on-text);
}

.h-chip .n {
  margin-left: 5px;
  opacity: 0.6;
  font-size: 12px;
}

.h-btn {
  border: 0;
  border-radius: 8px;
  padding: 7px 14px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
}

.h-btn.ghost {
  background: var(--chip);
  color: var(--text);
  font-weight: 500;
}

.h-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.h-job {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 10px;
  align-items: start;
  padding: 7px 0;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
}

.h-job .h-btn {
  width: 100%;
}

.h-keys {
  list-style: none;
  margin: 0;
  padding: 0;
}

.h-keys li {
  padding: 4px 0;
}

.h-keys li.ok strong {
  color: var(--ok);
}

.h-log {
  margin: 0;
  padding-left: 0;
  list-style: none;
  font-size: 12.5px;
  max-height: 220px;
  overflow-y: auto;
}

.h-mini {
  border-collapse: collapse;
  font-size: 13.5px;
  width: 100%;
}

.h-mini th,
.h-mini td {
  text-align: left;
  padding: 5px 8px 5px 0;
  border-top: 1px solid var(--line);
  vertical-align: middle;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.h-mini td.num {
  text-align: right;
}

.h-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 10px;
  margin-bottom: 8px;
}

.h-filter {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: var(--muted);
}

.h-filter.grow {
  flex: 1 1 220px;
}

.h-filter.grow input {
  width: 100%;
}

.h-events {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.h-events th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 6px 10px 6px 0;
  border-bottom: 1px solid var(--line);
}

.h-events td {
  padding: 8px 10px 8px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.h-events .h-date {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.h-headliner {
  font-weight: 600;
}

.h-src {
  font-size: 12.5px;
  color: var(--muted);
}

.h-src a {
  color: var(--muted);
}

.h-events tr.cancelled td {
  text-decoration: line-through;
  opacity: 0.6;
}

.h-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
}

.h-empty {
  max-width: 560px;
  margin: 48px auto;
}

.h-credits {
  margin-top: 28px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

.h-credits a {
  color: var(--muted);
}

/* ---------- charts ---------- */

.viz {
  display: block;
  max-width: 100%;
  overflow: visible;
}

.viz-grid {
  stroke: var(--grid);
  stroke-width: 1;
}

.viz-base {
  stroke: var(--axis);
  stroke-width: 1;
}

.viz-tick {
  fill: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.viz-value {
  fill: var(--text);
  font-size: 11.5px;
  font-weight: 600;
}

.viz-hit {
  fill: transparent;
  outline: none;
}

.viz-hit:hover,
.viz-hit:focus-visible {
  fill: color-mix(in srgb, var(--text) 6%, transparent);
}

.viz-click {
  cursor: pointer;
}

.viz-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 2px 0 8px;
  font-size: 12.5px;
  color: var(--text);
}

.viz-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.viz-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: none;
}

.viz-tip {
  position: absolute;
  z-index: 50;
  pointer-events: none;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 7px 10px;
  font-size: 12.5px;
  max-width: 280px;
}

.viz-tip-title {
  color: var(--muted);
  margin-bottom: 3px;
}

.viz-tip-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.viz-key {
  width: 12px;
  height: 2px;
  border-radius: 1px;
  flex: none;
}

.viz-table {
  margin-top: 6px;
  font-size: 12.5px;
  max-width: 100%;
  overflow-x: auto;
}

.viz-table summary {
  cursor: pointer;
  color: var(--muted);
}

.viz-table table {
  border-collapse: collapse;
  margin-top: 6px;
}

.viz-table th,
.viz-table td {
  padding: 3px 12px 3px 0;
  border-top: 1px solid var(--line);
  text-align: left;
  font-weight: 400;
}

.viz-table .num {
  text-align: right;
}

.viz-barlist {
  list-style: none;
  margin: 0;
  padding: 0;
}

.viz-barlist li {
  padding: 4px 0;
}

.viz-barlist-label {
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

.viz-barlist-track {
  display: grid;
  grid-template-columns: 1fr 88px;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.viz-barlist-lane {
  min-width: 0;
}

.viz-barlist-bar {
  display: block;
  height: 10px;
  border-radius: 0 4px 4px 0;
  background: var(--s1);
}

.viz-barlist-value {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.viz-split {
  display: flex;
  gap: 2px;
  height: 16px;
  border-radius: 4px;
  overflow: hidden;
  margin: 4px 0 10px;
}

.viz-split span {
  min-width: 2px;
}

.viz-split span:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: -2px;
}

/* ---------- History: rankings and extras ---------- */

.h-award {
  margin-left: 5px;
  font-size: 10.5px;
  padding: 0 5px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--warn) 22%, transparent);
  color: var(--text);
  vertical-align: 1px;
}

.h-score {
  font-weight: 600;
  color: var(--text);
}

.h-inline select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.h-mini thead th {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  border-top: 0;
}

.h-mini th.num,
.h-mini thead th.num {
  text-align: right;
}

.h-mix .h-mixbar {
  width: 40%;
  min-width: 90px;
}

.h-mix .viz-split {
  margin: 0;
  height: 10px;
}

@media (max-width: 640px) {
  .h-nav {
    margin-left: 0;
  }
  .h-job {
    grid-template-columns: 1fr;
  }
  /* Event rows stack on phones. */
  .h-events thead {
    display: none;
  }
  .h-events,
  .h-events tbody,
  .h-events tr,
  .h-events td {
    display: block;
    width: 100%;
  }
  .h-events tr {
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
  }
  .h-events td {
    border: 0;
    padding: 1px 0;
  }
  .h-unplaced td,
  .h-unplaced th {
    display: block;
  }
}

/* ---------- lines, clickable chart parts ---------- */

.viz-cross {
  stroke: var(--muted);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  pointer-events: none;
}

.viz-dot {
  stroke: var(--surface);
  stroke-width: 2;
  pointer-events: none;
}

.viz-line {
  pointer-events: none;
}

.viz-label {
  fill: var(--text);
  font-size: 12px;
}

.viz-linkbtn {
  border: 0;
  padding: 0;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--text) 30%, transparent);
  text-underline-offset: 2px;
  cursor: pointer;
}

.viz-linkbtn[aria-pressed='true'] {
  font-weight: 700;
  text-decoration-color: var(--text);
}

.viz-barlist li.on .viz-barlist-bar {
  outline: 2px solid var(--text);
  outline-offset: 1px;
}

.viz-split span.on {
  outline: 2px solid var(--text);
  outline-offset: -2px;
}

/* ---------- venue page: drill-downs, artist table, reviews, compare ---------- */

.h-drill {
  scroll-margin-top: 12px;
}

.h-drill-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
  margin-bottom: 8px;
}

.h-drill-head h3 {
  margin: 0;
}

.h-seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 10px;
}

.h-chiprow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 6px 0;
}

.h-chiprow .h-chiplabel {
  font-size: 12px;
  color: var(--muted);
  min-width: 70px;
}

.h-artists td,
.h-artists th {
  white-space: nowrap;
}

.h-artists td:first-child {
  white-space: normal;
  min-width: 140px;
}

.h-tablewrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.h-reviews {
  list-style: none;
  margin: 0;
  padding: 0;
}

.h-reviews li {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.h-reviews .h-quote {
  margin-top: 4px;
}

.h-reply {
  margin: 6px 0 0 12px;
  padding-left: 10px;
  border-left: 2px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.h-stars {
  letter-spacing: 1px;
  color: var(--text);
}

.h-compare-pick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.h-compare-pick .h-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.h-compare-pick .viz-swatch {
  width: 10px;
  height: 10px;
}

.h-compare th.vh {
  min-width: 110px;
}

.h-splitrow {
  display: grid;
  grid-template-columns: minmax(90px, 160px) 1fr;
  gap: 8px;
  align-items: center;
  margin: 6px 0;
  font-size: 13.5px;
}

.h-splitrow .viz-legend {
  display: none;
}

@media (max-width: 600px) {
  .h-splitrow {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

/* Artist photos: shown from Wikimedia Commons or Deezer, never stored. */
.h-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-right: 8px;
  border-radius: 6px;
  object-fit: cover;
  vertical-align: middle;
  background: var(--chip);
  flex: none;
}

.h-thumb.empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.h-list li.h-withthumb {
  padding: 4px 0;
}

td.h-withthumb {
  white-space: nowrap;
}

.h-artisthead {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.h-photo {
  margin: 0;
  flex: none;
  width: 168px;
}

.h-photo img {
  display: block;
  width: 168px;
  height: 168px;
  object-fit: cover;
  border-radius: 12px;
  background: var(--chip);
}

.h-photo figcaption {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.35;
}

.h-photo figcaption a {
  color: inherit;
}

@media (max-width: 560px) {
  .h-artisthead {
    flex-direction: column;
    gap: 8px;
  }

  .h-photo,
  .h-photo img {
    width: 120px;
  }

  .h-photo img {
    height: 120px;
  }
}

/* Whether a venue is still going. */
.h-status {
  display: inline-block;
  margin-left: 2px;
  padding: 1px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  vertical-align: middle;
  white-space: nowrap;
  background: var(--chip);
  color: var(--muted);
}

.h-head h2 .h-status {
  font-size: 12px;
}

.h-status.s-recent {
  background: color-mix(in srgb, var(--ok) 16%, transparent);
  color: var(--ok);
}

.h-status.s-quiet {
  background: color-mix(in srgb, var(--warn) 18%, transparent);
  color: var(--warn);
}

.h-status.s-closed {
  background: color-mix(in srgb, var(--err) 14%, transparent);
  color: var(--err);
}

.h-sortbtn {
  border: 0;
  padding: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.h-sortbtn:hover {
  color: var(--text);
}

.h-venuetable th,
.h-venuetable td,
.h-zonetable th,
.h-zonetable td {
  padding-right: 12px;
}

.h-venuetable tbody th {
  font-weight: 600;
  min-width: 170px;
}

.h-venuetable td:first-child {
  width: 22px;
}

.h-zonetable td.h-sub {
  font-size: 12.5px;
  min-width: 150px;
}

@media (prefers-color-scheme: dark) {
  .h-status.s-recent {
    color: #74c995;
  }

  .h-status.s-quiet {
    color: #e9b75a;
  }

  .h-status.s-closed {
    color: #f08a7e;
  }
}

/* Wristband header */
.wristband-brand { display:flex; align-items:center; gap:10px; width:max-content; margin:0 0 10px; text-decoration:none; }
.wristband-mark { display:grid; place-items:center; width:34px; height:34px; border-radius:10px; background:#739be4; }
.wristband-mark img { width:30px; height:auto; }
.wristband-brand picture img { display:block; width:116px; height:auto; }

/* Venue page: tiles that open what they count */
.h-tile-btn {
  display: block;
  width: 100%;
  border: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.h-tile-btn:hover {
  box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
}

.h-tile-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Venue page: next and latest shows */
.h-showlist {
  list-style: none;
  margin: 0;
  padding: 0;
}

.h-showlist li {
  display: grid;
  grid-template-columns: 7.5em 1fr;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.h-showday {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Venue page: the latest low review, read first */
.h-alertbox {
  padding: 4px 12px 2px;
  margin-bottom: 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--warn) 12%, transparent);
}

.h-alertbox-title {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 600;
}

.h-alertbox .h-reviews li {
  border-top: 0;
}

/* Venue page: tabs instead of one long page */
.h-tabs {
  display: flex;
  gap: 2px;
  margin: 4px 0 14px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}

.h-tabs button {
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 9px 14px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
}

.h-tabs button:hover {
  color: var(--text);
}

.h-tabs button[aria-selected='true'] {
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

.h-tabs button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* The venue's own row in a comparison table */
.h-mini tr.h-own td {
  font-weight: 600;
}

/* Venue page: the Calendar tab */
.h-cal {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin: 4px 0 8px;
}

.h-cal-head {
  text-align: center;
  font-size: 11.5px;
  color: var(--muted);
}

.h-cal-day {
  position: relative;
  aspect-ratio: 1.5;
  min-width: 0;
  border: 0;
  border-radius: 6px;
  padding: 3px 5px;
  font: inherit;
  font-size: 11px;
  text-align: left;
  vertical-align: top;
  color: var(--muted);
  background: color-mix(in srgb, var(--s2) calc(var(--heat) * 80%), var(--chip));
  cursor: pointer;
}

.h-cal-day span {
  position: absolute;
  top: 3px;
  left: 5px;
  white-space: nowrap;
}

.h-cal-day b {
  position: absolute;
  right: 5px;
  bottom: 3px;
  font-size: 11.5px;
  color: var(--text);
}

.h-cal-day.own {
  box-shadow: inset 0 0 0 2px var(--s1);
  color: var(--text);
  font-weight: 600;
}

.h-cal-day.open {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line);
}

.h-cal-day:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.h-cal-key {
  display: inline-block;
  width: 12px;
  height: 9px;
  border-radius: 2px;
  margin-right: 5px;
}

.h-cal-key.own {
  box-shadow: inset 0 0 0 2px var(--s1);
}

.h-cal-key.busy {
  background: var(--s2);
}

.h-cal-key.open {
  box-shadow: inset 0 0 0 1px var(--muted);
}

.h-nightlist {
  list-style: none;
  margin: 6px 0 10px;
  padding: 0;
  font-size: 13.5px;
}

.h-nightlist li {
  padding: 5px 0;
  border-top: 1px solid var(--line);
}

.h-night h4 {
  margin: 0 0 4px;
}

.h-clash {
  border-top: 1px solid var(--line);
  padding: 8px 0;
  font-size: 13.5px;
}

.h-clash summary {
  cursor: pointer;
}

.h-peer-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 12px; }
.h-peer-card { border: 1px solid var(--line); border-radius: 8px; padding: 14px; min-width: 0; }
.h-peer-card p { margin: 8px 0; }
.h-peer-heading { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.h-peer-heading > a { font-weight: 600; }
.h-peer-heading > .muted { font-size: 12px; }
.h-peer-rank { font-weight: 700; }
.h-peer-detail { margin-top: 10px; font-size: 13px; }
.h-peer-detail summary { cursor: pointer; }
.h-peer-detail summary:focus-visible { outline: 2px solid var(--s1); outline-offset: 3px; }
.h-peer-evidence { line-height: 1.5; overflow-wrap: anywhere; }

.h-average-comparison > .h-chiprow { display: none; }
.h-overview-trends { min-width: 0; }
.h-overview-trends select { max-width: 100%; min-width: 0; }

/* Authenticated venue workspace */
.session-bar { display:flex; align-items:center; flex-wrap:wrap; gap:12px; font-size:13px; margin-left:auto; }
.session-bar select,.session-bar button { padding:8px 10px; max-width:100%; }
body[data-role="venue"] .top .tabs, body[data-role="venue"] #summary, body[data-role="venue"] .top .actions, body[data-role="venue"] .h-search, body[data-role="venue"] .h-credits, body[data-role="venue"] .h-crumbs { display:none; }
body[data-readonly="true"] #refresh { display:none; }
@media(max-width:600px) { .session-bar { width:100%; margin:12px 0 0; } .session-bar span { flex-basis:100%; } body[data-role="venue"] .top { flex-wrap:wrap; } body[data-role="venue"] .h-toolbar { flex-wrap:wrap; } }
@media(max-width:600px) { .h-nav { max-width:100%; overflow-x:auto; flex-shrink:1; } }
