/* The Listening Room: persistent controls for the HOT app. */
:root {
  --audio-player-height: 0px;
  --audio-player-bottom: 24px;
}

.audio-dock {
  right: 24px;
  bottom: var(--audio-player-bottom);
  width: min(700px, calc(100vw - var(--rail-width) - 48px));
  max-height: calc(100dvh - var(--audio-player-bottom) - 24px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 22px 24px 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(243, 198, 122, .24);
  border-radius: 24px;
  background: linear-gradient(135deg, #14283b, #091729 72%);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .05);
  color: var(--ink);
}

.audio-dock [hidden] { display: none !important; }
.audio-dock.is-enhanced > audio { display: none; }
.audio-dock:not(.is-enhanced) :is(.player-controls, .player-mini-controls, .player-expand) { display: none; }
.audio-dock > audio { margin-top: 16px; }
.player-heading { display: flex; align-items: center; gap: 12px; min-width: 0; }
.player-artwork {
  display: grid;
  place-items: center;
  flex: 0 0 62px;
  width: 62px;
  height: 62px;
  border: 1px solid rgba(243, 198, 122, .18);
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(145deg, #23394a, #0c1a2c);
}
.player-artwork img { width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: cover; object-position: 50% 50%; }
.audio-dock .audio-dock-copy { flex: 1; gap: 4px; min-width: 0; }
.player-kicker { color: var(--gold); font-size: 9px; line-height: 1.4; letter-spacing: .19em; font-weight: 750; text-transform: uppercase; }
.audio-dock .audio-dock-copy strong { font-size: 19px; line-height: 1.25; font-weight: 650; letter-spacing: -.025em; white-space: normal; overflow-wrap: anywhere; }
.player-subtitle { color: #b9c6d4; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.audio-dock :is(.player-icon-button, .player-play, .player-skip) {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #d6dfe9;
  cursor: pointer;
  transition: background .16s ease, color .16s ease, transform .16s ease;
  touch-action: manipulation;
}
.audio-dock .player-icon-button { width: 44px; height: 44px; }
.audio-dock :is(.player-icon-button, .player-skip):hover { background: rgba(255, 255, 255, .08); color: #fff; }
.audio-dock :is(.player-icon-button, .player-play, .player-skip):active { transform: scale(.95); }
.audio-dock :is(button, select, input, summary):focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.audio-dock :is(button, input):disabled { opacity: .4; cursor: default; }
.audio-dock button:disabled:active { transform: none; }
.audio-dock :is(.player-icon-button, .player-skip) svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.player-expand svg { transition: transform .2s ease; }
.player-expand[aria-expanded="false"] svg { transform: rotate(180deg); }
.player-controls { margin-top: 14px; }
.player-timeline { width: 100%; }
.audio-dock .player-range {
  --player-progress: 0%;
  display: block;
  width: 100%;
  min-width: 0;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  accent-color: var(--gold);
}
.audio-dock .player-range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 10px;
  background: linear-gradient(to right, var(--gold) 0%, var(--gold) var(--player-progress), #3d4b5e var(--player-progress), #3d4b5e 100%);
}
.audio-dock .player-range::-moz-range-track { height: 4px; border-radius: 10px; background: #3d4b5e; }
.audio-dock .player-range::-moz-range-progress { height: 4px; border-radius: 10px; background: var(--gold); }
.audio-dock .player-range::-webkit-slider-thumb { width: 14px; height: 14px; margin-top: -5px; border: 0; border-radius: 50%; background: var(--gold); appearance: none; -webkit-appearance: none; box-shadow: 0 0 0 4px rgba(243, 198, 122, .09); }
.audio-dock .player-range::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(243, 198, 122, .09); }
.audio-dock .player-range:hover::-webkit-slider-thumb { box-shadow: 0 0 0 6px rgba(243, 198, 122, .15); }
.player-times { display: flex; justify-content: space-between; gap: 16px; margin-top: 0; color: #b9c6d4; font-size: 11px; font-variant-numeric: tabular-nums; line-height: 1.5; }
.player-control-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 18px; margin-top: 10px; }
.player-transport { display: flex; align-items: center; justify-content: center; gap: 16px; }
.audio-dock .player-play { width: 60px; height: 60px; min-height: 60px; background: var(--gold); color: #07172b; box-shadow: 0 4px 18px rgba(243, 198, 122, .12); }
.audio-dock .player-play:hover { background: #ffdda2; }
.player-play svg { width: 24px; height: 24px; }
.player-play [data-player-icon] { fill: currentColor; stroke: none; }
.audio-dock .player-skip { position: relative; width: 44px; height: 44px; }
.audio-dock .player-skip svg { width: 33px; height: 33px; }
.player-skip span { position: absolute; top: 17px; left: 0; width: 100%; text-align: center; font-size: 10px; font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1; }
.player-speed { display: flex; align-items: center; gap: 7px; color: #b9c6d4; font-size: 11px; }
.audio-dock .player-speed select { width: 76px; min-height: 44px; padding: 0 8px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 12px; background: rgba(255, 255, 255, .04); color: var(--ink); font-size: 12px; font-weight: 650; cursor: pointer; }
.player-speed option { background: #0c1d33; color: var(--ink); }
.player-volume { display: flex; align-items: center; justify-content: flex-end; gap: 0; min-width: 0; }
.player-volume [data-player-mute] { position: relative; }
.player-volume [data-player-mute][aria-pressed="true"] { color: var(--gold); background: rgba(243, 198, 122, .08); }
.player-volume [data-player-mute][aria-pressed="true"]::after { content: ""; position: absolute; width: 25px; height: 2px; border-radius: 2px; background: currentColor; transform: rotate(-45deg); }
.player-volume .player-range { width: min(78px, 100%); }
.audio-dock .player-volume .player-range::-webkit-slider-thumb { width: 10px; height: 10px; margin-top: -3px; box-shadow: none; }
.audio-dock .player-volume .player-range::-moz-range-thumb { width: 10px; height: 10px; box-shadow: none; }
.player-status { margin: 12px 0 2px; color: #c9d4e0; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.audio-dock.has-error .player-status { color: #ffcf9e; }
.audio-dock .player-status button { min-height: 44px; margin-left: 8px; padding: 0 12px; border: 1px solid rgba(243, 198, 122, .45); border-radius: 10px; background: transparent; color: var(--gold); cursor: pointer; }
.audio-dock.is-loading .player-artwork { border-color: rgba(243, 198, 122, .6); }
.audio-dock.is-playing .player-kicker { color: #ffdda2; }
.player-mini-controls { display: none; }
.audio-dock.is-collapsed { padding: 12px 16px; }
.audio-dock.is-collapsed :is(.player-controls, .player-kicker, .audio-private-tools) { display: none; }
.audio-dock.is-collapsed .player-subtitle { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.audio-dock.is-collapsed .player-mini-controls { display: flex; }
.audio-dock.is-collapsed .audio-dock-copy strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.audio-dock.is-collapsed .player-artwork { width: 44px; height: 44px; flex-basis: 44px; border-radius: 12px; }
.audio-dock.is-collapsed .player-artwork img { width: 100%; height: 100%; }
.audio-dock.is-collapsed .player-play { width: 44px; height: 44px; min-height: 44px; }
.audio-dock.is-collapsed .player-play svg { width: 19px; height: 19px; }

/* Keep the existing private queue, bookmarks and timer in one disclosure. */
.audio-dock .audio-private-tools { margin-top: 14px; max-height: none; overflow: visible; border-top: 1px solid rgba(255, 255, 255, .1); color: #b9c6d4; font-size: 13px; }
.audio-dock .audio-private-tools summary { padding: 14px 0 0; min-height: 44px; color: #d6dfe9; font-size: 12px; }
.audio-dock .audio-private-tools[open] summary { margin-bottom: 16px; }
.audio-dock .audio-private-tools .audio-tool-actions { gap: 10px; }
.audio-dock .audio-private-tools .audio-tool-actions > label { flex: 1 1 150px; }
.audio-dock .audio-private-tools :is(input, select) { margin-top: 6px; border-color: #46566b; border-radius: 10px; }
.audio-dock .audio-private-tools button { border-color: #46566b; border-radius: 10px; background: #16273b; font-size: 12px; }
.audio-dock .audio-private-tools button:hover { border-color: var(--gold); }
.audio-dock .audio-private-tools h3 { margin: 24px 0 12px; color: var(--ink); font-size: 14px; font-weight: 650; }
.audio-dock .audio-private-tools :is(ol, ul) { padding-left: 22px; }
.audio-dock .audio-private-tools li { padding-block: 6px; }

/* Reserve the measured dock height so the last page controls stay reachable. */
body.has-audio-player #app-main { padding-bottom: calc(var(--audio-player-height) + var(--audio-player-bottom) + 32px); }
html:has(body.has-audio-player) { scroll-padding-bottom: calc(var(--audio-player-height) + var(--audio-player-bottom) + 24px); }
body.has-audio-player .toast { bottom: calc(var(--audio-player-bottom) + var(--audio-player-height) + 12px); z-index: 75; max-width: min(360px, calc(100vw - 32px)); }

.audio-story { padding: 22px; border-color: rgba(255, 255, 255, .1); border-radius: 20px; background: #09182b; gap: 10px; }
.audio-story > header { margin-bottom: 10px; }
.audio-story > header h2 { font-size: 26px; }
.audio-row { min-height: 78px; padding: 14px 16px; border-color: rgba(255, 255, 255, .07); border-radius: 14px; background: rgba(255, 255, 255, .025); transition: background .16s ease, border-color .16s ease; }
.audio-row:hover { background: rgba(255, 255, 255, .055); border-color: rgba(243, 198, 122, .45); }
.audio-row > span:nth-child(2) { display: grid; flex: 1; min-width: 0; gap: 4px; }
.audio-row .audio-row-state { flex: 0 0 auto; margin-left: auto; }
.audio-row .play-glyph { display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; border: 1px solid rgba(243, 198, 122, .16); border-radius: 50%; background: rgba(243, 198, 122, .06); color: var(--gold); font-size: 13px; }
.audio-row .play-glyph svg { width: 16px; height: 16px; fill: currentColor; }
.audio-row[aria-current="true"] { border-color: rgba(243, 198, 122, .6); background: rgba(243, 198, 122, .07); }
.audio-row[aria-current="true"] .play-glyph { background: var(--gold); color: #07172b; }
.audio-row .audio-row-state { color: var(--gold); font-size: 11px; }

@media (max-width: 980px) {
  :root { --audio-player-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .audio-dock { right: max(12px, env(safe-area-inset-right)); width: min(700px, calc(100vw - max(12px, env(safe-area-inset-left)) - max(12px, env(safe-area-inset-right)))); max-height: calc(100dvh - var(--audio-player-bottom) - 80px); }
  body.has-audio-player .toast { right: 16px; }
}

@media (max-width: 620px) {
  .audio-dock { padding: 16px 16px 10px; border-radius: 20px; }
  .player-heading { gap: 6px; }
  .player-artwork { flex-basis: 48px; width: 48px; height: 48px; margin-right: 4px; border-radius: 13px; }
  .audio-dock .audio-dock-copy strong { font-size: 16px; }
  .player-kicker { font-size: 8px; letter-spacing: .12em; }
  .player-subtitle { font-size: 11px; }
  .player-controls { margin-top: 6px; }
  .player-control-row { grid-template-columns: 1fr auto 1fr; gap: 6px; margin-top: 9px; }
  .player-transport { gap: 8px; }
  .audio-dock .player-play { width: 56px; height: 56px; min-height: 56px; }
  .player-speed { flex-direction: column; justify-self: start; gap: 2px; font-size: 10px; }
  .audio-dock .player-speed select { width: 70px; }
  .player-volume { justify-self: end; }
  .player-volume .player-range { display: none; }
  .audio-dock.is-collapsed { padding: 10px; }
  .audio-dock.is-collapsed .player-artwork { display: grid; margin-right: 4px; }
  .audio-dock.is-collapsed .player-heading { gap: 4px; }
  .audio-dock.is-collapsed .audio-dock-copy { padding-left: 4px; }
  .audio-dock.is-collapsed .player-play { width: 44px; height: 44px; min-height: 44px; }
  .audio-dock .audio-private-tools { margin-top: 10px; }
  .audio-story { padding: 16px; }
  .audio-story > header { align-items: start; gap: 12px; }
  .audio-story > header h2 { font-size: 23px; }
  .audio-story > header span { font-size: 10px; padding-top: 6px; }
  .audio-row { gap: 12px; padding: 12px; }
  .audio-row strong { white-space: normal; overflow-wrap: anywhere; }
}

@media (max-width: 380px) {
  .audio-dock { padding-inline: 12px; }
  .audio-dock:not(.is-collapsed) .player-heading > .player-artwork { display: none; }
  .player-transport { gap: 4px; }
  .player-control-row { gap: 4px; }
  .audio-dock .player-speed select { width: 64px; }
  .audio-dock .player-play { width: 52px; height: 52px; min-height: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  .audio-dock *, .audio-row { transition: none !important; animation: none !important; }
}

@media (forced-colors: active) {
  .audio-dock, .audio-row, .audio-dock :is(.player-play, .player-icon-button, .player-skip) { border: 1px solid ButtonText; }
  .audio-dock .player-range { appearance: auto; -webkit-appearance: auto; }
}

/* Player views share one audio element and one set of controls. */
.player-view-bar { display: flex; align-items: center; justify-content: flex-end; gap: 16px; margin-bottom: 18px; }
.player-view-switch { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 14px; background: rgba(0, 0, 0, .12); }
.player-view-switch button { min-width: 62px; min-height: 44px; padding: 0 13px; border: 0; border-radius: 10px; background: transparent; color: #bdcad8; font-size: 12px; font-weight: 650; cursor: pointer; touch-action: manipulation; }
.player-view-switch button:hover { background: rgba(255, 255, 255, .07); color: var(--ink); }
.player-view-switch button[aria-pressed="true"] { background: #314253; color: #fff1d9; box-shadow: 0 1px 5px rgba(0, 0, 0, .15); }
.player-fullscreen-artwork, .player-browse-links, .player-browse { display: none; }
.audio-dock.is-collapsed .player-view-bar,
.audio-dock:not(.is-enhanced) .player-view-bar { display: none; }
.player-browse svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.audio-dock.is-fullscreen {
  --fs-gutter: max(24px, env(safe-area-inset-left), env(safe-area-inset-right));
  inset: 0;
  z-index: 90;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  padding: max(10px, env(safe-area-inset-top)) var(--fs-gutter) max(20px, env(safe-area-inset-bottom));
  align-items: center;
  border: 0;
  border-radius: 0;
  background: radial-gradient(ellipse at 50% 20%, #1c3548 0%, #0d1c30 44%, #040e1c 90%);
  box-shadow: none;
  overflow-y: auto;
  scrollbar-gutter: stable;
}
.audio-dock.is-fullscreen > * { flex-shrink: 0; }
.audio-dock.is-fullscreen .player-view-bar { width: min(560px, 100%); min-height: 56px; margin: 0 0 clamp(12px, 3vh, 32px); padding-right: 48px; justify-content: flex-start; }
.audio-dock.is-fullscreen .player-view-switch { display: none; }
.audio-dock.is-fullscreen .player-browse { display: inline-flex; align-items: center; justify-content: center; gap: 9px; width: auto; min-height: 44px; margin-left: -6px; padding: 0 14px 0 6px; border: 0; border-radius: 12px; background: transparent; color: #c9d4e0; font-size: 14px; font-weight: 600; cursor: pointer; touch-action: manipulation; }
.audio-dock.is-fullscreen .player-browse:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.audio-dock.is-fullscreen .player-fullscreen-artwork {
  display: grid;
  place-items: center;
  width: min(72vw, 320px, 36dvh);
  max-width: 100%;
  aspect-ratio: 1;
  margin-bottom: clamp(18px, 3.5vh, 36px);
  overflow: hidden;
  border: 1px solid rgba(243, 198, 122, .2);
  border-radius: 22px;
  background: radial-gradient(ellipse at 50% 30%, #294457, #09182b 80%);
  box-shadow: 0 28px 70px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .06);
}
/* Fill square frames edge to edge; non-square sources use a centered crop. */
.player-fullscreen-artwork img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: cover; object-position: 50% 50%; }
.audio-dock.is-fullscreen .player-heading { position: static; display: block; width: min(560px, 100%); text-align: center; }
.audio-dock.is-fullscreen .player-heading > .player-artwork,
.audio-dock.is-fullscreen .player-mini-controls,
.audio-dock.is-fullscreen .player-expand { display: none; }
.audio-dock.is-fullscreen [data-player-close] { position: absolute; top: max(16px, calc(env(safe-area-inset-top) + 6px)); right: max(calc(var(--fs-gutter) - 10px), calc(50% - 290px)); color: #c9d4e0; }
.audio-dock.is-fullscreen .audio-dock-copy { display: grid; gap: 6px; padding: 0; text-align: center; }
.audio-dock.is-fullscreen .audio-dock-copy strong { font-family: Georgia, serif; font-size: clamp(26px, 3.4vw, 38px); font-weight: 500; line-height: 1.12; letter-spacing: -.01em; }
.audio-dock.is-fullscreen .player-kicker { font-size: 10px; letter-spacing: .24em; }
.audio-dock.is-fullscreen .player-subtitle { color: #aebccb; font-size: 14px; }
.audio-dock.is-fullscreen :is(.player-controls, .player-status, .audio-private-tools, .player-browse-links) { width: min(560px, 100%); }
.audio-dock.is-fullscreen .player-controls { margin-top: clamp(16px, 3vh, 30px); }
.audio-dock.is-fullscreen .player-range::-webkit-slider-runnable-track { height: 6px; }
.audio-dock.is-fullscreen .player-range::-moz-range-track,
.audio-dock.is-fullscreen .player-range::-moz-range-progress { height: 6px; }
.audio-dock.is-fullscreen .player-timeline .player-range::-webkit-slider-thumb { width: 16px; height: 16px; margin-top: -5px; }
.audio-dock.is-fullscreen .player-times { margin-top: -4px; color: #aebccb; font-size: 12px; }
.audio-dock.is-fullscreen .player-control-row { grid-template-columns: 1fr 1fr; grid-template-areas: "transport transport" "speed volume"; row-gap: clamp(14px, 2.5vh, 26px); column-gap: 12px; margin-top: clamp(10px, 2vh, 20px); }
.audio-dock.is-fullscreen .player-transport { grid-area: transport; gap: clamp(8px, 4vw, 30px); }
.audio-dock.is-fullscreen .player-play { width: 80px; height: 80px; min-height: 80px; box-shadow: 0 10px 30px rgba(243, 198, 122, .22); }
.audio-dock.is-fullscreen .player-play svg { width: 32px; height: 32px; }
.audio-dock.is-fullscreen .player-skip { width: 56px; height: 56px; color: #e3eaf2; }
.audio-dock.is-fullscreen .player-skip svg { width: 38px; height: 38px; }
.audio-dock.is-fullscreen .player-skip span { top: 23px; font-size: 11px; }
.audio-dock.is-fullscreen .player-speed { grid-area: speed; flex-direction: row; justify-self: start; align-items: center; gap: 8px; color: #aebccb; font-size: 12px; }
.audio-dock.is-fullscreen .player-speed select { width: auto; min-width: 84px; padding: 0 30px 0 16px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 999px; background: rgba(255, 255, 255, .05) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f3c67a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 14px; appearance: none; -webkit-appearance: none; color: var(--ink); font-size: 14px; font-weight: 650; }
.audio-dock.is-fullscreen .player-volume { grid-area: volume; justify-self: end; }
.audio-dock.is-fullscreen .player-status { margin-top: 20px; text-align: center; }
.audio-dock.is-fullscreen .audio-private-tools { margin-top: clamp(16px, 3vh, 28px); padding: 0 16px; border: 1px solid rgba(255, 255, 255, .09); border-radius: 16px; background: rgba(255, 255, 255, .03); }
.audio-dock.is-fullscreen .audio-private-tools summary { display: flex; align-items: center; min-height: 44px; padding: 0; font-size: 14px; font-weight: 600; cursor: pointer; }
.audio-dock.is-fullscreen .audio-private-tools[open] { padding-bottom: 14px; }
.audio-dock.is-fullscreen .player-browse-links { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 18px; margin-top: auto; padding-top: clamp(16px, 3vh, 28px); }
.player-browse-links a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 6px; border: 0; border-radius: 10px; color: #aebccb; font-size: 13px; line-height: 1.4; text-align: center; }
.player-browse-links a:hover { color: var(--gold); }
.audio-dock .player-browse-links a:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
html:has(body.has-fullscreen-player), body.has-fullscreen-player { overflow: hidden; overscroll-behavior: none; }
body.has-fullscreen-player #app-main { padding-bottom: 32px; }
body.has-fullscreen-player .toast { z-index: 100; top: auto; bottom: max(16px, env(safe-area-inset-bottom)); right: max(16px, env(safe-area-inset-right)); }

@media (max-width: 620px) {
  .player-view-bar { justify-content: center; margin-bottom: 14px; }
  .player-view-switch { width: 100%; }
  .player-view-switch button { flex: 1; min-width: 0; padding-inline: 10px; }
  .audio-dock.is-fullscreen { --fs-gutter: max(20px, env(safe-area-inset-left), env(safe-area-inset-right)); padding: max(6px, env(safe-area-inset-top)) var(--fs-gutter) max(16px, env(safe-area-inset-bottom)); }
  .audio-dock.is-fullscreen .player-view-bar { margin-bottom: clamp(8px, 2vh, 20px); }
  .audio-dock.is-fullscreen .player-fullscreen-artwork { width: min(76vw, 300px, 34dvh); margin-bottom: clamp(16px, 3vh, 28px); border-radius: 20px; }
  .audio-dock.is-fullscreen .audio-dock-copy strong { font-size: 28px; }
  .audio-dock.is-fullscreen .player-subtitle { font-size: 13px; }
  .audio-dock.is-fullscreen .player-control-row { gap: 14px 8px; }
}
@media (max-width: 380px) {
  .audio-dock.is-fullscreen { --fs-gutter: max(14px, env(safe-area-inset-left), env(safe-area-inset-right)); }
  .audio-dock.is-fullscreen .audio-dock-copy strong { font-size: 24px; }
}
@media (max-height: 700px) {
  .audio-dock.is-fullscreen .player-view-bar { margin-bottom: 12px; }
  .audio-dock.is-fullscreen .player-fullscreen-artwork { width: min(60vw, 30dvh); margin-bottom: 18px; }
  .audio-dock.is-fullscreen .player-controls { margin-top: 14px; }
  .audio-dock.is-fullscreen .player-control-row { margin-top: 10px; }
}
@media (max-height: 480px) {
  .audio-dock.is-fullscreen .player-fullscreen-artwork { width: 112px; margin-bottom: 12px; }
  .audio-dock.is-fullscreen .player-view-bar { margin-bottom: 4px; }
  .audio-dock.is-fullscreen .audio-dock-copy strong { font-size: 24px; }
  .audio-dock.is-fullscreen .player-play { width: 60px; height: 60px; min-height: 60px; }
  .audio-dock.is-fullscreen .audio-private-tools { margin-top: 16px; }
}
/* Let the artwork sit beside the controls when both columns fit comfortably. */
@media (min-width: 900px) and (min-height: 560px) {
  .audio-dock.is-fullscreen { display: grid; grid-template-columns: minmax(240px, 380px) minmax(0, 520px); grid-template-rows: auto 1fr auto auto auto auto auto auto 1fr auto; grid-template-areas: "bar bar" "art ." "art heading" "art controls" "art upnext" "art status" "art chapters" "art tools" "art ." "nav nav"; column-gap: clamp(40px, 6vw, 96px); justify-content: center; align-items: start; }
  .audio-dock.is-fullscreen .player-view-bar { grid-area: bar; width: 100%; max-width: none; padding-right: 56px; }
  .audio-dock.is-fullscreen .player-fullscreen-artwork { grid-area: art; align-self: center; justify-self: end; width: 100%; max-width: 380px; margin: 0; }
  .audio-dock.is-fullscreen .player-heading { grid-area: heading; width: 100%; text-align: left; }
  .audio-dock.is-fullscreen .audio-dock-copy { text-align: left; }
  .audio-dock.is-fullscreen .player-controls { grid-area: controls; width: 100%; }
  .audio-dock.is-fullscreen .player-status { grid-area: status; width: 100%; text-align: left; }
  .audio-dock.is-fullscreen .audio-private-tools { grid-area: tools; width: 100%; }
  .audio-dock.is-fullscreen .player-browse-links { grid-area: nav; width: 100%; justify-content: center; }
  .audio-dock.is-fullscreen .player-transport { justify-content: flex-start; }
  .audio-dock.is-fullscreen [data-player-close] { right: max(14px, env(safe-area-inset-right)); }
}
@media (forced-colors: active) {
  .player-view-switch, .player-view-switch button[aria-pressed="true"], .player-browse-links a, .player-fullscreen-artwork { border: 1px solid ButtonText; }
}

/* ------------------------------------------------------------------
   Chapter navigation: previous / next, Up next with autoplay, chapter list.
   ------------------------------------------------------------------ */
.audio-dock .player-track {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: #d6dfe9; cursor: pointer; touch-action: manipulation;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}
.audio-dock .player-track:hover:not(:disabled) { background: rgba(255, 255, 255, .08); color: #fff; }
.audio-dock .player-track:active:not(:disabled) { transform: scale(.95); }
.audio-dock .player-track svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.audio-dock .player-track .player-track-fill { fill: currentColor; }
.audio-dock .player-track:disabled { opacity: .28; }
@media (max-width: 620px) { .audio-dock:not(.is-fullscreen) .player-track { display: none; } }

.player-up-next, .player-chapters { display: none; }
.audio-dock.is-fullscreen .player-up-next:not([hidden]) {
  display: flex; align-items: stretch; gap: 10px; width: min(560px, 100%); margin-top: clamp(14px, 2.6vh, 24px);
}
.player-up-next-card {
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; align-items: center; column-gap: 12px;
  flex: 1; min-width: 0; min-height: 56px; padding: 8px 14px 8px 16px; text-align: left;
  border: 1px solid rgba(243, 198, 122, .22); border-radius: 16px; background: rgba(243, 198, 122, .06);
  color: var(--ink); cursor: pointer; touch-action: manipulation;
}
.player-up-next-card:hover { border-color: rgba(243, 198, 122, .5); background: rgba(243, 198, 122, .1); }
.player-up-next-label { grid-column: 1; color: var(--gold); font-size: 10px; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; }
.player-up-next-card strong { grid-column: 1; overflow: hidden; font-size: 15px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.player-up-next-card svg { grid-column: 2; grid-row: 1 / 3; width: 20px; height: 20px; fill: none; stroke: var(--gold); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.player-autoplay {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-width: 76px; padding: 0 8px; border: 1px solid rgba(255, 255, 255, .09); border-radius: 16px;
  background: rgba(255, 255, 255, .03); color: #93a3b6; font-size: 11px; cursor: pointer;
}
.player-autoplay input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.player-switch { position: relative; width: 34px; height: 20px; border-radius: 999px; background: #3d4b5e; transition: background .16s ease; }
.player-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #d6dfe9; transition: transform .16s ease; }
.player-autoplay input:checked + .player-switch { background: var(--gold); }
.player-autoplay input:checked + .player-switch::after { transform: translateX(14px); background: #07172b; }
.player-autoplay:has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 3px; }

.audio-dock.is-fullscreen .player-chapters:not([hidden]) {
  display: block; width: min(560px, 100%); margin-top: 10px; padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, .09); border-radius: 16px; background: rgba(255, 255, 255, .03);
}
.player-chapters summary { display: flex; align-items: center; justify-content: space-between; min-height: 52px; color: #d6dfe9; font-size: 14px; font-weight: 600; cursor: pointer; list-style: none; }
.player-chapters summary::-webkit-details-marker { display: none; }
.player-chapters summary::after { content: ""; width: 8px; height: 8px; margin-left: 10px; border-right: 2px solid #93a3b6; border-bottom: 2px solid #93a3b6; transform: rotate(45deg) translateY(-3px); transition: transform .16s ease; }
.player-chapters[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
.player-chapter-count { margin-left: auto; color: #93a3b6; font-size: 12px; font-weight: 500; }
.player-chapters ol { max-height: 40vh; margin: 0 -8px 10px; padding: 0; overflow-y: auto; list-style: none; }
.player-chapters li button {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 6px 8px;
  border: 0; border-radius: 12px; background: transparent; color: #d6dfe9; font-size: 14px; text-align: left; cursor: pointer;
}
.player-chapters li button:hover { background: rgba(255, 255, 255, .06); }
.player-chapters li button[aria-current="true"] { background: rgba(243, 198, 122, .08); color: #fff1d9; cursor: default; }
.player-chapter-number { display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%; background: rgba(255, 255, 255, .06); color: #93a3b6; font-size: 12px; font-variant-numeric: tabular-nums; }
[aria-current="true"] .player-chapter-number { background: var(--gold); color: #07172b; }
.player-chapter-number svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.player-chapter-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.player-chapter-state { color: var(--gold); font-size: 11px; white-space: nowrap; }
.audio-dock.is-playing [aria-current="true"] .player-chapter-number svg path { animation: chapter-bars 1.1s ease-in-out infinite; transform-origin: center; }
@keyframes chapter-bars { 0%, 100% { transform: scaleY(.55); } 50% { transform: scaleY(1); } }

/* Fullscreen transport with five buttons. */
.audio-dock.is-fullscreen .player-track { width: 52px; height: 52px; }
.audio-dock.is-fullscreen .player-track svg { width: 26px; height: 26px; }
.audio-dock.is-fullscreen .player-transport { gap: clamp(8px, 4vw, 30px); }
@media (max-width: 620px) {
  .audio-dock.is-fullscreen .player-transport { gap: clamp(4px, 2.4vw, 16px); }
  .audio-dock.is-fullscreen .player-track { width: 44px; height: 44px; }
  .audio-dock.is-fullscreen .player-skip { width: 50px; height: 50px; }
  .audio-dock.is-fullscreen .player-skip svg { width: 34px; height: 34px; }
  .audio-dock.is-fullscreen .player-skip span { top: 20px; }
  .audio-dock.is-fullscreen .player-play { width: 72px; height: 72px; min-height: 72px; }
}
@media (max-width: 380px) {
  .audio-dock.is-fullscreen .player-transport { gap: 2px; }
  .audio-dock.is-fullscreen .player-skip { width: 44px; height: 44px; }
  .audio-dock.is-fullscreen .player-skip svg { width: 30px; height: 30px; }
  .audio-dock.is-fullscreen .player-skip span { top: 18px; font-size: 10px; }
  .audio-dock.is-fullscreen .player-play { width: 60px; height: 60px; min-height: 60px; }
}
@media (min-width: 900px) and (min-height: 560px) {
  .audio-dock.is-fullscreen .player-up-next { grid-area: upnext; width: 100%; }
  .audio-dock.is-fullscreen .player-chapters { grid-area: chapters; width: 100%; }
}
@media (max-height: 480px) {
  .audio-dock.is-fullscreen .player-up-next:not([hidden]) { margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .audio-dock.is-playing [aria-current="true"] .player-chapter-number svg path { animation: none; }
}
@media (forced-colors: active) {
  .player-up-next-card, .player-autoplay, .player-chapters { border: 1px solid ButtonText; }
}
@media (max-height: 480px) {
  .audio-dock.is-fullscreen .player-volume .player-range { display: none; }
  .audio-dock.is-fullscreen .player-transport { gap: clamp(4px, 2vw, 18px); }
}
/* Landscape keeps the story artwork visible beside the scrollable controls. */
@media (min-width: 620px) and (max-height: 480px) {
  .audio-dock.is-fullscreen {
    display: grid;
    grid-template-columns: clamp(130px, 20vw, 180px) minmax(0, 560px);
    grid-template-areas: "bar bar" "art heading" "art controls" ". upnext" ". status" ". chapters" ". tools" "nav nav";
    column-gap: 24px;
    justify-content: center;
    align-items: start;
  }
  .audio-dock.is-fullscreen .player-view-bar { grid-area: bar; width: 100%; }
  .audio-dock.is-fullscreen .player-fullscreen-artwork { grid-area: art; align-self: center; width: 100%; margin: 0; border-radius: 16px; }
  .audio-dock.is-fullscreen .player-heading { grid-area: heading; width: 100%; }
  .audio-dock.is-fullscreen .audio-dock-copy { text-align: left; }
  .audio-dock.is-fullscreen .player-controls { grid-area: controls; width: 100%; }
  .audio-dock.is-fullscreen .player-control-row { grid-template-columns: 1fr 1fr; grid-template-areas: "transport transport" "speed volume"; gap: 8px 12px; }
  .audio-dock.is-fullscreen .player-transport { gap: 8px; }
  .audio-dock.is-fullscreen .player-play { width: 60px; height: 60px; min-height: 60px; }
  .audio-dock.is-fullscreen :is(.player-track, .player-skip) { width: 44px; height: 44px; }
  .audio-dock.is-fullscreen .player-skip span { top: 17px; }
  .audio-dock.is-fullscreen .player-up-next { grid-area: upnext; }
  .audio-dock.is-fullscreen .player-status { grid-area: status; }
  .audio-dock.is-fullscreen .player-chapters { grid-area: chapters; }
  .audio-dock.is-fullscreen .audio-private-tools { grid-area: tools; }
  .audio-dock.is-fullscreen .player-browse-links { grid-area: nav; width: 100%; }
  .audio-dock.is-fullscreen [data-player-close] { right: max(14px, env(safe-area-inset-right)); }
}
/* Tap the title or artwork in the floating or mini player to open full screen. */
.audio-dock.is-enhanced:not(.is-fullscreen) :is(.audio-dock-copy, .player-heading > .player-artwork) { cursor: pointer; }

/* Audio library: cover-led browsing, with complete story titles below the art. */
.audio-library, .audio-album-detail { min-width: 0; padding-bottom: 20px; }
.audio-library [hidden], .audio-album-detail [hidden] { display: none !important; }
.audio-library > .page-header { margin-bottom: 26px; }
.audio-library-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; margin-bottom: 28px; }
.audio-library-search { display: block; flex: 1 1 260px; max-width: 480px; min-width: 0; }
.audio-library-search input {
  width: 100%;
  min-height: 48px;
  padding: 0 16px 0 44px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 14px;
  background: #0c1b2e url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23aeb9c9' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m16 16 5 5'/%3E%3C/svg%3E") no-repeat 16px center / 18px;
  color: var(--ink);
  font-size: 14px;
  appearance: none;
  -webkit-appearance: none;
}
.audio-library-search input::placeholder { color: #aeb9c9; opacity: 1; }
.audio-library-search input:focus { border-color: var(--gold); }
.audio-library-count { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.audio-album-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 32px 24px; }
.audio-album-card { position: relative; min-width: 0; padding-bottom: 6px; }
.audio-album-link { display: block; min-width: 0; border-radius: 18px; }
.audio-album-art {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 18px;
  background: radial-gradient(ellipse at 50% 25%, #2a4054, #0b192c 78%);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .18);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.audio-album-art img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: cover; object-position: 50% 50%; }
.audio-album-link:hover .audio-album-art { border-color: rgba(243, 198, 122, .5); box-shadow: 0 14px 32px rgba(0, 0, 0, .3); }
.audio-album-copy { padding-top: 14px; }
.audio-album-copy h2 { margin: 0 0 7px; color: var(--ink); font-family: inherit; font-size: 16px; font-weight: 650; letter-spacing: -.015em; line-height: 1.4; overflow-wrap: anywhere; }
.audio-album-copy p { min-height: 30px; margin: 0; padding-right: 52px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.audio-album-play {
  position: absolute;
  right: 0;
  bottom: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(243, 198, 122, .22);
  border-radius: 50%;
  background: #1c2a38;
  color: var(--gold);
  cursor: pointer;
  touch-action: manipulation;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}
.audio-album-play svg { width: 18px; height: 18px; fill: currentColor; }
.audio-album-play:hover, .audio-album-play[aria-current="true"] { background: var(--gold); color: #07172b; }
.audio-album-play:active { transform: scale(.94); }
.audio-library-resume {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 84px;
  margin: 0 0 28px;
  padding: 14px 18px;
  border: 1px solid rgba(243, 198, 122, .2);
  border-radius: 18px;
  background: linear-gradient(120deg, #15283c, #0b192c);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}
.audio-library-resume:hover { border-color: rgba(243, 198, 122, .5); }
.audio-library-resume > img { flex: 0 0 56px; width: 56px; height: 56px; object-fit: cover; object-position: 50% 50%; border-radius: 10px; background: #09182b; }
.audio-library-resume > span:first-of-type { display: grid; flex: 1; min-width: 0; gap: 4px; }
.audio-library-resume > span[aria-hidden] { flex: 0 0 22px; color: var(--gold); font-size: 22px; text-align: center; }
.audio-library-resume > span > span { color: var(--muted); font-size: 12px; line-height: 1.5; }
.audio-library-resume strong { font-size: 15px; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
.audio-library-resume small { color: var(--gold); font-size: 11px; line-height: 1.5; }
.audio-library-resume > svg { flex: 0 0 22px; width: 22px; height: 22px; fill: none; stroke: var(--gold); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.audio-library-empty { padding: 48px 24px; border: 1px dashed rgba(255, 255, 255, .2); border-radius: 18px; text-align: center; }
.audio-library-empty h2 { margin-bottom: 8px; font-size: 24px; }
.audio-library-empty p { margin-bottom: 0; color: var(--muted); line-height: 1.6; }
.audio-library-back { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; margin-bottom: 20px; border-radius: 10px; color: var(--gold); font-size: 13px; font-weight: 600; }
.audio-library-back:hover { color: #ffe0aa; }
.audio-library-back svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.audio-album-header { display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); align-items: center; gap: 40px; padding-bottom: 36px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.audio-album-header .audio-album-art { border-radius: 22px; box-shadow: 0 22px 50px rgba(0, 0, 0, .25); }
.audio-album-info { min-width: 0; }
.audio-album-info h1 { margin-bottom: 12px; font-size: clamp(34px, 4vw, 50px); line-height: 1.08; }
.audio-album-info > p:not(.eyebrow) { margin-bottom: 10px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.audio-album-info > .primary-button { gap: 9px; margin-top: 14px; border-radius: 999px; font-size: 12px; }
.audio-album-info > .primary-button svg { width: 17px; height: 17px; fill: currentColor; }
.audio-album-tracks { display: grid; gap: 10px; padding-top: 30px; }
.audio-album-tracks > h2 { margin: 0 0 10px; font-size: 25px; }
.audio-album-tracks .audio-row { min-height: 76px; }

@media (min-width: 1280px) {
  .audio-album-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .audio-album-header { grid-template-columns: minmax(160px, 240px) minmax(0, 1fr); gap: 28px; }
}
@media (max-width: 620px) {
  .audio-library > .page-header { margin-bottom: 22px; }
  .audio-library-toolbar { gap: 10px; margin-bottom: 22px; }
  .audio-library-search { flex-basis: 100%; max-width: none; }
  .audio-album-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 16px; }
  .audio-album-art { border-radius: 14px; }
  .audio-album-copy { padding-top: 11px; }
  .audio-album-copy h2 { font-size: 14px; }
  .audio-album-copy p { font-size: 11px; }
  .audio-library-resume { gap: 12px; margin-bottom: 22px; padding: 12px; border-radius: 16px; }
  .audio-library-resume > img { flex-basis: 48px; width: 48px; height: 48px; }
  .audio-library-resume strong { font-size: 14px; }
  .audio-album-header { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 24px; padding-bottom: 28px; }
  .audio-album-header .audio-album-art { width: min(78vw, 320px); }
  .audio-album-info { width: 100%; text-align: center; }
  .audio-album-info h1 { margin-inline: auto; font-size: 34px; }
  .audio-album-info > .primary-button { min-width: 160px; }
  .audio-album-tracks { padding-top: 24px; }
  .audio-album-tracks .audio-row-state { font-size: 10px; }
}
@media (max-width: 380px) {
  .audio-album-grid { gap: 22px 12px; }
  .audio-album-copy h2 { font-size: 13px; }
  .audio-album-info h1 { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .audio-library *, .audio-album-detail * { transition: none !important; }
}
@media (forced-colors: active) {
  .audio-album-art, .audio-album-play, .audio-library-resume { border: 1px solid ButtonText; }
}

.player-chapter-edition { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 400; }

/* New Audio is a player view, not a duplicate library shelf. */
.player-new-audio-toggle, .player-new-audio { display: none; }
.audio-dock.is-fullscreen .player-new-audio-toggle:not([hidden]) {
  display: inline-flex; align-items: center; justify-content: center; margin-left: auto;
  min-height: 44px; padding: 0 11px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--navy-850); color: var(--gold); white-space: nowrap; cursor: pointer;
}
.audio-dock.is-fullscreen.is-browsing-new-audio {
  display: flex; flex-direction: column; justify-content: flex-start;
}
.audio-dock.is-fullscreen.is-browsing-new-audio > :not(.player-view-bar, .player-new-audio) { display: none; }
.audio-dock.is-fullscreen.is-browsing-new-audio :is(.player-view-bar, .player-new-audio) { width: min(560px, 100%); }
.audio-dock.is-fullscreen.is-browsing-new-audio .player-view-bar { padding-right: 0; }
.audio-dock.is-fullscreen.is-browsing-new-audio .player-new-audio:not([hidden]) { display: block; }
.player-new-audio header { margin: 0 0 16px; }
.player-new-audio h2 { margin: 0 0 3px; }
.player-new-audio p { margin: 0; color: var(--muted); font-size: .875rem; }
.player-new-audio .audio-new-list { display: grid; gap: 8px; }
.player-new-audio .audio-row strong { white-space: normal; overflow-wrap: anywhere; }
@media(max-width: 375px) {
  .audio-dock.is-fullscreen:not(.is-browsing-new-audio) .player-view-bar { padding-right: 40px; gap: 4px; }
  .audio-dock.is-fullscreen .player-new-audio-toggle:not([hidden]) { padding: 0 8px; }
}
