/* v893 — MOBILE ONLY foundation safety layer
   Scope: public/customer pages. Desktop remains untouched. */

@media (max-width: 1080px){
  html, body{max-width:100%; overflow-x:hidden;}

  /* Any article/sidebar page becomes one safe column on tablet/mobile. */
  .price-xxx-layout-v871,
  .visa-req-xxx-layout-v872,
  .refund-guide-layout-v879,
  .privacy-guide-layout-v880,
  .booking-guide-layout-v878,
  .check-redo-layout-v881,
  .useful-guide-shell-v890,
  .article-layout,
  .guide-layout,
  .content-sidebar-layout,
  .vge-article-layout,
  [class*="-layout-v"][class*="sidebar"],
  main .container:has(> aside){
    grid-template-columns:1fr !important;
    width:min(100%, calc(100vw - 24px)) !important;
    max-width:100% !important;
    gap:18px !important;
  }

  /* Desktop sidebar rail becomes a non-sticky mobile support summary. */
  aside.emergency-sidebar-v787FR,
  .price-xxx-sidebar-v871,
  .visa-req-xxx-sidebar-v872,
  .refund-guide-sidebar-v879,
  .privacy-guide-sidebar-v880,
  .booking-guide-sidebar-v878,
  .check-redo-sidebar-v881,
  .useful-guide-emergency-sidebar-v890,
  [class*="sidebar"]{
    position:static !important;
    top:auto !important;
    width:100% !important;
    min-width:0 !important;
    max-width:100% !important;
    grid-column:1 / -1 !important;
    align-self:stretch !important;
    margin-top:14px !important;
    z-index:1 !important;
  }

  aside.emergency-sidebar-v787FR{
    display:grid !important;
    gap:12px !important;
  }
  aside.emergency-sidebar-v787FR .emergency-side-box-v787FR{
    border-radius:0 !important;
    box-shadow:none !important;
    padding:14px !important;
    overflow:hidden !important;
  }
  aside.emergency-sidebar-v787FR .emergency-side-box-v787FR h3{
    font-size:17px !important;
    margin-bottom:10px !important;
  }
  aside.emergency-sidebar-v787FR .emergency-side-box-v787FR p,
  aside.emergency-sidebar-v787FR .emergency-side-box-v787FR li,
  aside.emergency-sidebar-v787FR .emergency-side-box-v787FR label{
    font-size:13px !important;
    line-height:1.55 !important;
  }
}

@media (max-width: 768px){
  /* Global mobile width safety. */
  *, *::before, *::after{box-sizing:border-box;}
  body{min-width:0 !important;}
  img, svg, video, canvas{max-width:100% !important; height:auto;}
  iframe{max-width:100% !important;}

  .container,
  .page-container,
  main > section > .container,
  header > .container,
  footer > .container,
  [class*="container"]{
    max-width:100% !important;
    padding-left:16px !important;
    padding-right:16px !important;
  }

  main, section, article, header, footer, .section,
  [class*="main"], [class*="article"], [class*="content"], [class*="rail"]{
    max-width:100% !important;
    min-width:0 !important;
    overflow-wrap:break-word !important;
  }

  /* Typography downshift for mobile. */
  h1{font-size:clamp(30px, 9vw, 42px) !important; line-height:1.12 !important;}
  h2{font-size:clamp(24px, 7vw, 34px) !important; line-height:1.16 !important;}
  h3{font-size:clamp(18px, 5.5vw, 24px) !important; line-height:1.22 !important;}
  p, li{font-size:15px; line-height:1.62;}

  /* Banners/hero images should not consume half the phone screen. */
  [class*="banner"], [class*="hero"] [class*="image"], [class*="hero"] [class*="visual"]{
    max-width:100% !important;
  }
  [class*="banner"] img,
  [class*="hero"] img{
    max-height:260px !important;
    object-fit:cover !important;
  }
  .price-xxx-banner-v871,
  .refund-guide-banner-v879,
  .privacy-guide-banner-v880,
  .visa-req-hero-banner-v886{
    height:auto !important;
    min-height:0 !important;
  }
  .price-xxx-banner-v871 img,
  .refund-guide-banner-v879 img,
  .privacy-guide-banner-v880 img,
  .visa-req-hero-banner-v886 img{
    aspect-ratio:16/6.2 !important;
    width:100% !important;
    height:auto !important;
    max-height:240px !important;
  }

  /* Tables: never cut off columns; scroll inside the table box. */
  .fees-matrix-wrap-v787DN,
  .urgent-table-wrap,
  .visa-req-table-wrap-v886,
  .refund-guide-table-wrap-v879,
  .privacy-guide-table-wrap-v880,
  .booking-guide-table-wrap-v878,
  .requirement-table-wrap-v510G,
  .table-wrap,
  .table-responsive,
  [class*="table-wrap"],
  [class*="matrix-wrap"],
  [class*="table-responsive"]{
    width:100% !important;
    max-width:100% !important;
    overflow-x:auto !important;
    overflow-y:hidden !important;
    -webkit-overflow-scrolling:touch !important;
    border-radius:0 !important;
  }
  .fees-matrix-wrap-v787DN::before,
  .urgent-table-wrap::before,
  .visa-req-table-wrap-v886::before,
  .refund-guide-table-wrap-v879::before,
  .privacy-guide-table-wrap-v880::before,
  .booking-guide-table-wrap-v878::before,
  .requirement-table-wrap-v510G::before,
  [class*="table-wrap"]::before,
  [class*="matrix-wrap"]::before{
    content:"Swipe sideways to view all columns";
    display:block;
    padding:8px 10px;
    font-size:12px;
    line-height:1.3;
    color:#0b63ce;
    background:#f4f8ff;
    border:1px solid #d7e5f7;
    border-bottom:0;
    font-weight:700;
  }
  table{
    max-width:none !important;
    border-collapse:collapse;
  }
  .fees-matrix-v787DN,
  .visa-req-table-v886,
  .refund-guide-table-v879,
  .privacy-guide-table-v880,
  .booking-guide-table-v878,
  .requirement-table-v510G,
  [class*="table"] table,
  [class*="matrix"]{
    min-width:680px !important;
  }
  th, td{
    white-space:normal !important;
    overflow-wrap:break-word !important;
  }

  /* Multi-column cards/grids collapse safely. */
  .grid.two,
  .grid.three,
  [class*="grid"],
  [class*="columns"],
  [class*="two-col"],
  [class*="three-col"]{
    grid-template-columns:1fr !important;
    max-width:100% !important;
  }

  /* Forms/checkers/selects must not exceed the screen. */
  form,
  .fee-card,
  .visa-checker-box,
  .check-redo-card-v881,
  [class*="checker"],
  [class*="form"]{
    max-width:100% !important;
    min-width:0 !important;
  }
  input, select, textarea, button{
    max-width:100% !important;
  }
  input:not([type="checkbox"]):not([type="radio"]),
  select, textarea{
    width:100% !important;
    min-height:44px;
  }
  .hero-actions,
  [class*="actions"],
  [class*="button-row"]{
    flex-wrap:wrap !important;
    gap:10px !important;
  }
  .hero-actions .btn,
  [class*="actions"] .btn,
  button,
  .btn{
    max-width:100% !important;
  }

  /* Mobile sidebar summary: keep first key boxes, hide very long extra rail content. */
  aside.emergency-sidebar-v787FR .emergency-side-box-v787FR:nth-of-type(n+4){
    display:none !important;
  }
  aside.emergency-sidebar-v787FR .emergency-side-btn-v787FR{
    width:100% !important;
    min-height:42px !important;
  }

  /* Floating chat should not cover bottom CTA/content. */
  .vge-floating-contact-v787,
  .floating-contact,
  .need-help-floating,
  [class*="floating"]{
    max-width:calc(100vw - 24px) !important;
  }
  body{padding-bottom:88px;}
}

@media (max-width: 480px){
  .container,
  .page-container,
  main > section > .container,
  header > .container,
  footer > .container,
  [class*="container"]{
    padding-left:12px !important;
    padding-right:12px !important;
  }
  h1{font-size:clamp(28px, 10vw, 38px) !important;}
  h2{font-size:clamp(22px, 8vw, 30px) !important;}
  p, li{font-size:14.5px;}
  .btn, button, input, select, textarea{font-size:15px !important;}
  .fees-matrix-v787DN,
  .visa-req-table-v886,
  .refund-guide-table-v879,
  .privacy-guide-table-v880,
  .booking-guide-table-v878,
  .requirement-table-v510G,
  [class*="table"] table,
  [class*="matrix"]{
    min-width:620px !important;
  }
}
