/* V4G Ingestion · Web-α stylesheet
 * Palette mirrors the Excel export (src/services/financial_export.py):
 *   amber          E8A020 — accents, primary actions
 *   navy-dark      0F1520 — top bar, headings, body text
 *   navy           1E2D45 — secondary surfaces
 *   muted          64748B — supporting text
 */
:root {
  --amber:        #E8A020;
  --amber-hover:  #D49019;
  --navy-dark:    #0F1520;
  --navy:         #1E2D45;
  --muted:        #64748B;
  --bg:           #FAFAFA;
  --surface:      #FFFFFF;
  --surface-alt:  #FFF8EB;
  --border:       #E2E8F0;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--navy-dark);
  line-height: 1.5;
}

/* ─── Topbar ──────────────────────────────────────────────────────────── */
.topbar {
  background: var(--navy-dark);
  padding: 0.875rem 2rem;
  display: flex;
  gap: 1.5rem;
  align-items: center;
}
.topbar a {
  color: var(--amber);
  text-decoration: none;
  font-weight: 500;
}
.topbar a:hover { text-decoration: underline; }
.topbar .brand {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.topbar .topbar-spacer { flex: 1; }
.topbar .muted-link {
  color: var(--muted);
  font-size: 0.85rem;
  font-family: ui-monospace, 'Cascadia Mono', Menlo, monospace;
}

/* ─── Main layout ─────────────────────────────────────────────────────── */
main {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 2rem;
}

h1 {
  color: var(--navy-dark);
  font-size: 1.75rem;
  margin: 0 0 0.5rem 0;
  font-weight: 600;
}

.muted { color: var(--muted); font-size: 0.9rem; }
.muted strong { color: var(--navy-dark); font-weight: 600; }

/* ─── Search ──────────────────────────────────────────────────────────── */
.page-header {
  margin-bottom: 1.5rem;
}
.search {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
  max-width: 600px;
}
.search input[type="search"] {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  font-family: inherit;
}
.search input[type="search"]:focus {
  outline: 2px solid var(--amber);
  outline-offset: -1px;
  border-color: var(--amber);
}
.search button {
  padding: 0.75rem 1.5rem;
  background: var(--amber);
  color: var(--navy-dark);
  border: none;
  border-radius: 4px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  font-family: inherit;
}
.search button:hover { background: var(--amber-hover); }
.search button:active { transform: translateY(1px); }

/* ─── Tables ──────────────────────────────────────────────────────────── */
.parties-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 1rem;
}
.parties-table th {
  background: var(--navy-dark);
  color: var(--amber);
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
}
.parties-table td {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  vertical-align: top;
}
.parties-table tbody tr:hover { background: var(--surface-alt); }
.parties-table td a {
  color: var(--navy);
  text-decoration: none;
  font-weight: 500;
}
.parties-table td a:hover { color: var(--amber); }
.legal-name {
  display: block;
  font-size: 0.8rem;
  margin-top: 0.125rem;
  font-style: italic;
}

/* ─── Empty / fallback states ─────────────────────────────────────────── */
.empty {
  color: var(--muted);
  padding: 3rem 2rem;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 4px;
  margin-top: 1rem;
}

/* ─── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .topbar { padding: 0.75rem 1rem; gap: 1rem; flex-wrap: wrap; }
  .topbar .topbar-spacer { display: none; }
  main { padding: 0 1rem; margin: 1rem auto; }
  .parties-table th:nth-child(3),
  .parties-table td:nth-child(3) { display: none; }
}

/* ─── Party detail page ──────────────────────────────────────────────── */
.back-link {
  display: inline-block;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}
.back-link:hover { color: var(--amber); }

.party-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.legal-subname { margin: 0.25rem 0 1rem 0; }

.party-meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.4rem 1.25rem;
  max-width: 600px;
  margin: 1rem 0 0 0;
}
.party-meta dt {
  color: var(--muted);
  font-size: 0.85rem;
  padding-top: 0.1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.party-meta dd { margin: 0; font-weight: 500; }

.mono { font-family: ui-monospace, 'Cascadia Mono', Menlo, monospace; }
.muted-id { color: var(--muted); font-size: 0.85rem; font-weight: 400; }

.status-warn {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.05rem 0.45rem;
  background: #FEF3C7;
  color: #92400E;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-confirmed {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.05rem 0.45rem;
  background: #DCFCE7;
  color: #166534;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 600;
}

/* Chart */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.section-head h2 { margin: 0; }

.chart-section { margin: 2rem 0; }
.chart-svg {
  width: 100%;
  height: auto;
  max-width: 800px;
  background: var(--surface);
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.chart-empty { padding: 0; }

/* Buttons */
.button {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  font-size: 0.875rem;
  border: 1px solid transparent;
  font-family: inherit;
}
.button-primary {
  background: var(--amber);
  color: var(--navy-dark);
}
.button-primary:hover { background: var(--amber-hover); }

/* Sections + section headings */
section h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem 0;
  color: var(--navy-dark);
}

/* Financials + provenance tables */
.table-wrap { overflow-x: auto; margin: 0.5rem 0 1.5rem 0; }
.financials-table,
.provenance-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  font-size: 0.875rem;
}
.financials-table th,
.provenance-table th {
  background: var(--navy-dark);
  color: var(--amber);
  padding: 0.6rem 0.875rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.financials-table td,
.provenance-table td {
  padding: 0.5rem 0.875rem;
  border-top: 1px solid var(--border);
  vertical-align: top;
}
.financials-table .num,
.provenance-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, 'Cascadia Mono', Menlo, monospace;
}
.financials-table thead th.num,
.provenance-table thead th.num { text-align: right; }
.financials-table tbody tr:hover,
.provenance-table tbody tr:hover { background: var(--surface-alt); }

.source-tag {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  background: var(--navy);
  color: var(--amber);
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: ui-monospace, 'Cascadia Mono', Menlo, monospace;
  letter-spacing: 0.02em;
}

/* Empty state on detail page */
.empty strong { color: var(--navy-dark); display: block; margin-bottom: 0.5rem; }
.empty ul { margin: 0.5rem auto 0 auto; padding-left: 1.5rem; max-width: 400px; text-align: left; }
.empty p { margin: 0.25rem 0; }

/* ─── Topbar user info ───────────────────────────────────────────────── */
.topbar-user {
  color: #cbd5e1;
  font-size: 0.85rem;
  font-family: ui-monospace, 'Cascadia Mono', Menlo, monospace;
}
.topbar-user em {
  color: var(--amber);
  font-style: normal;
  font-weight: 600;
  margin-left: 0.25rem;
}
.topbar-link {
  color: var(--amber);
  font-size: 0.85rem;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--amber);
  border-radius: 3px;
  text-decoration: none;
}
.topbar-link:hover {
  background: var(--amber);
  color: var(--navy-dark);
  text-decoration: none !important;
}

/* ─── Login page ─────────────────────────────────────────────────────── */
.login-card {
  max-width: 440px;
  margin: 4rem auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2rem;
}
.login-card h1 {
  margin-top: 0;
  font-size: 1.5rem;
}

.login-notice {
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  line-height: 1.5;
}
.login-notice-success { background: #DCFCE7; color: #166534; border: 1px solid #BBF7D0; }
.login-notice-error   { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.login-notice-info    { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0;
}
.login-form label {
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.login-form input[type="email"] {
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  font-family: inherit;
}
.login-form input[type="email"]:focus {
  outline: 2px solid var(--amber);
  outline-offset: -1px;
  border-color: var(--amber);
}
.login-form .button {
  margin-top: 0.5rem;
  width: 100%;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}
.login-help { margin-top: 1rem; font-size: 0.85rem; }

/* ─── Dashboard ──────────────────────────────────────────────────────── */
.dashboard-hero {
  text-align: center;
  padding: 2.5rem 0 1.5rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}
.dashboard-hero h1 {
  font-size: 2.25rem;
  margin: 0 0 0.25rem 0;
  letter-spacing: -0.01em;
}
.dashboard-hero .muted { font-size: 0.95rem; }

.dashboard-search {
  margin: 1.75rem auto 1rem auto;
  max-width: 600px;
}

.dashboard-quicklinks {
  margin: 0.5rem 0 0 0;
  font-size: 0.9rem;
}
.dashboard-quicklinks a {
  color: var(--navy);
  text-decoration: none;
  font-weight: 500;
}
.dashboard-quicklinks a:hover { color: var(--amber); }
.dashboard-sep { color: var(--border); margin: 0 0.5rem; }

.dashboard-roadmap h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 1.5rem 0 1rem 0;
}

.phase-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.75rem;
}
.phase {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 0.15rem 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  border-left: 3px solid var(--border);
}
.phase-tag {
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-family: ui-monospace, 'Cascadia Mono', Menlo, monospace;
  white-space: nowrap;
  padding: 0.25rem 0.55rem;
  border-radius: 3px;
}
.phase-name { font-weight: 600; font-size: 0.95rem; }
.phase-detail { font-size: 0.825rem; }

.phase-done { border-left-color: #166534; }
.phase-done .phase-tag { background: #DCFCE7; color: #166534; }
.phase-active { border-left-color: var(--amber); background: #FFFBF0; }
.phase-active .phase-tag { background: var(--amber); color: var(--navy-dark); }
.phase-pending .phase-tag { background: #F1F5F9; color: var(--muted); }

/* ─── Party detail enrichment chips (PR-1 · 2026-05-23) ──────────────── */

.tier-chip,
.status-chip,
.completeness-chip,
.relationship-chip {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-right: 0.4rem;
}

/* Enrichment tier — P1=deepest, P4=lowest (per CHECK enrichment_tier) */
.tier-chip            { background: #eef2ff; color: #3730a3; }
.tier-chip.tier-p1    { background: #ede9fe; color: #5b21b6; }   /* Platinum-ish */
.tier-chip.tier-p2    { background: #fef3c7; color: #92400e; }   /* Gold-ish */
.tier-chip.tier-p3    { background: #e0e7ff; color: #3730a3; }
.tier-chip.tier-p4    { background: #f3f4f6; color: #4b5563; }

/* Enrichment status — pipeline lifecycle */
.status-chip.status-raw          { background: #f3f4f6; color: #6b7280; }
.status-chip.status-seed_pending { background: #fef3c7; color: #92400e; }
.status-chip.status-in_progress  { background: #dbeafe; color: #1e40af; }
.status-chip.status-enriched     { background: #dcfce7; color: #166534; }

/* Completeness score */
.completeness-chip       { background: #dcfce7; color: #166534; }
.completeness-chip.stale { background: #fee2e2; color: #991b1b; }

/* Relationship status (V4G profile) */
.relationship-chip { background: #ede9fe; color: #6d28d9; }

/* KBO signal badges */
.kbo-signals-section { margin: 1.5rem 0; }
.kbo-signals-section h2 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.kbo-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.kbo-signal {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  font-family: ui-monospace, 'Cascadia Mono', Menlo, monospace;
}
.kbo-signal.danger       { background: #fee2e2; color: #991b1b; }
.kbo-signal.info         { background: #dbeafe; color: #1e40af; }
.kbo-signal.ok           { background: #dcfce7; color: #166534; }
.kbo-signal.neutral      { background: #f3f4f6; color: #4b5563; }
.kbo-signal.muted-signal { background: transparent; color: var(--muted); border: 1px dashed var(--muted); }

/* V4G profile section */
.v4g-profile-section { margin: 1.5rem 0; }
.v4g-profile-section h2 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* ─── Party detail · sector overlay (PR-2 · 2026-05-23) ──────────────── */

.sector-section { margin: 1.5rem 0; }
.sector-section h2 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.sector-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.nace-chip {
  background: var(--surface-alt);
  color: var(--navy-dark);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
}
.v4g-sector-chip {
  background: #ede9fe;
  color: #6d28d9;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}
.v4g-supergroup-chip {
  background: #fef3c7;
  color: #92400e;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* ─── Inline classify form (PR-4 · 2026-05-24) ───────────────────────── */

.classify-form { margin-top: 0.4rem; }
.classify-toggle {
  cursor: pointer;
  display: inline-block;
  font-size: 0.78rem;
  color: var(--amber);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  user-select: none;
}
.classify-toggle:hover { text-decoration: underline; }
.classify-form[open] .classify-toggle { color: var(--navy-dark); }

.classify-form-body {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
  align-items: center;
}
.classify-form-body select {
  font-size: 0.9rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--muted);
  border-radius: 4px;
  min-width: 240px;
  background: var(--surface);
}
.button.button-small {
  font-size: 0.85rem;
  padding: 0.3rem 0.8rem;
}
.source-tag {
  font-size: 0.78rem;
  margin-left: 0.4rem;
  font-style: italic;
}

/* ─── Flash messages (PR-4) ──────────────────────────────────────────── */

.flash-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0 0 1rem 0;
}
.flash {
  padding: 0.6rem 1rem;
  border-radius: 6px;
  font-size: 0.95rem;
  border: 1px solid;
}
.flash-success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.flash-error   { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.flash-info    { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }

/* ─── Signals section (PR-3 · 2026-05-24) ────────────────────────────── */

.signals-section {
  margin: 1.5rem 0;
}
.signals-section h2 {
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
}
.section-subtitle {
  font-size: 0.85rem;
  margin-top: 0;
  margin-bottom: 0.8rem;
}
.signals-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.signal-card {
  border-left: 3px solid var(--muted);
  background: var(--surface);
  padding: 0.7rem 0.9rem;
  border-radius: 0 6px 6px 0;
  border-top: 1px solid #eee;
  border-right: 1px solid #eee;
  border-bottom: 1px solid #eee;
}

/* Per-category accent strip */
.signal-cat-seller     { border-left-color: #d97706; } /* amber — sell-side */
.signal-cat-buyer      { border-left-color: #2563eb; } /* blue — buy-side */
.signal-cat-investor   { border-left-color: #7c3aed; } /* purple — capital */
.signal-cat-structure  { border-left-color: #059669; } /* green — corp structure */
.signal-cat-timing     { border-left-color: #dc2626; } /* red — urgent */
.signal-cat-portfolio  { border-left-color: #0d9488; } /* teal — portfolio */

.signal-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: baseline;
  margin-bottom: 0.4rem;
  font-size: 0.92rem;
}
.signal-label {
  font-weight: 600;
  color: var(--navy-dark);
}
.signal-cat-chip {
  font-size: 0.72rem;
  padding: 0.1rem 0.45rem;
  background: #f3f4f6;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #4b5563;
}
.signal-date {
  font-size: 0.82rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.signal-source {
  font-size: 0.78rem;
  color: var(--muted);
  font-style: italic;
}

.signal-note {
  margin: 0.3rem 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: #1f2937;
  white-space: pre-wrap;
}

.signal-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.4rem;
  align-items: center;
}

.chip {
  font-size: 0.74rem;
  padding: 0.12rem 0.5rem;
  border-radius: 10px;
  background: #f3f4f6;
  color: #374151;
}
.chip-conf-low    { background: #fef3c7; color: #92400e; }
.chip-conf-medium { background: #fef9c3; color: #854d0e; }
.chip-conf-high   { background: #d1fae5; color: #065f46; }
.chip-evidence    { background: #e0e7ff; color: #3730a3; }
.chip-action-monitor  { background: #fef9c3; color: #854d0e; }
.chip-action-escalate { background: #fee2e2; color: #991b1b; font-weight: 600; }
.chip-workflow    { background: #ddd6fe; color: #5b21b6; }

.signal-source-link {
  font-size: 0.8rem;
  color: var(--amber);
  font-weight: 600;
  text-decoration: none;
}
.signal-source-link:hover { text-decoration: underline; }
.signal-source-detail {
  font-size: 0.8rem;
}

.empty-state {
  font-size: 0.9rem;
  font-style: italic;
  margin: 0.5rem 0;
}

/* ─── V4G profile edit form (PR-5 · 2026-05-24) ─────────────────────── */

.profile-edit-form { margin-top: 0.8rem; }
.profile-edit-toggle {
  cursor: pointer;
  display: inline-block;
  font-size: 0.78rem;
  color: var(--amber);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  user-select: none;
}
.profile-edit-toggle:hover { text-decoration: underline; }
.profile-edit-form[open] .profile-edit-toggle { color: var(--navy-dark); }

.profile-edit-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(200px, 1fr));
  gap: 0.6rem 1rem;
  margin-top: 0.6rem;
  padding: 0.8rem;
  background: #fafafa;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
}
.profile-edit-body label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.85rem;
}
.profile-edit-body label span {
  font-weight: 600;
  color: var(--navy-dark);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.profile-edit-body select {
  font-size: 0.9rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--muted);
  border-radius: 4px;
  background: white;
}
.profile-edit-body button {
  grid-column: 1 / -1;
  justify-self: start;
}

/* ─── M0 Actor Classifier workflow (PR-7.2) ──────────────────────────── */

.button-secondary {
  background: var(--surface);
  color: var(--navy-dark);
  border: 1px solid var(--border);
}
.button-secondary:hover { background: var(--surface-alt); }

.classify-header { margin-bottom: 0.5rem; }
.classify-header h1 { margin-bottom: 0.1rem; }

/* Inline link to the LLM flow on the party detail page */
.llm-classify-link {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--amber);
  text-decoration: none;
}
.llm-classify-link:hover { text-decoration: underline; }

/* Step pills */
.step-pills {
  list-style: none;
  display: flex;
  gap: 0.5rem;
  padding: 0;
  margin: 0 0 1.5rem 0;
  flex-wrap: wrap;
}
.step-pill {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
}
.step-pill.active { background: var(--amber); color: var(--navy-dark); border-color: var(--amber); }
.step-pill.done { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }

/* =========================================================================
   CARD UI v1
   Hero dossier + 6 facet cards on /party/<id>, plus country chips on /parties.
   Palette: --amber / --navy-dark / --muted / --surface / --surface-alt / --border
   ========================================================================= */

/* ─── /parties — country filter chips ──────────────────────────────────── */
.country-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.75rem 0 1.25rem;
  flex-wrap: wrap;
}
.country-filter .filter-label {
  font-size: 0.875rem;
  color: var(--muted);
  font-weight: 500;
}
.filter-chip {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.875rem;
  text-decoration: none;
  color: var(--navy-dark);
  background: var(--surface);
  transition: background 120ms ease, border-color 120ms ease;
}
.filter-chip:hover {
  background: var(--surface-alt);
  border-color: var(--amber);
}
.filter-chip-active {
  background: var(--amber);
  color: var(--navy-dark);
  border-color: var(--amber);
  font-weight: 600;
}

/* ─── /party/<id> — HERO DOSSIER CARD ─────────────────────────────────── */
.hero-card {
  background: var(--surface-alt);                /* warm amber-tinted surface */
  border: 1px solid var(--border);
  border-left: 4px solid var(--amber);            /* dossier accent rail */
  border-radius: 8px;
  padding: 1.5rem 1.75rem;
  margin: 0.5rem 0 1.25rem;
}
.hero-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}
.hero-titles { flex: 1 1 60%; min-width: 0; }
.hero-legal-name {
  font-size: 1.65rem;
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.25rem;
  color: var(--navy-dark);
  word-break: break-word;
}
.hero-display-name {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0;
}
.hero-meta-line {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0.75rem 0 1rem;
}
.hero-meta-line .hero-kbo-link {
  color: var(--navy);
  text-decoration: none;
  font-weight: 500;
}
.hero-meta-line .hero-kbo-link:hover { text-decoration: underline; }
.hero-no-kbo {
  color: var(--muted);
  font-style: italic;
}

.hero-chips {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.5rem 0 0.75rem;
}
/* Generic chip — already used elsewhere but reaffirmed here for hero context. */
.hero-card .chip {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.825rem;
  color: var(--navy-dark);
  line-height: 1.25;
}
.hero-card .chip-actor       { background: #e0e7ff; color: #3730a3; border-color: #c7d2fe; }
.hero-card .chip-confirmed   { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.hero-card .chip-unconfirmed { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.hero-card .chip-unclassified{ background: var(--surface); color: var(--muted); }
.hero-card .chip-sector      { background: #fff8eb; color: #92400e; border-color: #fde68a; }
.hero-card .chip-lifecycle   { background: #fce7f3; color: #9d174d; border-color: #fbcfe8; }

.hero-distress {
  background: #fef2f2;
  color: #991b1b;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  border: 1px solid #fecaca;
  font-size: 0.9rem;
  margin: 0.75rem 0 0;
  font-weight: 500;
}

.hero-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.hero-lang {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.lang-state {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.lang-state-auto {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
}
.lang-state-override {
  background: var(--amber);
  color: var(--navy-dark);
  border: 1px solid var(--amber);
}
.lang-form { margin: 0; }
.lang-select {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  font-size: 0.8rem;
  background: var(--surface);
  cursor: pointer;
  font-family: inherit;
}

/* ─── Buttons (hero + facet) ──────────────────────────────────────────── */
.btn, .btn-small {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: inherit;
  line-height: 1.2;
  transition: opacity 120ms ease, background 120ms ease;
}
.btn-small { padding: 0.35rem 0.7rem; font-size: 0.825rem; }
.btn-primary {
  background: var(--amber);
  color: var(--navy-dark);
  border-color: var(--amber);
}
.btn-primary:hover { background: var(--amber-hover); border-color: var(--amber-hover); }
.btn-secondary {
  background: var(--surface);
  color: var(--navy-dark);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--surface-alt); border-color: var(--amber); }

/* ─── FACET GRID ──────────────────────────────────────────────────────── */
.facet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 768px) {
  .facet-grid { grid-template-columns: 1fr; }
  .hero-card { padding: 1.25rem 1rem; }
  .hero-legal-name { font-size: 1.4rem; }
}
.facet-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.1rem 1.25rem;
}
.facet-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  color: var(--navy-dark);
  letter-spacing: 0.01em;
}
.facet-dl {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0.4rem 1rem;
  margin: 0;
  font-size: 0.875rem;
}
.facet-dl dt {
  color: var(--muted);
  font-weight: 500;
}
.facet-dl dd {
  margin: 0;
  color: var(--navy-dark);
  word-break: break-word;
}
.facet-dl a {
  color: var(--navy);
  text-decoration: none;
}
.facet-dl a:hover { text-decoration: underline; }
.facet-dl .mono { font-family: ui-monospace, 'Cascadia Mono', Menlo, monospace; font-size: 0.85em; }
.facet-dl .muted { color: var(--muted); }

.facet-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.9rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.facet-actions .classify-form { margin: 0; }
.facet-actions .classify-toggle {
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.facet-actions .classify-toggle::-webkit-details-marker { display: none; }
.facet-actions .classify-form[open] .classify-toggle {
  background: var(--surface-alt);
  border-color: var(--amber);
}
.facet-actions .classify-form-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.facet-actions .classify-form-body select {
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.85rem;
}

.facet-card .badge-confirmed {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: #d1fae5;
  color: #065f46;
  font-size: 0.75rem;
  margin-left: 0.4rem;
  vertical-align: middle;
}

/* Context card */
.classify-context-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}
.classify-context-card.compact { padding: 0.9rem 1.25rem; }
.classify-context-card h2 { margin-top: 0; }
.classify-note { margin: 0.75rem 0; font-size: 0.85rem; }
.classify-hint { font-size: 0.8rem; margin-left: 0.75rem; }

/* Candidate cards (radio selection) */
.candidate-card {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.6rem;
  cursor: pointer;
  background: var(--surface);
  transition: border-color 0.1s, background 0.1s;
}
.candidate-card:hover { border-color: var(--amber); }
.candidate-card.primary { border-color: var(--amber); background: var(--surface-alt); }
.candidate-card input[type="radio"] { margin-top: 0.25rem; }
.candidate-body { display: flex; flex-direction: column; gap: 0.35rem; }
.candidate-head { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.candidate-rank { font-weight: 700; color: var(--muted); font-size: 0.85rem; }
.candidate-type { font-weight: 600; }
.candidate-rationale { font-size: 0.85rem; color: var(--muted); }

/* Diagnostic flags */
.flag-chips { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.flag-chip {
  font-size: 0.75rem;
  font-family: ui-monospace, 'Cascadia Mono', Menlo, monospace;
  background: #fee2e2;
  color: #991b1b;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
}

/* Sector opt-in */
.sector-suggest-section { margin-top: 1.5rem; }
.sector-commit-toggle {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.9rem;
  cursor: pointer;
  margin-top: 0.4rem;
}

.classify-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.75rem;
  flex-wrap: wrap;
}

/* ── KBO picker (Card UI v1, Identity & KBO facet, no-KBO path) ─────────── */
.kbo-link-form { margin: 0; width: 100%; }
.kbo-link-toggle {
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.kbo-link-toggle::-webkit-details-marker { display: none; }
.kbo-link-form[open] .kbo-link-toggle {
  background: var(--surface-alt);
  border-color: var(--amber);
}
.kbo-link-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.6rem;
}
.kbo-search-input {
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.9rem;
  width: 100%;
  box-sizing: border-box;
}
.kbo-search-input:focus { outline: 2px solid var(--amber); border-color: var(--amber); }

.kbo-search-results {
  display: flex;
  flex-direction: column;
  max-height: 280px;
  overflow-y: auto;
}
.kbo-search-results:empty { display: none; }
.kbo-search-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-top: 0.3rem;
  cursor: pointer;
  background: #fff;
}
.kbo-search-row:hover {
  background: var(--surface-alt);
  border-color: var(--amber);
}
.kbo-search-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem;
  font-size: 0.85rem;
  color: var(--navy-dark);
}
.kbo-search-name { font-weight: 600; }
.kbo-search-sep,
.kbo-search-muni,
.kbo-search-form { color: var(--muted); }
.kbo-search-kbo { color: var(--navy-dark); }
.kbo-search-row .mono {
  font-family: ui-monospace, 'Cascadia Mono', Menlo, monospace;
  font-size: 0.85em;
}
.kbo-search-badge {
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  white-space: nowrap;
}
.kbo-search-badge-warn {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}
.kbo-search-empty,
.kbo-search-error {
  padding: 0.45rem 0.55rem;
  font-size: 0.85rem;
  margin-top: 0.3rem;
}
.kbo-search-error { color: #991b1b; }

/* Auto-suggest panel (fn_match_party_to_kbo) — sits above the manual typeahead */
.kbo-suggest-panel:empty { display: none; }
.kbo-suggest-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin: 0.2rem 0 0.3rem;
}
.kbo-suggest-label { font-size: 0.8rem; font-weight: 600; }
.kbo-suggest-notes { font-size: 0.75rem; }
.kbo-suggest-empty,
.kbo-suggest-loading { padding: 0.4rem 0.55rem; font-size: 0.85rem; }
.kbo-manual-label { font-size: 0.75rem; margin-top: 0.2rem; }
.kbo-band {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  white-space: nowrap;
}
.kbo-band-auto     { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.kbo-band-review   { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.kbo-band-no_match { background: var(--surface-alt); color: var(--muted); border: 1px solid var(--border, #d1d5db); }
.kbo-search-score  { font-weight: 600; color: #166534; }
.kbo-search-citytick { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }

/* KBO review-queue (UI-2) */
.review-queue { display: flex; flex-direction: column; gap: 0.6rem; }
.review-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.review-main { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.review-party { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.review-party-name { font-weight: 600; }
.review-method { font-size: 0.75rem; }
.review-suggest { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; font-size: 0.9rem; }
.review-sep { color: var(--muted); }
.review-score { font-weight: 600; color: #166534; }
.review-actions { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.review-actions form { margin: 0; }
.review-pager {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 1rem;
  justify-content: center;
}

.kbo-link-confirm {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.65rem;
  background: var(--surface-alt);
  border: 1px solid var(--amber);
  border-radius: 4px;
  margin-top: 0.4rem;
  flex-wrap: wrap;
}
.kbo-link-chosen {
  flex: 1;
  font-size: 0.85rem;
  color: var(--navy-dark);
  min-width: 12rem;
}
.kbo-link-warn { color: #92400e; font-weight: 600; }

/* ── People & mandates (Phase C · 2026-05-28) ─────────────────────────────
   Section sits between Signalen and V4G profile. Display-only: reads
   person_party_links + person_registry. Row look mirrors .kbo-search-row
   (flex row, --border, --surface-alt hover). Authority palette is shared
   between the avatar tint, the .person-chip bg, and the row left-edge bar.
*/
.people-section { margin: 1.5rem 0; }
.people-section h2 {
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.people-section .section-count {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}

.people-zone {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
  margin: 0.9rem 0 0.4rem 0;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}
.people-zone .section-count {
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.people-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.person-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
}
.person-row:hover {
  background: var(--surface-alt);
  border-color: var(--amber);
}

.person-main {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  min-width: 0;
  flex: 1;
}
.person-av {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(100, 116, 139, 0.13);
  color: var(--muted);
  border: 1px solid var(--border);
  font-family: ui-monospace, 'Cascadia Mono', Menlo, monospace;
}
.person-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.person-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--navy-dark);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.person-primary {
  color: var(--amber);
  font-size: 0.85rem;
}
.person-meta {
  font-size: 0.82rem;
  color: var(--muted);
}
.person-title {
  font-size: 0.82rem;
  color: var(--navy);
  font-style: italic;
}

.person-aside {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  max-width: 18rem;
}
.person-chip {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.person-pep {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  letter-spacing: 0.04em;
}
.person-email {
  font-size: 0.78rem;
  text-decoration: none;
  color: var(--muted);
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.person-email:hover { color: var(--amber); }
.person-li {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  background: #eef4fb;
  color: #1d4ed8;
  border: 1px solid #c7dcf5;
  text-decoration: none;
  font-family: ui-monospace, 'Cascadia Mono', Menlo, monospace;
}
.person-li:hover {
  background: #dbeafe;
  border-color: #1d4ed8;
}

/* Authority palette — drives avatar tint, chip color, and row left edge.
   Ultimate / Governance / Delegated / Operational / Advisory. */
.person-auth-ultimate    { border-left-color: #8B5CF6; }
.person-auth-ultimate    .person-av   { background: rgba(139, 92, 246, 0.13); color: #6D28D9; border-color: #ddd6fe; }
.person-auth-ultimate    .person-chip { background: rgba(139, 92, 246, 0.13); color: #6D28D9; border-color: #ddd6fe; }

.person-auth-governance  { border-left-color: var(--amber); }
.person-auth-governance  .person-av   { background: rgba(232, 160, 32, 0.13); color: #92400e; border-color: #fde68a; }
.person-auth-governance  .person-chip { background: rgba(232, 160, 32, 0.13); color: #92400e; border-color: #fde68a; }

.person-auth-delegated   { border-left-color: #2A6FB0; }
.person-auth-delegated   .person-av   { background: rgba(42, 111, 176, 0.13); color: #1e40af; border-color: #c7dcf5; }
.person-auth-delegated   .person-chip { background: rgba(42, 111, 176, 0.13); color: #1e40af; border-color: #c7dcf5; }

.person-auth-operational { border-left-color: #16A34A; }
.person-auth-operational .person-av   { background: rgba(22, 163, 74, 0.13); color: #15803d; border-color: #bbf7d0; }
.person-auth-operational .person-chip { background: rgba(22, 163, 74, 0.13); color: #15803d; border-color: #bbf7d0; }

.person-auth-advisory    { border-left-color: var(--muted); }
.person-auth-advisory    .person-av   { background: rgba(100, 116, 139, 0.13); color: var(--muted); border-color: var(--border); }
.person-auth-advisory    .person-chip { background: rgba(100, 116, 139, 0.13); color: var(--muted); border-color: var(--border); }

/* ── V4G Profile facet — PARTY_INTELLIGENCE_TIERS_v2 (Phase A · 2026-05-29) ──
   Tier chip + 6-gate eligibility strip + identifier chips + mandate +
   Phase B placeholder block. Lives inside .facet-card so the grid sizing
   still holds — only inner content changes.
*/
.v4g-profile-card {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.tier-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}
.tier-header .tier-since {
  flex: 1 0 100%;
  font-size: 0.78rem;
  margin: 0;
}

.identity-tier-chip {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  text-transform: none;
}
.identity-tier-neutral  { background: #f3f4f6; color: var(--muted);  border-color: var(--border); }
.identity-tier-gold     { background: rgba(232, 160, 32, 0.18); color: #92400e; border-color: #fde68a; }
.identity-tier-platinum { background: rgba(139, 92, 246, 0.18); color: #6D28D9; border-color: #ddd6fe; }

.analysis-route-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.18rem 0.55rem;
  border-radius: 4px;
  background: var(--navy-dark);
  color: var(--amber);
  font-family: ui-monospace, 'Cascadia Mono', Menlo, monospace;
}

.tier-reason {
  font-size: 0.78rem;
  line-height: 1.35;
  margin: 0;
  padding: 0.4rem 0.55rem;
  background: var(--surface-alt);
  border-left: 3px solid var(--amber);
  border-radius: 3px;
  color: var(--navy-dark);
}

/* ── 6-gate strip ─────────────────────────────────────────────────────── */
.gates-strip {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0.2rem 0;
}
.gate {
  display: grid;
  grid-template-columns: 1.4rem 1fr auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.82rem;
  background: var(--surface);
  cursor: default;
}
.gate-num {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  font-family: ui-monospace, 'Cascadia Mono', Menlo, monospace;
  text-align: center;
}
.gate-label { color: var(--navy-dark); }
.gate-mark {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
}
.gate-pass {
  border-left: 3px solid #16A34A;
}
.gate-pass .gate-mark { color: #16A34A; }
.gate-fail {
  border-left: 3px solid #DC2626;
  background: #fef2f2;
}
.gate-fail .gate-mark    { color: #DC2626; }
.gate-fail .gate-label   { color: #991b1b; }
.gate-fail               { cursor: help; }

/* ── Identifier chips ─────────────────────────────────────────────────── */
.identifiers-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.3rem 0;
}
.identifier-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  font-size: 0.78rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--navy-dark);
  text-decoration: none;
}
.identifier-chip:hover {
  background: var(--surface-alt);
  border-color: var(--amber);
}
.identifier-type {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.identifier-chip .identifier-value { color: var(--navy-dark); }
.identifier-chip.identifier-kbo .identifier-type        { color: #92400e; }
.identifier-chip.identifier-domain .identifier-type     { color: #1d4ed8; }
.identifier-chip.identifier-folk_co .identifier-type    { color: #6D28D9; }
.identifier-chip.identifier-pitchbook .identifier-type  { color: #15803d; }
.identifier-chip.identifier-crunchbase .identifier-type { color: #c2410c; }

/* ── Mandate + Phase B strip ──────────────────────────────────────────── */
.mandate-row { margin: 0.2rem 0; }
.potential-role-chip {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.12rem 0.5rem;
  border-radius: 4px;
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

.phase-b-strip {
  margin-top: 0.5rem;
  padding: 0.55rem 0.6rem;
  background: repeating-linear-gradient(
    -45deg,
    transparent 0,
    transparent 6px,
    rgba(100, 116, 139, 0.05) 6px,
    rgba(100, 116, 139, 0.05) 12px
  );
  border: 1px dashed var(--border);
  border-radius: 4px;
  position: relative;
}
.phase-b-tag {
  position: absolute;
  top: -0.45rem;
  left: 0.6rem;
  background: var(--surface);
  padding: 0 0.4rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 3px;
}
.phase-b-dl {
  margin: 0;
}
.phase-b-dl dt {
  color: var(--muted);
}
