/* The same reading rooms, with space for touch navigation and full-width scenes. */
@media (max-width:1100px){
  :root{--header-height:calc(108px + env(safe-area-inset-top,0px));--page-gutter:clamp(18px,4vw,32px)}
  html{scroll-padding-top:calc(var(--header-height) + 20px)}
  .site-header,.is-reading .site-header,.is-home .site-header,.is-atlas .site-header{display:grid;grid-template-columns:minmax(0,1fr) 44px;grid-template-rows:60px 48px;height:var(--header-height);min-height:0;padding:env(safe-area-inset-top,0px) var(--page-gutter) 0;gap:0 12px}
  .brand{min-width:0}.brand>span{font-size:22px;letter-spacing:.1em}.brand small{font-size:10px;letter-spacing:.025em}
  .site-header nav,.is-reading .site-header nav{grid-column:1/-1;grid-row:2;order:initial;width:100%;height:48px;margin:0;gap:25px;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none}
  .site-header nav::-webkit-scrollbar{display:none}
  .site-header nav a,.is-home .site-header nav a{flex-shrink:0;font-size:var(--fs-2);min-height:44px}
  .site-header nav a.active:after{left:0;right:0;bottom:0}
  .search-trigger{grid-column:2;grid-row:1;width:44px;height:44px;padding:10px;justify-self:end}
  .section-masthead{min-height:0;padding:28px var(--page-gutter);gap:20px}
  .story-volume-layout{grid-template-columns:170px minmax(0,1fr);gap:28px;padding:28px var(--page-gutter) 60px}
  .story-chapter-index,.scene-toc{top:calc(var(--header-height) + 20px)}
  .story-directory-tools{padding:8px var(--page-gutter) 14px}
  .chapter-reading-layout{grid-template-columns:1fr;gap:20px}.chapter-still{position:relative;top:auto}.chapter-still img{height:auto;aspect-ratio:16/9}
  .story-volume,.scene-body>section,.interpretation-chapter,.collection-library,.extension-shelf{scroll-margin-top:calc(var(--header-height) + 20px)}
  .story-atlas,.world-atlas{height:calc(100svh - var(--header-height));height:calc(100dvh - var(--header-height));min-height:0}
  .story-atlas .atlas-bar{left:var(--page-gutter);top:24px;width:180px}.story-scene-index{left:var(--page-gutter);width:180px;top:145px}
  .story-stage{left:16%;width:80%}
  .story-atlas .view-choice{left:var(--page-gutter)!important;bottom:calc(22px + env(safe-area-inset-bottom,0px))!important}
  .story-atlas .map-bottom{height:calc(68px + env(safe-area-inset-bottom,0px));padding:0 var(--page-gutter) env(safe-area-inset-bottom,0px)}
  .story-atlas .map-viewport{height:calc(100% - 68px - env(safe-area-inset-bottom,0px))}
  .story-atlas .minimap{display:none}.story-position{display:none}
  .world-atlas .world-canvas-heading{left:var(--page-gutter);right:var(--page-gutter)}
  .world-sidebar{left:var(--page-gutter);width:175px;top:132px;bottom:95px}
  .world-atlas .canvas-host{left:225px;width:calc(100% - 225px)}
  .world-atlas .map-bottom{left:0;right:0;bottom:0;height:calc(74px + env(safe-area-inset-bottom,0px));padding:0 16px env(safe-area-inset-bottom,0px);background:#0b1927ed}
  .world-atlas .map-viewport{height:calc(100% - 74px - env(safe-area-inset-bottom,0px))}.world-atlas .map-controls{gap:6px;padding:0;border:0;background:none}
  .world-atlas .map-legend{gap:12px;font-size:10px}.world-atlas .legend-line{width:20px}
  .library-workspace,.case-workspace,.book-workspace{padding:0 var(--page-gutter) 60px}
  .room-heading{gap:20px;padding:28px 0 22px}.room-heading h1{font-size:28px}.room-heading p{font-size:var(--fs-2)}
  .library-workspace .collection-library-head,.case-workspace .inquiry-tools{display:flex;flex-direction:column;align-items:stretch;gap:16px;padding:16px 0}
  .library-workspace .collection-filters,.case-workspace .inquiry-filters,.book-workspace>.books-filters{display:flex;overflow-x:auto;overscroll-behavior-x:contain;flex-wrap:nowrap;gap:25px;scrollbar-width:none;max-width:100%}
  .collection-filters button,.inquiry-filters button,.books-filters button{flex-shrink:0;min-height:44px;white-space:nowrap}
  .library-workspace .search-field,.case-workspace .search-field{width:100%;margin:0;min-height:44px}.search-field input{min-width:0;font-size:16px!important}
  .library-workspace .library-browse-layout{grid-template-columns:170px minmax(0,1fr);gap:26px;margin-top:24px;padding-top:0}
  .library-workspace .library-source-index{top:calc(var(--header-height) + 20px)}.archive-preview{display:none}
  .library-workspace .archive-row h2{font-size:var(--fs-5)}.library-workspace .archive-row p{font-size:var(--fs-3)}.library-workspace .record-origin{font-size:var(--fs-1)}
  .case-layout{grid-template-columns:200px minmax(0,1fr);gap:30px}.case-index{top:calc(var(--header-height) + 20px)}
  #case-focus{position:static}
  .case-focus-copy h2,.case-focus-summary,.case-focus-meta{max-width:100%}.case-focus-copy h2{font-size:var(--fs-6)}.case-focus-summary{font-size:16px}
  .case-focus-material{grid-template-columns:1fr;gap:28px}.case-source-image img{height:auto;max-height:500px}.case-source-image{max-width:500px}
  .book-workspace-layout{grid-template-columns:180px minmax(0,1fr);gap:30px}.book-index{max-height:calc(100svh - var(--header-height) - 40px)}
  #book-focus{position:static;grid-template-columns:1fr;gap:28px;min-height:0;scroll-margin-top:calc(var(--header-height) + 20px)}.book-focus-cover{height:300px}.book-focus-copy h2{font-size:28px}
  .book-focus-copy>p{font-size:16px}.book-focus-actions :is(a,button){min-height:44px}
  .scene-layout{padding:25px var(--page-gutter) 60px;grid-template-columns:150px minmax(0,1fr);gap:30px}
  #detail-dialog{inset:calc(var(--header-height) + 12px) 18px 18px auto;width:min(580px,calc(100vw - 36px));height:calc(100dvh - var(--header-height) - 30px)}
  #detail-dialog :is(.close-button,.drawer-full-page,.drawer-back){min-width:44px;min-height:44px}
  #detail-dialog .reader-outline summary,#detail-dialog .reader-outline button{min-height:44px}
  .home-rooms{padding:50px var(--page-gutter) 70px}.home-room{gap:30px}.home-room h3{font-size:var(--fs-6)}.home-room figure{height:260px}
  .journey-moments{width:calc(100% - 2 * var(--page-gutter))}.journey-moment{grid-template-columns:minmax(0,1fr) 90px minmax(0,1fr)}
  .journey-copy h3{font-size:var(--fs-6)}.journey-copy>p{font-size:var(--fs-3)}
}

@media (max-width:760px){
  body.drawer-open{overflow:hidden}
  .is-home .site-header{background:linear-gradient(#0b1927c9,#0b192740)}
  .home-hero{min-height:620px;height:100svh}.hero-image{object-position:56% top}
  .hero-copy{padding:0 var(--page-gutter) 105px;width:100%}.hero-copy h1{font-size:46px;letter-spacing:.12em}.hero-copy>p{font-size:var(--fs-3);line-height:1.9}
  .hero-actions{flex-wrap:wrap;gap:12px}.is-home .hero-actions .button{min-height:44px;padding:11px 16px;font-size:var(--fs-1)}
  .hero-caption{right:var(--page-gutter);bottom:calc(16px + env(safe-area-inset-bottom,0px));left:var(--page-gutter);font-size:9px}
  .home-hero:after{left:var(--page-gutter);bottom:calc(48px + env(safe-area-inset-bottom,0px))}
  .journey-intro{padding:55px var(--page-gutter) 0}.journey-intro h2{font-size:28px;letter-spacing:.03em}.journey-intro p{font-size:var(--fs-2)}
  .journey-moments{width:auto;margin:0 var(--page-gutter)}
  .journey-moment{display:grid;grid-template-columns:34px minmax(0,1fr);gap:22px 18px;min-height:0;padding:30px 0 40px;align-items:start}
  .journey-thread{left:1px;width:32px}.journey-node{left:17px;top:55px;width:30px;height:30px;transform:translate(-50%,-50%)}
  .journey-picture,.journey-moment.reverse .journey-picture{grid-column:2;grid-row:1}.journey-picture>a{aspect-ratio:16/10}.journey-moment[data-scene="altar"] .journey-picture>a{aspect-ratio:4/3}
  .journey-picture figcaption{position:static;margin-top:10px}.journey-picture .source-link{font-size:10px}
  .journey-copy,.journey-moment.reverse .journey-copy{grid-column:2;grid-row:2;max-width:none;padding:0}.journey-meta{flex-wrap:wrap;gap:8px 14px;margin-bottom:14px;line-height:1.8}
  .journey-copy h3{font-size:24px;line-height:1.6;margin-bottom:15px}.journey-copy>p{max-width:none;line-height:1.95;margin-bottom:15px}.journey-read{min-height:44px;font-size:var(--fs-1)}
  .journey-branch{margin:22px 0 0;padding:12px 24px 12px 16px;max-width:none}.journey-branch p{font-size:var(--fs-1)}.journey-branch>span{font-size:11px}
  .journey-ending{padding:55px var(--page-gutter)}.journey-ending h2{font-size:var(--fs-6)}
  .home-rooms>header{margin-bottom:30px}.home-rooms>header h2{font-size:var(--fs-6)}
  .home-room{grid-template-columns:1fr;gap:20px;min-height:0;padding:32px 0}.home-room figure{grid-row:1;height:auto;aspect-ratio:16/9}.home-room-copy{padding:0 0 0 30px}.home-room-number{top:4px}.home-room h3{font-size:25px;margin-bottom:15px}.home-room p{font-size:var(--fs-3);max-width:none;margin-bottom:18px}
  .home-room-enter{min-height:44px;font-size:var(--fs-1)}.home-library-door{gap:20px;padding:25px 18px;margin-top:20px}.home-library-door img{height:110px}.home-library-door h3{font-size:var(--fs-5)}.home-library-door p{font-size:var(--fs-1);line-height:1.8}.home-library-door>svg{display:none}
  .section-masthead{display:block;padding:27px var(--page-gutter) 20px}.section-masthead h1{font-size:28px;line-height:1.5}.section-masthead p{font-size:var(--fs-3)}
  .section-masthead .view-choice{min-height:44px;margin-top:12px;font-size:var(--fs-2)}
  .story-directory-tools{justify-content:space-between;gap:16px}.directory-count{font-size:11px}.story-reading .story-directory-tools .segmented{gap:14px}
  .story-volume-layout{display:block;padding:20px var(--page-gutter) 45px}
  .story-chapter-index{position:relative;top:auto;display:flex;flex-direction:row;overflow-x:auto;overscroll-behavior-x:contain;gap:14px;margin-bottom:28px;padding-bottom:12px;border-bottom:1px solid var(--menu-line);scrollbar-width:thin}
  .story-chapter-index>span{display:none}.story-chapter-index button{flex:0 0 210px;border-top:0;padding:12px;gap:10px;background:#12304444;border-left:1px solid color-mix(in srgb, var(--ink-3) 27%, transparent)}.story-chapter-index strong{font-size:var(--fs-2);line-height:1.7}.story-chapter-index button.selected{box-shadow:inset 2px 0 var(--menu-blue)}
  .story-volume{margin-bottom:42px}.story-volume>header{gap:12px}.story-volume .volume-number{font-size:22px;min-width:28px}.story-volume h2{font-size:24px;line-height:1.6}.story-volume>header p{font-size:var(--fs-3);line-height:1.9}
  .fine-scene-row{grid-template-columns:24px minmax(0,1fr) 16px;gap:12px;padding:21px 0}.fine-scene-row h3{font-size:18px;line-height:1.65}.fine-scene-row p{font-size:var(--fs-2);line-height:1.85}.fine-scene-meta{font-size:11px}.group-readings>summary{font-size:var(--fs-2);min-height:44px}.group-readings button strong{font-size:16px}.group-readings button small{font-size:var(--fs-1)}
  /* Keep the picture rail below the large scene, with chapter controls above it. */
  .story-atlas .atlas-bar{top:10px;left:var(--page-gutter);right:var(--page-gutter);width:auto}
  .story-atlas .atlas-navigation{display:flex;justify-content:space-between;align-items:center;gap:16px;position:static;padding:0;backdrop-filter:none;background:none}
  .story-atlas .atlas-game-tabs{gap:18px;margin:0;align-items:center}.story-atlas .atlas-game-tabs button{font-size:var(--fs-2);min-height:44px;padding:9px 0;border-bottom:1px solid transparent}.story-atlas .atlas-game-tabs button.selected:after{display:none}
  .story-atlas .canvas-chapters summary{min-height:44px;font-size:var(--fs-2);gap:8px}.story-atlas .canvas-chapters summary span{max-width:100px}
  .story-atlas .canvas-chapter-menu{left:auto;right:0;top:48px;width:min(310px,calc(100vw - 2 * var(--page-gutter)));max-height:calc(100dvh - var(--header-height) - 150px);padding:8px}
  .story-atlas .atlas-background{position:absolute;top:53px;right:0;margin:0;min-height:36px;padding:6px 0;font-size:11px}
  .story-scene-index{top:auto;bottom:calc(74px + env(safe-area-inset-bottom,0px));left:var(--page-gutter);width:calc(100% - 2 * var(--page-gutter));display:flex;gap:16px;overflow-x:auto;padding:8px 0;scrollbar-width:none}
  .story-scene-index button{display:block;flex:0 0 auto;width:auto;max-width:220px;min-height:44px;padding:10px 8px;font-size:var(--fs-1);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .story-scene-index button i,.story-scene-index button:before,.story-scene-index button:after{display:none}.story-scene-index button span{display:block;overflow:hidden;text-overflow:ellipsis}
  .story-stage{left:0;top:85px;width:100%;height:48%}.story-stage .scene-visual>img{max-width:100%;mask-image:linear-gradient(90deg,transparent,black 7%,black 93%,transparent),linear-gradient(0deg,transparent,black 12%,black 90%,transparent);mask-composite:intersect}
  .story-atlas .map-bottom{height:calc(74px + env(safe-area-inset-bottom,0px));padding-inline:var(--page-gutter)}.story-atlas .map-viewport{height:calc(100% - 130px - env(safe-area-inset-bottom,0px));mask-image:none}
  .story-atlas .view-choice{min-height:44px;bottom:calc(15px + env(safe-area-inset-bottom,0px))!important;gap:7px;font-size:var(--fs-1)!important}
  .story-atlas .map-controls,.world-atlas .map-controls{gap:5px}.story-atlas .map-controls button,.world-atlas .map-controls button{width:40px;height:44px;border-radius:var(--r-1);padding:10px}.story-atlas .map-controls output{font-size:10px;min-width:26px;text-align:center}
  .world-atlas .world-canvas-heading{top:14px;gap:12px}.world-atlas .world-canvas-heading h1{font-size:23px}.world-canvas-heading p{font-size:11px}.world-source{min-height:44px;font-size:10px;gap:5px}.world-source svg{width:15px;height:15px}
  .world-sidebar{left:0;top:87px;right:0;bottom:auto;width:auto;display:block;z-index:3;padding:0 var(--page-gutter);background:#0b1927eb}
  .world-atlas .world-index{display:flex;gap:15px;overflow-x:auto;overflow-y:visible;padding:0;scrollbar-width:none}.world-index>span{display:none}.world-index button{flex:0 0 auto;width:auto;font-size:var(--fs-1);white-space:nowrap;padding:12px 8px;min-height:44px}
  .world-atlas .world-canvas-note{display:none}.world-atlas .canvas-host{left:0;top:140px;width:100%;height:calc(100% - 140px)}
  .world-atlas .map-viewport{height:calc(100% - 92px - env(safe-area-inset-bottom,0px))}.world-atlas .map-bottom{height:calc(92px + env(safe-area-inset-bottom,0px));flex-direction:column;align-items:stretch;justify-content:center;gap:7px;padding:9px var(--page-gutter) calc(9px + env(safe-area-inset-bottom,0px))}
  .world-atlas .map-legend{display:flex;justify-content:center;gap:20px;font-size:10px}.world-atlas .map-controls{justify-content:center;margin:0}
  .room-heading{display:block}.room-heading h1{font-size:27px}.room-reading-links{gap:25px;margin-top:15px}.room-reading-links button{min-height:44px;font-size:var(--fs-2)}.room-count{display:block;margin-top:12px}
  .library-workspace .collection-filters,.case-workspace .inquiry-filters,.book-workspace>.books-filters{gap:23px;padding-bottom:0}.library-workspace .collection-filters button,.case-workspace .inquiry-filters button,.book-workspace>.books-filters button{font-size:var(--fs-2)}
  .library-workspace .library-browse-layout{display:block;margin-top:18px}
  .library-workspace .library-source-index{position:relative;top:auto;display:flex;flex-direction:row;overflow-x:auto;gap:12px;padding-bottom:15px;margin-bottom:20px;border-bottom:1px solid var(--menu-line);scrollbar-width:thin}
  .library-workspace .library-source-index>span{display:none}.library-workspace .library-source-index button{flex:0 0 auto;max-width:230px;min-width:90px;padding:10px 12px;font-size:var(--fs-1);line-height:1.7;min-height:44px;border-left:1px solid color-mix(in srgb, var(--ink-3) 27%, transparent);background:#12304444}.library-workspace .library-source-index a{flex:0 0 150px;margin:0;padding:10px;border-top:0;font-size:var(--fs-1)}
  .library-workspace .archive-row{gap:12px;grid-template-columns:22px minmax(0,1fr);padding:22px 0}.library-workspace .archive-row h2{font-size:19px}.library-workspace .archive-row p{font-size:var(--fs-3);line-height:1.9}.library-workspace .archive-category{font-size:11px}
  .library-workspace .extension-shelf{margin-top:40px;padding-top:25px}.extension-shelf>header h2{font-size:24px}.extension-shelf>header p{font-size:var(--fs-3)}
  .library-workspace .extension-shelf-list{grid-template-columns:1fr;gap:0}.extension-shelf-list>a{grid-template-columns:80px minmax(0,1fr) 16px;gap:15px}.extension-shelf-list img{width:80px;height:74px}.extension-shelf-list h3{font-size:18px}.extension-shelf-list p{font-size:var(--fs-1)}
  .case-layout{display:block;margin-top:22px}.case-index{position:relative;top:auto;margin-bottom:24px}
  #check-results{display:flex;overflow-x:auto;gap:12px;padding-bottom:12px;overscroll-behavior-x:contain;scrollbar-width:thin}.case-question{flex:0 0 230px;gap:10px;align-items:start;padding:13px 12px;border:1px solid color-mix(in srgb, var(--ink-3) 20%, transparent);background:#12304444}.case-question strong{font-size:var(--fs-2);line-height:1.8}
  #case-focus{padding-top:0}.case-focus-copy h2{font-size:25px;line-height:1.6}.case-focus-meta{font-size:var(--fs-1);gap:8px 20px;margin-bottom:15px}.case-focus-summary{font-size:16px;line-height:1.9;margin-bottom:25px}
  .case-focus-material{gap:24px;padding-top:22px}.case-focus-material blockquote{font-size:var(--fs-4);line-height:1.9}.case-source-names{margin-top:25px}.case-source-names p,.case-source-image figcaption{font-size:var(--fs-1)}.case-open{min-height:44px;font-size:var(--fs-2)}
  .book-workspace-layout{display:block;padding-top:22px}.book-index{flex-direction:row;overflow-x:auto;max-height:none;gap:12px;margin-bottom:28px;padding-bottom:12px}.book-index>button{flex:0 0 210px;padding:13px 12px;gap:10px;border:1px solid color-mix(in srgb, var(--ink-3) 20%, transparent);background:#12304444}.book-index strong{font-size:var(--fs-3)}.book-index small{font-size:11px}
  #book-focus{gap:28px}.book-focus-cover{height:310px}.book-focus-copy h2{font-size:28px}.book-focus-copy>p{font-size:16px;line-height:1.9}.book-focus-copy dl{gap:22px}.book-focus-copy dd{font-size:var(--fs-1)}.book-focus-actions>a{font-size:var(--fs-2)}.book-focus-actions button{font-size:var(--fs-2)}
  .scene-layout{display:block;padding:0 var(--page-gutter) 55px}.scene-toc{position:sticky;top:var(--header-height);z-index:4;display:flex;flex-direction:row;gap:22px;max-width:100%;overflow-x:auto;background:#0e2230f5;padding:9px 0;margin-bottom:28px;border-bottom:1px solid var(--menu-line);scrollbar-width:none}
  .scene-toc>span{display:none}.scene-toc button,.scene-toc>a{flex-shrink:0;max-width:240px;min-height:44px;padding:10px 0;font-size:var(--fs-1);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.scene-toc>a{margin:0}
  .scene-body{min-width:0;overflow-wrap:anywhere}.scene-body>section,.interpretation-chapter{scroll-margin-top:calc(var(--header-height) + 90px)}.scene-body h3{font-size:24px}.scene-body p{font-size:16px;line-height:1.95}.scene-body .scene-lead{font-size:18px;line-height:1.9}.scene-neighbours{grid-template-columns:1fr;gap:22px}.scene-neighbours strong{font-size:var(--fs-4)}.scene-books{grid-template-columns:1fr;gap:15px}.scene-source-links{flex-wrap:wrap;gap:15px}
  .scene-body .supplied-reading header h4,.interpretation-chapter :is(h2,h3,h4){font-size:21px;line-height:1.8}.scene-beats{grid-template-columns:1fr}
  /* A phone reader uses the full screen; the canvas underneath keeps its layout. */
  #detail-dialog{inset:0;margin:0;width:100%;height:100svh;height:100dvh;max-width:none;max-height:none;border:0;border-radius:0;background:#0e2230;z-index:30;box-shadow:none}
  #detail-dialog::backdrop{display:block;background:#020b15b3}
  #detail-dialog .dialog-toolbar{height:auto;min-height:calc(56px + env(safe-area-inset-top,0px));padding:env(safe-area-inset-top,0px) 10px 0 18px;gap:8px;background:#0e2230}
  #detail-dialog .drawer-signature{font-size:var(--fs-1)}#detail-dialog .drawer-back{font-size:var(--fs-1)}
  #detail-dialog .reader-outline summary{padding:10px 18px;min-height:48px;font-size:var(--fs-1)}#detail-dialog .reader-outline button{padding:12px 18px;font-size:var(--fs-2)}#detail-dialog .reader-outline nav{max-height:55dvh}
  #detail-dialog .dialog-content,#detail-dialog .drawer-scene{padding:24px var(--page-gutter) calc(32px + env(safe-area-inset-bottom,0px))}
  #detail-dialog h2,#detail-dialog .drawer-scene>h2{font-size:28px;line-height:1.5}
  #detail-dialog p,#detail-dialog .drawer-scene p,#detail-dialog .dialog-content>p:not(.detail-lead):not(.detail-updated){font-size:16px;line-height:1.95}
  #detail-dialog .record-abstract{font-size:16px!important;line-height:1.95!important}#detail-dialog .scene-subtitle{font-size:16px!important}
  #detail-dialog .drawer-scene>section>h3{font-size:21px}#detail-dialog .supplied-reading header h4{font-size:var(--fs-5)}#detail-dialog .proof-figure figcaption,.scene-frame figcaption{font-size:var(--fs-1);line-height:1.85}
  #detail-dialog .inline-citation :is(strong,span,a){font-size:var(--fs-1);line-height:1.9}#detail-dialog .book-detail-top{grid-template-columns:100px minmax(0,1fr);gap:18px}
  #detail-dialog .drawer-section-nav{gap:22px;padding:0 var(--page-gutter);overflow-x:auto;flex-wrap:nowrap}#detail-dialog .drawer-section-nav button{min-height:44px;flex-shrink:0}
  .image-viewer{inset:0;margin:0;width:100%;height:100svh;height:100dvh;border:0;border-radius:0}.image-viewer>header{gap:8px;padding:calc(8px + env(safe-area-inset-top,0px)) 12px 8px}.image-viewer header p{font-size:11px;max-height:58px;overflow-y:auto}
  .image-viewer header button{min-height:44px}.image-viewer [data-image-close]{width:44px;height:44px;flex-shrink:0}.image-viewer-canvas{display:flex;align-items:flex-start;padding:16px 12px calc(16px + env(safe-area-inset-bottom,0px))}.image-viewer-canvas img{max-height:calc(100dvh - 125px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));margin:auto;flex-shrink:0}.image-viewer.is-zoomed .image-viewer-canvas img{max-width:none;max-height:none;margin:0}
  .search-dialog{inset:12px;margin:0;width:calc(100% - 24px);height:calc(100svh - 24px);height:calc(100dvh - 24px);max-height:none;border-radius:var(--r-1);padding-top:env(safe-area-inset-top,0px)}.search-dialog[open]{display:flex;flex-direction:column}.search-dialog-head{padding:12px 16px 0}.search-dialog-head .close-button{width:44px;height:44px}.search-dialog>.search-field{margin:12px 16px;width:calc(100% - 32px);min-height:44px;flex-shrink:0}.search-dialog #global-results{max-height:none;min-height:0;flex:1;overflow-y:auto;overscroll-behavior:contain}.search-result{min-height:64px;padding:16px;gap:12px}.search-result strong{font-size:var(--fs-3);line-height:1.7}.search-help{padding-bottom:calc(12px + env(safe-area-inset-bottom,0px))}
  .about-page{padding:32px var(--page-gutter) 50px}.about-page h1{font-size:28px}.about-page>p{font-size:16px;line-height:1.95}.about-image img{height:auto}.source-list{overflow-wrap:anywhere}
  .site-footer{padding:25px var(--page-gutter) calc(25px + env(safe-area-inset-bottom,0px));gap:12px;line-height:1.8}.site-footer p{width:100%}.site-footer>a:not(.footer-title){margin-left:0;min-height:44px;display:flex;align-items:center}
}

@media (max-width:380px){
  .brand>span{font-size:var(--fs-5)}.brand small{font-size:9px}.site-header nav{gap:22px}
  .hero-copy h1{font-size:39px}.hero-actions{align-items:stretch;flex-direction:column;max-width:240px}
  .journey-moment{grid-template-columns:26px minmax(0,1fr);gap:18px 13px}.journey-thread{left:-3px}.journey-node{left:13px}.journey-copy h3{font-size:22px}
  .story-atlas .map-controls output{display:none}.story-atlas .view-choice{font-size:11px!important}
  .world-source span{max-width:88px;line-height:1.6}.world-atlas .world-canvas-heading h1{font-size:21px}
  .home-library-door{gap:15px;padding:22px 12px}.home-library-door img{height:90px}.home-library-door h3{font-size:18px}
  .extension-shelf-list>a{grid-template-columns:64px minmax(0,1fr);gap:13px}.extension-shelf-list img{width:64px;height:64px}.extension-shelf-list>a>svg{display:none}
}

@media (max-width:760px) and (max-height:540px) and (orientation:landscape){
  :root{--header-height:calc(60px + env(safe-area-inset-top,0px))}
  .site-header,.is-reading .site-header,.is-home .site-header,.is-atlas .site-header{grid-template-columns:auto minmax(0,1fr) 44px;grid-template-rows:60px;gap:18px}
  .brand small{display:none}.brand>span{font-size:18px}.site-header nav{grid-column:2;grid-row:1;gap:20px;height:60px}.search-trigger{grid-column:3}
  .story-stage{top:40px;left:17%;width:80%;height:65%}.story-atlas .atlas-bar{width:145px;right:auto}.story-atlas .atlas-navigation{display:block}.story-atlas .atlas-background{position:static}.story-atlas .canvas-chapter-menu{left:0;right:auto;max-height:calc(100dvh - var(--header-height) - 110px)}
  .world-atlas .world-canvas-heading{right:auto;width:165px;display:block}.world-canvas-heading p{display:none}.world-canvas-heading nav{display:flex}.world-sidebar{top:94px;bottom:15px;width:180px;right:auto}.world-atlas .world-index{display:block;overflow-y:auto;max-height:100%}.world-index button{width:100%;text-align:left;white-space:normal}.world-atlas .canvas-host{top:0;left:200px;width:calc(100% - 200px);height:100%}
}

/* Phone navigation and reading are arranged around one-handed use. */
@media (max-width:760px){
  :root{--header-height:calc(56px + env(safe-area-inset-top,0px));--mobile-tab-height:calc(64px + env(safe-area-inset-bottom,0px));--mobile-reader-height:calc(62px + env(safe-area-inset-bottom,0px))}
  body{padding-bottom:var(--mobile-tab-height)}
  body:has(#detail-dialog[open],.search-dialog[open],.mobile-picker-dialog[open]){overflow:hidden}
  .site-header,.is-reading .site-header,.is-home .site-header,.is-atlas .site-header{grid-template-columns:minmax(0,1fr) 44px;grid-template-rows:56px;height:var(--header-height);gap:0 12px}
  .site-header nav,.is-reading .site-header nav{display:none}.brand>span{font-size:var(--fs-5)}.brand small{display:none}.brand svg{width:32px;height:32px}.search-trigger{grid-column:2;grid-row:1}
  .is-home .site-header{grid-template-columns:minmax(0,1fr)}.is-home .site-header .search-trigger{display:none}
  .mobile-tabs{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));position:fixed;inset:auto 0 0;z-index:12;height:var(--mobile-tab-height);padding:0 8px env(safe-area-inset-bottom,0px);background:#0e2230ed;backdrop-filter:blur(22px);border-top:1px solid color-mix(in srgb, var(--ink-2) 14%, transparent)}
  .mobile-tabs a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;min-height:56px;color:var(--ink-3);font-size:11px;letter-spacing:.05em;border-radius:var(--r-2);-webkit-tap-highlight-color:transparent}
  .mobile-tabs svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.5}.mobile-tabs [aria-current=page]{color:var(--gold-0)}.mobile-tabs a:active{background:color-mix(in srgb, var(--gold-0) 7%, transparent)}
  .mobile-tabs a:focus-visible,.mobile-library-tabs :is(a,button):focus-visible{outline:2px solid var(--gold-0);outline-offset:-3px}
  .home-hero{height:calc(100svh - var(--mobile-tab-height));min-height:500px}.hero-copy{padding:0 var(--page-gutter) 58px}.hero-copy h1{font-size:44px;letter-spacing:.12em}.hero-copy>p{font-size:var(--fs-3);line-height:2;margin-bottom:0}.hero-note{font-size:var(--fs-4);margin-bottom:15px}
  .is-home .hero-actions,.is-home .hero-caption,.home-hero:after,.journey-direction{display:none}
  .room-heading .section-label,.room-count{display:none}.room-heading{padding:27px 0 20px}.room-heading h1{font-size:var(--fs-6);line-height:1.6}.room-heading p{font-size:var(--fs-2);margin-top:8px}
  .mobile-library-tabs{display:flex;gap:3px;padding:4px;margin:0 0 18px;min-height:44px;background:#123044;border-radius:11px}
  .mobile-library-tabs :is(a,button){display:flex;flex:1;align-items:center;justify-content:center;min-height:38px;padding:8px 4px;font-size:var(--fs-1);border-radius:var(--r-2);color:var(--ink-2);white-space:nowrap}
  .mobile-library-tabs :is([aria-pressed=true],[aria-current=page]){background:#234c62;color:var(--ink-0);box-shadow:0 1px 5px #02101e38}
  .mobile-enhanced .room-reading-links,.mobile-enhanced .library-workspace .library-source-index,.mobile-enhanced .story-chapter-index{display:none}
  .mobile-picker-trigger{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:44px;padding:10px 14px;border:1px solid color-mix(in srgb, var(--ink-3) 22%, transparent);border-radius:var(--r-2);background:#12304488;text-align:left;color:var(--ink-1);font-size:var(--fs-2)}
  .mobile-picker-trigger>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mobile-picker-trigger svg{flex-shrink:0;width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.5}
  .collection-library-head>.mobile-picker-trigger{width:100%}.library-workspace .collection-filters,.case-workspace .inquiry-filters,.book-workspace>.books-filters{gap:18px}.library-workspace .collection-filters button,.case-workspace .inquiry-filters button,.book-workspace>.books-filters button{font-size:var(--fs-1)}
  .library-workspace .search-field,.case-workspace .search-field,.search-dialog>.search-field{background:#12304480;border:1px solid color-mix(in srgb, var(--ink-3) 19%, transparent);border-radius:11px;padding:0 12px;min-height:46px}
  .library-workspace .collection-library-head{gap:13px;padding-top:0}.library-workspace .library-browse-layout{margin-top:6px}.library-workspace .archive-row{grid-template-columns:minmax(0,1fr);gap:0;padding:22px 0}.archive-record-symbol{display:none}.library-workspace .archive-row h2{font-size:18px;line-height:1.7}.library-workspace .archive-row p{font-size:var(--fs-3)}.library-workspace .record-origin{font-size:var(--fs-1);line-height:1.8}
  .mobile-enhanced .library-workspace .extension-shelf{display:none;margin-top:22px;padding-top:0;border-top:0}.library-workspace.mobile-show-readings .collection-library{display:none}.library-workspace.mobile-show-readings .extension-shelf{display:block}
  .library-workspace .room-heading,.case-workspace .room-heading{padding:24px 0 12px;border-bottom:0}.library-workspace .room-heading h1,.case-workspace .room-heading h1{font-size:24px;margin:0}.library-workspace .room-heading p,.case-workspace .room-heading p,.library-workspace .mobile-library-tabs{display:none}
  .mobile-collection-tools{display:flex;justify-content:space-between;align-items:center;gap:16px;margin:0 0 16px;padding:0 0 9px;border-bottom:1px solid color-mix(in srgb, var(--ink-3) 18%, transparent)}.mobile-collection-tools>div{display:flex;gap:4px;flex-shrink:0}
  .mobile-content-switch{display:flex;align-items:center;gap:9px;min-height:44px;padding:8px 0;min-width:0;color:var(--ink-1);font-size:var(--fs-2)}.mobile-content-switch>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mobile-content-switch svg{width:14px;height:14px;flex-shrink:0}
  .mobile-collection-tools>div button{position:relative;display:grid;place-items:center;width:44px;height:44px;border-radius:var(--r-2);color:var(--gold-0)}.mobile-collection-tools>div svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.5}.mobile-collection-tools>div button:active{background:color-mix(in srgb, var(--gold-0) 7%, transparent)}.mobile-collection-search[aria-expanded=true]{background:color-mix(in srgb, var(--gold-0) 7%, transparent);color:var(--gold-0)}.mobile-collection-filter[data-active=true]:after{content:'';position:absolute;right:8px;top:8px;width:4px;height:4px;border-radius:50%;background:var(--gold-0)}
  .library-workspace.mobile-show-readings .mobile-collection-tools>div{display:none}.mobile-enhanced .library-workspace .collection-library-head,.mobile-enhanced .case-workspace .inquiry-tools{display:none;margin:0;border:0;padding:0}.mobile-enhanced .library-workspace .collection-filters,.mobile-enhanced .case-workspace .inquiry-filters{display:none}
  .library-workspace.mobile-search-open .collection-library-head,.case-workspace.mobile-search-open .inquiry-tools{display:block;padding:0 0 16px}.mobile-search-close{display:grid;place-items:center;flex-shrink:0;width:36px;height:42px;padding:8px;color:var(--ink-2)}.mobile-search-close svg{width:17px;height:17px}
  .library-workspace .library-browse-layout{margin-top:0}.library-workspace .results-line{margin:0 0 5px}.library-workspace .archive-row{padding:20px 0}.library-workspace .archive-row h2{font-size:var(--fs-4);line-height:1.65;margin:6px 0 8px}.library-workspace .archive-row p{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;font-size:var(--fs-2);line-height:1.85;margin:0 0 10px}.library-workspace .archive-category{font-size:10px}.library-workspace .record-origin{font-size:11px;line-height:1.8}
  .library-workspace .extension-shelf>header{margin-bottom:6px}.library-workspace .extension-shelf>header h2,.library-workspace .extension-shelf>header p{display:none}.library-workspace .extension-shelf-list h3{font-size:var(--fs-4);line-height:1.7}
  .case-layout{margin-top:10px}.case-index{margin:0}.case-index>span{font-size:var(--fs-1)}#case-focus{display:none}
  #check-results{display:block;overflow:visible;padding:4px 0 0}.case-question{display:grid;grid-template-columns:minmax(0,1fr) 16px;gap:6px 12px;width:100%;min-height:72px;padding:17px 0;border:0;border-bottom:1px solid color-mix(in srgb, var(--ink-3) 15%, transparent);border-radius:0;background:none;box-shadow:none;text-align:left}
  .case-question>span{display:none}.case-question strong{grid-column:1;font-size:16px;line-height:1.7;font-weight:400;color:var(--ink-1)}.case-question:after{content:'';grid-column:2;grid-row:1/3;align-self:center;width:7px;height:7px;border-top:1px solid var(--ink-2);border-right:1px solid var(--ink-2);transform:rotate(45deg)}
  .mobile-case-verdict{display:block;grid-column:1;font-size:var(--fs-1);line-height:1.8;color:var(--gold-2)}.case-question[aria-current=true]{background:none;box-shadow:none}.case-question:active{background:color-mix(in srgb, var(--gold-0) 5%, transparent)}
  .book-workspace-layout{padding-top:18px}#book-focus{display:none}.book-index{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:22px 18px;overflow:visible;max-height:none;margin:0;padding:0}
  .book-index>button{display:flex;flex-direction:column;align-items:stretch;gap:0;min-width:0;padding:0 0 20px;border:0;border-bottom:1px solid color-mix(in srgb, var(--ink-3) 15%, transparent);background:none;box-shadow:none;border-radius:0}.book-index>button>span{display:none}.book-index>button>div{min-width:0;overflow-wrap:anywhere}
  .mobile-book-cover{display:block;width:100%;height:186px;object-fit:contain;object-position:center bottom;margin:0 auto 18px}.book-index strong{font-size:var(--fs-3);line-height:1.7;color:var(--ink-1)}.book-index small{font-size:11px;line-height:1.7;margin:0 0 7px}.book-index>button[aria-current=true]{background:none;box-shadow:none}.book-index>button:active{opacity:.75}
  .story-directory-tools{gap:12px}.directory-count{display:none}.story-directory-tools>.mobile-picker-trigger{padding:10px 12px;font-size:var(--fs-1);min-width:0}.story-volume-layout{padding-top:18px}
  .story-atlas,.world-atlas{height:calc(100svh - var(--header-height) - var(--mobile-tab-height));height:calc(100dvh - var(--header-height) - var(--mobile-tab-height));min-height:0}
  .story-atlas .map-bottom{height:64px;padding:0 var(--page-gutter)}.story-atlas .map-viewport{height:calc(100% - 120px)}.story-scene-index{bottom:64px}.story-atlas .view-choice{bottom:calc(var(--mobile-tab-height) + 10px)!important}
  .world-sidebar{display:none}.world-atlas .world-canvas-heading{top:12px;width:auto;display:flex;align-items:start}.world-canvas-heading p{display:none}.world-canvas-heading>div{min-width:0;max-width:calc(100% - 95px)}.world-canvas-heading h1{font-size:23px;margin-bottom:9px}.world-canvas-heading .mobile-picker-trigger{font-size:var(--fs-1);padding:8px 12px;max-width:100%}
  .world-atlas .canvas-host{left:0;top:112px;width:100%;height:calc(100% - 112px)}.world-atlas .map-viewport{height:calc(100% - 92px)}.world-atlas .map-bottom{height:92px;padding:9px var(--page-gutter)}
  #detail-dialog{inset:calc(10px + env(safe-area-inset-top,0px)) 0 0;height:calc(100svh - 10px - env(safe-area-inset-top,0px));height:calc(100dvh - 10px - env(safe-area-inset-top,0px));border-radius:22px 22px 0 0;overflow:hidden;box-shadow:0 -12px 50px #020b1544}
  #detail-dialog[open]{animation:mobile-sheet-arrive .26s cubic-bezier(.2,.8,.2,1)}#detail-dialog::backdrop{background:#020b15a8;backdrop-filter:blur(3px)}#detail-dialog.is-dismissing{pointer-events:none}
  .mobile-sheet-grab{display:block;height:18px;min-height:18px;flex-shrink:0;touch-action:none}.mobile-sheet-grab:before{content:'';display:block;width:34px;height:4px;margin:7px auto;border-radius:var(--r-1);background:color-mix(in srgb, var(--ink-2) 37%, transparent)}
  #detail-dialog .dialog-toolbar{height:50px;min-height:50px;padding:0 10px 0 18px;touch-action:none;background:transparent}#detail-dialog .dialog-content,#detail-dialog .drawer-scene{padding-bottom:24px}
  .mobile-reading-progress{display:block;flex-shrink:0;height:2px;background:color-mix(in srgb, var(--gold-0) 7%, transparent)}.mobile-reading-progress:before{content:'';display:block;height:100%;width:var(--reading-progress,0%);background:var(--gold-0);transition:width .12s linear}
  .mobile-enhanced #detail-dialog .drawer-neighbours{display:none}.mobile-reader-bar{position:relative;z-index:6;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));flex-shrink:0;height:var(--mobile-reader-height);padding:6px 12px calc(6px + env(safe-area-inset-bottom,0px));gap:8px;border-top:1px solid color-mix(in srgb, var(--ink-2) 14%, transparent);background:#192a39}
  .mobile-reader-bar:has([data-reader-close]){grid-template-columns:repeat(2,minmax(0,1fr))}.mobile-reader-bar button{display:flex;justify-content:center;align-items:center;gap:7px;min-height:44px;padding:8px 4px;border-radius:var(--r-2);color:var(--ink-1);font-size:var(--fs-1)}.mobile-reader-bar button:active{background:color-mix(in srgb, var(--gold-0) 8%, transparent)}.mobile-reader-bar button:disabled{opacity:.3}.mobile-reader-bar svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.5}.mobile-next-chevron{display:flex;transform:rotate(180deg)}
  #detail-dialog .reader-outline summary{min-height:44px;font-size:var(--fs-1);padding:9px 18px}#detail-dialog .reader-outline nav{position:fixed;inset:auto 12px calc(var(--mobile-reader-height) + 10px);max-height:55dvh;padding:8px 0;border:1px solid color-mix(in srgb, var(--ink-3) 30%, transparent);border-radius:16px;background:#123044;z-index:5;box-shadow:0 -10px 45px #020b1580}
  #detail-dialog .reader-outline .mobile-outline-scrim{position:fixed;inset:0;z-index:4;display:block;padding:0;border:0;width:100%;height:100%;background:#020b1580;box-shadow:none;border-radius:0}#detail-dialog .reader-outline:not([open]) .mobile-outline-scrim{display:none}
  #detail-dialog .reader-outline button{padding:13px 18px;font-size:var(--fs-2)}#detail-dialog .reader-outline .heading-level-4{padding-left:30px;font-size:var(--fs-1)}#detail-dialog .reader-outline .heading-level-5{padding-left:42px;font-size:var(--fs-1)}
  .mobile-picker-dialog{inset:auto 0 0;margin:0;width:100%;height:auto;max-width:none;max-height:78dvh;padding:0 0 env(safe-area-inset-bottom,0px);border:0;border-radius:24px 24px 0 0;background:#192a39;color:var(--ink-1);box-shadow:0 -15px 60px #02101e66;overflow:hidden}
  .mobile-picker-dialog[open]{display:flex;flex-direction:column;animation:mobile-sheet-arrive .24s cubic-bezier(.2,.8,.2,1)}.mobile-picker-dialog::backdrop{background:#020b15a8;backdrop-filter:blur(3px)}
  .mobile-picker-heading{display:flex;justify-content:space-between;align-items:center;padding:0 12px 8px 22px;gap:18px;flex-shrink:0;touch-action:none}.mobile-picker-heading h2{font:500 19px/1.6 var(--sans);margin:0}.mobile-picker-heading button{display:grid;place-items:center;width:44px;height:44px;color:var(--ink-2)}.mobile-picker-heading svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.5}
  .mobile-picker-options{overflow-y:auto;overscroll-behavior:contain;min-height:0;padding:0 14px 16px}.mobile-picker-options button{display:flex;align-items:center;justify-content:space-between;gap:18px;text-align:left;width:100%;min-height:56px;padding:16px 12px;border-bottom:1px solid color-mix(in srgb, var(--ink-3) 14%, transparent);border-radius:0;color:var(--ink-2);font-size:var(--fs-3);line-height:1.8}.mobile-picker-options button>span{min-width:0;overflow-wrap:anywhere}.mobile-picker-options small{display:block;font-size:var(--fs-1);color:var(--ink-2);margin-top:5px}.mobile-picker-options svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.5;flex-shrink:0;visibility:hidden}.mobile-picker-options [aria-pressed=true]{background:color-mix(in srgb, var(--gold-0) 7%, transparent);border-radius:var(--r-2);color:var(--ink-0)}.mobile-picker-options [aria-pressed=true] svg{visibility:visible;color:var(--gold-0)}
  .mobile-filter-groups{overflow-y:auto;overscroll-behavior:contain;min-height:0;padding:0 20px 8px}.mobile-filter-groups section{margin-bottom:22px}.mobile-filter-groups h3{font:400 var(--fs-1)/1.8 var(--sans);color:var(--ink-2);margin:5px 0 12px}.mobile-filter-groups button{min-height:44px;color:var(--ink-2);font-size:var(--fs-1);line-height:1.7}.mobile-filter-themes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.mobile-filter-themes button{padding:8px 4px;border:1px solid color-mix(in srgb, var(--ink-3) 21%, transparent);border-radius:9px}.mobile-filter-themes svg{display:none}.mobile-filter-themes [aria-pressed=true]{background:color-mix(in srgb, var(--gold-0) 9%, transparent);border-color:color-mix(in srgb, var(--gold-0) 53%, transparent);color:var(--ink-1)}
  .mobile-filter-sources button{display:flex;align-items:center;justify-content:space-between;gap:16px;width:100%;padding:13px 0;border-bottom:1px solid color-mix(in srgb, var(--ink-3) 14%, transparent);text-align:left}.mobile-filter-sources svg{visibility:hidden;width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.5;flex-shrink:0}.mobile-filter-sources [aria-pressed=true]{color:var(--gold-0)}.mobile-filter-sources [aria-pressed=true] svg{visibility:visible}
  .mobile-filter-footer{padding:10px 20px 16px;flex-shrink:0;border-top:1px solid color-mix(in srgb, var(--ink-3) 18%, transparent)}.mobile-filter-footer button{min-height:46px;width:100%;background:#234c62;color:var(--ink-1);border-radius:11px;font-size:var(--fs-2)}
  .search-dialog{inset:calc(10px + env(safe-area-inset-top,0px)) 0 0;width:100%;height:calc(100dvh - 10px - env(safe-area-inset-top,0px));padding-top:0;border:0;border-radius:22px 22px 0 0}.search-dialog #global-results{padding-top:4px}.search-help{display:none}.search-result>span{font-size:10px}
  @keyframes mobile-sheet-arrive{from{transform:translateY(100%)}to{transform:translateY(0)}}
}
@media (max-width:380px){.mobile-book-cover{height:160px}.mobile-reader-bar button{font-size:var(--fs-1)}.hero-copy h1{font-size:39px}.story-directory-tools>.mobile-picker-trigger{font-size:var(--fs-1);gap:8px}}
@media (max-width:760px) and (prefers-reduced-motion:reduce){#detail-dialog[open],.mobile-picker-dialog[open]{animation:none}.mobile-reading-progress:before{transition:none}}
