/* Shared phone layout: viewport/content driven, with no brand or UA branches. */
/* Self-hosted OFL font: identical Latin glyphs on iOS and Android, offline too. */
@font-face{
 font-family:"Dictionary Home English";
 src:url("assets/fonts/eb-garamond-italic-latin.ttf") format("truetype");
 font-style:italic;
 font-weight:400;
 font-display:swap;
 unicode-range:U+0020,U+002C,U+002E,U+0041-005A,U+0061-007A,U+2019;
}
@media(max-width:760px){
 /* The responsive homepage already supplies readable sizes. Prevent additional
    browser text inflation; do not disable pinch zoom or clamp wrapped content. */
 #home-view{-webkit-text-size-adjust:100%;text-size-adjust:100%}
 #creation-guide{-webkit-text-size-adjust:100%;text-size-adjust:100%}
 #home-view .hero-label{
  font-family:"Dictionary Home English",var(--art-serif);
  font-size:12px;
  font-style:italic;
  font-weight:400;
  line-height:1.5;
  letter-spacing:.7px;
  white-space:normal;
  overflow-wrap:break-word;
 }
 .header{height:auto;min-height:90px;flex-wrap:wrap;column-gap:8px;row-gap:10px;padding-bottom:12px}
 .header .nav{flex:none;flex-wrap:wrap;max-width:100%;height:auto;gap:4px;margin-left:auto}
 .header .nav button{min-width:44px;min-height:44px}
 /* The body-level pendant must also clear a wrapped navigation row. */
 .moon-pendant{top:max(0px,calc(var(--page-header-height,90px) + var(--page-header-height,90px) - 180px))}
 #home-view .hero{height:calc(100vh - var(--page-header-height,90px));height:calc(100svh - var(--page-header-height,90px))}
 /* Leave room for actual copy (including enlarged/wrapped text) plus artwork.
    The page may grow naturally if this no longer fits the available viewport. */
 body:not(.home-star-voice-open):not(.curiosity-active) #home-view .hero{
  --home-copy-bottom:113px;
  min-height:max(420px,calc(var(--home-copy-height,140px) + var(--home-copy-bottom) + 160px));
 }
 body:not(.home-star-voice-open):not(.curiosity-active) #home-view .hero-copy{bottom:var(--home-copy-bottom)}
 body:not(.home-star-voice-open):not(.curiosity-active) #home-view #art-bounds{
  height:min(65%,calc(100% - var(--home-copy-height,140px) - var(--home-copy-bottom) - 24px));
 }
 body[data-subject="venus"]:not(.home-star-voice-open):not(.curiosity-active) #home-view #art-bounds{
  height:min(70%,calc(100% - var(--home-copy-height,140px) - var(--home-copy-bottom) - 24px));
 }
 /* Keep text entry readable and avoid focus zoom on small iPhone inputs. */
 #home-search input,.browse-search input,#creation-guide .creation-search input,#creation-guide.creation-starry .creation-search input,
 .chat-form input,dialog input:not([type="checkbox"]):not([type="radio"]),dialog textarea{font-size:16px}
 input,textarea{scroll-margin-block:24px}
 .settings-shell{padding-bottom:max(24px,env(safe-area-inset-bottom,0px))}
 .personal-view{padding-bottom:max(40px,env(safe-area-inset-bottom,0px))}
 .personal-row{flex-wrap:wrap}
 .personal-theme-end{min-width:0}
 .personal-theme-end small{white-space:normal;overflow-wrap:anywhere}
 /* Older webviews get a vh fallback; modern browsers use their visible height. */
 #settings-dialog{height:100vh;max-height:100vh;height:100dvh;max-height:100dvh}
 .registration-gate{max-height:calc(100vh - 40px);max-height:calc(100dvh - 40px)}
}
@media(max-width:640px){
 /* Position the creative prompt against the visible page, not a fixed 620px field. */
 #creation-guide.creation-starry:not(.creation-has-query){
  height:calc(100vh - var(--page-header-height,90px));
  height:calc(100svh - var(--page-header-height,90px));
  min-height:max(460px,calc(var(--creation-star-height,44px)*4 + var(--creation-toolbar-height,105px) + 170px));
  max-height:none;
 }
 #creation-guide.creation-starry:not(.creation-has-query) .creation-toolbar{top:44%}
 #creation-guide.creation-starry .creation-directory{top:calc(44% + var(--creation-toolbar-height,105px)/2 + 12px)}
 #creation-guide.creation-starry .creation-star{min-height:44px;padding:4px 5px;gap:8px}
 #creation-guide.creation-starry.creation-has-query{
  min-height:calc(100vh - var(--page-header-height,90px));
  min-height:calc(100svh - var(--page-header-height,90px));
 }
}
@media(max-width:760px) and (max-height:759px){
 body:not(.home-star-voice-open):not(.curiosity-active) #home-view .hero{--home-copy-bottom:clamp(76px,calc(100svh - 647px),113px)}
}
/* Landscape phones keep usable typography and scroll instead of clipping. */
@media(orientation:landscape) and (max-width:1000px) and (max-height:500px){
 .header{padding-left:max(4%,env(safe-area-inset-left,0px));padding-right:max(4%,env(safe-area-inset-right,0px))}
 #home-search input{font-size:16px}
 /* Very short landscape screens prioritize the prompt and complete directory. */
 #creation-guide.creation-starry:not(.creation-has-query){height:auto;min-height:calc(100svh - var(--page-header-height,120px));max-height:none;padding:24px 0}
 #creation-guide.creation-starry:not(.creation-has-query) .creation-toolbar{position:relative;left:auto;top:auto;transform:none;margin:0 auto;gap:16px;width:min(520px,100%)}
 #creation-guide.creation-starry .creation-star-field{display:none}
 #creation-guide.creation-starry .creation-directory{position:relative;left:auto;top:auto;transform:none;margin:16px auto 0}
 #creation-guide.creation-starry .creation-search input{font-size:16px}
}
