:root {
  color-scheme: dark;
  --bg: #101114;
  --panel: #1a1d22;
  --panel-2: #20242b;
  --text: #f2f5f8;
  --muted: #a3adba;
  --line: #333945;
  --accent: #46b58d;
  --accent-strong: #56d9aa;
  --danger: #d85f67;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

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

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

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

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 4rem);
  line-height: 1;
  letter-spacing: 0;
}

.status-pill {
  min-width: 112px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.status-pill.live {
  border-color: rgba(86, 217, 170, 0.45);
  color: var(--accent-strong);
}

.status-pill.stopped {
  border-color: rgba(216, 95, 103, 0.45);
  color: #ff9aa1;
}

.player-panel {
  margin-top: 16px;
  padding: 18px;
}

audio {
  display: block;
  width: 100%;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.readout {
  padding: 20px;
}

.readout-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.readout-row:first-child {
  padding-top: 0;
}

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

.readout-row span {
  color: var(--muted);
}

.readout-row strong {
  text-align: right;
}

.controls {
  padding: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

label strong {
  float: right;
  color: var(--text);
}

input,
select {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111318;
  color: var(--text);
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
}

input[type="range"] {
  height: 30px;
  padding: 0;
  border: 0;
  accent-color: var(--accent);
}

.buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.sliders {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.sliders label {
  margin-top: 4px;
  margin-bottom: 0;
}

button {
  min-height: 46px;
  border: 1px solid rgba(86, 217, 170, 0.35);
  border-radius: 6px;
  background: rgba(70, 181, 141, 0.14);
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
}

button:hover {
  border-color: var(--accent-strong);
  background: rgba(70, 181, 141, 0.23);
}

button.active {
  background: var(--accent);
  color: #07120f;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.stop {
  width: 100%;
  margin-top: 10px;
  border-color: rgba(216, 95, 103, 0.4);
  background: rgba(216, 95, 103, 0.13);
}

.stop:hover {
  border-color: var(--danger);
  background: rgba(216, 95, 103, 0.22);
}

.message {
  min-height: 1.4em;
  margin: 12px 0 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.tuner-panel {
  margin-top: 16px;
  padding: 20px;
}

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

h2 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.action-row {
  display: flex;
  gap: 10px;
}

.section-heading button {
  min-width: 112px;
}

.tuner-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.tuner-grid label {
  margin: 0;
}

.tuner-grid input,
.tuner-grid select {
  margin-top: 8px;
}

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.toggle-row span {
  color: var(--text);
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 920px);
    padding: 10px 0;
  }

  .header {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px;
  }

  .status-pill {
    width: 100%;
  }

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

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

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

  .action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .section-heading button {
    width: 100%;
  }

  .tuner-grid,
  .toggle-grid {
    grid-template-columns: 1fr;
  }
}
