/* AppDrop V2.1 — mobile layout and hierarchy repair.
   Scoped to the public UI. Added after main, localized and V2 styles. */
@media (max-width:760px) {
  /* Premium appearance means compact, not oversized neon blocks. */
  body:not(.admin):not(.admin-page){
    background:#060B0C;
  }
  body .w{width:min(650px,calc(100% - 28px))!important;padding:0!important}
  body.localized-site .locale-hero{margin-bottom:12px}
  body.localized-site .locale-hero h1{font-size:clamp(25px,6.4vw,33px)!important;line-height:1.13}
  body.localized-site .locale-hero .hero-copy>p{font-size:13px!important}
  body.localized-site .locale-note{font-size:12px;line-height:1.55}
  body.localized-site .locale-related[data-appdrop-quick-grid]{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:10px!important;
  }
  body.localized-site .locale-related[data-appdrop-quick-grid]>a{
    min-height:120px!important;
    border-radius:17px!important;
    padding:15px 28px 13px 14px!important;
    font-size:12.5px!important;
    line-height:1.35!important;
  }
  body.localized-site .locale-related[data-appdrop-quick-grid]>a::before{
    width:34px!important;height:34px!important;
    font-size:21px!important;top:12px!important;left:13px!important;
  }
  body.localized-site nav.appdrop-resource-links{
    height:auto!important;min-height:0!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
    margin-bottom:18px!important;
  }
  body.localized-site nav.appdrop-resource-links a{
    min-height:44px!important;
    padding:9px 11px!important;
    border-radius:13px!important;
    font-size:11.5px!important;
    line-height:1.3!important;
    overflow-wrap:anywhere;
  }
  /* The catalog filter used to consume most of a phone screen.
     Keep existing buttons, data attributes and event handlers intact. */
  body.localized-site .locale-browser{
    padding:16px 13px 14px!important;
    margin:16px 0 15px!important;
    border-radius:20px!important;
    background:linear-gradient(145deg,#0B211A,#081512 90%)!important;
  }
  body.localized-site .locale-browser .locale-browser-heading{
    font-size:19px!important;
    margin:0 0 12px!important;
  }
  body.localized-site .locale-browser .category-wrap.locale-filters{
    border:0!important;
    background:none!important;
    padding:0!important;
    margin:0 0 13px!important;
  }
  body.localized-site .locale-browser .category-scroll{
    display:flex!important;
    flex-flow:row nowrap!important;
    grid-template-columns:none!important;
    align-items:stretch!important;
    gap:7px!important;
    width:100%;
    height:auto!important;
    min-height:0!important;
    padding:0 0 3px!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    scrollbar-width:thin;
    -webkit-overflow-scrolling:touch;
  }
  body.localized-site .locale-browser .category-scroll .cat-filter,
  body.localized-site .locale-browser .category-scroll [data-locale-filter="all"]{
    display:inline-flex!important;
    flex:0 0 auto!important;
    flex-direction:row!important;
    align-items:center!important;
    justify-content:center!important;
    gap:6px!important;
    width:auto!important;
    min-height:43px!important;
    height:43px!important;
    min-width:0!important;
    padding:9px 12px!important;
    border-radius:11px!important;
    font-size:12px!important;
    font-weight:750!important;
    line-height:1.15!important;
    white-space:nowrap!important;
    overflow:visible!important;
  }
  body.localized-site .locale-browser .category-scroll .device-icon{
    font-size:15px!important;
    line-height:1!important;
  }
  body.localized-site .locale-browser .locale-category-heading{
    margin:8px 0 9px!important;
    font-size:13px!important;
    font-weight:750!important;
  }
  body.localized-site .locale-browser .locale-subcategories{
    display:flex!important;
    flex-flow:row nowrap!important;
    grid-template-columns:none!important;
    align-items:stretch!important;
    gap:7px!important;
    width:100%!important;
    max-width:100%;
    min-height:0!important;
    margin:0 0 13px!important;
    padding:0 0 7px!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    scrollbar-width:thin!important;
    scroll-snap-type:x proximity;
    -webkit-overflow-scrolling:touch;
  }
  body.localized-site .locale-browser .locale-subcategories .locale-category{
    display:inline-flex!important;
    flex:0 0 auto!important;
    align-items:center!important;
    justify-content:center!important;
    min-height:43px!important;
    max-height:46px!important;
    width:auto!important;
    max-width:200px;
    padding:10px 14px!important;
    border-radius:11px!important;
    font-size:12px!important;
    font-weight:730!important;
    line-height:1.16!important;
    text-align:center!important;
    white-space:nowrap!important;
    scroll-snap-align:start;
  }
  body.localized-site .locale-browser .locale-search{
    display:flex!important;
    align-items:stretch;
    width:100%!important;
    gap:7px!important;
    margin:0!important;
  }
  body.localized-site .locale-browser .locale-search input{
    box-sizing:border-box;
    flex:1 1 auto;
    min-width:0;
    height:46px!important;
    min-height:46px!important;
    padding:10px 13px!important;
    border-radius:12px!important;
    font-size:15px!important;
  }
  body.localized-site .locale-browser .locale-search button{
    flex:0 0 46px;
    min-width:46px!important;
    width:46px!important;
    height:46px!important;
    min-height:46px!important;
    padding:0!important;
    border-radius:12px!important;
  }
  body.localized-site .locale-filter-status{font-size:12px!important;margin:8px 0 14px!important}
  body.localized-site .locale-grid{gap:12px!important}
  body.localized-site .locale-grid .locale-card{
    border-radius:19px!important;
    background:linear-gradient(135deg,#0C211A,#091514)!important;
  }
  body.localized-site .locale-grid .locale-card .locale-card-link{
    padding:15px!important;gap:9px!important;
  }
  body.localized-site .locale-grid .locale-card .locale-card-title{
    font-size:15px!important;line-height:1.28!important;
  }
  body.localized-site .locale-grid .locale-card .locale-card-cta{
    min-height:42px;
    padding:9px 13px!important;
    font-size:12px!important;
    border-radius:12px!important;
  }
  /* Compact and scrollable, with no giant menu overlay on the screen. */
  body .site-nav #menu.menu.show{
    box-sizing:border-box;
    top:calc(100% + 8px)!important;
    right:0!important;
    width:min(310px,calc(100vw - 36px))!important;
    max-width:calc(100vw - 36px)!important;
    max-height:min(72dvh,600px)!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
    padding:8px!important;
    border:1px solid #315B48!important;
    border-radius:18px!important;
    background:#0B1518!important;
    box-shadow:0 17px 50px #000C!important;
  }
  body .site-nav #menu.menu.show a{
    display:flex!important;align-items:center!important;
    gap:8px!important;
    min-height:42px!important;
    padding:8px 11px!important;
    margin:0!important;
    border-radius:10px!important;
    font-size:13px!important;
    font-weight:680!important;
    line-height:1.25!important;
  }
  body .site-nav #menu.menu.show .menu-icon{
    flex:0 0 23px!important;
    font-size:17px!important;
    text-align:center!important;
  }
  body .site-nav #menu.menu.show .menu-arrow{
    margin-left:auto!important;
    color:#5BEAA0!important;
  }
  body .site-nav #menu.menu.show .menu-separator{margin:5px 8px!important}
  /* Smaller, native plus/minus footer rows. */
  body :is(footer.site-footer,footer#site-footer) .foot{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    gap:9px!important;
  }
  body :is(footer.site-footer,footer#site-footer) .foot>div:first-child{
    padding:0 5px 8px!important;
  }
  body :is(footer.site-footer,footer#site-footer) .foot>div:first-child .footer-brand img{
    height:40px!important;max-width:165px!important;
  }
  body :is(footer.site-footer,footer#site-footer) .foot>div:first-child p{
    font-size:12px!important;
    line-height:1.5!important;
    margin-top:4px!important;
  }
  body :is(footer.site-footer,footer#site-footer) .foot>div.footer-accordion{
    padding:7px 12px!important;
    border:1px solid #245341!important;
    border-radius:16px!important;
    background:#0C201A!important;
    box-shadow:none!important;
  }
  body :is(footer.site-footer,footer#site-footer) .foot>div.footer-accordion>h2{
    min-height:43px!important;margin:0!important;
    font-size:15px!important;
    gap:9px!important;
  }
  body :is(footer.site-footer,footer#site-footer) .foot>div.footer-accordion>h2::before{
    content:"+"!important;
    flex:0 0 28px!important;
    width:28px!important;height:28px!important;
    border-radius:9px!important;
    font-size:17px!important;
  }
  body :is(footer.site-footer,footer#site-footer) .foot>div.footer-accordion:nth-child(3)>h2::before{content:"✧"!important}
  body :is(footer.site-footer,footer#site-footer) .foot .footer-accordion-toggle{
    min-height:43px!important;
    font-size:14px!important;
    font-weight:800!important;
  }
  body :is(footer.site-footer,footer#site-footer) .foot .footer-accordion-symbol{
    width:29px!important;height:29px!important;flex-basis:29px!important;
    border-radius:9px!important;font-size:20px!important;
  }
  body :is(footer.site-footer,footer#site-footer) .foot>div.footer-accordion:not(.is-open)>a{
    display:none!important;
  }
  body :is(footer.site-footer,footer#site-footer) .foot>div.footer-accordion.is-open>a{
    min-height:40px!important;
    font-size:12px!important;
    padding:6px 4px!important;
  }
  body :is(footer.site-footer,footer#site-footer) .credit{
    margin-top:12px!important;
    padding-top:12px!important;
    font-size:11px!important;
    gap:7px!important;
  }
  body :is(footer.site-footer,footer#site-footer){
    margin-top:30px!important;padding-top:22px!important;padding-bottom:35px!important;
  }
  /* Remove repeated Telegram footers; the existing home channel banner and menu link stay. */
  body footer.site-footer>div:has(>a[href="https://t.me/AppDropDeals"]),
  body footer#site-footer>div:has(>a[href="https://t.me/AppDropDeals"]){
    display:none!important;
  }
  /* Detail pages: section headings and links must never share a 4-column row. */
  body.localized-site article.app-detail-redesign nav.locale-related{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:9px!important;
    align-items:stretch!important;
    width:100%!important;
    height:auto!important;
    margin:14px 0 25px!important;
    padding:16px!important;
    box-sizing:border-box;
    border:1px solid #2A6248;
    border-radius:18px;
    background:linear-gradient(140deg,#0E281E,#081714);
  }
  body.localized-site article.app-detail-redesign nav.locale-related>h2{
    grid-column:1/-1!important;
    min-width:0!important;
    max-width:100%!important;
    width:auto!important;
    margin:0 0 4px!important;
    font-size:19px!important;
    line-height:1.3!important;
    overflow-wrap:normal!important;
    color:#F2FFF8;
  }
  body.localized-site article.app-detail-redesign nav.locale-related>a{
    min-width:0!important;
    min-height:44px!important;
    padding:11px 12px!important;
    border:1px solid #2A7852!important;
    border-radius:11px!important;
    background:#103626!important;
    text-decoration:none!important;
    color:#C9FBDD!important;
    font-size:12px!important;
    font-weight:740!important;
    line-height:1.4!important;
    overflow-wrap:anywhere;
  }
  body.localized-site article.app-detail-redesign .locale-panel{
    margin:12px 0!important;padding:17px!important;
    border-radius:18px!important;
  }
  body.localized-site article.app-detail-redesign .locale-panel h2{
    font-size:20px!important;line-height:1.23!important;
  }
  body.localized-site article.app-detail-redesign .locale-information .locale-facts{
    gap:10px!important;
  }
  body.localized-site article.app-detail-redesign .locale-bottom-cta{margin:12px 0!important}
  body:has(.deal-page) .deal-related-section .section-heading{
    display:flex!important;
    flex-wrap:wrap!important;
    align-items:flex-start!important;
    justify-content:space-between!important;
    gap:9px!important;
  }
  body:has(.deal-page) .deal-related-section .related-grid{
    grid-template-columns:minmax(0,1fr)!important;
    gap:10px!important;
  }
  body:has(.deal-page) .deal-related-section .related-card{
    min-width:0!important;
    max-width:100%!important;
    overflow-wrap:anywhere;
  }
  body:has(.deal-page) .sticky-cta{
    bottom:max(9px,env(safe-area-inset-bottom))!important;
    width:calc(100% - 20px)!important;
    min-height:57px!important;
    padding:7px 9px!important;
    border-radius:17px!important;
    background:rgba(5,15,14,.95)!important;
  }
  body:has(.deal-page) .sticky-cta>.store{
    min-height:44px!important;
    font-size:12px!important;
    border-radius:12px!important;
  }
  body:has(.deal-page) .sticky-cta-spacer{height:95px!important}
}
@media(max-width:360px){
  body.localized-site article.app-detail-redesign nav.locale-related{grid-template-columns:minmax(0,1fr)!important}
  body.localized-site nav.appdrop-resource-links{grid-template-columns:minmax(0,1fr)!important}
}
