/* Spoken edition + digital-human news anchor (2026-11-15; package 47, 2026-11-24). */
:root{--speech-frame:#ff5a1f}
:root[data-theme=dark]{--speech-frame:#ff7a45}

/* Articles with a ready spoken edition: since 2026-11-22 their frame is the frame of their content type (frames.css); the colour stays on the audio button. */
.news-card[data-speech=ready] .audio-button{color:var(--speech-frame)}

/* Header button of the news anchor (avatar-host.js). data-state: off | waiting | download | starting | ready | speaking | error. The person icon carries a small badge for the state
   (arrow down = download, play = starting, check = ready, bars = speaking, ! = error, slash = off) and, while it loads, the percentage; the tooltip says the same in words.
   Nothing blinks. Hidden until the manifest avatar/build/avatar-build.json exists. */
.avatar-toggle{position:relative;display:inline-flex;align-items:center;justify-content:center}
.avatar-toggle[hidden]{display:none}
.avatar-toggle:not([data-state]) .avatar-badge{display:none}   /* package 66: before the manifest answered the button is only the person symbol, no badge */
.avatar-toggle svg.avatar-person{width:19px;height:19px}
.avatar-toggle .avatar-badge{position:absolute;right:3px;top:3px;width:13px;height:13px;overflow:visible;pointer-events:none}
.avatar-toggle .avatar-badge circle{fill:var(--surface,#000);stroke:currentColor;stroke-width:1}
.avatar-toggle .avatar-badge path{fill:none;stroke:currentColor;stroke-width:1.3;stroke-linecap:round;stroke-linejoin:round;display:none}
.avatar-toggle .avatar-badge .b-start{fill:currentColor;stroke-width:.6}
.avatar-toggle[data-state=waiting] .b-download,.avatar-toggle[data-state=download] .b-download,.avatar-toggle[data-state=starting] .b-start,.avatar-toggle[data-state=ready] .b-ready,
.avatar-toggle[data-state=speaking] .b-speaking,.avatar-toggle[data-state=error] .b-error,.avatar-toggle[data-state=off] .b-off{display:inline}
.avatar-toggle[aria-pressed=true]{color:var(--speech-frame);border-color:var(--speech-frame)}
.avatar-toggle[data-state=off]{color:var(--muted,var(--faint,currentColor));opacity:.8}
.avatar-toggle[data-state=waiting]{color:var(--text,currentColor)}
.avatar-toggle[data-state=error]{border-color:#d93025;color:#d93025}
.avatar-toggle[data-progress]::after{content:attr(data-progress);position:absolute;left:0;right:0;bottom:2px;text-align:center;font:700 8.5px/1 system-ui,sans-serif;color:var(--speech-frame);pointer-events:none}

/* The player is a transparent layer over the whole window (the embed's .aimigo-digital-human, fixed, never takes a click). It is invisible in every state but "speaking" (its inline
   0.45 s opacity transition does the fade); avatar-host.js sets display:none while idle, and while it loads it stays displayed (a hidden frame would be throttled). */
.aimigo-digital-human[data-anchor]{opacity:0!important}
.aimigo-digital-human[data-anchor=speaking]{opacity:1!important}
/* Package 48: the embed fixes its layer at z-index 2147483000. The audio dock (reader.css, z-index 40) and the footer bar with the news ticker must be in front of the anchor,
   everything else behind it: the layer sits directly behind the dock, the footer bar (7) and the toast (25) go above it. */
.aimigo-digital-human{z-index:39!important}
.app-footer{z-index:41!important}
.toast{z-index:42!important}
/* Anchor mode of the dock: mute + volume at the right next to the close button, the title gets the room. */
.audio-dock.avatar-mode>.audio-controls.audio-controls{flex:0 0 auto;margin-inline-start:auto}
.audio-dock.avatar-mode .audio-volume{flex:0 0 120px;width:120px}
/* The shared download cache pill of the embed (moved out of the hidden player layer by avatar-host.js): small, top right under the header, above the dock. */
.avatar-cache-optin{position:fixed;top:92px;right:16px;z-index:43;line-height:0}
.avatar-cache-optin:empty{display:none}
/* The presenter controls in the frame colour of the presenter posts (--frame-presenter, changes with the UI style, presenter-frame.css): icon, frame and glow. The glow is the
   style's own halo (--halo) when it has one, like the post frames; the repeat button of the dock and the header button of the anchor while it is on. */
.avatar-toggle:is([aria-pressed=true]):not([data-state=error]){color:var(--frame-presenter-ink)!important;border-color:var(--frame-presenter)!important;box-shadow:var(--halo,0 0 12px -3px color-mix(in srgb,var(--frame-presenter) 75%,transparent))}
.avatar-toggle:is([aria-pressed=true]):not([data-state=error]) .avatar-person{filter:drop-shadow(0 0 3px color-mix(in srgb,var(--frame-presenter) 65%,transparent))}

/* While the anchor speaks, the dock shows the title, the previous / next buttons, the volume (mute + slider: the anchor's volume too) and close; the page's own player stays silent
   and the anchor can be neither paused nor sought, so play, position and time are hidden (reader.css hides all controls in this mode). */
.audio-dock.avatar-mode audio{display:none}
.audio-dock.avatar-mode>.audio-controls.audio-controls{display:flex}
.audio-dock.avatar-mode>.audio-controls :is(.audio-play,.audio-seek,.audio-time){display:none}
/* Package 59: the read-aloud button of a post is as high as the vote and share buttons beside it (28 px; it was 21 px), the picture of a poster is a link like the name. */
.news-card .card-footer .audio-button{box-sizing:border-box;height:28px;min-height:28px;padding:0 9px}
.news-card .card-footer .audio-button>svg{width:13px;height:13px}
.news-card .card-footer .audio-button>small{font-size:9px}
@media(max-width:340px){.news-card .card-footer .card-listening .audio-button{padding:0 7px}}
.community-byline-image-link{display:contents}
/* Package 63: the state "crashed" (the last load died with the page) looks like an error. */
.avatar-toggle[data-state=crashed]{border-color:#d93025;color:#d93025}
.avatar-toggle[data-state=crashed] .b-error{display:inline}
/* Package 62: loading from the browser storage has its own badge (a ring), the arrow stays for a real download. */
.avatar-toggle[data-state=loading] .b-loading{display:inline}
.avatar-toggle[data-state=loading] .avatar-badge circle{stroke:none}   /* the ring is the badge: no second circle around it */
/* Package 64: the auto toggle of the audio dock; pressed = the accent colour. */
.audio-dock>.audio-auto[aria-pressed=true]{color:var(--accent-text,var(--accent));border:1px solid var(--accent-text,var(--accent));background:var(--tint)}
.audio-dock>.audio-auto:disabled{opacity:.4}
/* Package 101: the second loading run (the enhanced image of the presenter) has its own badge, a star; the percent below it is the effect's. */
.avatar-toggle[data-state=effect] .b-effect{display:inline}
.avatar-toggle .avatar-badge .b-effect{fill:currentColor;stroke-width:.5}
