/* Keep Safari's rectangular tap overlay off the public controls. */
body:not(.admin-mode) :where(a[href], button, summary, [role="button"], [role="tab"]) {
  -webkit-tap-highlight-color: transparent;
}

/* Keep a keyboard focus indicator within the control instead of adding an outer border. */
body:not(.admin-mode) :is(a[href], button, summary, [role="button"], [role="tab"]):focus-visible {
  outline-offset: -3px !important;
}

/* Focus can return to a button programmatically after a touch-opened dialog closes. */
html[data-dc88-pointer-focus] body:not(.admin-mode)
  :is(a[href], button, summary, [role="button"], [role="tab"]):focus,
body:not(.admin-mode) dialog :is(h1, h2, h3)[tabindex="-1"]:focus {
  outline: none !important;
}

@media (any-pointer: coarse) {
  /* Press the icon and label, without moving the hit area or the wheel. */
  body:not(.admin-mode) :where(.bottom-nav, .portal-bottom)
    > :where(button, a[href]):not(.floating-wheel, :disabled, [aria-disabled="true"])
    > :where(b, span) {
    transition: scale 140ms cubic-bezier(.22, .61, .36, 1), opacity 140ms ease-out;
  }

  body:not(.admin-mode) :where(.bottom-nav, .portal-bottom)
    > :where(button, a[href]):not(.floating-wheel, :disabled, [aria-disabled="true"]):is(:active,.dc88-tap-pressed)
    > :where(b, span) { opacity: .78; }

  body:not(.admin-mode) :where(.top-right, .shortcuts, .categories, .member-quick-grid, .member-account-payment, .side-menu-grid)
    > :where(button, a[href]):not(:disabled, [aria-disabled="true"]):is(:active,.dc88-tap-pressed) {
    opacity: .78;
  }
}

@media (any-pointer: coarse) and (prefers-reduced-motion: no-preference) {
  body:not(.admin-mode) :where(.bottom-nav, .portal-bottom)
    > :where(button, a[href]):not(.floating-wheel, :disabled, [aria-disabled="true"]):is(:active,.dc88-tap-pressed)
    > :where(b, span) { scale: .93; }
}

@media (any-pointer: coarse) and (prefers-reduced-motion: reduce) {
  body:not(.admin-mode) :where(.bottom-nav, .portal-bottom)
    > :where(button, a[href]):not(.floating-wheel, :disabled, [aria-disabled="true"])
    > :where(b, span) {
    transition: none;
  }
}
