/* 26Winter mobile foundation. Safe areas are physical insets, independent of
   whether the browser places its address bar at the top or bottom. */
:root{--fb-safe-top:env(safe-area-inset-top,0px);--fb-safe-bottom:env(safe-area-inset-bottom,0px);--fb-safe-left:env(safe-area-inset-left,0px);--fb-safe-right:env(safe-area-inset-right,0px);--fb-bar-height:calc(clamp(52px,4.6vw,76px) + var(--fb-safe-top))}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body,#app{height:100vh;height:100dvh}
#boxNav.nav-v2 .box-topline{padding-top:var(--fb-safe-top);padding-left:max(16px,3.2vw,var(--fb-safe-left));padding-right:max(16px,3.2vw,var(--fb-safe-right))}
#boxNav.nav-v2 .nav-brand{top:calc(50% + var(--fb-safe-top)/2)}
#boxNav.nav-v2 #boxToggle{height:max(44px,calc(var(--fb-bar-height) - var(--fb-safe-top) - 12px));min-width:44px}
#boxNav.nav-v2 #objects{padding-left:var(--fb-safe-left);padding-right:var(--fb-safe-right)}
#boxNav.nav-v2 #accountCard{max-height:calc(100dvh - var(--fb-bar-height) - var(--fb-safe-bottom) - 24px);overflow-y:auto;overscroll-behavior:contain}
.page{scroll-padding-top:calc(var(--fb-bar-height) + 16px);overscroll-behavior-y:contain}
#page-home,#page-gallery,#page-creators,#page-events{padding-bottom:var(--fb-safe-bottom)}
#page-freshview .fv-nav{bottom:calc(2.2% + var(--fb-safe-bottom))}
/* Reader's measured stage excludes the notch and home indicator; PDF gestures
   stay on the stage. Browser zoom remains available for surrounding UI. */
#fresh-reader,#reader-welcome{inset:0;height:100vh;height:100dvh;box-sizing:border-box}
#fresh-reader{padding:var(--fb-safe-top) var(--fb-safe-right) var(--fb-safe-bottom) var(--fb-safe-left)}
#fresh-reader .fr-close-float,#fresh-reader .fr-more-btn{top:calc(var(--fb-safe-top) + 16px)}
#fresh-reader .fr-close-float{left:calc(var(--fb-safe-left) + var(--fr-edge-space))}
#fresh-reader .fr-more-btn{right:calc(var(--fb-safe-right) + var(--fr-edge-space))}
#fresh-reader .fr-brand{top:calc(var(--fb-safe-top) + 18px);left:calc(var(--fb-safe-left) + var(--fr-edge-space) + var(--fr-top-control) + 10px)}
#fresh-reader .fr-page-pill{bottom:calc(var(--fb-safe-bottom) + 18px);right:calc(var(--fb-safe-right) + 18px)}
#fresh-reader .fr-more-panel{top:calc(var(--fb-safe-top) + 12px);right:calc(var(--fb-safe-right) + 12px);max-height:calc(100dvh - var(--fb-safe-top) - var(--fb-safe-bottom) - 24px)}
#fresh-reader .fr-help{max-height:calc(100dvh - var(--fb-safe-top) - var(--fb-safe-bottom) - 32px)}
.welcome-round{top:calc(var(--fb-safe-top) + 16px)}
.welcome-back{left:calc(var(--fb-safe-left) + 16px)}.welcome-more{right:calc(var(--fb-safe-right) + 16px)}
.welcome-brand{top:calc(var(--fb-safe-top) + 20px);left:calc(var(--fb-safe-left) + 70px)}
#welcome-menu{top:calc(var(--fb-safe-top) + 12px);right:calc(var(--fb-safe-right) + 12px);max-height:calc(100dvh - var(--fb-safe-top) - var(--fb-safe-bottom) - 24px);box-sizing:border-box}
@media(max-width:819px){
 #boxNav.nav-v2 .box-page-name{font-size:clamp(18px,5.6vw,26px);max-width:32%;overflow:hidden;text-overflow:ellipsis}
 #boxNav.nav-v2 .nav-brand{font-size:clamp(18px,4.8vw,22px)}
 #boxNav.nav-v2 #accountContent .account-top button{min-width:44px;min-height:44px}
 #boxNav.nav-v2 #accountLanguage{min-height:44px;font-size:16px}
 #boxNav.nav-v2 .account-language label,#boxNav.nav-v2 .account-language p{font-size:13px;line-height:1.6}
 #nowPoster .now-tagline{padding:48px 24px 64px;font-size:19px;line-height:1.5}
 #nowPoster .now-issue{width:calc(100% - 40px);grid-template-columns:minmax(0,1fr);gap:0;align-items:start}
 #nowPoster .now-status{text-align:left;font-size:clamp(36px,10vw,60px);line-height:1.02;margin-bottom:14px}
 #nowPoster .now-cover{aspect-ratio:1/1}
 #nowPoster .now-released .now-cover{aspect-ratio:4/3}
 #nowPoster .now-issue-info{grid-column:1;display:flex;flex-direction:column;align-items:flex-end;gap:0;text-align:right;padding-top:18px;min-width:0}
 #nowPoster .now-issue-info h2{font-size:clamp(30px,8.4vw,48px);line-height:1.15}
 #nowPoster .now-quote{max-width:100%;white-space:normal;font-size:16px;line-height:1.5;margin-top:20px}
 #nowPoster .now-issue-arrow{min-width:44px;min-height:44px;display:inline-flex;justify-content:center;align-items:center;font-size:28px;padding:8px;margin-top:10px}
 #nowPoster .now-publications{gap:64px}
 #nowPoster .now-about,#nowPoster .now-explore,#nowPoster .now-more{padding-top:88px}
 #nowPoster .now-about-copy{width:calc(100% - 48px);margin-top:32px;font-size:16px;line-height:1.75;overflow-wrap:break-word}
 #nowPoster .now-text-links{gap:20px;margin-top:32px}
 #nowPoster .now-text-links button{min-height:44px;padding:8px 0;max-width:calc(100% - 64px);font-size:17px}
 #nowPoster .now-explore-grid{grid-template-columns:minmax(0,1fr);width:calc(100% - 48px);gap:64px;margin-top:44px}
 #nowPoster .now-tool-link{gap:24px;font-size:18px;min-height:44px}
 #nowPoster .now-tool-link>img,#nowPoster .now-esh-icon{width:clamp(120px,34vw,180px);height:clamp(120px,34vw,180px);margin:auto}
 #nowPoster .now-esh-icon b{font-size:clamp(48px,14vw,74px)}#nowPoster .now-esh-icon strong{font-size:clamp(15px,4.4vw,23px)}
 #nowPoster .now-explore-grid article>p{max-width:32ch;margin:28px auto 0;font-size:16px;line-height:1.75}
 #nowPoster .now-footer{padding:88px 24px 40px}
 #gallery-home .g26-brand>p,.c26-intro p{width:calc(100% - 48px);font-size:16px;line-height:1.75}
 #gallery-home .g26-creators-link,.c26-back{min-height:44px;min-width:44px}
 #page-creators .c26-search input{font-size:16px;min-height:44px}
 .c26-bubbles{margin-bottom:48px}
 .fv-about{inset:calc(var(--fb-safe-top) + 16px) 0 auto;width:calc(100% - 20px - var(--fb-safe-left) - var(--fb-safe-right));height:calc(100dvh - var(--fb-safe-top) - 16px);max-height:none;box-sizing:border-box}
 .fv-about .fv-close{top:12px;right:12px;width:44px;height:44px}
 .fv-about .fv-about-body{padding:76px 24px calc(36px + var(--fb-safe-bottom));overflow-wrap:break-word}
 .fv-about h1{font-size:28px}.fv-about h2{font-size:22px}.fv-about p,.now-info li{font-size:16px;line-height:1.8}
 .fv-about.c26-profile h2{font-size:32px;margin:28px 0 12px}
 .c26-profile .c26-meta,.c26-profile .c26-bio{margin-top:32px}
 .c26-controls>button:disabled{top:12px;right:72px;min-height:44px}
 #freshview-root .fv-logo{width:min(66vw,40svh);max-width:80%}
 .fv-subtitle{font-size:16px;line-height:1.6;padding:0 24px}
 .fv-nav{left:16px;right:16px;grid-template-columns:1fr 1.3fr 1fr}
 .fv-nav button{font-size:14px;min-height:56px;padding:14px 2px;white-space:normal}
 /* Give editorial scenes enough vertical space for real readable text. */
 .fv-places,.fv-new-york,.fv-midnights{aspect-ratio:auto;min-height:420px;height:76svh;max-height:700px}
 .fv-places-strip{height:44%}.fv-places-caption{left:24px;top:auto;bottom:32px}
 .fv-places-caption h3{font-size:32px;margin-bottom:16px}
 #freshview-root .fv-scene-read{font-size:18px;min-height:44px;align-items:center}
 .fv-ny-title{font-size:20px;left:16px;bottom:24px;padding:8px}
 .fv-ny-note{font-size:14px;width:auto;max-width:80%;right:16px;top:20px;padding:12px;line-height:1.4}
 .fv-new-york>.fv-scene-read{right:20px;bottom:88px}
 .fv-midnights-caption{left:24px;top:auto;bottom:96px}.fv-midnights-caption h3{font-size:36px}.fv-midnights-caption p{font-size:16px;line-height:1.5}
 .fv-midnights>.fv-scene-read{bottom:28px;right:24px}
 .fv-visual-design{aspect-ratio:auto;padding:32px 24px;display:flex;flex-direction:column;gap:24px}
 .fv-visual-art,.fv-visual-heading,.fv-visual-description,.fv-visual-brand,.fv-visual-design>.fv-scene-read{position:relative;inset:auto}
 .fv-visual-art{width:55%;max-width:240px;align-self:center}
 .fv-visual-heading h3{font-size:26px;white-space:normal}.fv-visual-heading p,.fv-visual-description,.fv-visual-brand span{font-size:16px;line-height:1.6}
 .fv-visual-heading p{margin-top:12px}.fv-visual-brand{gap:16px;align-items:center}#freshview-root .fv-visual-brand img{width:80px}
 .fv-visual-design>.fv-scene-read{align-self:flex-end}
 #fv-library .publication-panel{margin-left:24px;margin-right:24px}
 #fv-library .publication-read{min-height:44px;align-items:center}
 #fv-library .depth-carousel__arrow{min-width:44px;min-height:44px}
 #fv-library .depth-carousel__arrow::before{width:65%;height:65%;margin:auto}
 #fv-library .depth-carousel__dots{bottom:20px;gap:2px;padding:0;background:transparent}
 #fv-library .depth-carousel__dot,#fv-library .depth-carousel__dot.is-active{position:relative;width:28px;height:44px;min-width:28px;background:transparent;border-radius:0}
 #fv-library .depth-carousel__dot::after{content:'';position:absolute;top:19px;left:11px;width:6px;height:6px;background:#777;border-radius:50%}
 #fv-library .depth-carousel__dot.is-active::after{background:#fff}
 #fresh-reader{--fr-top-control:44px;--fr-control:44px;--fr-edge-space:12px}
 #fresh-reader .fr-brand{font-size:22px;top:calc(var(--fb-safe-top) + 25px)}
 #fresh-reader .fr-more-panel label,#fresh-reader .fr-menu-action,#fresh-reader .fr-setting-row{min-height:44px}
 #fresh-reader select{font-size:16px;min-height:44px;max-width:100%}
 #fresh-reader .fr-help{padding:68px 24px 24px;width:calc(100% - 24px - var(--fb-safe-left) - var(--fb-safe-right))}
 #fresh-reader .fr-help .fr-guide-close{width:44px;height:44px}
 #reader-welcome .welcome-round{width:44px;height:44px}
 #reader-welcome .welcome-brand{font-size:22px;top:calc(var(--fb-safe-top) + 25px)}
 #reader-welcome .welcome-hero{position:relative;inset:auto;transform:none;width:100%;height:auto;min-height:0;margin:calc(var(--fb-safe-top) + 112px) auto 36px;gap:30px;padding:0 24px}
 #reader-welcome .welcome-logo,#reader-welcome .welcome-logo-hit{width:min(64vw,260px)}
 #reader-welcome .welcome-words{font-size:20px;line-height:1.5}
 #reader-welcome .welcome-start{position:relative;inset:auto;transform:none;width:100%;padding:0 24px 28px;min-height:0;display:block;text-align:center}
 #reader-welcome #welcome-options{display:flex!important;position:relative;inset:auto;opacity:1;visibility:visible;pointer-events:auto;flex-direction:column;gap:8px}
 #reader-welcome .welcome-start-label{display:none!important}
 #reader-welcome .welcome-option{min-height:48px;font-size:20px!important}
 #reader-welcome #welcome-status{position:relative;inset:auto;padding:0 24px calc(24px + var(--fb-safe-bottom));font-size:14px}
 #reader-welcome #welcome-menu{font-size:16px;max-width:calc(100% - 24px - var(--fb-safe-left) - var(--fb-safe-right))}
}
@media(hover:none),(pointer:coarse){
 button,a,select{touch-action:manipulation}
 #nowPoster .now-text-links button:not(:disabled)>.fb-arrow,#nowPoster .now-tool-link[href]>span>.fb-arrow{position:relative;left:auto;top:auto;opacity:1;transform:none;margin-left:.5em}
 #nowPoster .now-tool-link[href]>span{display:inline-flex;align-items:center}
}
@media(max-width:819px){
 #fv-library .publication-panel,#fv-library [data-publication=qidian] .publication-panel{position:relative;inset:auto;margin:calc(var(--fb-bar-height) + 76px) 24px 12px;min-height:0;display:flex;flex-direction:column;gap:24px;width:auto}
 #fv-library .publication-index,#fv-library .publication-panel .fr-title-block,#fv-library [data-publication=qidian] .fr-title-block,#fv-library [data-publication=rewind] .fr-title-block,#fv-library .publication-panel .fr-publisher,#fv-library [data-publication=qidian] .fr-publisher,#fv-library .publication-read,#fv-library [data-publication=qidian] .publication-read{position:static;inset:auto}
 #fv-library .publication-panel .fr-title-english,#fv-library .publication-panel .fr-title-auxiliary{white-space:normal}
 #fv-library .carousel-wrap{height:66svh;min-height:340px;max-height:560px}
 #fresh-reader .fr-prev{left:calc(var(--fb-safe-left) + 9px)}#fresh-reader .fr-next{right:calc(var(--fb-safe-right) + 9px)}
 #reader-welcome #welcome-options[hidden]{opacity:1;visibility:visible;pointer-events:auto;transform:none}
 #reader-welcome #welcome-options[hidden] .welcome-option{opacity:1;transform:none}
}
/* Landscape phones still need notches and short browser viewports respected. */
@media(max-height:500px) and (pointer:coarse){
 #boxNav.nav-v2{--menu-height:min(100dvh,calc(var(--fb-bar-height) + 166px))}
 #boxNav.nav-v2 #objects{height:calc(var(--menu-height) - var(--fb-bar-height));grid-template-columns:repeat(5,minmax(0,1fr));padding-bottom:8px;overflow-y:auto}
 #boxNav.nav-v2 .object{height:100%;min-height:100px}
 #boxNav.nav-v2 .object img,#boxNav.nav-v2 .object>.settings-symbol{width:48px;height:48px}
 #boxNav.nav-v2 .object[data-id=freshview] img{width:60px}
 .fv-brand{top:24%}#freshview-root .fv-logo{width:min(38vw,36svh)}
 .fv-subtitle{font-size:14px;margin-top:12px}.fv-nav button{min-height:44px;padding:8px 2px}
 #reader-welcome .welcome-hero{position:relative;inset:auto;transform:none;width:100%;height:auto;margin:calc(var(--fb-safe-top) + 90px) auto 24px}
 #reader-welcome .welcome-start{position:relative;inset:auto;transform:none;width:100%;padding:0 24px 32px;min-height:0}
}
#nowPoster{padding-left:var(--fb-safe-left);padding-right:var(--fb-safe-right)}
#page-gallery .gallery-body,#page-creators{padding-left:var(--fb-safe-left);padding-right:var(--fb-safe-right)}
#page-freshview #freshview-root{left:var(--fb-safe-left);right:var(--fb-safe-right)}
#fv-library .library-header{top:var(--fb-bar-height)}
@media(max-width:819px){.fv-about{margin-left:calc(10px + var(--fb-safe-left));margin-right:calc(10px + var(--fb-safe-right))}}
@media(max-width:819px){
 #boxNav.nav-v2 .account-top{font-size:13px}
 #boxNav.nav-v2 #accountContent .appearance strong{font-size:14px}
 #boxNav.nav-v2 #accountContent .appearance-line{font-size:16px;min-height:44px;display:flex;align-items:center;justify-content:space-between}
 #boxNav.nav-v2 .appearance-icon svg{width:22px;height:22px}
 #fv-library .depth-carousel__dot,#fv-library .depth-carousel__dot.is-active{width:44px;min-width:44px}
 #fv-library .depth-carousel__dot::after{left:19px}
}
@media(pointer:coarse){
 #fresh-reader{--fr-control:44px;--fr-top-control:44px}
 #reader-welcome .welcome-round{width:44px;height:44px}
 #fresh-reader .fr-menu-action,#fresh-reader .fr-setting-row,#welcome-menu button{min-height:44px}
}
/* Safari paints/samples the document canvas outside the dynamic app viewport.
   Keep that canvas continuous with the active page instead of the legacy black
   body. Full-bleed touch scrollers are configured separately below. */
html:not([data-reader-page]){--fb-canvas:#ffd1dc;min-height:100%;background-color:var(--fb-canvas)}
html:not([data-reader-page])[data-theme=dark],html:has(#page-gallery.active){--fb-canvas:#1b1b1b}
html:has(#page-freshview.active){--fb-canvas:#19191b}
html:not([data-reader-page]) body{background-color:var(--fb-canvas)}
html[data-reader-page],html[data-reader-page] body{background-color:#fff4e8}
html[data-reader-page][data-reader-theme=dark],html[data-reader-page][data-reader-theme=dark] body{background-color:#333}
/* Safari's translucent chrome needs document scrolling for ordinary pages.
   Nested full-height overflow surfaces do not provide the same under-toolbar
   content. FreshVIEW retains its scene-controlled scroll/transition contract. */
@media(pointer:coarse){
 html:not([data-reader-page]):not(:has(#page-freshview.active)){height:auto;min-height:100%;overflow-y:auto}
 html:not([data-reader-page]):not(:has(#page-freshview.active)) body{height:auto;min-height:100svh;overflow:visible}
 html:not([data-reader-page]):not(:has(#page-freshview.active)) #app{height:auto;min-height:100svh}
 #page-home.active,#page-gallery.active,#page-creators.active,#page-events.active{height:auto;min-height:100svh;overflow:visible;animation:none}
 #page-gallery.active .gallery-body{flex:none;overflow:visible;height:auto}
}
/* Scene/Reader content also needs an unclipped document canvas on iOS.
   Their internal gesture surfaces remain independent of document scrolling. */
@media(pointer:coarse){
 html:not([data-reader-page]):has(#page-freshview.active){height:auto;min-height:100%;overflow-y:auto}
 html:not([data-reader-page]):has(#page-freshview.active) body{height:auto;min-height:100lvh;overflow:visible}
 html:not([data-reader-page]):has(#page-freshview.active) #app{height:100lvh}
 #page-freshview .fv-nav{bottom:calc(2.2% + var(--fb-safe-bottom) + max(0px,100lvh - 100dvh))}
 html[data-reader-page],html[data-reader-page] body{height:auto;min-height:100lvh;overflow:visible}
 #fresh-reader,#reader-welcome{position:absolute;height:100lvh}
 #fresh-reader .fr-close-float,#fresh-reader .fr-brand{position:fixed}
 #fresh-reader .fr-page-pill{position:fixed}
}
/* FreshVIEW now hands touch scrolling to the document, too. Scene heights
   remain explicit so Rewind keeps the same artwork/transition coordinates. */
@media(pointer:coarse){
 html:not([data-reader-page]):has(#page-freshview.active) #app{height:auto;min-height:100lvh}
 #page-freshview.active{height:auto;min-height:100lvh;overflow:visible;animation:none}
 #page-freshview #freshview-root[data-native-scroll=true]{position:relative;inset:auto;width:calc(100% - var(--fb-safe-left) - var(--fb-safe-right));margin-left:var(--fb-safe-left);overflow:visible}
 #freshview-root[data-native-scroll=true] .fv-scroll,#freshview-root[data-native-scroll=true] .fv-scroll[data-unlocked=true]{height:auto;overflow:visible;overscroll-behavior:auto}
 #freshview-root[data-native-scroll=true] .fv-identity,#freshview-root[data-native-scroll=true] .fv-spotlight{height:100lvh;min-height:100lvh}
 #freshview-root[data-native-scroll=true] #fv-library{height:auto;min-height:100lvh;padding-bottom:var(--fb-safe-bottom)}
}
/* Programmatic dialog focus is not a keyboard interaction. Tab/keyboard use
   restores the existing visible focus indicators, including on touch devices. */
html:not([data-input-mode=keyboard]) :is(button,a,select,[tabindex]):focus-visible{outline:none!important;box-shadow:none!important}
@media(pointer:coarse){
 dialog.fv-about{position:absolute;inset:calc(var(--fb-dialog-page-y,0px) + var(--fb-safe-top) + 16px) 0 auto;height:calc(100lvh - var(--fb-safe-top) - 16px);max-height:none}
 dialog.fv-about::backdrop{position:fixed;inset:0;height:100lvh}
 dialog.fv-about .fv-about-body{padding-bottom:calc(36px + var(--fb-safe-bottom) + max(0px,100lvh - 100dvh))}
}
/* Mobile modal content must itself be the document scroller, not another
   fixed-height/top-layer surface. Desktop retains its native modal overlay. */
@media(pointer:coarse){
 html[data-document-dialog],html[data-document-dialog] body{height:auto!important;min-height:100lvh;background:#303034!important;overflow:visible!important}
 html[data-document-dialog] #app,html[data-document-dialog] #boxNav{display:none!important}
 html[data-document-dialog] dialog.fv-about[data-document-panel=true]{position:relative;inset:auto;display:flex;flex-direction:column;width:100%;max-width:none;height:auto;min-height:100lvh;margin:0;padding:0;border:0;overflow:visible;background:#303034}
 html[data-document-dialog] dialog.fv-about .fv-about-body{flex:none;overflow:visible;min-height:100lvh;padding:calc(var(--fb-safe-top) + 76px) max(24px,var(--fb-safe-right)) calc(36px + var(--fb-safe-bottom)) max(24px,var(--fb-safe-left))}
 html[data-document-dialog] .fv-about .fv-close{position:fixed;top:calc(var(--fb-safe-top) + 12px);right:calc(var(--fb-safe-right) + 12px)}
 html[data-document-dialog] .c26-controls>button:disabled{position:fixed;top:calc(var(--fb-safe-top) + 12px);right:calc(var(--fb-safe-right) + 72px)}
}
