.story-library { margin: 0; color: var(--ryb-ink); line-height: 1.6; }
.story-library main { width: min(100% - 2 * clamp(1rem, 4vw, 3rem), 65rem); margin: 0 auto; }
.story-library main *, .story-library main *::before { box-sizing: border-box; }
.story-library main a { color: var(--ryb-teal, #21685f); text-underline-offset: .17em; }
.story-library main :focus-visible { outline: 3px solid #21685f; outline-offset: 3px; }
.skip-story, .studio-sr { position: absolute; clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px; }
.skip-story:focus { clip-path: none; width: auto; height: auto; z-index: 20; background: white; padding: 1rem; }
.library-intro { max-width: 48rem; margin-block: clamp(1.6rem, 4vw, 3.3rem) 1.5rem; }
.library-intro h1, .story-library main :is(h2,h3) { margin: 0; }
.library-intro p { margin: .7rem 0 0; max-width: 67ch; font-size: clamp(1rem, .95rem + .35vw, 1.18rem); }
.studio-stories { display: grid; gap: .85rem; }
.story-card, .story-wish, .story-device { scroll-margin-block-start: 5.75rem; }
.story-card {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(15rem, 1fr);
  gap: .7rem 2rem; align-items: center; padding: clamp(1rem, 2.4vw, 1.55rem);
  border: 1px solid var(--ryb-line); border-radius: var(--ryb-card); background: #fffcf7;
}
html[data-ryb-ci] body.story-library main .story-card h2 { font-size: clamp(1.3rem, 1.1rem + .75vw, 1.8rem); line-height: 1.16; }
.story-copy p { margin: .45rem 0 0; max-width: 56ch; }
.story-audio span { font-size: .9rem; font-weight: 800; }
.story-audio audio { display: block; width: 100%; margin-top: .3rem; }
.story-card details { grid-column: 1 / -1; }
.story-card summary { width: fit-content; padding: .6rem 0; color: #21685f; cursor: pointer; font-weight: 800; }
.story-reading { max-width: 63ch; margin-inline: auto; }
.story-reading p { margin: .8rem 0; line-height: 1.7; }
.story-reading b { display: block; color: #21685f; }
.story-feature { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "picture copy" "picture audio" "reading reading"; }
.story-feature .story-copy { grid-area: copy; align-self: end; }
.story-feature .story-audio { grid-area: audio; align-self: start; }
.story-feature details { grid-area: reading; }
.story-cover { grid-area: picture; }
.story-cover img { display: block; width: 100%; aspect-ratio: 3 / 2; height: auto; border-radius: var(--ryb-image); object-fit: cover; }
.story-wish { background: #eaf1eb; border-radius: var(--ryb-card); margin-block: 1rem; padding: clamp(1rem, 3vw, 2rem); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1rem 2rem; }
.story-wish p, .device-copy p { margin: .6rem 0 0; max-width: 66ch; }
.story-library main :is(.music-button,.story-button) { display: inline-flex; align-items: center; justify-content: center; width: fit-content; max-width: 100%; min-height: 44px; padding: .7rem 1.25rem; border-radius: 2rem; background: #21685f; color: white; font: inherit; font-weight: 800; text-align: center; text-decoration: none; }
.story-library main :is(.music-button,.story-button):hover { background: #194f49; }
.story-device { margin-block: clamp(2.5rem, 5vw, 4rem) 1.5rem; }
.device-copy { max-width: 48rem; }
.sound-product-scene { margin: 1.1rem auto; max-width: 54rem; }
.story-device .p12-stations { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem; }
.story-device .p12-stations button { width: auto; height: auto; padding: .45rem .75rem; min-height: 44px; border: 1px solid var(--ryb-line); border-radius: 2rem; font: inherit; font-size: .9rem; font-weight: 800; color: var(--ryb-ink); background: #fffcf7; }
.story-device .p12-stations button[aria-pressed=true] { color: white; background: #21685f; border-color: #21685f; }
.story-device .p12-stations button::after { display: none; }
.sound-product-mount { min-height: 0; }
.sound-product-scene noscript img { width: min(100%, 18rem); height: auto; border-radius: var(--ryb-image); }
.story-transfer { padding: clamp(1.1rem, 3vw, 2rem); border: 1px solid var(--ryb-line); border-radius: var(--ryb-card); }
.story-transfer ol { padding-inline-start: 1.4rem; margin: .8rem 0 1.2rem; max-width: 70ch; }
.story-transfer li + li { margin-top: .45rem; }
.story-transfer li::marker { color: #21685f; font-weight: 800; }
.story-actions { display: flex; flex-wrap: wrap; gap: .65rem 1.25rem; align-items: center; }
.story-soundroom { margin: 1.25rem 0 2rem; max-width: 70ch; }
@media (max-width: 680px) {
  .story-card, .story-wish { grid-template-columns: minmax(0,1fr); }
  html[data-ryb-ci] body.story-library main h1 { font-size: clamp(1.65rem, 8.2vw, 2.7rem); }
  .story-feature { grid-template-columns: minmax(0,1fr); grid-template-areas: "picture" "copy" "audio" "reading"; gap: .65rem; }
  #geschichte-mira .story-cover img { aspect-ratio: 2.35; object-position: 50% 10%; }
  .story-device .p12-stations { display: grid; width: 100%; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .25rem; }
  .story-device .p12-stations button { padding: .35rem .1rem; font-size: clamp(.76rem, 3.2vw, .9rem); }
  .story-feature .story-copy p { font-size: .94rem; }
}
