:root {
  color-scheme: dark;
  --ink: #f7f7f8;
  --muted: #a7abb3;
  --line: rgba(255, 255, 255, 0.13);
  --paper: #070b13;
  --panel: #111827;
  --panel-soft: #1d2638;
  --teal: #26c6b8;
  --teal-dark: #77e4da;
  --coral: #ff6a1a;
  --gold: #d7a650;
  --blue: #73a8ff;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.32);
  --font-display: "Avenir Next", Avenir, "Helvetica Neue", Arial, sans-serif;
  --font-body: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  font-family: var(--font-body);
  background:
    radial-gradient(circle at 18% 0%, rgba(215, 166, 80, 0.22), transparent 34%),
    radial-gradient(circle at 92% 12%, rgba(38, 198, 184, 0.15), transparent 30%),
    linear-gradient(180deg, #101827 0%, var(--paper) 46%);
  color: var(--ink);
}

button,
input,
select {
  min-width: 0;
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  min-height: calc(100vh - 88px);
  min-height: calc(100svh - 88px);
}

.sidebar {
  min-width: 0;
  padding: 28px;
  border-right: 1px solid var(--line);
  background: rgba(13, 13, 17, 0.84);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  min-width: 0;
  gap: 14px;
  align-items: center;
  margin-bottom: 26px;
}

.brand-logo {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  background: #f7f7f8;
  box-shadow: var(--shadow);
}

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

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

h1 {
  margin-bottom: 0;
  font-size: 1.45rem;
}

h2 {
  margin-bottom: 0;
  font-size: 2.15rem;
  line-height: 1.05;
}

.search-panel {
  display: grid;
  min-width: 0;
  gap: 16px;
}

.field-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

.search-box svg,
button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
}

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

.filter-grid label {
  min-width: 0;
}

select {
  width: 100%;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 700;
}

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

.primary-action,
.install-button,
.phone-button,
.tag-button,
.icon-button,
.favorite-button,
.favorites-filter,
.library-filter,
.playlist-card-button {
  border: 0;
  border-radius: 8px;
}

.primary-action {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px;
  background: var(--coral);
  color: white;
  font-weight: 800;
}

.primary-action:hover {
  background: #ff7a2f;
}

.install-button {
  min-height: 40px;
  padding: 0 13px;
  background: #f7f7f8;
  color: #111116;
  font-weight: 900;
}

.phone-button {
  min-height: 40px;
  padding: 0 13px;
  background: rgba(122, 167, 255, 0.18);
  color: var(--blue);
  font-weight: 900;
}

.install-button,
.phone-button,
.status-pill,
.tag-button,
.favorites-filter,
.library-filter,
.search-box,
select,
.page-button {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.install-button {
  color: #111116;
}

.favorites-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  margin-top: 16px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  font-weight: 900;
}

.favorites-filter span {
  color: var(--coral);
  font-size: 1.1rem;
}

.favorites-filter strong {
  margin-left: auto;
  min-width: 28px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 85, 0, 0.18);
  text-align: center;
}

.favorites-filter.active {
  background: var(--coral);
  color: white;
}

.favorites-filter.active span,
.favorites-filter.active strong {
  color: white;
}

.favorites-filter.active strong {
  background: rgba(255, 255, 255, 0.22);
}

.library-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  margin-top: 8px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  font-weight: 900;
}

.library-filter svg {
  width: 19px;
  color: var(--teal);
}

.library-filter strong {
  margin-left: auto;
  min-width: 28px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(42, 199, 184, 0.16);
  text-align: center;
}

.library-filter.active {
  background: var(--teal);
  color: #07111f;
}

.library-filter.active svg,
.library-filter.active strong {
  color: #07111f;
}

.library-filter.active strong {
  background: rgba(7, 17, 31, 0.14);
}

.playlist-manager {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

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

.playlist-heading h2 {
  font-size: 1rem;
  line-height: 1.2;
}

.playlist-heading span {
  min-width: 26px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(122, 167, 255, 0.16);
  color: var(--blue);
  text-align: center;
  font-size: 0.75rem;
  font-weight: 900;
}

.playlist-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 7px;
}

.playlist-form input {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

.playlist-form input:focus {
  border-color: var(--blue);
}

.playlist-form button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: white;
}

.playlist-target-label {
  display: block;
  margin: 12px 0 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

#playlistTarget {
  width: 100%;
  min-height: 40px;
  font-size: 0.82rem;
}

.playlist-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.playlist-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 6px;
}

.playlist-open,
.playlist-delete {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
}

.playlist-open {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
  text-align: left;
}

.playlist-open span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.playlist-open strong {
  color: var(--muted);
  font-size: 0.75rem;
}

.playlist-row.active .playlist-open {
  background: var(--blue);
  color: white;
}

.playlist-row.active .playlist-open strong {
  color: white;
}

.playlist-delete {
  display: grid;
  place-items: center;
  padding: 0;
  background: rgba(255, 85, 0, 0.12);
  color: var(--coral);
}

.playlist-delete svg {
  width: 17px;
}

.playlist-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.quick-tags {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.tag-button {
  padding: 8px 11px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  font-weight: 800;
}

.tag-button:hover,
.tag-button.active {
  background: var(--ink);
  color: #111116;
}

.content {
  min-width: 0;
  padding: 28px 28px 118px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

.feature-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(145px, 1fr)) auto;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 20px;
}

.feature-button,
.sleep-control {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.065);
  color: var(--ink);
}

.feature-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 12px;
  font-weight: 850;
}

.feature-button:hover,
.feature-button.active {
  border-color: var(--teal);
  background: rgba(36, 199, 183, 0.16);
}

.feature-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.feature-button svg,
.sleep-control svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sleep-control {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 7px 9px;
  align-items: center;
  padding: 7px 10px;
  font-size: 0.86rem;
  font-weight: 850;
}

.sleep-control select {
  grid-column: 2 / 4;
  min-height: 28px;
  padding: 2px 28px 2px 8px;
  border-radius: 6px;
  font-size: 0.78rem;
}

.sleep-control strong {
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.unlocked-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 160px;
  padding: 8px 12px;
  border: 1px solid rgba(36, 199, 183, 0.4);
  border-radius: 8px;
  background: rgba(36, 199, 183, 0.1);
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
}

.language-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.language-switch button {
  min-width: 36px;
  height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.language-switch button.active {
  background: var(--blue);
  color: white;
}

.status-pill {
  flex: 0 0 auto;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.now-playing {
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(0, 1fr) auto 46px;
  gap: 22px;
  align-items: end;
  margin-bottom: 20px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background:
    radial-gradient(circle at 16% 10%, rgba(215, 166, 80, 0.24), transparent 30%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(255, 106, 26, 0.16)),
    var(--panel);
  box-shadow: var(--shadow);
}

.now-playing[hidden] {
  display: none;
}

.now-playing.expanded {
  min-height: 300px;
}

.station-logo {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  background: #2a2a32;
}

.live-art {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  background:
    radial-gradient(circle at 54% 42%, rgba(115, 168, 255, 0.22), transparent 34%),
    linear-gradient(145deg, #f6f7f8, #111827);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.36);
}

.live-logo,
.track-art {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  object-fit: cover;
}

.live-logo {
  display: block;
}

.live-logo[hidden] {
  display: none;
}

.live-wave {
  position: absolute;
  left: 14px;
  bottom: 14px;
  display: flex;
  align-items: end;
  gap: 4px;
  height: 36px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(7, 11, 19, 0.72);
  backdrop-filter: blur(10px);
}

.live-wave span {
  width: 5px;
  min-height: 8px;
  border-radius: 999px;
  background: var(--gold);
  animation: livePulse 820ms ease-in-out infinite alternate;
}

.live-wave span:nth-child(2) {
  animation-delay: 120ms;
}

.live-wave span:nth-child(3) {
  animation-delay: 240ms;
}

.live-wave span:nth-child(4) {
  animation-delay: 360ms;
}

.live-copy {
  min-width: 0;
}

.live-copy h3 {
  margin-bottom: 8px;
  font-size: 3.35rem;
  line-height: 0.96;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.artist-line {
  margin-bottom: 18px;
  color: var(--gold);
  font-size: 1.05rem;
  font-weight: 900;
}

.station-live {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  max-width: 520px;
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.station-live img {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  background: #2a2a32;
}

.station-live strong,
.station-live span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.station-live span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.now-playing h3,
.station-card h3 {
  margin-bottom: 4px;
}

.station-card h3 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.now-playing p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.now-playing .track-line {
  margin: 7px 0 0;
  color: var(--teal-dark);
  font-size: 0.9rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.track-art {
  display: block;
  background: #dfe7e5;
}

.track-art[hidden] {
  display: none;
}

.record-panel {
  display: grid;
  gap: 5px;
  justify-items: center;
}

.record-panel[hidden] {
  display: none;
}

.record-button {
  min-height: 42px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  background: var(--coral);
  color: white;
  font-weight: 900;
}

.record-button.recording {
  background: #d64600;
}

.record-panel span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

body.drive-mode .app-shell {
  grid-template-columns: 1fr;
}

body.drive-mode .sidebar,
body.drive-mode .media-library,
body.drive-mode .station-grid,
body.drive-mode .pagination {
  display: none;
}

body.drive-mode .content {
  width: min(100%, 980px);
  margin: 0 auto;
}

body.drive-mode .feature-toolbar {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
}

body.drive-mode .unlocked-badge {
  display: none;
}

body.drive-mode .now-playing {
  grid-template-columns: minmax(220px, 360px) minmax(0, 1fr) auto 54px;
  min-height: 430px;
}

body.drive-mode .icon-button {
  width: 54px;
  height: 54px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 85, 0, 0.18);
  color: var(--ink);
}

.notice {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-left: 4px solid var(--coral);
  border-radius: 8px;
  background: rgba(255, 85, 0, 0.12);
  color: #ffd9c7;
  font-weight: 700;
}

.media-library {
  margin-bottom: 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.media-library-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.media-library-head h2 {
  font-size: 1.35rem;
}

.media-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.media-actions input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-button,
.clear-media-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 13px;
  border: 0;
  border-radius: 8px;
  font-family: var(--font-display);
  font-weight: 900;
}

.file-button {
  gap: 8px;
  background: var(--teal);
  color: #07111f;
  cursor: pointer;
}

.file-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.clear-media-button {
  background: rgba(255, 255, 255, 0.10);
  color: var(--ink);
}

.video-stage {
  margin-bottom: 12px;
  overflow: hidden;
  border-radius: 8px;
  background: #000;
}

.video-stage video {
  display: block;
  width: 100%;
  max-height: 56vh;
  background: #000;
}

.media-playlist {
  display: grid;
  gap: 8px;
}

.media-empty {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.media-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.media-item.active {
  border-color: rgba(38, 198, 184, 0.58);
  background: rgba(38, 198, 184, 0.12);
}

.media-type {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.10);
  color: var(--gold);
  font-family: var(--font-display);
  font-weight: 900;
}

.media-name {
  min-width: 0;
}

.media-name strong,
.media-name span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-name span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.media-play-button {
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: var(--coral);
  color: white;
  font-family: var(--font-display);
  font-weight: 900;
}

.media-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.media-favorite-button,
.media-icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.10);
}

.media-favorite-button {
  color: var(--coral);
  font-size: 1.05rem;
}

.media-favorite-button.active {
  background: var(--coral);
  color: white;
}

.media-icon-button {
  color: var(--blue);
}

.media-icon-button.remove {
  background: var(--blue);
  color: white;
}

.media-icon-button svg {
  width: 17px;
  height: 17px;
}

.station-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(122px, 1fr));
  grid-auto-flow: dense;
  gap: 20px 14px;
  align-items: start;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
}

.pagination[hidden] {
  display: none;
}

.page-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  font-weight: 900;
}

.page-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.page-button svg {
  width: 18px;
  height: 18px;
}

.pagination span {
  min-width: 84px;
  color: var(--muted);
  text-align: center;
  font-weight: 900;
}

.station-card {
  display: grid;
  grid-template-rows: auto minmax(42px, auto);
  gap: 8px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  color: inherit;
  text-align: center;
  cursor: pointer;
  transition: transform 160ms ease;
}

.station-card:hover,
.station-card:focus-visible {
  transform: translateY(-2px);
  outline: none;
}

.station-card:focus-visible .station-art {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(55, 137, 255, 0.24), 0 12px 24px rgba(0, 0, 0, 0.24);
}

.station-card.playing {
  transform: translateY(-2px);
  z-index: 2;
}

.station-card.playing .station-art {
  display: grid;
  place-items: center;
  overflow: visible;
  border-color: rgba(215, 166, 80, 0.92);
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle, #05070c 0 8px, #121821 9px 12px, #05070c 13px 18px);
  box-shadow: 0 0 0 3px rgba(215, 166, 80, 0.20), 0 14px 28px rgba(0, 0, 0, 0.30);
}

.station-card.playing .station-art::before,
.station-card.playing .station-art::after {
  content: "";
  position: absolute;
  z-index: 2;
  border-radius: 50%;
  pointer-events: none;
}

.station-card.playing .station-art::before {
  inset: 12%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    inset 0 0 0 18px rgba(255, 255, 255, 0.035),
    inset 0 0 34px rgba(215, 166, 80, 0.18);
}

.station-card.playing .station-art::after {
  width: 18%;
  height: 18%;
  background:
    radial-gradient(circle, #f8f5ef 0 30%, #07111f 31% 46%, var(--gold) 47% 100%);
  box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.08);
}

.station-card.playing .station-copy {
  text-align: left;
}

.station-card.playing h3 {
  font-size: 1.05rem;
}

.station-card.playing p {
  white-space: normal;
}

.station-card.playing .play-fab {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0);
  visibility: hidden;
}

.station-art {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(17, 29, 51, 0.12);
  background: #f8f5ef;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.station-card:hover .station-art {
  border-color: rgba(55, 137, 255, 0.46);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
}

.station-art .station-logo {
  width: 100%;
  height: 100%;
  padding: 8px;
  border-radius: 8px;
  background: #f8f5ef;
  object-fit: contain;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.64);
}

.station-card.playing .station-logo {
  width: 74%;
  height: 74%;
  padding: 10px;
  border-radius: 50%;
  background: #f8f5ef;
  box-shadow:
    0 0 0 8px rgba(255, 255, 255, 0.06),
    0 0 0 20px rgba(255, 255, 255, 0.035);
  animation: vinylSpin 4.5s linear infinite;
}

.vinyl-eq {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  border-radius: 50%;
  background: transparent;
  pointer-events: none;
}

.station-card.playing .vinyl-eq {
  display: block;
}

.vinyl-eq span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 3px;
  height: var(--bar-height, 10px);
  min-height: 7px;
  border-radius: 999px;
  background: hsl(calc(var(--i) * 7.5), 96%, 58%);
  box-shadow:
    0 0 8px hsl(calc(var(--i) * 7.5), 96%, 58%),
    0 0 16px hsl(calc(var(--i) * 7.5), 96%, 50%);
  transform: translate(-50%, -100%) rotate(var(--rot));
  transform-origin: 50% 100%;
  animation: equalizerBeat var(--beat-duration, 760ms) ease-in-out var(--beat-delay, 0ms) infinite alternate;
  transition: height 72ms linear;
}

.vinyl-eq span[style*="--bar-height"] {
  animation: none;
}

.play-fab {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.88);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.station-card:hover .play-fab,
.station-card:focus-visible .play-fab {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.play-fab svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  stroke: none;
  transform: translateX(1px);
}

.station-copy {
  min-width: 0;
  padding: 0 2px;
}

.station-head {
  min-width: 0;
}

.station-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 0;
}

.meta-row span {
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #c7cad1;
  font-size: 0.76rem;
  font-weight: 800;
}

.card-actions {
  display: none;
}

.play-button,
.favorite-button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  font-weight: 800;
}

.playlist-card-button {
  display: grid;
  place-items: center;
  width: 34px;
  min-height: 34px;
  padding: 0;
  background: rgba(255, 255, 255, 0.92);
  color: var(--blue);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.playlist-card-button.remove {
  background: var(--blue);
  color: white;
}

.playlist-card-button svg {
  width: 17px;
  height: 17px;
}

.play-button {
  background: rgba(255, 255, 255, 0.10);
  color: white;
}

.favorite-button {
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.92);
  color: var(--coral);
  font-size: 1.08rem;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.favorite-button.active {
  background: var(--coral);
  color: white;
}

.home-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--blue);
  text-decoration: none;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.station-card.playing .home-button {
  display: none;
}

.tile-actions {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 5;
  display: grid;
  gap: 6px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.station-card:hover .tile-actions,
.station-card:focus-within .tile-actions,
.station-card.playing .tile-actions {
  opacity: 1;
  transform: translateY(0);
}

.tile-actions .favorite-button {
  width: 34px;
  min-height: 34px;
  border-radius: 8px;
}

.tile-actions .favorite-button.active {
  background: var(--coral);
  color: white;
}

.player-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(300px, 1fr) minmax(190px, 260px);
  gap: 18px;
  align-items: center;
  padding: 10px 28px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(255, 85, 0, 0.16), transparent 36%),
    rgba(12, 12, 15, 0.96);
  backdrop-filter: blur(18px);
  box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.28);
  transition: padding 180ms ease, background 180ms ease;
}

.player-bar.expanded {
  padding-top: 18px;
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
  background:
    linear-gradient(90deg, rgba(255, 85, 0, 0.22), transparent 44%),
    rgba(12, 12, 15, 0.985);
}

.player-now {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 22px;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.player-now img {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  object-fit: cover;
  background: #2a2a32;
}

.player-now strong,
.player-now span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-now strong {
  color: var(--ink);
  font-size: 0.98rem;
}

.player-now span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.expand-icon {
  width: 20px;
  color: var(--muted);
  transition: transform 180ms ease;
}

.player-bar.expanded .expand-icon {
  transform: rotate(180deg);
}

.player-controls {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.transport-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.transport-controls button,
.player-library-actions button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

.transport-controls button:disabled,
.player-library-actions button:disabled,
.player-library-actions select:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.transport-controls button:hover:not(:disabled),
.player-library-actions button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.16);
}

.transport-controls .player-play-button {
  width: 44px;
  height: 44px;
  background: var(--coral);
  color: white;
}

.transport-controls svg,
.player-library-actions svg {
  width: 19px;
  height: 19px;
}

.pause-icon,
.muted-icon,
.player-bar.is-playing .play-icon,
#playerMute.active .volume-icon {
  display: none;
}

.player-bar.is-playing .pause-icon,
#playerMute.active .muted-icon {
  display: block;
}

.seek-row {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) 50px;
  gap: 9px;
  align-items: center;
}

.seek-row span {
  color: var(--muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

#playerSeek {
  width: 100%;
  height: 4px;
  margin: 0;
  border-radius: 999px;
  appearance: none;
  background: linear-gradient(90deg, var(--coral) var(--seek-progress, 0%), rgba(255, 255, 255, 0.18) var(--seek-progress, 0%));
  accent-color: var(--coral);
}

#playerSeek::-webkit-slider-thumb {
  width: 15px;
  height: 15px;
  border: 0;
  border-radius: 50%;
  appearance: none;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

#playerSeek:disabled {
  opacity: 0.45;
}

.player-library-actions {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  gap: 7px;
  align-items: center;
  min-width: 0;
}

.player-library-actions select {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  font-size: 0.78rem;
}

#playerFavorite {
  color: var(--coral);
  font-size: 1.15rem;
}

#playerFavorite.active {
  background: var(--coral);
  color: white;
}

#playerAddPlaylist {
  color: var(--blue);
}

.player-bar audio {
  display: none;
}

.skeleton {
  min-height: 216px;
  border-radius: 8px;
  background: linear-gradient(90deg, #1a1a20 25%, #26262f 50%, #1a1a20 75%);
  background-size: 200% 100%;
  animation: shimmer 1.15s infinite;
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }

  to {
    background-position: -200% 0;
  }
}

@keyframes vinylSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes equalizerBeat {
  from {
    height: 7px;
  }

  to {
    height: var(--idle-height, 24px);
  }
}

@keyframes livePulse {
  from {
    height: 8px;
  }

  to {
    height: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .station-card.playing .station-logo,
  .vinyl-eq span {
    animation: none;
  }
}

@media (max-width: 880px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .topbar {
    flex-direction: column;
  }

  .feature-toolbar,
  body.drive-mode .feature-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .unlocked-badge {
    max-width: none;
    grid-column: 1 / -1;
  }

  body.drive-mode .now-playing {
    grid-template-columns: minmax(190px, 280px) minmax(0, 1fr);
    min-height: 0;
  }

  h2 {
    font-size: 1.85rem;
  }

  .player-bar {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 1fr);
  }

  .player-library-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  body {
    background: var(--paper);
  }

  .app-shell {
    min-height: calc(100svh - 92px);
  }

  .sidebar,
  .content,
  .player-bar {
    padding-left: 16px;
    padding-right: 16px;
  }

  .sidebar {
    padding-top: calc(16px + env(safe-area-inset-top));
    padding-bottom: 18px;
  }

  .brand {
    margin-bottom: 18px;
  }

  .brand-logo {
    width: 46px;
    height: 46px;
  }

  h1 {
    font-size: 1.25rem;
  }

  h2 {
    font-size: 1.55rem;
  }

  .search-panel {
    gap: 12px;
  }

  .search-box,
  .primary-action,
  select {
    min-height: 48px;
  }

  .filter-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .quick-tags {
    overflow-x: auto;
    flex-wrap: nowrap;
    margin-right: -16px;
    padding-right: 16px;
    scrollbar-width: none;
  }

  .quick-tags::-webkit-scrollbar {
    display: none;
  }

  .tag-button {
    flex: 0 0 auto;
  }

  .station-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px 10px;
  }

  .media-library {
    padding: 12px;
  }

  .media-library-head {
    display: grid;
  }

  .media-actions {
    justify-content: stretch;
  }

  .file-button {
    flex: 1 1 180px;
    font-size: 0.88rem;
    white-space: nowrap;
  }

  .clear-media-button {
    flex: 1 1 90px;
  }

  .media-item {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .media-item-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .media-play-button {
    flex: 1 1 auto;
  }

  .content {
    padding-top: 20px;
    padding-bottom: 126px;
  }

  .topbar {
    gap: 12px;
    margin-bottom: 16px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .feature-toolbar,
  body.drive-mode .feature-toolbar {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .feature-button,
  .sleep-control {
    min-width: 0;
    min-height: 60px;
    font-size: 0.8rem;
  }

  .feature-button {
    flex-direction: column;
    gap: 4px;
    padding: 7px;
  }

  .feature-button span {
    overflow-wrap: anywhere;
  }

  .sleep-control {
    grid-template-columns: auto 1fr;
  }

  .sleep-control select {
    grid-column: 1 / -1;
    width: 100%;
  }

  body.drive-mode .topbar > div:first-child,
  body.drive-mode .status-pill,
  body.drive-mode .phone-button,
  body.drive-mode .install-button {
    display: none;
  }

  body.drive-mode .topbar-actions {
    justify-content: flex-end;
  }

  body.drive-mode .now-playing {
    grid-template-columns: 1fr;
  }

  .status-pill {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .now-playing {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
    align-items: stretch;
  }

  .now-playing.expanded {
    min-height: 0;
  }

  .live-art {
    max-width: 320px;
    margin: 0 auto;
  }

  .live-copy h3 {
    font-size: 2.05rem;
  }

  .record-panel {
    grid-column: 1 / -1;
    grid-template-columns: 1fr auto;
    align-items: center;
    justify-items: stretch;
  }

  .icon-button {
    justify-self: end;
  }

  .station-card {
    min-height: 0;
    padding: 0;
  }

  .station-head {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .station-logo {
    width: 56px;
    height: 56px;
  }

  .pagination {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
  }

  .page-button {
    min-width: 0;
    padding: 0 10px;
  }

  .player-bar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding-top: 10px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }

  .player-bar.expanded {
    grid-template-columns: 1fr;
    gap: 14px;
    padding-top: 14px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }

  .player-now {
    grid-template-columns: 42px minmax(0, 1fr) 18px;
    gap: 9px;
  }

  .player-now img {
    width: 42px;
    height: 42px;
  }

  .player-bar:not(.expanded) .seek-row,
  .player-bar:not(.expanded) .player-library-actions,
  .player-bar:not(.expanded) #playerPrevious,
  .player-bar:not(.expanded) #playerMute {
    display: none;
  }

  .player-bar:not(.expanded) .player-controls {
    width: auto;
  }

  .player-bar:not(.expanded) .transport-controls {
    gap: 6px;
  }

  .player-bar:not(.expanded) .transport-controls button {
    width: 38px;
    height: 38px;
  }

  .player-bar.expanded .player-library-actions {
    grid-column: auto;
  }

  .player-bar.expanded .seek-row {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
  }
}

/* Typography refresh */
.eyebrow,
h1,
h2,
.field-label,
.primary-action,
.install-button,
.phone-button,
.favorites-filter,
.tag-button,
.status-pill,
.record-button,
.page-button,
.pagination span,
.now-playing h3,
.station-card h3,
.meta-row span,
.play-button,
.favorite-button,
.home-button,
.player-now strong {
  font-family: var(--font-display);
}

.eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

h1 {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

h2 {
  font-size: 2.35rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.field-label {
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.now-playing h3,
.station-card h3,
.player-now strong {
  font-weight: 800;
  letter-spacing: 0.005em;
}

.station-card p {
  font-size: 0.84rem;
  line-height: 1.35;
}

.now-playing .track-line {
  font-size: 0.88rem;
}

.meta-row span {
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

.player-now strong {
  font-size: 1rem;
}

.player-now span {
  font-size: 0.8rem;
}

@media (max-width: 880px) {
  h2 {
    font-size: 1.95rem;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 1.32rem;
  }

  h2 {
    font-size: 1.62rem;
  }
}
