/* CiviHelv · Mobile rendering guard 2026-11-22.
   Applies to every public HTML route, independently of language or module.
   Avoid large fixed/blurred compositing layers that show vertical GPU stripes
   on Android WebView/Samsung Internet; preserve photographs and functionality. */
@media screen and (max-width:820px){
  html,body{
    box-sizing:border-box;
    min-width:0;
    max-width:100%;
    overflow-x:clip;
  }
  body{background-attachment:scroll!important}
  body.ch-cinema{
    background:#061730!important;
    background-color:#061730!important;
    background-image:none!important;
    background-attachment:scroll!important;
  }
  body.ch-cinema::before,body.ch-cinema::after{
    content:none!important;
    display:none!important;
    background:none!important;
    -webkit-backdrop-filter:none!important;
    backdrop-filter:none!important;
  }
  :is(main,section,article,aside,header,footer,.wrap,.filters,.grid,.panel,.card,.hero,
      .ch-future-region,.ch-home-dashboard,.ch-category-explorer,.ch-category-window,
      .ch-flight-hero,.ch-flight-panel,.ch-tax-hub,.ch-tax-hub-choice){
    min-width:0;
    box-sizing:border-box;
  }
  :is(main,.wrap,.hero,.ch-flight-panel,.ch-flight-hero,.ch-home-dashboard,
      .ch-category-explorer,.ch-category-window,.filter-panel){
    max-width:100%;
  }
  :is(.ch-home-dashboard,.ch-category-explorer,.ch-category-window,
      .ch-flight-panel,.ch-flight-hero,.ch-tax-hub,.ch-tax-hub-choice,
      .filter-panel,.national-directory,.source-card,.ch-svc,.tile,.panel){
    background-attachment:scroll!important;
    -webkit-backdrop-filter:none!important;
    backdrop-filter:none!important;
  }
  :is(img,video,iframe,canvas,svg){max-width:100%}
  :is(.ch-svc,.ch-category-window,.ch-category-choice,.ch-flight-hero,
      .ch-flight-panel,.filter-panel,.ch-tax-hub-choice,.source-card,.panel,
      .national-directory){
    -webkit-mask-image:none!important;
    mask-image:none!important;
    mix-blend-mode:normal!important;
  }
  /* Paint the known defective panel surfaces with opaque fills. The images are
     separate <img> elements and therefore stay visible in their original size. */
  .ch-category-window[open],
  .ch-category-window[open] .ch-category-panel,
  .ch-category-window[open] .ch-category-services,
  .ch-category-window[open] .ch-svc{
    background:#082343!important;
    background-image:none!important;
    filter:none!important;
  }
  .ch-category-window[open] .ch-svc{
    border-color:#3bd9f0!important;
    overflow:hidden!important;
    transform:none!important;
  }
  .ch-category-window[open] .ch-svc img{
    display:block;
    position:relative;
    max-width:100%!important;
    height:auto;
    object-fit:contain!important;
    filter:none!important;
    -webkit-mask-image:none!important;
    mask-image:none!important;
  }
  body:has(.visa-quicknav) .hero{
    background:#0b2449!important;
    background-image:none!important;
    filter:none!important;
    -webkit-backdrop-filter:none!important;
    backdrop-filter:none!important;
  }
  body:has(.visa-quicknav) .hero img{height:auto!important;object-fit:contain!important}
  body:has(#canton) .filter-panel{
    background:#0b2446!important;
    background-image:none!important;
  }
  body:has(#canton) .hero{background-attachment:scroll!important}
  .ch-flight-hero,.ch-flight-panel{
    background:#0b2346!important;
    background-image:none!important;
  }
  body:has(#civi-tax-app) .ch-tax-hub-choice,
  body:has(#civi-tax-app) .section,
  body:has(#civi-tax-app) .panel{
    background:#0c2546!important;
    background-image:none!important;
  }
  :is(h1,h2,h3,p,label,summary,.ch-svc,strong,small){
    overflow-wrap:break-word;
  }
  :is(input,select,textarea,button){max-width:100%;font-size:16px}
  /* Make the tax campaign a dismissible in-flow notice, not an overlay above
     insurance, tax, visa or flight form controls. */
  #tax-ribbon-2027{
    position:relative!important;
    top:auto!important;
    right:auto!important;
    bottom:auto!important;
    left:auto!important;
    z-index:auto!important;
    width:calc(100% - 24px)!important;
    max-width:700px!important;
    margin:12px auto!important;
  }
  /* CivilGPT remains available, compact and readable. It disappears while
     the visitor is typing so the keyboard and form controls remain clear. */
  .ch-ai-button{
    width:auto!important;
    max-width:104px!important;
    min-width:70px!important;
    min-height:43px!important;
    padding:9px 11px!important;
    right:10px!important;
    bottom:calc(12px + env(safe-area-inset-bottom,0px))!important;
    z-index:700!important;
    border-radius:22px!important;
    background:#0a3558!important;
    color:#ecfbff!important;
    box-shadow:0 2px 14px #00152c99!important;
    font:800 12px/1.2 system-ui,sans-serif!important;
  }
  body:has(:is(input,textarea,select):focus) .ch-ai-button,
  body:has(.ch-category-window[open]) .ch-ai-button{
    display:none!important;
  }
  .ch-ai-card{
    width:calc(100vw - 20px)!important;
    max-width:430px!important;
    right:10px!important;
    bottom:calc(67px + env(safe-area-inset-bottom,0px))!important;
    max-height:calc(100dvh - 90px)!important;
  }
  body:not([data-civi-ai-full]){padding-bottom:60px}
}
@media print{
  #tax-ribbon-2027,.ch-ai-button,.ch-ai-card:not([data-civi-ai-full]){
    display:none!important;
  }
}


/* 2026-11-22 · second-pass compositor remediation for ALL interior modules.
   Screenshots from Samsung Android proved that disabling the body wallpaper alone
   did not neutralize nested glass panels and the shared header. Keep approved HD
   hero photos, imagery, text and forms; flatten ONLY their surrounding surfaces. */
@media screen and (max-width:820px){
  /* Prevent GPU compositing artifacts, including dynamically inserted components. */
  html body *, html body *::before, html body *::after{
    -webkit-backdrop-filter:none!important;
    backdrop-filter:none!important;
    -webkit-mask-image:none!important;
    mask-image:none!important;
    background-attachment:scroll!important;
    mix-blend-mode:normal!important;
  }
  html body.ch-cinema :is(.ch-topbar,.ch-cinema-head,.ch-cinema-topbar,.top),
  html body.ch-future > header.ch-topbar{
    background:#071e3c!important;
    background-image:none!important;
    background-color:#071e3c!important;
    -webkit-backdrop-filter:none!important;
    backdrop-filter:none!important;
    filter:none!important;
    isolation:isolate!important;
  }
  html body.ch-cinema :is(.ch-topbar,.ch-cinema-head,.ch-cinema-topbar)::before,
  html body.ch-cinema :is(.ch-topbar,.ch-cinema-head,.ch-cinema-topbar)::after{
    display:none!important;content:none!important;
  }
  /* No photographic banners are targeted here. Native approved HD banner
     backgrounds on .hero/.ch-hero/.emp-hero/.cv2-hero remain intact. */
  html body.ch-cinema .ch-future-region,
  html body.ch-cinema .ch-future-region :is(.section,.card,.panel,.guide,.mini,.tile,.source,.national-directory),
  html body.ch-cinema :is(.ch-cat-browser,.ch-guide-search,.launch-trust,.ch-canton-details,.ch-gd-explorer,.filter-panel,.territory-panel,.ch-complaint-portal),
  html body.ch-future :is(.ch-category-explorer,.ch-category-window[open],.ch-home-dashboard),
  html body:has(#canton) .filter-panel{
    background:#0a2443!important;
    background-color:#0a2443!important;
    background-image:none!important;
    background-attachment:scroll!important;
    -webkit-backdrop-filter:none!important;
    backdrop-filter:none!important;
    filter:none!important;
  }
  html body.ch-cinema :is(.ch-future-region,.ch-home-dashboard,.ch-category-explorer,.ch-cat-browser,.ch-guide-search)::before,
  html body.ch-cinema :is(.ch-future-region,.ch-home-dashboard,.ch-category-explorer,.ch-cat-browser,.ch-guide-search)::after{
    content:none!important;display:none!important;
  }
  /* Standalone Navigator and visa module use their own styles, not ch-cinema. */
  html body:has(#situation){
    background:#06162e!important;
    background-image:none!important;
  }
  html body:has(#situation) :is(.top,.hero,.shell>.hero,.chnd-panel),
  html body:has(.visa-quicknav) .hero{
    background:#0b2443!important;
    background-image:none!important;
    -webkit-backdrop-filter:none!important;
    backdrop-filter:none!important;
  }
  html body:has(#situation) .top{position:relative!important;top:auto!important}
  /* Campaign banner remains readable and dismissible without dark striped
     overlays or obscuring a form. */
  html body #tax-ribbon-2027{
    background:#0b2b4b!important;
    background-image:none!important;
    -webkit-backdrop-filter:none!important;
    backdrop-filter:none!important;
    filter:none!important;
    box-shadow:none!important;
  }
  /* CivilGPT launcher was demonstrably covering selection fields and inputs.
     Keep it working at document end in normal flow instead of atop content. */
  html body .ch-ai-button{
    position:relative!important;
    inset:auto!important;
    top:auto!important;right:auto!important;bottom:auto!important;left:auto!important;
    display:flex!important;
    width:max-content!important;
    max-width:180px!important;
    min-width:90px!important;
    min-height:44px!important;
    margin:12px 15px 16px auto!important;
    padding:11px 16px!important;
    z-index:1!important;
    background:#0a3859!important;
    background-image:none!important;
    box-shadow:none!important;
    color:#eaffff!important;
  }
  html body:has(.ch-category-window[open]) .ch-ai-button,
  html body:has(:is(input,textarea,select):focus) .ch-ai-button{
    display:none!important;
  }
  html body .ch-ai-card:not([hidden]){
    position:fixed!important;
    z-index:900!important;
    left:10px!important;right:10px!important;
    top:auto!important;bottom:10px!important;
    max-width:calc(100vw - 20px)!important;
    width:calc(100vw - 20px)!important;
    max-height:calc(100dvh - 20px)!important;
    overflow-y:auto!important;
    background:#0a2546!important;
  }
  html body:not([data-civi-ai-full]){padding-bottom:0!important}
}
