/* ==========================================================
   EVIDENTIA — Design Tokens (from CLAUDE.md)
   ========================================================== */
:root {
  /* Base */
  --color-canvas: #F8F9FB;
  --color-surface: #FFFFFF;
  --color-surface-raised: #F1F3F7;

  /* Nav */
  --color-nav-bg: #0F1A2E;
  --color-nav-bg-2: #142340;
  --color-nav-text: #A8B8D0;
  --color-nav-active: #FFFFFF;
  --color-nav-accent: #2563EB;

  /* Brand */
  --color-primary: #2563EB;
  --color-primary-hover: #1D4ED8;
  --color-secondary: #0EA5E9;

  /* Semantic */
  --color-finding-critical: #DC2626;
  --color-finding-major: #EA580C;
  --color-finding-minor: #CA8A04;
  --color-finding-info: #2563EB;
  --color-pass: #16A34A;
  --color-pending: #9333EA;

  /* Text */
  --color-text-primary: #0F172A;
  --color-text-secondary: #475569;
  --color-text-muted: #94A3B8;
  --color-text-inverse: #F8FAFC;

  /* Border */
  --color-border: #E2E8F0;
  --color-border-strong: #CBD5E1;

  /* Typography */
  --font-display: 'IBM Plex Sans', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', '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;

  /* Layout */
  --sidebar-w: 240px;
  --sidebar-w-collapsed: 64px;
  --content-max: 1280px;

  /* Radius */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 8px 24px rgba(15, 23, 42, 0.12);
}

/* ==========================================================
   Reset & Base
   ========================================================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  background: var(--color-canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button { font: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; font-weight: 600; color: var(--color-text-primary); }
p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ==========================================================
   App Shell
   ========================================================== */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  transition: grid-template-columns 250ms ease-in-out;
}
.app-shell.is-collapsed {
  grid-template-columns: var(--sidebar-w-collapsed) 1fr;
}

/* ==========================================================
   Sidebar
   ========================================================== */
.sidebar {
  background: var(--color-nav-bg);
  color: var(--color-nav-text);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow: hidden;
  border-right: 1px solid rgba(255,255,255,0.04);
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: relative;
}
.sidebar__brand-mark {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: #fff;
  display: grid; place-items: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(37,99,235,0.4);
}
.sidebar__brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.sidebar__brand-name {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #fff;
}
.sidebar__brand-tag {
  font-size: 10px;
  font-weight: 500;
  font-style: italic;
  letter-spacing: 0.01em;
  color: var(--color-nav-text);
  opacity: 0.75;
  margin-top: 3px;
  white-space: nowrap;
}
.sidebar__collapse {
  margin-left: auto;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--color-nav-text);
  border-radius: var(--r-sm);
  width: 28px; height: 28px;
  display: grid; place-items: center;
  transition: background 80ms linear, color 80ms linear;
}
.sidebar__collapse:hover { background: rgba(255,255,255,0.06); color: #fff; }

.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 8px 16px;
}
.sidebar__nav::-webkit-scrollbar { width: 6px; }
.sidebar__nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

.nav-group { margin-top: 14px; }
.nav-group__label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
  padding: 8px 12px 6px;
  opacity: 0.65;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px 9px 14px;
  border-radius: var(--r-sm);
  margin: 2px 4px;
  color: var(--color-nav-text);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: background 80ms linear, color 80ms linear;
}
.nav-item:hover { background: rgba(255,255,255,0.04); color: #E2E8F0; }
.nav-item__icon {
  width: 22px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  color: inherit;
}
.nav-item__label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item__badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.nav-item__badge--info { background: rgba(37,99,235,0.22); color: #93C5FD; }
.nav-item__badge--alert { background: rgba(220,38,38,0.18); color: #FCA5A5; }
.nav-item__badge--muted { background: rgba(255,255,255,0.06); color: var(--color-text-muted); }

.nav-item.is-active {
  background: rgba(37,99,235,0.14);
  color: var(--color-nav-active);
}
.nav-item.is-active::before {
  content: '';
  position: absolute;
  left: -4px; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--color-nav-accent);
  border-radius: 0 2px 2px 0;
}

.nav-item--locked { opacity: 0.55; }
.nav-phase-tag {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  width: 28px; height: 18px;
  border-radius: 3px;
  background: rgba(255,255,255,0.07);
  color: var(--color-nav-text);
  letter-spacing: 0.04em;
}
.nav-item.is-active .nav-phase-tag {
  background: rgba(37,99,235,0.45);
  color: #fff;
}

.sidebar__footer {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 8px 8px 14px;
}
.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 8px;
  margin: 6px 4px 0;
  border-radius: var(--r-md);
  background: rgba(255,255,255,0.04);
}
.user-card__avatar {
  width: 32px; height: 32px;
  border-radius: 999px;
  background: linear-gradient(135deg, #6366F1, #2563EB);
  color: #fff;
  font-weight: 700;
  font-size: var(--text-xs);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.user-card__meta { min-width: 0; flex: 1; }
.user-card__name { color: #fff; font-size: var(--text-xs); font-weight: 600; }
.user-card__role { color: var(--color-text-muted); font-size: 10px; margin-top: 1px; }
.user-card__logout {
  background: transparent; border: 0; color: var(--color-text-muted);
  padding: 4px; border-radius: var(--r-sm);
}
.user-card__logout:hover { color: #fff; background: rgba(255,255,255,0.08); }

/* Collapsed mode */
.app-shell.is-collapsed .sidebar__brand-text,
.app-shell.is-collapsed .sidebar__collapse,
.app-shell.is-collapsed .nav-item__label,
.app-shell.is-collapsed .nav-item__badge,
.app-shell.is-collapsed .nav-group__label,
.app-shell.is-collapsed .user-card__meta,
.app-shell.is-collapsed .user-card__logout {
  display: none;
}
.app-shell.is-collapsed .nav-item { justify-content: center; padding: 9px 8px; }
.app-shell.is-collapsed .user-card { justify-content: center; padding: 8px 4px; }

@media (max-width: 1024px) {
  .app-shell { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }
}

/* ==========================================================
   Canvas / Pages
   ========================================================== */
.canvas {
  min-width: 0;
  background: var(--color-canvas);
  overflow-x: hidden;
}
.canvas:focus { outline: none; }
.page { display: none; padding: 24px 32px 80px; }
.page.is-active { display: block; animation: fadeIn 150ms ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(2px);} to { opacity: 1; transform: translateY(0);} }
.page__inner { max-width: var(--content-max); margin: 0 auto; }

/* ==========================================================
   Page Header
   ========================================================== */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--color-border);
}
.page-header__left { min-width: 0; flex: 1; }
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: 8px;
  font-weight: 500;
}
.breadcrumb__sep { opacity: 0.6; }
.breadcrumb a:hover { color: var(--color-text-secondary); }
.breadcrumb__current { color: var(--color-text-secondary); font-weight: 600; }

.page-header__title-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.page-header h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
}
.page-header__sub {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-top: 6px;
  max-width: 720px;
  line-height: 1.55;
}
.page-header__actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* ==========================================================
   Buttons
   ========================================================== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--r-sm);
  font-size: var(--text-sm);
  font-weight: 600;
  border: 1px solid transparent;
  transition: background 80ms linear, color 80ms linear, border-color 80ms linear;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn--primary {
  background: var(--color-primary);
  color: #fff;
}
.btn--primary:hover { background: var(--color-primary-hover); }
.btn--ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border-color: var(--color-border);
}
.btn--ghost:hover { background: var(--color-surface-raised); color: var(--color-text-primary); border-color: var(--color-border-strong); }
.btn--danger { background: var(--color-finding-critical); color: #fff; }
.btn--sm { height: 30px; padding: 0 12px; font-size: var(--text-xs); }
.btn--icon { width: 32px; padding: 0; justify-content: center; }

.btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 1px; }

/* ==========================================================
   Badges (Status)
   ========================================================== */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.7;
}
.badge--pending    { background: #F3F4F6; color: #374151; }
.badge--processing { background: #F5F3FF; color: #7C3AED; animation: pulse 1.5s ease-in-out infinite; }
.badge--pass       { background: #F0FDF4; color: #15803D; }
.badge--finding    { background: #FEF2F2; color: #B91C1C; }
.badge--review     { background: #FFFBEB; color: #92400E; }
.badge--closed     { background: #F8F9FA; color: #6B7280; }
.badge--info       { background: #EFF6FF; color: #1D4ED8; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.severity-tag {
  display: inline-flex; align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 3px;
  text-transform: uppercase;
}
.severity-tag--critical { background: rgba(220,38,38,0.1); color: var(--color-finding-critical); }
.severity-tag--major    { background: rgba(234,88,12,0.1); color: var(--color-finding-major); }
.severity-tag--minor    { background: rgba(202,138,4,0.1); color: var(--color-finding-minor); }
.severity-tag--info     { background: rgba(37,99,235,0.1); color: var(--color-finding-info); }

/* ==========================================================
   Cards & Grids
   ========================================================== */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  padding: 20px;
}
.card--flat { box-shadow: none; }
.card--raised { box-shadow: var(--shadow-sm); }
.card__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; }
.card__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text-primary);
}
.card__sub {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}
.card__actions { display: flex; gap: 8px; }

.grid { display: grid; gap: 20px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--2-1 { grid-template-columns: 2fr 1fr; }
.grid--1-2 { grid-template-columns: 1fr 2fr; }
@media (max-width: 1080px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--2-1, .grid--1-2 { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

/* Stat tiles */
.stat-tile {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}
.stat-tile__label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.stat-tile__value {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 600;
  margin-top: 8px;
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
}
.stat-tile__delta {
  font-size: var(--text-xs);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
}
.stat-tile__delta--up { color: var(--color-pass); }
.stat-tile__delta--down { color: var(--color-finding-critical); }
.stat-tile__delta--flat { color: var(--color-text-muted); }
.stat-tile__sparkline { position: absolute; right: 12px; top: 16px; opacity: 0.7; }

/* ==========================================================
   Tables
   ========================================================== */
.table-wrap {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.table thead th {
  text-align: left;
  padding: 12px 16px;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}
.table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
  height: 48px;
  vertical-align: middle;
  color: var(--color-text-primary);
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background 80ms linear; }
.table tbody tr:hover { background: var(--color-surface-raised); }
.table tbody tr.has-severity { border-left: 4px solid var(--color-border); }
.table tbody tr.has-severity--critical { border-left-color: var(--color-finding-critical); }
.table tbody tr.has-severity--major    { border-left-color: var(--color-finding-major); }
.table tbody tr.has-severity--minor    { border-left-color: var(--color-finding-minor); }
.table tbody tr.has-severity--info     { border-left-color: var(--color-finding-info); }
.table tbody tr.has-severity--pass     { border-left-color: var(--color-pass); }

.table .cell--mono { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-text-secondary); }
.table .cell--num { font-variant-numeric: tabular-nums; text-align: right; }
.table .cell--strong { font-weight: 600; }

.table-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
  border-top: 1px solid var(--color-border);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.pagination { display: flex; gap: 4px; }
.pagination button {
  width: 28px; height: 28px;
  border-radius: var(--r-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
  font-weight: 600;
}
.pagination button.is-active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.pagination button:hover:not(.is-active) { background: var(--color-surface-raised); }

/* ==========================================================
   Finding Card (P04/P05)
   ========================================================== */
.finding {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-border-strong);
  border-radius: var(--r-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow 80ms linear;
}
.finding:hover { box-shadow: var(--shadow-sm); }
.finding--critical { border-left-color: var(--color-finding-critical); }
.finding--major    { border-left-color: var(--color-finding-major); }
.finding--minor    { border-left-color: var(--color-finding-minor); }
.finding--info     { border-left-color: var(--color-finding-info); }

.finding__head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.finding__code {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 600;
}
.finding__title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
}
.finding__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 24px;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}
.finding__meta b { color: var(--color-text-primary); font-weight: 600; }

.confidence {
  display: flex; align-items: center; gap: 10px;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}
.confidence__bar {
  flex: 1;
  height: 6px;
  background: var(--color-surface-raised);
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  gap: 1px;
}
.confidence__seg {
  flex: 1;
  background: var(--color-border);
}
.confidence__seg.is-on { background: var(--color-primary); }
.confidence__val { font-family: var(--font-mono); font-weight: 600; color: var(--color-text-primary); }

.finding__actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  border-top: 1px dashed var(--color-border);
  padding-top: 12px;
}

/* ==========================================================
   AI Output Panel
   ========================================================== */
.ai-panel {
  background: #F8FAFF;
  border: 1px solid #DBEAFE;
  border-radius: var(--r-md);
  overflow: hidden;
}
.ai-panel__head {
  background: #EFF6FF;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: #1E40AF;
  border-bottom: 1px solid #DBEAFE;
}
.ai-panel__head .ai-dot {
  width: 7px; height: 7px;
  border-radius: 999px;
  background: var(--color-pending);
  animation: pulse 1.5s ease-in-out infinite;
}
.ai-panel__head .ai-meta { margin-left: auto; opacity: 0.8; }
.ai-panel__body {
  padding: 16px 18px;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  line-height: 1.7;
  white-space: pre-wrap;
}
.ai-panel__warn {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: #FFFBEB;
  border-top: 1px solid #FEF3C7;
  color: #92400E;
  font-size: var(--text-xs);
  font-weight: 500;
}

/* ==========================================================
   Forms
   ========================================================== */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  font-weight: 500;
}
.field__input,
.field__select,
.field__textarea {
  height: 40px;
  border: 1px solid var(--color-border);
  border-radius: var(--r-sm);
  padding: 0 12px;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  background: var(--color-surface);
  transition: border-color 80ms linear, box-shadow 80ms linear;
}
.field__textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 80px; }
.field__input:focus,
.field__select:focus,
.field__textarea:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
  border-color: var(--color-primary);
}
.field__hint { font-size: var(--text-xs); color: var(--color-text-muted); }

/* ==========================================================
   Stepper (P00)
   ========================================================== */
.stepper { display: flex; align-items: center; gap: 0; margin-bottom: 24px; }
.stepper__step { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.stepper__bubble {
  width: 32px; height: 32px;
  border-radius: 999px;
  background: var(--color-surface-raised);
  color: var(--color-text-muted);
  display: grid; place-items: center;
  font-weight: 700;
  font-size: var(--text-sm);
  border: 2px solid var(--color-border);
  flex-shrink: 0;
}
.stepper__step.is-done .stepper__bubble { background: var(--color-pass); color: #fff; border-color: var(--color-pass); }
.stepper__step.is-active .stepper__bubble { background: var(--color-primary); color: #fff; border-color: var(--color-primary); box-shadow: 0 0 0 4px rgba(37,99,235,0.18); }
.stepper__meta { min-width: 0; }
.stepper__title { font-size: var(--text-sm); font-weight: 600; color: var(--color-text-primary); }
.stepper__sub { font-size: var(--text-xs); color: var(--color-text-muted); }
.stepper__step.is-active .stepper__title { color: var(--color-primary); }
.stepper__line {
  flex: 1; height: 2px;
  background: var(--color-border);
  margin: 0 8px;
  min-width: 24px;
}
.stepper__step.is-done + .stepper__line { background: var(--color-pass); }
.stepper__step { cursor: pointer; transition: opacity 80ms linear; }
.stepper__step:hover { opacity: 0.85; }
.stepper__step:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; border-radius: var(--r-sm); }
@media (max-width: 920px) {
  .stepper__meta { display: none; }
}

/* Permission matrix (P00 step 4) */
.perm-matrix {
  display: grid;
  grid-template-columns: 200px repeat(8, minmax(60px, 1fr));
  gap: 4px;
  font-size: var(--text-xs);
  overflow-x: auto;
}
.perm-matrix__head {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  padding: 8px 6px;
  text-align: center;
  font-family: var(--font-mono);
}
.perm-matrix__rowhead {
  padding: 10px 12px;
  background: var(--color-surface-raised);
  border-radius: var(--r-sm);
  font-weight: 600;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.perm-matrix__cell {
  height: 40px;
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  background: var(--color-surface-raised);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background 80ms linear, transform 80ms linear;
}
.perm-matrix__cell:hover { transform: scale(1.05); }
.perm-matrix__cell--full   { background: rgba(22,163,74,0.15); color: var(--color-pass); }
.perm-matrix__cell--write  { background: rgba(37,99,235,0.15); color: var(--color-primary); }
.perm-matrix__cell--read   { background: rgba(148,163,184,0.18); color: var(--color-text-secondary); }
.perm-matrix__cell--approve{ background: rgba(147,51,234,0.15); color: var(--color-pending); }
.perm-matrix__cell--none   { background: var(--color-surface); color: var(--color-text-muted); border: 1px dashed var(--color-border); }

.role-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 3px;
}
.role-pill--partner  { background: rgba(220,38,38,0.1);  color: var(--color-finding-critical); }
.role-pill--manager  { background: rgba(234,88,12,0.1);  color: var(--color-finding-major); }
.role-pill--senior   { background: rgba(37,99,235,0.1);  color: var(--color-primary); }
.role-pill--junior   { background: rgba(14,165,233,0.1); color: var(--color-secondary); }
.role-pill--admin    { background: rgba(147,51,234,0.1); color: var(--color-pending); }

/* Toggle switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle__slider {
  position: absolute;
  inset: 0;
  background: var(--color-border-strong);
  border-radius: 999px;
  transition: background 150ms ease-in-out;
  cursor: pointer;
}
.toggle__slider::before {
  content: '';
  position: absolute;
  height: 14px; width: 14px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 999px;
  transition: transform 150ms ease-in-out;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle input:checked + .toggle__slider { background: var(--color-primary); }
.toggle input:checked + .toggle__slider::before { transform: translateX(16px); }
.toggle input:focus-visible + .toggle__slider { outline: 2px solid var(--color-primary); outline-offset: 2px; }

/* Notification rule row */
.notif-rule {
  display: grid;
  grid-template-columns: 32px 1fr auto auto auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  transition: border-color 80ms linear;
}
.notif-rule:hover { border-color: var(--color-border-strong); }
.notif-rule__icon {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  background: var(--color-surface-raised);
  display: grid; place-items: center;
}
.notif-rule__name { font-weight: 600; font-size: var(--text-sm); }
.notif-rule__desc { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 2px; }
.notif-rule__channels { display: flex; gap: 6px; }
.channel-chip {
  width: 28px; height: 28px;
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  background: var(--color-surface-raised);
  color: var(--color-text-muted);
  transition: background 80ms linear, color 80ms linear;
}
.channel-chip.is-on { background: rgba(37,99,235,0.12); color: var(--color-primary); }
.channel-chip--slack.is-on   { background: rgba(74,21,75,0.1);  color: #4A154B; }
.channel-chip--teams.is-on   { background: rgba(70,71,117,0.1); color: #464775; }
.channel-chip--email.is-on   { background: rgba(37,99,235,0.12);color: var(--color-primary); }
.channel-chip--inapp.is-on   { background: rgba(22,163,74,0.12);color: var(--color-pass); }

.escalation-chain {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.escalation-step {
  display: grid;
  grid-template-columns: 32px 80px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--color-surface-raised);
  border-radius: var(--r-sm);
}
.escalation-step__num {
  width: 24px; height: 24px;
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}
.escalation-step__time {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  font-weight: 600;
}

/* Declaration question (P01 Independence) */
.declaration-q {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  background: var(--color-surface);
  transition: border-color 80ms linear;
}
.declaration-q + .declaration-q { margin-top: 10px; }
.declaration-q:hover { border-color: var(--color-border-strong); }
.declaration-q__title { font-size: var(--text-sm); font-weight: 600; }
.declaration-q__hint { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 4px; line-height: 1.5; }
.declaration-q__answer {
  display: flex; gap: 4px;
  border: 1px solid var(--color-border);
  border-radius: var(--r-sm);
  padding: 2px;
  height: fit-content;
  flex-shrink: 0;
}
.declaration-q__answer button {
  background: transparent;
  border: 0;
  padding: 6px 14px;
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: 3px;
  color: var(--color-text-secondary);
}
.declaration-q__answer button.is-yes { background: rgba(220,38,38,0.1); color: var(--color-finding-critical); }
.declaration-q__answer button.is-no { background: rgba(22,163,74,0.1); color: var(--color-pass); }

/* Signature box */
.signature-box {
  border: 2px solid var(--color-border);
  border-radius: var(--r-md);
  padding: 20px;
  background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
}
.signature-box--signed {
  border-color: var(--color-pass);
  background: linear-gradient(180deg, #FFFFFF 0%, #F0FDF4 100%);
}
.signature-line {
  border-bottom: 2px solid var(--color-text-primary);
  padding-bottom: 4px;
  min-height: 56px;
  display: flex;
  align-items: flex-end;
  font-family: 'Brush Script MT', cursive, var(--font-display);
  font-size: 28px;
  color: var(--color-text-primary);
  font-style: italic;
}
.signature-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
  font-size: var(--text-xs);
}
.signature-meta b { display: block; color: var(--color-text-muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 2px; font-weight: 600; }
.signature-meta .mono { color: var(--color-text-primary); font-weight: 500; }
.signature-cert {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 4px 8px;
  background: #EFF6FF;
  color: var(--color-primary);
  border: 1px solid #DBEAFE;
  border-radius: 3px;
  margin-top: 10px;
}

/* Approval chain (Accept/Reject workflow) */
.approval-chain {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  position: relative;
}
@media (max-width: 720px) {
  .approval-chain { grid-template-columns: 1fr; }
}
.approval-node {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--r-md);
  padding: 18px 20px;
  position: relative;
  display: flex; flex-direction: column; gap: 8px;
}
.approval-node + .approval-node { margin-left: 12px; }
@media (max-width: 720px) {
  .approval-node + .approval-node { margin-left: 0; margin-top: 12px; }
}
.approval-node--done { border-color: var(--color-pass); background: linear-gradient(180deg, #FFFFFF 0%, #F0FDF4 100%); }
.approval-node--active { border-color: var(--color-primary); box-shadow: 0 0 0 4px rgba(37,99,235,0.1); }
.approval-node__head { display: flex; align-items: center; gap: 10px; }
.approval-node__avatar {
  width: 36px; height: 36px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: #fff;
  font-weight: 700;
  font-size: var(--text-xs);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.approval-node--done .approval-node__avatar { background: var(--color-pass); }
.approval-node__role {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
}
.approval-node__name { font-weight: 600; font-size: var(--text-sm); }
.approval-node__action {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  display: flex; align-items: center; gap: 6px;
}

/* Decision card (Accept / Reject / Continue) */
.decision-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 720px) { .decision-grid { grid-template-columns: 1fr; } }
.decision-card {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--r-md);
  padding: 18px 20px;
  cursor: pointer;
  transition: border-color 80ms linear, transform 80ms linear;
  display: flex; flex-direction: column; gap: 8px;
}
.decision-card:hover { transform: translateY(-1px); }
.decision-card__icon {
  width: 38px; height: 38px;
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  background: var(--color-surface-raised);
  color: var(--color-text-secondary);
}
.decision-card__title { font-family: var(--font-display); font-weight: 600; font-size: var(--text-base); }
.decision-card__desc { font-size: var(--text-xs); color: var(--color-text-secondary); line-height: 1.5; }
.decision-card--accept { border-color: var(--color-pass); }
.decision-card--accept .decision-card__icon { background: rgba(22,163,74,0.1); color: var(--color-pass); }
.decision-card--continue { border-color: var(--color-primary); }
.decision-card--continue .decision-card__icon { background: rgba(37,99,235,0.1); color: var(--color-primary); }
.decision-card--reject { border-color: var(--color-finding-critical); }
.decision-card--reject .decision-card__icon { background: rgba(220,38,38,0.1); color: var(--color-finding-critical); }
.decision-card.is-selected { box-shadow: 0 0 0 4px rgba(37,99,235,0.12); }

/* Document preview (Engagement Letter) */
.doc-preview {
  background: #FFFFFF;
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  padding: 40px 48px;
  font-family: var(--font-display);
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  line-height: 1.7;
  box-shadow: var(--shadow-md);
  max-height: 520px;
  overflow-y: auto;
  position: relative;
}
.doc-preview__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--color-text-primary);
  margin-bottom: 18px;
}
.doc-preview__logo {
  width: 40px; height: 40px;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  display: grid; place-items: center;
  color: #fff;
  font-weight: 700;
}
.doc-preview__kap { text-align: right; font-size: var(--text-xs); color: var(--color-text-secondary); line-height: 1.5; }
.doc-preview__kap b { color: var(--color-text-primary); font-size: var(--text-sm); display: block; }
.doc-preview h2 { font-size: var(--text-lg); margin: 18px 0 8px; }
.doc-preview p { margin: 0 0 12px; font-size: var(--text-sm); }
.doc-preview ul { font-size: var(--text-sm); margin: 0 0 12px; padding-left: 20px; }
.doc-preview ul li { margin-bottom: 6px; }
.doc-preview__field {
  display: inline-block;
  background: #FFFBEB;
  border-bottom: 1px dashed var(--color-finding-minor);
  padding: 0 4px;
}
.doc-preview__sign-area {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--color-border);
}
.doc-preview__sign-box {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}
.doc-preview__sign-line {
  border-bottom: 1px solid var(--color-text-primary);
  height: 40px;
  margin-bottom: 8px;
}

/* Team roster (P01 Engagement Team) */
.team-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  padding: 16px 18px;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 14px;
  align-items: center;
}
.team-card__avatar {
  width: 44px; height: 44px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: #fff;
  font-weight: 700;
  font-size: var(--text-sm);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.team-card__name { font-weight: 600; font-size: var(--text-sm); }
.team-card__role { font-size: var(--text-xs); color: var(--color-text-muted); }
.team-card__meta { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.team-card__check { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: var(--text-xs); }

/* Document checklist (P01 Required Documents) */
.doc-checklist { display: flex; flex-direction: column; }
.doc-check-row {
  display: grid;
  grid-template-columns: 22px 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--color-border);
}
.doc-check-row:last-child { border-bottom: 0; }
.doc-checkbox {
  width: 18px; height: 18px;
  border-radius: 4px;
  border: 2px solid var(--color-border-strong);
  background: var(--color-surface);
  display: grid; place-items: center;
  cursor: pointer;
  transition: background 80ms linear, border-color 80ms linear;
  flex-shrink: 0;
}
.doc-checkbox.is-checked {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.doc-checkbox.is-checked::after {
  content: '';
  width: 4px; height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}
.doc-check-row__label { font-size: var(--text-sm); font-weight: 500; color: var(--color-text-primary); }
.doc-check-row__sub { font-size: 11px; color: var(--color-text-muted); margin-top: 2px; }
.phase-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(37,99,235,0.12);
  color: var(--color-primary);
  letter-spacing: 0.04em;
}
.phase-tag--p02 { background: rgba(147,51,234,0.12); color: var(--color-pending); }

/* Data lineage row */
.lineage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.lineage-table th {
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--color-border);
}
.lineage-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}
.lineage-table tr:last-child td { border-bottom: 0; }
.dim-pill {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  margin-right: 4px;
  margin-bottom: 4px;
  letter-spacing: 0.04em;
}
.dim-pill--industry { background: rgba(14,165,233,0.12);  color: var(--color-secondary); }
.dim-pill--financial{ background: rgba(220,38,38,0.10);   color: var(--color-finding-critical); }
.dim-pill--governance{ background: rgba(234,88,12,0.10);  color: var(--color-finding-major); }
.dim-pill--regulatory{ background: rgba(147,51,234,0.10); color: var(--color-pending); }
.dim-pill--ethics    { background: rgba(202,138,4,0.10);  color: var(--color-finding-minor); }

/* Rating picker (Low/Medium/High) — for Fraud Triangle */
.rating-pick {
  display: inline-flex; gap: 4px;
  border: 1px solid var(--color-border);
  border-radius: var(--r-sm);
  padding: 2px;
  height: fit-content;
}
.rating-pick button {
  background: transparent; border: 0;
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 700;
  border-radius: 3px;
  color: var(--color-text-secondary);
  letter-spacing: 0.04em;
}
.rating-pick button.is-low    { background: rgba(22,163,74,0.12);   color: var(--color-pass); }
.rating-pick button.is-med    { background: rgba(202,138,4,0.12);   color: var(--color-finding-minor); }
.rating-pick button.is-high   { background: rgba(220,38,38,0.12);   color: var(--color-finding-critical); }

/* Fraud triangle sections */
.fraud-triangle {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 980px) { .fraud-triangle { grid-template-columns: 1fr; } }
.fraud-section {
  border: 1px solid var(--color-border);
  border-top: 4px solid var(--color-border-strong);
  border-radius: var(--r-md);
  background: var(--color-surface);
  padding: 16px 18px;
}
.fraud-section--pressure       { border-top-color: var(--color-finding-critical); }
.fraud-section--opportunity    { border-top-color: var(--color-finding-major); }
.fraud-section--rationalization{ border-top-color: var(--color-finding-minor); }
.fraud-section__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-base);
  margin-bottom: 4px;
}
.fraud-section__sub { font-size: var(--text-xs); color: var(--color-text-muted); margin-bottom: 12px; }
.fraud-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--color-border);
}
.fraud-item__label { font-size: var(--text-sm); font-weight: 500; }
.fraud-item__hint { font-size: 11px; color: var(--color-text-muted); margin-top: 2px; line-height: 1.5; }

/* Meeting notes (Fraud Team Discussion) */
.meeting-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.meeting-card__head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 16px 20px;
  background: linear-gradient(180deg, #F8FAFF 0%, #FFFFFF 100%);
  border-bottom: 1px solid var(--color-border);
}
.meeting-card__title { font-family: var(--font-display); font-weight: 600; font-size: var(--text-lg); }
.meeting-card__when {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin-top: 4px;
}
.meeting-card__attendees { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 20px; border-bottom: 1px solid var(--color-border); }
.attendee-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--color-surface-raised);
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  font-size: var(--text-xs);
}
.attendee-chip__avatar {
  width: 22px; height: 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: #fff;
  font-size: 10px; font-weight: 700;
  display: grid; place-items: center;
}
.meeting-card__body { padding: 18px 20px; }
.meeting-section + .meeting-section { margin-top: 16px; }
.meeting-section__head {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}
.meeting-section__body {
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  line-height: 1.6;
}
.meeting-section__body ul { margin: 0; padding-left: 18px; }
.meeting-section__body li { margin: 4px 0; }

/* Assertion matrix (FR-P03-09) */
.assertion-matrix {
  display: grid;
  grid-template-columns: 220px repeat(6, 1fr);
  gap: 4px;
}
.assertion-matrix__head {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  padding: 8px 6px;
  text-align: center;
}
.assertion-matrix__rowhead {
  background: var(--color-surface-raised);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-weight: 600;
  font-size: var(--text-xs);
  display: flex; align-items: center;
}
.assertion-matrix__cell {
  height: 44px;
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 700;
  cursor: pointer;
  transition: transform 80ms linear;
}
.assertion-matrix__cell:hover { transform: scale(1.04); }
.assertion-matrix__cell--high   { background: rgba(220,38,38,0.14);  color: var(--color-finding-critical); border: 1px solid rgba(220,38,38,0.3); }
.assertion-matrix__cell--med    { background: rgba(234,88,12,0.12);  color: var(--color-finding-major); border: 1px solid rgba(234,88,12,0.25); }
.assertion-matrix__cell--low    { background: rgba(22,163,74,0.10);  color: var(--color-pass); border: 1px solid rgba(22,163,74,0.2); }
.assertion-matrix__cell--na     { background: var(--color-surface-raised); color: var(--color-text-muted); }

/* Significant Risk gate criteria */
.sig-risk-criteria {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--r-sm);
}
.sig-risk-criteria + .sig-risk-criteria { margin-top: 8px; }
.sig-risk-criteria__label { font-size: var(--text-sm); }
.sig-risk-criteria__hint { font-size: 11px; color: var(--color-text-muted); margin-top: 2px; }

/* Going Concern indicator dots */
.gc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
@media (max-width: 720px) { .gc-grid { grid-template-columns: 1fr; } }
.gc-item {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--r-sm);
  background: var(--color-surface);
}
.gc-item__dot {
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--color-pass);
}
.gc-item--yellow .gc-item__dot { background: var(--color-finding-minor); }
.gc-item--red    .gc-item__dot { background: var(--color-finding-critical); }
.gc-item__label  { font-size: var(--text-sm); font-weight: 500; }
.gc-item__value  { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-text-secondary); font-weight: 600; }

/* Filter bar (JE Investigation) */
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  padding: 12px 14px;
}
.filter-bar .field__input,
.filter-bar .field__select {
  height: 36px;
  font-size: var(--text-xs);
}
.filter-bar__label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Pattern distribution bars */
.pattern-bars { display: flex; flex-direction: column; gap: 10px; }
.pattern-bar {
  display: grid;
  grid-template-columns: 220px 1fr 50px 70px;
  gap: 14px;
  align-items: center;
}
.pattern-bar__label { font-size: var(--text-sm); font-weight: 500; }
.pattern-bar__track {
  height: 14px;
  background: var(--color-surface-raised);
  border-radius: 999px;
  overflow: hidden;
}
.pattern-bar__fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 999px;
}
.pattern-bar__fill--critical { background: var(--color-finding-critical); }
.pattern-bar__fill--major    { background: var(--color-finding-major); }
.pattern-bar__fill--minor    { background: var(--color-finding-minor); }
.pattern-bar__count { font-family: var(--font-mono); font-size: var(--text-sm); font-weight: 600; text-align: right; }
.pattern-bar__sev { text-align: right; }

/* JE table specifics */
.je-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-secondary);
  white-space: nowrap;
}
.je-time--alert {
  color: var(--color-finding-critical);
  font-weight: 600;
}
.day-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--color-surface-raised);
  color: var(--color-text-secondary);
  margin-right: 4px;
  letter-spacing: 0.04em;
}
.day-tag--weekend { background: rgba(220,38,38,0.1); color: var(--color-finding-critical); }
.day-tag--offhours { background: rgba(234,88,12,0.1); color: var(--color-finding-major); }

.je-pattern-tag {
  display: inline-flex; align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 3px;
  background: var(--color-surface-raised);
  color: var(--color-text-secondary);
  white-space: nowrap;
}
.je-pattern-tag--round { background: rgba(220,38,38,0.1);  color: var(--color-finding-critical); }
.je-pattern-tag--rev   { background: rgba(234,88,12,0.1);  color: var(--color-finding-major); }
.je-pattern-tag--off   { background: rgba(202,138,4,0.1);  color: var(--color-finding-minor); }
.je-pattern-tag--rpt   { background: rgba(147,51,234,0.1); color: var(--color-pending); }
.je-pattern-tag--dup   { background: rgba(14,165,233,0.1); color: var(--color-secondary); }

/* Bulk action footer */
.bulk-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-raised);
  gap: 14px;
  flex-wrap: wrap;
}
.bulk-footer__count {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-primary);
}

/* Filter banner (cross-tab context) */
.filter-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #EFF6FF;
  border: 1px solid #DBEAFE;
  border-left: 4px solid var(--color-primary);
  border-radius: var(--r-md);
  padding: 14px 18px;
  margin-bottom: 18px;
  animation: slideIn 250ms ease-out;
}
.filter-banner[hidden] { display: none; }
.filter-banner__icon {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  background: rgba(37,99,235,0.15);
  color: var(--color-primary);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.filter-banner__body { flex: 1; min-width: 0; }
.filter-banner__title { font-size: var(--text-sm); font-weight: 600; color: var(--color-text-primary); }
.filter-banner__sub { font-size: var(--text-xs); color: var(--color-text-secondary); margin-top: 2px; }

/* Dimmed rows (filtered out but kept visible) */
.je-row-dim {
  opacity: 0.28;
  transition: opacity 200ms ease-in-out;
}

/* Clickable SR row */
.sr-row { cursor: pointer; }
.sr-row td:last-child { color: var(--color-primary); }
.sr-row:hover td:last-child { color: var(--color-primary-hover); }
.sr-row__chevron {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-primary);
  white-space: nowrap;
}
.sr-row__chevron svg { transition: transform 80ms linear; }
.sr-row:hover .sr-row__chevron svg { transform: translateX(2px); }

/* ==========================================================
   P04 Workspace components
   ========================================================== */

/* Inherited from previous phase banner (top of tab) */
.inherited-banner {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 14px;
  align-items: center;
  background: linear-gradient(90deg, #F0F6FF 0%, #FFFFFF 100%);
  border: 1px solid #DBEAFE;
  border-left: 4px solid var(--color-pending);
  border-radius: var(--r-md);
  padding: 12px 16px;
  margin-bottom: 18px;
}
.inherited-banner__icon {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  background: rgba(147,51,234,0.12);
  color: var(--color-pending);
  display: grid; place-items: center;
}
.inherited-banner__title { font-size: var(--text-sm); font-weight: 600; }
.inherited-banner__sub { font-size: var(--text-xs); color: var(--color-text-secondary); margin-top: 2px; }
.inherited-banner__chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

/* Cycle picker (workspace selector) */
.cycle-picker {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}
@media (max-width: 980px) { .cycle-picker { grid-template-columns: repeat(2, 1fr); } }
.cycle-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 80ms linear, transform 80ms linear;
  display: flex; flex-direction: column; gap: 8px;
}
.cycle-card:hover { border-color: var(--color-border-strong); transform: translateY(-1px); }
.cycle-card.is-active { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); background: #F0F6FF; }
.cycle-card__name { font-family: var(--font-display); font-weight: 600; font-size: var(--text-sm); }
.cycle-card__progress {
  height: 4px;
  background: var(--color-surface-raised);
  border-radius: 999px;
  overflow: hidden;
}
.cycle-card__progress-fill {
  height: 100%;
  background: var(--color-primary);
}
.cycle-card__meta {
  display: flex; justify-content: space-between;
  font-size: 10px;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* Cycle workspace switcher */
.cycle-workspace { display: none; }
.cycle-workspace.is-active { display: block; animation: fadeIn 150ms ease-out; }

/* Workspace step (numbered section) */
.step-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  margin-bottom: 14px;
  overflow: hidden;
}
.step-section__header {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}
.step-section__num {
  width: 28px; height: 28px;
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}
.step-section--done .step-section__num { background: var(--color-pass); }
.step-section--pending .step-section__num { background: var(--color-border-strong); color: var(--color-text-muted); }
.step-section__title { font-family: var(--font-display); font-weight: 600; font-size: var(--text-base); }
.step-section__sub { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 2px; }
.step-section__body { padding: 16px 18px; }

/* Control point row */
.control-point {
  display: grid;
  grid-template-columns: 24px 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--r-sm);
  background: var(--color-surface);
}
.control-point + .control-point { margin-top: 8px; }
.control-point__id {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
}
.control-point__desc { font-size: var(--text-sm); font-weight: 500; }
.control-point__hint { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 2px; }

/* Transaction trace (walkthrough sample) */
.trace { display: flex; flex-direction: column; gap: 0; position: relative; }
.trace-step {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 14px;
  padding: 14px 0 14px 0;
  position: relative;
}
.trace-step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 13px; top: 42px; bottom: -14px;
  width: 2px;
  background: var(--color-border);
}
.trace-step__bubble {
  width: 28px; height: 28px;
  border-radius: 999px;
  background: var(--color-surface-raised);
  color: var(--color-text-secondary);
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  z-index: 1;
  flex-shrink: 0;
}
.trace-step--ok .trace-step__bubble { background: rgba(22,163,74,0.15); color: var(--color-pass); }
.trace-step--issue .trace-step__bubble { background: rgba(220,38,38,0.15); color: var(--color-finding-critical); }
.trace-step__title { font-weight: 600; font-size: var(--text-sm); }
.trace-step__detail { font-size: var(--text-xs); color: var(--color-text-secondary); margin-top: 4px; line-height: 1.6; }
.trace-step__time { font-family: var(--font-mono); font-size: 11px; color: var(--color-text-muted); white-space: nowrap; }

/* ToC expand control row */
.toc-detail {
  background: var(--color-canvas);
  padding: 16px 20px;
  border-top: 1px solid var(--color-border);
  display: none;
}
.toc-detail.is-open { display: block; }
.toc-detail__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}
@media (max-width: 720px) { .toc-detail__grid { grid-template-columns: 1fr 1fr; } }
.toc-mini-stat {
  background: var(--color-surface);
  padding: 10px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--color-border);
}
.toc-mini-stat__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  font-weight: 600;
}
.toc-mini-stat__value { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 600; margin-top: 2px; }

.sample-row {
  display: grid;
  grid-template-columns: 24px 1fr 1fr 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-sm);
  font-size: var(--text-xs);
}
.sample-row + .sample-row { margin-top: 6px; }
.sample-row__id { font-family: var(--font-mono); font-weight: 600; color: var(--color-text-muted); }

.toc-row-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--color-primary);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
}

/* SoD cycle selector (sub-tabs) */
.sub-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.sub-tab {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-sm);
  padding: 8px 14px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background 80ms linear, color 80ms linear, border-color 80ms linear;
}
.sub-tab:hover { background: var(--color-surface-raised); }
.sub-tab.is-active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* SoD user drill-down */
.user-conflict {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-finding-critical);
  border-radius: var(--r-md);
}
.user-conflict + .user-conflict { margin-top: 10px; }
.user-conflict--major { border-left-color: var(--color-finding-major); }
.user-conflict__avatar {
  width: 40px; height: 40px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--color-finding-critical), var(--color-finding-major));
  color: #fff;
  font-weight: 700;
  font-size: var(--text-xs);
  display: grid; place-items: center;
}
.user-conflict__name { font-weight: 600; font-size: var(--text-sm); }
.user-conflict__role { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 2px; }
.user-conflict__chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

/* System inventory row */
.system-row {
  display: grid;
  grid-template-columns: 36px 1fr auto auto auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
}
.system-row + .system-row { margin-top: 8px; }
.system-row__icon {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  background: var(--color-surface-raised);
  color: var(--color-text-secondary);
  display: grid; place-items: center;
}
.system-row__name { font-weight: 600; font-size: var(--text-sm); }
.system-row__meta { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 2px; }

/* ==========================================================
   Risk Heat Map (5x5)
   ========================================================== */
.heatmap {
  display: grid;
  grid-template-columns: 28px repeat(5, 1fr);
  grid-template-rows: repeat(5, 64px) 28px;
  gap: 6px;
}
.heatmap__cell {
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: var(--text-xs);
  color: #fff;
  cursor: pointer;
  transition: transform 80ms linear, box-shadow 80ms linear;
  position: relative;
}
.heatmap__cell:hover { transform: scale(1.03); box-shadow: var(--shadow-sm); z-index: 1; }
.heatmap__cell--1 { background: #16A34A; }
.heatmap__cell--2 { background: #65A30D; }
.heatmap__cell--3 { background: #CA8A04; }
.heatmap__cell--4 { background: #EA580C; }
.heatmap__cell--5 { background: #DC2626; }
.heatmap__axis {
  display: grid; place-items: center;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 600;
}

/* ==========================================================
   COSO Heat Map matrix
   ========================================================== */
.coso-matrix {
  display: grid;
  grid-template-columns: 200px repeat(5, 1fr);
  gap: 4px;
}
.coso-matrix__head, .coso-matrix__rowhead {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  padding: 8px 6px;
}
.coso-matrix__rowhead { background: var(--color-surface-raised); border-radius: var(--r-sm); color: var(--color-text-primary); text-transform: none; letter-spacing: 0; font-weight: 600; }
.coso-matrix__cell {
  height: 40px;
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: transform 80ms linear;
}
.coso-matrix__cell:hover { transform: scale(1.03); }
.coso-matrix__cell--pass { background: var(--color-pass); }
.coso-matrix__cell--gap-minor { background: var(--color-finding-minor); }
.coso-matrix__cell--gap-major { background: var(--color-finding-major); }
.coso-matrix__cell--gap-critical { background: var(--color-finding-critical); }
.coso-matrix__cell--na { background: var(--color-border); color: var(--color-text-secondary); }

/* ==========================================================
   Activity feed / Timeline
   ========================================================== */
.activity { display: flex; flex-direction: column; gap: 0; }
.activity__item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--color-border);
  align-items: flex-start;
}
.activity__item:last-child { border-bottom: 0; }
.activity__dot {
  width: 28px; height: 28px;
  border-radius: 999px;
  display: grid; place-items: center;
  background: var(--color-surface-raised);
  color: var(--color-text-secondary);
  flex-shrink: 0;
}
.activity__dot--ai { background: #F5F3FF; color: var(--color-pending); }
.activity__dot--pass { background: #F0FDF4; color: var(--color-pass); }
.activity__dot--alert { background: #FEF2F2; color: var(--color-finding-critical); }
.activity__msg { font-size: var(--text-sm); color: var(--color-text-primary); line-height: 1.45; }
.activity__sub { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 2px; }
.activity__time { font-size: var(--text-xs); color: var(--color-text-muted); font-family: var(--font-mono); white-space: nowrap; }

/* ==========================================================
   Upload zone
   ========================================================== */
.dropzone {
  border: 2px dashed var(--color-border-strong);
  border-radius: var(--r-md);
  padding: 32px;
  text-align: center;
  background: var(--color-surface-raised);
  color: var(--color-text-secondary);
  transition: border-color 80ms linear, background 80ms linear;
}
.dropzone:hover { border-color: var(--color-primary); background: #F0F6FF; color: var(--color-primary); }
.dropzone__icon { width: 36px; height: 36px; margin: 0 auto 8px; color: var(--color-text-muted); }
.dropzone__title { font-weight: 600; font-size: var(--text-sm); color: var(--color-text-primary); }
.dropzone__hint { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 4px; }
.file-row {
  display: grid;
  grid-template-columns: 24px 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--r-sm);
  background: var(--color-surface);
  margin-top: 8px;
}
.file-row__name { font-size: var(--text-sm); font-weight: 500; }
.file-row__meta { font-size: var(--text-xs); color: var(--color-text-muted); font-family: var(--font-mono); }
.progress { width: 120px; height: 6px; background: var(--color-surface-raised); border-radius: 999px; overflow: hidden; }
.progress__fill { height: 100%; background: var(--color-primary); transition: width 200ms ease-out; }

/* ==========================================================
   Tabs
   ========================================================== */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 20px;
  overflow-x: auto;
}
.tab {
  background: transparent; border: 0;
  padding: 12px 18px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color 80ms linear, border-color 80ms linear;
}
.tab:hover { color: var(--color-text-primary); }
.tab.is-active { color: var(--color-primary); border-bottom-color: var(--color-primary); }

.tab-panel { display: none; }
.tab-panel.is-active { display: block; animation: fadeIn 150ms ease-out; }

/* Walkthrough cycle list */
.cycle-list { display: flex; flex-direction: column; gap: 10px; }
.cycle-row {
  display: grid;
  grid-template-columns: 32px 1fr auto auto auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  transition: border-color 80ms linear;
}
.cycle-row:hover { border-color: var(--color-border-strong); }
.cycle-row__icon {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  background: var(--color-surface-raised);
  color: var(--color-text-secondary);
  display: grid; place-items: center;
}
.cycle-row__name { font-weight: 600; }
.cycle-row__meta { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 2px; }

/* ITGC quad */
.itgc-tile {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.itgc-tile__head { display: flex; align-items: center; justify-content: space-between; }
.itgc-tile__name { font-family: var(--font-display); font-size: var(--text-base); font-weight: 600; }
.itgc-tile__metric { display: flex; align-items: baseline; gap: 8px; }
.itgc-tile__value { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 600; }
.itgc-tile__label { font-size: var(--text-xs); color: var(--color-text-muted); }

/* SoD conflict matrix */
.sod-matrix {
  display: grid;
  grid-template-columns: 160px repeat(6, 1fr);
  gap: 4px;
  font-size: var(--text-xs);
}
.sod-matrix__head, .sod-matrix__rowhead {
  padding: 8px 6px;
  font-weight: 600;
  text-align: center;
  color: var(--color-text-muted);
}
.sod-matrix__rowhead {
  text-align: left;
  background: var(--color-surface-raised);
  border-radius: var(--r-sm);
  color: var(--color-text-primary);
}
.sod-matrix__cell {
  height: 36px;
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  background: var(--color-surface-raised);
  color: var(--color-text-muted);
}
.sod-matrix__cell--conflict-critical { background: rgba(220,38,38,0.12); color: var(--color-finding-critical); border: 1px solid rgba(220,38,38,0.3); }
.sod-matrix__cell--conflict-major    { background: rgba(234,88,12,0.12); color: var(--color-finding-major); border: 1px solid rgba(234,88,12,0.3); }
.sod-matrix__cell--ok                { background: rgba(22,163,74,0.08); color: var(--color-pass); }

/* Business Model Canvas (BMC) */
.bmc {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: 130px 130px 100px;
  gap: 8px;
  font-size: var(--text-xs);
}
.bmc__cell {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 4px;
  overflow: hidden;
}
.bmc__cell h4 {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}
.bmc__cell li { font-size: var(--text-xs); margin-left: 14px; color: var(--color-text-secondary); line-height: 1.5; }
.bmc__cell ul { margin: 0; padding: 0; }
.bmc__partners   { grid-row: 1 / span 2; grid-column: 1; }
.bmc__activities { grid-row: 1; grid-column: 2; }
.bmc__resources  { grid-row: 2; grid-column: 2; }
.bmc__value      { grid-row: 1 / span 2; grid-column: 3; background: #F0F6FF; border-color: #DBEAFE; }
.bmc__relations  { grid-row: 1; grid-column: 4; }
.bmc__channels   { grid-row: 2; grid-column: 4; }
.bmc__segments   { grid-row: 1 / span 2; grid-column: 5; }
.bmc__costs      { grid-row: 3; grid-column: 1 / span 2; background: #FEF3F2; border-color: #FECACA; }
.bmc__revenue    { grid-row: 3; grid-column: 3 / span 3; background: #F0FDF4; border-color: #BBF7D0; }
@media (max-width: 980px) {
  .bmc { grid-template-columns: 1fr 1fr; grid-template-rows: none; }
  .bmc__cell { grid-row: auto !important; grid-column: auto !important; }
}

/* Ownership tree */
.ownership { font-size: var(--text-sm); }
.ownership__node {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-sm);
}
.ownership__pct {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--color-surface-raised);
  color: var(--color-text-secondary);
  margin-left: auto;
}
.ownership__pct--ctrl { background: rgba(37,99,235,0.12); color: var(--color-primary); }
.ownership__pct--rpt { background: rgba(202,138,4,0.12); color: var(--color-finding-minor); }
.ownership__children { margin-left: 32px; margin-top: 6px; display: flex; flex-direction: column; gap: 6px;
  position: relative;
}
.ownership__children::before {
  content: '';
  position: absolute;
  left: -16px; top: 0; bottom: 16px;
  width: 1px;
  background: var(--color-border-strong);
}
.ownership__node--root { font-weight: 600; border-color: var(--color-border-strong); }

/* ==========================================================
   Gantt chart
   ========================================================== */
.gantt {
  display: grid;
  grid-template-columns: 220px 1fr;
  font-size: var(--text-xs);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--color-surface);
}
.gantt__col-head {
  background: var(--color-surface-raised);
  padding: 10px 14px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--color-border);
}
.gantt__timeline-head {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  background: var(--color-surface-raised);
  border-bottom: 1px solid var(--color-border);
}
.gantt__timeline-head span {
  padding: 10px 8px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-left: 1px solid var(--color-border);
}
.gantt__row-label {
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border);
  font-weight: 500;
  color: var(--color-text-primary);
  display: flex; align-items: center; gap: 8px;
}
.gantt__row {
  position: relative;
  border-bottom: 1px solid var(--color-border);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  height: 44px;
}
.gantt__row > span {
  border-left: 1px solid var(--color-border);
}
.gantt__bar {
  position: absolute;
  top: 10px; bottom: 10px;
  border-radius: var(--r-sm);
  display: flex; align-items: center;
  padding: 0 10px;
  color: #fff;
  font-weight: 600;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  transition: transform 80ms linear;
}
.gantt__bar:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.gantt__bar--blue { background: var(--color-primary); }
.gantt__bar--purple { background: var(--color-pending); }
.gantt__bar--green { background: var(--color-pass); }
.gantt__bar--orange { background: var(--color-finding-major); }

/* ==========================================================
   Drawer / Modal
   ========================================================== */
.drawer {
  position: fixed;
  top: 0; right: 0;
  width: 480px; max-width: 92vw;
  height: 100vh;
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  z-index: 100;
  transform: translateX(0);
  transition: transform 200ms ease-in-out;
}
.drawer[hidden] { display: flex !important; transform: translateX(100%); pointer-events: none; }
.drawer__head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--color-border);
}
.drawer__eyebrow { font-size: var(--text-xs); color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.drawer__title { font-family: var(--font-display); font-size: var(--text-lg); margin-top: 4px; }
.drawer__close {
  background: transparent; border: 1px solid var(--color-border);
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  color: var(--color-text-secondary);
}
.drawer__close:hover { background: var(--color-surface-raised); color: var(--color-text-primary); }
.drawer__body { flex: 1; overflow-y: auto; padding: 22px; }

.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
  transition: opacity 200ms ease-in-out;
}
.drawer-backdrop[hidden] { display: block; opacity: 0; pointer-events: none; }

/* ==========================================================
   Toast
   ========================================================== */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 200;
  background: var(--color-text-primary);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideIn 300ms ease-out;
}
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ==========================================================
   Utility
   ========================================================== */
.section-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 32px 0 12px;
}
.section-sub {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: 18px;
  max-width: 720px;
}
.divider { height: 1px; background: var(--color-border); margin: 16px 0; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--color-text-muted); }
.text-secondary { color: var(--color-text-secondary); }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--r-md);
}

.kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-bottom-width: 2px;
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--color-text-secondary);
}

/* Donut placeholder (SVG-based) */
.donut { width: 140px; height: 140px; }

/* Inline meter */
.meter {
  height: 8px;
  background: var(--color-surface-raised);
  border-radius: 999px;
  overflow: hidden;
  width: 100%;
}
.meter__fill {
  height: 100%;
  background: var(--color-primary);
}
.meter__fill--pass { background: var(--color-pass); }
.meter__fill--warn { background: var(--color-finding-minor); }
.meter__fill--crit { background: var(--color-finding-critical); }

/* Phase status strip */
.phase-strip {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  margin-bottom: 24px;
}
.phase-strip__item {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: border-color 80ms linear, background 80ms linear;
}
.phase-strip__item:hover { border-color: var(--color-primary); }
.phase-strip__code { font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.06em; color: var(--color-text-muted); }
.phase-strip__name { font-size: var(--text-xs); font-weight: 600; color: var(--color-text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phase-strip__bar { height: 4px; background: var(--color-surface-raised); border-radius: 999px; overflow: hidden; }
.phase-strip__bar span { display: block; height: 100%; background: var(--color-primary); }
.phase-strip__item.is-active { background: #EFF6FF; border-color: var(--color-primary); }
.phase-strip__item.is-done .phase-strip__bar span { background: var(--color-pass); }
.phase-strip__item.is-pending .phase-strip__bar span { background: var(--color-border); }
@media (max-width: 1080px) {
  .phase-strip { grid-template-columns: repeat(4, 1fr); }
}
