/*
 * Tokens shared by all themes. A theme may override any of them.
 * Theme files only set tokens; components never use raw values (see README.md).
 */
:root {
  --font-sans: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;

  --text-xs: 11px;
  --text-sm: 12px;
  --text-base: 13px;
  --text-md: 14px;
  --text-lg: 16px;
  --text-xl: 20px;
  --text-2xl: 26px;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --leading: 1.45;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;

  /* Density (compact by default, D32) */
  --control-h: 36px;
  --control-h-sm: 28px;
  --bar-h: 56px;
  --row-pad-y: 7px;
  --row-pad-x: 14px;
  --page-pad: 22px 24px;

  /* Shell layout. A theme may rearrange it by redefining the grid. */
  --sidebar-w: 64px;
  --sidebar-w-expanded: 232px;
  --detail-w: 380px;
  --shell-columns: var(--sidebar-w) minmax(0, 1fr);
  --shell-areas: 'sidebar main';
  /* Phone bottom bar (§8.4); 0 on wider screens. */
  --tabbar-h: 0px;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --duration-fast: 120ms;
  --duration: 180ms;

  --focus-ring: 0 0 0 2px var(--color-bg), 0 0 0 4px var(--color-accent);
}

/*
 * Phones (§8.4, up to 720 px wide): no sidebar, a bottom tab bar, tighter page padding.
 * The breakpoint is fixed (media queries can't read tokens); themes may still restyle the parts.
 */
@media (max-width: 720px) {
  :root {
    --page-pad: 16px;
    --shell-columns: minmax(0, 1fr);
    --shell-areas: 'main';
    --tabbar-h: 64px;
  }
}

/* Touch screens: controls at least 44 px high (ux-principles 11). */
@media (pointer: coarse) {
  :root {
    --control-h: 44px;
    --control-h-sm: 36px;
  }
}
