:root {
  color-scheme: light;
  --bg: #f5f6f2;
  --surface: #ffffff;
  --surface-2: #eef1eb;
  --surface-3: #f8f9f5;
  --text: #242424;
  --muted: #8990a2;
  --line: #e1e5dc;
  --accent: #f05335;
  --accent-2: #ff8a4a;
  --accent-soft: #fff0eb;
  --accent-3: #31bd82;
  --ok: #31bd82;
  --hero-tint: rgba(49, 189, 130, 0.08);
  --hero-overlay: rgba(245, 246, 242, 0.78);
  --shadow: none;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root.dark-theme {
  color-scheme: dark;
  --bg: #121211;
  --surface: #1b1c1f;
  --surface-2: #25272c;
  --surface-3: #151619;
  --text: #f5f1ea;
  --muted: #a4a9b7;
  --line: #343840;
  --accent: #ff6746;
  --accent-2: #ff9a55;
  --accent-soft: rgba(255, 103, 70, 0.14);
  --accent-3: #4bd592;
  --ok: #4bd592;
  --hero-tint: rgba(255, 103, 70, 0.08);
  --hero-overlay: rgba(18, 18, 17, 0.8);
  --shadow: none;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-width: 320px;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

.app-hero {
  position: relative;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto 1fr;
  background:
    linear-gradient(90deg, var(--hero-tint), transparent 56%),
    var(--bg);
  border-bottom: 1px solid var(--line);
}

.hero-image,
.hero-overlay {
  position: absolute;
  inset: 0;
}

.hero-image {
  width: min(390px, 42vw);
  height: min(245px, 38vw);
  top: 92px;
  right: max(16px, calc((100vw - 1180px) / 2));
  left: auto;
  bottom: auto;
  object-fit: cover;
  border-radius: 8px;
  opacity: 0.18;
  filter: saturate(0.85) contrast(0.95);
  z-index: -2;
}

.hero-overlay {
  background: var(--hero-overlay);
  z-index: -1;
}

.topbar {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--text);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  display: block;
  object-fit: cover;
  border: 1px solid var(--line);
  box-shadow: none;
}

.icon-button,
.ghost-link {
  min-height: 38px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.icon-button {
  width: 38px;
  cursor: pointer;
}

.ghost-link {
  padding: 0 14px;
  font-weight: 700;
}

.hero-content {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  align-content: center;
  gap: 24px;
  padding: 42px 0 46px;
}

.hero-copy {
  max-width: 730px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.74rem;
  font-weight: 850;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(2.35rem, 6.6vw, 5.1rem);
  line-height: 0.98;
  letter-spacing: 0;
  max-width: 760px;
}

.hero-subtitle {
  max-width: 640px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.28rem);
  line-height: 1.55;
}

.weekend-toolbar {
  width: min(100%, 1060px);
  display: grid;
  grid-template-columns: 170px 180px 210px minmax(220px, 1fr);
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  border-radius: 8px;
}

.field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 800;
}

.field input,
.field select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  background: var(--surface-3);
  color: var(--text);
  border-radius: 7px;
  padding: 0 11px;
  letter-spacing: 0;
  outline: none;
}

.field select option {
  color: var(--text);
}

.field input:focus,
.field select:focus,
.collapse-toggle:focus-visible,
.series-toggle:focus-visible,
.event-summary:focus-visible,
.event-actions a:focus-visible,
.event-actions button:focus-visible,
.primary-action:focus-visible,
.secondary-action:focus-visible,
.segment:focus-visible,
.icon-button:focus-visible,
.ghost-link:focus-visible {
  outline: 3px solid rgba(240, 83, 53, 0.34);
  outline-offset: 2px;
}

.summary-band {
  border-block: 1px solid var(--line);
  background: var(--surface);
}

.summary-grid {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
}

.summary-grid article {
  min-height: 96px;
  padding: 20px;
  border-inline-start: 1px solid var(--line);
  display: grid;
  align-content: center;
  gap: 4px;
}

.summary-grid article:last-child {
  border-inline-end: 1px solid var(--line);
}

.summary-grid span,
.side-section h2,
.meta-copy,
.helper-text,
.event-location,
.watch-copy {
  color: var(--muted);
}

.summary-grid span {
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 0.7rem;
  font-weight: 850;
}

.summary-grid strong {
  font-size: clamp(1.1rem, 2.2vw, 1.55rem);
  letter-spacing: 0;
}

.content-shell,
.directory-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.content-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  padding: 34px 0 48px;
  align-items: start;
}

.side-panel {
  position: sticky;
  top: 14px;
  display: grid;
  gap: 12px;
}

.side-section {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 16px;
}

.side-section h2 {
  margin: 0 0 12px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.segmented {
  display: grid;
  gap: 8px;
}

.segment,
.primary-action,
.secondary-action,
.event-actions a,
.event-actions button {
  min-height: 38px;
  border-radius: 7px;
  border: 1px solid var(--line);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  background: transparent;
  font-weight: 800;
  font-size: 0.9rem;
}

.segment.is-active,
.primary-action {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

.secondary-action,
.segment,
.event-actions a,
.event-actions button {
  background: var(--surface-3);
}

.segment:not(.is-active):hover,
.secondary-action:hover,
.event-actions a:hover,
.event-actions button:hover,
.collapse-toggle:hover,
.series-toggle:hover {
  border-color: rgba(240, 83, 53, 0.38);
}

.primary-action,
.secondary-action {
  width: 100%;
  margin-top: 8px;
}

.primary-action:disabled,
.secondary-action:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.helper-text {
  margin: 12px 0 0;
  font-size: 0.86rem;
  line-height: 1.5;
}

.coverage-list {
  display: grid;
  gap: 8px;
}

.coverage-row {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.coverage-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.schedule-panel {
  min-width: 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.heading-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  letter-spacing: 0;
}

.meta-copy {
  margin: 0;
  font-size: 0.92rem;
  text-align: right;
}

.collapse-toggle {
  min-height: 36px;
  border-radius: 7px;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--surface-3);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  font-weight: 850;
  font-size: 0.88rem;
}

.event-list {
  display: grid;
  gap: 12px;
}

.event-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  overflow: clip;
}

.event-card.is-open {
  background: var(--surface);
  border-color: rgba(240, 83, 53, 0.48);
}

.event-summary {
  width: 100%;
  border: 0;
  color: var(--text);
  background: transparent;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 16px;
  cursor: pointer;
  text-align: left;
}

.event-summary:hover {
  background: var(--surface-3);
}

.event-main {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.event-date {
  min-height: 92px;
  border-radius: 7px;
  border: 1px solid rgba(240, 83, 53, 0.18);
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  padding: 10px;
  text-align: center;
  color: var(--accent);
  font-weight: 900;
  line-height: 1.2;
}

.event-copy {
  min-width: 0;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.pill,
.source-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 850;
}

.pill {
  background: var(--accent-soft);
  color: var(--accent);
}

.pill-muted {
  background: rgba(49, 189, 130, 0.12);
  color: var(--accent-3);
}

.source-pill {
  background: rgba(49, 189, 130, 0.12);
  color: var(--ok);
  text-transform: capitalize;
}

.event-series {
  display: block;
  margin: 0;
  font-size: clamp(1.03rem, 2vw, 1.32rem);
  letter-spacing: 0;
  font-weight: 850;
}

.event-title {
  display: block;
  margin: 4px 0 0;
  font-weight: 850;
}

.event-location,
.watch-copy {
  display: block;
  margin: 6px 0 0;
  line-height: 1.45;
}

.collapse-chip {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-3);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  font-size: 0.82rem;
  font-weight: 850;
  white-space: nowrap;
}

.when-open {
  display: none;
}

.event-card.is-open .when-open {
  display: inline;
  color: var(--accent);
}

.event-card.is-open .when-closed {
  display: none;
}

.collapse-arrow {
  width: 8px;
  height: 8px;
  border-bottom: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 160ms ease;
}

.event-card.is-open .collapse-arrow {
  transform: rotate(225deg) translate(-1px, -1px);
}

.event-details {
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 280px);
  gap: 18px;
  padding: 16px;
  background: var(--surface-3);
}

.event-detail-copy {
  min-width: 0;
}

.event-note,
.source-copy,
.series-source-copy {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.source-copy a {
  color: var(--accent);
  font-weight: 800;
}

.event-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.event-actions a,
.event-actions button {
  justify-content: flex-start;
  background: var(--surface);
}

.event-actions .source-link {
  color: var(--accent);
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 30px;
  background: var(--surface);
}

.empty-state h3 {
  margin: 0 0 6px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

.directory-shell {
  padding: 12px 0 56px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  line-height: 1.45;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-3);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
}

tr:last-child td {
  border-bottom: 0;
}

.series-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  display: inline-grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.series-toggle-mark {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: inline-grid;
  place-items: center;
  color: var(--accent);
}

.series-toggle-mark::before {
  content: "+";
  font-weight: 900;
  line-height: 1;
}

.series-toggle[aria-expanded="true"] .series-toggle-mark::before {
  content: "-";
}

.series-detail-row td {
  padding: 0;
  background: var(--surface-3);
}

.series-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr 0.8fr;
  gap: 12px;
  padding: 14px 14px 8px;
}

.series-detail-grid > div {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  background: var(--surface);
}

.detail-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.68rem;
  font-weight: 850;
}

.series-source-copy {
  padding: 0 14px;
}

.series-event-list {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0 14px 14px;
  list-style: none;
}

.series-event-list li {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) minmax(160px, 0.7fr);
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
  line-height: 1.4;
}

.series-event-list span,
.series-event-list em {
  color: var(--muted);
  font-style: normal;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  background: #242424;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  padding: 12px 14px;
  box-shadow: none;
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 20;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 980px) {
  .weekend-toolbar,
  .content-shell,
  .summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  .search-field,
  .schedule-panel,
  .side-panel {
    grid-column: 1 / -1;
  }

  .side-panel {
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-image {
    width: 320px;
    height: 210px;
    opacity: 0.12;
  }

  .event-card {
    grid-template-columns: 1fr;
  }

  .event-details {
    grid-template-columns: 1fr;
  }

  .event-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .series-detail-grid,
  .series-event-list li {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .app-hero {
    min-height: 0;
  }

  .topbar {
    align-items: flex-start;
    padding: 16px 0;
  }

  .brand {
    max-width: 190px;
  }

  .weekend-toolbar,
  .summary-grid,
  .side-panel,
  .event-main,
  .event-actions {
    grid-template-columns: 1fr;
  }

  .summary-grid article,
  .summary-grid article:last-child {
    border-inline: 1px solid var(--line);
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .heading-actions {
    justify-items: start;
  }

  .meta-copy {
    text-align: left;
  }

  .event-summary {
    grid-template-columns: 1fr;
  }

  .hero-image {
    width: 260px;
    height: 170px;
    top: 112px;
    right: -42px;
    opacity: 0.1;
  }

  .hero-content {
    padding-top: 28px;
  }

  .collapse-chip {
    justify-self: start;
  }

  .event-date {
    min-height: 56px;
    place-items: center start;
    text-align: left;
  }

  .hero-content,
  .content-shell {
    padding-bottom: 34px;
  }
}
