:root {
  --bg: #0c1014;
  --panel: #161c23;
  --panel-2: #1f2731;
  --text: #e8eef3;
  --muted: #8a98a8;
  --dim: #5b6775;
  --accent: #4ade80;
  --border: #232c36;
  --border-soft: #1d252e;
}

* { box-sizing: border-box; }

/* ============================================================
   HOME = clean white canvas, just the interactive web.
   The sector detail slides in as a drawer only when a node is
   clicked. Scoped to body.home so the dark inner pages are
   unaffected.
   ============================================================ */
body.home { background: #ffffff; }
.home header {
  background: #ffffff;
  border-bottom: 1px solid #e7ebf0;
}
.home header h1 { color: #0f1419; }
.home header .subtitle { color: #6b7280; }
.home header nav a { color: #6b7280; }
.home header nav a:hover { color: #0f1419; background: #f1f5f9; }
.home header nav a.active { color: #0f1419; background: #eef2f6; border-color: #e7ebf0; }
.home #meta { color: #9aa7b4; }

/* web fills the whole canvas */
.home #layout { grid-template-columns: 1fr; }
.home main { background: #ffffff; }
.home #network { background: #ffffff; }
.home #legend { display: none; }

/* detail drawer — hidden until a sector is clicked, then slides over the right */
.home #panel { display: none; }
.home.panel-open #panel {
  display: block;
  position: fixed;
  top: 49px;
  right: 0;
  bottom: 0;
  width: 380px;
  z-index: 50;
  box-shadow: -10px 0 30px rgba(15, 20, 25, 0.18);
}
#panel-close {
  display: none;
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 51;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 5px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
#panel-close:hover { color: var(--text); background: #2c3744; }
.home.panel-open #panel-close { display: block; }


html, body {
  margin: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

header .title {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

header h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

header .subtitle {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

header nav {
  display: flex;
  gap: 4px;
  margin-left: 12px;
}

header nav a {
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 12px;
  text-decoration: none;
  color: var(--muted);
  border: 1px solid transparent;
}

header nav a:hover { color: var(--text); background: var(--panel-2); }
header nav a.active { color: var(--text); background: var(--panel-2); border-color: var(--border); }

#meta {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

#layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  height: calc(100vh - 49px);
}

main {
  position: relative;
  background: radial-gradient(ellipse at center, #0f161d 0%, #0a0e12 70%);
  min-height: 0;
  overflow: hidden;
}

#network {
  width: 100%;
  height: 100%;
}

#legend {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(22, 28, 35, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  max-width: 280px;
  font-size: 11px;
  color: var(--muted);
  pointer-events: none;
}

#legend .legend-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0;
}

#legend .swatch {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

aside#panel {
  background: var(--panel);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  padding: 18px 18px 30px;
}

.hint p { margin: 8px 0; color: var(--muted); }
.hint .dim { color: var(--dim); font-size: 12px; }

#panel-content h2 {
  margin: 0 0 4px;
  font-size: 18px;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

#panel-content h2 .sector-dot {
  width: 12px; height: 12px; border-radius: 50%;
  display: inline-block;
}

#panel-content .sector-meta {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 14px;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}

.stat {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
}

.stat .num {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.stat .lbl {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.section-h {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 18px 0 8px;
  font-weight: 600;
}

.entry-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 5px;
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.1s;
}

.entry-card:hover { background: #2a3441; }

.entry-card .e-head {
  font-weight: 500;
  font-size: 13px;
  line-height: 1.35;
}

.entry-card .e-meta {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.entry-card .e-meta .cat { color: var(--text); }

.entry-card.expanded .e-body {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: #c5d0db;
}

.entry-card .e-body { display: none; }

.entry-card.expanded .e-people {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}
.entry-card .e-people { display: none; }

.entry-card .e-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent);
}
.entry-card .e-link:hover { border-bottom-style: solid; }

.tag-pill {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--panel);
  color: var(--muted);
  border: 1px solid var(--border);
  margin-right: 4px;
}

/* Invested-by badge inside entry cards */
.entry-card.has-firms { border-left-color: #f59e0b; }
.e-firms {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
}
.e-firms-label {
  color: #f59e0b;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 10px;
  margin-right: 4px;
}
.firm-pill {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 3px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  font-size: 11px;
  margin-right: 4px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.1s;
}
.firm-pill:hover { background: rgba(245, 158, 11, 0.25); border-color: rgba(245, 158, 11, 0.6); }

.company-detail-link {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px dotted transparent;
}
.company-detail-link:hover { border-bottom-color: var(--accent); color: var(--accent); }

.person-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted transparent;
}
.person-link:hover { border-bottom-color: var(--accent); }
.person-link strong { color: var(--text); }
.person-link:hover strong { color: var(--accent); }

/* Sector-level market context (SOP Phase 5) */
.ctx-thesis {
  font-size: 13px;
  line-height: 1.55;
  color: #cbd5e1;
  background: rgba(74, 222, 128, 0.06);
  border-left: 2px solid var(--accent);
  padding: 9px 11px;
  border-radius: 0 4px 4px 0;
  margin-bottom: 10px;
}
.ctx-block {
  font-size: 12px;
  line-height: 1.55;
  color: #c5d0db;
  margin-bottom: 8px;
}
.ctx-lbl {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 6px;
  font-weight: 500;
}

/* Market-signal notes (folded-in intelligence — info first, source as quiet citation) */
.signal-note {
  font-size: 12px;
  line-height: 1.55;
  color: #c5d0db;
  padding: 7px 10px;
  background: rgba(56, 189, 248, 0.05);
  border-left: 2px solid rgba(56, 189, 248, 0.5);
  border-radius: 0 4px 4px 0;
  margin-bottom: 6px;
}
.signal-cite {
  color: var(--dim);
  font-size: 10px;
  font-style: italic;
  white-space: nowrap;
}
.hint-lead { margin: 0 0 4px; color: var(--text); font-size: 14px; }

/* Home hub — Explore tiles shown in the panel when no sector is selected */
.hub-lead { margin: 0 0 2px; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.hub-sub { margin: 0 0 14px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.hub-tiles { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.hub-tile {
  display: block;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 11px 13px;
  text-decoration: none;
  transition: background 0.1s, border-color 0.1s, transform 0.05s;
}
.hub-tile:hover { background: #2a3441; transform: translateX(2px); }
.hub-tile-top { display: flex; align-items: baseline; justify-content: space-between; }
.hub-tile-label { font-size: 14px; font-weight: 600; color: var(--text); }
.hub-tile-n { font-size: 16px; font-weight: 700; color: var(--accent); }
.hub-tile-arrow { font-size: 15px; color: var(--accent); }
.hub-tile-desc { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); line-height: 1.4; }

/* Compact company row — used in the sector-panel 'Portfolio investments' section. */
.dim-note {
  font-weight: 400;
  color: var(--dim);
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
  margin-left: 6px;
}

.company-row {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 8px 11px;
  margin-bottom: 6px;
}
.company-row-head {
  font-size: 13px;
  color: var(--text);
}
.company-row-head strong { font-weight: 500; }
.company-row-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  margin-top: 3px;
  flex-wrap: wrap;
}
.company-row-meta .muted { color: var(--muted); }
.company-row-meta .round-amt {
  color: #fbbf24;
  font-weight: 500;
}
.company-row-meta .stage-pill {
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 10px;
  text-transform: capitalize;
}
.company-row-investors {
  margin-top: 5px;
  line-height: 1.7;
}

/* Firm cards in the investors section */
.firm-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.firm-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.firm-head strong { font-size: 13px; }
.firm-link {
  font-size: 11px;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent);
}
.firm-link:hover { border-bottom-style: solid; }
.firm-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}
.firm-meta span { white-space: nowrap; }
.firm-portfolio {
  margin-top: 6px;
  font-size: 11px;
  color: #c5d0db;
  line-height: 1.5;
}
.firm-portfolio-label {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 9px;
  margin-right: 4px;
}
.firm-refs {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}
.ref-pill {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.3);
  color: var(--accent);
  font-size: 10px;
  margin-right: 4px;
  margin-top: 2px;
}
