/* Shared application rules. Delivered once per document by startup_delivery.py. */
/* Platform-wide flat elevation contract.
   Both light and dark application themes are intentionally shadow-free.
   Visual hierarchy comes from surfaces, borders and spacing, not elevation.
   Focus stays accessible through a real outline instead of a shadow ring. */
html[data-aidc-color-mode][data-aidc-color-mode][data-aidc-color-mode] body,
html[data-aidc-color-mode][data-aidc-color-mode][data-aidc-color-mode] body * {
  box-shadow: none !important;
  text-shadow: none !important;
}

html[data-aidc-color-mode][data-aidc-color-mode][data-aidc-color-mode] body :where(
  button,
  a,
  input,
  textarea,
  select,
  [tabindex]:not([tabindex="-1"])
):focus-visible {
  outline: 2px solid var(--aidc-action-focus-ring) !important;
  outline-offset: 2px !important;
}

/* Global scrollbar contract. */
html,
body,
body * {
  scrollbar-width: thin !important;
  scrollbar-color: var(--aidc-scrollbar-thumb) var(--aidc-scrollbar-track) !important;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
body *::-webkit-scrollbar {
  width: var(--aidc-scrollbar-size) !important;
  height: var(--aidc-scrollbar-size) !important;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track,
body *::-webkit-scrollbar-track {
  background: var(--aidc-scrollbar-track) !important;
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb,
body *::-webkit-scrollbar-thumb {
  background: var(--aidc-scrollbar-thumb) !important;
  border: 1px solid transparent !important;
  background-clip: padding-box !important;
  border-radius: 999px !important;
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover,
body *::-webkit-scrollbar-thumb:hover {
  background: var(--aidc-scrollbar-thumb-hover) !important;
  background-clip: padding-box !important;
}

/* Theme tokens change as one paint; normal interaction transitions resume afterward. */
html[data-aidc-color-mode-changing],
html[data-aidc-color-mode-changing] *,
html[data-aidc-color-mode-changing] *::before,
html[data-aidc-color-mode-changing] *::after {
  transition: none !important;
}
