/* v33: compact search drawer and approved two-column category layout at every size. */
#filters{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;max-height:none!important;overflow:visible!important}
#filters button{grid-column:auto!important;min-width:0!important;white-space:normal!important;line-height:1.1!important}
#drawer:not(.search-hidden){height:min(78vh,720px)!important;max-height:calc(100vh - 120px)!important;overflow:hidden!important}
@media (max-width:900px),(pointer:coarse){
  #drawer:not(.search-hidden){left:8px!important;right:8px!important;top:72px!important;bottom:auto!important;width:calc(100vw - 16px)!important;max-width:760px!important;height:min(78dvh,700px)!important;max-height:calc(100dvh - 94px)!important;border-radius:10px!important;border:1px solid #24352c!important;box-shadow:0 18px 40px rgba(0,0,0,.4)!important}
  #drawer:not(.search-hidden) #drawerClose{top:8px!important;right:10px!important}
  #filters{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  #categoryRail{top:156px!important}
  #categoryRestore{top:156px!important}
}

/* =====================================================================
   v34 fix — appended so this (last-loaded) stylesheet has final say.
   Root cause: v30-fixes.css strips the panel width cap for ANY window
   <=900px wide ("#drawer{width:auto;max-width:none}"), which is not a
   phone-only condition -- it fires on any moderately narrow desktop
   browser window too, making the search panel (and facility detail
   panel) balloon to near-full window width instead of keeping the
   proportioned/capped layout. This restores the intended capped
   "tablet/narrow-desktop" sizing (the same values v25-ui.css already
   defines for 431-900px) for genuine desktop widths, while leaving
   true phone widths (<=640px) on their existing full-bleed behavior.
   ===================================================================== */
@media (min-width:641px) and (max-width:900px){
  /* Selector must match #drawer:not(.search-hidden) above (same file,
     earlier in cascade) -- that :not() carries real specificity (as
     much as a class), so a plain "#drawer" selector here would silently
     lose to it regardless of appearing later in the file. Matching the
     selector exactly is what makes source order decide the winner. */
  #drawer:not(.search-hidden){
    left:8px!important;
    right:auto!important;
    top:92px!important;
    bottom:8px!important;
    width:min(var(--panel),calc(100vw - 16px))!important;
    max-width:var(--panel)!important;
    max-height:calc(100vh - 100px)!important;
    height:auto!important;
    border-radius:0!important;
  }
  #detail{
    left:auto!important;
    right:8px!important;
    top:8px!important;
    bottom:8px!important;
    width:min(var(--panel),calc(100vw - 16px))!important;
    max-width:var(--panel)!important;
    border-radius:14px!important;
  }
}

/* v35 fix: the legacy rule below v26-fixes.css forces the five named
   category buttons to span the full grid row. Match its specificity and
   reset each button so the approved two-column layout applies consistently. */
#filters button[data-filter="refineries"],
#filters button[data-filter="fuel-logistics"],
#filters button[data-filter="power"],
#filters button[data-filter="maritime"],
#filters button[data-filter="wildberries"]{grid-column:auto!important}
