:root {
  color-scheme: light;
  --bg: #fff7e8;
  --panel: #fffdf8;
  --panel-soft: #fff2d4;
  --ink: #1f2933;
  --muted: #677381;
  --line: #eadcc3;
  --accent: #00b878;
  --accent-ink: #052d22;
  --coral: #ff6b4a;
  --sun: #ffd166;
  --warn: #ffc857;
  --danger: #ff7b7b;
  --blue: #55b6ff;
  --radius: 8px;
  --shadow: 0 18px 50px rgba(91, 64, 24, .14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--ink);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(135deg, rgba(255, 209, 102, .38) 0 16%, transparent 16% 100%),
    linear-gradient(180deg, rgba(0, 184, 120, .14), transparent 320px),
    repeating-linear-gradient(90deg, rgba(255, 107, 74, .08) 0 1px, transparent 1px 78px),
    var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

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

.app-header,
main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 0 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--coral);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 4.4rem);
  line-height: .95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: 1.15rem;
}

h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-link,
.button,
.ghost-button,
.icon-button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(255, 255, 255, .76);
  cursor: pointer;
  text-decoration: none;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.admin-link,
.button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  font-weight: 750;
}

.admin-link {
  min-height: 34px;
  padding: 0 10px;
  color: var(--muted);
  font-size: .88rem;
  font-weight: 800;
}

.icon-button {
  width: 42px;
  height: 42px;
  font-size: 1.35rem;
  font-weight: 800;
}

.button.primary {
  border-color: transparent;
  color: #06251a;
  background: var(--accent);
}

.button.primary:hover {
  border-color: transparent;
  background: #19cc8e;
}

.admin-link:hover,
.button:hover,
.ghost-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 107, 74, .56);
  background: #fff;
}

.next-panel {
  margin-bottom: 16px;
}

.next-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid rgba(0, 184, 120, .32);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 209, 102, .38), rgba(255, 255, 255, .74)),
    linear-gradient(90deg, rgba(0, 184, 120, .16), transparent);
  box-shadow: var(--shadow);
}

.next-card p {
  margin-bottom: 0;
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: .9rem;
}

.meta-line span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px;
  padding: 8px 0 12px;
  background: linear-gradient(180deg, var(--bg), rgba(255, 247, 232, .92));
  backdrop-filter: blur(14px);
}

.tab {
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, .72);
  cursor: pointer;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab.active {
  border-color: rgba(0, 184, 120, .72);
  color: var(--ink);
  background: rgba(0, 184, 120, .16);
}

.view {
  display: none;
  padding: 8px 0 44px;
}

.view.active {
  display: block;
}

.festival-list,
.agenda-list,
.replay-list {
  display: grid;
  gap: 12px;
}

.festival-card,
.admin-panel,
.agenda-day,
.replay-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, .92);
  box-shadow: 0 10px 28px rgba(91, 64, 24, .08);
}

.festival-card {
  overflow: hidden;
}

.festival-header {
  padding: 0;
  background: linear-gradient(90deg, rgba(255, 209, 102, .16), rgba(255, 255, 255, .2));
}

.festival-card.expanded .festival-header {
  border-bottom: 1px solid var(--line);
}

.festival-toggle {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 32px;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 76px;
  padding: 14px;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.festival-toggle:hover {
  background: rgba(255, 209, 102, .13);
}

.logo-chip {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: var(--radius);
  color: #1d1b12;
  font-weight: 900;
  background: var(--festival-color, var(--accent));
}

.logo-chip.logo-image {
  padding: 6px;
  background: #fff;
}

.logo-chip img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.festival-summary {
  min-width: 0;
}

.festival-summary h2 {
  margin-bottom: 4px;
}

.toggle-indicator {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, .7);
  font-size: .86rem;
  font-weight: 900;
  transition: transform .16s ease;
}

.festival-card.expanded .toggle-indicator {
  transform: rotate(180deg);
}

.festival-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.festival-title-row h2 {
  margin-bottom: 4px;
}

.festival-body {
  display: grid;
  min-width: 0;
  gap: 12px;
  padding: 14px;
}

.festival-detail-strip {
  display: grid;
  gap: 6px;
}

.stream-card,
.lineup-card,
.suggestion-card {
  display: grid;
  min-width: 0;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .7);
}

.stream-card.lineup-only {
  opacity: .72;
}

.stream-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.festival-header > div,
.stream-top > div {
  min-width: 0;
}

.artist {
  margin-bottom: 4px;
  font-weight: 900;
  font-size: 1.03rem;
}

.status {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--ink);
  background: #f3ead8;
  font-size: .76rem;
  font-weight: 900;
  text-align: center;
}

.status.live,
.status.confirmed,
.status.soon {
  color: #052d22;
  background: var(--accent);
}

.status.pending,
.status.probable,
.status.unknown {
  color: #1b1300;
  background: var(--warn);
}

.status.none {
  color: #3a0606;
  background: var(--danger);
}

.status.replay {
  color: #07131f;
  background: var(--blue);
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.small-note {
  margin: 0;
  color: var(--muted);
  font-size: .86rem;
  overflow-wrap: anywhere;
}

.day-group {
  display: grid;
  gap: 8px;
}

.day-title {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 900;
  text-transform: uppercase;
}

.past-days {
  display: grid;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
}

.past-days summary {
  width: max-content;
  cursor: pointer;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 900;
}

.past-days[open] summary {
  margin-bottom: 8px;
}

.agenda-day {
  padding: 14px;
}

.agenda-day h2 {
  margin-bottom: 12px;
}

.admin-panel {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: #fffaf0;
  padding: 9px 10px;
}

.field textarea {
  min-height: 86px;
  resize: vertical;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

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

.source-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .64);
}

.empty-state {
  padding: 28px 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, .48);
  text-align: center;
}

.hidden {
  display: none !important;
}

@media (max-width: 720px) {
  .app-header,
  main {
    width: calc(100% - 32px);
  }

  .app-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .header-actions {
    align-self: stretch;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .next-card,
  .stream-top,
  .festival-title-row {
    grid-template-columns: 1fr;
  }

  .festival-toggle {
    grid-template-columns: 48px minmax(0, 1fr) 32px;
  }

  .stream-top .status,
  .festival-title-row .status {
    justify-self: start;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

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

  .festival-body > .small-note {
    max-width: 34ch;
  }
}
