/* Device fit (21 Nov 2026): the website must work on any phone, tablet, laptop or large screen, in portrait and landscape.
   This sheet is loaded last. It only corrects things that go wrong on small or unusual screens; large screens are unchanged. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { max-width: 100%; overflow-x: clip; }
img, video, canvas, iframe, svg { max-width: 100%; }
iframe { border: 0; }
table { max-width: 100%; }
/* a table that is wider than the screen scrolls inside its own box instead of widening the page */
.view table:not(.no-scroll) { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
pre, code { overflow-wrap: anywhere; white-space: pre-wrap; }
/* notches and rounded corners: the bottom bar and the floating buttons stay clear of the home indicator */
.bnav { padding-bottom: env(safe-area-inset-bottom, 0); }
.chatFab { margin-bottom: env(safe-area-inset-bottom, 0); }
body { padding-left: env(safe-area-inset-left, 0); padding-right: env(safe-area-inset-right, 0); }

/* touch screens: comfortable targets, and no automatic zoom when a field is selected (iOS zooms any field below 16px) */
@media (pointer: coarse) {
  a.btn, button.btn, .btn, button, [role="button"], select { min-height: 40px; }
  input:not([type="checkbox"]):not([type="radio"]), select, textarea { min-height: 44px; }
}
@media (max-width: 900px) {
  input:not([type="checkbox"]):not([type="radio"]), select, textarea { font-size: 16px !important; }
}

/* phones and small tablets: only the main header stays at the top while scrolling, so the page keeps its room */
@media (max-width: 900px) {
  html body .topbar.idm-tb, html body div.topbar { position: static !important; }
  html body .topbar.idm-tb { min-height: 0 !important; }
  html body .topbar.idm-tb .wrap { flex-wrap: wrap !important; justify-content: center !important; gap: 6px 10px !important; padding: 6px 10px !important; overflow: visible !important; }
  html body .topbar.idm-tb .r { flex-wrap: wrap !important; justify-content: center !important; gap: 6px 10px !important; white-space: normal !important; margin: 0 !important; }
}
@media (max-width: 560px) {
  html body header.site .hbar { padding: 8px 12px 6px !important; gap: 6px 10px !important; }
  html body header.site .brand { gap: 10px !important; min-width: 0; max-width: 100%; }
  html body header.site .brand .logo { width: 118px !important; height: 44px !important; }
  html body header.site .brand::after { font-size: .76rem !important; padding-left: 10px !important; white-space: normal !important; overflow-wrap: anywhere; }
  html body header.site a.myidm { padding: 8px 18px !important; font-size: .92rem !important; }
  html body header.site .iconbtn { width: 40px !important; height: 40px !important; }
}
@media (max-width: 360px) {
  html body header.site .brand::after { content: "IDM Eswatini" !important; }
  html body header.site .brand .logo { width: 104px !important; }
  html body header.site a.myidm { padding: 7px 14px !important; font-size: .86rem !important; }
}
/* phones turned sideways: the header scrolls away instead of covering half of the screen */
@media (max-height: 500px) and (orientation: landscape) {
  html body header.site { position: static !important; }
  html body .bnav { display: none !important; }
}

/* the home sections */
@media (max-width: 560px) {
  #idmProgs .pgh-head, #idmNews .nlh-head { margin-bottom: 14px; }
  #idmProgs .pgh-cta { width: 100%; } #idmProgs .pgh-cta a { width: 100%; }
  #idmProgs .pgh-foot a { flex: 1 1 100%; }
  #idmNews .nlh-btns a { flex: 1 1 100%; }
}
.ps2 .ts-bar, [data-print-doc] .ts-bar, .ps2 .tbl-search { display: none !important; }

/* Buttons never squeeze into a round blob with the word broken over two lines: a button keeps its words on one line and its own width (21 Nov 2026). */
a.btn, button.btn, .btn, a.adv-btn, .adv-btn, td a[class*="btn"], td button, th button, .row > .adv-btn, a.row > span.adv-btn, .ib, a.tbtn { white-space: nowrap !important; flex-shrink: 0 !important; width: auto; min-width: max-content; word-break: normal !important; overflow-wrap: normal !important; hyphens: manual !important; }
td, th { overflow-wrap: break-word; }
.gd-file > div, .dl-row > div { min-width: 0; flex: 1 1 auto; } .gd-file > a, .dl-row > a, .gd-file > button, .dl-row > button { flex: 0 0 auto !important; white-space: nowrap !important; }
.btn-sm { min-height: 34px; padding-left: 14px; padding-right: 14px; border-radius: 999px; }
