:root {
  --bg: #0D0D0F;
  --surface: #16161E;
  --surface2: #2A2A32;
  --border: #333340;
  --border2: #3D3D4D;
  --text: #F0F2FF;
  --muted: #8892A4;
  --brand: #4D8BFF;
  --brand-deep: #2B6FD4;
  --info: #4D8BFF;
  --success: #7BC393;
  --danger: #D97777;
  --focus: #4D8BFF;
  --tier-excellent: #7BC393;
  --tier-good: #9BBE6E;
  --tier-hold: #D9A864;
  --tier-weak: #D68B5C;
  --tier-avoid: #D97777;
  --tier-excellent-rgb: 123, 195, 147;
  --tier-good-rgb: 155, 190, 110;
  --tier-hold-rgb: 217, 168, 100;
  --tier-weak-rgb: 214, 139, 92;
  --tier-avoid-rgb: 217, 119, 119;
  --mono: "JetBrains Mono", "SF Mono", Consolas, "Liberation Mono", monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Compatibility aliases used across existing templates. */
  --orange: var(--tier-hold);
  --blue: var(--info);
  --green: var(--tier-excellent);
  --red: var(--tier-avoid);
  --dim: var(--muted);
  --dim2: var(--muted);
  --validate: var(--tier-excellent);
  --accent: var(--brand);
  --brand-glow: rgba(77, 139, 255, 0.18);
  --brand-glow-soft: rgba(77, 139, 255, 0.07);
  --radius: 10px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --border-strong: #4D5A7C;
  --shadow-soft: 0 12px 30px rgba(0, 0, 0, 0.36);
  --shadow-mid: 0 16px 42px rgba(0, 0, 0, 0.44);
  --lime: var(--tier-good);
  --purple: #8B5CF6;
}

/* ── Light theme ──────────────────────────────────────────────────── */
[data-theme="light"] {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface2: #f0f1f3;
  --border: #dde0e6;
  --border2: #c8ccd4;
  --text: #1a1d24;
  --muted: #5f6b7a;
  --brand: #2B6FD4;
  --brand-deep: #1A4FA0;
  --info: #2B6FD4;
  --success: #16a34a;
  --danger: #dc2626;
  --focus: #2B6FD4;
  --tier-excellent: #16a34a;
  --tier-good: #65a30d;
  --tier-hold: #ca8a04;
  --tier-weak: #d97706;
  --tier-avoid: #dc2626;
  --tier-excellent-rgb: 22, 163, 74;
  --tier-good-rgb: 101, 163, 13;
  --tier-hold-rgb: 202, 138, 4;
  --tier-weak-rgb: 217, 119, 6;
  --tier-avoid-rgb: 220, 38, 38;
  --orange: var(--tier-hold);
  --blue: var(--info);
  --green: var(--tier-excellent);
  --red: var(--tier-avoid);
  --dim: var(--muted);
  --dim2: var(--muted);
  --validate: var(--tier-excellent);
  --accent: var(--brand);
  --brand-glow: rgba(43, 111, 212, 0.12);
  --brand-glow-soft: rgba(43, 111, 212, 0.06);
  --border-strong: #8b9ab5;
  --shadow-soft: 0 12px 30px rgba(0, 0, 0, 0.08);
  --shadow-mid: 0 16px 42px rgba(0, 0, 0, 0.12);
  --lime: var(--tier-good);
  --purple: #7c3aed;
}

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

html {
  /* Bumped from 14px -> 15px for readability on dense data UI.
     Cascades to rem-sized text across pages (page CSS uses rem).
     Keep conservative — a further bump to 16px gave +14% global scale
     which was too disruptive to existing layouts. */
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  background: linear-gradient(135deg, #0A0A0C 0%, #0D0D0F 40%, #111118 75%, #16161E 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
  min-height: 100vh;
}
[data-theme="light"] body,
body[data-theme="light"] {
  background: linear-gradient(135deg, #eef0f4 0%, #f5f6f8 40%, #ffffff 75%, #f0f1f3 100%);
}
[data-theme="light"] ::selection {
  background: rgba(183, 142, 92, 0.24);
  color: #1a1d24;
}

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

/* Global keyboard focus indicator — uses --focus token throughout */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Remove focus ring for mouse/touch interactions only */
:focus:not(:focus-visible) {
  outline: none;
}

/* Brand text selection */
::selection {
  background: rgba(77, 139, 255, 0.32);
  color: #ffffff;
}

.outer {
  max-width: none;
  margin: 0;
  padding: 0 0 72px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 20px 0 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.site-logo {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
  text-decoration: none;
}

.site-logo span {
  color: var(--brand);
}

.link,
.head-link,
.back-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
}

.link:hover,
.head-link:hover,
.back-link:hover {
  color: var(--text);
}

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

@media (max-width: 640px) {
  .outer {
    padding: 0 0 44px;
  }
}
