/* Waydev mobile dashboard and Ask Waydev treatment.
   Loaded after the existing sidebar and dashboard CSS; draft only. */
@media (max-width:1050px){
  /* The current right-rail grid unnecessarily compresses the dashboard. */
  #homepage_hero .wd-ai-hero-container{
    transform:none!important;
    margin-left:auto!important;margin-right:auto!important;
    width:calc(100% - 20px)!important;max-width:none!important;
    overflow:visible!important;
  }
  #homepage_hero .wd-home-workspace,
  #homepage_hero .wd-home-workspace.is-ask-collapsed,
  #homepage_hero .wd-home-workspace.is-ask-mobile-open{
    display:block!important;grid-template-columns:minmax(0,1fr)!important;
    width:100%!important;max-width:100%!important;overflow:visible!important;
  }
  #homepage_hero .wd-home-workspace-main{width:100%!important;min-width:0!important}
  #homepage_hero .wd-home-workspace-main .wd-ai-overview{width:100%!important;max-width:100%!important}
  #homepage_hero .wd-ask-panel{
    width:auto!important;max-width:none!important;
    min-height:0!important;height:auto!important;
    background:transparent!important;border:0!important;
    position:static!important;
  }
  /* Collapsed dock is always a real mobile CTA, never a 510px sidebar. */
  #homepage_hero .wd-home-workspace:not(.is-ask-mobile-open) .wd-ask-rail{
    display:flex!important;position:fixed!important;
    right:max(15px,env(safe-area-inset-right))!important;
    bottom:max(20px,calc(env(safe-area-inset-bottom) + 14px))!important;
    width:61px!important;height:61px!important;min-height:0!important;
    z-index:10011!important;box-shadow:0 8px 30px #163C7B46!important;
    background:#176FED!important;border:2px solid #FFF!important;
    border-radius:50%!important;overflow:hidden!important;
    align-items:center!important;justify-content:center!important;
  }
  #homepage_hero .wd-ask-rail-open{height:100%!important;padding:0!important;gap:0!important;justify-content:center!important;color:#FFF!important}
  #homepage_hero .wd-ask-rail-spark{width:auto!important;height:auto!important;line-height:1!important;background:none!important;border:0!important;color:#FFF!important;font-size:29px!important}
  #homepage_hero .wd-ask-rail-label{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip-path:inset(50%)!important;white-space:nowrap!important}
  /* Open chat is an independent sheet, not part of the grid. */
  #homepage_hero .wd-home-workspace.is-ask-mobile-open .wd-ask-panel{
    position:fixed!important;inset:0 0 0 auto!important;
    width:min(430px,100vw)!important;
    height:100vh!important;height:100dvh!important;
    min-height:0!important;max-height:100dvh!important;
    z-index:10020!important;border-left:1px solid #D4E1F0!important;
    border-top:0!important;background:#FFF!important;
    box-shadow:-10px 0 35px #00152D2E!important;
    overflow:hidden!important;
  }
  #homepage_hero .wd-home-workspace.is-ask-mobile-open .wd-ask-open{
    display:flex!important;flex-direction:column!important;
    height:100%!important;min-height:0!important;max-height:100%!important;
  }
  #homepage_hero .wd-home-workspace.is-ask-mobile-open .wd-ask-rail{display:none!important}
  #homepage_hero .wd-home-workspace.is-ask-mobile-open .wd-ask-header{
    height:56px!important;min-height:56px!important;flex-shrink:0!important;
    padding:0 12px!important;
  }
  #homepage_hero .wd-home-workspace.is-ask-mobile-open .wd-ask-header-actions button{
    width:37px!important;height:39px!important;
  }
  #homepage_hero .wd-home-workspace.is-ask-mobile-open .wd-ask-transcript{
    flex:1 1 auto!important;height:auto!important;min-height:0!important;
    overflow-y:auto!important;overscroll-behavior:contain!important;
    -webkit-overflow-scrolling:touch!important;
    padding:16px!important;
  }
  #homepage_hero .wd-home-workspace.is-ask-mobile-open .wd-ask-bottom{
    flex:0 0 auto!important;min-width:0!important;
    max-height:min(51dvh,490px)!important;overflow-y:auto!important;
    overscroll-behavior:contain!important;
    padding:10px 13px max(14px,env(safe-area-inset-bottom))!important;
    box-shadow:0 -10px 30px #15315A0C!important;
  }
  #homepage_hero .wd-ask-compose textarea{
    font-size:16px!important; /* Prevent iOS zoom-on-focus */
    line-height:1.45!important;
  }
  #homepage_hero .wd-ask-suggestions button{min-height:44px!important}
  #homepage_hero .wd-ask-mode-row button{min-height:48px!important}
  #homepage_hero .wd-ask-disclaimer{font-size:9px!important}
  #homepage_hero .wd-ask-welcome{padding-top:24px!important}
  #homepage_hero .wd-ai-overview .wd-ai-filters{
    display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:7px!important;
  }
  #homepage_hero .wd-ai-overview .wd-ai-filters label{
    flex:initial!important;min-width:0!important;width:100%!important;
  }
  #homepage_hero .wd-ai-overview .wd-ai-filters select{width:100%!important}
  #homepage_hero .wd-ai-overview .wd-ai-settings{min-height:44px!important}
  #homepage_hero .wd-ai-overview .wd-ai-chartgrid{grid-template-columns:minmax(0,1fr)!important}
  #homepage_hero .wd-ai-overview .wd-ai-chart-container{height:230px!important}
}
@media(max-width:640px){
  #homepage_hero .wd-ai-hero-container{width:calc(100% - 14px)!important}
  #homepage_hero .wd-ai-overview .wd-ai-body{padding:11px!important}
  #homepage_hero .wd-ai-overview .wd-ai-filters{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  #homepage_hero .wd-ai-overview .wd-ai-gauges{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important;
  }
  #homepage_hero .wd-ai-overview .wd-ai-gauge-card{
    flex-direction:column!important;align-items:center!important;text-align:center!important;
    min-height:160px!important;padding:14px 8px!important;gap:11px!important;
  }
  #homepage_hero .wd-ai-overview .wd-ai-ring{
    flex:0 0 65px!important;width:65px!important;height:65px!important;
  }
  #homepage_hero .wd-ai-overview .wd-ai-card-info{align-items:center!important;gap:5px!important}
  #homepage_hero .wd-ai-overview .wd-ai-card-info strong{font-size:11px!important}
  #homepage_hero .wd-ai-overview .wd-ai-card-info small{font-size:9px!important}
  #homepage_hero .wd-ai-overview .wd-ai-microkpis{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important;
  }
  #homepage_hero .wd-ai-overview .wd-ai-microkpis button{padding:12px 6px!important;min-height:100px!important}
  #homepage_hero .wd-ai-overview .wd-ai-microkpis strong{font-size:21px!important}
  #homepage_hero .wd-ai-overview .wd-ai-section-heading h3{font-size:20px!important}
  #homepage_hero .wd-ai-overview .wd-ai-panel-header{
    flex-wrap:wrap!important;gap:9px!important;padding:12px 12px 4px!important;
  }
  #homepage_hero .wd-ai-overview .wd-ai-chart-container{
    height:194px!important;margin:8px 11px 4px!important;
  }
  #homepage_hero .wd-ai-overview .wd-ai-chart-container svg{min-width:0!important}
  #homepage_hero .wd-ai-overview .wd-ai-legend{padding:9px 10px!important;gap:8px!important}
  #homepage_hero .wd-ai-overview .wd-ai-legend button{font-size:9px!important;min-height:24px!important}
  #homepage_hero .wd-ai-overview .wd-ai-bottomdata{padding:14px!important}
  #homepage_hero .wd-ai-overview .wd-ai-bottomdata svg{max-width:100%!important}
  #homepage_hero .wd-ai-overview .wd-ai-accordion-toggle{padding:12px!important;gap:7px!important}
  #homepage_hero .wd-ai-overview .wd-ai-accordion-toggle strong{font-size:12px!important}
  #homepage_hero .wd-ai-overview .wd-ai-running{font-size:9px!important}
  #homepage_hero .wd-ask-header-brand{font-size:13px!important}
}
@media(max-width:420px){
  #homepage_hero .wd-ai-overview .wd-ai-gauges{gap:6px!important}
  #homepage_hero .wd-ai-overview .wd-ai-gauge-card{min-height:154px!important}
  #homepage_hero .wd-ask-mode-row button{font-size:9px!important}
  #homepage_hero .wd-ask-suggestions button{font-size:12px!important}
  #homepage_hero .wd-ask-welcome h3{font-size:18px!important}
}
@media(prefers-reduced-motion:no-preference){
  #homepage_hero .wd-home-workspace.is-ask-mobile-open .wd-ask-panel{animation:wd-ask-slide-in .2s ease-out both}
  @keyframes wd-ask-slide-in{from{opacity:.85;transform:translateX(12px)}to{opacity:1;transform:translateX(0)}}
}
body.wd-ask-scroll-lock{overflow:hidden!important}
.wd-ask-mobile-backdrop{position:fixed;inset:0;z-index:9990;background:rgba(8,20,38,.45);display:none}
@media(min-width:741px) and (max-width:1050px){.wd-ask-mobile-backdrop.is-visible{display:block}}

/* Mobile horizontal-scroll regression: homepage hero and workspace must never
   expand the document or drift away from the visible viewport. */
@media(max-width:767px){
  html{
    width:100%!important;max-width:100%!important;
    overflow-x:hidden!important;overscroll-behavior-x:none!important;
    touch-action:pan-y!important;
  }
  body.home{
    width:100%!important;max-width:100%!important;
    margin:0!important;overflow-x:hidden!important;
    overscroll-behavior-x:none!important;touch-action:pan-y!important;
  }
  body.home #header,body.home #homepage_hero{
    width:100%!important;max-width:100%!important;margin-left:0!important;
    margin-right:0!important;box-sizing:border-box!important;
  }
  body.home #homepage_hero{
    overflow-x:clip!important;overscroll-behavior-x:none!important;
  }
  body.home #homepage_hero .hero_wrapper{
    display:block!important;box-sizing:border-box!important;
    width:100%!important;max-width:100%!important;min-width:0!important;
    padding-left:16px!important;padding-right:16px!important;
    margin-left:auto!important;margin-right:auto!important;
    overflow:visible!important;
  }
  body.home #homepage_hero .small-news-group__wrapper{
    max-width:100%!important;width:100%!important;min-width:0!important;
    padding:0!important;overflow:hidden!important;
  }
  body.home #homepage_hero .small-news-group{
    display:block!important;max-width:100%!important;
    white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;
    box-sizing:border-box!important;
  }
  body.home #homepage_hero .hero_title{
    width:100%!important;max-width:100%!important;min-width:0!important;
    margin:16px auto 21px!important;box-sizing:border-box!important;
    font-size:clamp(30px,8.2vw,42px)!important;
    line-height:1.14!important;letter-spacing:-.045em!important;
    text-align:center!important;white-space:normal!important;
  }
  body.home #homepage_hero .hero_title .hero-tooltip{
    display:block!important;width:100%!important;max-width:100%!important;
    min-width:0!important;white-space:normal!important;
    overflow-wrap:break-word!important;word-break:normal!important;
  }
  body.home #homepage_hero .hero_title .wd-home-hero-break{display:none!important}
  body.home #homepage_hero .hp-top-subtitle{
    display:block!important;box-sizing:border-box!important;
    width:100%!important;max-width:100%!important;min-width:0!important;
    padding:0 2px!important;margin:0 auto 25px!important;
    font-size:clamp(15px,4.1vw,18px)!important;
    line-height:1.55!important;text-align:center!important;overflow-wrap:break-word!important;
  }
  body.home #homepage_hero .wd-factory-hero-signals{
    box-sizing:border-box!important;width:100%!important;max-width:100%!important;
    margin-left:auto!important;margin-right:auto!important;padding:0!important;
    justify-content:center!important;
  }
  body.home #homepage_hero .hero_cta_btns{
    display:flex!important;flex-direction:column!important;align-items:stretch!important;
    box-sizing:border-box!important;width:100%!important;max-width:100%!important;min-width:0!important;
    padding:0 0 12px!important;margin:0 auto!important;gap:12px!important;
  }
  body.home #homepage_hero .hero_cta_btns .wbtn{
    box-sizing:border-box!important;width:100%!important;max-width:100%!important;
    white-space:normal!important;text-align:center!important;justify-content:center!important;
  }
  body.home #homepage_hero .wd-ai-hero-container{
    box-sizing:border-box!important;position:relative!important;
    width:100%!important;max-width:100%!important;min-width:0!important;
    transform:none!important;margin:12px auto 24px!important;
    left:auto!important;right:auto!important;
  }
  body.home #homepage_hero .wd-home-workspace,
  body.home #homepage_hero .wd-home-workspace-main,
  body.home #homepage_hero .wd-ai-overview{
    box-sizing:border-box!important;width:100%!important;max-width:100%!important;min-width:0!important;
    margin-left:0!important;margin-right:0!important;
  }
  body.home #homepage_hero .wd-ai-overview .wd-ai-filters,
  body.home #homepage_hero .wd-ai-overview .wd-ai-gauges,
  body.home #homepage_hero .wd-ai-overview .wd-ai-microkpis,
  body.home #homepage_hero .wd-ai-overview .wd-ai-chartgrid{
    width:100%!important;max-width:100%!important;min-width:0!important;
  }
  body.home #homepage_hero .wd-ai-overview :is(.wd-ai-panel,.wd-ai-chart-container,.wd-ai-bottomdata){
    max-width:100%!important;min-width:0!important;
  }
}

