/* GAIMS ITSM UAT typography system | 2026-11-16.
   Shared portal + Admin scale. Only type metrics change; no layouts, branding,
   colors, interactions, or status semantics are changed. */
:root{
  --itsm-font:Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  --itsm-type-caption:12px;
  --itsm-type-small:13px;
  --itsm-type-body:14px;
  --itsm-type-control:14px;
  --itsm-type-card:16px;
  --itsm-type-section:18px;
  --itsm-type-page:22px;
  --itsm-type-figure:28px;
  --itsm-type-leading:1.45;
}
body:has(#portalApp),body:has(#appView){
  font-family:var(--itsm-font)!important;
  font-size:var(--itsm-type-body);
  line-height:var(--itsm-type-leading);
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
}
:is(#portalApp,#appView){
  font-family:var(--itsm-font)!important;
  font-size:var(--itsm-type-body);
  line-height:var(--itsm-type-leading);
}
/* Keep all native controls in the same font family, including mobile More sheets. */
body:has(#portalApp) :is(button,input,select,textarea),
body:has(#appView) :is(button,input,select,textarea){
  font-family:var(--itsm-font)!important;
}
#portalApp :is(.topbar h2,.sectionTitle h2),
#appView :is(.top h1,.titlebar h2){
  font-size:var(--itsm-type-page)!important;
  font-weight:750!important;
  line-height:1.25!important;
}
#portalApp :is(.mobileAppGreeting h2,.sectionTitle h1),
#appView :is(.adminMobileGreeting h2,.ialControlHead h2){
  font-size:var(--itsm-type-page)!important;
  line-height:1.25!important;
  font-weight:750!important;
}
#portalApp :is(.cardHead h3,.card h3,.ticketTitle,.mobileAppTile .mobileAppLabel),
#appView :is(.card h3,.ialControlViewTitle,.ialControlGroupTitle){
  font-size:var(--itsm-type-card)!important;
  line-height:1.3!important;
  font-weight:750!important;
}
#portalApp :is(.cardBody,.ticket,.ticketTop,.sectionTitle p,.mobileAppTile .mobileAppSub),
#appView :is(.titlebar p,.card p,.ialControlHead p,.ialControlGroupText small){
  font-size:var(--itsm-type-body)!important;
  line-height:var(--itsm-type-leading)!important;
}
#portalApp :is(.btn,.chip,.nav button,.actions button,.mobileAppTile button),
#appView :is(.btn,.nav button,.ialControlShortcut,.ialControlGroupButton,.ialControlRow){
  font-size:var(--itsm-type-control)!important;
  line-height:1.35!important;
}
#portalApp :is(.btn.small,.topActions .btn,.ticketNo,.ticket .meta,.ticketMeta,.card .sub),
#appView :is(.ialControlRowLabel,.ialControlGroupCount,.stat span,.chip,.badge,.mono){
  font-size:var(--itsm-type-small)!important;
  line-height:1.4!important;
}
#portalApp :is(.label,.kpi .label,.kpi small,.sub,.muted,.hint),
#appView :is(.field label,.sub,.muted,.hint,.ialControlBlockHeading){
  font-size:var(--itsm-type-small)!important;
  line-height:1.45!important;
}
#portalApp :is(.kpi .value,.kpi strong),
#appView :is(.stat b,.stat strong){
  font-size:var(--itsm-type-figure)!important;
  font-weight:800!important;
  line-height:1.17!important;
  font-variant-numeric:tabular-nums;
}
/* Table typography is consistent without touching column widths or scrolling. */
#portalApp :is(table,.table) :is(th,td),
#appView :is(table,.table) :is(th,td){
  font-size:var(--itsm-type-small)!important;
  line-height:1.45!important;
}
#portalApp :is(table,.table) th,
#appView :is(table,.table) th{
  font-size:var(--itsm-type-caption)!important;
  font-weight:750!important;
}
/* Portal announcements and modal dialogs also render outside #portalApp. */
body:has(#portalApp) :is(.ialAnnPanel,.ialAnnBellMenu,.ialMoreSheet,.modalBackdrop){
  font-family:var(--itsm-font)!important;
  font-size:var(--itsm-type-body);
}
body:has(#portalApp) :is(.ialAnnPanelHead h2,.ialAnnDetail h3){
  font-size:var(--itsm-type-section)!important;
  font-weight:750!important;
  line-height:1.3!important;
}
body:has(#portalApp) :is(.ialAnnRowTitle,.ialAnnRowDesc,.ialAnnDetail p,.ialAnnPopItem){
  font-size:var(--itsm-type-body)!important;
  line-height:1.45!important;
}
body:has(#portalApp) :is(.ialAnnRowMeta,.ialAnnBadge,.ialAnnDetailMeta,.ialAnnPanelHead p){
  font-size:var(--itsm-type-caption)!important;
  line-height:1.4!important;
}
#appView .ialControlRowLabel,
body:has(#appView) :is(.adminMobileMenuLabel,.adminMobileSheetLogout,.adminMobileMoreRows button){
  font-size:var(--itsm-type-body)!important;
  line-height:1.4!important;
}
#appView :is(.ialControlGroupText small,.ialControlGroupCount){
  font-size:var(--itsm-type-caption)!important;
  line-height:1.35!important;
}
#appView :is(.ialControlHead h2,.ialControlViewTitle){
  font-size:var(--itsm-type-section)!important;
}
/* Mobile: clear headings, readable lists and controls; 16px inputs prevent iOS auto-zoom. */
@media(max-width:820px){
  :root{
    --itsm-type-caption:12px;
    --itsm-type-small:13px;
    --itsm-type-body:14px;
    --itsm-type-control:14px;
    --itsm-type-card:16px;
    --itsm-type-section:18px;
    --itsm-type-page:21px;
    --itsm-type-figure:27px;
  }
  #portalApp :is(.topbar h2,.sectionTitle h2),
  #appView :is(.top h1,.titlebar h2){font-size:21px!important}
  #portalApp :is(.mobileAppGreeting h2,.mobileAppTile .mobileAppLabel),
  #appView :is(.adminMobileGreeting h2,.ialControlHead h2){font-size:18px!important}
  #portalApp :is(.mobileNav button,#mobileNav button),
  #appView :is(.mobileNav button,#mobileNav button){font-size:13px!important;line-height:1.25!important}
  #portalApp :is(.ticketTitle,.cardHead h3,.card h3),
  #appView :is(.card h3,.ialControlGroupTitle){font-size:16px!important}
  #appView .ialControlGroupText small{font-size:12px!important}
  #portalApp :is(.btn,.chip,.actions button),
  #appView :is(.btn,.ialControlShortcut,.ialControlGroupButton,.ialControlRow){
    font-size:14px!important;
  }
  body:has(#portalApp) :is(input:not([type=checkbox]):not([type=radio]):not([type=range]),select,textarea),
  body:has(#appView) :is(input:not([type=checkbox]):not([type=radio]):not([type=range]),select,textarea){
    font-size:16px!important;
    line-height:1.4!important;
  }
  /* Keep page titles, ticket labels and metrics distinct rather than enlarging badges. */
  body:has(#portalApp) .ialAnnPanelHead h2{font-size:18px!important}
  body:has(#portalApp) .ialAnnRowTitle{font-size:14px!important}
  #appView .ialControlGroupTitle{font-size:14px!important}
  #appView .ialControlRowLabel{font-size:14px!important}
}
@media(max-width:360px){
  #portalApp :is(.mobileNav button,#mobileNav button),
  #appView :is(.mobileNav button,#mobileNav button){font-size:12px!important}
}

/* Login, account and form labels inherit the same text hierarchy. */
body:has(#portalApp) :is(.loginCard .field label,.loginCard .sub,.modalBody label),
body:has(#appView) :is(.loginCard label,.loginCard .sub,.modal label){
  font-size:var(--itsm-type-small)!important;
  line-height:1.45!important;
}
body:has(#appView) :is(.adminMobileSheetHead h3,.adminMobileMoreGroup h4){
  font-size:var(--itsm-type-section)!important;
  line-height:1.3!important;
}
body:has(#appView) :is(.adminMobileSheetHead p,.adminMobileMoreSearch){
  font-size:var(--itsm-type-small)!important;
  line-height:1.45!important;
}
