/* ==========================================================================
   Riskovate AI Labs explainer design system (Copilot Navigator)
   ========================================================================== */

/* ---------- Design Tokens ---------- */
:root {
  /* Tier colours */
  --grey: #6b7280;
  --grey-bg: #f3f4f6;
  --grey-border: #d1d5db;
  --blue: #2563eb;
  --blue-bg: #eff6ff;
  --blue-border: #93c5fd;
  --gold: #c9a227;
  --gold-bg: #fef9e7;
  --gold-border: #f0d060;

  /* Status colours */
  --status-retired: #991b1b;
  --status-retired-bg: #fef2f2;
  --status-broken: #dc2626;
  --status-broken-bg: #fef2f2;
  --status-buggy: #d97706;
  --status-buggy-bg: #fffbeb;
  --status-working: #16a34a;
  --status-working-bg: #f0fdf4;
  --status-new: #2563eb;
  --status-new-bg: #eff6ff;

  /* Neutral palette */
  --bg: #ffffff;
  --bg-subtle: #f9fafb;
  --bg-muted: #f3f4f6;
  --text: #111827;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --border: #e5e7eb;
  --border-strong: #d1d5db;

  /* Accent: Riskovate green, the one thread back to the parent brand */
  --accent: #0B5520;
  --accent-hover: #083F18;
  --accent-bg: #EEF4EF;
  --accent-tint: rgba(11, 85, 32, 0.05);

  /* Spacing scale (4px base) */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;

  /* Typography */
  --font: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;

  /* Misc */
  --radius-sm: 0.375rem;
  --radius: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --transition: 150ms ease;
  --transition-slow: 300ms ease;
  --max-width: 1280px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-subtle);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
button { cursor: pointer; font: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
fieldset { border: none; }
legend { font-weight: 600; }

/* ---------- Utilities ---------- */
.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;
}
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--sp-4); }

/* ---------- Skip Link ---------- */
.skip-link {
  position: absolute; top: -100%; left: var(--sp-4);
  background: var(--accent); color: #fff;
  padding: var(--sp-2) var(--sp-4); border-radius: var(--radius);
  z-index: 1000; font-weight: 600;
}
.skip-link:focus { top: var(--sp-2); }

/* ---------- Site Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.header-inner {
  max-width: var(--max-width); margin: 0 auto;
  padding: var(--sp-3) var(--sp-4);
  display: flex; align-items: center;
  justify-content: space-between; gap: var(--sp-4);
}
.header-brand { display: flex; align-items: center; gap: var(--sp-3); }
.header-icon { flex-shrink: 0; height: 28px; width: auto; }
.header-title {
  font-size: var(--text-xl); font-weight: 700;
  letter-spacing: -0.02em;
}
.header-titles { display: flex; flex-direction: column; line-height: 1.2; }
.header-byline {
  font-size: var(--text-xs); font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
}
.header-byline:hover { color: var(--text-secondary); }

/* Freshness Badge */
.freshness-badge {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-3);
  background: var(--status-working-bg);
  color: var(--status-working);
  border: 1px solid rgba(22, 163, 74, 0.2);
  border-radius: 9999px;
  font-size: var(--text-sm); font-weight: 500;
  white-space: nowrap;
}
.freshness-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--status-working);
  animation: pulse-dot 4s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); }
}

/* ---------- Section Nav ---------- */
.section-nav {
  position: sticky; top: 57px; z-index: 90;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.section-nav::-webkit-scrollbar { display: none; }
.nav-inner {
  max-width: var(--max-width); margin: 0 auto;
  padding: 0 var(--sp-4);
  display: flex; gap: var(--sp-1);
}
.nav-link {
  display: block; padding: var(--sp-3) var(--sp-4);
  font-size: var(--text-sm); font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}
.nav-link:hover { color: var(--text); text-decoration: none; }
.nav-link.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---------- Scenario Panel ---------- */
.scenario-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--sp-6);
  margin: var(--sp-6) auto;
  max-width: var(--max-width);
  box-shadow: var(--shadow);
}
.scenario-title {
  font-size: var(--text-lg); font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: var(--sp-1);
}
.scenario-subtitle {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin-bottom: var(--sp-6);
}
.scenario-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-6);
}
.control-group {}
.control-label {
  font-size: var(--text-sm); font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--sp-3);
  display: block;
}

/* Tier Buttons */
.tier-selector { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.tier-btn {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  font-size: var(--text-sm); font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.tier-btn:hover { border-color: var(--border-strong); color: var(--text); }
.tier-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.tier-btn[aria-checked="true"].tier-free {
  border-color: var(--grey); background: var(--grey-bg); color: var(--grey);
  box-shadow: 0 0 0 1px var(--grey);
}
.tier-btn[aria-checked="true"].tier-chat {
  border-color: var(--blue); background: var(--blue-bg); color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
}
.tier-btn[aria-checked="true"].tier-m365 {
  border-color: var(--gold); background: var(--gold-bg); color: #92700c;
  box-shadow: 0 0 0 1px var(--gold);
}

.tier-btn-icon {
  width: 10px; height: 10px; flex-shrink: 0;
  border: 1.5px solid currentColor; border-radius: 50%;
}
.tier-btn-icon.icon-half { background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.tier-btn-icon.icon-full { background: currentColor; }

/* Line icons (inline SVG) */
.icon { width: 18px; height: 18px; flex-shrink: 0; }
.prompt-view-icon .icon { width: 28px; height: 28px; margin: 0 auto; color: var(--text-secondary); }

/* App Checkboxes */
.app-checkboxes { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.app-checkbox {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}
.app-checkbox:hover { border-color: var(--border-strong); }
.app-checkbox input { position: absolute; opacity: 0; width: 0; height: 0; }
.checkbox-visual {
  width: 16px; height: 16px;
  border: 2px solid var(--border-strong);
  border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}
.checkbox-visual::after {
  content: ''; display: block;
  width: 8px; height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
  opacity: 0;
  transition: opacity var(--transition);
}
.app-checkbox input:checked + .checkbox-visual {
  background: var(--accent); border-color: var(--accent);
}
.app-checkbox input:checked + .checkbox-visual::after { opacity: 1; }
.app-checkbox input:focus-visible + .checkbox-visual {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.app-note {
  font-size: var(--text-xs); color: var(--status-buggy);
  margin-top: var(--sp-2);
}

/* Storage Radios */
.storage-radios { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.storage-radio {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}
.storage-radio:hover { border-color: var(--border-strong); }
.storage-radio input { position: absolute; opacity: 0; width: 0; height: 0; }
.storage-radio:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-bg);
  color: var(--accent);
}
.storage-radio:has(input:focus-visible) {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.radio-visual { font-size: var(--text-lg); line-height: 1; }

/* ---------- Section Cards ---------- */
.section-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  margin-bottom: var(--sp-6);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-slow);
}
.section-card:hover { box-shadow: var(--shadow-md); }
.section-header {
  display: flex; align-items: flex-start; gap: var(--sp-4);
  padding: var(--sp-6);
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}
.section-number {
  font-size: var(--text-3xl); font-weight: 700;
  color: var(--text); line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  min-width: 56px;
}
.section-title {
  font-size: var(--text-xl); font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: var(--sp-1);
}
.section-key-message {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-style: italic;
}
.section-body { padding: var(--sp-6); }

/* ---------- Content Components ---------- */

/* Comparison Table */
.comparison-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: var(--sp-4) 0;
}
.comparison-table {
  width: 100%; border-collapse: collapse;
  font-size: var(--text-sm);
}
.comparison-table th,
.comparison-table td {
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.comparison-table th {
  font-weight: 600;
  background: var(--bg-subtle);
  white-space: nowrap;
}
.comparison-table thead th { border-bottom: 2px solid var(--border-strong); }
.comparison-table .col-free { }
.comparison-table .col-chat { }
.comparison-table .col-m365 { }
.comparison-table .col-highlight {
  background: var(--accent-tint);
}
.comparison-table .col-dim { opacity: 0.5; }

/* Tier column headers */
.tier-col-header {
  padding: var(--sp-3) var(--sp-4);
  font-weight: 600; text-align: center;
  border-radius: var(--radius) var(--radius) 0 0;
}
.tier-col-header.free-header { background: var(--grey-bg); color: var(--grey); }
.tier-col-header.chat-header { background: var(--blue-bg); color: var(--blue); }
.tier-col-header.m365-header { background: var(--gold-bg); color: #92700c; }

/* Status indicators */
.status-yes {
  color: var(--status-working); font-weight: 600;
}
.status-yes::before { content: '✓ '; }
.status-no {
  color: var(--status-broken); font-weight: 500;
}
.status-no::before { content: '✗ '; }
.status-partial {
  color: var(--status-buggy); font-weight: 500;
}
.status-partial::before { content: '⚠ '; }
.status-na {
  color: var(--text-muted); font-style: italic;
}

/* Callout Boxes */
.callout-box {
  border-left: 4px solid var(--border-strong);
  background: var(--bg-subtle);
  padding: var(--sp-4) var(--sp-5);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: var(--sp-4) 0;
  font-size: var(--text-sm);
}
.callout-box.callout-warning {
  border-left-color: var(--status-buggy);
  background: var(--status-buggy-bg);
}
.callout-box.callout-danger {
  border-left-color: var(--status-broken);
  background: var(--status-broken-bg);
}
.callout-box.callout-success {
  border-left-color: var(--status-working);
  background: var(--status-working-bg);
}
.callout-box.callout-info {
  border-left-color: var(--blue);
  background: var(--blue-bg);
}
.callout-title {
  font-weight: 700;
  margin-bottom: var(--sp-2);
}

/* Timeline */
.timeline {
  display: flex;
  gap: 0;
  margin: var(--sp-6) 0;
  position: relative;
}
.timeline::before {
  content: '';
  position: absolute;
  top: 14px; left: 0; right: 0;
  height: 3px;
  background: var(--border);
}
.timeline-item {
  flex: 1;
  position: relative;
  padding-top: var(--sp-8);
  padding-right: var(--sp-3);
}
.timeline-item::before {
  content: '';
  position: absolute;
  top: 8px; left: 0;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 3px solid var(--border);
  background: var(--bg);
  z-index: 1;
}
.timeline-item.status-retired::before { border-color: var(--status-retired); background: var(--status-retired); }
.timeline-item.status-broken::before { border-color: var(--status-broken); background: var(--status-broken); }
.timeline-item.status-buggy::before { border-color: var(--status-buggy); background: var(--status-buggy); }
.timeline-item.status-working::before { border-color: var(--status-working); background: var(--status-working); }
.timeline-item.status-new::before { border-color: var(--status-new); background: var(--status-new); }
.timeline-date {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--sp-1);
}
.timeline-label {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--sp-1);
}
.timeline-detail {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.4;
}
.timeline-status-badge {
  display: inline-block;
  padding: 1px var(--sp-2);
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--sp-1);
}
.timeline-status-badge.retired { background: var(--status-retired-bg); color: var(--status-retired); }
.timeline-status-badge.broken { background: var(--status-broken-bg); color: var(--status-broken); }
.timeline-status-badge.buggy { background: var(--status-buggy-bg); color: var(--status-buggy); }
.timeline-status-badge.working { background: var(--status-working-bg); color: var(--status-working); }
.timeline-status-badge.new { background: var(--status-new-bg); color: var(--status-new); }

/* Hub and Spoke */
.hub-spoke {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: var(--sp-6) auto;
  aspect-ratio: 1;
}
.hub-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 120px; height: 120px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--text);
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  font-weight: 700;
  font-size: var(--text-sm);
  z-index: 2;
  box-shadow: var(--shadow-lg);
  padding: var(--sp-2);
}
.spoke {
  position: absolute;
  width: 110px;
  text-align: center;
  z-index: 2;
}
.spoke-dot {
  width: 48px; height: 48px;
  border-radius: 50%;
  margin: 0 auto var(--sp-2);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-lg);
  border: 2px solid var(--border);
  background: var(--bg);
  transition: all var(--transition-slow);
  box-shadow: var(--shadow-sm);
}
.spoke-dot.tier-free-dot { border-color: var(--grey); color: var(--grey); }
.spoke-dot.tier-chat-dot { border-color: var(--blue); color: var(--blue); background: var(--blue-bg); }
.spoke-dot.tier-m365-dot { border-color: var(--gold); color: #92700c; background: var(--gold-bg); }
.spoke-dot.spoke-active {
  transform: scale(1.15);
  box-shadow: var(--shadow-md);
}
.spoke-dot.spoke-inactive { opacity: 0.35; }
.spoke-name {
  font-size: var(--text-xs);
  font-weight: 600;
}
.spoke-desc {
  font-size: 0.6875rem;
  color: var(--text-secondary);
  line-height: 1.3;
  margin-top: 2px;
}
.spoke-line {
  position: absolute;
  top: 50%; left: 50%;
  height: 2px;
  background: var(--border);
  transform-origin: left center;
  z-index: 1;
}

/* Hub spoke mobile fallback */
.hub-spoke-list {
  display: none;
  flex-direction: column;
  gap: var(--sp-3);
  margin: var(--sp-4) 0;
}
.spoke-list-item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  transition: all var(--transition);
}
.spoke-list-dot {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: var(--text-base);
  border: 2px solid var(--border);
  background: var(--bg);
}
.spoke-list-dot.tier-free-dot { border-color: var(--grey); color: var(--grey); }
.spoke-list-dot.tier-chat-dot { border-color: var(--blue); color: var(--blue); background: var(--blue-bg); }
.spoke-list-dot.tier-m365-dot { border-color: var(--gold); color: #92700c; background: var(--gold-bg); }
.spoke-list-dot.spoke-active { box-shadow: var(--shadow); }
.spoke-list-dot.spoke-inactive { opacity: 0.35; }
.spoke-list-info { flex: 1; }
.spoke-list-name { font-weight: 600; }
.spoke-list-desc { color: var(--text-secondary); font-size: var(--text-xs); }

/* Tree Diagram */
.tree-container { margin: var(--sp-4) 0; }
.tree-root {
  text-align: center;
  padding: var(--sp-3) var(--sp-6);
  background: var(--bg-muted);
  border: 2px solid var(--text);
  border-radius: var(--radius-lg);
  font-weight: 700;
  font-size: var(--text-lg);
  display: inline-block;
  margin: 0 auto var(--sp-4);
}
.tree-root-wrapper { text-align: center; }
.tree-branches {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
  position: relative;
}
.tree-branch {
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  position: relative;
}
.tree-branch::before {
  content: '';
  position: absolute;
  top: -18px; left: 50%;
  width: 2px; height: 18px;
  background: var(--border-strong);
}
.tree-branch.branch-free { border-color: var(--grey); }
.tree-branch.branch-free .tree-branch-title { color: var(--grey); }
.tree-branch.branch-chat { border-color: var(--blue); }
.tree-branch.branch-chat .tree-branch-title { color: var(--blue); }
.tree-branch.branch-m365 { border-color: var(--gold); }
.tree-branch.branch-m365 .tree-branch-title { color: #92700c; }
.tree-branch-title {
  font-weight: 700;
  font-size: var(--text-base);
  margin-bottom: var(--sp-1);
}
.tree-branch-audience {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-bottom: var(--sp-3);
}
.tree-branch-features {
  list-style: none;
  font-size: var(--text-sm);
}
.tree-branch-features li {
  padding: var(--sp-1) 0;
  border-bottom: 1px solid var(--border);
}
.tree-branch-features li:last-child { border-bottom: none; }

/* Naming Timeline (compact) */
.naming-timeline {
  margin-top: var(--sp-6);
  font-size: var(--text-sm);
}
.naming-timeline-title {
  font-weight: 700;
  margin-bottom: var(--sp-3);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.naming-entry {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--border);
}
.naming-entry:last-child { border-bottom: none; }
.naming-date {
  font-weight: 600;
  white-space: nowrap;
  color: var(--text-secondary);
  min-width: 80px;
}

/* Flow Diagram (VIS-03) */
.flow-diagram {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin: var(--sp-4) 0;
}
.flow-path {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: var(--text-sm);
  transition: all var(--transition);
}
.flow-path.flow-blocked { }
.flow-path.flow-allowed { }
.flow-path.flow-highlight {
  border-color: var(--accent);
  background: var(--accent-bg);
}
.flow-path-label { flex: 1; font-weight: 500; }
.flow-path-arrow { color: var(--text-muted); }
.flow-path-result { font-weight: 600; }

/* Desktop vs Web cards */
.versus-container {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--sp-4);
  align-items: start;
  margin: var(--sp-4) 0;
}
.versus-divider {
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--text-muted);
  font-size: var(--text-2xl);
  padding-top: var(--sp-8);
}

/* Bug List */
.bug-list {
  list-style: none;
  margin: var(--sp-4) 0;
}
.bug-item {
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--border);
  border-left: 4px solid var(--status-broken);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: var(--sp-2);
  font-size: var(--text-sm);
}
.bug-item-title { font-weight: 600; margin-bottom: var(--sp-1); }

/* Prompt Lab Views */
.prompt-views {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--sp-3);
  margin: var(--sp-4) 0;
}
.prompt-view-card {
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  font-size: var(--text-sm);
}
.prompt-view-icon {
  font-size: var(--text-2xl);
  margin-bottom: var(--sp-2);
}

/* Source References */
.source-ref {
  font-size: var(--text-xs);
  color: var(--accent);
  vertical-align: super;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  padding: 0 1px;
}
.source-ref:hover { text-decoration: underline; }

/* Sub-section headings */
.subsection-title {
  font-size: var(--text-base);
  font-weight: 700;
  margin: var(--sp-6) 0 var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--border);
}
.subsection-title:first-child { margin-top: 0; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: var(--sp-8) 0;
  margin-top: var(--sp-8);
}
.footer-sources h2 {
  font-size: var(--text-base);
  margin-bottom: var(--sp-4);
}
#source-list {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  padding-left: var(--sp-6);
}
#source-list li { margin-bottom: var(--sp-2); }
#source-list a { word-break: break-all; }
.footer-meta {
  margin-top: var(--sp-6);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.disclaimer { margin-top: var(--sp-2); }

/* Riskovate Links */
.footer-riskovate {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: var(--sp-6);
}
.footer-riskovate a {
  color: var(--text-muted);
  transition: color var(--transition);
}
.footer-riskovate a:hover { color: var(--text-secondary); }
.riskovate-sep { color: var(--border-strong); }

/* Colophon */
.footer-colophon {
  border-left: 3px solid var(--border-strong);
  background: var(--bg-subtle);
  padding: var(--sp-4) var(--sp-5);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--sp-6);
  line-height: 1.6;
}
.footer-colophon p + p { margin-top: var(--sp-2); }
.colophon-label {
  font-size: var(--text-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted);
}
.footer-colophon a { color: var(--text-secondary); text-decoration: underline; }
.footer-colophon a:hover { color: var(--text); }

/* ---------- Responsive ---------- */

/* Tablet (768px+) */
@media (min-width: 768px) {
  .scenario-controls {
    grid-template-columns: 1fr 1fr;
  }
  .control-group:first-child {
    grid-column: 1 / -1;
  }
  .versus-container {
    grid-template-columns: 1fr auto 1fr;
  }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
  .scenario-controls {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .control-group:first-child {
    grid-column: auto;
  }
}

/* Mobile (below 768px) */
@media (max-width: 767px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-2);
  }
  .header-title { font-size: var(--text-lg); }
  .section-header {
    padding: var(--sp-4);
    flex-direction: column;
    gap: var(--sp-2);
  }
  .section-number { font-size: var(--text-xl); }
  .section-body { padding: var(--sp-4); }
  .tree-branches { grid-template-columns: 1fr; }
  .tree-branch::before { display: none; }
  .versus-container { grid-template-columns: 1fr; }
  .versus-divider {
    padding-top: 0;
    font-size: var(--text-lg);
  }
  .hub-spoke { display: none; }
  .hub-spoke-list { display: flex; }

  /* Timeline vertical on mobile */
  .timeline {
    flex-direction: column;
    gap: var(--sp-4);
    padding-left: var(--sp-6);
  }
  .timeline::before {
    top: 0; bottom: 0; left: 6px;
    width: 3px; height: auto;
    right: auto;
  }
  .timeline-item {
    padding-top: 0;
    padding-left: var(--sp-4);
  }
  .timeline-item::before {
    top: 4px; left: -24px;
  }

  .scenario-panel { padding: var(--sp-4); }
}

/* Max-width cap */
@media (min-width: 1280px) {
  .container { padding: 0 var(--sp-8); }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .section-nav, .scenario-panel, .skip-link { display: none; }
  .section-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }
  .hub-spoke { display: none; }
  .hub-spoke-list { display: flex; }
  body { background: #fff; }
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
