/* Every demo keeps the same canvas, including while loading or playing. */
.feature-demos { scroll-margin-top: 96px; }
.demo-filters { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; }
.demo-filters button, .demo-play, .demo-voices button { font: inherit; cursor: pointer; border: 1px solid #cfd6df; background: #fff; color: #17435e; border-radius: 999px; padding: 10px 16px; min-height: 44px; }
.demo-filters [aria-pressed="true"], .demo-voices [aria-pressed="true"] { background: #0a66c2; border-color: #0a66c2; color: #fff; }
.demo-browse { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.demo-browse-hint { margin: 0; font-size: .9rem; color: #53616d; }
.demo-navigation { display: flex; gap: 8px; flex-shrink: 0; }
.demo-navigation[hidden] { display: none; }
.demo-navigation button { width: 44px; height: 44px; border: 1px solid #cfd6df; border-radius: 50%; background: #fff; color: #17435e; font: inherit; font-size: 1.4rem; cursor: pointer; }
.demo-navigation button:disabled { opacity: .35; cursor: default; }
.demo-grid { display: flex; gap: 24px; align-items: flex-start; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; padding: 6px 4px 18px; scroll-padding-inline: 4px; scrollbar-width: thin; scrollbar-color: #a6b4c0 #edf1f5; }
.demo-card { flex: 0 0 calc((100% - 48px) / 3); min-width: 0; scroll-snap-align: start; scroll-margin-top: 96px; }
.demo-card[hidden] { display: none; }
.demo-window { position: relative; aspect-ratio: 1; width: 100%; overflow: hidden; border: 1px solid #e2e6ec; border-radius: 22px; background: #f4f5f7; contain: layout paint; }
.demo-window video { display: block; width: 100%; height: 100%; object-fit: contain; background: #fff; cursor: pointer; }
.demo-copy { padding: 16px 4px 0; }
.demo-copy h3 { font-size: 1.18rem; margin: 0 0 8px; }
.demo-copy p { margin: 0 0 14px; line-height: 1.6; color: #53616d; }
.demo-play { padding: 8px 15px; }
.demo-voices { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.demo-voices button { padding: 8px 12px; }
.demo-audio-status { min-height: 1.6em; margin-top: 8px !important; font-size: .88rem; }
.demo-note { text-align: center; color: #66717e; font-size: .85rem; line-height: 1.6; margin-top: 30px; }
.demo-filters button:focus-visible, .demo-play:focus-visible, .demo-voices button:focus-visible, .demo-navigation button:focus-visible, .demo-grid:focus-visible { outline: 3px solid #0a66c2; outline-offset: 3px; }
@media (max-width: 900px) { .demo-card { flex-basis: 46%; } }
@media (max-width: 560px) { .demo-grid { gap: 16px; } .demo-card { flex-basis: 88%; } .demo-filters { justify-content: flex-start; } }

.demo-new-links { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 10px 18px; margin-top: 24px; font-size: .9rem; }
.demo-new-links > span { color: #66717e; }
.demo-new-links a { color: #17435e; text-decoration: underline; text-underline-offset: 3px; }

@media (prefers-reduced-motion: no-preference) { .demo-play { transition: background-color .18s ease, color .18s ease; } }

.demo-contrast { background: #052430; }
[data-demo-contrast="routine"] { background: #f4f5f7; }
.demo-contrast img, .demo-voice-still img { display: block; width: 100%; height: 100%; object-fit: contain; }
.demo-contrast .contrast-after, .demo-contrast .contrast-landscape { position: absolute; inset: 0; opacity: 0; }
.demo-contrast.is-after .contrast-after { opacity: 1; }
.demo-contrast-controls { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 64px; font-size: .9rem; font-weight: 600; }
.demo-contrast-controls [data-contrast-after], .demo-contrast-controls.is-after [data-contrast-before] { color: #77838d; }
.demo-contrast-controls.is-after [data-contrast-after] { color: #0a66c2; }
.demo-switch { width: 51px; height: 31px; border: 0; border-radius: 20px; padding: 2px; background: #b5bcc3; cursor: pointer; position: relative; flex-shrink: 0; }
.demo-switch::before { content: ''; position: absolute; inset: -7px 0; }
.demo-switch span { display: block; width: 27px; height: 27px; border-radius: 50%; background: white; box-shadow: 0 1px 3px #0003; }
.demo-switch[aria-checked="true"] { background: #0a66c2; }
.demo-switch[aria-checked="true"] span { transform: translateX(20px); }
[data-contrast-switch="sleep"][aria-checked="true"] { background: #d73438; }
.demo-switch:focus-visible { outline: 3px solid #0a66c2; outline-offset: 5px; }
@media (prefers-reduced-motion: no-preference) { .contrast-after, .contrast-landscape { transition: opacity .32s ease; } .demo-switch, .demo-switch span { transition: background .2s ease, transform .2s ease; } }

.demo-voice-comparison { display: flex; flex-direction: column; padding: clamp(12px, 2vw, 24px); gap: 12px; background: #f7f9fb; }
.demo-language { display: flex; padding: 3px; background: #e9edf1; border-radius: 12px; }
.demo-language button { flex: 1; font: inherit; font-size: .85rem; border: 0; border-radius: 9px; background: transparent; padding: 8px; cursor: pointer; }
.demo-language [aria-pressed="true"] { background: white; box-shadow: 0 1px 4px #0001; }
.demo-voice-comparison .demo-voices { display: grid; grid-template-rows: repeat(4, minmax(0, 1fr)); gap: 8px; flex: 1; min-height: 0; margin: 0; }
.demo-voice-comparison .demo-voices button { border-radius: 12px; border-color: transparent; padding: 8px 14px; text-align: left; display: flex; align-items: center; justify-content: space-between; font-weight: 600; }
.demo-voice-comparison .demo-voices button::after { content: '▷'; font-size: 1.5em; font-weight: normal; }
.demo-voice-comparison .demo-voices [aria-pressed="true"]::after { content: '□'; }
.demo-language button:focus-visible { outline: 3px solid #0a66c2; outline-offset: 2px; }
[data-demo-contrast="sleep"].is-after { background: #000; }
.demo-contrast-controls.is-after [data-contrast-switch="sleep"] ~ [data-contrast-after] { color: #d73438; }

.demo-contrast.is-landscape .contrast-landscape { opacity: 1; }

.demo-contrast .contrast-landscape { background: #052430; }

.demo-voice-comparison [data-demo-voice][hidden] { display: none; }
