/* 1. Enable the scroll engine on the panel */
.page {
  scrollbar-width: none; /* Firefox */
  scroll-snap-align: center;
  /* Clamps page panel height 40px above viewport floor, protecting footer space */
  max-height: calc(100svh - 40px);
}

/* 2. Hide the scrollbar track entirely for Chrome/Safari/Edge */
.page::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* Remove the "active" page shadow */
.page.active {
  box-shadow: 2px 1px 4px rgba(0, 0, 0, 0.2);
}

.paper {
  /* Includes padding inside height math to prevent layout expansion blowout into footer*/
  box-sizing: border-box; /* Includes padding/borders inside the 100% height calculation */
}

.footer {
  padding-bottom: 50px; /* more reasonable padding than 500px */
}

/* Makes the children of .main, i.e. the .page panels, snap to the center of the viewport when scrolling horizontally. */
.main {
  scroll-snap-type: x mandatory;
}

/* 
@media all and (max-width: 490px) {
  .page {
    zoom: 87.5%;
    margin: 6px;
    max-height: calc((100svh - 40px) / 0.875);
  }
} */

@media all and (max-width: 490px) {

    .page {
    zoom: 87.5%;
    margin: 6px;
    max-height: calc((100svh - 40px) / 0.875);
  }

  /* --- TYPOGRAPHY AND CORE TRACK FIXES --- */
  footer, footer *, .neighborhood-collapsible, #site-owner {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important;
    box-sizing: border-box !important;
  }

  .main.restore-panning {
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    touch-action: pan-x !important;
  }
  .main.restore-panning .page { pointer-events: auto !important; }

  /* --- FOOTER MAIN ROW CONTAINER --- */
  footer {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important; 
    justify-content: space-between !important;
    height: 55px !important;
    min-height: 55px !important;
    padding: 0 10px !important;
    background: #333333 !important; 
    color: #ffffff !important;
    position: relative !important;
    z-index: 9999 !important;
  }

  /* --- FAR LEFT META BYLINE --- */
  #site-owner {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    height: 55px !important;
    min-width: 55px !important;
  }
  
  #site-owner .byline-tag {
    font-size: 10px !important;
    line-height: 12px !important;
    color: #aaaaaa !important;
    margin: 0 !important;
    display: block !important;
  }
  
  #site-owner .owner-name {
    font-size: 12px !important;
    line-height: 14px !important;
    font-weight: bold !important;
    color: #ffffff !important;
    margin: 0 !important;
    display: block !important;
  }

  /* Padlock vertical centering */
  .mobile-auth-center-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 55px !important;
    padding: 0 4px !important;
    margin-right: 2px !important;
  }
  .mobile-auth-center-btn img { width: 16px !important; height: auto !important; }

  /* --- BALANCED COMPACT SEARCH BOX --- */
  .searchbox, .search {
    display: flex !important;
    align-items: center !important;
    height: 55px !important;
    margin: 0 6px !important;
    max-width: 85px !important;
    position: relative !important;
    transition: max-width 0.25s ease !important;
  }
  .searchbox:focus-within { max-width: 125px !important; }

  .searchbox input {
    width: 100% !important;
    height: 32px !important;
    border-radius: 6px !important;
    border: 1px solid #555555 !important;
    background: #ffffff !important;
    color: #222222 !important;
    padding: 0 8px !important;
    font-size: 13px !important;
  }

  /* Forcefully remove default overlapping text elements */
  .searchbox .pages, footer > .pages, footer text, .editEnable,
  footer span:contains("wiki"), footer div:contains("wiki") { 
    display: none !important; 
    visibility: hidden !important;
    width: 0 !important; height: 0 !important;
  }

  /* --- UNIFIED COMBINED UNIVERSAL EDIT COMPONENT ROW --- */
  .mobile-edit-system-wrapper {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    height: 55px !important;
    padding: 0 4px !important;
    cursor: pointer !important;
  }

  .mobile-universal-edit-deck {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 55px !