* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Native ~80% UI scale for the logged-in app (matches browser zoom 80%).
   Applied at the root so it behaves like real page zoom: layout reflows, fixed
   overlays cover the full screen, and breakpoints shift — so more fits on small
   laptops. Scoped to `body.area-app` (the /app + /admin shell; marketing/login
   stay 100%) and gated to pointer:fine desktops/laptops (phones/touch stay 100%).
   --app-zoom defaults to 1 (no-op) and is set to 0.8 only where the zoom applies,
   so full-height shells that divide by it — calc(100vh / var(--app-zoom)) — stay
   correct off the zoomed path. Tunable via --app-zoom. */
:root {
  --app-zoom: 1;
}
@media (min-width: 1024px) and (pointer: fine) {
  html:has(body.area-app) {
    --app-zoom: 0.8;
    zoom: var(--app-zoom);
  }
}

body {
  font-family: var(--font-sans);
  color: var(--color-black);
  background-color: var(--surface-base);
  line-height: 1.6;
  min-height: 100vh;
  display: block;
  margin: 0;
  padding: 0;
}

#app-root {
  min-height: 100vh;
  display: block;
}

#boot-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-gray);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: var(--spacing-md);
}

h1 {
  font-size: var(--text-3xl);
}

h2 {
  font-size: var(--text-2xl);
}

h3 {
  font-size: var(--text-xl);
}

a {
  color: var(--color-black);
  text-decoration: none;
  border-bottom: var(--border-width) solid transparent;
  transition: border-color var(--transition-fast);
}

a:hover {
  border-bottom-color: var(--color-black);
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* Touch targets for tablet */
button, a, input[type="checkbox"], input[type="radio"] {
  min-height: 44px;
  min-width: 44px;
}

/* Global focus-visible default for keyboard users in light DOM. */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

/* Honor reduced motion: collapse non-essential transitions/animations. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
