:root {
  color-scheme: light;
  --bg: #f5f3ee;
  --surface: #fffdf8;
  --surface-2: #e8f0ec;
  --text: #1d2522;
  --muted: #66706b;
  --line: #d7ddd5;
  --accent: #007c7a;
  --accent-2: #c94132;
  --shadow: 0 22px 60px rgba(30, 38, 35, 0.16);
}

body.dark {
  color-scheme: dark;
  --bg: #171b1d;
  --surface: #22282a;
  --surface-2: #293539;
  --text: #f4f0e7;
  --muted: #b4bdb8;
  --line: #3b484b;
  --accent: #58d5cd;
  --accent-2: #ff8a73;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  background:
    linear-gradient(135deg, rgba(0, 124, 122, 0.12), transparent 36%),
    linear-gradient(315deg, rgba(201, 65, 50, 0.12), transparent 34%),
    var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 32px 0;
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 24px;
  align-items: center;
}

.player-panel,
.browse-panel {
  background: rgba(255, 253, 248, 0.86);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.player-panel {
  border-radius: 8px;
  padding: 26px;
}

.browse-panel {
  border-radius: 8px;
  padding: 22px;
  min-height: 620px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.topbar,
.search-row,
.status-row,
.station-item,
.tabs {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 16px;
}

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

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 0.95;
}

.now-playing {
  margin: 38px 0 26px;
  display: grid;
  gap: 22px;
}

.cover {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 24%, rgba(244, 240, 231, 0.78), transparent 24%),
    linear-gradient(145deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: clamp(4rem, 18vw, 9rem);
  font-weight: 800;
  text-shadow: 0 6px 22px rgba(0, 0, 0, 0.24);
}

.station-copy h2 {
  margin: 6px 0 8px;
  font-size: 1.55rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.station-copy p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 26px 0 18px;
}

.icon-button,
.round-button,
.favorite-button,
.play-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  display: grid;
  place-items: center;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.icon-button:hover,
.round-button:hover,
.favorite-button:hover,
.play-button:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.icon-button,
.round-button,
.favorite-button {
  width: 44px;
  height: 44px;
  border-radius: 999px;
}

.play-button {
  width: 76px;
  height: 76px;
  border-radius: 999px;
  border: 0;
  background: var(--accent);
  color: #fff;
  font-size: 1.55rem;
}

.status-row {
  justify-content: space-between;
  min-height: 44px;
}

.status-pill {
  display: inline-flex;
  max-width: calc(100% - 56px);
  min-height: 34px;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.favorite-button.is-active {
  color: var(--accent-2);
  border-color: var(--accent-2);
}

.volume-control,
.searchbar,
.custom-form label {
  display: grid;
  gap: 8px;
}

.volume-control span,
.searchbar label,
.custom-form span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

input[type="range"] {
  accent-color: var(--accent);
}

input[type="search"],
input[type="text"],
input[type="url"] {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.search-row {
  gap: 10px;
}

.command-button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.tabs {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
  background: var(--surface-2);
}

.tab {
  flex: 1;
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.tab.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}

.custom-form {
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.custom-form:not([hidden]) {
  display: grid;
}

.station-list {
  display: grid;
  gap: 10px;
  overflow: auto;
  padding-right: 4px;
}

.station-item {
  width: 100%;
  min-height: 74px;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.station-item:hover,
.station-item.is-active {
  border-color: var(--accent);
}

.station-mark {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--accent);
  font-weight: 800;
}

.station-detail {
  min-width: 0;
  flex: 1;
}

.station-title,
.station-subtitle {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.station-title {
  font-weight: 800;
}

.station-subtitle {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.9rem;
}

.empty-state {
  margin: 24px 0;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

@media (max-width: 860px) {
  .app-shell {
    min-height: auto;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .browse-panel {
    min-height: 520px;
  }

  .now-playing {
    grid-template-columns: 112px 1fr;
    align-items: center;
  }

  .cover {
    font-size: 3.5rem;
  }
}

@media (max-width: 520px) {
  .app-shell {
    width: min(100% - 20px, 1120px);
    padding: 10px 0;
    gap: 10px;
  }

  .player-panel,
  .browse-panel {
    padding: 16px;
  }

  .now-playing {
    grid-template-columns: 1fr;
    margin: 24px 0 18px;
  }

  .cover {
    max-height: 240px;
  }

  .search-row {
    display: grid;
  }

  .command-button {
    width: 100%;
  }
}
