/* Persistent radio: fixed overlay, zero document flow. */

.radio-dock {
  position: fixed;
  z-index: 30;
  left: 1.1rem;
  right: auto;
  bottom: 1.1rem;
  width: min(22rem, calc(100vw - 2.2rem));
  pointer-events: none;
}
.radio-dock > * {
  pointer-events: auto;
}

.radio-dock-fab {
  display: none;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(0, 255, 163, 0.35);
  border-radius: 50%;
  background: rgba(18, 22, 28, 0.96);
  color: #00ffa3;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  place-items: center;
  padding: 0;
}
.radio-dock-fab-ico {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 7px 0 7px 12px;
  border-color: transparent transparent transparent currentColor;
  margin-left: 3px;
}
.radio-dock-fab.is-playing .radio-dock-fab-ico {
  width: 12px;
  height: 14px;
  border: none;
  margin-left: 0;
  background:
    linear-gradient(currentColor, currentColor) 0 0 / 4px 100% no-repeat,
    linear-gradient(currentColor, currentColor) 8px 0 / 4px 100% no-repeat;
}

.radio-dock .mini-radio {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.45rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(18, 22, 28, 0.96);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}
.radio-dock .mini-radio-cover {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #111;
  flex: 0 0 auto;
}
.radio-dock .mini-radio-jump {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 0.08rem;
  text-align: left;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  padding: 0;
  cursor: pointer;
}
.radio-dock .mini-radio-jump strong {
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.radio-dock .mini-radio-jump span {
  color: #9aa3ad;
  font-size: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.radio-dock .mini-radio-play {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #00ffa3;
  color: #04140c;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: 0 0 auto;
}
.radio-dock .mini-radio-play .icon-play {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 7px 0 7px 12px;
  border-color: transparent transparent transparent currentColor;
  margin-left: 3px;
}
.radio-dock .mini-radio-play.playing .icon-play {
  width: 12px;
  height: 14px;
  border: none;
  margin-left: 0;
  background:
    linear-gradient(currentColor, currentColor) 0 0 / 4px 100% no-repeat,
    linear-gradient(currentColor, currentColor) 8px 0 / 4px 100% no-repeat;
}
.radio-dock-close {
  display: none;
  width: 32px;
  height: 32px;
  border: 0;
  background: none;
  color: #9aa3ad;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}

.radio-dock-stations {
  margin-top: 0.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.45rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(18, 22, 28, 0.96);
}
.radio-dock-stations[hidden] {
  display: none !important;
}
.radio-dock-stations .station-chip {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
}
.radio-dock-stations .station-chip.active {
  border-color: rgba(0, 255, 163, 0.45);
  background: rgba(0, 255, 163, 0.12);
  color: #00ffa3;
}

/* Site pages: compact bar always on. */
body:not(.pulse-page):not(.pulse-app-shell):not(.pulse-embed-host) .radio-dock-fab {
  display: none;
}

/* Leave room so the last news row can scroll above the player */
body:not(.pulse-page):not(.pulse-app-shell):not(.pulse-embed-host) {
  padding-bottom: 5.25rem;
}

/* Pulse / Overlay: FAB only until opened or playing. */
body.pulse-page .radio-dock,
body.pulse-app-shell .radio-dock,
html.pulse-embed-host .radio-dock,
html.overlay-embed-host .radio-dock,
body.pulse-embed-host .radio-dock {
  width: auto;
  right: 0.95rem;
  bottom: 1.1rem;
  z-index: 45;
}
body.pulse-page .radio-dock-fab,
body.pulse-app-shell .radio-dock-fab,
html.pulse-embed-host .radio-dock-fab,
html.overlay-embed-host .radio-dock-fab,
body.pulse-embed-host .radio-dock-fab {
  display: grid;
}
body.pulse-page .radio-dock:not(.is-open) .mini-radio,
body.pulse-page .radio-dock:not(.is-open) .radio-dock-stations,
body.pulse-app-shell .radio-dock:not(.is-open) .mini-radio,
body.pulse-app-shell .radio-dock:not(.is-open) .radio-dock-stations,
html.pulse-embed-host .radio-dock:not(.is-open) .mini-radio,
html.pulse-embed-host .radio-dock:not(.is-open) .radio-dock-stations,
html.overlay-embed-host .radio-dock:not(.is-open) .mini-radio,
html.overlay-embed-host .radio-dock:not(.is-open) .radio-dock-stations,
body.pulse-embed-host .radio-dock:not(.is-open) .mini-radio,
body.pulse-embed-host .radio-dock:not(.is-open) .radio-dock-stations {
  display: none;
}
body.pulse-page .radio-dock.is-open,
body.pulse-app-shell .radio-dock.is-open,
html.pulse-embed-host .radio-dock.is-open,
html.overlay-embed-host .radio-dock.is-open,
body.pulse-embed-host .radio-dock.is-open {
  width: min(22rem, calc(100vw - 1.5rem));
}
body.pulse-page .radio-dock.is-open .radio-dock-fab,
body.pulse-app-shell .radio-dock.is-open .radio-dock-fab,
html.pulse-embed-host .radio-dock.is-open .radio-dock-fab,
html.overlay-embed-host .radio-dock.is-open .radio-dock-fab,
body.pulse-embed-host .radio-dock.is-open .radio-dock-fab {
  display: none;
}
body.pulse-page .radio-dock-close,
body.pulse-app-shell .radio-dock-close,
html.pulse-embed-host .radio-dock-close,
html.overlay-embed-host .radio-dock-close,
body.pulse-embed-host .radio-dock-close {
  display: grid;
}

/* Desktop Pulse: keep last score row clear of the FAB */
@media (min-width: 981px) {
  body.pulse-embed-host .pulse-embed-main,
  body.pulse-app-shell .pulse-main {
    padding-bottom: 4.25rem;
  }
}

/* Pixel 10a / phones: sit above the bottom dock, not on top of it */
@media (max-width: 980px) {
  .radio-dock {
    left: 0.65rem;
    right: 0.65rem;
    bottom: calc(4.7rem + env(safe-area-inset-bottom, 0px));
    width: auto;
    z-index: 28;
  }

  body:not(.pulse-page):not(.pulse-app-shell):not(.pulse-embed-host) {
    padding-bottom: calc(8.6rem + env(safe-area-inset-bottom, 0px));
  }

  body.pulse-page .radio-dock,
  body.pulse-app-shell .radio-dock,
  html.pulse-embed-host .radio-dock,
  html.overlay-embed-host .radio-dock,
  body.pulse-embed-host .radio-dock {
    left: auto;
    right: 0.7rem;
    bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
    z-index: 45;
    width: auto;
  }
  body.pulse-page .radio-dock.is-open,
  body.pulse-app-shell .radio-dock.is-open,
  html.pulse-embed-host .radio-dock.is-open,
  html.overlay-embed-host .radio-dock.is-open,
  body.pulse-embed-host .radio-dock.is-open {
    left: 0.65rem;
    width: auto;
  }
  body.menu-open .radio-dock {
    visibility: hidden;
  }
}
