/* ────────────────────────────────────────────────────────────────────────
 * 4Front2Market — editorial-modernist design system
 * ────────────────────────────────────────────────────────────────────────
 * Palette: warm cream paper + dark ink + burnt-orange accent.
 * Typography: Instrument Serif (display) · Inter Tight (body) · JetBrains
 * Mono (metadata eyebrow labels).
 *
 * Legacy variable names (--bg, --primary, --text, etc.) are preserved so
 * the existing React components in app.js work unchanged — they just
 * resolve to the new palette.
 */

:root {
  /* Core palette */
  --cream: #F2EFE6;             /* primary surface */
  --cream-deep: #EAE6D9;        /* muted surface */
  --paper: #FBF9F2;             /* elevated surface (cards) */
  --page: #D9D5C8;              /* page background behind content */
  --ink: #141414;               /* primary text + hard dividers */
  --ink-soft: #2A2824;          /* emphatic text */
  --body-text: #4A453C;         /* body copy */
  --dim: #8B8577;               /* caption / metadata text */
  --accent: #D2542A;            /* burnt orange — primary accent */
  --accent-deep: #B3431E;       /* hover on accent */
  --accent-tint: rgba(210, 84, 42, 0.10);
  --line: rgba(20, 20, 20, 0.12);
  --line-soft: rgba(20, 20, 20, 0.06);

  /* Legacy aliases — DO NOT remove, app.js references these directly */
  --bg: var(--cream);
  --bg-muted: var(--paper);
  --surface: var(--paper);
  --border: var(--line);
  --border-strong: rgba(20, 20, 20, 0.24);
  --text: var(--ink);
  --muted: var(--dim);
  --primary: var(--accent);
  --primary-hover: var(--accent-deep);
  --primary-bg: var(--accent-tint);
  --green: #2F7A52;
  --green-bg: rgba(47, 122, 82, 0.10);
  --red: #A63E30;
  --red-bg: rgba(166, 62, 48, 0.10);
  --amber: var(--accent);
  --amber-bg: var(--accent-tint);

  /* Editorial aesthetic: shadows understated, corners slightly less round */
  --shadow-sm: 0 1px 2px rgba(20, 20, 20, 0.04);
  --shadow: 0 1px 3px rgba(20, 20, 20, 0.08), 0 1px 2px rgba(20, 20, 20, 0.04);
  --shadow-md: 0 4px 16px rgba(20, 20, 20, 0.08);
  --radius: 6px;
  --radius-lg: 10px;

  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;

  /* Typography stacks */
  --font-display: "Instrument Serif", "Times New Roman", Georgia, serif;
  --font-body: "Inter Tight", "Inter", "Helvetica Neue", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-deep);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

button,
input,
textarea,
select {
  font: inherit;
}

/* Headings shift to Instrument Serif display — large, tight leading.
   Body components that already set fontFamily inline take precedence. */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.08;
  color: var(--ink);
}

/* A utility class components can opt-in for eyebrow labels */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

/* Focus-visible matches the accent */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── App Shell ── */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ── Header ── */
.masthead {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--ink);      /* hard ink rule — editorial seam */
  background: rgba(242, 239, 230, 0.92);    /* cream with slight transparency */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  height: 36px;
  width: auto;
  object-fit: contain;
}

.masthead-search {
  justify-self: center;
  width: 100%;
  max-width: 520px;
}

.masthead-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-block h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1;
}

.brand-block h1 em {
  font-style: italic;
  color: var(--accent);
}

.brand-block .lede {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

.masthead-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.global-search {
  position: relative;
}

.global-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.875rem;
}

.global-search input {
  height: 40px;
  width: 100%;
  padding: 0 16px 0 38px;
  border: 1px solid var(--line);
  border-radius: 999px;                /* editorial pill */
  background: var(--paper);
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--ink);
  transition: border-color 0.2s, background 0.2s;
}

.global-search input::placeholder {
  color: var(--dim);
}

.global-search input:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px var(--accent-tint);
}

.export-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  border-radius: 999px;                /* pill — matches design system */
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.export-button:hover {
  background: var(--ink-soft);
  transform: translateY(-1px);
}

/* ── Stats Strip ── */
.overview-band {
  padding: 18px 28px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--cream);
}

.overview-context {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.overview-kicker {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

.overview-context-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.overview-context-note {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.overview-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 0;
  border-bottom: none;
  background: transparent;
}

.metric-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  transition: transform 0.25s, border-color 0.25s;
  min-height: 82px;
}

.metric-card:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
}

.metric-card-primary {
  border-color: var(--ink);
  background: var(--paper);
}

.metric-card-quiet {
  background: var(--cream);
}

.metric-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--cream-deep);
  color: var(--dim);
  font-size: 1.05rem;
  flex-shrink: 0;
  transition: background 0.25s, color 0.25s;
}

.metric-card:hover .metric-icon {
  background: var(--accent);
  color: #fff;
}

.metric-card-primary .metric-icon {
  background: var(--accent);
  color: #fff;
}

.metric-info {
  min-width: 0;
}

.metric-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--dim);
  margin-bottom: 4px;
}

.metric-value {
  display: block;
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 400;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.015em;
}

.metric-detail {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--dim);
  margin-top: 4px;
  line-height: 1.3;
  letter-spacing: 0.06em;
}

/* ── Workspace 3-Column Layout ── */
.workspace-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 340px;
  flex: 1;
  overflow: hidden;
}

/* ── Directory Sidebar ── */
.directory-panel {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--cream);
  overflow: hidden;
  min-width: 0;
}

.directory-header {
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--cream);
}

.directory-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.directory-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--dim);
}

.directory-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.directory-subtitle {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--body-text);
  margin: 0;
}

.coverage-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.coverage-bar-track {
  flex: 1;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--bg-muted);
}

.coverage-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s;
}

.coverage-bar-fill.bar-green { background: var(--green); }
.coverage-bar-fill.bar-amber { background: var(--amber); }
.coverage-bar-fill.bar-red { background: var(--red); }

.coverage-bar-pct {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.directory-search {
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
}

.directory-search-summary {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--muted);
}

.directory-filters {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  margin-top: 10px;
}

.directory-search input {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  font-size: 0.8125rem;
}

.directory-search input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg);
}

.directory-search-wrap {
  position: relative;
}

.directory-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.8125rem;
}

.directory-list {
  flex: 1;
  overflow-y: auto;
}

.directory-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  padding: 14px 18px;
  border: none;
  border-bottom: 1px solid var(--line-soft);
  background: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, padding 0.2s;
  color: var(--ink);
  position: relative;
}

.directory-row:hover {
  background: var(--paper);
  padding-left: 22px;
}

.directory-row.active {
  background: var(--paper);
  padding-left: 22px;
}

.directory-row.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
}

.directory-row.active .directory-row-name {
  color: var(--ink);
  font-weight: 600;
}

.directory-row-info {
  min-width: 0;
  flex: 1;
}

.directory-row-name {
  display: block;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.directory-row-meta {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}

.directory-row-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--cream-deep);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  flex-shrink: 0;
  margin-left: 12px;
  margin-top: 2px;
  border: 1px solid var(--line);
}

.directory-row.active .directory-row-count {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* 0-data investors */
.directory-row.empty-data {
  opacity: 0.55;
}

.directory-row.empty-data:hover {
  opacity: 0.75;
}

.directory-row.empty-data.active {
  opacity: 1;
}

.empty-data-count {
  color: var(--border-strong);
  font-weight: 400;
}

/* ── Center Panel ── */
.center-panel {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--bg);
}

.center-content {
  padding: 0;
}

/* ── Portfolio Book ── */
.portfolio-section {
  background: var(--surface);
}

.portfolio-section-indented {
  padding: 20px 24px 28px;
  background: var(--bg);
}

.portfolio-section-shell {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.portfolio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}

.portfolio-header > div {
  min-width: 0;
}

.portfolio-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
}

.portfolio-title-icon {
  font-size: 1rem;
}

.portfolio-subtitle {
  margin: 6px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.portfolio-company-count {
  font-size: 0.8125rem;
  color: var(--muted);
  font-weight: 400;
}

.portfolio-scroll-shell {
  max-height: min(58vh, 720px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(250, 251, 255, 0.78), rgba(255, 255, 255, 0.98));
}

.portfolio-list {
  display: flex;
  flex-direction: column;
}

.portfolio-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  transition: background 0.1s;
}

.portfolio-row:hover {
  background: var(--bg-muted);
}

.portfolio-row:last-child {
  border-bottom: none;
}

.portfolio-company-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.portfolio-company-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.portfolio-company-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.portfolio-company-name a {
  color: var(--text);
  text-decoration: none;
}

.portfolio-company-name a:hover {
  color: var(--primary);
}

.portfolio-row-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.portfolio-flag {
  font-size: 1rem;
  flex-shrink: 0;
}

.portfolio-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--primary-bg);
  color: var(--primary);
  font-size: 0.6875rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.portfolio-stage {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--green-bg);
  color: var(--green);
  font-size: 0.6875rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.portfolio-country,
.portfolio-country-cell {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg-muted);
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.portfolio-domain {
  font-size: 0.8125rem;
  color: var(--muted);
  flex-shrink: 0;
}

.portfolio-domain-link {
  font-size: 0.8125rem;
  color: var(--muted);
  text-decoration: none;
}

.portfolio-domain-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.portfolio-domain-fallback {
  font-size: 0.8125rem;
  color: var(--muted);
}

.portfolio-supporting-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.portfolio-meta-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-muted);
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 600;
  white-space: nowrap;
}

.portfolio-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--green-bg);
  color: var(--green);
  font-size: 0.6875rem;
  font-weight: 700;
  white-space: nowrap;
}

.portfolio-status-badge.subtle {
  background: var(--bg-muted);
  color: var(--text);
  font-weight: 600;
}

.portfolio-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Investor Detail Sections ── */
.investor-hero {
  padding: 22px 24px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.investor-hero-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.investor-hero-main {
  flex: 1;
  max-width: 760px;
}

.investor-hero h2 {
  margin: 0 0 8px;
  font-size: 1.72rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.investor-hero-subtitle {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.45;
}

.investor-hero .lede {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.5;
  max-width: 70ch;
}

.investor-chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.investor-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(100, 103, 242, 0.08);
  color: var(--primary);
}

.investor-chip-soft {
  background: var(--bg-muted);
  color: var(--muted);
}

.investor-hero-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 220px;
  flex-shrink: 0;
}

.investor-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.hero-stat {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), var(--bg));
}

.hero-stat span {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.hero-stat strong {
  display: block;
  font-size: 1.22rem;
  font-weight: 700;
  margin-top: 4px;
}

.investor-facts-grid {
  margin-top: 14px;
}

.investor-secondary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 18px 24px 0;
  background: var(--bg);
}

.investor-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.investor-info-card {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
  box-shadow: var(--shadow-sm);
}

.investor-info-card-header {
  margin-bottom: 12px;
}

.investor-info-card-header h3 {
  margin: 2px 0 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.investor-info-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.investor-info-row {
  display: grid;
  grid-template-columns: minmax(96px, 120px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.investor-info-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.investor-info-value {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
}

.investor-info-link {
  color: var(--primary);
  text-decoration: none;
}

.investor-info-link:hover {
  text-decoration: underline;
}

.investor-info-note {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--muted);
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 16px;
  border-radius: 8px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}

.primary-button:hover {
  background: var(--primary-hover);
  text-decoration: none;
}

/* ── Investor Network Panel ── */
.section-panel {
  padding: 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.section-panel-card {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.section-panel-spaced {
  margin: 18px 24px 0;
  border: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}

.section-panel-card .news-list,
.section-panel-card .network-list {
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.section-panel-spaced .relation-company-list {
  max-height: 340px;
  overflow-y: auto;
  padding-right: 4px;
}

.section-panel-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  min-height: 58px;               /* keeps Round Watch + Market News headers aligned */
}

.section-panel-title {
  display: flex;
  flex-direction: column;           /* stack kicker above headline */
  align-items: flex-start;
  gap: 4px;
}

.section-panel-title h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--ink);
}

.section-panel-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--cream-deep);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  border: 1px solid var(--line);
  align-self: flex-end;
  margin-bottom: 4px;
}

.kicker {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--dim);
  margin: 0;
}

.network-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.network-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  color: var(--text);
  width: 100%;
  text-align: left;
}

.network-row:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.network-row-static {
  cursor: default;
}

.network-row-static:hover {
  border-color: var(--border);
  box-shadow: none;
}

.network-row-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.network-row-info strong {
  font-size: 0.8125rem;
  font-weight: 600;
}

.network-row-info small {
  font-size: 0.75rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.network-pair {
  font-size: 0.8125rem;
  font-weight: 500;
}

/* ── Company Relations ── */
.relation-company-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.relation-company-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.relation-company-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.inline-chip-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip-button {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.chip-button:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.relation-context {
  margin: 10px 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.45;
}

/* ── News Section ── */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.news-row {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  transition: border-color 0.2s, transform 0.2s;
}
.news-row:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
}

/* Admin-only inline Reject button on news/rounds/companies */
.admin-reject-btn {
  padding: 3px 9px;
  background: transparent;
  color: var(--red);
  border: 1px solid var(--red);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  margin-left: auto;
  transition: background 0.2s, color 0.2s;
}
.admin-reject-btn:hover {
  background: var(--red);
  color: #fff;
}

.news-row strong {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.news-row p {
  margin: 0 0 8px;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.4;
}

.news-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--muted);
}

/* ── Fresh Flow Sidebar ── */
.feed-panel {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}

.feed-header {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
}

.feed-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.feed-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
}

.feed-title-icon {
  font-size: 1rem;
}

.feed-subtitle {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 4px 0 0;
}

.feed-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: auto;
}

.feed-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feed-row {
  padding: 0;
}

.feed-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.feed-row strong {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 6px;
}

.feed-row p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--primary);
}

.feed-row small {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
}

.feed-row .feed-open-link {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--primary);
}

.feed-investor-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.feed-divider {
  height: 1px;
  background: var(--border);
  margin: 0;
  border: none;
}

/* ── Status Badges ── */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.675rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-badge.tone-funding {
  background: var(--primary-bg);
  color: var(--primary);
}

.status-badge.tone-news {
  background: var(--bg-muted);
  color: var(--muted);
}

.status-badge.tone-positive {
  background: var(--green-bg);
  color: var(--green);
}

.status-badge.tone-negative {
  background: var(--red-bg);
  color: var(--red);
}

.status-badge.tone-neutral {
  background: var(--amber-bg);
  color: var(--amber);
}

.status-badge.tone-muted {
  background: var(--bg-muted);
  color: var(--muted);
}

.status-badge.tone-signal {
  background: var(--primary-bg);
  color: var(--primary);
}

.feed-date {
  font-size: 0.75rem;
  color: var(--muted);
}

/* ── Round Board ── */
.round-panel {
  padding: 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.round-table {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.round-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.9fr);
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.round-title-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.round-title-row strong {
  font-weight: 600;
}

.round-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: 6px;
}

.round-finance {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.round-amounts {
  display: flex;
  gap: 16px;
  font-size: 0.8125rem;
  color: var(--muted);
}

.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--bg-muted);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
}

.progress-fill.tone-positive {
  background: var(--green);
}

.progress-fill.tone-negative {
  background: var(--red);
}

.progress-fill.tone-neutral {
  background: var(--amber);
}

.progress-fill.tone-muted {
  background: var(--muted);
}

/* ── Analysis Grid ── */
.analysis-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.85fr) minmax(320px, 0.85fr);
  gap: 16px;
  padding: 24px;
}

.panel {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.panel-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--bg-muted);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.875rem;
}

.panel-note {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 0;
  align-self: flex-end;
  margin-bottom: 4px;
  white-space: nowrap;
}

.span-two {
  grid-column: span 2;
}

/* ── Chart ── */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
}

.chart-column {
  min-width: 0;
  text-align: center;
}

.chart-bars {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 4px;
  min-height: 160px;
  margin-bottom: 8px;
}

.bar {
  width: calc(50% - 2px);
  min-width: 8px;
  border-radius: 6px 6px 2px 2px;
}

.bar-portfolio {
  background: var(--primary);
}

.bar-news {
  background: var(--green);
}

.chart-column strong {
  font-size: 0.75rem;
  font-weight: 500;
}

.chart-column small {
  font-size: 0.675rem;
  color: var(--muted);
}

.legend-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
  font-size: 0.8125rem;
  color: var(--muted);
}

.swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 3px;
}

.swatch-portfolio {
  background: var(--primary);
}

.swatch-news {
  background: var(--green);
}

/* ── Coverage / Snapshot ── */
.coverage-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.coverage-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.coverage-list div:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.coverage-list span {
  color: var(--muted);
  font-size: 0.875rem;
}

.coverage-list strong {
  font-weight: 600;
}

/* ── Table Shell ── */
.table-shell {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 6px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: var(--bg-muted);
}

tr:last-child td {
  border-bottom: none;
}

.global-portfolio-table tbody tr:hover {
  background: rgba(245, 247, 250, 0.7);
}

td strong {
  font-weight: 500;
}

td small {
  font-size: 0.75rem;
  color: var(--muted);
}

.compact-table td,
.compact-table th {
  padding: 8px 12px;
}

/* ── Empty / Loading States ── */
.empty-box {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
  background: var(--bg);
}

.empty-box.small {
  font-size: 0.8125rem;
  padding: 12px;
}

.loading-card {
  max-width: 480px;
  margin: 120px auto;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  text-align: center;
  box-shadow: var(--shadow);
}

.error-card {
  border-color: var(--red);
}

/* ── Compact Network List ── */
.compact-network-list .network-row,
.compact-network-list .network-row-static {
  padding: 8px 12px;
}

.network-summary-list {
  margin-bottom: 12px;
}

/* ── Tab Bar ── */
.tab-bar {
  display: flex;
  gap: 0;
  padding: 0 24px;
  background: var(--cream);
  border-bottom: 1px solid var(--ink);
  position: sticky;
  top: 0;
  z-index: 100;
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }

.tab-button {
  padding: 14px 22px;
  border: none;
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  border-radius: 0;
  position: relative;
}

.tab-button:hover {
  color: var(--ink);
}

.tab-button.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
  background: transparent;
}

.tab-button.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  display: none;            /* dot disabled in favor of underline */
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  background: var(--cream-deep);
  color: var(--dim);
  border: 1px solid var(--line);
}

.tab-button.active .tab-badge {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── Market Layout (Dashboard) ── */
.market-layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 0;
  flex: 1;
  overflow: auto;
}

.market-left {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-right: 1px solid var(--border);
}

.market-right {
  overflow-y: auto;
}

.market-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── Analytics Layout ── */
.analytics-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 28px;
  overflow-y: auto;
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.analytics-section-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s;
}
.analytics-section-card:hover {
  border-color: rgba(20, 20, 20, 0.28);
}

.analytics-section-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line);
}

.analytics-section-header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.015em;
  line-height: 1.15;
}

.analytics-section-header .kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 6px;
}

.analytics-section-body {
  padding: 16px 20px;
}

/* ── All News Panel ── */
.all-news-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.all-news-panel .section-panel-header {
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 10;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
}

.all-news-panel .news-list {
  overflow-y: auto;
  padding: 0 20px 20px;
}

.news-investor-badge {
  display: inline-block;
  padding: 2px 8px;
  margin-bottom: 4px;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  background: var(--primary-bg);
  color: var(--primary);
}

.show-more-wrap {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.show-more-btn {
  display: block;
  flex: 1;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.show-more-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.show-all-btn {
  flex: 0 0 auto;
  background: transparent;
  color: var(--dim);
  border-color: var(--line);
}
.show-all-btn:hover {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}

.show-more-note {
  text-align: center;
  margin: 16px 0 4px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ── Capital Flows ── */
.capital-country-grid {
  display: grid;
  gap: 4px;
  padding: 12px 0;
}

.capital-country-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8125rem;
}

.capital-country-row:hover {
  background: var(--bg-muted);
}

.capital-flag {
  font-weight: 600;
  min-width: 60px;
}

.capital-stat {
  color: var(--muted);
  font-size: 0.75rem;
}

.capital-role {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: capitalize;
}

.role-exporter { background: var(--green-bg); color: var(--green); }
.role-importer { background: var(--amber-bg); color: var(--amber); }
.role-balanced { background: var(--bg-muted); color: var(--muted); }

.capital-flows-list {
  padding: 0 12px 12px;
}

.flow-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 0.8125rem;
}

.flow-arrow {
  color: var(--primary);
  font-weight: 700;
  font-size: 1rem;
}

.flow-volume {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.75rem;
}

/* ── Investors Layout ── */
.investors-layout {
  display: grid;
  grid-template-columns: clamp(320px, 24vw, 360px) minmax(0, 1fr);
  flex: 1;
  overflow: hidden;
}

/* ── Global Portfolio Table ── */
.global-portfolio-view {
  padding: 20px 24px;
  overflow: auto;
  flex: 1;
}

.view-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.view-toolbar-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.view-toolbar-meta strong {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
}

.view-toolbar-note {
  font-size: 0.75rem;
  color: var(--muted);
}

.active-filter-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary-bg);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
}

.view-toolbar-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 150px;
}

.filter-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.filter-select {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg);
}

.clear-filters-button,
.row-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.clear-filters-button:hover,
.row-action-button:hover {
  border-color: var(--primary);
  background: var(--primary-bg);
  color: var(--primary);
}

.row-action-button.compact {
  height: 30px;
  padding: 0 12px;
  font-size: 0.75rem;
}

.global-portfolio-table {
  width: 100%;
}

.global-portfolio-table th {
  user-select: none;
  white-space: nowrap;
}

.global-portfolio-table th:hover {
  color: var(--primary);
}

.table-company-cell,
.table-person-cell {
  min-width: 220px;
}

.table-company-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.table-primary-link {
  color: var(--text);
  font-weight: 600;
}

.table-primary-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.table-supporting-meta {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.table-muted-label {
  font-size: 0.75rem;
  color: var(--muted);
}

.link-button {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  padding: 0;
  text-decoration: none;
}

.link-button:hover {
  text-decoration: underline;
}

/* ── Auth Logo Image ── */
.auth-logo-img {
  width: 200px;
  height: auto;
  margin-bottom: 24px;
}

.activity-chart-panel {
  width: 100%;
}

/* ── Responsive ── */
@media (max-width: 1400px) {
  .overview-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .market-layout {
    grid-template-columns: 1fr;
  }

  .market-left {
    border-right: none;
  }

  .market-bottom-grid {
    grid-template-columns: 1fr;
  }

  .investors-layout {
    grid-template-columns: 300px minmax(0, 1fr);
  }

  .analytics-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .app-shell {
    height: auto;
    overflow: visible;
  }

  .investors-layout {
    grid-template-columns: 1fr;
  }

  .directory-panel {
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 400px;
  }

  .overview-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .relation-company-list {
    grid-template-columns: 1fr;
  }

  .masthead {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 8px;
    padding: 10px 16px;
  }

  .masthead-search {
    max-width: 100%;
  }

  .masthead-controls {
    flex-wrap: wrap;
    justify-content: center;
  }

  .investor-hero-header {
    flex-direction: column;
  }

  .investor-hero-actions {
    width: 100%;
    min-width: 0;
  }

  .investor-secondary-grid,
  .investor-detail-grid {
    grid-template-columns: 1fr;
  }

  .section-panel-spaced {
    margin: 16px 24px 0;
  }

  .portfolio-section-indented {
    padding-top: 16px;
  }

  .portfolio-scroll-shell {
    max-height: min(52vh, 640px);
  }

  .round-row {
    grid-template-columns: 1fr;
  }

  .tab-bar {
    padding: 0 12px;
    overflow-x: auto;
  }

  .tab-button {
    padding: 10px 14px;
    font-size: 0.8125rem;
    white-space: nowrap;
  }

  .view-toolbar {
    flex-direction: column;
  }

  .view-toolbar-controls {
    width: 100%;
    justify-content: flex-start;
  }

  .directory-filters {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .overview-strip {
    grid-template-columns: 1fr;
    padding: 12px 16px;
  }

  .masthead {
    padding: 12px 16px;
  }

  .chart-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .market-left {
    padding: 12px 16px;
  }

  .global-portfolio-view {
    padding: 12px 16px;
  }

  .portfolio-row {
    flex-direction: column;
    align-items: stretch;
  }

  .portfolio-row-actions {
    justify-content: flex-start;
  }

  .investor-secondary-grid {
    padding: 14px 16px 0;
  }

  .section-panel-card,
  .section-panel-spaced {
    margin: 0;
    border-radius: 14px;
  }

  .portfolio-section-indented {
    padding: 14px 16px 20px;
  }

  .portfolio-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .portfolio-scroll-shell {
    max-height: 48vh;
  }

  .investor-info-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .filter-field {
    min-width: 100%;
  }
}


/* ── Auth Wall ──────────────────────────────────────────────────────────── */

.auth-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #4338ca 100%);
  z-index: 9999;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  margin: 16px;
  padding: 40px 32px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  text-align: center;
}

.auth-logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

.auth-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--text);
}

.auth-subtitle {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0 0 24px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.auth-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}

.auth-input {
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 0.9375rem;
  font-family: inherit;
  transition: border-color 0.15s;
}

.auth-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg);
}

.auth-btn {
  margin-top: 8px;
  padding: 10px 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.auth-btn:hover {
  background: var(--primary-hover);
}

.auth-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-error {
  padding: 10px 12px;
  background: var(--red-bg);
  color: var(--red);
  font-size: 0.8125rem;
  border-radius: 8px;
}

.auth-switch {
  margin-top: 20px;
  font-size: 0.8125rem;
  color: var(--muted);
}

.auth-link {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  font-weight: 600;
  text-decoration: underline;
  padding: 0;
}

.auth-verify h2 {
  font-size: 1.125rem;
  margin: 0 0 12px;
}

.auth-verify p {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0 0 8px;
  line-height: 1.5;
}

.auth-verify .auth-btn {
  margin-top: 16px;
}

/* User menu in header */
.user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
}

.user-email {
  font-size: 0.75rem;
  color: var(--muted);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1200px) {
  .user-email { display: none; }
}

.signout-button {
  padding: 5px 12px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font-size: 0.75rem;
  font-family: inherit;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}

.signout-button:hover {
  background: var(--red-bg);
  color: var(--red);
  border-color: var(--red);
}


/* ── Admin Page ─────────────────────────────────────────────────────────── */

.admin-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  font-family: "Inter", system-ui, sans-serif;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.admin-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 32px;
}

.admin-table th {
  background: var(--bg-muted);
  text-align: left;
  padding: 10px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding: 10px 14px;
  font-size: 0.8125rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.admin-table tr:hover td {
  background: var(--bg-muted);
}

.admin-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
}

.admin-badge.role-admin {
  background: var(--primary-bg);
  color: var(--primary);
}

.admin-badge.role-user {
  background: var(--green-bg);
  color: var(--green);
}

.admin-action-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  background: var(--bg-muted);
  color: var(--muted);
}

.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
}

.admin-tab {
  padding: 8px 16px;
  border: none;
  border-radius: 8px 8px 0 0;
  background: var(--bg-muted);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}

.admin-tab.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* ── Admin GDPR ── */
.admin-action-btn {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}

.admin-action-btn:hover { background: var(--bg-muted); }
.admin-action-btn:disabled { opacity: 0.5; cursor: default; }

.admin-action-btn.approve {
  background: var(--green-bg);
  color: var(--green);
  border-color: var(--green);
}

.admin-action-btn.approve:hover { background: var(--green); color: #fff; }

.admin-action-btn.reject {
  background: var(--red-bg);
  color: var(--red);
  border-color: var(--red);
}

.admin-action-btn.reject:hover { background: var(--red); color: #fff; }

.admin-action-btn.danger {
  color: var(--red);
  border-color: var(--red);
}

.admin-action-btn.danger:hover { background: var(--red); color: #fff; }

.admin-badge.status-pending { background: var(--amber-bg); color: var(--amber); }
.admin-badge.status-approved,
.admin-badge.status-completed { background: var(--green-bg); color: var(--green); }
.admin-badge.status-rejected { background: var(--red-bg); color: var(--red); }

.gdpr-panel { padding-top: 8px; }

/* ── Detail Card Overlay ── */
.detail-card-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.detail-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  max-width: 640px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 24px;
}

.detail-card-narrow {
  max-width: 480px;
}

.detail-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.detail-card-header h3 {
  margin: 0;
  font-size: 1.25rem;
}

.close-button {
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: all 0.15s;
}

.close-button:hover {
  background: var(--border);
  color: var(--text);
}

.detail-description {
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0 0 16px;
}

.detail-related-investors {
  margin: 0 0 16px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}

.detail-related-investors h4 {
  margin: 0 0 10px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.detail-related-note {
  margin: 10px 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.5;
}

.detail-note {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-muted);
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.detail-facts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 0 0 16px;
}

.detail-fact {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
}

.detail-fact-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.detail-fact-value {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.4;
}

.detail-fact-link {
  color: var(--primary);
  text-decoration: none;
}

.detail-fact-link:hover {
  text-decoration: underline;
}

.detail-people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.detail-people-section {
  min-height: 100%;
}

.detail-people-section h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0 0 8px;
}

.detail-empty-state {
  padding: 12px;
  border-radius: 10px;
  background: var(--bg-muted);
}

.detail-empty-state p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.detail-person-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  padding: 4px 0;
  font-size: 0.875rem;
}

.detail-person-row small {
  color: var(--muted);
  font-size: 0.75rem;
  margin-left: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60%;
}

.detail-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
}

.detail-footer a {
  color: var(--primary);
}

.detail-meta {
  margin-left: auto;
}

.detail-card {
  max-width: 720px;
}

.detail-card-titleblock {
  min-width: 0;
}

.detail-kicker {
  margin: 0 0 4px;
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.detail-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.detail-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.detail-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(100, 103, 242, 0.08);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 500;
}

.detail-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.detail-section {
  margin-bottom: 18px;
}

.detail-section-heading {
  margin: 0 0 10px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.detail-facts-grid-compact {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.detail-description-panel {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}

.detail-description-panel .detail-description {
  margin: 0;
}

.detail-related-investors {
  margin-bottom: 18px;
}

.detail-people-section {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}

.detail-people-section h4 {
  margin-bottom: 10px;
}

/* ── Overlap badge ── */
.overlap-badge {
  display: inline-block;
  background: var(--primary-bg);
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 6px;
  vertical-align: middle;
}

/* ── Profile indicator dot ── */
.profile-dot {
  color: var(--green);
  font-size: 0.6rem;
  margin-left: 4px;
  vertical-align: middle;
}

/* ── Clickable hero stat ── */
.clickable-stat {
  cursor: pointer;
  transition: background 0.15s;
  border-radius: 8px;
}

.clickable-stat:hover {
  background: var(--primary-bg);
}

/* ── Profiled company button style ── */
.link-button.profiled {
  color: var(--primary);
  font-weight: 600;
}

@media (max-width: 980px) {
  .overview-band {
    padding: 16px 20px 14px;
  }

  .overview-context {
    flex-direction: column;
    align-items: flex-start;
  }

  .overview-context-note {
    white-space: normal;
  }

  .detail-card {
    max-height: calc(100vh - 48px);
    padding: 20px;
  }

  .detail-card-header {
    flex-direction: column;
  }

  .detail-card-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .overview-band {
    padding: 12px 16px;
  }

  .overview-strip {
    padding: 0;
  }

  .detail-card-overlay {
    padding: 12px;
  }

  .detail-card {
    padding: 16px;
  }

  .detail-facts-grid,
  .detail-facts-grid-compact,
  .detail-people-grid {
    grid-template-columns: 1fr;
  }
}

/* ── People Search Landing ── */
.people-search-landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 24px 40px;
  max-width: 680px;
  margin: 0 auto;
}

.people-search-hero {
  text-align: center;
  width: 100%;
}

.people-search-icon-large {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.7;
}

.people-search-hero h2 {
  margin: 0 0 6px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.people-search-subtitle {
  margin: 0 0 24px;
  font-size: 0.875rem;
  color: var(--muted);
}

.people-search-box {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.people-search-box input {
  width: 100%;
  height: 48px;
  padding: 0 20px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  font-size: 1rem;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.people-search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-bg);
}

.people-search-box input::placeholder {
  color: var(--muted);
}

.people-search-hint {
  margin: 10px 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.people-search-inline {
  padding: 12px 24px 0;
}

.people-search-inline .people-search-box {
  max-width: 100%;
}

.people-search-inline .people-search-box input {
  height: 40px;
  font-size: 0.875rem;
  border-width: 1px;
  border-radius: 8px;
}

/* ── Board Overlap Highlights ── */
.people-highlights {
  width: 100%;
  margin-top: 40px;
  text-align: left;
}

.people-highlights h4 {
  margin: 0 0 4px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
}

.people-highlights-subtitle {
  margin: 0 0 14px;
  font-size: 0.75rem;
  color: var(--muted);
}

.people-highlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.people-highlight-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.people-highlight-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.people-highlight-name {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.people-highlight-meta {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--primary);
}

.people-highlight-company {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
}

.people-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 22px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  text-align: center;
  cursor: pointer;
  font-family: var(--font-body);
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
  position: relative;
  overflow: hidden;
}

.people-stat-card:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
}

.people-stat-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Active state: the filter corresponding to this card is currently applied */
.people-stat-card.is-active {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--accent-tint), var(--paper));
}
.people-stat-card.is-active::after {
  content: '';
  position: absolute;
  top: 8px;
  right: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(210, 84, 42, 0.2);
}
.people-stat-card.is-active .people-stat-number {
  color: var(--accent-deep);
}

.people-stat-number {
  display: block;
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 400;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.02em;
}

.people-stat-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

.people-stat-detail {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  color: var(--dim);
}

/* ══════════════════════════════════════════════════════════════════════════
   ── PORTFOLIO SEARCH LANDING ──
   ══════════════════════════════════════════════════════════════════════════ */

.portfolio-search-landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 24px 40px;
  max-width: 720px;
  margin: 0 auto;
}

.portfolio-search-hero {
  text-align: center;
  width: 100%;
}

.portfolio-search-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.7;
}

.portfolio-search-title {
  margin: 0 0 6px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.portfolio-search-subtitle {
  margin: 0 0 24px;
  font-size: 0.875rem;
  color: var(--muted);
}

.portfolio-search-box-wrapper {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.portfolio-search-box {
  width: 100%;
  height: 48px;
  padding: 0 20px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  font-size: 1rem;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.portfolio-search-box:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-bg);
}

.portfolio-search-box::placeholder {
  color: var(--muted);
}

.portfolio-search-hint {
  margin: 10px 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}

/* Stats strip */
.portfolio-stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
  margin-top: 36px;
}

.portfolio-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 16px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.portfolio-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.portfolio-stat-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Sector highlights */
.portfolio-sector-highlights {
  width: 100%;
  margin-top: 36px;
  text-align: left;
}

.portfolio-highlights-title {
  margin: 0 0 4px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
}

.portfolio-highlights-subtitle {
  margin: 0 0 14px;
  font-size: 0.75rem;
  color: var(--muted);
}

.portfolio-sector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.portfolio-sector-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.portfolio-sector-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-bg);
}

.portfolio-sector-name {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.portfolio-sector-count {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--primary);
}

/* Inline search in toolbar */
.portfolio-inline-search {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--text);
  background: var(--surface);
  min-width: 160px;
}

.portfolio-inline-search:focus {
  outline: none;
  border-color: var(--primary);
}

/* Checkbox column */
.table-checkbox-col {
  width: 36px;
  text-align: center;
  padding: 6px 4px !important;
}

.table-checkbox-col input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
}

/* Selected row highlight */
.global-portfolio-table tr.row-selected {
  background: var(--primary-bg);
}

/* ── News Ticker ── */
.news-ticker {
  display: flex;
  align-items: center;
  background: var(--text);
  color: var(--surface);
  overflow: hidden;
  height: 32px;
  font-size: 0.8125rem;
  border-bottom: 1px solid var(--border);
}

.ticker-label {
  flex-shrink: 0;
  padding: 0 14px;
  font-weight: 700;
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  background: var(--primary);
  color: #fff;
  height: 100%;
  display: flex;
  align-items: center;
}

.ticker-track {
  flex: 1;
  overflow: hidden;
  position: relative;
  height: 100%;
}

.ticker-content {
  display: flex;
  gap: 0;
  white-space: nowrap;
  height: 100%;
  align-items: center;
  animation: ticker-scroll 120s linear infinite;
  width: max-content;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 24px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  height: 100%;
  transition: color 0.15s, background 0.15s;
}

.ticker-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.ticker-investor {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.ticker-title {
  font-weight: 400;
}

.ticker-date {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.75rem;
  flex-shrink: 0;
}

@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── Consent Banner ── */
.consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px 24px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
  font-size: 0.8125rem;
  color: var(--muted);
}

.consent-text {
  margin: 0;
  max-width: 600px;
}

.consent-text a {
  color: var(--primary);
  text-decoration: underline;
}

.consent-dismiss {
  flex-shrink: 0;
  padding: 6px 20px;
  border: none;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  font-size: 0.8125rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.consent-dismiss:hover {
  background: var(--primary-hover);
}

/* ── Site Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  margin-top: 48px;
  font-size: 0.75rem;
  color: var(--muted);
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-brand {
  font-weight: 700;
  color: var(--text);
  font-size: 0.8125rem;
}

.footer-links {
  display: flex;
  gap: 16px;
  align-items: center;
}

.footer-links a,
.footer-link {
  color: var(--muted);
  font-size: 0.75rem;
  transition: color 0.15s;
}

.footer-links a:hover,
.footer-link:hover {
  color: var(--primary);
  text-decoration: none;
}

.footer-copy {
  color: var(--muted);
  opacity: 0.7;
}

/* ── Removal Request Dialog ── */
.removal-dialog {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.removal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
}

.removal-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.removal-form label span {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
}

.removal-lookup-result {
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--bg-muted);
  font-size: 0.8125rem;
  color: var(--muted);
}

.removal-success {
  margin-top: 20px;
  padding: 20px;
  border-radius: 8px;
  background: var(--green-bg);
  text-align: center;
}

.removal-success p {
  margin: 4px 0;
  font-size: 0.875rem;
}

.removal-success code {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--surface);
  font-size: 0.8125rem;
  font-family: monospace;
}

.gdpr-removal-link {
  display: inline-block;
  margin-top: 12px;
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.6875rem;
  color: var(--muted);
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s, color 0.15s;
}

.gdpr-removal-link:hover {
  opacity: 1;
  color: var(--primary);
}

/* ── Premium / Subscription Gating ── */

/* Full-view paywall (e.g. the People tab for free users) */
.view-paywall {
  padding: 60px 24px;
  max-width: 640px;
  margin: 60px auto;
  text-align: center;
}
.view-paywall-note {
  margin-top: 24px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--body-text);
  line-height: 1.55;
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}

/* Header export button when locked (free tier) */
.export-button-locked {
  background: var(--cream-deep) !important;
  color: var(--dim) !important;
  border-color: var(--line) !important;
  cursor: pointer;
  position: relative;
}
.export-button-locked:hover {
  background: var(--accent) !important;
  color: #fff !important;
  border-color: var(--accent) !important;
  transform: translateY(-1px);
}

.premium-gate {
  position: relative;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 40px 28px;
  text-align: center;
  background: linear-gradient(180deg, var(--accent-tint), var(--paper));
}

.premium-gate-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.premium-gate-title {
  margin: 0;
  font-size: 1rem;
  color: var(--text);
}

.premium-gate-desc {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
  max-width: 320px;
}

.premium-badge {
  display: inline-block;
  padding: 2px 10px;
  background: var(--primary);
  color: #fff;
  border-radius: 4px;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.6;
}

.premium-cta {
  margin-top: 8px;
  padding: 10px 28px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-family: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s;
}

.premium-cta:hover {
  background: var(--primary-hover);
}

.premium-cta-sm {
  padding: 4px 14px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-family: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.15s;
}

.premium-cta-sm:hover {
  background: var(--primary-hover);
}

.premium-inline-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  margin: 12px 0;
  background: var(--primary-bg);
  border-radius: 8px;
  font-size: 0.8125rem;
  color: var(--muted);
}

.blurred-value {
  filter: blur(4px);
  user-select: none;
  pointer-events: none;
  cursor: default;
}

.blurred-btn {
  filter: blur(1px) opacity(0.6);
  cursor: pointer;
}

.blurred-btn:hover {
  filter: none;
}

/* Subscription badge in header */
.subscription-badge {
  padding: 4px 12px;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
}

.subscription-badge.pro {
  background: var(--primary);
  color: #fff;
}

.subscription-badge.pro:hover {
  background: var(--primary-hover);
}

.subscription-badge.free {
  background: var(--bg-muted);
  color: var(--muted);
  border: 1px solid var(--border);
}

.subscription-badge.free:hover {
  background: var(--primary-bg);
  color: var(--primary);
  border-color: var(--primary);
}

@media (max-width: 600px) {
  .consent-banner {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }
  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

/* ═══════════════════════════════════════════════════ */
/* Startup Investor Matching                          */
/* ═══════════════════════════════════════════════════ */

.startup-list-view {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 60px;
}

.startup-vc-badge-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 8px 14px;
  background: linear-gradient(135deg, rgba(16,185,129,.08), rgba(16,185,129,.02));
  border: 1px solid rgba(16,185,129,.2);
  border-radius: 8px;
  font-size: 0.8125rem;
}
.startup-vc-verified {
  color: #10b981;
  font-weight: 600;
}
.startup-vc-org {
  color: var(--muted);
}

.startup-cta-card {
  background: linear-gradient(135deg, var(--card) 0%, rgba(99,102,241,.04) 100%);
  border: 1px dashed var(--primary);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}
.startup-cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.startup-cta-inner h3 {
  font-size: 1.1rem;
  margin: 0 0 4px;
  color: var(--text);
}
.startup-cta-inner p {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
  max-width: 520px;
}
.startup-cta-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.startup-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  font-size: 0.9rem;
}

.startup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}

.startup-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  transition: border-color .15s, box-shadow .15s;
}
.startup-card:hover {
  border-color: var(--primary);
}
.startup-card.expanded {
  grid-column: 1 / -1;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}
.startup-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  cursor: pointer;
  gap: 8px;
}
.startup-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.startup-card-title h4 {
  font-size: 1rem;
  margin: 0;
  color: var(--text);
}
.startup-card-badges {
  display: flex;
  gap: 6px;
}
.startup-country-badge, .startup-stage-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}
.startup-country-badge {
  background: rgba(99,102,241,.1);
  color: var(--primary);
}
.startup-country-badge.small {
  font-size: 0.65rem;
  padding: 1px 5px;
}
.startup-stage-badge {
  background: rgba(16,185,129,.1);
  color: #10b981;
}
.startup-expand-icon {
  color: var(--muted);
  font-size: 0.7rem;
  margin-top: 4px;
  flex-shrink: 0;
}
.startup-one-liner {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 8px 0;
  line-height: 1.5;
}
.startup-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 0.78rem;
  color: var(--muted);
}
.startup-card-meta span {
  display: inline-flex;
  align-items: center;
}
.startup-website-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.78rem;
}
.startup-website-link:hover {
  text-decoration: underline;
}

.startup-expanded-content {
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

/* VC-only section */
.startup-vc-section {
  border: 1px dashed rgba(16,185,129,.3);
  border-radius: 8px;
  padding: 14px;
  background: rgba(16,185,129,.03);
  margin-bottom: 16px;
}
.startup-vc-section-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #10b981;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.startup-lock-icon {
  margin-right: 4px;
}
.startup-detail-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.85rem;
}
.startup-detail-row label {
  font-weight: 600;
  color: var(--muted);
  min-width: 60px;
  font-size: 0.78rem;
}
.startup-detail-row span,
.startup-detail-row p {
  color: var(--text);
  margin: 0;
}
.startup-detail-row a {
  color: var(--primary);
  text-decoration: none;
}
.startup-detail-row a:hover {
  text-decoration: underline;
}
.startup-no-details {
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
}

/* Locked view for non-VC users */
.startup-vc-locked {
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  background: var(--bg);
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.startup-vc-locked::before {
  content: "";
  position: absolute;
  inset: 0;
  backdrop-filter: blur(3px);
  z-index: 0;
}
.startup-vc-locked-content {
  position: relative;
  z-index: 1;
}
.startup-vc-locked-content .startup-lock-icon {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 8px;
}
.startup-vc-locked-content p {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

.startup-edit-btn {
  display: inline-block;
  font-size: 0.8rem;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  margin-bottom: 16px;
}
.startup-edit-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.startup-badge {
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: 4px;
  font-weight: 600;
}
.startup-badge.active {
  background: rgba(16,185,129,.1);
  color: #10b981;
}
.startup-badge.paused {
  background: rgba(245,158,11,.1);
  color: #f59e0b;
}
.startup-badge.closed {
  background: rgba(239,68,68,.1);
  color: #ef4444;
}

/* Investor match sidebar */
.match-sidebar {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.match-sidebar h5 {
  font-size: 0.85rem;
  margin: 0 0 12px;
  color: var(--text);
}
.match-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.match-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}
.match-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.match-card-header strong {
  font-size: 0.82rem;
  color: var(--text);
}
.match-card-meta {
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 2px;
}
.match-card-focus {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}
.match-score {
  display: flex;
  gap: 3px;
}
.match-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
}
.match-dot.filled {
  background: var(--primary);
}

/* Startup listing form */
.startup-form-dialog {
  background: var(--card);
  border-radius: 12px;
  width: 95vw;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.startup-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.startup-form-section {
  margin-bottom: 20px;
}
.startup-form-section h5 {
  font-size: 0.85rem;
  margin: 0 0 4px;
  color: var(--text);
}
.startup-form-hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0 0 12px;
}
.startup-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}
.startup-form label > span {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
}
.startup-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.startup-textarea {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}
.char-counter {
  font-size: 0.7rem;
  color: var(--muted);
  text-align: right;
}
.startup-form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}
.startup-delete-btn {
  font-size: 0.8rem;
  padding: 6px 14px;
  border: 1px solid rgba(239,68,68,.3);
  border-radius: 6px;
  background: none;
  color: #ef4444;
  cursor: pointer;
}
.startup-delete-btn:hover {
  background: rgba(239,68,68,.08);
}
.startup-cancel-btn {
  font-size: 0.8rem;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.startup-delete-confirm {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--muted);
}

@media (max-width: 600px) {
  .startup-grid {
    grid-template-columns: 1fr;
  }
  .startup-cta-inner {
    flex-direction: column;
    text-align: center;
  }
  .startup-form-row {
    grid-template-columns: 1fr;
  }
  .match-cards {
    grid-template-columns: 1fr;
  }
}
