:root {
  color-scheme: dark light;
  --bg: #111114;
  --deck: #17171c;
  --deck-2: #202027;
  --ink: #f7f4ee;
  --muted: #9b9aa4;
  --line: rgba(255, 255, 255, 0.13);
  --paper: #f5f2ec;
  --paper-ink: #151515;
  --paper-muted: #77777f;
  --accent: #18d19a;
  --amber: #e5a93d;
  --danger: #df6b6b;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(24, 209, 154, 0.1), transparent 34%),
    linear-gradient(180deg, #101014 0%, #17181c 55%, #1a1417 100%);
  color: var(--ink);
}

button,
textarea,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.radio-shell {
  width: min(100%, 760px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 28px;
  overflow: hidden;
  background: var(--deck);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.45);
}

.live-deck {
  min-height: 330px;
  padding: 34px 38px 0;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.12) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(180deg, var(--deck) 0%, #111115 100%);
}

.station-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: start;
}

.avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #e7d8be, #8cc0b2);
  color: #101014;
  font-weight: 800;
}

.station-copy h1 {
  margin: -6px 0 2px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(2.5rem, 8vw, 4.6rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.station-copy p,
.clock {
  margin: 0;
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 700;
}

.station-copy p {
  color: var(--accent);
}

.live-dot {
  width: 9px;
  height: 9px;
  display: inline-block;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 16px rgba(24, 209, 154, 0.8);
}

.top-wave,
.bottom-wave {
  display: flex;
  align-items: end;
  gap: 4px;
}

.top-wave {
  height: 190px;
  margin: 54px -38px 0;
  padding: 0 0 0;
}

.wave-bar {
  flex: 1;
  min-width: 3px;
  border-radius: 999px 999px 0 0;
  background: rgba(255, 255, 255, 0.82);
  transform-origin: bottom;
}

.bottom-wave {
  height: 42px;
  margin: 8px 0 16px;
  align-items: center;
}

.bottom-wave .wave-bar {
  height: var(--bar-height);
  border-radius: 999px;
  background: #c9c9cf;
}

.bottom-wave .wave-bar.is-hot {
  background: #151515;
}

.player-sheet {
  margin-top: -34px;
  padding: 42px 32px 30px;
  border-radius: 34px 34px 0 0;
  background: var(--paper);
  color: var(--paper-ink);
}

.session-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: start;
}

.session-head h2 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 3.4rem);
  line-height: 1.04;
  letter-spacing: 0;
}

.session-head p {
  margin: 12px 0 0;
  color: var(--paper-muted);
  font-size: 1.05rem;
}

.health-link {
  color: var(--paper-muted);
  font-weight: 800;
  text-decoration: none;
}

.session-form {
  margin: 28px 0 22px;
  display: grid;
  gap: 14px;
}

.scene-field,
.quick-controls label,
.control-grid label {
  display: grid;
  gap: 8px;
  color: var(--paper-muted);
  font-size: 0.86rem;
  font-weight: 800;
}

textarea,
select {
  width: 100%;
  border: 1px solid #d8d3ca;
  border-radius: 8px;
  background: #fffdf8;
  color: var(--paper-ink);
  outline: none;
}

textarea {
  min-height: 78px;
  resize: vertical;
  padding: 12px 14px;
  line-height: 1.45;
}

select {
  min-height: 44px;
  padding: 0 12px;
}

textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(24, 209, 154, 0.18);
}

.quick-controls {
  display: grid;
  grid-template-columns: minmax(130px, 190px) 1fr;
  gap: 10px;
  align-items: end;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  padding-top: 12px;
}

.advanced-panel {
  border-top: 1px solid #ded9cf;
  padding-top: 10px;
}

.advanced-panel summary {
  width: fit-content;
  cursor: pointer;
  color: var(--paper-muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.toggle {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #ddd8cf;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fffdf8;
  color: var(--paper-ink);
  white-space: nowrap;
}

.toggle input {
  accent-color: var(--accent);
}

.primary-button,
.play-button,
.icon-button {
  border: 0;
  cursor: pointer;
}

.primary-button {
  min-height: 48px;
  border-radius: 8px;
  background: #151515;
  color: #fff;
  font-weight: 900;
}

.primary-button:disabled {
  cursor: wait;
  background: #77777f;
}

.transport {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 14px;
  align-items: center;
  margin-top: 8px;
}

.play-button,
.icon-button {
  height: 42px;
  border-radius: 999px;
  background: #151515;
  color: #fff;
  font-weight: 900;
}

.play-button {
  width: 76px;
}

.icon-button {
  width: 56px;
  background: transparent;
  color: #151515;
  border: 1px solid #d6d1c8;
}

.progress-wrap {
  display: grid;
  gap: 6px;
}

progress {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #dfdbd3;
}

progress::-webkit-progress-bar {
  background: #dfdbd3;
}

progress::-webkit-progress-value {
  background: #151515;
}

progress::-moz-progress-bar {
  background: #151515;
}

.time-row {
  display: flex;
  justify-content: space-between;
  color: var(--paper-muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.transcript-panel {
  max-height: 310px;
  overflow: auto;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(245, 242, 236, 0) 70%, rgba(245, 242, 236, 0.96) 100%),
    radial-gradient(circle, rgba(0, 0, 0, 0.08) 1px, transparent 1px) 0 0 / 18px 18px,
    #ebe7df;
}

.segment-list {
  list-style: none;
  margin: 0;
  padding: 20px 22px 42px;
  display: grid;
  gap: 18px;
}

.segment {
  opacity: 0.42;
  transition: opacity 160ms ease, transform 160ms ease;
}

.segment.is-active {
  opacity: 1;
  transform: translateX(4px);
}

.segment-meta {
  margin: 0 0 6px;
  color: var(--paper-muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.segment-text {
  margin: 0;
  font-size: clamp(1rem, 3vw, 1.35rem);
  line-height: 1.45;
}

.segment-song {
  margin: 8px 0 0;
  color: var(--paper-muted);
  font-size: 0.95rem;
}

.warning {
  color: var(--danger);
}

@media (max-width: 700px) {
  .app-shell {
    padding: 0;
    place-items: stretch;
  }

  .radio-shell {
    width: 100%;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .live-deck {
    min-height: 280px;
    padding: 26px 22px 0;
  }

  .top-wave {
    height: 142px;
    margin: 46px -22px 0;
  }

  .player-sheet {
    padding: 32px 20px 24px;
  }

  .control-grid,
  .quick-controls,
  .transport,
  .session-head {
    grid-template-columns: 1fr;
  }

  .toggle {
    justify-content: space-between;
  }

  .play-button,
  .icon-button {
    width: 100%;
  }
}
