/* Portrait is the primary viewing format, reserved before metadata arrives. */
.home-page,.library-page{max-width:1000px}
.home-page .intro{padding-top:42px;padding-bottom:32px}
.home-page .collection{padding-top:8px}
.story-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:30px;max-width:680px}
.story-art,.up-next .story-art{aspect-ratio:9/16}
.story-art img{object-fit:contain}
.card-body{align-items:flex-start;gap:10px}
.resume-image{width:48px;height:auto;aspect-ratio:9/16}
.watch-page{max-width:1050px;padding-top:24px}
.watch-layout{grid-template-columns:minmax(0,420px) minmax(260px,1fr);gap:64px;align-items:start}
.watch-main{min-width:0}
.watch-topbar{display:flex;align-items:center;gap:12px;min-height:60px;padding-bottom:10px}
.watch-topbar .back-link{width:40px;min-height:44px;justify-content:center;flex-shrink:0}
.watch-topbar h1{font-size:17px;letter-spacing:-.3px;margin:0}
.watch-topbar p{font-size:10px;color:var(--muted);margin-top:3px}
.chapter-count{font-size:10px;letter-spacing:1px;color:var(--accent);margin-left:auto;white-space:nowrap}
.video-shell.portrait{aspect-ratio:9/16;width:min(100%,calc((100dvh - 300px) * 9 / 16));max-height:none;margin-inline:auto;border-radius:12px}
.watch-progress{margin-bottom:0;padding:0;min-height:46px}
.watch-tools{justify-content:space-around;padding:4px 0;min-height:60px}
.watch-tools .tool-button{flex:1;flex-direction:row;gap:8px;font-size:11px;min-height:48px}
.watch-sidebar{padding-top:60px}
.story-context h2{font-size:38px;margin-top:14px;letter-spacing:-1px}
.desktop-chapters{margin-top:30px}
.episode-row>img,.sheet .episode-row>img{display:block;width:32px;height:auto;aspect-ratio:9/16}
.watch-sidebar .sample-note{margin-top:28px}
.watching .footer{display:none}
@media(max-width:760px){
  .home-page .intro{padding-top:28px;padding-bottom:24px}
  .home-page .intro h1{font-size:29px}
  .home-page .collection{padding-top:0}
  .story-grid{gap:14px}
  .story-art{border-radius:10px}
  .art-label{left:10px;bottom:11px;padding:3px 7px;font-size:9px}
  .round-play{right:10px;bottom:10px;width:30px;height:30px}
  .card-body{padding-top:12px;position:relative}
  .card-body h3{font-size:19px;padding-right:25px}
  .card-body .small-label{font-size:8px;letter-spacing:0}
  .card-body .save-icon{position:absolute;right:-4px;top:26px;width:32px;height:44px;border:0}
  .card-body .save-icon svg{width:17px}
  .card-description{font-size:10px;line-height:1.5}
  .card-link{font-size:11px;gap:6px;margin-top:2px}
  .resume-image{width:42px;height:auto}
  .watching .header{display:none}
  .watch-page{padding:0 12px}
  .watch-layout{display:block}
  .watch-main{width:min(100%,440px);margin:auto;min-height:100dvh;padding-bottom:env(safe-area-inset-bottom)}
  .watch-topbar{min-height:58px;padding:4px 0}
  .video-shell.portrait{width:min(100%,calc((100dvh - 168px - env(safe-area-inset-bottom)) * 9 / 16));border-radius:9px}
  .watch-topbar,.watch-progress,.watch-tools{max-width:440px;margin-inline:auto}
  .watch-progress{min-height:46px;margin-bottom:0}
  .watch-tools{min-height:60px}
  .watch-sidebar{display:block;padding:26px 8px 30px;max-width:440px;margin:auto;border-top:1px solid var(--line)}
  .watch-sidebar .desktop-chapters{display:none}
  .story-context h2{font-size:27px}
  .watch-sidebar .sample-note{margin-top:20px}
}
@media(max-height:500px) and (orientation:landscape){
  .watching .header{display:none}
  .watch-page{padding-top:0}
  .watch-layout{grid-template-columns:minmax(0,360px) minmax(220px,1fr);gap:32px;display:grid}
  .video-shell.portrait{width:calc((100dvh - 168px) * 9 / 16)}
  .watch-sidebar{padding-top:25px}
}
/* Collected-library adaptation: long titles and large episode inventories. */
.story-art{isolation:isolate}.story-art img{position:relative;z-index:1}.poster-fallback{position:absolute;inset:0;z-index:-1;display:flex;flex-direction:column;justify-content:space-between;padding:24px;background:linear-gradient(145deg,#4a4541,#23282c);font-size:20px;line-height:1.3}.poster-fallback small{letter-spacing:3px;font-size:10px;color:var(--accent)}
.story-art img[hidden]{display:none}.story-art:after{z-index:2}.art-label,.round-play{z-index:3}
.library-grid{max-width:none;grid-template-columns:repeat(4,minmax(0,1fr));gap:24px}.library-grid .card-body h3{font-size:18px}.card-body h3{overflow-wrap:anywhere}.watch-topbar>div{min-width:0}.watch-topbar h1{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:14px}.watch-topbar{height:60px}.watch-topbar .chapter-count{flex-shrink:0}
.watch-sidebar .library-description{margin:18px 0 0;font-size:12px}.story-context h2{font-size:28px;line-height:1.2}.desktop-chapters #desktopEpisodes{max-height:360px;overflow-y:auto}.episode-sheet-list{max-height:52dvh;overflow-y:auto}.sheet-header h2{font-size:20px}.source-options{display:flex;flex-direction:column;gap:12px;margin-top:20px}.episode-row{min-height:62px}.resume-card h3{font-size:14px}.resume-card>div:nth-child(2){min-width:0}.resume-image .poster-fallback{padding:5px;font-size:7px}.resume-image .poster-fallback small{font-size:5px}.sample-note p{overflow-wrap:anywhere}
@media(max-width:760px){.library-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.card-body h3{font-size:17px}.card-body .small-label{line-height:1.5;padding-right:5px}.card-body .save-icon{top:40px}.watch-topbar h1{font-size:12px}.watch-topbar p{font-size:9px}.watch-topbar{height:60px}.poster-fallback{padding:16px;font-size:16px}.watch-progress>p{font-size:10px}.next-control{font-size:10px}}
.pending-episodes{max-width:600px;margin-top:24px}.pending-episodes .episode-row:disabled{opacity:.7}
