:root {
  color-scheme: light;

  --surface-page: #f8fafc;
  --surface-panel: rgba(255, 255, 255, 0.94);
  --surface-soft: rgba(241, 245, 249, 0.72);
  --surface-muted: rgba(248, 250, 252, 0.78);
  --surface-muted-strong: rgba(248, 250, 252, 0.88);
  --surface-hover: rgba(248, 250, 252, 0.95);
  --surface-control: #ffffff;
  --surface-control-raised: rgba(255, 255, 255, 0.9);
  --surface-popover: rgba(255, 255, 255, 0.98);
  --surface-overlay: rgba(15, 23, 42, 0.48);
  --surface-inverse: #111827;
  --surface-grid-line: rgba(15, 23, 42, 0.035);
  --selection-bg: rgba(224, 231, 255, 0.95);
  --selection-text: #4338ca;

  --border-default: rgba(148, 163, 184, 0.32);
  --border-strong: rgba(148, 163, 184, 0.48);
  --border-muted: rgba(148, 163, 184, 0.22);
  --border-subtle: rgba(148, 163, 184, 0.28);
  --border-control: #cbd5e1;
  --text-primary: #0f172a;
  --text-muted: #64748b;
  --text-disabled: #94a3b8;
  --text-inverse: #ffffff;
  --accent-text: #2563eb;
  --accent-text-strong: #1d4ed8;
  --accent-bg: #eff6ff;
  --status-success-text: #047857;
  --status-success-bg: #ecfdf5;
  --status-success-border: #bbf7d0;
  --status-warning-text: #b45309;
  --status-warning-bg: #fff7ed;
  --status-warning-border: #fed7aa;
  --status-danger-text: #dc2626;
  --status-danger-bg: #fef2f2;
  --status-danger-border: #fecaca;

  --font-family-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-family-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --font-size-xs: 12px;
  --font-size-sm: 13px;
  --font-size-md: 14px;
  --font-size-lg: 18px;
  --font-size-xl: 24px;
  --font-size-stat: 26px;
  --font-size-page-title: clamp(26px, 4vw, 34px);
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-strong: 500;
  --font-weight-black: 500;
  --font-weight-page-title: 500;
  --font-weight-number: 500;
  --line-height-none: 1;
  --line-height-tight: 1.2;
  --line-height-snug: 1.35;
  --line-height-copy: 1.6;
  --line-height-relaxed: 1.7;

  --radius-sm: 8px;
  --radius-option: 10px;
  --radius-md: 12px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-pill: 999px;
  --shadow-hairline: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-control: 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow-subtle: 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-panel: 0 18px 50px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 8px 26px rgba(15, 23, 42, 0.06);
  --shadow-popover: 0 20px 48px rgba(15, 23, 42, 0.16);
  --shadow-modal: 0 28px 80px rgba(15, 23, 42, 0.24);
  --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

* { box-sizing: border-box; }

html {
  overflow-y: auto;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--surface-page);
  color: var(--text-primary);
  font-family: var(--font-family-sans);
  font-weight: var(--font-weight-regular);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--surface-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--surface-grid-line) 1px, transparent 1px);
  background-size: 28px 28px;
}

[hidden], .hidden { display: none !important; }

button, input, select, textarea { font: inherit; }
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: var(--font-weight-regular);
  letter-spacing: 0;
}
strong, b { font-weight: var(--font-weight-regular); }
a { color: inherit; }

::selection {
  background: var(--selection-bg);
  color: var(--selection-text);
}

.muted {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-copy);
}

.mono {
  font-family: var(--font-family-mono);
  overflow-wrap: anywhere;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
