/* VigVag UI 2.0 — unified mobile foundation */
:root{
  --vv-mobile-gutter:14px;
  --vv-mobile-header:60px;
  --vv-mobile-nav:72px;
}
.vv-mobile-header,.vv-mobile-bottom,.vv-mobile-drawers{display:none}

@media (max-width:1240px){
  html{scroll-padding-top:calc(var(--vv-mobile-header) + 12px)}
  body{background:#f4f6f8}
  body.vv-sheet-open{overflow:hidden}
  .vv-app{display:block;min-height:100dvh}
  .vv-main{width:100%;min-width:0;padding-bottom:calc(var(--vv-mobile-nav) + env(safe-area-inset-bottom) + 16px)!important}
  .vv-sidebar,.vv-topbar,.vv-floating-mobile-switch,.vv-mobile-top{display:none!important}

  .vv-mobile-header{
    display:flex;position:sticky;top:0;z-index:1000;height:calc(var(--vv-mobile-header) + env(safe-area-inset-top));
    padding:env(safe-area-inset-top) var(--vv-mobile-gutter) 0;align-items:center;justify-content:space-between;
    background:rgba(255,255,255,.94);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);
    border-bottom:1px solid rgba(15,23,42,.08)
  }
  .vv-mobile-brand{display:flex;align-items:center;gap:9px;min-width:0;font-size:18px;letter-spacing:.3px}
  .vv-mobile-brand-mark{width:34px;height:34px;border-radius:11px;display:grid;place-items:center;background:linear-gradient(135deg,var(--yellow),#ffb800);font-weight:1000;box-shadow:0 7px 18px rgba(255,191,0,.25)}
  .vv-mobile-header-actions{display:flex;align-items:center;gap:8px}
  .vv-mobile-create,.vv-mobile-icon,.vv-mobile-avatar{position:relative;width:36px;height:36px;border:0;border-radius:12px;display:grid;place-items:center;background:#f1f3f5;color:#111;font-weight:900;font-size:18px;cursor:pointer}
  .vv-mobile-create{background:var(--yellow);font-size:24px;line-height:1}
  .vv-mobile-avatar{background:#15191e;color:#fff;font-size:14px}
  .vv-mobile-icon .vv-dot{top:-5px;right:-5px}

  .vv-mobile-bottom{
    display:grid;grid-template-columns:repeat(5,1fr);position:fixed;left:0;right:0;bottom:0;z-index:950;
    min-height:calc(var(--vv-mobile-nav) + env(safe-area-inset-bottom));padding:7px 8px env(safe-area-inset-bottom);
    background:rgba(255,255,255,.96);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);
    border-top:1px solid rgba(15,23,42,.09);box-shadow:0 -10px 32px rgba(15,23,42,.08)
  }
  .vv-mobile-bottom a{min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;color:#68707d;font-weight:800}
  .vv-mobile-bottom a span{font-size:21px;line-height:1}
  .vv-mobile-bottom a small{font-size:10px;white-space:nowrap}
  .vv-mobile-bottom-create{transform:translateY(-13px)}
  .vv-mobile-bottom-create span{width:50px;height:50px;border-radius:17px;display:grid!important;place-items:center;background:var(--yellow);color:#111;font-size:29px!important;box-shadow:0 10px 24px rgba(255,191,0,.3)}
  .vv-mobile-bottom-create small{color:#111}

  .vv-mobile-drawers{display:block}
  .vv-mobile-sheet-backdrop{display:none;position:fixed;inset:0;z-index:1090;border:0;background:rgba(15,23,42,.42);backdrop-filter:blur(2px)}
  .vv-mobile-sheet{position:fixed;left:0;right:0;bottom:0;z-index:1100;transform:translateY(105%);transition:transform .24s ease;background:#fff;border-radius:24px 24px 0 0;padding:10px 18px calc(24px + env(safe-area-inset-bottom));box-shadow:0 -20px 60px rgba(15,23,42,.2);min-height:190px}
  .vv-mobile-sheet.open{transform:translateY(0)}
  .vv-mobile-sheet-backdrop.open{display:block}
  .vv-mobile-sheet-handle{width:44px;height:5px;border-radius:999px;background:#d7dbe0;margin:0 auto 14px}
  .vv-mobile-sheet .vv-drawer-head{padding:0 0 13px}
  .vv-mobile-sheet .vv-drawer-empty{padding:22px 0;color:var(--muted)}

  /* Unified page rhythm */
  .vv-page,.vv-post-layout,.vv-build-columns,.vv-trust-shell,.vv-admin-wrap,.vv-content-shell,.vv-search-page,.vv-form-page{
    width:100%!important;max-width:100%!important;margin:0!important;padding:14px var(--vv-mobile-gutter) 24px!important;min-width:0!important
  }
  .vv-page,.vv-home-page,.vv-post-layout,.vv-build-columns,.vv-trust-shell{display:block!important}
  .vv-content,.vv-right,.vv-post-content,.vv-post-side,.vv-build-main,.vv-build-side{width:100%!important;min-width:0!important;position:static!important}
  .vv-section-head{gap:10px;align-items:flex-start;flex-wrap:wrap}
  .vv-section-head h1,.vv-section-head h2{line-height:1.15}

  /* Cards and controls */
  .vv-card,.vv-panel,.vv-side-card,.vv-market-card,.vv-build-card,.vv-profile-hero,.vv-post-gallery,.vv-post-title-card,.vv-author-card,.vv-response-box,.vv-company-card,.vv-specialist-card,.vv-row{
    border-radius:18px!important;box-shadow:0 8px 24px rgba(15,23,42,.055)!important
  }
  .vv-market-grid,.vv-build-grid,.vv-benefits,.vv-category-strip,.vv-similar-grid,.vv-stat-grid,.vv-profile-stats2,.vv-badge-grid,.vv-stage-grid,.vv-build-action-grid{
    grid-template-columns:1fr!important;gap:12px!important
  }
  .vv-market-card,.vv-build-card{overflow:hidden}
  .vv-card-photo{height:210px!important;min-height:210px;background-position:center;background-size:cover}
  .vv-market-card-body{padding:14px!important}
  .vv-market-card h3{font-size:18px!important;line-height:1.25;margin-bottom:9px!important}
  .vv-price{font-size:20px!important}
  .vv-btn{min-height:46px;border-radius:14px}
  .vv-input,input,textarea,select{max-width:100%;font-size:16px!important}
  .vv-form,.vv-form.two{grid-template-columns:1fr!important}
  .vv-form .full{grid-column:auto}

  /* Scrollers instead of squeezed category grids */
  .vv-category-strip{display:flex!important;overflow-x:auto!important;gap:10px!important;margin-left:calc(var(--vv-mobile-gutter) * -1)!important;margin-right:calc(var(--vv-mobile-gutter) * -1)!important;padding:2px var(--vv-mobile-gutter) 8px!important;scroll-snap-type:x proximity;-webkit-overflow-scrolling:touch;scrollbar-width:none}
  .vv-category-strip::-webkit-scrollbar{display:none}
  .vv-category-card{flex:0 0 168px!important;scroll-snap-align:start}

  /* Post page */
  .vv-post-layout{padding-bottom:28px!important}
  .vv-post-gallery{overflow:hidden}
  .vv-gallery-main,.vv-post-main-photo{height:min(74vw,360px)!important;min-height:230px!important}
  .vv-gallery-main img,.vv-gallery-main video,.vv-post-main-photo img{object-fit:cover!important}
  .vv-post-title-card{padding:16px!important;margin-top:12px!important}
  .vv-post-title-card h1{font-size:clamp(24px,7vw,31px)!important;overflow-wrap:anywhere}
  .vv-post-price{font-size:27px!important}
  .vv-author-link{grid-template-columns:50px minmax(0,1fr)!important}

  /* Profile and tables */
  .vv-profile-hero{grid-template-columns:64px minmax(0,1fr)!important;align-items:start}
  .vv-profile-avatar{width:64px;height:64px}
  .vv-profile-hero>:last-child{grid-column:1/-1;width:100%}
  .vv-row{align-items:flex-start;flex-direction:column}
  .vv-table-list{overflow:visible}
  table{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}

  /* Map */
  .vv-map,.vv-map-shell,.vv-activity-map{width:100%!important;max-width:100%!important;border-radius:18px!important;overflow:hidden}
  .vv-activity-map{height:300px!important;min-height:300px!important}
  .maplibregl-control-container,.leaflet-control-container{font-size:13px}

  /* Defensive overflow fixes */
  img,video,iframe,canvas,svg{max-width:100%}
  pre,code{white-space:pre-wrap;overflow-wrap:anywhere}
  h1,h2,h3,p,a,span{overflow-wrap:anywhere}
  [style*="width:"]{max-width:100%}
}

@media (max-width:560px){
  :root{--vv-mobile-gutter:12px}
  .vv-mobile-brand b{font-size:17px}
  .vv-mobile-header-actions{gap:6px}
  .vv-mobile-create,.vv-mobile-icon,.vv-mobile-avatar{width:34px;height:34px}
  .vv-hero{min-height:280px!important;border-radius:0!important;margin-left:calc(var(--vv-mobile-gutter) * -1);margin-right:calc(var(--vv-mobile-gutter) * -1)}
  .vv-hero h1{font-size:31px!important}
  .vv-card-photo{height:195px!important;min-height:195px}
  .vv-category-card{flex-basis:155px!important}
}

@media (prefers-reduced-motion:reduce){
  .vv-mobile-sheet{transition:none}
}
@media (max-width:1240px){.vv-mobile-bottom a.active{color:#111}.vv-mobile-bottom a.active:not(.vv-mobile-bottom-create) span{background:#fff4bf;border-radius:12px;padding:6px 11px;margin:-6px -11px}}
