/* Element defaults and accessibility rules shared by every product. */

@layer base {
  * {
    border-color: var(--border);
    outline-color: color-mix(in oklab, var(--ring) 50%, transparent);
  }
  html {
    min-height: 100%;
    font-family: var(--font-sans);
  }
  body {
    min-height: 100%;
    background-color: var(--background);
    color: var(--foreground);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  ::selection {
    background: var(--accent);
    color: var(--accent-foreground);
  }
  input,
  textarea {
    caret-color: var(--primary);
  }
  /* Numbers in tables and lists line up. */
  table,
  .numeric {
    font-variant-numeric: tabular-nums;
  }
  a {
    text-underline-offset: 3px;
  }
  a:focus-visible,
  summary:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: -2px;
    border-radius: 4px;
  }
}

/* Coarse pointers need usable targets, including the dense desktop controls. */
@media (pointer: coarse), (max-width: 767px) {
  [data-slot="button"],
  [data-slot="dialog-trigger"],
  [data-slot="dropdown-menu-trigger"],
  [data-slot="popover-trigger"],
  [data-slot="input"],
  [data-slot="select-trigger"] {
    min-height: 44px;
  }
  :is(
    [data-slot="button"],
    [data-slot="dialog-trigger"],
    [data-slot="dropdown-menu-trigger"],
    [data-slot="popover-trigger"]
  ):has(> svg:only-child) {
    min-width: 44px;
  }
}

/* iOS Safari zooms into every field under 16 px on focus and the page jumps.
   Body text stays 14 px; only the fields grow, and never shrink below their
   parent's size. An app rule with its own font-size on a field wins. */
@media (pointer: coarse) {
  :is(input, select, textarea, [data-slot="input"], [data-slot="textarea"], [data-slot="select-trigger"]) {
    font-size: max(16px, 1em);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
