/* ============================================================
   Governance Integra · Design System v2
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Design Tokens ──────────────────────────────────────────── */
:root {
  /* Colour palette */
  --teal-900: #0e3a45;
  --teal-800: #134e5e;
  --teal-700: #1a6678;
  --teal-600: #217a8f;
  --teal-200: #b8d8e0;
  --teal-100: #d9edf1;
  --teal-50:  #eef7fa;

  --gold-700: #9a6e00;
  --gold-600: #b88000;
  --gold-500: #c9930a;
  --gold-400: #d4a732;
  --gold-300: #e2c16a;
  --gold-100: #fdf3dc;
  --gold-50:  #fffbf0;

  --cream:    #faf8f4;
  --white:    #ffffff;

  --green:    #1a7f4b;
  --green-bg: #e8f5ee;
  --amber:    #b06000;
  --amber-bg: #fef3e2;
  --red:      #c0392b;
  --red-bg:   #fdecea;

  --grey-700: #374151;
  --grey-600: #4b5563;
  --grey-500: #6b7280;
  --grey-400: #9ca3af;
  --grey-300: #d1d5db;
  --grey-200: #e5e7eb;
  --grey-100: #f3f4f6;
  --grey-50:  #f9fafb;

  /* Borders */
  --border-card:    rgba(14, 58, 69, 0.10);
  --border-subtle:  var(--grey-200);
  --border-divider: var(--grey-100);

  /* Typography */
  --font-display: 'Lora', Georgia, serif;
  --font-body:    'Inter', system-ui, sans-serif;

  --text-eyebrow: 11px;
  --text-xs:      12px;
  --text-sm:      13px;
  --text-base:    15px;
  --text-lg:      17px;
  --text-subhead: 18px;
  --text-h3:      22px;
  --text-h2:      28px;
  --text-h1:      40px;

  /* Spacing scale */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  32px;
  --space-2xl: 48px;
  --space-3xl: 72px;

  /* Layout */
  --rail-width:      220px;
  --topbar-height:   56px;
  --content-max:     1200px;
  --content-padding: var(--space-2xl);

  /* Radii */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Shadows */
  --shadow-card:  0 1px 3px rgba(0,0,0,.05), 0 0 0 1px rgba(14,58,69,.06);
  --shadow-lift:  0 2px 8px rgba(0,0,0,.08), 0 0 0 1px rgba(14,58,69,.06);
  --shadow-modal: 0 8px 40px rgba(0,0,0,.18);
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--grey-700);
  background: var(--grey-50);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  animation: fadeIn 200ms ease-out;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; font-size: inherit; }
input  { font-family: inherit; font-size: inherit; }

/* ── Top bar ────────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-height);
  background: var(--white);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  padding: 0 var(--space-lg);
  z-index: 200;
  gap: var(--space-md);
}
.topbar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}
.topbar-logo img {
  height: 72px;
  width: auto;
  display: block;
}
.topbar-logo-icon {
  width: 30px; height: 30px;
  background: var(--teal-800);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.topbar-logo-icon svg { width: 16px; height: 16px; }
.topbar-logo-text .t1 {
  display: block;
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--teal-800);
  line-height: 1.2;
}
.topbar-logo-text .t2 {
  display: block;
  font-size: 11px;
  color: var(--teal-600);
  line-height: 1.2;
}
.topbar-spacer { flex: 1; }
.topbar-demo-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gold-600);
  background: var(--gold-50);
  border: 1px solid var(--gold-300);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
}
.topbar-workspace {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-sm);
  color: var(--grey-600);
}
.topbar-workspace svg { width: 12px; height: 12px; color: var(--grey-400); }
.topbar-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--teal-800);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Shell ──────────────────────────────────────────────────── */
.shell {
  display: flex;
  padding-top: var(--topbar-height);
  min-height: 100vh;
}

/* ── Rail ───────────────────────────────────────────────────── */
.rail {
  width: var(--rail-width);
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--border-subtle);
  position: fixed;
  top: var(--topbar-height);
  bottom: 0;
  left: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  padding: var(--space-md) 0 var(--space-sm);
  z-index: 100;
}
.rail-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--grey-400);
  padding: var(--space-md) var(--space-md) var(--space-xs);
}
.rail-label.phase {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding-top: var(--space-lg);
}
.rail-label .cs {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .03em;
  color: var(--grey-400);
}
.rail-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px var(--space-md);
  font-size: var(--text-sm);
  color: var(--grey-600);
  transition: background .12s, color .12s;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  white-space: nowrap;
}
.rail-item svg {
  width: 15px; height: 15px;
  flex-shrink: 0;
  opacity: .65;
}
.rail-item:hover {
  background: var(--grey-50);
  color: var(--teal-800);
}
.rail-item:hover svg { opacity: .9; }
.rail-item.active {
  background: var(--gold-50);
  color: var(--teal-900);
  font-weight: 500;
}
.rail-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 5px; bottom: 5px;
  width: 3px;
  background: var(--gold-500);
  border-radius: 0 2px 2px 0;
}
.rail-item.active svg { opacity: 1; color: var(--teal-700); }
.rail-item.phase-locked {
  color: var(--grey-400);
}
.rail-item.phase-locked svg { opacity: .5; }
.rail-item.phase-locked:hover {
  background: var(--grey-50);
  color: var(--grey-500);
}
.rail-item.phase-locked.active {
  background: var(--gold-50);
  color: var(--teal-900);
}
.rail-item.phase-locked.active svg { opacity: 1; color: var(--teal-700); }
.rail-spacer { flex: 1; min-height: var(--space-md); }
.rail-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--space-sm);
}
.rail-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--space-sm) var(--space-md);
  font-size: var(--text-xs);
  color: var(--grey-500);
}
.rail-user-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--grey-200);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--grey-600);
  flex-shrink: 0;
}

/* ── Main content ───────────────────────────────────────────── */
.main {
  margin-left: var(--rail-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: var(--space-2xl) var(--content-padding);
  min-width: 0;
}
.main-inner {
  width: 100%;
  max-width: var(--content-max);
  flex: 1;
}

/* ── Page header ────────────────────────────────────────────── */
.dateline {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--grey-400);
  margin-bottom: var(--space-lg);
}
.eyebrow {
  font-size: var(--text-eyebrow);
  font-weight: 600;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--gold-600);
  margin-bottom: var(--space-xs);
}
.page-title {
  font-family: var(--font-display);
  font-size: var(--text-h1);
  font-weight: 700;
  color: var(--teal-900);
  line-height: 1.12;
  margin-bottom: var(--space-sm);
}
.page-sub {
  font-size: var(--text-base);
  color: var(--grey-500);
  margin-bottom: var(--space-md);
}
.gold-rule {
  width: 44px;
  height: 3px;
  background: var(--gold-500);
  border-radius: 2px;
  margin-bottom: var(--space-2xl);
}

/* ── Section rhythm ─────────────────────────────────────────── */
.section {
  margin-bottom: var(--space-2xl);
}
.section-divider {
  width: 36px;
  height: 2px;
  background: var(--gold-300);
  border-radius: 2px;
  margin: var(--space-2xl) 0;
}
.section-eye   { /* alias */ }
.section-title {
  font-family: var(--font-display);
  font-size: var(--text-h2);
  font-weight: 600;
  color: var(--teal-900);
  line-height: 1.2;
  margin-bottom: var(--space-lg);
}
.section-title-sm {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: 600;
  color: var(--teal-900);
  line-height: 1.25;
  margin-bottom: var(--space-md);
}

/* ── Phase preview tag ──────────────────────────────────────── */
.phase-tag {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--gold-700);
  background: var(--gold-50);
  border: 1px solid var(--gold-300);
  border-radius: var(--radius-sm);
  padding: 3px 9px;
  margin-left: var(--space-md);
  vertical-align: middle;
  position: relative;
  top: -3px;
}

/* ── Breadcrumb ─────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-xs);
  color: var(--grey-400);
  margin-bottom: var(--space-lg);
}
.breadcrumb a:hover { color: var(--teal-700); }
.breadcrumb .sep { color: var(--grey-300); }
.breadcrumb .cur { color: var(--grey-600); }

/* ── Stat bar ───────────────────────────────────────────────── */
.stat-bar {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
}
.stat-item {
  font-size: var(--text-sm);
  color: var(--grey-500);
}
.stat-item strong { color: var(--teal-900); font-weight: 600; }
.stat-item.s-green strong { color: var(--green); }
.stat-item.s-amber strong { color: var(--amber); }
.stat-item.s-red   strong { color: var(--red); }

/* ── Big stat ───────────────────────────────────────────────── */
.stat-big-row {
  display: flex;
  gap: var(--space-2xl);
  flex-wrap: wrap;
  margin-bottom: var(--space-xl);
}
.stat-big .num {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
  color: var(--teal-900);
}
.stat-big .num.green { color: var(--green); }
.stat-big .num.amber { color: var(--amber); }
.stat-big .num.red   { color: var(--red); }
.stat-big .lbl {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--grey-400);
  margin-top: var(--space-xs);
}

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
}
.card-sm   { padding: var(--space-md); }
.card-lg   { padding: var(--space-xl); }
.card-gold {
  background: var(--gold-50);
  border-color: var(--gold-300);
}
.card-teal {
  background: var(--white);
  border-color: var(--teal-200);
}
.card-dashed {
  background: transparent;
  border: 2px dashed var(--teal-200);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  box-shadow: none;
}
.card-clickable {
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s;
}
.card-clickable:hover {
  box-shadow: var(--shadow-lift);
  border-color: var(--teal-200);
}

/* ── Grids ──────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-xl); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-xl); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-lg); }

/* ── Doc card ───────────────────────────────────────────────── */
.doc-card {
  background: var(--white);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s;
}
.doc-card:hover {
  box-shadow: var(--shadow-lift);
  border-color: var(--teal-200);
}
.doc-card .cat {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gold-600);
  margin-bottom: var(--space-xs);
}
.doc-card .title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--teal-900);
  line-height: 1.3;
  margin-bottom: var(--space-sm);
}
.doc-card .meta {
  font-size: var(--text-xs);
  color: var(--grey-400);
  line-height: 1.5;
}

/* ── Pills ──────────────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
}
.pill .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.pill-green  { background: var(--green-bg);  color: var(--green); }
.pill-amber  { background: var(--amber-bg);  color: var(--amber); }
.pill-red    { background: var(--red-bg);    color: var(--red); }
.pill-teal   { background: var(--teal-100);  color: var(--teal-800); }
.pill-gold   { background: var(--gold-100);  color: var(--gold-700); }
.pill-grey   { background: var(--grey-100);  color: var(--grey-600); }

/* ── Tags ───────────────────────────────────────────────────── */
.tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}
.tag-governance   { background: var(--teal-100);  color: var(--teal-800); }
.tag-compliance   { background: #e8f0fe;           color: #1a4ab1; }
.tag-planning     { background: #e5f4e8;           color: #1a6b2f; }
.tag-risk         { background: var(--red-bg);     color: var(--red); }
.tag-returns      { background: var(--amber-bg);   color: var(--amber); }
.tag-board-papers { background: var(--grey-100);   color: var(--grey-700); }

/* ── Status dots ────────────────────────────────────────────── */
.dot-status {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-green { background: var(--green); }
.dot-amber { background: var(--amber); }
.dot-red   { background: var(--red); }
.dot-teal  { background: var(--teal-600); }
.dot-gold  { background: var(--gold-500); }
.dot-grey  { background: var(--grey-300); }

/* ── Impact badge ───────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}
.badge-high   { background: var(--red);        color: #fff; }
.badge-medium { background: var(--amber);      color: #fff; }
.badge-low    { background: var(--grey-400);   color: #fff; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 9px var(--space-md);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  border: none;
  cursor: default;
  line-height: 1;
}
.btn-primary  { background: var(--teal-800); color: #fff; }
.btn-secondary { background: var(--white); color: var(--teal-800); border: 1px solid var(--grey-300); }
.btn-ghost    { background: transparent; color: var(--grey-500); border: 1px solid var(--grey-200); }
.btn-gold     { background: var(--gold-500); color: #fff; }
.btn-sm { padding: 6px var(--space-sm); font-size: var(--text-xs); }
.btn-lg { padding: 12px var(--space-xl); font-size: var(--text-base); }

/* ── Search bar ─────────────────────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-md);
}
.search-bar input {
  border: none;
  outline: none;
  flex: 1;
  font-size: var(--text-sm);
  color: var(--grey-600);
  background: transparent;
}
.search-bar input::placeholder { color: var(--grey-400); }
.search-bar svg { color: var(--grey-400); flex-shrink: 0; width: 15px; height: 15px; }

/* ── Filter chips ───────────────────────────────────────────── */
.filter-chips {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-2xl);
}
.chip {
  padding: 6px var(--space-md);
  border-radius: 20px;
  border: 1px solid var(--grey-300);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--grey-600);
  background: var(--white);
  cursor: default;
}
.chip.active {
  background: var(--teal-800);
  color: var(--white);
  border-color: var(--teal-800);
}

/* ── Robin bar ──────────────────────────────────────────────── */
.robin-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--gold-50);
  border: 1px solid var(--gold-300);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-sm);
}
.robin-bar svg { color: var(--gold-500); flex-shrink: 0; width: 16px; height: 16px; }
.robin-bar input {
  border: none;
  outline: none;
  flex: 1;
  font-size: var(--text-base);
  color: var(--grey-600);
  background: transparent;
}
.robin-bar input::placeholder { color: var(--grey-400); }
.robin-bar-you {
  background: var(--teal-50);
  border-color: var(--teal-200);
}
.robin-bar-you svg { color: var(--teal-700); }

/* ── Attention / list rows ──────────────────────────────────── */
.attn-list { margin-bottom: var(--space-md); }
.attn-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border-divider);
}
.attn-item:last-child { border-bottom: none; }
.attn-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.attn-body { flex: 1; }
.attn-title {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--teal-800);
  margin-bottom: 2px;
}
.attn-sub  { font-size: var(--text-xs); color: var(--grey-400); }
.attn-cta  { font-size: var(--text-xs); font-weight: 600; color: var(--gold-600); cursor: default; white-space: nowrap; }

/* ── Recent item (generic link list row) ────────────────────── */
.recent-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-divider);
}
.recent-item:last-child { border-bottom: none; }
.recent-body { flex: 1; }
.recent-title {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--teal-800);
  margin-bottom: 2px;
}
.recent-meta  { font-size: var(--text-xs); color: var(--grey-400); }

/* ── Timeline ───────────────────────────────────────────────── */
.timeline { display: flex; flex-direction: column; gap: var(--space-lg); }
.timeline-item { display: flex; gap: var(--space-sm); align-items: flex-start; }
.t-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold-500);
  margin-top: 5px;
  flex-shrink: 0;
}
.t-dot.dim { background: var(--grey-300); }
.t-time  { font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--grey-400); margin-bottom: 2px; }
.t-title { font-size: var(--text-sm); font-weight: 500; color: var(--teal-800); margin-bottom: 2px; }
.t-sub   { font-size: var(--text-xs); color: var(--grey-400); }

/* ── Table ──────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--grey-400);
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}
.data-table td {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-divider);
  font-size: var(--text-sm);
  color: var(--grey-700);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }

/* ── Chat / source ──────────────────────────────────────────── */
.chat-speaker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--grey-400);
  margin-bottom: var(--space-sm);
}
.chat-bubble {
  border-left: 3px solid var(--gold-300);
  padding: var(--space-md);
  background: var(--gold-50);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: var(--text-sm);
  color: var(--grey-700);
  line-height: 1.65;
  margin-bottom: var(--space-md);
}
.chat-you {
  border-left-color: var(--teal-200);
  background: var(--teal-50);
}
.chat-bubble-you {
  border-left-color: var(--teal-200);
  background: var(--teal-50);
}
.source-item {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-divider);
}
.source-item:last-child { border-bottom: none; }
.source-icon {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  background: var(--gold-50);
  border: 1px solid var(--gold-300);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
}
.source-title { font-size: var(--text-sm); font-weight: 500; color: var(--teal-700); }
.source-meta  { font-size: var(--text-xs); color: var(--grey-400); margin-top: 2px; }

/* ── Gap card ───────────────────────────────────────────────── */
.gap-card {
  border-left: 3px solid var(--red);
  background: var(--white);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
  margin-bottom: var(--space-lg);
}
.gap-card.amber { border-left-color: var(--amber); }
.gap-card-eye {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: var(--space-xs);
}
.gap-card.amber .gap-card-eye { color: var(--amber); }
.gap-card-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--teal-900);
  margin-bottom: var(--space-md);
}
.gap-card-sub {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--grey-400);
  margin-bottom: var(--space-xs);
}
.gap-card-body {
  font-size: var(--text-sm);
  color: var(--grey-600);
  line-height: 1.65;
  margin-bottom: var(--space-md);
}

/* ── Clause box ─────────────────────────────────────────────── */
.clause-box {
  background: var(--grey-50);
  border-left: 3px solid var(--grey-300);
  padding: var(--space-md);
  font-size: var(--text-sm);
  color: var(--grey-600);
  line-height: 1.65;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  margin-bottom: var(--space-md);
}
.clause-suggested {
  border-left-color: var(--green);
  background: var(--green-bg);
}

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20,40,50,.52);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  padding: var(--space-2xl) var(--space-2xl);
  width: 880px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}
.modal-close {
  position: absolute;
  top: var(--space-md); right: var(--space-lg);
  font-size: 22px;
  color: var(--grey-400);
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
  padding: var(--space-xs) var(--space-sm);
  text-decoration: none;
  display: inline-block;
}
.modal-close:hover { color: var(--grey-700); }

/* ── Footer ─────────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: var(--space-3xl) 0 var(--space-xl);
  font-size: var(--text-xs);
  color: var(--grey-400);
}
.footer-rocketeer img {
  height: 128px;
  width: auto;
  display: inline-block;
  vertical-align: middle;
}

/* ── Utility: spacing ───────────────────────────────────────── */
.mb-xs  { margin-bottom: var(--space-xs); }
.mb-sm  { margin-bottom: var(--space-sm); }
.mb-md  { margin-bottom: var(--space-md); }
.mb-lg  { margin-bottom: var(--space-lg); }
.mb-xl  { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }
.mb-3xl { margin-bottom: var(--space-3xl); }

.mt-xs  { margin-top: var(--space-xs); }
.mt-sm  { margin-top: var(--space-sm); }
.mt-md  { margin-top: var(--space-md); }
.mt-lg  { margin-top: var(--space-lg); }
.mt-xl  { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }

.ml-auto { margin-left: auto; }

.pt-md  { padding-top: var(--space-md); }
.pt-lg  { padding-top: var(--space-lg); }
.pb-md  { padding-bottom: var(--space-md); }
.pb-lg  { padding-bottom: var(--space-lg); }
.p-md   { padding: var(--space-md); }
.p-lg   { padding: var(--space-lg); }
.p-xl   { padding: var(--space-xl); }
.p-2xl  { padding: var(--space-2xl); }
.px-md  { padding-left: var(--space-md); padding-right: var(--space-md); }
.px-lg  { padding-left: var(--space-lg); padding-right: var(--space-lg); }
.py-sm  { padding-top: var(--space-sm);  padding-bottom: var(--space-sm); }
.py-md  { padding-top: var(--space-md);  padding-bottom: var(--space-md); }
.py-lg  { padding-top: var(--space-lg);  padding-bottom: var(--space-lg); }

/* ── Utility: flex ──────────────────────────────────────────── */
.flex      { display: flex; }
.flex-col  { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1    { flex: 1; min-width: 0; }
.flex-none { flex-shrink: 0; }
.items-center   { align-items: center; }
.items-start    { align-items: flex-start; }
.items-baseline { align-items: baseline; }
.items-end      { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-start   { justify-content: flex-start; }
.justify-end     { justify-content: flex-end; }
.justify-center  { justify-content: center; }

.gap-xs  { gap: var(--space-xs); }
.gap-sm  { gap: var(--space-sm); }
.gap-md  { gap: var(--space-md); }
.gap-lg  { gap: var(--space-lg); }
.gap-xl  { gap: var(--space-xl); }
.gap-2xl { gap: var(--space-2xl); }

/* ── Utility: typography ────────────────────────────────────── */
.font-display { font-family: var(--font-display); }
.font-medium  { font-weight: 500; }
.font-semi    { font-weight: 600; }
.font-bold    { font-weight: 700; }

.text-xs      { font-size: var(--text-xs); }
.text-sm      { font-size: var(--text-sm); }
.text-base    { font-size: var(--text-base); }
.text-lg      { font-size: var(--text-lg); }
.text-subhead { font-size: var(--text-subhead); font-family: var(--font-display); font-weight: 600; color: var(--teal-900); }
.text-h3      { font-size: var(--text-h3);      font-family: var(--font-display); font-weight: 600; color: var(--teal-900); line-height: 1.25; }
.text-h2      { font-size: var(--text-h2);      font-family: var(--font-display); font-weight: 700; color: var(--teal-900); line-height: 1.2; }

.lh-tight  { line-height: 1.3; }
.lh-normal { line-height: 1.55; }
.lh-loose  { line-height: 1.7; }
.uppercase { text-transform: uppercase; }
.tracking   { letter-spacing: .06em; }

/* ── Utility: colour ────────────────────────────────────────── */
.text-teal    { color: var(--teal-700); }
.text-teal-dk { color: var(--teal-900); }
.text-gold    { color: var(--gold-600); }
.text-muted   { color: var(--grey-500); }
.text-subtle  { color: var(--grey-400); }
.text-green   { color: var(--green); }
.text-amber   { color: var(--amber); }
.text-red     { color: var(--red); }
.text-white   { color: #fff; }
.text-dark    { color: var(--grey-700); }

.bg-white   { background: var(--white); }
.bg-grey    { background: var(--grey-50); }
.bg-teal    { background: var(--teal-50); }
.bg-gold    { background: var(--gold-50); }

/* ── Utility: sizing / misc ─────────────────────────────────── */
.w-full  { width: 100%; }
.h-full  { height: 100%; }
.block   { display: block; }
.inline  { display: inline; }
.inline-flex { display: inline-flex; }
.relative { position: relative; }
.cursor-default { cursor: default; }
.overflow-hidden { overflow: hidden; }
.border-b { border-bottom: 1px solid var(--border-divider); }
.border-t { border-top: 1px solid var(--border-divider); }

/* ── Thin icon box ──────────────────────────────────────────── */
.icon-box {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  background: var(--teal-50);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.icon-box svg { width: 16px; height: 16px; color: var(--teal-700); }
.icon-box.gold { background: var(--gold-50); }
.icon-box.gold svg { color: var(--gold-600); }

/* ── Backwards-compatibility aliases ────────────────────────── */
/* These map old class names to new styles while pages are updated */
.section-rule    { width: 36px; height: 2px; background: var(--gold-300); border-radius: 2px; margin: var(--space-2xl) 0; }
.section-eyebrow { font-size: var(--text-eyebrow); font-weight: 600; letter-spacing: .10em; text-transform: uppercase; color: var(--gold-600); margin-bottom: var(--space-xs); }
.section-title-lg{ font-family: var(--font-display); font-size: var(--text-h2); font-weight: 700; color: var(--teal-900); line-height: 1.2; margin-bottom: var(--space-lg); }
.card-grid       { display: grid; gap: var(--space-lg); }
.card-grid-2     { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-lg); }
.card-grid-3     { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-lg); }
.card-grid-4     { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-md); }
.two-col         { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-xl); }
.three-col       { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-lg); }
.status-dot      { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-status      { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.filter-chip     { padding: 6px var(--space-md); border-radius: 20px; border: 1px solid var(--grey-300); font-size: var(--text-xs); font-weight: 500; color: var(--grey-600); background: var(--white); cursor: default; }
.filter-chip.active { background: var(--teal-800); color: var(--white); border-color: var(--teal-800); }
.filter-chips    { display: flex; gap: var(--space-sm); flex-wrap: wrap; margin-bottom: var(--space-2xl); }
.stat-item.amber strong { color: var(--amber); }
.stat-item.green strong { color: var(--green); }
.stat-item.red   strong { color: var(--red); }
.impact-badge    { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: var(--radius-sm); }
.impact-high     { background: var(--red); color: #fff; }
.impact-medium   { background: var(--amber); color: #fff; }
.timeline-dot    { width: 8px; height: 8px; border-radius: 50%; background: var(--gold-500); margin-top: 5px; flex-shrink: 0; }
.timeline-time   { font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--grey-400); margin-bottom: 2px; }
.timeline-title  { font-size: var(--text-sm); font-weight: 500; color: var(--teal-800); margin-bottom: 2px; }
.timeline-sub    { font-size: var(--text-xs); color: var(--grey-400); }
.page-subtitle   { font-size: var(--text-base); color: var(--grey-500); margin-bottom: var(--space-md); }
.list-row        { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-md) 0; border-bottom: 1px solid var(--border-divider); font-size: var(--text-sm); }
.list-row:last-child { border-bottom: none; }
.list-row .row-title { flex: 1; color: var(--teal-800); font-weight: 500; }
.list-row .row-meta  { color: var(--grey-400); font-size: var(--text-xs); }
.list-row .row-action{ font-size: var(--text-xs); font-weight: 600; color: var(--gold-600); cursor: default; }
.attn-action     { font-size: var(--text-xs); font-weight: 600; color: var(--gold-600); cursor: default; white-space: nowrap; }
.phase-preview-tag { display: inline-flex; align-items: center; font-size: 10px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--gold-700); background: var(--gold-50); border: 1px solid var(--gold-300); border-radius: var(--radius-sm); padding: 3px 9px; margin-left: var(--space-md); vertical-align: middle; position: relative; top: -3px; }
.phase-locked    { color: var(--grey-400); }
.robin-bar-sub   { font-size: var(--text-xs); color: var(--grey-400); margin-top: var(--space-xs); margin-bottom: var(--space-2xl); }
.stat-big        { }
.stat-big .num   { font-family: var(--font-display); font-size: 44px; font-weight: 700; line-height: 1; color: var(--teal-900); }
.stat-big .lbl   { font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--grey-400); margin-top: var(--space-xs); }
.stat-big-row    { display: flex; gap: var(--space-2xl); flex-wrap: wrap; margin-bottom: var(--space-xl); }
.stat-big .label { font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--grey-400); margin-top: var(--space-xs); }
.gap-card-eyebrow { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--red); margin-bottom: var(--space-xs); }
.gap-card.amber .gap-card-eyebrow { color: var(--amber); }
.gap-card-body   { font-size: var(--text-sm); color: var(--grey-600); line-height: 1.65; margin-bottom: var(--space-md); }
.gap-card-sub    { font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--grey-400); margin-bottom: var(--space-xs); }
.gap-card-title  { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 600; color: var(--teal-900); margin-bottom: var(--space-md); }

/* ── Utility: prose width cap ───────────────────────────────── */
.max-prose   { max-width: 640px; }
.max-prose-lg { max-width: 760px; }
.max-prose-sm { max-width: 480px; }
