/* Adapt to available browser space, including folded, unfolded and split windows. */
/* Suppress browser pinch and double-tap zoom, including scroll containers.
   Low specificity preserves the camera/film's touch-action:none gesture handling.
   Photo/camera zoom is handled by their pointer events; normal scrolling stays enabled. */
:where(html, body, body *) { touch-action:pan-x pan-y; }
.pane, .polimg { touch-action:pan-x pan-y; }
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}
/* Folding/rotation must never replace the app with a rotate-device gate. */
@media (orientation:landscape) and (pointer:coarse) {
  .stage { display:flex!important; }
  .rotate { display:none; }
}
body.mobile .stage { padding-left:var(--safe-left); padding-right:var(--safe-right); }
body.mobile .home { padding-bottom:calc(var(--safe-bottom) + 96px); }
body.mobile .tabbar, html.pola-sa .tabbar { bottom:calc(var(--safe-bottom) + 8px + var(--dock-lift,0px)); }
.tab { min-width:44px; min-height:44px; justify-content:center; font-size:9px; }
.tabbar { max-width:calc(100% - 16px); }
.panehead { padding-top:calc(var(--safe-top) + 22px); }
.panehead span, .pfpnote, .idbio, .ccsub, .cmt, .actwhen { font-size:11px; }
.docbody { font-size:12px; }
.gridbtn, .menubtn, .docx, .cvback { min-width:44px; min-height:44px; }
.pfpedit, .idedit, .pwatab, .fbkkind, .refbtn, .dsub, .pfollow { min-height:44px; }
.pullhint { border:0; background:none; padding:6px 8px; min-height:48px; max-width:100%; cursor:pointer; pointer-events:auto; flex-shrink:0; }
.pullhint .ltrs { white-space:normal; font-size:9px; letter-spacing:.15em; }
.pullhint.gone { pointer-events:none; }
.camclose { position:absolute; z-index:10; top:2px; right:14px; width:44px; height:44px;
  border:0; border-radius:50%; background:none; color:#ede7f6; font:18px var(--mono); cursor:pointer; }
.camclose:focus-visible { outline:2px solid #c084fc; outline-offset:-4px; }
.cambar { grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); }
.island.compact-controls .cambar { grid-template-columns:minmax(0,1fr) 96px minmax(0,1fr); gap:8px; padding:8px 12px 12px; }
.island.compact-controls .camtoggle { margin:0; min-height:44px; align-items:center; }
.island.compact-controls .ct-ic { display:none; }
.island.compact-controls .shutwrap { margin-right:0; gap:6px; }
.island.compact-controls .fscreen, .island.compact-controls .roller { width:100%; max-width:96px; }
.island.compact-controls .filterctl { min-width:0; width:100%; }
.island.compact-controls .fname { font-size:9px; letter-spacing:.1em; }
.modeflip { width:44px; }
.modeflip .mfknob { width:36px; }
.intro, .uname, .slides { padding:calc(var(--safe-top) + 20px) 16px calc(var(--safe-bottom) + 60px); overflow-y:auto; }
.ilogo { font-size:clamp(40px,15vw,64px); }
.isub, .homesub { line-height:1.8; letter-spacing:.18em; }
.icard { flex-shrink:0; max-width:100%; }
.slides { gap:16px; }
.sview { flex-shrink:0; }
.sbottom { flex-shrink:0; }
.slide { padding:0 20px; }
.docsheet { max-height:calc(100% - var(--safe-top) - 12px); }
.docbody { padding-bottom:calc(var(--safe-bottom) + 24px); }
.menuwrap { max-height:calc(100dvh - var(--safe-top) - var(--safe-bottom) - 90px); overflow-y:auto; }
.pfpname, .pfpbio, .pfpuser input, .dsearch input, .fbktext, .noteedit input, .cadd input { font-size:16px; }
.feed, .actbody, .pfpwrap, .cvgrid { scroll-padding-bottom:calc(var(--safe-bottom) + 110px); }
/* Keep large screens useful without making individual prints enormous. */
@media (min-width:600px) {
  .home { max-width:560px; margin-inline:auto; }
  .feed, .dresults, .actbody { width:100%; max-width:900px; margin-inline:auto; }
  #worldfeed { column-count:2; column-gap:20px; }
  .ccard { break-inside:avoid; }
  #feed .post { max-width:460px; margin-inline:auto; }
  .cvgrid { grid-template-columns:repeat(4,minmax(0,1fr)); max-width:900px; width:100%; margin-inline:auto; }
  .panehead { width:100%; max-width:900px; margin-inline:auto; }
  .lightbox .bigpol { width:min(320px,70vw); }
}
@media (max-height:650px) {
  body.mobile .home { padding-top:calc(var(--safe-top) + 54px); }
  .homelogo { font-size:36px; }
  .homestripes { height:6px; margin:8px 0 4px; }
  .homesub { font-size:8px; }
  .gallery .empty { padding:12px 8px; }
  .pullhint { margin-top:auto; margin-bottom:8px; }
  .shelf { padding:8px 12px 2px; }
  .shelfhead { margin-bottom:0; }
  .gallery { padding:6px 4px; }
  .intro, .uname, .slides { justify-content:flex-start; }
  .intro .ilogo { margin-top:auto; }
  .intro .icard { margin-top:20px; margin-bottom:auto; }
  .slides { padding-top:calc(var(--safe-top) + 14px); gap:12px; }
  .swfan { height:100px; }
  .swfan .spol { width:80px; }
  .slide h3 { font-size:20px; margin:10px 0; }
  .slide p { font-size:10px; }
  .spol { width:110px; margin-top:8px; }
  .snext, .sback { padding:12px 24px; }
  .sbottom { gap:8px; padding-bottom:12px; }
  .lightbox { overflow-y:auto; justify-content:flex-start; padding:16px 0 80px; }
  .lbfilm { flex-shrink:0; }
  .lightbox .bigpol { width:min(240px,65vw); }
}
@media (max-height:460px) {
  body.mobile .home { padding-top:calc(var(--safe-top) + 12px); }
  .home .homelogo, .home .homestripes, .home .homesub { display:none; }
  .pullhint .arr { display:none; }
  .intro .ilogo { font-size:40px; }
  .intro .istripes { margin:8px 0; height:6px; }
  .intro .icard { margin-top:12px; gap:8px; }
  .ifoot { bottom:calc(var(--safe-bottom) + 10px); }
  .shelfbrand { padding-bottom:2px; }
}
@media (prefers-reduced-motion:reduce) {
  .pullhint i, .pullhint .arr, .grain { animation:none; }
}
