[data-ui-surface],
[data-ui-surface]::before,
[data-ui-surface]::after,
[data-ui-surface] *,
[data-ui-surface] *::before,
[data-ui-surface] *::after {
  box-sizing: border-box;
}

[data-ui-surface] {
  cursor: default;
  color: var(--arhix-ink-active);
  font-family: var(--arhix-font);
  font-size: var(--arhix-font-size-body);
  font-weight: var(--arhix-font-weight-body);
  line-height: 1.2;
}

[data-ui-surface] :where(button, input, textarea, select) {
  color: inherit;
  font: inherit;
}

/* Workbench chrome is a control surface, not selectable document text. */
[data-ui-surface] button {
  -webkit-user-select: none;
  user-select: none;
}

[data-ui-surface] :where(input, textarea, [contenteditable]:not([contenteditable="false"])) {
  -webkit-user-select: text;
  user-select: text;
}

/* Controls keep the surface pointer; only text editing changes its shape. */
[data-ui-surface] :where(a, button, input, textarea, select) {
  cursor: inherit;
}

[data-ui-surface] :where(
  textarea,
  input:not([type="button"], [type="submit"], [type="reset"], [type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"], [type="image"], [type="hidden"]),
  [contenteditable]:not([contenteditable="false"])
):not(:disabled) {
  cursor: text;
}

[data-ui-surface] :where(button, input, textarea, select, svg) {
  margin: 0;
}

[data-ui-surface] :where(svg, img) {
  display: block;
}
