/* Layout adaptations for the configured UI type scale. */
@layer site-typography {
  html[data-site-typography="on"] .skip-link:not(:focus) { position: absolute !important; width: 1px !important; height: 1px !important; min-width: 0 !important; min-height: 0 !important; padding: 0 !important; overflow: hidden !important; clip-path: inset(50%); white-space: nowrap !important; }
  html[data-site-typography="on"] :is(.visa-info-item, .visa-info-item > div, .visa-info-item p, .visa-info-item strong, .fee-summary-row p, .fee-summary-row strong) {
    min-width: 0 !important;
    max-width: 100%;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere !important;
    height: auto !important;
  }
  html[data-site-typography="on"] .fee-summary-row {
    grid-template-columns: minmax(0, 1fr) minmax(5ch, .6fr) !important;
    align-items: start !important;
  }
  html[data-site-typography="on"] .fee-summary-row strong { text-align: right; }
  html[data-site-typography="on"] .breadcrumb { flex-wrap: wrap !important; height: auto !important; overflow: visible !important; gap: 6px 10px; }
  html[data-site-typography="on"] .breadcrumb > * { min-width: 0; white-space: normal !important; overflow-wrap: anywhere; }
  html[data-site-typography="on"] .destination-card { height: auto !important; aspect-ratio: auto !important; min-height: 400px !important; display: flex; align-items: flex-end; }
  html[data-site-typography="on"] .destination-card .card-body { position: relative !important; width: 100%; padding-top: 100px; transform: none !important; }
  html[data-site-typography="on"] .destination-card .hover-panel { overflow-y: auto !important; pointer-events: none !important; }
  html[data-site-typography="on"] :is(.destination-card:hover, .destination-card.is-open) .hover-panel { max-height: 100% !important; pointer-events: auto !important; }
  html[data-site-typography="on"] :is(.field-title, .field > span) { white-space: normal !important; overflow-wrap: anywhere !important; max-width: 100%; height: auto !important; }
  html[data-site-typography="on"] :is(.field, .form-grid > *, .visa-info-grid > *, .tool-section, .tool-workspace-stage) { min-width: 0 !important; }
  html[data-site-typography="on"] dialog { max-width: calc(100vw - 24px) !important; max-height: calc(100dvh - 24px) !important; overflow: auto !important; }
  html[data-site-typography="on"] :is(.questionnaire-actions, .form-actions, .dialog-actions) { flex-wrap: wrap !important; gap: 10px; }
  @media (max-width: 760px) {
    html[data-site-typography="on"] .mobile-main .destination-card { min-height: 282px !important; }
    html[data-site-typography="on"] .destination-card .card-meta { grid-template-columns: minmax(0, 1fr) !important; }
    html[data-site-typography="on"] .destination-card .card-meta > div { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, calc(var(--site-type-body) * 4.2)), 1fr)); align-items: start; gap: 4px 8px; text-align: left; }
    html[data-site-typography="on"] :is(.site-header, .topbar):not(.mobile-header):has([data-site-nav]) {
      height: auto !important;
      min-height: 64px;
      overflow: visible !important;
    }
    html[data-site-typography="on"] :is(.topbar, .site-header > .nav-shell):has(> [data-site-nav]) {
      display: flex !important;
      align-items: center !important;
      flex-wrap: wrap !important;
      gap: 8px 12px !important;
      padding: 12px 16px !important;
      width: 100% !important;
      min-width: 0 !important;
    }
    html[data-site-typography="on"] .site-header:has(> [data-site-nav]) {
      display: flex !important;
      align-items: center !important;
      flex-wrap: wrap !important;
      gap: 8px 12px !important;
      padding: 12px 16px !important;
    }
    html[data-site-typography="on"] [data-site-nav] {
      order: 3 !important;
      display: flex !important;
      flex: 1 1 100% !important;
      width: 100% !important;
      max-width: 100% !important;
      min-width: 0 !important;
      flex-wrap: wrap !important;
      justify-content: flex-start !important;
      gap: 4px !important;
      overflow: visible !important;
    }
    html[data-site-typography="on"] [data-site-nav] > a {
      padding: 8px 10px !important;
      height: auto !important;
      white-space: normal !important;
      max-width: 100%;
      overflow-wrap: anywhere;
    }
    html[data-site-typography="on"] :is(.tool-master-detail, .tool-list-panel) { overflow: visible !important; }
    html[data-site-typography="on"] .tool-list-scroll {
      display: grid !important;
      grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
      gap: 8px !important;
      overflow: visible !important;
    }
    html[data-site-typography="on"] .tool-list-scroll .tool-card {
      width: 100% !important;
      min-width: 0 !important;
      grid-template-columns: minmax(0, 1fr) !important;
      align-content: start !important;
      height: auto !important;
      flex-basis: auto !important;
    }
    html[data-site-typography="on"] .tool-list-scroll :is(.tool-name, .tool-desc, .tool-card > span) {
      min-width: 0 !important;
      white-space: normal !important;
      overflow: visible !important;
      text-overflow: clip !important;
      overflow-wrap: anywhere !important;
    }
    html[data-site-typography="on"] .tool-list-scroll .tool-icon { display: none !important; }
    html[data-site-typography="on"] :is(.step-progress, .canada-tabs) {
      display: flex !important;
      flex-wrap: wrap !important;
      width: 100% !important;
      max-width: 100% !important;
      height: auto !important;
      overflow: visible !important;
      gap: 6px !important;
    }
    html[data-site-typography="on"] :is(.step-progress, .canada-tabs) > span {
      flex: 1 1 90px !important;
      min-width: 0 !important;
      height: auto !important;
      white-space: normal !important;
      overflow-wrap: anywhere !important;
    }
    html[data-site-typography="on"] :is(.step-progress, .canada-tabs) em { position: static !important; display: block !important; max-width: 100%; white-space: normal !important; overflow-wrap: anywhere !important; }
    html[data-site-typography="on"] .form-canvas { grid-template-columns: minmax(0, 1fr) !important; min-width: 0 !important; width: 100% !important; max-width: 100% !important; }
    html[data-site-typography="on"] .canada-layout { grid-template-columns: minmax(0, 1fr) !important; min-width: 0 !important; }
    html[data-site-typography="on"] .canada-detail-panel { min-width: 0 !important; max-width: 100% !important; }
    html[data-site-typography="on"] :is(.form-band, .field-grid) { min-width: 0 !important; min-inline-size: 0 !important; max-width: 100% !important; }
    html[data-site-typography="on"] #document-generator :is(.bilingual-row, .salary-input, .date-range) { grid-template-columns: minmax(0, 1fr) !important; min-width: 0 !important; min-inline-size: 0 !important; }
    html[data-site-typography="on"] #document-generator .generator-layout { grid-template-columns: minmax(0, 1fr) !important; min-width: 0 !important; width: 100% !important; }
    html[data-site-typography="on"] #document-generator :is(.guided-form, .letter-preview, .bilingual-form) { min-width: 0 !important; width: 100% !important; max-width: 100% !important; }
    html[data-site-typography="on"] #document-generator :is(.bilingual-form, .field-cell, .bilingual-row > *, .compact-form-heading p) { min-width: 0 !important; max-width: 100%; white-space: normal !important; overflow-wrap: anywhere !important; }
    html[data-site-typography="on"] #document-generator .compact-form-heading { display: block !important; }
    html[data-site-typography="on"] #document-generator .choice-pills { grid-template-columns: repeat(auto-fit, minmax(min(100%, 100px), 1fr)) !important; }
    html[data-site-typography="on"] #document-generator .choice-pills span { white-space: normal !important; overflow-wrap: anywhere !important; }
    html[data-site-typography="on"] #document-generator :is(.guided-form, .bilingual-form) { height: auto !important; max-height: none !important; overflow: visible !important; }
  }
  @media (max-width: 480px) {
    html[data-site-typography="on"] .share-poster .poster-qr-row { grid-template-columns: minmax(0, 1fr) !important; }
    html[data-site-typography="on"] .share-poster .poster-contact { min-width: 0; overflow-wrap: anywhere; }
  }
}
