/*
 * Baseline for every app. Static CSS (not createGlobalStyle): it is rendered once by the host, cached, SSR-safe, and
 * needs none of the marker-class / !important workarounds the old global styles did.
 * Values come from the tokens (generated/tokens.css); nothing here is a literal colour or size.
 */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-family-base);
  font-size: var(--text-body-m-size);
  line-height: var(--text-body-m-line-height);
  font-weight: var(--text-body-m-weight);
  letter-spacing: var(--text-body-m-letter-spacing);
  color: var(--text-body);
  background-color: var(--background-default);
}

/* Browsers give form controls their own font (Arial): take the page font. Zero specificity, any component still wins. */
:where(button, input, select, textarea) {
  font-family: inherit;
}

:where(strong, b) {
  font-weight: var(--font-weight-semibold);
}

/* The accent pair flips as a unit: white on blue in light, black on the brand green in dark. */
::selection {
  color: var(--action-accent-text);
  background-color: var(--action-accent-bg);
}

:where(:focus-visible) {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/*
 * COMPAT (delete when the remotes set their own line-heights and resets).
 * Federated remotes used to ship their own global reset (box-sizing, line-height: 1, bare buttons and links). That reset now
 * lives here, scoped to remote routes (the host sets <body class="mf-remote-route">) and at zero specificity, so
 * it behaves like the old element selectors and never outranks a component.
 */
/* Normal specificity on purpose: `body {}` above is (0,0,1), a zero-specificity compat rule would lose to it. Nothing but the
   body element itself matches this, so it cannot outrank a component. Only the size and line-height are left to the remotes
   (10px text, tight line-height: keeps their `em` sizes exact; their `rem` values were converted to px). Weight, letter-spacing
   and font family are the one shared body above, on the host and on every remote: do not override them here. */
body.mf-remote-route {
  font-size: 10px;
  line-height: 1;
}

:where(body.mf-remote-route) :where(*, *::before, *::after) {
  box-sizing: border-box;
}

:where(body.mf-remote-route) :where(button) {
  background-color: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}

:where(body.mf-remote-route) :where(select) {
  appearance: none;
}

:where(body.mf-remote-route) :where(a) {
  color: inherit;
}
