/* ════════════════════════════════════════════════════════════
   Dossier Design System — Shared Styles
   ════════════════════════════════════════════════════════════ */

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

/* ── Theme Tokens — Chambers Gold ─────────────────── */
:root {
  --ds-brand-primary: #8B6914;
  --ds-brand-primary-hover: #7A5C10;
  --ds-brand-primary-subtle: rgba(139, 105, 20, 0.06);
  --ds-brand-accent: #A07B1E;
  --ds-brand-accent-subtle: rgba(160, 123, 30, 0.06);
  --ds-success: #059669;
  --ds-success-subtle: rgba(5, 150, 105, 0.08);
  --ds-info: #2563EB;
  --ds-info-subtle: rgba(37, 99, 235, 0.08);
  --ds-error: #DC2626;
  --ds-warning: #B8860B;
  --ds-font-display: 'Newsreader', Georgia, serif;
  --ds-font-body: 'Inter', system-ui, sans-serif;
  --ds-font-mono: 'JetBrains Mono', monospace;
  --ds-radius-sm: 3px;
  --ds-radius-md: 5px;
  --ds-radius-lg: 6px;
}

:root[data-theme="dark"] {
  --bg: #0C1220;
  --bg-raised: #162032;
  --bg-inset: #0A0F1A;
  --text-primary: #E8E0D4;
  --text-secondary: #9CA3AF;
  --text-tertiary: #6B7280;
  --border-default: rgba(201, 169, 110, 0.12);
  --border-subtle: rgba(201, 169, 110, 0.06);
  --border-strong: rgba(201, 169, 110, 0.25);
  --code-bg: #0D1525;
  --toggle-bg: rgba(201, 169, 110, 0.08);
  --toggle-hover: rgba(201, 169, 110, 0.12);
  --callout-bg: rgba(201, 169, 110, 0.06);
  --callout-border: rgba(201, 169, 110, 0.20);
  --graph-node-fill: #162032;
  --graph-node-stroke: rgba(201, 169, 110, 0.20);
  --graph-edge: rgba(201, 169, 110, 0.25);
  --graph-label-bg: #0C1220E6;
  --ds-brand-primary: #C9A96E;
  --ds-brand-primary-hover: #D4BA85;
  --ds-brand-accent: #D4BA85;
}

:root[data-theme="light"] {
  --bg: #F5F4ED;
  --bg-raised: #FFFFFF;
  --bg-inset: #EDECE3;
  --text-primary: #1F1B16;
  --text-secondary: #555048;
  --text-tertiary: #8A857A;
  --border-default: rgba(139, 105, 20, 0.14);
  --border-subtle: rgba(139, 105, 20, 0.08);
  --border-strong: rgba(139, 105, 20, 0.25);
  --code-bg: #EDECE3;
  --toggle-bg: #EDECE3;
  --toggle-hover: rgba(139, 105, 20, 0.10);
  --callout-bg: rgba(139, 105, 20, 0.04);
  --callout-border: rgba(139, 105, 20, 0.18);
  --graph-node-fill: #FFFFFF;
  --graph-node-stroke: rgba(139, 105, 20, 0.18);
  --graph-edge: rgba(139, 105, 20, 0.20);
  --graph-label-bg: #F5F4EDE6;
}

/* ── Base ─────────────────────────────────────────── */
html {
  font-family: var(--ds-font-body);
  background: var(--bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

::selection { background: var(--ds-brand-primary); color: #FFFFFF; }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(139, 105, 20, 0.15); border-radius: 3px; }

/* ── Legacy Top Bar (campaign page) ──────────────── */
.top-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; height: 48px;
  background: var(--bg); border-bottom: 1px solid var(--border-subtle);
  transition: background 0.3s, border-color 0.3s;
}
.top-bar-logo {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--ds-font-display); font-size: 17px; font-weight: 600;
  color: var(--ds-brand-primary); text-decoration: none; letter-spacing: -0.02em;
}
.top-bar-logo img { width: 24px; height: 24px; border-radius: 4px; }
.top-bar-right { display: flex; align-items: center; gap: 6px; }
.top-bar-link {
  font-size: 12px; font-weight: 500; color: var(--text-tertiary); text-decoration: none;
  padding: 5px 10px; border-radius: 6px; transition: all 0.15s;
}
.top-bar-link:hover { color: var(--text-primary); background: var(--toggle-bg); }
.top-bar-link.active { color: var(--text-primary); }
.top-bar-sep { width: 1px; height: 16px; background: var(--border-subtle); margin: 0 4px; }
.theme-toggle {
  width: 32px; height: 32px; border-radius: 6px;
  border: 1px solid transparent; background: transparent;
  color: var(--text-tertiary); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; font-size: 16px;
}
.theme-toggle:hover { background: var(--toggle-bg); border-color: var(--border-default); color: var(--text-primary); }

/* ── Navigation (layout.js) ──────────────────────── */
.ds-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 300;
}
.ds-nav-bar {
  background: var(--bg); border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  position: relative; z-index: 2;
}
.ds-nav.scrolled .ds-nav-bar {
  border-bottom-color: var(--border-subtle);
  box-shadow: 0 1px 12px rgba(0,0,0,0.08);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
}
.ds-nav-inner {
  max-width: 1200px; margin: 0 auto; height: 60px;
  display: flex; align-items: center; padding: 0 32px; gap: 4px;
}
.ds-nav-logo {
  display: flex; align-items: center; gap: 9px; text-decoration: none;
  font-family: var(--ds-font-display); font-size: 18px; font-weight: 600;
  color: var(--ds-brand-primary); letter-spacing: -0.02em;
  margin-right: 36px; flex-shrink: 0;
}
.ds-nav-logo img { width: 24px; height: 24px; border-radius: 5px; }
.ds-nav-links { display: flex; align-items: center; gap: 2px; flex: 1; }
.ds-nav-link, .ds-nav-dropdown-trigger {
  font-size: 14px; font-weight: 500; color: var(--text-secondary); text-decoration: none;
  padding: 8px 14px; border-radius: 6px; transition: all 0.15s; cursor: pointer;
  display: flex; align-items: center; gap: 5px; position: relative;
}
.ds-nav-link:hover, .ds-nav-dropdown-trigger:hover,
.ds-nav-dropdown-trigger.open { color: var(--text-primary); background: var(--toggle-bg); }
.ds-nav-link.active, .ds-nav-dropdown-trigger.active { color: var(--text-primary); }
.ds-nav-dropdown-trigger svg { transition: transform 0.2s; opacity: 0.4; }
.ds-nav-dropdown-trigger.open svg { transform: rotate(180deg); opacity: 0.7; }

.ds-nav-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.ds-nav-theme {
  width: 36px; height: 36px; border-radius: 8px; border: 1px solid transparent;
  background: transparent; color: var(--text-tertiary); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.15s; font-size: 16px;
}
.ds-nav-theme:hover { background: var(--toggle-bg); border-color: var(--border-default); color: var(--text-primary); }

.ds-nav-btn {
  font-size: 13px; font-weight: 600; padding: 8px 18px; border-radius: 8px;
  text-decoration: none; transition: all 0.15s; white-space: nowrap;
}
.ds-nav-btn.secondary { color: var(--text-secondary); border: 1px solid var(--border-default); }
.ds-nav-btn.secondary:hover { color: var(--text-primary); border-color: var(--border-strong); background: var(--toggle-bg); }
.ds-nav-btn.primary { background: var(--ds-brand-primary); color: #FFFFFF; }
.ds-nav-btn.primary:hover { background: var(--ds-brand-primary-hover); }

.ds-nav-mobile-toggle { display: none; }

/* ── Mega dropdown ───────────────────────────────── */
.ds-mega-backdrop {
  position: fixed; inset: 0; z-index: -1;
  background: rgba(0,0,0,0); transition: background 0.3s;
  pointer-events: none;
}
.ds-nav.dropdown-open .ds-mega-backdrop {
  background: rgba(0,0,0,0.4); pointer-events: auto;
}
.ds-dropdowns {
  position: relative; z-index: 1;
  background: var(--bg-raised); border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 12px 48px -8px rgba(0,0,0,0.25), 0 4px 16px -4px rgba(0,0,0,0.15);
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height 0.3s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.2s ease;
}
.ds-nav.dropdown-open .ds-dropdowns {
  max-height: 500px; opacity: 1;
}
.ds-dropdown-panel { display: none; }
.ds-dropdown-panel.active { display: block; }

.ds-mega-inner {
  max-width: 1200px; margin: 0 auto; padding: 24px 32px 28px;
}
.ds-mega-columns {
  display: grid; gap: 0;
}
.ds-dropdown-panel[data-cols="1"] .ds-mega-columns { grid-template-columns: 1fr; }
.ds-dropdown-panel[data-cols="2"] .ds-mega-columns { grid-template-columns: 1fr 1fr; }
.ds-dropdown-panel[data-cols="3"] .ds-mega-columns { grid-template-columns: 1fr 1fr 1fr; }

.ds-mega-col { padding: 0 8px; }
.ds-mega-col + .ds-mega-col { border-left: 1px solid var(--border-subtle); padding-left: 24px; }
.ds-mega-heading {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-tertiary); margin-bottom: 12px; padding-left: 12px;
}
.ds-mega-item {
  display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px;
  border-radius: 10px; text-decoration: none; transition: all 0.15s;
  position: relative;
}
.ds-mega-item:hover { background: var(--toggle-bg); }
.ds-mega-item.active { background: var(--toggle-bg); }
.ds-mega-icon {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  background: var(--bg-inset); color: var(--text-tertiary);
  border: 1px solid var(--border-subtle); transition: all 0.15s;
}
.ds-mega-item:hover .ds-mega-icon {
  color: var(--ds-brand-primary); border-color: var(--ds-brand-primary-subtle);
  background: var(--ds-brand-primary-subtle);
}
.ds-mega-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ds-mega-label { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.ds-mega-desc { font-size: 12px; color: var(--text-tertiary); line-height: 1.4; }
.ds-mega-arrow {
  margin-left: auto; color: var(--text-tertiary); opacity: 0; flex-shrink: 0;
  transition: opacity 0.15s, transform 0.15s; padding-top: 2px;
}
.ds-mega-item:hover .ds-mega-arrow { opacity: 1; transform: translateX(2px); }

/* ── Footer (layout.js) ─────────────────────────── */
.ds-footer {
  border-top: 1px solid var(--border-subtle); margin-top: 80px;
  background: var(--bg-inset);
}
.ds-footer-inner { max-width: 1200px; margin: 0 auto; padding: 56px 32px 36px; }
.ds-footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px; margin-bottom: 48px; }
.ds-footer-col h4 {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-tertiary); margin-bottom: 14px;
}
.ds-footer-col a {
  display: block; font-size: 13px; color: var(--text-secondary); text-decoration: none;
  padding: 4px 0; transition: color 0.15s;
}
.ds-footer-col a:hover { color: var(--ds-brand-primary); }
.ds-footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 24px; border-top: 1px solid var(--border-subtle);
}
.ds-footer-brand {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--ds-font-display); font-size: 15px; font-style: italic;
  color: var(--ds-brand-primary);
}
.ds-footer-brand img { width: 20px; height: 20px; border-radius: 4px; }
.ds-footer-copy { font-size: 12px; color: var(--text-tertiary); }

/* ── Mobile nav ──────────────────────────────────── */
@media (max-width: 768px) {
  .ds-nav-links, .ds-nav-btn.secondary { display: none; }
  .ds-nav-inner { height: 52px; padding: 0 20px; }
  .ds-nav-mobile-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 8px; border: none;
    background: transparent; color: var(--text-secondary); cursor: pointer;
    margin-left: auto;
  }
  .ds-nav.mobile-open .ds-nav-links {
    display: flex; flex-direction: column; position: absolute;
    top: 52px; left: 0; right: 0; background: var(--bg);
    border-bottom: 1px solid var(--border-subtle); padding: 8px 16px 16px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.15);
  }
  .ds-nav-actions .ds-nav-btn.primary { font-size: 12px; padding: 7px 14px; }
  .ds-mega-columns { grid-template-columns: 1fr !important; }
  .ds-mega-col + .ds-mega-col { border-left: none; padding-left: 8px; border-top: 1px solid var(--border-subtle); padding-top: 16px; margin-top: 12px; }
  .ds-footer-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .ds-footer-bottom { flex-direction: column; gap: 8px; align-items: flex-start; }
}

/* ── Layout ──────────────────────────────────────── */
.page { max-width: 960px; margin: 0 auto; padding: 100px 32px 0; }

/* ── Header ──────────────────────────────────────── */
.header { margin-bottom: 20px; }
.header h1 {
  font-family: var(--ds-font-display); font-size: clamp(36px, 5vw, 52px); font-weight: 400;
  letter-spacing: -0.03em; line-height: 1.12; margin-bottom: 16px;
}
.header h1 em { font-style: italic; color: var(--ds-brand-primary); }
.header .subtitle { font-size: 16px; color: var(--text-secondary); line-height: 1.7; max-width: 640px; }

/* ── Sections ────────────────────────────────────── */
.section { margin-top: 72px; }
.section h2 {
  font-family: var(--ds-font-display); font-size: 32px; font-weight: 400;
  letter-spacing: -0.025em; margin-bottom: 12px; padding-top: 36px;
  border-top: 1px solid var(--border-subtle);
}
.section h3 {
  font-size: 15px; font-weight: 600; color: var(--text-primary);
  margin: 36px 0 10px; letter-spacing: 0.01em;
}
.section p, .section li {
  font-size: 14px; color: var(--text-secondary); line-height: 1.75; max-width: 640px;
}
.section p { margin-bottom: 12px; }
.section p strong { color: var(--text-primary); font-weight: 500; }
.section ul, .section ol { padding-left: 20px; margin-bottom: 12px; }
.section li { margin-bottom: 4px; }

/* ── Nav (in-page secondary) ─────────────────────── */
.nav {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 48px;
  padding: 12px 0; border-bottom: 1px solid var(--border-subtle);
}
.nav a {
  font-size: 12px; color: var(--text-tertiary); text-decoration: none;
  padding: 4px 10px; border-radius: 100px; transition: all 0.15s;
  border: 1px solid transparent;
}
.nav a:hover { color: var(--text-primary); border-color: var(--border-default); background: var(--bg-raised); }

/* ── Tags (pills) ────────────────────────────────── */
.tag { display: inline-block; font-size: 11px; font-family: var(--ds-font-mono); padding: 2px 8px; border-radius: 100px; font-weight: 500; }
.tag.terra { background: var(--ds-brand-primary-subtle); color: var(--ds-brand-primary); }
.tag.accent { background: var(--ds-brand-accent-subtle); color: var(--ds-brand-accent); }
.tag.blue { background: var(--ds-info-subtle); color: var(--ds-info); }
.tag.green { background: var(--ds-success-subtle); color: var(--ds-success); }

/* ── Callout ─────────────────────────────────────── */
.callout {
  background: var(--callout-bg); border-left: 3px solid var(--callout-border);
  border-radius: 0 var(--ds-radius-sm) var(--ds-radius-sm) 0;
  padding: 14px 18px; margin: 16px 0; font-size: 13px; color: var(--text-secondary); line-height: 1.7; max-width: 640px;
}
.callout strong { color: var(--ds-brand-primary); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
.callout code { font-family: var(--ds-font-mono); font-size: 11.5px; background: var(--code-bg); padding: 1px 5px; border-radius: 4px; }

/* ── Graph containers + SVG theming ──────────────── */
.graph-wrap {
  background: var(--bg-raised); border: 1px solid var(--border-subtle);
  border-radius: var(--ds-radius-lg); padding: 24px; margin: 20px 0; overflow-x: auto;
}
.graph-wrap .graph-title {
  font-size: 11px; font-weight: 600; color: var(--text-tertiary);
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 16px;
}
.graph-wrap svg { display: block; margin: 0 auto; }
.graph-wrap svg .node-rect { fill: var(--graph-node-fill); stroke: var(--graph-node-stroke); stroke-width: 1.5; rx: 8; }
.graph-wrap svg .node-rect.primary { stroke: var(--ds-brand-primary); }
.graph-wrap svg .node-rect.accent { stroke: var(--ds-brand-accent); }
.graph-wrap svg .node-rect.info { stroke: var(--ds-info); }
.graph-wrap svg .node-rect.success { stroke: var(--ds-success); }
.graph-wrap svg .node-rect.warn { stroke: var(--ds-warning); }
.graph-wrap svg .node-label { fill: var(--text-primary); font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 600; }
.graph-wrap svg .node-sub { fill: var(--text-tertiary); font-family: 'Inter', sans-serif; font-size: 10px; }
.graph-wrap svg .edge-line { stroke: var(--graph-edge); stroke-width: 1.5; fill: none; }
.graph-wrap svg .edge-arrow { fill: var(--graph-edge); }
.graph-wrap svg .edge-label { fill: var(--text-tertiary); font-family: 'JetBrains Mono', monospace; font-size: 10px; }
.graph-wrap svg .edge-label-bg { fill: var(--graph-label-bg); }
.graph-wrap svg .group-rect { fill: none; stroke: var(--border-subtle); stroke-width: 1; stroke-dasharray: 6 4; rx: 12; }
.graph-wrap svg .group-label { fill: var(--text-tertiary); font-family: 'Inter', sans-serif; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
.graph-wrap svg .field-label { fill: var(--ds-brand-accent); font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 400; }

/* ── Entity cards ────────────────────────────────── */
.entity-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 20px 0; }
.entity-card {
  background: var(--bg-raised); border: 1px solid var(--border-subtle);
  border-radius: var(--ds-radius-lg); padding: 22px 24px; transition: border-color 0.2s;
}
.entity-card:hover { border-color: var(--border-strong); }
.entity-card.span-2 { grid-column: 1 / -1; }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.card-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 17px; font-weight: 600;
}
.card-icon.terra { background: var(--ds-brand-primary-subtle); color: var(--ds-brand-primary); }
.card-icon.accent { background: var(--ds-brand-accent-subtle); color: var(--ds-brand-accent); }
.card-icon.blue { background: var(--ds-info-subtle); color: var(--ds-info); }
.card-icon.green { background: var(--ds-success-subtle); color: var(--ds-success); }
.card-title { font-size: 16px; font-weight: 600; }
.card-sub { font-size: 11px; color: var(--text-tertiary); font-family: var(--ds-font-mono); margin-top: 2px; }
.card-body { font-size: 13px; color: var(--text-secondary); line-height: 1.7; }
.card-body code { font-family: var(--ds-font-mono); font-size: 11.5px; background: var(--code-bg); padding: 1px 5px; border-radius: 4px; }

/* ── Type tables ─────────────────────────────────── */
.type-table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 13px; }
.type-table th {
  text-align: left; font-size: 11px; font-weight: 600; color: var(--text-tertiary);
  text-transform: uppercase; letter-spacing: 0.05em; padding: 8px 12px;
  border-bottom: 1px solid var(--border-default);
}
.type-table td { padding: 8px 12px; border-bottom: 1px solid var(--border-subtle); color: var(--text-secondary); vertical-align: top; }
.type-table td:first-child { color: var(--text-primary); font-weight: 500; font-family: var(--ds-font-mono); font-size: 12px; white-space: nowrap; }
.type-table td code { font-family: var(--ds-font-mono); font-size: 11px; background: var(--code-bg); padding: 1px 4px; border-radius: 3px; }
.type-table tr:last-child td { border-bottom: none; }

/* ── Scope table ─────────────────────────────────── */
.scope-table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 12px; }
.scope-table th { text-align: center; font-size: 11px; font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.04em; padding: 8px 10px; border-bottom: 1px solid var(--border-default); }
.scope-table th:first-child { text-align: left; }
.scope-table td { padding: 8px 10px; border-bottom: 1px solid var(--border-subtle); color: var(--text-secondary); text-align: center; }
.scope-table td:first-child { text-align: left; font-weight: 500; color: var(--text-primary); font-size: 12px; }
.scope-table .yes { color: var(--ds-success); font-weight: 600; }
.scope-table .no { color: var(--text-tertiary); }
.scope-table tr:last-child td { border-bottom: none; }

/* ── Code blocks + syntax highlighting ───────────── */
.code-block {
  background: var(--code-bg); border: 1px solid var(--border-subtle);
  border-radius: var(--ds-radius-md); padding: 18px 22px; margin: 16px 0; overflow-x: auto;
}
.code-block pre { font-family: var(--ds-font-mono); font-size: 12px; line-height: 1.7; color: var(--text-secondary); white-space: pre; margin: 0; }
.code-block .label { color: var(--ds-brand-primary); font-weight: 500; font-size: 11px; letter-spacing: 0.04em; display: block; margin-bottom: 10px; }
.code-block .key { color: var(--ds-info); }
.code-block .str { color: var(--ds-success); }
.code-block .num { color: var(--ds-brand-accent); }
.code-block .bool { color: var(--ds-brand-accent); }
.code-block .comment { color: var(--text-tertiary); font-style: italic; }
.code-block .kw { color: var(--ds-brand-primary); }

/* ── Naming grid ─────────────────────────────────── */
.naming-grid { display: grid; grid-template-columns: 1fr; gap: 2px; margin: 20px 0; }
.naming-row {
  display: grid; grid-template-columns: 28px 130px 1fr 100px;
  gap: 0; align-items: stretch; font-size: 13px;
  background: var(--bg-raised); border: 1px solid var(--border-subtle); border-radius: 0;
}
.naming-row:first-child { border-radius: var(--ds-radius-md) var(--ds-radius-md) 0 0; }
.naming-row:last-child { border-radius: 0 0 var(--ds-radius-md) var(--ds-radius-md); }
.naming-row.header-row { background: var(--bg-inset); font-size: 11px; font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.04em; }
.naming-cell { padding: 10px 14px; border-right: 1px solid var(--border-subtle); display: flex; align-items: center; }
.naming-cell:last-child { border-right: none; }
.naming-cell.num { justify-content: center; font-family: var(--ds-font-mono); font-size: 11px; color: var(--text-tertiary); }
.naming-cell.name { font-weight: 600; color: var(--text-primary); font-family: var(--ds-font-mono); font-size: 12px; }
.naming-cell.desc { color: var(--text-secondary); font-size: 12px; }

/* ── Layer tags ──────────────────────────────────── */
.layer-tag { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 100px; }
.layer-tag.vocab { background: var(--ds-warning); color: var(--bg); }
.layer-tag.comp { background: var(--ds-info-subtle); color: var(--ds-info); }
.layer-tag.runtime { background: var(--ds-brand-accent-subtle); color: var(--ds-brand-accent); }
.layer-tag.producer { background: var(--ds-success-subtle); color: var(--ds-success); }

/* ── Retired names ───────────────────────────────── */
.retired { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--border-subtle); border-radius: var(--ds-radius-sm); font-size: 12px; color: var(--text-tertiary); margin: 4px; }
.retired .old { text-decoration: line-through; }

/* ── Flow examples ───────────────────────────────── */
.flow-example { background: var(--bg-raised); border: 1px solid var(--border-subtle); border-radius: var(--ds-radius-lg); padding: 18px; margin-bottom: 12px; }
.flow-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 10px; }
.flow-pipe { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11px; font-family: var(--ds-font-mono); }
.flow-pipe .chip { padding: 4px 10px; border-radius: 6px; }
.flow-pipe .chip-source { background: var(--ds-success-subtle); color: var(--ds-success); }
.flow-pipe .chip-schema { background: var(--ds-warning); color: var(--bg); font-weight: 600; }
.flow-pipe .chip-binding { background: var(--ds-info-subtle); color: var(--ds-info); }
.flow-pipe .chip-field { background: var(--ds-brand-accent-subtle); color: var(--ds-brand-accent); }
.flow-pipe .chip-entry { background: var(--ds-brand-primary-subtle); color: var(--ds-brand-primary); }
.flow-pipe .chip-neutral { background: var(--bg-inset); color: var(--text-secondary); }
.flow-pipe .arrow { color: var(--text-tertiary); }

/* ── Card grid ───────────────────────────────────── */
.card-grid { display: grid; gap: 12px; margin: 20px 0; }
.card-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.card-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.card-grid.cols-full { grid-template-columns: 1fr; }
.card { background: var(--bg-raised); border: 1px solid var(--border-subtle); border-radius: var(--ds-radius-lg); padding: 16px; }
.card.highlight { border-color: var(--ds-brand-primary); }
.card.dashed { border-style: dashed; }
.card .card-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.card .card-body { font-size: 11px; color: var(--text-secondary); line-height: 1.6; }
.card-mono { font-size: 10px; color: var(--text-tertiary); margin-top: 6px; font-family: var(--ds-font-mono); }

/* ── Timeline ────────────────────────────────────── */
.timeline { margin: 20px 0; }
.tl-row { display: grid; grid-template-columns: 90px 160px 1fr 120px 60px; gap: 0; font-size: 11px; border-bottom: 1px solid var(--border-subtle); }
.tl-row.tl-head { font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; font-size: 10px; letter-spacing: 0.04em; background: var(--bg-inset); border-radius: var(--ds-radius-md) var(--ds-radius-md) 0 0; }
.tl-cell { padding: 8px 12px; border-right: 1px solid var(--border-subtle); color: var(--text-secondary); }
.tl-cell:last-child { border-right: none; }
.tl-cell.key { font-family: var(--ds-font-mono); color: var(--ds-brand-accent); font-size: 10px; }
.tl-cell.val { color: var(--text-primary); }
.tl-cell.src { font-size: 10px; }
.tl-cell.src.manual { color: var(--ds-success); }
.tl-cell.src.credit { color: var(--ds-info); }
.tl-cell.src.case-mgmt { color: var(--ds-brand-primary); }
.tl-cell.time { font-size: 10px; color: var(--text-tertiary); font-family: var(--ds-font-mono); }
.tl-confirm { font-size: 10px; text-align: center; }
.tl-confirm .pending { color: var(--ds-warning); }
.tl-confirm .ok { color: var(--ds-success); }

/* ── ID decoder ──────────────────────────────────── */
.id-decoder { display: flex; align-items: center; gap: 0; margin: 20px 0; flex-wrap: wrap; justify-content: center; }
.id-seg {
  font-family: var(--ds-font-mono); font-size: 16px; font-weight: 600;
  padding: 10px 14px; border: 1px solid var(--border-subtle); position: relative;
}
.id-seg:first-child { border-radius: var(--ds-radius-sm) 0 0 var(--ds-radius-sm); }
.id-seg:last-child { border-radius: 0 var(--ds-radius-sm) var(--ds-radius-sm) 0; }
.id-seg + .id-seg { border-left: none; }
.id-seg .seg-label {
  position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%);
  font-family: var(--ds-font-body); font-size: 10px; font-weight: 500;
  color: var(--text-tertiary); white-space: nowrap; letter-spacing: 0.03em;
}
.id-sep { font-family: var(--ds-font-mono); font-size: 16px; color: var(--text-tertiary); padding: 10px 2px; }
.id-seg.seg-type { background: var(--ds-brand-primary-subtle); color: var(--ds-brand-primary); }
.id-seg.seg-domain { background: var(--ds-brand-accent-subtle); color: var(--ds-brand-accent); }
.id-seg.seg-const { background: var(--bg-raised); color: var(--text-tertiary); }
.id-seg.seg-name { background: var(--ds-info-subtle); color: var(--ds-info); }

/* ── Data tables (pricing/legal) ─────────────────── */
.data-table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 13px; }
.data-table th { text-align: left; font-size: 11px; font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; padding: 8px 12px; border-bottom: 1px solid var(--border-default); }
.data-table th.right { text-align: right; }
.data-table td { padding: 8px 12px; border-bottom: 1px solid var(--border-subtle); color: var(--text-secondary); vertical-align: top; }
.data-table td:first-child { color: var(--text-primary); font-weight: 500; }
.data-table td.right { text-align: right; font-family: var(--ds-font-mono); font-size: 12px; }
.data-table td.mono { font-family: var(--ds-font-mono); font-size: 12px; }
.data-table td code { font-family: var(--ds-font-mono); font-size: 11px; background: var(--code-bg); padding: 1px 4px; border-radius: 3px; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr.total td { border-top: 2px solid var(--border-default); font-weight: 600; color: var(--text-primary); }

/* ── Footer ─────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 32px 0 48px;
  margin-top: 80px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--text-tertiary);
}
.site-footer a {
  color: var(--text-tertiary); text-decoration: none; transition: color 0.15s;
}
.site-footer a:hover { color: var(--text-primary); }
.footer-links { display: flex; gap: 16px; }

/* ── Top bar nav separator (thin dot) ────────────── */
.top-bar-dot { color: var(--text-tertiary); font-size: 8px; margin: 0 2px; user-select: none; }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 780px) {
  .card-grid.cols-2, .card-grid.cols-3 { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .entity-grid { grid-template-columns: 1fr; }
  .page { padding: 80px 20px 80px; }
  .header h1 { font-size: 32px; }
}
