/* ============================================================
   Theatre Buddy — design system
   ============================================================ */

:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f9f9fb;
  --border: #e4e4e8;
  --border-light: #ededf0;
  --text: #1a1a1a;
  --text-2: #555560;
  --text-3: #6e6e7d;
  --accent: #c0392b;
  --accent-bg: #fdf2f0;
  --accent-dark: #96261a;
  --watch: #d97706;
  --watch-bg: #fffbeb;
  --watch-border: #fde68a;
  --seen-dim: 0.6;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --status-now-bg: #dcfce7;
  --status-now-fg: #15803d;
  --status-previews-bg: #fef3c7;
  --status-previews-fg: #b45309;
  --status-upcoming-bg: #ede9fe;
  --status-upcoming-fg: #6d28d9;
  --status-closed-bg: #f3f4f6;
  --status-closed-fg: #6b7280;
  --status-tour-bg: #e0f2fe;
  --status-tour-fg: #0369a1;
  --text-sm: 0.8125rem;
  --text-xs: 0.75rem;
  --header-height: 53px;
  --controls-height: 55px;
  --header-bg: #111118;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-xs: 4px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.07), 0 4px 16px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.07);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

a,
button,
[role="button"],
label {
  touch-action: manipulation;
}

html {
  /* Offset for sticky header + controls bar so anchor-scrolled
     content is not hidden behind the fixed chrome. */
  scroll-padding-top: calc(var(--header-height) + var(--controls-height) + 2px);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ── Skip nav ────────────────────────────────────────────── */
.skip-nav {
  position: absolute;
  top: -100%;
  left: 0;
  padding: var(--space-2) var(--space-4);
  background: var(--text);
  color: #fff;
  font-size: 0.875rem;
  z-index: 9999;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-nav:focus {
  top: 0;
}

/* ── Header ──────────────────────────────────────────────── */
.site-header {
  background: var(--header-bg);
  color: #fff;
  padding: 1.125rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.site-header h1,
.site-header .site-brand {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  flex-shrink: 0;
  margin: 0;
}
.site-header h1 a,
.site-header .site-brand a {
  color: inherit;
}

.tagline {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.45);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quicknav {
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
  margin-left: auto;
}
.quicknav a {
  color: rgba(255, 255, 255, 0.65);
  font-size: var(--text-sm);
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition:
    background 0.15s,
    color 0.15s;
}
.quicknav a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  text-decoration: none;
}

/* ── Controls bar ────────────────────────────────────────── */
.controls {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: var(--header-height);
  z-index: 90;
  padding: var(--space-3) 0;
}
.controls .container {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: wrap;
}

#search {
  flex: 1;
  min-width: 180px;
  max-width: 300px;
  padding: 0.45rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.875rem;
  background: var(--bg);
  color: var(--text);
  outline: none;
  font-family: inherit;
}
#search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

.filter-row {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
}
.filter-group {
  display: inline-flex;
  gap: 0.15rem;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px;
}
.filter-group .filter-btn {
  border-color: transparent;
}
.filter-group .filter-btn:hover {
  border-color: var(--text-3);
  background: var(--surface);
}
.filter-sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 var(--space-1);
}

.site-title-link {
  color: inherit;
  text-decoration: none;
}

.filter-hint {
  font-size: var(--text-xs);
  color: var(--text-muted, #888);
  align-self: center;
  margin-left: auto;
  white-space: nowrap;
}
.filter-hint a {
  color: inherit;
  text-decoration: underline;
}

/* radio-based category filters */
.cat-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}
.cat-radio + .filter,
.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  transition:
    background 0.12s,
    color 0.12s,
    border-color 0.12s;
  white-space: nowrap;
  font-family: inherit;
  user-select: none;
}
.cat-radio + .filter:hover,
.filter-btn:hover {
  border-color: var(--text-3);
  color: var(--text);
}
.cat-radio:checked + .filter,
.filter-btn.active {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}
.filter-btn.watch-active {
  background: var(--watch);
  color: #fff;
  border-color: var(--watch);
}
.cat-radio:focus-visible + .filter {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.count {
  font-size: 0.8rem;
  color: var(--text-3);
  margin-left: auto;
}

.filter-btn--reset {
  margin-left: auto;
  border-color: var(--border);
  color: var(--text-3);
}
.filter-btn--reset:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
}
.filter-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.filter-btn:disabled {
  opacity: 0.6;
  cursor: default;
  pointer-events: none;
}

/* CSS-only category filter */
#main-content:has(#cat-broadway:checked) .theatre[data-category="off-broadway"],
#main-content:has(#cat-broadway:checked) .theatre[data-category="off-off-broadway"],
#main-content:has(#cat-off-broadway:checked) .theatre[data-category="broadway"],
#main-content:has(#cat-off-broadway:checked) .theatre[data-category="off-off-broadway"],
#main-content:has(#cat-off-off-broadway:checked) .theatre[data-category="broadway"],
#main-content:has(#cat-off-off-broadway:checked) .theatre[data-category="off-broadway"] {
  display: none;
}
#main-content:has(#cat-broadway:checked) section#off-broadway,
#main-content:has(#cat-broadway:checked) section#off-off-broadway,
#main-content:has(#cat-off-broadway:checked) section#broadway,
#main-content:has(#cat-off-broadway:checked) section#off-off-broadway,
#main-content:has(#cat-off-off-broadway:checked) section#broadway,
#main-content:has(#cat-off-off-broadway:checked) section#off-broadway {
  display: none;
}

/* Same filter applied to show-items in the Show view */
#main-content:has(#cat-broadway:checked) .show-item[data-category="off-broadway"],
#main-content:has(#cat-broadway:checked) .show-item[data-category="off-off-broadway"],
#main-content:has(#cat-off-broadway:checked) .show-item[data-category="broadway"],
#main-content:has(#cat-off-broadway:checked) .show-item[data-category="off-off-broadway"],
#main-content:has(#cat-off-off-broadway:checked) .show-item[data-category="broadway"],
#main-content:has(#cat-off-off-broadway:checked) .show-item[data-category="off-broadway"] {
  display: none;
}

/* ── Layout ──────────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 max(1.25rem, env(safe-area-inset-right)) 0 max(1.25rem, env(safe-area-inset-left));
}

section.container {
  padding-top: 1.75rem;
  padding-bottom: var(--space-2);
}

section h2 {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
section h2 .muted {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

/* ── Theatre grid ────────────────────────────────────────── */
.theatre-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 0.875rem;
  padding-bottom: var(--space-8);
}

.theatre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.18s;
}
.theatre:hover {
  box-shadow: var(--shadow);
}

/* theatre header */
.theatre-header {
  padding: 0.875rem 1rem 0.625rem;
  border-bottom: 1px solid var(--border-light);
}
.theatre h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.theatre .meta {
  font-size: 0.75rem;
  color: var(--text-3);
  margin-top: 0.2rem;
  line-height: 1.35;
}
.theatre .links {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: var(--space-2);
}
.theatre .links a {
  font-size: 0.7rem;
  color: var(--text-2);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  transition:
    border-color 0.12s,
    color 0.12s;
}
.theatre .links a:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
.theatre .links a.link-seating,
.show-detail-venue a.link-seating {
  border-color: rgba(90, 138, 90, 0.4);
  color: #4aab7f;
  background: rgba(74, 171, 127, 0.08);
}
.theatre .links a.link-seating:hover,
.show-detail-venue a.link-seating:hover {
  border-color: #4aab7f;
  background: rgba(74, 171, 127, 0.15);
}

/* ── Show list ───────────────────────────────────────────── */
.shows {
  list-style: none;
}

.show {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0 var(--space-2);
  padding: 0.625rem var(--space-4);
  border-bottom: 1px solid var(--border-light);
  transition:
    background 0.12s,
    opacity 0.2s;
}
.show:last-child {
  border-bottom: none;
}
.show:hover {
  background: var(--surface-2);
}

.show-main {
  min-width: 0;
  display: flex;
  gap: 0.625rem;
  align-items: flex-start;
}
.show-content {
  flex: 1;
  min-width: 0;
}

/* Show poster thumbnails */
.show-poster {
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  display: block;
  box-shadow: var(--shadow-sm);
}
.show .show-poster {
  width: 52px;
  height: 69px;
}
.show-item .show-poster {
  width: 72px;
  height: 96px;
}

.show-title-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.show-title {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}
.show-title:hover {
  text-decoration: underline;
  color: var(--accent);
}
.show-meta {
  font-size: 0.75rem;
  color: var(--text-3);
  margin-top: 0.2rem;
}
.show-links {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}
.show-links a {
  font-size: 0.725rem;
  font-weight: 500;
  color: var(--accent-dark);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  background: var(--accent-bg);
  border: 1px solid rgba(192, 57, 43, 0.15);
  transition: opacity 0.12s;
}
.show-links a:hover {
  opacity: 0.75;
  text-decoration: none;
}

/* status badges */
.status {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-xs);
  vertical-align: middle;
  flex-shrink: 0;
}
.status.now {
  background: var(--status-now-bg);
  color: var(--status-now-fg);
}
.status.previews {
  background: var(--status-previews-bg);
  color: var(--status-previews-fg);
}
.status.upcoming {
  background: var(--status-upcoming-bg);
  color: var(--status-upcoming-fg);
}
.status.closed {
  background: var(--status-closed-bg);
  color: var(--status-closed-fg);
}
.status.tour {
  background: var(--status-tour-bg);
  color: var(--status-tour-fg);
}

/* ── Tracking buttons ────────────────────────────────────── */
.show-actions {
  display: flex;
  flex-direction: column;
  gap: 0;
  align-self: start;
}
.btn-track {
  min-width: 44px;
  min-height: 44px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  color: var(--border);
  transition:
    background 0.12s,
    color 0.12s;
  padding: 0;
  line-height: 1;
}
.btn-track:hover {
  background: var(--bg);
  color: var(--text-3);
}
.btn-track:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-track.is-watchlist {
  color: var(--watch);
}

/* Show action labels on touch-primary devices */
@media (pointer: coarse) and (max-width: 480px) {
  .show-actions:not(.show-detail-track) {
    flex-direction: row;
    align-self: center;
    justify-content: flex-end;
    gap: 0;
    width: 100%;
    padding-top: 0.375rem;
    border-top: 1px solid var(--border-light);
    grid-column: 1 / -1;
  }
  .show-actions:not(.show-detail-track) .btn-track {
    flex-direction: column;
    gap: 0.15rem;
    font-size: var(--text-xs);
    min-width: 48px;
    min-height: 48px;
    flex: 1;
  }
  .btn-watch::after {
    content: "Save";
    font-size: 0.6rem;
  }
  .btn-seen::after {
    content: "Seen";
    font-size: 0.6rem;
  }
  .btn-skip::after {
    content: "Hide";
    font-size: 0.6rem;
  }
  .btn-note::after {
    content: "Note";
    font-size: 0.6rem;
  }
  .btn-seen.is-seen::after {
    content: "Seen";
  }
}

/* Seen counter — show the number in a small filled badge.
   font-size is set once here; the coarse-pointer override below still applies. */
.btn-seen.is-seen {
  background: var(--text-2);
  color: #fff;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 22px;
}
.btn-seen.is-seen:hover {
  background: var(--text);
}

/* seen: dim the whole row */
.show.state-seen,
.show-item.state-seen {
  opacity: var(--seen-dim);
}
.show.state-seen .show-title,
.show-item.state-seen .show-title {
  text-decoration: line-through;
}
/* when filtering to seen-only or closed-only, show seen shows at full opacity without strikethrough */
body.filter-seen-only .show.state-seen,
body.filter-seen-only .show-item.state-seen,
body.filter-closed-only .show.state-seen,
body.filter-closed-only .show-item.state-seen {
  opacity: 1;
}
body.filter-seen-only .show.state-seen .show-title,
body.filter-seen-only .show-item.state-seen .show-title,
body.filter-closed-only .show.state-seen .show-title,
body.filter-closed-only .show-item.state-seen .show-title {
  text-decoration: none;
}

/* watchlist: subtle highlight */
.show.state-watchlist,
.show-item.state-watchlist {
  background: var(--watch-bg);
  border-left: 3px solid var(--watch);
}
.show.state-watchlist:hover {
  background: #fff8e1;
}

/* hidden by filter */
.show.filter-hidden,
.show-item.filter-hidden {
  display: none;
}
/* .theatre.hide and .theatre.filter-hidden are DISTINCT states — do not
   consolidate. search.js applies .hide to theatre cards for view/search
   misses; tracking.js applies .filter-hidden for tracking filters
   (watchlist, seen, hidden). tracking.js line 319 explicitly checks for
   both classes. */
.theatre.filter-hidden {
  display: none;
}
.theatre.hide {
  display: none;
}

/* ── Placeholder shows ───────────────────────────────────── */
.show.placeholder {
  background: var(--surface-2);
  grid-template-columns: 1fr;
}
.show.placeholder .show-meta {
  font-style: italic;
  color: var(--text-3);
}

/* ── First-visit onboarding callout ─────────────────────── */
.container:has(#onboarding-callout) {
  padding-top: var(--space-2);
  padding-bottom: 0;
}
.onboarding-callout {
  background: var(--accent-bg);
  border: 1px solid #f0c8c4;
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
}
.onboarding-callout[hidden] {
  display: none;
}
.onboarding-body {
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.45;
}
.onboarding-body strong {
  color: var(--text);
  font-weight: 600;
}
.onboarding-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: 0.375rem;
}
.onboarding-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.2rem var(--space-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-2);
}
.onboarding-dismiss {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  font-size: 1rem;
  padding: 0.125rem;
  line-height: 1;
  border-radius: var(--radius-sm);
}
.onboarding-dismiss:hover {
  color: var(--text);
  background: var(--border-light);
}
.onboarding-dismiss:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── View toggle ─────────────────────────────────────────── */
.view-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg);
}
.view-btn {
  padding: 0.3rem 0.75rem;
  font-size: var(--text-sm);
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  font-family: inherit;
  transition:
    background 0.12s,
    color 0.12s;
}
.view-btn.active {
  background: var(--text);
  color: #fff;
  border-radius: 999px;
}
.view-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* ── Show list view ──────────────────────────────────────── */
.show-list-container {
  padding-top: var(--space-4);
  padding-bottom: var(--space-8);
}
.show-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 0.625rem;
}
.show-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0 var(--space-2);
  box-shadow: var(--shadow-sm);
  transition:
    box-shadow 0.15s,
    opacity 0.2s;
}
.show-item:hover {
  box-shadow: var(--shadow);
}
.show-item-venue {
  font-size: 0.775rem;
  color: var(--text-3);
  margin-top: 0.2rem;
}
.show-item.state-closing-soon-watch .show-title::after,
.show.state-closing-soon-watch .show-title::after {
  content: " ⚡";
  font-size: 0.75em;
  color: var(--accent);
  font-style: normal;
}

/* filter dropdowns */
.filter-select {
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  outline: none;
}
.filter-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

/* closing date change badges */
.closing-change {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-xs);
  cursor: default;
  white-space: nowrap;
}
.closing-change--extended {
  background: var(--status-now-bg);
  color: var(--status-now-fg);
}
.closing-change--shortened {
  background: #fee2e2;
  color: #b91c1c;
}
.closing-change--updated {
  background: #fef9c3;
  color: #854d0e;
}
details.closing-change {
  display: inline-block;
  cursor: pointer;
}
details.closing-change summary {
  list-style: none;
}
details.closing-change summary::-webkit-details-marker {
  display: none;
}
.extension-list {
  margin: 0.35rem 0 0;
  padding: 0.35rem 0.5rem;
  list-style: none;
  font-size: 0.75rem;
  font-weight: 400;
  white-space: normal;
  background: #f0fdf4;
  border-radius: var(--radius-xs);
}
.extension-list li + li {
  margin-top: 0.2rem;
}
.ext-detected {
  color: var(--text-3);
}

/* closed shows — dim and suppress ticket links (historical record only) */
.show[data-status="closed"],
.show-item[data-status="closed"] {
  opacity: 0.5;
  background: var(--surface-2);
}
.show[data-status="closed"] .show-title,
.show-item[data-status="closed"] .show-title {
  color: var(--text-3);
}
/* when filtering to closed-only or seen-only, show closed shows at full opacity */
body.filter-closed-only .show[data-status="closed"],
body.filter-closed-only .show-item[data-status="closed"],
body.filter-seen-only .show[data-status="closed"],
body.filter-seen-only .show-item[data-status="closed"] {
  opacity: 1;
  background: var(--surface);
}
body.filter-closed-only .show[data-status="closed"] .show-title,
body.filter-closed-only .show-item[data-status="closed"] .show-title,
body.filter-seen-only .show[data-status="closed"] .show-title,
body.filter-seen-only .show-item[data-status="closed"] .show-title {
  color: var(--text);
  text-decoration: none;
}
.show[data-status="closed"] .show-links,
.show-item[data-status="closed"] .show-links {
  display: none;
}

/* not-interested / skipped show items — revealed in "Show hidden" mode */
.show.state-skipped,
.show-item.state-skipped {
  opacity: 0.35;
}
.show.state-skipped .show-title,
.show-item.state-skipped .show-title {
  text-decoration: line-through;
  color: var(--text-3);
}
.theatre.state-skipped {
  opacity: 0.45;
}
/* in hidden-only mode, show skipped items at full opacity */
body.filter-hidden-only .show.state-skipped,
body.filter-hidden-only .show-item.state-skipped {
  opacity: 1;
}
body.filter-hidden-only .show.state-skipped .show-title,
body.filter-hidden-only .show-item.state-skipped .show-title {
  text-decoration: none;
  color: var(--text);
}
body.filter-hidden-only .theatre.state-skipped {
  opacity: 1;
}

/* skip button active state */
.btn-skip.is-skipped {
  color: var(--accent);
}

/* theatre header: name + hide button side by side */
.theatre-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
}
.theatre-title-row h3 {
  flex: 1;
}
.btn-skip-venue {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--border);
  font-size: 0.875rem;
  padding: var(--space-1) 0.35rem;
  border-radius: var(--radius-xs);
  line-height: 1;
  transition:
    color 0.12s,
    background 0.12s;
}
.btn-skip-venue:hover {
  color: var(--accent);
  background: var(--accent-bg);
}
.btn-skip-venue:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn-skip-venue.is-skipped {
  color: var(--accent);
}

/* Visibility utilities — all three require !important to override tracking
   state background rules that have higher specificity.
   .u-hidden       — JS-toggled general hidden (view switching, etc.)
   .search-hidden  — applied by search.js to items that don't match text
                     search or the current view
   .filter-hidden  — applied by tracking.js to items hidden by tracking
                     filters (watchlist / seen / hidden) */
.u-hidden {
  display: none !important;
}
.search-hidden {
  display: none !important;
}
section.filter-hidden {
  display: none !important;
}

/* ── Resource cards (tickets.html) ───────────────────────── */
.resources {
  padding: 1.75rem 0 var(--space-8);
}
.lede {
  font-size: 0.9375rem;
  color: var(--text-2);
  margin-bottom: var(--space-4);
}

/* 250px minimum is intentional — resource cards are more compact than
   theatre cards (340px) and benefit from the tighter column floor. */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.875rem;
}
.resource {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.125rem;
}
.resource h3 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-3);
  margin-bottom: 0.625rem;
}
.resource ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.resource li {
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.4;
}
.resource a {
  color: var(--text);
  font-weight: 600;
}
.resource a:hover {
  text-decoration: underline;
}

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  margin-top: 3rem;
  padding: var(--space-6) 0;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.site-footer p {
  font-size: 0.8125rem;
  color: var(--text-3);
  text-align: center;
}
.bo-footnote {
  font-size: 0.75rem;
  margin-top: 0.375rem;
}

/* ── Disclaimer / about ──────────────────────────────────── */
.disclaimer {
  padding: var(--space-8) 0 3rem;
}
.disclaimer p {
  color: var(--text-2);
  font-size: 0.9375rem;
  margin-bottom: var(--space-3);
}
.disclaimer .meta {
  color: var(--text-3);
  font-size: 0.875rem;
}

/* ── Show detail page ────────────────────────────────────── */
.show-detail {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2.5rem;
  padding-top: var(--space-8);
  padding-bottom: 3rem;
  align-items: start;
}

.show-detail-poster img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: block;
}

.show-detail-title-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-wrap: wrap;
  margin-bottom: 0.375rem;
}
.show-detail-title-row h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.btn-share {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.2em 0.55em;
  font-size: 0.75rem;
  cursor: pointer;
  color: var(--text-3);
  line-height: 1;
}
.btn-share:hover {
  background: var(--surface-2);
  color: var(--text-2);
}

.show-detail-venue {
  font-size: 0.9375rem;
  color: var(--text-2);
  margin-bottom: 1.25rem;
}
.show-detail-venue a {
  color: var(--text-2);
  font-weight: 600;
}
.show-detail-venue a:hover {
  color: var(--accent);
}

.show-detail-meta {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 1.25rem;
}
.show-detail-meta th,
.show-detail-meta td {
  padding: 0.3rem 0;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}
.show-detail-meta th {
  width: 90px;
  color: var(--text-3);
  font-weight: 500;
  text-align: left;
}
.show-detail-meta td {
  color: var(--text);
}

.show-detail-history {
  margin-bottom: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.show-detail-links h3 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  margin-bottom: 0.625rem;
}
.show-links--large a {
  font-size: 0.875rem;
  padding: 0.4rem 0.875rem;
}

/* ── Box office hours ────────────────────────────────────────────────── */
.box-office-hours {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) 0.625rem;
  font-size: 0.72rem;
  color: var(--text-3);
  margin: 0.375rem 0 0.25rem;
  align-items: baseline;
}
.bo-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  width: 100%;
  margin-bottom: 0.1rem;
}
.bo-row {
  display: inline-flex;
  gap: 0.3rem;
  white-space: nowrap;
}
.bo-days {
  font-weight: 500;
  color: var(--text-2);
}
.bo-time {
  color: var(--text-3);
}
.bo-note {
  font-size: 0.68rem;
  font-style: italic;
  color: var(--text-3);
  width: 100%;
}
/* On the show detail page, give more space */
.show-detail-bo .box-office-hours {
  font-size: 0.8125rem;
  margin-bottom: var(--space-3);
}
.show-detail-bo .bo-days {
  color: var(--text);
}
.show-detail-bo .bo-time {
  color: var(--text-2);
}

.show-detail-schedule {
  margin-bottom: 1.25rem;
}
.show-detail-schedule h3 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  margin-bottom: var(--space-2);
}
.schedule-dark td,
.schedule-dark th {
  color: var(--text-3);
  font-style: italic;
}
.schedule-caveat {
  font-size: 0.75rem;
  color: var(--text-3);
  margin-top: 0.375rem;
  font-style: italic;
}
.schedule-source {
  font-size: 0.75rem;
  color: var(--text-3);
  margin-top: 0.375rem;
}

.show-detail-track {
  margin-top: var(--space-6);
  flex-direction: row;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.show-detail-track .btn-track {
  width: auto;
  height: auto;
  padding: 0.4rem 0.875rem;
  border: 1px solid var(--border);
  font-size: 0.8125rem;
  gap: 0.3rem;
  color: var(--text-2);
}
.show-detail-track .btn-track:hover {
  border-color: var(--text-3);
  color: var(--text);
  background: var(--bg);
}
.show-detail-track .btn-track.is-watchlist {
  color: var(--watch);
  border-color: var(--watch-border);
  background: var(--watch-bg);
}
.show-detail-track .btn-seen.is-seen {
  background: var(--text-2);
  color: #fff;
  border-color: var(--text-2);
  border-radius: var(--radius-sm);
}
.show-detail-track .btn-skip.is-skipped {
  color: var(--accent);
  border-color: var(--accent);
}
.show-detail-rating {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  padding-top: var(--space-1);
}
.rating-label {
  font-size: 0.8125rem;
  color: var(--text-2);
  white-space: nowrap;
}
.btn-rate {
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  cursor: pointer;
  background: transparent;
  color: var(--text-2);
}
.btn-rate:hover {
  border-color: var(--text-3);
  color: var(--text);
  background: var(--bg);
}
.btn-rate.is-current {
  background: var(--text-2);
  color: #fff;
  border-color: var(--text-2);
}

/* ── Category ratings ────────────────────────────────────── */
.cat-ratings-panel {
  width: 100%;
  margin-top: 0.375rem;
}
.cat-ratings-summary {
  font-size: 0.8125rem;
  color: var(--text-2);
  cursor: pointer;
  padding: 0.2rem 0;
  list-style: none;
  user-select: none;
}
.cat-ratings-summary::-webkit-details-marker {
  display: none;
}
.cat-ratings-summary::before {
  content: "▸ ";
  font-size: 0.7rem;
  opacity: 0.6;
}
details[open] .cat-ratings-summary::before {
  content: "▾ ";
}
.cat-ratings-body {
  padding-top: 0.625rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}
.cat-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.cat-group-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.125rem;
}
.cat-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.cat-label {
  font-size: 0.8125rem;
  color: var(--text-2);
  min-width: 130px;
}
.cat-stars {
  display: flex;
  gap: 0.0625rem;
}
.btn-cat-star {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--border);
  padding: 0.125rem;
  line-height: 1;
  transition: color 0.1s;
}
.btn-cat-star:hover,
.btn-cat-star.is-set {
  color: var(--accent);
}

/* ── Notes ───────────────────────────────────────────────── */
#note-panel {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
#note-panel[hidden] {
  display: none;
}
.note-panel-box {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  width: 100%;
  max-width: 380px;
  margin: var(--space-4);
}
.note-panel-label {
  font-size: 0.8125rem;
  color: var(--text-2);
  margin-bottom: 0.625rem;
}
.note-panel-label strong {
  color: var(--text);
}
#note-panel-text {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  font-size: 0.875rem;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
  background: var(--surface);
  color: var(--text);
}
#note-panel-text:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}
.note-panel-actions {
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
  margin-top: var(--space-3);
}
.btn-note {
  font-size: 0.875rem;
  color: var(--text-3);
}
.btn-note.has-note {
  color: var(--accent);
}
/* Note button on list items */
.li-note {
  background: none;
  border: none;
  font-size: 0.875rem;
  color: var(--text-3);
  cursor: pointer;
  padding: 0.125rem 0.25rem;
  border-radius: var(--radius-sm);
  opacity: 0;
  flex-shrink: 0;
}
.li:hover .li-note,
.li-note.has-note {
  opacity: 1;
}
.li-note.has-note {
  color: var(--accent);
}
.li-note:hover {
  background: var(--accent-bg);
  color: var(--accent);
  opacity: 1;
}
/* Show detail page note section */
.show-detail-last-seen {
  margin-top: var(--space-2);
  font-size: 0.8125rem;
  color: var(--text-3);
  font-style: italic;
}
.show-detail-note {
  margin-top: 1.25rem;
  padding: 0.875rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}
.show-detail-note-heading {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  margin-bottom: 0.375rem;
}
.show-detail-note-text {
  font-size: 0.875rem;
  color: var(--text-2);
  white-space: pre-wrap;
  line-height: 1.5;
}

/* Tier move button */
.li-move {
  background: none;
  border: none;
  font-size: 0.875rem;
  color: var(--text-3);
  cursor: pointer;
  padding: 0.125rem 0.25rem;
  border-radius: var(--radius-sm);
  opacity: 0;
  flex-shrink: 0;
}
.li:hover .li-move {
  opacity: 1;
}
.li-move:hover {
  background: var(--bg);
  color: var(--text-2);
  opacity: 1;
}
/* Tier move menu */
.tier-menu {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: var(--space-1);
  min-width: 150px;
  z-index: 500;
}
.tier-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.4rem 0.75rem;
  border: none;
  background: none;
  font-size: 0.875rem;
  font-family: inherit;
  cursor: pointer;
  border-radius: var(--radius-sm);
  color: var(--text);
}
.tier-menu-item:hover:not(.is-current) {
  background: var(--bg);
}
.tier-menu-item.is-current {
  color: var(--text-3);
  font-style: italic;
  cursor: default;
}

/* ── Updates page ────────────────────────────────────────── */
.updates-page {
  max-width: 680px;
  padding-top: var(--space-8);
  padding-bottom: 4rem;
}
.updates-hd {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.updates-title {
  flex: 1;
  font-size: 1.375rem;
}
.updates-filter {
  display: flex;
  gap: var(--space-1);
}
.updates-hint {
  font-size: 0.8125rem;
  color: var(--text-3);
  margin-bottom: 1.25rem;
}
.upd-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.upd-item {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.upd-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  width: 1.5rem;
  text-align: center;
  margin-top: 0.1rem;
}
.upd--extended {
  color: var(--status-now-fg);
}
.upd--shortened {
  color: var(--accent);
}
.upd--announced {
  color: var(--text-3);
}
.upd--updated {
  color: var(--text-3);
}
.upd--cancelled {
  color: var(--accent);
}
.upd--relocated {
  color: #1d4ed8;
}
.upd--ownership {
  color: var(--text-2);
}
.upd--cast-joined {
  color: var(--status-now-fg);
}
.upd--cast-departed {
  color: var(--text-3);
}
.upd-body {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-2);
}
.upd-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
.upd-title:hover {
  text-decoration: underline;
}
.upd-venue {
  font-size: 0.8125rem;
  color: var(--text-3);
}
.upd-closed {
  font-size: 0.6875rem;
  background: var(--bg);
  color: var(--text-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 0 0.3rem;
}
.upd-change {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-2);
}
.upd-detail {
  width: 100%;
  font-size: 0.875rem;
  color: var(--text-2);
  margin: 0.125rem 0 0;
}
.upd-source {
  width: 100%;
  font-size: 0.75rem;
  color: var(--text-3);
}
a.upd-source {
  color: var(--text-3);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a.upd-source:hover {
  color: var(--text-2);
}
.upd-recorded {
  width: 100%;
  font-size: 0.75rem;
  color: var(--text-3);
}
.upd-track-badge {
  font-size: 0.75rem;
  padding: 0.125rem 0.4rem;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.upd-track--watch {
  background: var(--watch-bg);
  color: var(--watch);
  border: 1px solid var(--watch-border);
}
.upd-track--seen {
  background: var(--accent-bg);
  color: var(--accent);
  border: 1px solid var(--accent);
}

.lists-page {
  max-width: 680px;
  padding-top: var(--space-8);
  padding-bottom: 4rem;
}
.lists-hd {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: 1.25rem;
}
.lists-title {
  flex: 1;
  font-size: 1.375rem;
}
#list-actions {
  display: flex;
  gap: var(--space-2);
}
.data-btns {
  display: flex;
  gap: var(--space-1);
}
.btn-data {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.625rem;
  font-size: 0.8125rem;
  color: var(--text-3);
  cursor: pointer;
}
.btn-data:hover {
  color: var(--text-2);
  border-color: var(--text-3);
}
.import-choices {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}
.import-choice {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}
.import-choice button {
  flex-shrink: 0;
  width: 7rem;
}
.import-choice p {
  font-size: 0.8125rem;
  color: var(--text-2);
  line-height: 1.4;
  margin-top: 0.4rem;
}
.btn-new-list {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-new-list:hover {
  background: var(--accent-dark);
}

/* Tabs */
.list-tabs {
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.75rem;
}
.list-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: var(--space-2) 0.875rem;
  font-size: 0.875rem;
  color: var(--text-2);
  cursor: pointer;
  margin-bottom: -1px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.list-tab:hover {
  color: var(--text);
  background: var(--bg);
}
.list-tab.is-active {
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

/* List content area */
.list-content {
  min-height: 8rem;
}
.list-empty {
  color: var(--text-3);
  font-size: 0.875rem;
  padding: var(--space-8) 0;
}
.list-hint {
  color: var(--text-3);
  font-size: 0.8125rem;
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* Tier blocks */
.tier-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.tier-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.tier-hd {
  display: flex;
  align-items: center;
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--border-light);
  gap: var(--space-2);
}
.tier-name {
  flex: 1;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.tier-btns {
  display: flex;
  gap: var(--space-1);
}
.btn-tier-action {
  background: none;
  border: none;
  font-size: 0.75rem;
  color: var(--text-3);
  cursor: pointer;
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-sm);
}
.btn-tier-action:hover {
  color: var(--text-2);
  background: var(--bg);
}
.btn-add-tier {
  background: none;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-2) 0.875rem;
  font-size: 0.8125rem;
  color: var(--text-3);
  cursor: pointer;
  width: 100%;
}
.btn-add-tier:hover {
  border-color: var(--text-3);
  color: var(--text-2);
}

/* Drop zones */
.drop-ul {
  list-style: none;
  min-height: 2.5rem;
  padding: var(--space-1) 0;
}
.flat-ul {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* List items */
.li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0.75rem;
  cursor: default;
  border-bottom: 1px solid var(--border-light);
}
.li:last-child {
  border-bottom: none;
}
.li--dragging {
  opacity: 0.35;
}
.li--selected {
  background: var(--accent-bg);
  border-left: 2px solid var(--accent);
  padding-left: calc(0.75rem - 2px);
}
.selection-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0.375rem 0.75rem;
  background: var(--accent-bg);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-4);
  font-size: 0.8125rem;
}
.selection-bar-count {
  flex: 1;
  color: var(--text-2);
  font-weight: 500;
}
.selection-bar-clear {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: 0.8125rem;
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-sm);
}
.selection-bar-clear:hover {
  color: var(--text-2);
  background: var(--bg);
}

.li-handle {
  color: var(--text-3);
  cursor: grab;
  font-size: 1rem;
  flex-shrink: 0;
  user-select: none;
}
.li-handle:active {
  cursor: grabbing;
}
.li-rank {
  width: 1.75rem;
  text-align: right;
  color: var(--text-3);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.li-title {
  flex: 1;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.li-venue {
  font-size: 0.75rem;
  color: var(--text-3);
  white-space: nowrap;
  flex-shrink: 0;
}
.li-badge {
  font-size: 0.6875rem;
  background: var(--bg);
  color: var(--text-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 0 0.3rem;
  flex-shrink: 0;
}
.li-reorder {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex-shrink: 0;
  opacity: 0;
}
.li:hover .li-reorder {
  opacity: 1;
}
.li-up,
.li-down {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 0.7rem;
  cursor: pointer;
  min-width: 28px;
  min-height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  line-height: 1;
}
.li-up:hover,
.li-down:hover {
  color: var(--text);
  background: var(--bg);
}
.li-up:focus-visible,
.li-down:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
@media (pointer: coarse) {
  .li-reorder {
    opacity: 1;
  }
  .li-up,
  .li-down {
    min-width: 36px;
    min-height: 30px;
  }
  .quicknav a {
    min-height: 44px;
    padding: 0.625rem 0.85rem;
    display: inline-flex;
    align-items: center;
  }
  .cat-radio + .filter,
  .filter-btn,
  .view-btn,
  .filter-select {
    min-height: 44px;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
  }
  .li-note,
  .li-remove,
  .li-move {
    opacity: 1;
  }
}
.li-remove {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.125rem 0.25rem;
  border-radius: var(--radius-sm);
  opacity: 0;
  flex-shrink: 0;
}
.li:hover .li-remove {
  opacity: 1;
}
.li-remove:hover {
  color: var(--accent);
  background: var(--accent-bg);
}
.li-empty {
  font-size: 0.8125rem;
  color: var(--text-3);
  font-style: italic;
  padding: 0.625rem 0.75rem;
}
.li-drop-indicator {
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  margin: 1px 0.75rem;
  list-style: none;
  pointer-events: none;
}

/* Mode toggle (flat ↔ tiered) */
.btn-mode-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--text-3);
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-mode-toggle:hover {
  color: var(--text-2);
  border-color: var(--text-3);
}

/* Add-show search */
.add-show {
  position: relative;
  margin-bottom: var(--space-4);
}
.add-show-input {
  width: 100%;
  padding: var(--space-2) 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  background: var(--surface);
  color: var(--text);
}
.add-show-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}
.add-show-results {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  list-style: none;
  z-index: 50;
  max-height: 14rem;
  overflow-y: auto;
}
.add-show-hit {
  padding: var(--space-2) 0.75rem;
  font-size: 0.875rem;
  cursor: pointer;
}
.add-show-hit:hover {
  background: var(--bg);
}
.add-show-venue {
  color: var(--text-3);
  font-size: 0.8125rem;
}

/* Delete list button */
.btn-danger {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  color: var(--text-3);
  cursor: pointer;
  padding: 0.375rem 0.75rem;
}
.btn-danger:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* New list modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal[hidden] {
  display: none;
}
.modal-box {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--space-6);
  width: 100%;
  max-width: 400px;
  margin: var(--space-4);
}
.modal-title {
  font-size: 1.125rem;
  margin-bottom: 1.25rem;
}
.modal-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: var(--space-4);
  border: none;
  padding: 0;
}
.modal-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-2);
}
.modal-field input[type="text"] {
  padding: var(--space-2) 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  background: var(--surface);
  color: var(--text);
}
.modal-field input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}
.modal-type {
  gap: var(--space-1);
}
.modal-radio {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: var(--space-2) 0.625rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.875rem;
}
.modal-radio:has(input:checked) {
  background: var(--accent-bg);
}
.modal-radio small {
  color: var(--text-3);
  font-size: 0.75rem;
  margin-left: 1.4rem;
}
.modal-actions {
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
  margin-top: var(--space-6);
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.4375rem var(--space-4);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary:hover {
  background: var(--accent-dark);
}
.btn-ghost {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4375rem 0.875rem;
  font-size: 0.875rem;
  color: var(--text-2);
  cursor: pointer;
}
.btn-ghost:hover {
  border-color: var(--text-3);
  color: var(--text);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .show-detail {
    grid-template-columns: 200px 1fr;
    gap: var(--space-6);
  }
  .show-detail-poster {
    max-width: 200px;
  }
}

@media (max-width: 640px) {
  :root {
    /* Header collapses to ~46px at narrow widths (tagline hidden, no wrap) */
    --header-height: 46px;
  }
  .theatre-grid {
    grid-template-columns: 1fr;
  }
  .tagline {
    display: none;
  }
  .controls {
    top: var(--header-height);
  }
  #search {
    max-width: none;
  }
  .show-detail {
    grid-template-columns: 1fr;
  }
  .show-detail-title-row h1 {
    font-size: 1.375rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
