/* v899 — Rendered-structure targeted mobile pass
   Desktop remains untouched. */

.vge-mobile-table-note-v899{display:none;}

@media (max-width: 768px){
  /* All known table wrappers from the static rendered-structure scan */
  body :where(
    .arrival-xxx-section-v829,
    .departure-xxx-section-v830,
    .evisa-card-v787GL,
    .speedup-section-content-v806,
    .correction-xxx-content-v828,
    .arrival-comparison-table-v512G,
    .visa-info-xxx-section-v835 > div,
    .emergency-article-v787FR
  ):has(> table){
    display:block !important;
    width:100% !important;
    max-width:100% !important;
    overflow-x:auto !important;
    overflow-y:hidden !important;
    -webkit-overflow-scrolling:touch !important;
    border:1px solid #d7e2f0 !important;
    background:#fff !important;
    box-sizing:border-box !important;
    margin:12px 0 16px !important;
  }

  body :where(
    .arrival-xxx-table-v829,
    .departure-xxx-table-v830,
    .evisa-table-v787GL,
    .speedup-simple-table-v827,
    .correction-xxx-table-v828,
    .emergency-summary-table-v787FR,
    .visa-info-xxx-simple-table-v835,
    .guide-table,
    .guide-seo-table-v517A,
    .exemption-table-v510G,
    .trust-voa-table-v799,
    .terms-xxx-table-v831,
    .privacy-guide-table-v880,
    .refund-guide-table-v879,
    .booking-guide-table-v878
  ){
    min-width:560px !important;
    width:max-content !important;
    max-width:none !important;
    table-layout:auto !important;
  }

  body :where(
    .arrival-xxx-table-v829,
    .departure-xxx-table-v830,
    .evisa-table-v787GL,
    .speedup-simple-table-v827,
    .correction-xxx-table-v828,
    .emergency-summary-table-v787FR,
    .visa-info-xxx-simple-table-v835,
    .guide-table,
    .guide-seo-table-v517A,
    .exemption-table-v510G,
    .trust-voa-table-v799,
    .terms-xxx-table-v831,
    .privacy-guide-table-v880,
    .refund-guide-table-v879,
    .booking-guide-table-v878
  ) th,
  body :where(
    .arrival-xxx-table-v829,
    .departure-xxx-table-v830,
    .evisa-table-v787GL,
    .speedup-simple-table-v827,
    .correction-xxx-table-v828,
    .emergency-summary-table-v787FR,
    .visa-info-xxx-simple-table-v835,
    .guide-table,
    .guide-seo-table-v517A,
    .exemption-table-v510G,
    .trust-voa-table-v799,
    .terms-xxx-table-v831,
    .privacy-guide-table-v880,
    .refund-guide-table-v879,
    .booking-guide-table-v878
  ) td{
    min-width:120px !important;
    vertical-align:top !important;
    overflow-wrap:break-word !important;
  }

  /* Give first column a readable sticky feel where possible, but not on narrow unknown tables */
  body :where(
    .fees-matrix-v787DN,
    .visa-req-table-v886,
    .trust-voa-table-v799,
    .exemption-table-v510G
  ) th:first-child,
  body :where(
    .fees-matrix-v787DN,
    .visa-req-table-v886,
    .trust-voa-table-v799,
    .exemption-table-v510G
  ) td:first-child{
    position:sticky !important;
    left:0 !important;
    z-index:2 !important;
    background:#fff !important;
    box-shadow:1px 0 0 #d7e2f0 !important;
  }

  body :where(
    .fees-matrix-v787DN,
    .visa-req-table-v886,
    .trust-voa-table-v799,
    .exemption-table-v510G
  ) thead th:first-child{
    z-index:3 !important;
    background:#f4f8ff !important;
  }

  /* Form pages found by scan */
  body :where(
    .aq-card.aq-form,
    .speedup-card,
    .finder-form,
    .missing-form,
    .order-layout,
    .check-redo-form-v881
  ){
    display:grid !important;
    grid-template-columns:1fr !important;
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    gap:12px !important;
    box-sizing:border-box !important;
  }

  body :where(
    .aq-card.aq-form,
    .speedup-card,
    .finder-form,
    .missing-form,
    .order-layout,
    .check-redo-form-v881
  ) > *{
    max-width:100% !important;
    min-width:0 !important;
    box-sizing:border-box !important;
  }

  body :where(
    .aq-card.aq-form,
    .speedup-card,
    .finder-form,
    .missing-form,
    .order-layout,
    .check-redo-form-v881
  ) input,
  body :where(
    .aq-card.aq-form,
    .speedup-card,
    .finder-form,
    .missing-form,
    .order-layout,
    .check-redo-form-v881
  ) select,
  body :where(
    .aq-card.aq-form,
    .speedup-card,
    .finder-form,
    .missing-form,
    .order-layout,
    .check-redo-form-v881
  ) textarea{
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    box-sizing:border-box !important;
    font-size:16px !important;
  }

  /* Step/progress indicators on order-like flows */
  body :where([class*="step"], [class*="progress"], [class*="wizard"]){
    max-width:100% !important;
    min-width:0 !important;
  }

  body :where([class*="step-row"], [class*="progress-row"], [class*="wizard-row"], [class*="steps"]){
    overflow-x:auto !important;
    -webkit-overflow-scrolling:touch !important;
  }

  /* Working-visa embedded iframe/media */
  body.working-visa-page iframe,
  body[class*="working"] iframe{
    width:100% !important;
    max-width:100% !important;
    min-height:300px !important;
    border:0 !important;
  }

  /* Public pages that have old card-style sections */
  body :where(
    .arrival-xxx-card-v829,
    .departure-xxx-card-v830,
    .evisa-card-v787GL,
    .guide-card,
    .guide-table-wrap,
    .trust-voa-table-wrap-v800,
    .exemption-table-wrap-v510G,
    .evisa-ref-table-wrap-v803
  ){
    max-width:100% !important;
    min-width:0 !important;
    box-sizing:border-box !important;
  }

  /* Avoid sticky first column causing too much squeeze on very narrow tables */
  @media (max-width:430px){
    body :where(
      .fees-matrix-v787DN,
      .visa-req-table-v886,
      .trust-voa-table-v799,
      .exemption-table-v510G
    ) th:first-child,
    body :where(
      .fees-matrix-v787DN,
      .visa-req-table-v886,
      .trust-voa-table-v799,
      .exemption-table-v510G
    ) td:first-child{
      min-width:112px !important;
      max-width:150px !important;
    }
  }
}

@media (max-width:480px){
  body :where(
    .arrival-xxx-table-v829,
    .departure-xxx-table-v830,
    .evisa-table-v787GL,
    .speedup-simple-table-v827,
    .correction-xxx-table-v828,
    .emergency-summary-table-v787FR,
    .visa-info-xxx-simple-table-v835,
    .guide-table,
    .guide-seo-table-v517A,
    .exemption-table-v510G,
    .trust-voa-table-v799,
    .terms-xxx-table-v831,
    .privacy-guide-table-v880,
    .refund-guide-table-v879,
    .booking-guide-table-v878
  ){
    min-width:520px !important;
  }
}
