:root {
  color-scheme: light;
  --bg: #f7efe4;
  --bg-alt: #dfe9ef;
  --surface: rgba(255, 251, 245, 0.86);
  --surface-strong: rgba(255, 251, 245, 0.98);
  --surface-soft: rgba(255, 255, 255, 0.58);
  --text: #1e1d1b;
  --muted: #6b665f;
  --border: rgba(41, 32, 21, 0.12);
  --shadow: 0 24px 80px rgba(28, 28, 25, 0.14);
  --accent: #0e646d;
  --accent-2: #d77c3f;
  --accent-3: #2f7b56;
  --danger: #9f3a43;
  --lineup-day-width: clamp(420px, 24vw, 560px);
  --day-friday: #d26b2c;
  --day-saturday: #1f53d8;
  --day-sunday: #c43d8d;
  --stage-main-stage: #d04a2d;
  --stage-big-top-stage: #2966cc;
  --stage-stage-3-dance: #8646d1;
  --stage-smugglers-inn: #b85d1f;
  --stage-kids-big-top: #2f9e44;
  --stage-mad-4-animals-tent: #0f8c8c;
  --stage-storytellers-cove: #c84f82;
  --stage-arts-and-crafts: #a07a16;
  --stage-pirate-arena: #7f4f2f;
  --stage-walkabout-performances: #0f7aa7;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Space Grotesk", system-ui, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(14, 100, 109, 0.18), transparent 34%),
    radial-gradient(circle at 85% 10%, rgba(215, 124, 63, 0.16), transparent 24%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.glow {
  position: fixed;
  inset: auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.42;
  pointer-events: none;
}

.glow-a {
  top: 40px;
  left: 40px;
  background: rgba(14, 100, 109, 0.28);
}

.glow-b {
  right: 30px;
  bottom: 30px;
  background: rgba(215, 124, 63, 0.24);
}

.shell {
  width: calc(100% - clamp(16px, 2vw, 42px));
  margin: 0 auto;
  padding: 12px 0 88px;
  position: relative;
  z-index: 1;
}

.card {
  background: var(--surface);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.subtle {
  background: var(--surface-soft);
  box-shadow: none;
}

.hero {
  border-radius: var(--radius-xl);
  padding: 16px 18px;
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.8fr);
  gap: 16px;
  align-items: center;
}

.eyebrow,
.section-label,
.metric-label,
.microcopy,
.helper-copy {
  margin: 0;
}

.eyebrow,
.section-label,
.metric-label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent-2);
}

.hero h1 {
  margin: 0;
  max-width: 10ch;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(2.7rem, 5.8vw, 4.9rem);
  line-height: 0.94;
}

.lede {
  margin: 8px 0 0;
  max-width: 72ch;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px 10px;
}

.hero-actions .microcopy {
  width: 100%;
  text-align: right;
  font-size: 0.84rem;
}

.button,
.filter-chip {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

.button:hover,
.filter-chip:hover,
.lineup-card:hover {
  transform: translateY(-1px);
}

.button.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #0a4146);
  box-shadow: 0 16px 30px rgba(14, 100, 109, 0.24);
}

.button.secondary,
.filter-chip,
.search,
.lineup-card,
.itinerary-card {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  color: var(--text);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0;
}

.metric {
  border-radius: var(--radius-lg);
  padding: 10px 12px;
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: baseline;
  gap: 8px;
}

.metric-value {
  margin: 0;
  font-size: clamp(1.15rem, 1.4vw, 1.45rem);
  line-height: 1;
  font-weight: 700;
}

.metric-label {
  font-size: 0.66rem;
  white-space: nowrap;
}

.metric-subtext {
  font-size: 0.82rem;
  line-height: 1.25;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-subtext,
.microcopy,
.helper-copy,
.empty-state,
.day-caption,
.lineup-time,
.itinerary-time,
.conflict-note {
  color: var(--muted);
}

.workspace {
  border-radius: var(--radius-xl);
  display: grid;
  grid-template-columns: clamp(250px, 16vw, 310px) minmax(0, 1fr);
  overflow: hidden;
}

.sidebar {
  padding: 18px;
  background: rgba(25, 28, 31, 0.05);
  border-right: 1px solid var(--border);
  display: grid;
  align-content: start;
  gap: 16px;
}

.side-stack,
.helper {
  display: grid;
  gap: 10px;
}

.helper {
  padding: 16px;
  border-radius: var(--radius-md);
}

.search {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 14px;
}

.filter-list {
  display: grid;
  gap: 10px;
}

.filter-list.compact {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.filter-chip {
  width: 100%;
  text-align: left;
  font-weight: 700;
}

.filter-chip.is-active {
  background: linear-gradient(135deg, rgba(14, 100, 109, 0.12), rgba(215, 124, 63, 0.12));
  border-color: rgba(14, 100, 109, 0.24);
}

.stage-filter {
  border-left: 4px solid transparent;
}

.stage-filter[data-stage-key="main-stage"] {
  border-left-color: var(--stage-main-stage);
}

.stage-filter[data-stage-key="big-top-stage"] {
  border-left-color: var(--stage-big-top-stage);
}

.stage-filter[data-stage-key="stage-3-dance"] {
  border-left-color: var(--stage-stage-3-dance);
}

.stage-filter[data-stage-key="smugglers-inn"] {
  border-left-color: var(--stage-smugglers-inn);
}

.stage-filter[data-stage-key="kids-big-top"] {
  border-left-color: var(--stage-kids-big-top);
}

.stage-filter[data-stage-key="mad-4-animals-tent"] {
  border-left-color: var(--stage-mad-4-animals-tent);
}

.stage-filter[data-stage-key="storytellers-cove"] {
  border-left-color: var(--stage-storytellers-cove);
}

.stage-filter[data-stage-key="arts-and-crafts"] {
  border-left-color: var(--stage-arts-and-crafts);
}

.stage-filter[data-stage-key="pirate-arena"] {
  border-left-color: var(--stage-pirate-arena);
}

.stage-filter[data-stage-key="walkabout-performances"] {
  border-left-color: var(--stage-walkabout-performances);
}

.filter-chip[data-day-key="friday-31st-july"] {
  border-left: 4px solid var(--day-friday);
}

.filter-chip[data-day-key="saturday-1st-august"] {
  border-left: 4px solid var(--day-saturday);
}

.filter-chip[data-day-key="sunday-2nd-august"] {
  border-left: 4px solid var(--day-sunday);
}

.panel {
  display: grid;
  grid-template-columns: max-content clamp(450px, 36vw, 600px);
  min-height: 60vh;
  align-items: start;
  overflow-x: auto;
  overflow-y: hidden;
}

.panel-section {
  padding: 22px;
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
}

.lineup-section {
  width: max-content;
  max-width: none;
}

.itinerary-section {
  width: clamp(450px, 36vw, 600px);
  background: rgba(255, 255, 255, 0.36);
  border-left: 1px solid var(--border);
}

.viewport-scrollbar {
  position: fixed;
  bottom: 10px;
  z-index: 20;
  overflow-x: auto;
  overflow-y: hidden;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.94);
  border: 1px solid var(--border);
  box-shadow: 0 10px 24px rgba(28, 22, 15, 0.12);
  scrollbar-color: rgba(14, 100, 109, 0.72) rgba(255, 255, 255, 0.5);
  scrollbar-width: thin;
}

.viewport-scrollbar-track {
  height: 1px;
}

.viewport-scrollbar::-webkit-scrollbar {
  height: 14px;
}

.viewport-scrollbar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.5);
  border-radius: 999px;
}

.viewport-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(14, 100, 109, 0.72);
  border-radius: 999px;
  border: 3px solid rgba(255, 253, 249, 0.94);
}

@media (hover: none) and (pointer: coarse) {
  /* Avoid iPad Safari compositing ghosting between adjacent translucent panels. */
  .card {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .lineup-section,
  .itinerary-section,
  .lineup-day-column,
  .itinerary-card,
  .lineup-card {
    background: #fffdf9;
  }

  .lineup-section,
  .itinerary-section {
    position: relative;
    isolation: isolate;
  }
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.lineup-grid,
.itinerary {
  display: grid;
  gap: 12px;
}

.lineup-grid {
  align-items: start;
  justify-content: start;
  overflow-x: visible;
  padding-bottom: 4px;
  width: max-content;
  max-width: none;
}

.lineup-day-column {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.34);
  border: 1px solid var(--border);
  border-top-width: 5px;
}

.lineup-day-column[data-day-key="friday-31st-july"] {
  border-top-color: var(--day-friday);
  background: linear-gradient(180deg, rgba(210, 107, 44, 0.14), rgba(255, 255, 255, 0.34) 24%);
}

.lineup-day-column[data-day-key="saturday-1st-august"] {
  border-top-color: var(--day-saturday);
  background: linear-gradient(180deg, rgba(31, 83, 216, 0.15), rgba(255, 255, 255, 0.34) 24%);
}

.lineup-day-column[data-day-key="sunday-2nd-august"] {
  border-top-color: var(--day-sunday);
  background: linear-gradient(180deg, rgba(196, 61, 141, 0.15), rgba(255, 255, 255, 0.34) 24%);
}

.lineup-stage-group {
  display: grid;
  gap: 8px;
}

.lineup-stage-heading {
  margin: 0;
  padding: 0 2px;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.lineup-stage-heading[data-stage-key="main-stage"] {
  color: var(--stage-main-stage);
}

.lineup-stage-heading[data-stage-key="big-top-stage"] {
  color: var(--stage-big-top-stage);
}

.lineup-stage-heading[data-stage-key="stage-3-dance"] {
  color: var(--stage-stage-3-dance);
}

.lineup-stage-heading[data-stage-key="smugglers-inn"] {
  color: var(--stage-smugglers-inn);
}

.lineup-stage-heading[data-stage-key="kids-big-top"] {
  color: var(--stage-kids-big-top);
}

.lineup-stage-heading[data-stage-key="mad-4-animals-tent"] {
  color: var(--stage-mad-4-animals-tent);
}

.lineup-stage-heading[data-stage-key="storytellers-cove"] {
  color: var(--stage-storytellers-cove);
}

.lineup-stage-heading[data-stage-key="arts-and-crafts"] {
  color: var(--stage-arts-and-crafts);
}

.lineup-stage-heading[data-stage-key="pirate-arena"] {
  color: var(--stage-pirate-arena);
}

.lineup-stage-heading[data-stage-key="walkabout-performances"] {
  color: var(--stage-walkabout-performances);
}

.lineup-day-header {
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.lineup-day-column[data-day-key="friday-31st-july"] .lineup-day-header h3,
.day-block[data-day-key="friday-31st-july"] .day-header h3 {
  color: var(--day-friday);
}

.lineup-day-column[data-day-key="saturday-1st-august"] .lineup-day-header h3,
.day-block[data-day-key="saturday-1st-august"] .day-header h3 {
  color: var(--day-saturday);
}

.lineup-day-column[data-day-key="sunday-2nd-august"] .lineup-day-header h3,
.day-block[data-day-key="sunday-2nd-august"] .day-header h3 {
  color: var(--day-sunday);
}

.lineup-card,
.itinerary-card {
  border-radius: var(--radius-md);
  padding: 16px;
}

.lineup-card {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 14px;
}

.lineup-card.is-selected {
  border-color: rgba(14, 100, 109, 0.34);
  background: linear-gradient(135deg, rgba(14, 100, 109, 0.08), rgba(255, 255, 255, 0.82));
}

.lineup-card.has-clash,
.itinerary-card.has-clash {
  border-color: rgba(159, 58, 67, 0.36);
  background: linear-gradient(135deg, rgba(159, 58, 67, 0.1), rgba(255, 255, 255, 0.82));
}

.lineup-head,
.itinerary-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.itinerary-head {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.untick-button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(159, 58, 67, 0.3);
  background: rgba(159, 58, 67, 0.08);
  color: var(--danger);
  font-size: 0.78rem;
  font-weight: 700;
}

.untick-button:hover {
  background: rgba(159, 58, 67, 0.14);
}

.act-toggle {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--accent);
}

.lineup-time,
.itinerary-time {
  margin: 0 0 2px;
  font-size: 0.88rem;
  font-weight: 700;
}

.lineup-act,
.itinerary-act,
.day-block h3 {
  margin: 0;
}

.lineup-act,
.itinerary-act {
  font-size: 1rem;
  line-height: 1.25;
}

.lineup-meta,
.itinerary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border);
  font-size: 0.84rem;
  font-weight: 700;
}

.clash-pill {
  color: var(--danger);
}

.stage-pill[data-stage-key="main-stage"] {
  color: var(--stage-main-stage);
  border-color: rgba(208, 74, 45, 0.38);
}

.stage-pill[data-stage-key="big-top-stage"] {
  color: var(--stage-big-top-stage);
  border-color: rgba(41, 102, 204, 0.38);
}

.stage-pill[data-stage-key="stage-3-dance"] {
  color: var(--stage-stage-3-dance);
  border-color: rgba(134, 70, 209, 0.38);
}

.stage-pill[data-stage-key="smugglers-inn"] {
  color: var(--stage-smugglers-inn);
  border-color: rgba(184, 93, 31, 0.38);
}

.stage-pill[data-stage-key="kids-big-top"] {
  color: var(--stage-kids-big-top);
  border-color: rgba(47, 158, 68, 0.38);
}

.stage-pill[data-stage-key="mad-4-animals-tent"] {
  color: var(--stage-mad-4-animals-tent);
  border-color: rgba(15, 140, 140, 0.38);
}

.stage-pill[data-stage-key="storytellers-cove"] {
  color: var(--stage-storytellers-cove);
  border-color: rgba(200, 79, 130, 0.38);
}

.stage-pill[data-stage-key="arts-and-crafts"] {
  color: var(--stage-arts-and-crafts);
  border-color: rgba(160, 122, 22, 0.38);
}

.stage-pill[data-stage-key="pirate-arena"] {
  color: var(--stage-pirate-arena);
  border-color: rgba(127, 79, 47, 0.38);
}

.stage-pill[data-stage-key="walkabout-performances"] {
  color: var(--stage-walkabout-performances);
  border-color: rgba(15, 122, 167, 0.38);
}

.day-block {
  padding-top: 10px;
  border-top: 4px solid transparent;
}

.day-block[data-day-key="friday-31st-july"] {
  border-top-color: var(--day-friday);
}

.day-block[data-day-key="saturday-1st-august"] {
  border-top-color: var(--day-saturday);
}

.day-block[data-day-key="sunday-2nd-august"] {
  border-top-color: var(--day-sunday);
}

.day-block {
  display: grid;
  gap: 12px;
}

.day-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
}

.empty-state {
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border);
  background: rgba(255, 255, 255, 0.42);
}

@media (max-width: 720px) and (hover: none) and (pointer: coarse) {
  .workspace,
  .hero,
  .metrics {
    grid-template-columns: 1fr;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-subtext {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .workspace {
    overflow: visible;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .panel {
    overflow: visible;
    grid-template-columns: 1fr;
  }

  .lineup-section,
  .itinerary-section,
  .panel-section {
    width: 100%;
    max-width: 100%;
  }

  .itinerary-section {
    border-left: 0;
    border-top: 1px solid var(--border);
  }

  .lineup-grid {
    grid-template-columns: 1fr !important;
    width: 100%;
    max-width: 100%;
    overflow-x: visible;
    padding-bottom: 0;
  }

  .lineup-day-column {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 720px) and (hover: none) and (pointer: coarse) {
  .shell {
    width: calc(100% - 18px);
    padding-top: 10px;
    padding-bottom: 40px;
  }

  .viewport-scrollbar {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .hero,
  .sidebar,
  .panel-section {
    padding: 14px;
  }

  .metrics {
    grid-template-columns: 1fr;
  }

  .metric {
    grid-template-columns: auto auto 1fr;
  }

  .button,
  .filter-chip {
    min-height: 32px;
    padding: 0 10px;
  }

  .search {
    min-height: 38px;
  }

  .hero h1 {
    max-width: none;
  }

  .hero-actions {
    justify-content: flex-start;
  }

  .hero-actions .microcopy {
    text-align: left;
  }

  .lineup-day-column {
    padding: 10px;
  }

  .lineup-card,
  .itinerary-card {
    padding: 10px;
  }

  .lineup-stage-heading,
  .lineup-time,
  .itinerary-time,
  .lineup-act,
  .itinerary-act {
    font-size: 0.92rem;
  }

  .day-header {
    gap: 8px;
  }

  .day-header h3 {
    font-size: 1rem;
  }

  .day-caption {
    font-size: 0.82rem;
  }

  .itinerary-head {
    grid-template-columns: 1fr;
  }

  .untick-button {
    justify-self: start;
  }
}