/* Tokens lifted from Optro-Agentic-Platform tailwind config + Luna */
:root {
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --header-dark: #101827; /* used for sidenav header + matching rail accent */

  --teal-50: #f3fafb;
  --teal-100: #d9f1f5;
  --teal-200: #b3e3eb;
  --teal-300: #82cfdd;
  --teal-400: #4db4c9;
  --teal-500: #266c92;
  --teal-600: #0e5371;
  --teal-700: #0a405a;

  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-500: #3b82f6;
  --blue-700: #1d4ed8;

  --green-50: #ecfdf5;
  --green-100: #d1fae5;
  --green-500: #10b981;
  --green-700: #047857;

  --orange-50: #fff7ed;
  --orange-100: #ffedd5;
  --orange-400: #fb923c;
  --orange-500: #f97316;
  --orange-700: #c2410c;

  --red-50: #fef2f2;
  --red-100: #fee2e2;
  --red-400: #f87171;
  --red-500: #ef4444;
  --red-700: #b91c1c;

  --purple-50: #faf5ff;
  --purple-100: #f3e8ff;
  --purple-500: #a855f7;
  --purple-700: #7e22ce;

  --shadow-100: 0px 1px 1px 0px rgba(1, 64, 126, 0.06);
  --shadow-200: 0 2px 4px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-300: 0 8px 16px rgba(0, 0, 0, 0.08), 0 0 24px rgba(0, 0, 0, 0.04);

  --font-sans: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--gray-900);
  background: var(--white);
}
a { color: var(--teal-500); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============= Optro app shell ============= */
/* AppLayout: flex row of [icon rail | side nav | main column with header on top] */
.app {
  display: flex;
  align-items: stretch;
  height: 100vh;
  overflow: hidden;
  background: var(--gray-50);
}

/* Left icon rail — w-14 (56px), bg-gray-900, items 40x40 rounded */
.rail {
  width: 56px;
  background: var(--gray-900);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 8px 8px 10px;
  flex-shrink: 0;
}
.rail-top, .rail-bottom { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.rail-logo {
  width: 40px; height: 40px;
  border-radius: 4px;
  display: grid; place-items: center;
  cursor: pointer;
  text-decoration: none;
}
.rail-logo:hover { text-decoration: none; }
.rail-logo .glyph {
  width: 28px; height: 28px;
  background: var(--teal-500);
  color: var(--white);
  font-weight: 700;
  font-size: 14px;
  border-radius: 4px;
  display: grid; place-items: center;
}
.rail-logo img.logo-img { width: 28px; height: 28px; display: block; }
.rail-logo:hover { background: var(--gray-800); }
.rail-item {
  width: 40px; height: 40px;
  border-radius: 4px;
  display: grid; place-items: center;
  color: var(--gray-400);
  cursor: pointer; position: relative;
  transition: background-color 0.15s;
  text-decoration: none;
}
.rail-item:hover { background: var(--gray-800); color: var(--gray-300); text-decoration: none; }
.rail-item.active { background: var(--teal-500); color: var(--white); }
.rail-item svg { width: 16px; height: 16px; }
.rail-item .dot {
  position: absolute; top: 6px; right: 6px;
  width: 6px; height: 6px;
  background: var(--teal-400);
  border-radius: 50%;
}

/* Side navigation — w-[236px], white bg, dark header strip */
.sidenav {
  width: 236px;
  background: var(--white);
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100%;
}
.sidenav-header {
  height: 48px;
  background: var(--header-dark);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px;
  flex-shrink: 0;
}
.sidenav-switcher {
  display: flex; align-items: center; gap: 6px;
  background: transparent; border: none; color: var(--white);
  font-family: inherit; font-size: 14px; font-weight: 600;
  height: 32px; padding: 0 8px; border-radius: 4px;
  cursor: pointer;
  max-width: 180px;
}
.sidenav-switcher:hover { background: rgba(255,255,255,0.08); }
.sidenav-switcher .ws-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidenav-switcher .chev { color: var(--gray-400); width: 14px; height: 14px; flex-shrink: 0; }
.sidenav-switcher .new-pill {
  font-size: 9px; font-weight: 700;
  background: var(--orange-400);
  color: var(--white);
  padding: 1px 5px;
  border-radius: 2px;
  letter-spacing: 0.05em;
  margin-left: 4px;
}
.sidenav-collapse-btn {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: transparent; border: none; color: var(--gray-400);
  cursor: pointer; border-radius: 4px;
}
.sidenav-collapse-btn:hover { background: rgba(255,255,255,0.08); }
.sidenav-collapse-btn svg { width: 16px; height: 16px; }

/* Quick access section (Home/Recent/Favorites) */
.quick-access {
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 12px 8px;
  border-bottom: 1px solid var(--gray-100);
}
.quick-link {
  display: flex; align-items: center; gap: 12px;
  height: 36px; padding: 8px 12px;
  border-radius: 4px;
  color: var(--gray-600);
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
}
.quick-link:hover { background: var(--gray-100); text-decoration: none; }
.quick-link.active { background: var(--teal-50); color: var(--teal-600); font-weight: 600; }
.quick-link svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--gray-500); }
.quick-link.active svg { color: var(--teal-600); }

/* Sections */
.sidenav-sections {
  display: flex; flex-direction: column; gap: 12px;
  padding: 12px 12px 24px;
  flex: 1;
  overflow-y: auto;
}
.nav-section { display: flex; flex-direction: column; }
.section-title-btn {
  display: flex; align-items: center; justify-content: space-between;
  background: transparent; border: none; padding: 6px 8px;
  cursor: pointer; border-radius: 4px;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-400);
}
.section-title-btn:hover { background: var(--gray-50); }
.section-title-btn .chev { color: var(--gray-400); width: 14px; height: 14px; transition: transform 0.2s; }
.section-list {
  display: flex; flex-direction: column; gap: 2px;
  padding-top: 4px;
}
.nav-link {
  display: flex; align-items: center;
  gap: 8px;
  height: 33px; padding: 6px 8px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 400;
  color: var(--gray-600);
  text-decoration: none;
  cursor: pointer;
}
.nav-link:hover { background: var(--gray-100); text-decoration: none; }
.nav-link.active { background: var(--teal-50); color: var(--teal-600); font-weight: 600; }
.nav-link .badge-count {
  background: var(--teal-500);
  color: var(--white);
  font-size: 11px;
  font-weight: 500;
  height: 20px; min-width: 20px; padding: 0 6px;
  border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
}

/* Main column (header + content) */
.main-col {
  flex: 1;
  min-width: 0;
  display: flex; flex-direction: column;
  height: 100%;
  background: var(--white);
}

/* Top app header (search + utility icons + avatar) */
.top-header {
  height: 48px;
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid var(--gray-200);
  background: var(--white);
  flex-shrink: 0;
}
.top-header .spacer { flex: 1; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  height: 32px; min-width: 320px; max-width: 540px;
  padding: 0 10px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  color: var(--gray-500);
  background: var(--gray-50);
  font-size: 13px;
}
.search-box svg { width: 14px; height: 14px; }
.search-box .kbd {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 2px;
  font-size: 11px; padding: 1px 5px;
  border: 1px solid var(--gray-200);
  border-radius: 3px;
  background: var(--white);
  color: var(--gray-500);
}
.util-btn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: transparent; border: none; cursor: pointer;
  color: var(--gray-400);
  border-radius: 4px;
  position: relative;
}
.util-btn:hover { color: var(--gray-700); background: var(--gray-100); }
.util-btn svg { width: 16px; height: 16px; }
.util-btn .jewel {
  position: absolute; top: 7px; right: 8px;
  width: 7px; height: 7px;
  background: var(--red-500);
  border-radius: 50%;
  border: 2px solid var(--white);
}
.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--teal-500);
  color: var(--white);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 600;
  margin-left: 4px;
  cursor: pointer;
}
.proto-pill {
  font-size: 10px;
  background: var(--purple-50);
  color: var(--purple-700);
  border: 1px solid var(--purple-100);
  padding: 2px 8px;
  border-radius: 999px;
  margin-right: 4px;
}

/* Page content */
.content {
  flex: 1;
  overflow-y: auto;
  background: var(--gray-50);
  padding: 28px 36px 40px;
}

/* Page header — title dominates, subtitle whispers, actions on the right */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.page-header > div:first-child { min-width: 0; }
.page-header h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--gray-900);
}
.page-header .subtitle {
  color: var(--gray-600);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  margin-top: 6px;
  max-width: 720px;
}

/* Buttons — taller, more clickable, consistent height */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px;
  padding: 0 16px;
  font-size: 14px; font-weight: 500;
  border-radius: 6px; border: 1px solid transparent;
  cursor: pointer; font-family: inherit;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--teal-500); color: var(--white); box-shadow: 0 1px 2px rgba(38, 108, 146, 0.18); }
.btn-primary:hover { background: var(--teal-600); }
.btn-secondary { background: var(--white); color: var(--gray-800); border-color: var(--gray-300); }
.btn-secondary:hover { background: var(--gray-50); border-color: var(--gray-400); }
.btn-ghost { background: transparent; color: var(--teal-500); }
.btn-ghost:hover { background: var(--teal-50); text-decoration: none; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; }

/* Card — consistent padding everywhere */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  box-shadow: var(--shadow-100);
}
.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.card-header h2 { margin: 0; font-size: 15px; font-weight: 600; color: var(--gray-900); }
.card-body { padding: 22px; }

/* Linked cards: hover affordance so the user sees them as clickable */
a.card:hover, a.lib-card:hover, a.evidence-card:hover {
  border-color: var(--teal-400);
  box-shadow: var(--shadow-200);
  text-decoration: none;
}

/* Stats — these are the headline numbers; make them dominate */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.stat {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 18px 22px;
  display: flex; flex-direction: column; gap: 8px;
}
.stat .label {
  font-size: 11px;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.stat .value {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--gray-900);
}
.stat .value.warn { color: var(--orange-500); }
.stat .value.bad { color: var(--red-500); }
.stat .value.good { color: var(--green-500); }

/* Subtle background tint when the value is warn/bad/good — uses :has() so
   the card itself shifts color, drawing attention to urgent numbers. */
.stat:has(.value.bad) {
  background: linear-gradient(180deg, #fff5f5 0%, var(--white) 100%);
  border-color: #fecaca;
}
.stat:has(.value.warn) {
  background: linear-gradient(180deg, #fff8f0 0%, var(--white) 100%);
  border-color: #fed7aa;
}
.stat:has(.value.good) {
  background: linear-gradient(180deg, #f0fdf4 0%, var(--white) 100%);
  border-color: #bbf7d0;
}

/* Inline badges (in tables/chips) */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1.4;
}
.badge-gray { background: var(--gray-100); color: var(--gray-700); }
.badge-blue { background: var(--blue-50); color: var(--blue-700); border-color: var(--blue-100); }
.badge-teal { background: var(--teal-50); color: var(--teal-600); border-color: var(--teal-100); }
.badge-green { background: var(--green-50); color: var(--green-700); border-color: var(--green-100); }
.badge-orange { background: var(--orange-50); color: var(--orange-700); border-color: var(--orange-100); }
.badge-red { background: var(--red-50); color: var(--red-700); border-color: var(--red-100); }
.badge-purple { background: var(--purple-50); color: var(--purple-700); border-color: var(--purple-100); }

/* Tabs (within content) */
.tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--gray-200); margin-bottom: 20px; }
.tabs button {
  background: none; border: none; padding: 12px 16px;
  font-size: 14px; font-weight: 500; color: var(--gray-600);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
  font-family: inherit;
}
.tabs button.active { color: var(--teal-600); border-bottom-color: var(--teal-500); }

/* Tables — more padding for readability, headers visually separated */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 14px 18px; font-size: 14px; vertical-align: middle; }
th {
  font-weight: 600; color: var(--gray-600);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  padding-top: 11px; padding-bottom: 11px;
}
td { border-bottom: 1px solid var(--gray-200); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray-50); }

.muted { color: var(--gray-600); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot.green { background: var(--green-500); }
.dot.orange { background: var(--orange-400); }
.dot.red { background: var(--red-500); }
.dot.gray { background: var(--gray-400); }

.approach-note {
  margin-top: 40px;
  padding: 18px 22px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
  border: 1px solid;
}
.approach-note.blue { background: var(--blue-50); border-color: var(--blue-100); color: var(--blue-700); }
.approach-note.orange { background: var(--orange-50); border-color: var(--orange-100); color: var(--orange-700); }
.approach-note.teal { background: var(--teal-50); border-color: var(--teal-100); color: var(--teal-600); }

/* Workflow stepper (top of each prototype page) — more presence so users
   actually orient on it, but still subordinate to the page H1 below. */
.stepper {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin: 0 0 28px;
  padding: 14px 18px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  font-size: 14px;
}
.stepper .step {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px;
  border-radius: 4px;
  color: var(--gray-600);
  text-decoration: none;
  white-space: nowrap;
}
.stepper .step:hover { background: var(--gray-50); text-decoration: none; }
.stepper .step .num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 11px; font-weight: 600;
  display: grid; place-items: center;
}
.stepper .step.active { background: var(--teal-50); color: var(--teal-600); font-weight: 600; }
.stepper .step.active .num { background: var(--teal-500); color: var(--white); }
.stepper .step.done .num { background: var(--green-500); color: var(--white); }
.stepper .arrow { color: var(--gray-300); }
.stepper .label { color: var(--gray-500); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500; margin-right: 8px; padding-right: 8px; border-right: 1px solid var(--gray-200); }

/* Workflow pager (prev / next at bottom) — more separation from content */
.workflow-pager {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 32px; padding: 20px 0 0;
  border-top: 1px solid var(--gray-200);
}
.workflow-pager .prev, .workflow-pager .next {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: 6px;
  background: var(--white);
  border: 1px solid var(--gray-300);
  color: var(--gray-700);
  text-decoration: none;
  font-size: 14px; font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
}
.workflow-pager .prev:hover, .workflow-pager .next:hover { background: var(--gray-50); text-decoration: none; }
.workflow-pager .next { background: var(--teal-500); color: var(--white); border-color: var(--teal-500); }
.workflow-pager .next:hover { background: var(--teal-600); border-color: var(--teal-600); }
.workflow-pager .disabled { opacity: 0.4; pointer-events: none; }

/* Layouts */
.split-2 { display: grid; grid-template-columns: 1fr 320px; gap: 28px; }

/* In-content section titles — clearer hierarchy: small uppercase tracker,
   not sized to compete with card titles or H1. */
.section-title {
  margin: 28px 0 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-500);
}
.section-title:first-child { margin-top: 0; }

/* Key-value rows — used in detail panels (Provenance, Control, etc.) */
.kv-row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px dashed var(--gray-200); font-size: 13px; line-height: 1.5; }
.kv-row:last-child { border-bottom: none; }
.kv-row .k { color: var(--gray-500); flex-shrink: 0; }
.kv-row .v { color: var(--gray-900); font-weight: 500; text-align: right; }

.code-block {
  background: var(--gray-900); color: #e2e8f0;
  border-radius: 6px; padding: 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; line-height: 1.6;
  overflow-x: auto;
}

/* ============= Tour overlay ============= */
body.tour-active { overflow: hidden; }

.tour-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 9000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.tour-overlay.active { opacity: 1; pointer-events: auto; }

.tour-spotlight {
  position: fixed;
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.55), 0 0 0 3px var(--teal-400);
  background: transparent;
  z-index: 9001;
  pointer-events: none;
  transition: top 0.25s, left 0.25s, width 0.25s, height 0.25s, opacity 0.2s;
  opacity: 0;
}
.tour-spotlight.active { opacity: 1; }

.tour-popover {
  position: fixed;
  width: 340px;
  background: var(--white);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(15, 23, 42, 0.08);
  z-index: 9002;
  opacity: 0;
  transition: opacity 0.2s, top 0.25s, left 0.25s;
  pointer-events: none;
  font-family: var(--font-sans);
}
.tour-popover.active { opacity: 1; pointer-events: auto; }
.tour-popover .tour-progress {
  font-size: 11px; font-weight: 600; color: var(--teal-500);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.tour-popover h3.tour-title {
  margin: 0 0 8px; font-size: 16px; font-weight: 600;
  color: var(--gray-900);
}
.tour-popover p.tour-body {
  margin: 0 0 18px; font-size: 14px; line-height: 1.5;
  color: var(--gray-700);
}
.tour-popover .tour-actions {
  display: flex; align-items: center; justify-content: space-between;
}
.tour-popover .tour-buttons { display: flex; gap: 8px; }
.tour-popover button {
  font-family: inherit; cursor: pointer;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px; font-weight: 500;
  border: 1px solid transparent;
}
.tour-popover .tour-skip {
  background: transparent; color: var(--gray-500);
  padding: 6px 8px;
}
.tour-popover .tour-skip:hover { color: var(--gray-700); }
.tour-popover .tour-prev {
  background: var(--white); color: var(--gray-700);
  border-color: var(--gray-300);
}
.tour-popover .tour-prev:hover { background: var(--gray-50); }
.tour-popover .tour-next {
  background: var(--teal-500); color: var(--white);
  border-color: var(--teal-500);
}
.tour-popover .tour-next:hover { background: var(--teal-600); border-color: var(--teal-600); }

.tour-start-btn {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--teal-500); color: var(--white);
  padding: 12px 20px;
  border-radius: 999px;
  border: none;
  font-family: var(--font-sans);
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(38, 108, 146, 0.35);
  z-index: 8500;
  display: flex; align-items: center; gap: 8px;
}
.tour-start-btn:hover { background: var(--teal-600); transform: translateY(-1px); }
body.tour-active .tour-start-btn { display: none; }

/* ===== UX hardening =====
   Reviewed: 2026-05-04. Fixes for: dual-Next confusion during tours,
   missing exit affordance, fake-interactive controls, weak visual signal
   on stale items, hard-to-spot AI participants, and other small papercuts. */

/* 1. Hide page-level pager when tour is active so the tour popover's
      Next is the only "advance" action. */
body.tour-active .workflow-pager { display: none; }

/* 2. Make the proto-pill a real exit link — single way out of any prototype
      back to the comparison index. */
a.proto-pill {
  text-decoration: none;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
a.proto-pill:hover {
  background: var(--purple-100);
  border-color: var(--purple-300, #d8b4fe);
  color: var(--purple-700);
  text-decoration: none;
}
a.proto-pill::after { content: " ↗"; opacity: 0.7; }

/* 3. The top header search box is presentational only; signal that. */
.search-box { cursor: default; user-select: none; }

/* 4. Filter pills in C3 are visual chips — non-active ones shouldn't look
      hoverable like buttons. */
.filter-pill { cursor: default; }
.filter-pill:not(.active) { opacity: 0.85; }
.filter-pill:not(.active):hover { background: var(--white); }

/* 5. Setup checklist in A1 — same: not real progress controls in this demo. */
.checklist .check { cursor: default; }

/* 6. Sidenav links without a real href shouldn't look interactive. */
.nav-link:not([href]) { cursor: default; }
.nav-link:not([href]):hover { background: transparent; color: var(--gray-600); }
.quick-link:not([href]) { cursor: default; }
.quick-link:not([href]):hover { background: transparent; }
.quick-link.active { cursor: default; }

/* 7. Cross-option workspace nav links — visual hint they leave this option. */
/* Push the badge (or the cross-option arrow if there's no badge) to the
   right end so labels stay left-aligned and counts stay flush right. */
.nav-link .badge-count { margin-left: auto; }
.nav-link.cross-option::after {
  content: "↗";
  color: var(--gray-400); font-size: 11px; font-weight: 500;
}
.nav-link.cross-option:not(:has(.badge-count))::after { margin-left: auto; }
.nav-link.cross-option:hover::after { color: var(--teal-500); }

/* 8. Library: stale items get a red 3px left rail; aging items get orange.
      Was: same uniform card regardless of freshness — easy to miss the urgent ones. */
.lib-card.lib-stale {
  border-left: 3px solid var(--red-500);
  background: linear-gradient(90deg, var(--red-50) 0%, var(--white) 30%);
}
.lib-card.lib-aging {
  border-left: 3px solid var(--orange-400);
}
.lib-card.lib-fresh {
  border-left: 3px solid var(--green-500);
}

/* 9. AI participant in chat: visually distinct (label + gradient bubble).
      Was: AI's messages used the same bubble style as auditor messages. */
.msg.system .bubble {
  background: linear-gradient(135deg, var(--purple-50) 0%, #f5edff 100%);
  position: relative;
}
.msg.system .bubble::before {
  content: "✨ AUTOMATED";
  display: block; margin-bottom: 6px;
  font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
  color: var(--purple-500);
}

/* 10. Stepper at the top of each page: more prominent, easier to scan. */
.stepper { padding: 14px 18px; font-size: 14px; box-shadow: var(--shadow-100); }
.stepper .step { padding: 6px 12px; }
.stepper .step .num { width: 24px; height: 24px; font-size: 12px; }
.stepper .label { font-size: 10px; }

/* 11. Tour popover: clamp width on narrow viewports + smoother transition. */
.tour-popover { max-width: calc(100vw - 24px); }

/* 12. Tour spotlight: stronger contrast on dark elements */
.tour-spotlight { box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.6), 0 0 0 3px var(--teal-400), 0 0 24px rgba(38, 108, 146, 0.4); }

/* 13. A3 review: keep a Save action right below the justification textarea
      so the action is co-located with where the user typed. */
.justification-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 12px;
}

/* 14. Make the index "Start tour" CTA look like a real button + clear secondary path */
.opt-card .opt-arrow {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: var(--teal-500); color: var(--white);
  border-radius: 6px;
  font-size: 13px; font-weight: 600;
  width: fit-content;
}
.opt-card:hover .opt-arrow { background: var(--teal-600); }

/* 15. Compose card section titles: small caps, not headings */
.compose-card .section-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--gray-500); font-weight: 600; margin-top: 24px;
}

/* Aliases so inline page styles using --luna-* keep working */
:root {
  --luna-white: var(--white);
  --luna-gray-50: var(--gray-50); --luna-gray-100: var(--gray-100); --luna-gray-200: var(--gray-200);
  --luna-gray-300: var(--gray-300); --luna-gray-400: var(--gray-400); --luna-gray-500: var(--gray-500);
  --luna-gray-600: var(--gray-600); --luna-gray-700: var(--gray-700); --luna-gray-800: var(--gray-800);
  --luna-gray-900: var(--gray-900);
  --luna-teal-50: var(--teal-50); --luna-teal-100: var(--teal-100); --luna-teal-500: var(--teal-500);
  --luna-teal-600: var(--teal-600); --luna-teal-700: var(--teal-700);
  --luna-blue-50: var(--blue-50); --luna-blue-100: var(--blue-100); --luna-blue-500: var(--blue-500); --luna-blue-700: var(--blue-700);
  --luna-green-50: var(--green-50); --luna-green-100: var(--green-100); --luna-green-500: var(--green-500); --luna-green-700: var(--green-700);
  --luna-orange-50: var(--orange-50); --luna-orange-100: var(--orange-100); --luna-orange-400: var(--orange-400); --luna-orange-500: var(--orange-500); --luna-orange-700: var(--orange-700);
  --luna-red-50: var(--red-50); --luna-red-100: var(--red-100); --luna-red-400: var(--red-400); --luna-red-500: var(--red-500); --luna-red-700: var(--red-700);
  --luna-purple-50: var(--purple-50); --luna-purple-100: var(--purple-100); --luna-purple-500: var(--purple-500); --luna-purple-700: var(--purple-700);
  --luna-fontFamily: var(--font-sans);
  --luna-text-subdued: var(--gray-600);
  --luna-border-color: var(--gray-200);
  --luna-font-size-100: 12px; --luna-font-size-150: 13px; --luna-font-size-200: 14px;
  --luna-font-size-300: 16px; --luna-font-size-400: 18px; --luna-font-size-450: 20px;
  --luna-font-size-500: 24px; --luna-font-size-600: 32px;
  --luna-space-1: 4px; --luna-space-2: 8px; --luna-space-3: 12px; --luna-space-4: 16px;
  --luna-space-5: 20px; --luna-space-6: 24px; --luna-space-8: 32px; --luna-space-10: 40px; --luna-space-12: 48px;
  --luna-radius-sm: 4px; --luna-radius-md: 6px; --luna-radius-lg: 8px; --luna-radius-full: 999px;
  --luna-shadow-100: var(--shadow-100); --luna-shadow-200: var(--shadow-200); --luna-shadow-300: var(--shadow-300);
}

/* ============================================================
   Luna design system components — extracted from
   /Users/sanderson/Desktop/optro-prototypes-main/prototypes/shared/styles/layout.css
   so the prototypes match production Luna without needing the
   full kit chrome (which conflicts with our hand-rolled body grid).
   ============================================================ */

/* ---- LUNA BUTTON ---- */
.luna-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    height: 1.75rem;
    padding: 0 0.5rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.25rem;
    background: #ffffff;
    font-size: 0.8125rem;
    font-family: inherit;
    font-weight: 500;
    color: #0f172a;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: background 0.2s, box-shadow 0.2s, color 0.2s;
}
.luna-btn:hover { background: #f8fafc; text-decoration: none; }
.luna-btn:focus-visible {
    box-shadow: 0 0 0 0.125rem #ffffff, 0 0 0 4px #266c92;
    outline: 2px solid transparent;
}
.luna-btn.blue { background: #266c92; color: #ffffff; border-color: #266c92; }
.luna-btn.blue:hover { background: #0e5371; border-color: #0e5371; }
.luna-btn.red { background: #db3535; color: #ffffff; border-color: #db3535; }
.luna-btn.red:hover { background: #ba2a2a; border-color: #ba2a2a; }
.luna-btn.orange { background: #cc4e00; color: #ffffff; border-color: #cc4e00; }
.luna-btn.orange:hover { background: #a84100; border-color: #a84100; }
.luna-btn.green { background: #36844a; color: #ffffff; border-color: #36844a; }
.luna-btn.green:hover { background: #26603b; border-color: #26603b; }
.luna-btn.gray { background: #f1f5f9; color: #0f172a; border-color: transparent; }
.luna-btn.gray:hover { background: #e2e8f0; }
.luna-btn.transparent { background: transparent; color: #0f172a; border-color: transparent; }
.luna-btn.transparent:hover { background: hsla(210, 98%, 20%, 0.03); }
.luna-btn[data-size="xs"] { height: 1.25rem; padding: 0 0.375rem; font-size: 0.6875rem; }
.luna-btn[data-size="sm"] { height: 1.5rem; padding: 0 0.5rem; font-size: 0.75rem; }
.luna-btn[data-size="lg"] { height: 2rem; padding: 0 0.625rem; }
.luna-btn[data-width="full"] { width: 100%; }
.luna-btn:disabled { background: #e2e8f0; color: #828ca3; border: 0; cursor: default; pointer-events: none; }

/* ---- LUNA BADGE ---- */
.luna-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 99px;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.175rem 0.5rem;
    white-space: nowrap;
    flex-shrink: 0;
}
.luna-badge[data-size="sm"] { font-size: 0.625rem; padding: 0.125rem 0.375rem; }
.luna-badge[data-size="lg"] { font-size: 0.75rem; padding: 0.25rem 0.625rem; }
.luna-badge[data-variant="round"] { border-radius: 50%; min-width: 1.5rem; min-height: 1.5rem; padding: 0.125rem; text-align: center; }
.luna-badge.gray.weak    { background: #e3eaf1; color: #343d55; }
.luna-badge.gray.normal  { background: transparent; border-color: #3b4a5c; color: #3b4a5c; }
.luna-badge.gray.strong  { background: #64748b; color: #ffffff; }
.luna-badge.gray.xstrong { background: #334155; color: #ffffff; }
.luna-badge.blue.weak    { background: #dbeaff; color: #0e48a1; }
.luna-badge.blue.normal  { background: transparent; border-color: #1f5dd8; color: #1f5dd8; }
.luna-badge.blue.strong  { background: #3172e3; color: #ffffff; }
.luna-badge.blue.xstrong { background: #0e48a1; color: #ffffff; }
.luna-badge.red.weak    { background: #ffe0e0; color: #ba2a2a; }
.luna-badge.red.normal  { background: transparent; border-color: #db3535; color: #db3535; }
.luna-badge.red.strong  { background: #db3535; color: #ffffff; }
.luna-badge.red.xstrong { background: #8c1c1c; color: #ffffff; }
.luna-badge.orange.weak    { background: #ffeacf; color: #a84100; }
.luna-badge.orange.normal  { background: transparent; border-color: #cc4e00; color: #cc4e00; }
.luna-badge.orange.strong  { background: #ea6706; color: #ffffff; }
.luna-badge.orange.xstrong { background: #a84100; color: #ffffff; }
.luna-badge.yellow.weak    { background: #fef9c3; color: #8d5112; }
.luna-badge.yellow.normal  { background: transparent; border-color: #e4b913; color: #bf8207; }
.luna-badge.yellow.strong  { background: #bf8207; color: #ffffff; }
.luna-badge.yellow.xstrong { background: #8d5112; color: #ffffff; }
.luna-badge.green.weak    { background: #c6fdd9; color: #26603b; }
.luna-badge.green.normal  { background: transparent; border-color: #36844a; color: #36844a; }
.luna-badge.green.strong  { background: #36844a; color: #ffffff; }
.luna-badge.green.xstrong { background: #1b4a2c; color: #ffffff; }
.luna-badge.purple.weak    { background: #e5ddfa; color: #4518a8; }
.luna-badge.purple.normal  { background: transparent; border-color: #6931e3; color: #6931e3; }
.luna-badge.purple.strong  { background: #6931e3; color: #ffffff; }
.luna-badge.purple.xstrong { background: #341180; color: #ffffff; }
.luna-badge.teal.weak    { background: #e3f0f2; color: #0e5371; }
.luna-badge.teal.normal  { background: transparent; border-color: #266c92; color: #266c92; }
.luna-badge.teal.strong  { background: #266c92; color: #ffffff; }
.luna-badge.teal.xstrong { background: #0c3f5c; color: #ffffff; }

/* ---- LUNA TABLIST ---- */
.luna-tablist { display: flex; gap: 1.25rem; border-bottom: 1px solid #e2e8f0; }
.luna-tab {
    display: flex; align-items: center;
    height: 2.5rem; padding: 0;
    font-size: 0.875rem; font-weight: 500; font-family: inherit;
    color: #0f172a; background: none;
    border: none; border-bottom: 2px solid transparent;
    cursor: pointer; white-space: nowrap;
    transition: border-color 0.15s;
}
.luna-tab:hover { border-bottom-color: #e2e8f0; }
.luna-tab.active { color: #266c92; border-bottom-color: #266c92; }
.luna-tablist[data-size="sm"] .luna-tab { height: 2.25rem; }
.luna-tablist[data-size="lg"] .luna-tab { font-size: 1rem; height: 2.75rem; }

/* ============================================================
   REFINED POLISH — single layer, modern-minimalist quality
   Replaces all prior polish iterations. Scoped, non-destructive,
   focused on type rendering, focus rings, and transition easing.
   No universal border overrides. No layered shadows. No heavy
   chrome. Inspired by Harvey / Linear / Vercel design vocabulary.
   ============================================================ */

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-feature-settings: "ss01", "cv11", "cv02";
  letter-spacing: -0.005em;
}

h1, h2, h3, h4, h5, h6 {
  font-feature-settings: "ss01", "cv11", "cv02";
  letter-spacing: -0.022em;
  font-weight: 600;
}

h1 { line-height: 1.08; }
h2 { line-height: 1.2; }
h3 { line-height: 1.3; }

/* Subtle focus rings on interactive elements only */
*:focus { outline: none; }
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(168, 49, 63, 0.12);
}
a:focus-visible {
  outline: 2px solid rgba(168, 49, 63, 0.35);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Mono ligatures on code */
code, kbd, samp, pre,
.mono, [class*="mono"], [class*="-mono"] {
  font-feature-settings: "ss01", "cv01", "cv02", "cv11";
}

/* Smoother default easing on every transition */
* {
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Disable text-selection highlight on interactive nav chrome */
nav, button, .btn, [role="button"] {
  -webkit-tap-highlight-color: transparent;
}
