:root{
  --bo-red:#E01B2F;
  --bo-green:#007A6D;
  --bo-red-hover:#B31626;
  --bo-green-hover:#006257;
  --bo-green-soft:#E6F2F0;
}
/* Top listening controls — no bottom bar.
   A compact pill appears at the top only while something is playing
   and the main controls have scrolled out of reach. */

.bo-listen-heading{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:12px 20px;
  margin:0 0 8px;
}
.bo-listen-heading h1{
  margin:0;
  flex:1 1 auto;
  min-width:min(12rem,100%);
}
.bo-listen-dock{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:10px;
}
.bo-listen-dock-heading{
  flex:0 1 auto;
  justify-content:flex-end;
}
.bo-listen-dock-nav{
  justify-content:center;
  padding:12px 16px 14px;
  background:#fff8ec;
  border-bottom:1px solid #e6d8c4;
  box-sizing:border-box;
}

.bo-btn-listen,
.bo-btn-stop,
.bo-btn-next{
  font:inherit;
  font-weight:700;
  font-size:1.05rem;
  line-height:1.2;
  text-align:center;
  cursor:pointer;
  border-radius:14px;
  min-height:56px;
  padding:8px 16px;
  flex:none;
  white-space:normal;
}
.bo-btn-listen{
  background:var(--bo-green);
  color:#fff;
  border:2px solid var(--bo-green-hover);
  min-width:7.5em;
}
.bo-btn-listen.is-switch{
  min-width:11em;
}
.bo-btn-stop{
  background:var(--bo-red);
  color:#fff;
  border:2px solid var(--bo-red-hover);
  min-width:9.5em;
}
.bo-btn-next{
  background:var(--bo-green-soft);
  color:var(--bo-green);
  border:2px solid var(--bo-green);
  min-width:5.5em;
}
.bo-btn-listen:hover,
.bo-btn-listen:focus-visible{
  background:var(--bo-green-hover);
  outline:3px solid var(--bo-green-hover);
  outline-offset:3px;
}
.bo-btn-stop:hover,
.bo-btn-stop:focus-visible{
  background:var(--bo-red-hover);
  outline:3px solid var(--bo-red-hover);
  outline-offset:3px;
}
.bo-btn-next:hover,
.bo-btn-next:focus-visible{
  background:var(--bo-green);
  color:#fff;
  outline:3px solid var(--bo-green);
  outline-offset:3px;
}
.bo-btn-stop:disabled,
.bo-btn-next:disabled{
  opacity:.4;
  cursor:default;
}
.bo-btn-stop:disabled:hover,
.bo-btn-stop:disabled:focus-visible{
  background:var(--bo-red);
  color:#fff;
  outline:none;
}
.bo-btn-next:disabled:hover,
.bo-btn-next:disabled:focus-visible{
  background:var(--bo-green-soft);
  color:var(--bo-green);
  outline:none;
}

.bo-now-title{
  font-weight:700;
  color:var(--bo-green);
  font-size:.95rem;
  line-height:1.25;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  max-width:22em;
}
.bo-listen-dock .bo-now-title{display:none}

/* Compact stay-on-screen control — only while listening, when the dock is off-screen.
   Sits at the top, clear of the mid-screen Back and Top buttons. */
.bo-listen-pill{
  position:fixed;
  top:8px;
  left:50%;
  transform:translateX(-50%);
  z-index:45;
  display:flex;
  align-items:center;
  gap:8px;
  max-width:min(720px, calc(100% - 16px));
  padding:6px 8px;
  background:var(--bo-green-soft);
  border:2px solid var(--bo-green);
  border-radius:20px;
  box-shadow:0 4px 16px rgba(0,122,109,.2);
  box-sizing:border-box;
}
.bo-listen-pill[hidden]{display:none}
.bo-listen-pill .bo-now-title{
  flex:1 1 auto;
  padding:0 4px 0 8px;
  max-width:none;
}
.bo-listen-pill .bo-btn-stop,
.bo-listen-pill .bo-btn-next{
  min-height:48px;
  padding:6px 12px;
  border-radius:14px;
  font-size:1rem;
}

.now-playing-tag{
  display:inline-flex;
  align-items:center;
  margin:6px 0 10px;
  padding:4px 12px;
  border-radius:999px;
  background:var(--bo-green);
  color:#fff;
  font-weight:700;
  font-size:.9rem;
  letter-spacing:.01em;
  line-height:1.3;
}
.story-card.now-playing{
  box-shadow:inset 6px 0 0 var(--bo-green);
}
.listen-item.now-playing a{
  color:var(--bo-green);
}
.listen-item{flex-wrap:wrap}
.listen-item .now-playing-tag{
  margin:0 0 0 auto;
  flex:none;
  font-size:.85rem;
  padding:4px 10px;
}

/* Make the card Listen button the obvious way to pick a story */
.listen-btn{
  font:inherit;
  font-weight:700;
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:48px;
  padding:8px 20px;
  margin:4px 0 14px;
  border:2px solid var(--bo-green);
  border-radius:999px;
  background:var(--bo-green);
  color:#fff;
  cursor:pointer;
}
.listen-btn:hover,
.listen-btn:focus-visible{
  background:var(--bo-green-hover);
  color:#fff;
  outline:3px solid var(--bo-green-hover);
  outline-offset:3px;
}

@media(max-width:700px){
  .bo-listen-heading{
    flex-direction:column;
    align-items:stretch;
    gap:10px;
  }
  .bo-listen-dock-heading,
  .bo-listen-dock-nav{
    width:100%;
    justify-content:stretch;
  }
  .bo-btn-listen,
  .bo-btn-stop{
    flex:1 1 calc(50% - 10px);
  }
  .bo-btn-next{
    flex:1 1 100%;
  }
  .bo-btn-listen.is-switch{
    flex:1 1 100%;
  }
  /* Keep list play buttons clear of the mid-left Back button */
  .listen-list{
    padding-left:56px;
  }
  .listen-item .now-playing-tag{
    flex:1 0 100%;
    margin:4px 0 0 0;
    justify-content:center;
  }
  .bo-listen-pill{
    top:6px;
    width:calc(100% - 12px);
    max-width:none;
    flex-wrap:wrap;
    border-radius:16px;
  }
  .bo-listen-pill .bo-now-title{
    flex:1 1 100%;
    padding:2px 8px 0;
  }
  .bo-listen-pill .bo-btn-stop,
  .bo-listen-pill .bo-btn-next{
    flex:1 1 auto;
    min-height:52px;
  }
}
@media(max-width:390px){
  .bo-btn-listen,
  .bo-btn-stop,
  .bo-btn-next{
    min-height:58px;
    font-size:1.05rem;
  }
}

/* Keep story titles clear of the compact top pill */
body.has-listen-pill .story-card,
body.has-listen-pill .listen-item{
  scroll-margin-top:110px;
}

