/* Pondera design tokens. Light and dark values; every frontend variant (React, Vue, standalone)
   consumes these custom properties and never hard-codes colours, spacing or radii.
   Dark mode: `prefers-color-scheme` by default, forced with `data-theme="dark|light"` on <html>. */
:root {
  --pd-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --pd-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --pd-text-xs: 0.75rem; --pd-text-sm: 0.875rem; --pd-text-md: 1rem; --pd-text-lg: 1.125rem; --pd-text-xl: 1.5rem; --pd-text-2xl: 2rem;
  --pd-space-1: 4px; --pd-space-2: 8px; --pd-space-3: 12px; --pd-space-4: 16px; --pd-space-5: 24px; --pd-space-6: 32px; --pd-space-7: 48px;
  --pd-radius-sm: 6px; --pd-radius: 12px; --pd-radius-lg: 16px;
  --pd-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.06);
  --pd-container: 1200px; --pd-container-narrow: 760px;
  --pd-bg: #f6f7f9; --pd-surface: #ffffff; --pd-surface-2: #eef0f3;
  --pd-ink: #16191d; --pd-muted: #5b6470; --pd-line: #dde1e6;
  --pd-accent: #c8102e; --pd-accent-ink: #ffffff; --pd-accent-soft: #fbe9ec;
  --pd-ok: #1a7f37; --pd-warn: #9a6700; --pd-danger: #b42318; --pd-info: #0b5cad;
  --pd-danger-ink: #ffffff;
  --pd-focus: 0 0 0 3px rgba(200, 16, 46, 0.3);
  color-scheme: light;
}
/* Responsive layout tokens (ADR 0048, docs/responsive.md; numbers mirrored in breakpoints.ts). Mobile-first, min-width only.
   Breakpoints in em: sm 40em (640), md 48em (768), lg 64em (1024), xl 80em (1280), 2xl 96em (1536). Container queries: 360, 600, 840 px. */
:root {
  --pd-page-padding: 12px; --pd-gutter: 12px; --pd-header-height: 56px; --pd-rail-width: 4rem; --pd-section-space: 24px;
  --pd-content-max: 1280px;
}
/* responsive-check: allow 360 px is the narrow-phone padding step, not a layout breakpoint */
@media (min-width: 22.5em) { :root { --pd-page-padding: 16px; } }
@media (min-width: 40em) { :root { --pd-page-padding: 20px; --pd-gutter: 16px; } }
@media (min-width: 48em) { :root { --pd-page-padding: 24px; --pd-section-space: 32px; } }
@media (min-width: 64em) { :root { --pd-page-padding: 32px; --pd-gutter: 24px; --pd-header-height: 64px; --pd-section-space: 48px; } }
@media (min-width: 80em) { :root { --pd-page-padding: 40px; } }
@media (min-width: 96em) { :root { --pd-gutter: 32px; } }
/* Compact density: optional setting for desktop power users (data-density="compact" on <html>). */
:root[data-density="compact"] {
  --pd-space-3: 8px; --pd-space-4: 12px; --pd-space-5: 16px; --pd-space-6: 24px; --pd-space-7: 32px;
  --pd-section-space: 24px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="eink"]) {
    --pd-bg: #111317; --pd-surface: #1a1d22; --pd-surface-2: #22262c;
    --pd-ink: #e8eaed; --pd-muted: #9aa3ad; --pd-line: #2c3138;
    --pd-accent: #ff4d5e; --pd-accent-ink: #16191d; --pd-accent-soft: #3a1b20;
    --pd-ok: #3fb950; --pd-warn: #d29922; --pd-danger: #f85149; --pd-info: #58a6ff;
    --pd-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --pd-bg: #111317; --pd-surface: #1a1d22; --pd-surface-2: #22262c;
  --pd-ink: #e8eaed; --pd-muted: #9aa3ad; --pd-line: #2c3138;
  --pd-accent: #ff4d5e; --pd-accent-ink: #16191d; --pd-accent-soft: #3a1b20;
  --pd-ok: #3fb950; --pd-warn: #d29922; --pd-danger: #f85149; --pd-info: #58a6ff;
  --pd-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}
/* E-ink (Onyx Boox, PocketBook, Kindle, Kobo, reMarkable, Tolino): pure black on white, borders instead of shaded surfaces,
   no shadows, gradients or colour-only meaning. Set by the user or by `system` detection (see theme.ts). */
:root[data-theme="eink"] {
  --pd-bg: #ffffff; --pd-surface: #ffffff; --pd-surface-2: #ffffff;
  --pd-ink: #000000; --pd-muted: #000000; --pd-line: #000000;
  --pd-accent: #000000; --pd-accent-ink: #ffffff; --pd-accent-soft: #ffffff;
  --pd-ok: #000000; --pd-warn: #000000; --pd-danger: #000000; --pd-info: #000000;
  --pd-danger-ink: #ffffff;
  --pd-shadow: none;
  --pd-focus: 0 0 0 4px #000000;
  --pd-touch: 48px;
  /* content: charts by dash pattern and thick lines, greyscale high-contrast map tiles, static "Loading" text, no motion */
  --pd-chart-font: 17px; --pd-chart-stroke: 4px; --pd-chart-point: 5px; --pd-chart-bar-stroke: 2px;
  --pd-chart-dash-1: 12 6; --pd-chart-dash-2: 2 6; --pd-chart-dash-3: 14 6 2 6; --pd-chart-dash-4: 6 6;
  --pd-map-tile-filter: grayscale(1) contrast(1.35); --pd-map-marker-shadow: none; --pd-map-marker-outline: 4px double #000;
  --pd-spin: none; --pd-spinner-dot-display: none;
  --pd-spinner-text-pos: static; --pd-spinner-text-size: auto; --pd-spinner-text-clip: none; --pd-spinner-text-wrap: normal;
  --pd-text-sm: 1rem; --pd-text-xs: 0.875rem;
  color-scheme: light;
}
/* Skin tokens (ADR 0047). Values of the `default` skin; skins/<name>.css override them under :root[data-skin="<name>"]. */
:root {
  --pd-font-display: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; --pd-font-body: var(--pd-font-display); --pd-font-ui: var(--pd-font-display);
  --pd-text-3xl: 2.5rem; --pd-text-hero: clamp(2rem, 1.5rem + 3vw, 3.5rem);
  --pd-leading: 1.5; --pd-leading-tight: 1.2; --pd-tracking-display: 0; --pd-weight-display: 700;
  --pd-radius-xs: 4px; --pd-radius-pill: 999px; --pd-border-w: 1px; --pd-shadow-raised: var(--pd-shadow); --pd-shadow-hard: none;
  --pd-density: 1; --pd-aside-w: 20rem; --pd-measure: 72ch;
  --pd-ease: ease; --pd-duration: 150ms; --pd-motion: 1;
  --pd-texture: none; --pd-pattern: none;
  --pd-accent-2: var(--pd-accent); --pd-accent-2-ink: var(--pd-accent-ink);
  --pd-hero-bg: var(--pd-surface-2); --pd-hero-ink: var(--pd-ink);
  --pd-nav-bg: var(--pd-surface); --pd-nav-ink: var(--pd-ink); --pd-nav-active: var(--pd-accent-soft);
  --pd-selection: var(--pd-accent-soft); --pd-scrim: rgba(0, 0, 0, 0.5);
}
:root[data-theme="eink"] { --pd-motion: 0; --pd-shadow-raised: none; }
