@layer foundation {
  html,
  body {
    background: var(--bg-app);
    color: var(--text-primary);
  }

  body {
    min-width: 320px;
    overflow-x: hidden;
    font-family: var(--font-ui);
    font-size: var(--type-body);
    line-height: var(--leading-body);
    text-rendering: optimizeLegibility;
  }

  .setae-gui-host,
  .setae-gui-host > #app,
  .app-shell {
    width: 100%;
    min-height: 100dvh;
  }

  .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  button {
    color: inherit;
  }

  button:disabled {
    cursor: not-allowed;
    opacity: .56;
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  p {
    margin-top: 0;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    font-family: var(--font-ui);
    line-height: var(--leading-tight);
  }

  :focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
  }

  .page {
    width: min(100%, var(--content-reading-width));
    margin-inline: auto;
    padding: var(--space-5) var(--space-4) calc(var(--bottom-nav-height) + var(--safe-bottom) + var(--space-5));
  }

  .page-header h1,
  .compact-header h1 {
    margin: var(--space-1) 0 0;
    font-family: var(--font-ui);
    font-size: var(--type-page);
    font-weight: 680;
  }

  .eyebrow,
  .sidebar-group-label,
  .taxon-family,
  .collection-inspector-section-title,
  .quick-record-section h3 {
    color: var(--text-muted);
    font-family: var(--font-ui);
    font-size: var(--type-micro);
    font-weight: 700;
    line-height: var(--leading-tight);
    letter-spacing: 0;
    text-transform: uppercase;
  }

  .section-title {
    font-family: var(--font-ui);
    font-size: var(--type-section);
    font-weight: 680;
    line-height: var(--leading-tight);
  }

  .secondary,
  .caption,
  small {
    font-size: var(--type-caption);
  }

  .scientific-name,
  .detail-species,
  .detail-scientific,
  .collection-inspector-species {
    font-family: var(--font-taxon);
    font-style: italic;
  }

  .animal-code,
  .registry-date,
  time,
  [data-metric] {
    font-family: var(--font-mono);
  }

  @media (min-width: 768px) {
    .page {
      padding: var(--space-6);
    }
  }
}
