/* Shared listening controls; the existing talk-directory layout stays intact. */
html body .theme-control .atlas-soundtrack{width:auto;min-width:36px;padding:0 9px;display:inline-flex;gap:6px;align-items:center;text-decoration:none;border-radius:18px}
.atlas-listen-label{font:600 12px/1.2 system-ui,sans-serif;letter-spacing:.01em}
.atlas-soundtrack[aria-current=page]{background:var(--a-surface);color:var(--a-accent)}
html.atlas-listening-host,html.atlas-listening-host body{overflow:hidden}
#atlas-listening-page{position:fixed;inset:0 0 var(--talk-player-height,0px);width:100%;height:calc(100% - var(--talk-player-height,0px));border:0;background:var(--a-paper);z-index:90}
.atlas-listening-child #talk-player{display:none!important}
/* The page is a navigation focus target, not an interactive control. */
.atlas-listening-child main[tabindex="-1"]:focus{outline:none}
#listening-navigation-status{position:fixed;top:8px;left:50%;transform:translateX(-50%);z-index:110;max-width:calc(100% - 32px);padding:8px 14px;border:1px solid var(--a-line);border-radius:8px;background:var(--a-paper);color:var(--a-ink);font:14px/1.5 system-ui,sans-serif;box-shadow:0 4px 16px #0001}
#listening-navigation-status[hidden]{display:none}
#listening-navigation-status button,#listening-navigation-status a{margin-left:10px;color:inherit;min-height:44px}
.talk-player .talk-player-actions{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:6px}
html body .talk-player .talk-player-info .talk-playing-atlas{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-height:44px;margin:0;padding:6px 14px;border:1px solid var(--a-line);border-radius:6px;background:var(--a-surface);color:var(--a-ink);font:500 13px/1.4 system-ui,sans-serif;text-decoration:none;touch-action:manipulation}
html body .talk-player .talk-player-info .talk-playing-atlas:hover{background:var(--a-selected);border-color:var(--room-accent,var(--a-accent))}
.talk-player #talk-playing-dana{justify-content:flex-end;margin:0 0 0 auto;gap:6px}
@media(max-width:850px) and (min-height:501px){.talk-player .talk-player-info{grid-column:1/-1;grid-row:1}.talk-player .talk-player-info strong{padding-right:58px}}
/* Desktop has three balanced zones: recording, playback, and secondary actions.
   Equal outer columns center playback on the window, even with a long title. */
@media(min-width:851px){
 html body .talk-player{grid-template-columns:minmax(0,1fr) minmax(320px,1.4fr) minmax(0,1fr);gap:8px 24px;padding:12px max(24px,calc((100vw - 1300px)/2)) calc(12px + env(safe-area-inset-bottom,0px));background:var(--a-card);box-shadow:0 -3px 18px #0000000c}
 .talk-player .talk-player-info{display:contents}
 .talk-player .talk-player-info strong{grid-column:1;grid-row:1;align-self:center;overflow-wrap:anywhere}
 .talk-player .talk-player-actions{grid-column:3;grid-row:1;justify-content:flex-end;flex-wrap:wrap;align-content:center;gap:8px;margin:0;padding-right:44px}
 .talk-player #talk-playing-dana{margin:0;gap:8px}
 .talk-player .talk-player-controls{grid-column:2;grid-row:1;gap:2px}
 .talk-player .talk-player-transport{order:-1;grid-template-columns:minmax(84px,1fr) 44px 48px 44px minmax(84px,1fr);column-gap:clamp(0px,calc(25cqi - 76px),12px)}
 html body .talk-player .talk-player-toggle{width:48px;height:48px;min-width:48px}
 .talk-player-toggle svg{width:24px;height:24px}
 html body .talk-player #talk-player-seek{height:28px;min-height:28px}
 .talk-player #talk-player-seek::-webkit-slider-runnable-track{height:4px;border-radius:2px}
 .talk-player #talk-player-seek::-moz-range-track{height:4px;border-radius:2px}
 .talk-player #talk-player-seek::-webkit-slider-thumb{width:16px;height:16px;margin-top:-6px;border-width:2px}
 .talk-player #talk-player-seek::-moz-range-thumb{width:16px;height:16px;border-width:2px}
 .talk-player .talk-player-times{margin-top:-2px;font-size:12px}
 html body .talk-player #talk-player-close{grid-column:3;grid-row:1;align-self:center;justify-self:end;width:36px;min-height:44px}
 html body .talk-player .talk-player-info .talk-playing-atlas,html body .talk-player .talk-dana{background:transparent}
 html body .talk-player .talk-player-info .talk-playing-atlas:hover,html body .talk-player .talk-dana:hover{background:var(--a-selected)}
}
.talk-connection-preview{display:flex;gap:6px 14px;flex-wrap:wrap;margin-top:14px;font-size:13px}
.talk-connection-preview a{display:inline-flex;align-items:center;gap:6px;padding:5px 0;color:var(--a-accent);text-underline-offset:3px}
.talk-connection-preview span{color:var(--a-muted);font-size:12px}
.talk-connection-backlinks a{display:inline-flex;align-items:center;gap:7px;justify-self:start;min-height:36px;padding:5px 10px;border:1px solid var(--a-line);border-radius:7px;text-decoration:none;background:var(--a-paper)}
.talk-connection-backlinks a:hover{border-color:var(--a-accent);text-decoration:underline}
.talk-connection-backlinks svg{width:16px;height:16px;flex:none}
.talk-connection-count{font-weight:400;font-size:.82em;opacity:.75}
@media(pointer:coarse){html body .theme-control .atlas-soundtrack{min-height:44px;min-width:44px}.talk-connection-preview a,.talk-connection-backlinks a{min-height:44px}}
@media(max-width:380px){html body .theme-control .atlas-soundtrack{padding:0 6px}.atlas-listen-label{font-size:11px}}
/* Only installed Home Screen windows need their own navigation controls. */
html.atlas-standalone{--atlas-app-nav-height:calc(56px + env(safe-area-inset-bottom,0px));scroll-padding-bottom:calc(var(--atlas-app-nav-height) + var(--talk-player-height,0px) + 16px)}
html.atlas-standalone body{padding-bottom:var(--atlas-app-nav-height)}
#atlas-app-navigation{position:fixed;inset:auto 0 0;z-index:105;display:flex;align-items:center;justify-content:space-between;gap:16px;box-sizing:border-box;min-height:56px;padding:6px max(18px,env(safe-area-inset-right,0px)) calc(6px + env(safe-area-inset-bottom,0px)) max(18px,env(safe-area-inset-left,0px));border-top:1px solid var(--a-line);background:var(--a-surface,var(--a-paper,#f6f4ed));color:var(--a-ink,#243b32)}
html body #atlas-app-navigation :is(button,a){display:inline-flex;align-items:center;justify-content:center;gap:8px;box-sizing:border-box;min-width:88px;min-height:44px;margin:0;padding:8px 12px;border:0;border-radius:8px;background:transparent;color:inherit;font:500 14px/1.4 system-ui,sans-serif;text-decoration:none;cursor:pointer;touch-action:manipulation}
html body #atlas-app-navigation :is(button,a):hover{background:var(--a-selected)}
html body #atlas-app-navigation button:disabled{opacity:.35;cursor:default;background:transparent}
#atlas-app-navigation svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:none}
#atlas-app-navigation :focus-visible{outline:2px solid var(--room-accent,var(--a-accent));outline-offset:2px}
html.atlas-standalone .talk-player{bottom:var(--atlas-app-nav-height);padding-bottom:10px}
html.atlas-standalone #atlas-listening-page{bottom:calc(var(--talk-player-height,0px) + var(--atlas-app-nav-height));height:calc(100% - var(--talk-player-height,0px) - var(--atlas-app-nav-height))}
@media print{#atlas-listening-page,#talk-player,#listening-navigation-status,#atlas-app-navigation{display:none!important}}

/* Keep podcast browsing close to its search, without stacked section margins. */
html body[data-atlas-room] main[data-resource-page=podcasts]{padding-top:16px}
html body[data-atlas-room] main[data-resource-page=podcasts] #resource-filters.atlas-search-filters{margin:0 0 8px}
html body[data-atlas-room] main[data-resource-page=podcasts] .resource-results-heading{margin:8px 0 16px;gap:0}
main[data-resource-page=podcasts] :is(#resource-context,#resource-status,#resource-editorial-intro):empty{display:none}
html body[data-atlas-room] main[data-resource-page=podcasts] #resource-results>.directory-group{margin-top:32px}
html body[data-atlas-room] main[data-resource-page=podcasts] #resource-results>.directory-group:first-child{margin-top:0}
html body[data-atlas-room] main[data-resource-page=podcasts] .shelf-heading{margin:0 0 16px}
html body[data-atlas-room] main[data-resource-page=podcasts] .shelf-heading h2{margin:4px 0 6px}
html body[data-atlas-room] main[data-resource-page=podcasts] .shelf-heading p{--content-size:1rem;--type-leading:1.5;margin:0}
html body[data-atlas-room] main[data-resource-page=podcasts] #resource-count{font-size:.8125rem;font-weight:400;color:var(--a-muted)}

/* The archive count is secondary to browsing and stays readable in both themes. */
html body[data-atlas-room] main #gv-count{--content-size:.8125rem;--type-leading:1.5;margin:10px 0 14px;color:var(--a-muted);font-weight:400}

/* Keep the original audio alive while the room supplies its visible controls. */
html.atlas-in-sitting-room #talk-player,html.atlas-in-sitting-room #atlas-app-navigation{display:none!important}
html.atlas-in-sitting-room #atlas-listening-page{inset:0;height:100%}
html.atlas-in-sitting-room{--talk-player-height:0px!important;--atlas-app-nav-height:0px!important}

html body .talk-player #talk-player-sit{display:inline-flex;align-self:center;align-items:center;justify-content:center;gap:10px;order:1;margin:9px 0 1px;padding:10px 22px;min-height:44px;border:1px solid var(--room-accent,var(--a-accent));border-radius:999px;background:var(--room-accent,var(--a-accent));color:var(--a-paper);font:500 14px/1.25 system-ui,sans-serif;box-shadow:0 2px 8px #0001;cursor:pointer}
html body .talk-player #talk-player-sit[hidden]{display:none}
#talk-player-sit svg{width:19px;height:19px;flex:none}
html body .talk-player #talk-player-sit:hover{filter:brightness(1.08)}
html body .talk-player #talk-player-sit:focus-visible{outline:2px solid var(--a-ink);outline-offset:3px}
