/* AirlyGo V11.4.0D3.9.1 — English Font Unification
   Public/customer-facing pages use Work Sans consistently.
   Sinhala/Tamil retain script-safe Noto Sans fallbacks.
   Loaded last to neutralize legacy Baloo/JetBrains/Arial/serif page overrides. */
:root {
  --ag-font-en: "Work Sans", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --ag-font-si: "Noto Sans Sinhala", "Work Sans", system-ui, sans-serif;
  --ag-font-ta: "Noto Sans Tamil", "Work Sans", system-ui, sans-serif;

  /* Normalize legacy font variables used by older public stylesheets. */
  --font-display: var(--ag-font-en) !important;
  --font-body: var(--ag-font-en) !important;
  --font-mono: var(--ag-font-en) !important;
  --font: var(--ag-font-en) !important;
  --ag-font-latin: var(--ag-font-en) !important;
  --ag-font-ui: var(--ag-font-en) !important;
  --ag-font-heading: var(--ag-font-en) !important;
  --ag-font-display: var(--ag-font-en) !important;
  --ag-public-font: var(--ag-font-en) !important;
}

/* English/default public UI. Repeated data-attribute selector deliberately gives
   this final design-system layer enough specificity to beat old !important rules. */
html[data-ag-font="work-sans"][data-ag-font="work-sans"][data-ag-font="work-sans"] body,
html[data-ag-font="work-sans"][data-ag-font="work-sans"][data-ag-font="work-sans"] body *:not(svg):not(path) {
  font-family: var(--ag-font-en) !important;
}

/* Script-safe whole-page language modes. */
html[data-ag-font="work-sans"][lang="si"] body,
html[data-ag-font="work-sans"][lang="si"] body *:not(svg):not(path) {
  font-family: var(--ag-font-si) !important;
}
html[data-ag-font="work-sans"][lang="ta"] body,
html[data-ag-font="work-sans"][lang="ta"] body *:not(svg):not(path) {
  font-family: var(--ag-font-ta) !important;
}

/* Mixed-language fragments on otherwise English pages. */
html[data-ag-font="work-sans"] body [lang="si"],
html[data-ag-font="work-sans"] body [lang="si"] *:not(svg):not(path) {
  font-family: var(--ag-font-si) !important;
}
html[data-ag-font="work-sans"] body [lang="ta"],
html[data-ag-font="work-sans"] body [lang="ta"] *:not(svg):not(path) {
  font-family: var(--ag-font-ta) !important;
}
html[data-ag-font="work-sans"] body [lang="en"],
html[data-ag-font="work-sans"] body [lang="en"] *:not(svg):not(path) {
  font-family: var(--ag-font-en) !important;
}

/* Form controls must never fall back to a platform-specific font. */
html[data-ag-font="work-sans"] button,
html[data-ag-font="work-sans"] input,
html[data-ag-font="work-sans"] select,
html[data-ag-font="work-sans"] textarea,
html[data-ag-font="work-sans"] option,
html[data-ag-font="work-sans"] optgroup {
  font-family: var(--ag-font-en) !important;
}
html[data-ag-font="work-sans"][lang="si"] :is(button,input,select,textarea,option,optgroup) {
  font-family: var(--ag-font-si) !important;
}
html[data-ag-font="work-sans"][lang="ta"] :is(button,input,select,textarea,option,optgroup) {
  font-family: var(--ag-font-ta) !important;
}
