/* v350
   1) Camo-only: a little padding under the badge so it and its 3px shadow sit inside the bar.
      Light and Dark are unchanged (those rules live only under html[data-camo]).
   2) All themes, phone and desktop: fill leftover viewport space so the footer ends
      neatly just above the fixed bottom nav. Body padding stays 0 under html.ft-flush
      (the footer itself still clears the tabbar). Tabbar stays glued to the screen
      bottom with safe-area only (v347). Run-view height rules are not touched.
*/

/* ---- Camo header tightness ---- */
html[data-camo] .topbar{
  padding-bottom:8px !important;
  box-sizing:border-box !important;
}

/* ---- Footer sits at the bottom of short pages; copyright stays just above the nav ---- */
html{--apjj-topbar-h:51px}
@media (min-width:900px){html{--apjj-topbar-h:64px}}

html.ft-flush main#app{
  display:flex !important;
  flex-direction:column !important;
  box-sizing:border-box !important;
  min-height:calc(100dvh - var(--apjj-topbar-h, 51px)) !important;
}
html.ft-flush main#app > .view{flex:0 0 auto}
html.ft-flush main#app > .site-foot3,
html.ft-flush body main > .site-foot3,
html.ft-flush body main > #view-more:not([hidden]) ~ .site-foot3{
  margin-top:auto !important;
  margin-bottom:0 !important;
  flex:0 0 auto;
  /* tabbar clearance + a tight 10px so © sits just above the nav (was +18px, and
     w297-dsite used tb-h/0.32 + 18 ≈ 221px, which left a ~150px void when scale is 1) */
  padding-bottom:calc(var(--ft-tb, var(--tb-h, 65px)) + 10px) !important;
}

/* Chrome "Desktop site" on a phone: pad by the tabbar in *layout* pixels
   (visible bar height / actual scale), not a worst-case 0.32 scale. */
html.w297-dsite.ft-flush body main > .site-foot3,
html.w297-dsite.ft-flush body main > #view-more:not([hidden]) ~ .site-foot3,
html.w297-dsite body main > .site-foot3{
  padding-bottom:calc(var(--ft-tb, var(--tb-h, 65px)) / var(--ft-scale, 1) + 10px) !important;
}
