@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  color-scheme: dark;
  --bg: #020817;
  --panel: rgba(6, 15, 34, 0.84);
  --panel2: rgba(9, 20, 44, 0.93);
  --line: rgba(185, 220, 255, 0.12);
  --text: #eaf4ff;
  --muted: #7f98b8;
  --blue: #38bdf8;
  --deep-blue: #2563eb;
  --green: #2cff9a;
  --teal: #5cc8ff;
  --amber: #ffb454;
  --red: #ff4f6d;
  --violet: #a855f7;
  --supplier: #a855f7;
  --client: #2cff9a;
  --debt: #ff4f6d;
  --font-display: "Space Grotesk", Inter, ui-sans-serif, system-ui, sans-serif;
  --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --grad-accent: linear-gradient(120deg, #38bdf8 0%, #5cc8ff 40%, #a78bfa 100%);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 50% -10%, rgba(56,189,248,0.13), transparent 32%),
              radial-gradient(circle at 90% 20%, rgba(37,99,235,0.12), transparent 24%),
              radial-gradient(circle at 8% 88%, rgba(168,85,247,0.07), transparent 30%),
              var(--bg);
  color: var(--text);
  font: 14px/1.4 var(--font-body);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Film grain — kills the flat vector look */
body::after {
  content: '';
  position: fixed; inset: -50%;
  width: 200%; height: 200%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.02em; }

/* ── Reveal-on-scroll utilities ── */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  filter: blur(6px);
  transition: opacity 0.7s cubic-bezier(0.22,1,0.36,1),
              transform 0.7s cubic-bezier(0.22,1,0.36,1),
              filter 0.7s cubic-bezier(0.22,1,0.36,1);
}
.reveal.in {
  opacity: 1;
  transform: none;
  filter: none;
}
.reveal-d1 { transition-delay: 0.08s; }
.reveal-d2 { transition-delay: 0.16s; }
.reveal-d3 { transition-delay: 0.24s; }
.reveal-d4 { transition-delay: 0.32s; }
.reveal-d5 { transition-delay: 0.40s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; filter: none; transition: none; }
}

a { color: inherit; text-decoration: none; }
button, input {
  font: inherit;
}

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 52px;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(2, 8, 23, 0.82);
  backdrop-filter: blur(18px);
  flex-shrink: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.brand-logo {
  height: 60px;
  width: auto;
  display: block;
}

.nav {
  display: flex;
  gap: 28px;
  color: rgba(148,201,232,0.7);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  flex: 1;
  justify-content: center;
}

.nav a {
  color: rgba(148,201,232,0.65);
  transition: color 0.2s;
  position: relative;
  padding: 4px 0;
}
.nav a::after {
  content: '';
  position: absolute;
  left: 0; right: 100%; bottom: 0;
  height: 1px;
  background: var(--grad-accent);
  transition: right 0.28s cubic-bezier(0.22,1,0.36,1);
}
.nav a:hover { color: var(--blue); }
.nav a:hover::after { right: 0; }
.nav a.active { color: var(--blue); font-weight: 700; }
.nav a.active::after { right: 0; }

.status-pill {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #a8bdd7;
  font-size: 12px;
  white-space: nowrap;
}

.status-pill span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 12px var(--blue);
}
.status-pill.status-ok #site-status-dot { background: var(--green); box-shadow: 0 0 10px var(--green); }
.status-pill.status-warn #site-status-dot { background: #f59e0b; box-shadow: 0 0 10px #f59e0b; }
.status-pill.status-err #site-status-dot { background: #ef4444; box-shadow: 0 0 10px #ef4444; }

/* ── Ticker card logo + flag ── */
.ticker-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.ticker-card-text { flex: 1; min-width: 0; }
.ticker-card-text h1 { margin: 0; }
.company-logo { width: 32px; height: 32px; border-radius: 6px; object-fit: contain; background: rgba(255,255,255,0.06); flex-shrink: 0; }
#company-flag { font-size: 15px; line-height: 1; }

/* ── Map disclaimer ── */
.map-disclaimer {
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 7px;
  font-size: 12px;
  line-height: 1.55;
  color: #94a3b8;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(185,220,255,0.1);
}
.map-disclaimer.disclaimer-nodisclosure { border-color: rgba(251,191,36,0.25); background: rgba(251,191,36,0.06); }
.map-disclaimer.disclaimer-new { border-color: rgba(56,189,248,0.2); background: rgba(56,189,248,0.05); }

/* ── Map usage hint ── */
@keyframes muh-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.map-usage-hint {
  position: absolute;
  bottom: 48px; right: 28px;
  background: rgba(6,15,34,0.92);
  border: 1px solid rgba(56,189,248,0.28);
  color: #eaf4ff;
  font-size: 12.5px;
  padding: 16px 18px 12px;
  border-radius: 8px;
  pointer-events: auto;
  z-index: 20;
  opacity: 0;
  animation: muh-in 0.5s cubic-bezier(0.22,1,0.36,1) 2.2s forwards;
  transition: opacity 0.8s ease;
  backdrop-filter: blur(10px);
  min-width: 190px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.55);
}
.map-usage-hint.hidden { opacity: 0 !important; pointer-events: none; }
.muh-title {
  font-size: 10px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: #38bdf8; margin-bottom: 10px;
}
.muh-row {
  display: flex; align-items: center; gap: 10px;
  padding: 3px 0; border-bottom: 1px solid rgba(56,189,248,0.07);
}
.muh-row:last-of-type { border-bottom: none; }
.muh-key {
  font-size: 10px; font-weight: 700; letter-spacing: 0.05em;
  color: #38bdf8; min-width: 76px; white-space: nowrap;
}
.muh-desc { font-size: 11.5px; color: #7f98b8; }
.muh-dismiss {
  margin-top: 10px; width: 100%;
  background: rgba(56,189,248,0.1); border: 1px solid rgba(56,189,248,0.25);
  color: #38bdf8; font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 5px 0; border-radius: 4px; cursor: pointer;
  transition: background 0.2s;
}
.muh-dismiss:hover { background: rgba(56,189,248,0.2); }

.workspace {
  display: grid;
  grid-template-columns: var(--left-w, 300px) 5px minmax(0, 1fr) 5px var(--right-w, 330px);
  grid-template-rows: minmax(0, 1fr);
  height: calc(100vh - 58px);
  max-height: calc(100vh - 58px);
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.left-rail, .right-rail {
  height: calc(100vh - 58px);
  max-height: calc(100vh - 58px);
  min-height: 0;
  padding: 16px;
  border-right: 1px solid var(--line);
  background: rgba(3, 10, 28, 0.44);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.right-rail {
  border-right: 0;
  border-left: 1px solid var(--line);
}

.resize-handle {
  width: 5px;
  height: calc(100vh - 58px);
  cursor: col-resize;
  background: transparent;
  position: relative;
  z-index: 10;
  transition: background 150ms;
  flex-shrink: 0;
}
.resize-handle:hover,
.resize-handle.dragging {
  background: rgba(56,189,248,0.22);
}

.search-block, .ticker-card, .panel, .layer-list, .price-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent 40%), var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 18px 60px rgba(0,0,0,0.34), inset 0 1px 0 rgba(255,255,255,0.045);
}

.ticker-card, .panel, .layer-list { margin-top: 12px; }

.eyebrow {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.search-block label {
  display: block;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr 70px;
  gap: 8px;
}

input {
  width: 100%;
  background: #061426;
  color: var(--text);
  border: 1px solid rgba(185,220,255,0.16);
  border-radius: 6px;
  padding: 10px 11px;
  text-transform: uppercase;
  outline: none;
}

input:focus { border-color: rgba(56,189,248,0.58); }

button {
  border: 1px solid rgba(56,189,248,0.4);
  background: rgba(56,189,248,0.12);
  color: var(--blue);
  border-radius: 6px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 700;
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}

button:hover {
  background: rgba(56,189,248,0.2);
  border-color: rgba(56,189,248,0.6);
  box-shadow: 0 0 18px rgba(56,189,248,0.16);
}
button:active { transform: translateY(1px); }

select {
  width: 100%;
  background: #061426;
  color: var(--text);
  border: 1px solid rgba(185,220,255,0.16);
  border-radius: 6px;
  padding: 10px 11px;
  outline: none;
}

.search-results {
  display: grid;
  gap: 4px;
  margin-top: 10px;
}

.search-results button {
  width: 100%;
  text-align: left;
  color: #a8bdd7;
  background: rgba(255,255,255,0.025);
  border-color: rgba(255,255,255,0.06);
  display: grid;
  grid-template-columns: 52px minmax(0,1fr);
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
}
.search-results button:hover { background: rgba(56,189,248,0.1); border-color: rgba(56,189,248,0.28); }
.sr-ticker {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sr-name {
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: none;
}

h1, h2, p { margin: 0; }

.ticker-card h1 {
  font-size: 22px;
  line-height: 1.1;
  margin-bottom: 10px;
}

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

.ticker-meta span {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  padding: 3px 8px;
}

.risk-meter {
  height: 7px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  overflow: hidden;
  margin: 16px 0 12px;
}

.risk-meter div {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, rgba(44,255,154,0.78), rgba(255,180,84,0.78), rgba(255,79,109,0.8));
}

.metrics, .detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.metrics div, .detail-grid div {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.055);
  border-radius: 6px;
  padding: 8px;
}

.metrics strong, .detail-grid strong {
  display: block;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.metrics span, .detail-grid span {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.9px;
}

.layer-list {
  display: grid;
  gap: 9px;
}

.layer-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #aec2dc;
  cursor: pointer;
  user-select: none;
}

.layer-list input[type="checkbox"] {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  margin: 0;
  accent-color: var(--blue);
}

.layer-list label::after {
  content: "";
  width: 9px;
  height: 9px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 12px currentColor;
}

.layer-list label:has([data-layer="supplier"])::after { background: var(--supplier); box-shadow: 0 0 12px var(--supplier); }
.layer-list label:has([data-layer="customer"])::after { background: var(--client); box-shadow: 0 0 12px var(--client); }
.layer-list label:has([data-layer="debt"])::after { background: var(--debt); box-shadow: 0 0 12px var(--debt); }
.layer-list label:has([data-layer="acquisition"])::after { background: var(--amber); box-shadow: 0 0 12px var(--amber); }
.layer-list label:has([data-layer="ownership"])::after { background: var(--teal); box-shadow: 0 0 12px var(--teal); }

.map-stage {
  position: relative;
  min-width: 0;
  background: radial-gradient(circle at 50% 50%, rgba(56,189,248,0.08), transparent 36%),
              radial-gradient(circle at 12% 80%, rgba(37,99,235,0.12), transparent 28%);
  overflow: hidden;
  height: calc(100vh - 58px);
  min-height: 0;
}

#scene {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

.connection-svg,
.connection-nodes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: none;
}

.connection-svg {
  opacity: 0.92;
}

.connection-line {
  fill: none;
  stroke: rgba(56, 189, 248, 0.7);
  stroke-width: 2.2;
}

.connection-line.supplier { stroke: rgba(168, 85, 247, 0.78); }
.connection-line.debt { stroke: rgba(255, 79, 109, 0.78); }
.connection-line.acquisition { stroke: rgba(255, 180, 84, 0.68); }
.connection-line.ownership { stroke: rgba(92, 200, 255, 0.7); }
.connection-line.customer { stroke: rgba(44, 255, 154, 0.76); }
.connection-line.filing { stroke: rgba(123, 145, 181, 0.48); }
.connection-line.endpoint {
  stroke: rgba(56, 189, 248, 0.62);
  stroke-width: 1.35;
  stroke-dasharray: 5 6;
}

.map-node {
  position: absolute;
  width: 76px;
  min-height: 46px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(230,236,232,0.14);
  border-radius: 8px;
  background: rgba(4, 12, 28, 0.9);
  box-shadow: 0 0 24px rgba(56,189,248,0.2), inset 0 0 16px rgba(56,189,248,0.08);
  padding: 7px 8px;
  pointer-events: auto;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.map-node:hover {
  transform: translate(-50%, -50%) scale(1.04);
  border-color: rgba(230,236,232,0.34);
  box-shadow: 0 0 34px rgba(56,189,248,0.18);
}

.map-node.root {
  width: 116px;
  min-height: 72px;
  border-color: rgba(230,236,232,0.42);
  background: rgba(7, 18, 40, 0.94);
  box-shadow: 0 0 56px rgba(56,189,248,0.24);
}

.map-node.supplier { border-color: rgba(168,85,247,0.46); box-shadow: 0 0 18px rgba(56,189,248,0.2), 0 0 28px rgba(168,85,247,0.16); }
.map-node.customer { border-color: rgba(44,255,154,0.42); box-shadow: 0 0 18px rgba(56,189,248,0.2), 0 0 28px rgba(44,255,154,0.14); }
.map-node.debt { border-color: rgba(255,79,109,0.44); box-shadow: 0 0 18px rgba(56,189,248,0.2), 0 0 28px rgba(255,79,109,0.15); }
.map-node.acquisition { border-color: rgba(255,180,84,0.38); }
.map-node.ownership { border-color: rgba(92,200,255,0.38); }
.map-node.filing { border-color: rgba(123,145,181,0.28); }
.map-node.filing {
  width: 58px;
  min-height: 36px;
  opacity: 0.82;
}

.map-node strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-node span {
  display: block;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.8px;
  margin-top: 5px;
  text-transform: uppercase;
}

.labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.node-label {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(2, 8, 23, 0.68);
  border: 1px solid rgba(255,255,255,0.08);
  color: #dcecff;
  font-size: 11px;
  white-space: nowrap;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.node-label.navigable {
  pointer-events: auto;
  cursor: pointer;
  border-color: rgba(56,189,248,0.28);
}

.node-label.supplier { border-color: rgba(168,85,247,0.34); box-shadow: 0 0 16px rgba(168,85,247,0.08); }
.node-label.customer { border-color: rgba(44,255,154,0.32); box-shadow: 0 0 16px rgba(44,255,154,0.08); }
.node-label.debt { border-color: rgba(255,79,109,0.34); box-shadow: 0 0 16px rgba(255,79,109,0.08); }
.node-label.acquisition { border-color: rgba(255,180,84,0.28); }
.node-label.ownership { border-color: rgba(92,200,255,0.3); }

.node-label.navigable:hover {
  color: #ffffff;
  border-color: rgba(56,189,248,0.58);
  box-shadow: 0 0 18px rgba(56,189,248,0.14);
}

.stage-hud {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}

.stage-hud div {
  min-width: 150px;
  background: rgba(0,0,0,0.48);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 10px 12px;
  backdrop-filter: blur(12px);
}

.hud-button {
  pointer-events: auto;
  min-width: 118px;
  align-self: end;
  padding: 10px 12px;
  border-color: rgba(56,189,248,0.34);
  background: rgba(5, 18, 42, 0.72);
  color: var(--text);
  box-shadow: 0 0 22px rgba(56,189,248,0.1);
}

.hud-button:hover {
  background: rgba(56,189,248,0.16);
}

.hud-label {
  display: block;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.panel h2 {
  font-size: 18px;
  margin-bottom: 8px;
}

.panel p {
  color: #91a19a;
  margin-bottom: 12px;
}

.signals {
  display: grid;
  gap: 8px;
}

.signal {
  border-left: 2px solid var(--teal);
  background: rgba(255,255,255,0.03);
  padding: 8px 10px;
  border-radius: 4px;
}

.signal.high { border-left-color: var(--red); }
.signal.medium { border-left-color: var(--amber); }
.signal.low { border-left-color: var(--green); }

.signal strong { display: block; margin-bottom: 3px; }
.signal span { color: var(--muted); font-size: 12px; }

.feature-list {
  margin: 0;
  padding-left: 18px;
  color: #9cadA5;
}

.feature-list li { margin: 8px 0; }

.node-ticker-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.node-ticker-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 11px;
  border-radius: 6px;
  background: rgba(56,189,248,0.10);
  border: 1px solid rgba(56,189,248,0.30);
  color: #38bdf8;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.node-ticker-badge:hover {
  background: rgba(56,189,248,0.20);
  border-color: rgba(56,189,248,0.50);
  text-decoration: none;
}
.node-ticker-nav-links {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  gap: 8px;
}
.node-ticker-nav-links a {
  color: #38bdf8;
  text-decoration: none;
}
.node-ticker-nav-links a:hover { text-decoration: underline; }

.ticker-profile-name {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(56,189,248,0.06);
  border: 1px solid rgba(56,189,248,0.16);
  border-radius: 7px;
}
.ticker-profile-name-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ticker-profile-name-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: #38bdf8;
  background: rgba(56,189,248,0.12);
  border: 1px solid rgba(56,189,248,0.25);
  border-radius: 5px;
  padding: 2px 8px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.ticker-profile-name-badge:hover {
  background: rgba(56,189,248,0.22);
  text-decoration: none;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.profile-grid div {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.055);
  border-radius: 6px;
  min-width: 0;
  padding: 8px;
}

.profile-grid span,
.event-row span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.9px;
  text-transform: uppercase;
}

.profile-grid strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.event-list {
  display: grid;
  gap: 8px;
}

.event-row {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.055);
  border-radius: 6px;
  padding: 9px;
}

.event-row strong {
  display: block;
  margin-bottom: 3px;
}

.event-row p {
  color: #91a19a;
  font-size: 12px;
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.empty-state {
  color: var(--muted);
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 6px;
  padding: 10px;
}

.panel-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.panel-header-row .eyebrow {
  margin-bottom: 0;
}

.fin-toggle-btn {
  font-size: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  border-color: rgba(56,189,248,0.3);
  background: rgba(56,189,248,0.08);
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.fin-toggle-btn:hover {
  background: rgba(56,189,248,0.16);
  color: var(--text);
}

.fin-panel {
  border-top: 1px solid var(--line);
  margin-top: 10px;
  padding-top: 2px;
}

.biotech-eyebrow {
  color: var(--green) !important;
}

#biotech-card {
  border-color: rgba(44,255,154,0.22);
}

.pricing-hero {
  padding: 56px 24px 28px;
  max-width: 900px;
}

.pricing-hero h1 {
  font-size: 44px;
  line-height: 1.02;
  max-width: 820px;
}

.pricing-hero p {
  max-width: 640px;
  color: #9cadA5;
  font-size: 17px;
  margin-top: 14px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 0 24px 28px;
}

.price-card {
  min-height: 420px;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s cubic-bezier(0.22,1,0.36,1), border-color 0.25s, box-shadow 0.25s;
}
.price-card:hover {
  transform: translateY(-4px);
  border-color: rgba(56,189,248,0.3);
  box-shadow: 0 26px 70px rgba(0,0,0,0.45), 0 0 40px rgba(56,189,248,0.07);
}

.price-card.featured {
  border-color: rgba(44,255,154,0.4);
  box-shadow: 0 0 60px rgba(44,255,154,0.08);
}
.price-card.featured:hover {
  border-color: rgba(44,255,154,0.6);
  box-shadow: 0 26px 70px rgba(0,0,0,0.45), 0 0 60px rgba(44,255,154,0.14);
}

.price-card h2 {
  font-size: 24px;
}

.price {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 700;
  margin: 14px 0;
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  width: fit-content;
}
.price span {
  -webkit-text-fill-color: var(--muted);
}

.price span {
  color: var(--muted);
  font-size: 14px;
  margin-left: 4px;
}

.price-card ul {
  margin: 0 0 18px;
  padding-left: 18px;
  color: #9cadA5;
}

.price-card li { margin: 10px 0; }
.price-card button { margin-top: auto; width: 100%; }

.search-page {
  overflow: auto;
}

.search-shell {
  min-height: 100vh;
}

.correlation-workbench {
  padding: 22px;
  display: grid;
  gap: 14px;
}

.search-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.search-hero h1 {
  font-size: 36px;
  line-height: 1.04;
}

.graph-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(88px, 1fr));
  gap: 8px;
  min-width: 420px;
}

.graph-stats div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.graph-stats strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.graph-stats span {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.search-controls {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 160px 150px 112px;
  gap: 10px;
  align-items: end;
}

.search-field label,
.select-field label {
  display: block;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 1.4px;
  margin-bottom: 7px;
  text-transform: uppercase;
}

.results-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
  align-items: start;
}

.results-panel,
.entity-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.entity-panel {
  position: sticky;
  top: 74px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-head h2 {
  font-size: 19px;
}

.count-pill {
  color: var(--green);
  border: 1px solid rgba(44,255,154,0.22);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
}

.correlation-results {
  display: grid;
  gap: 9px;
}

.correlation-row {
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  background: rgba(255,255,255,0.025);
  padding: 9px 12px;
  cursor: pointer;
  position: relative;
}

.correlation-row.active,
.correlation-row:hover {
  border-color: rgba(44,255,154,0.28);
  background: rgba(44,255,154,0.045);
}

.row-path {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  flex-wrap: wrap;
}

.row-arrow {
  color: var(--muted);
  font-size: 11px;
}

.row-inline-meta {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 4px;
}

.row-names {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-snippet {
  font-size: 11px;
  color: #8fa098;
  margin-top: 4px;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.row-map-link {
  display: inline-block;
  margin-top: 5px;
  font-size: 11px;
  color: var(--blue);
  text-decoration: none;
}

.row-actions {
  display: grid;
  gap: 7px;
  align-content: start;
}

.row-actions a,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(44,255,154,0.35);
  background: rgba(44,255,154,0.12);
  color: var(--green);
  border-radius: 6px;
  padding: 9px 10px;
  font-weight: 700;
}

.entity-panel p {
  color: #91a19a;
  margin-bottom: 12px;
}

.detail-actions {
  margin: 12px 0 16px;
}

.section-label {
  margin-top: 10px;
}

.evidence-box {
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  color: #a9bbb2;
  padding: 11px;
  font-size: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 300px;
  overflow: auto;
}

/* ── Collapsible panels ── */
.panel > .eyebrow,
.panel > .panel-header-row {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 4px;
}
.panel > .eyebrow::after,
.panel > .panel-header-row::after {
  content: '▾';
  font-size: 16px;
  color: var(--blue);
  margin-left: 8px;
  flex-shrink: 0;
  line-height: 1;
}
.panel--collapsed > .eyebrow::after,
.panel--collapsed > .panel-header-row::after { content: '▸'; }
.panel--collapsed > *:not(.eyebrow):not(.panel-header-row) { display: none !important; }
.panel--collapsed { cursor: pointer; }
.panel--collapsed:hover { border-color: rgba(56,189,248,0.25); background: rgba(56,189,248,0.04); }

/* ── Filing categories ── */
.filing-category { background: rgba(255,255,255,0.03); border: 1px solid rgba(185,220,255,0.09); border-radius: 8px; overflow: hidden; margin-bottom: 6px; }
.filing-category > summary { list-style: none; cursor: pointer; padding: 9px 11px; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text); }
.filing-category > summary::-webkit-details-marker { display: none; }
.filing-category > summary::before { content: '▸'; color: var(--blue); font-size: 10px; }
.filing-category[open] > summary::before { content: '▾'; }
.filing-category-label { font-weight: 700; flex: 1; }
.filing-category-count { background: rgba(56,189,248,0.12); border: 1px solid rgba(56,189,248,0.2); border-radius: 999px; color: var(--blue); font-size: 10px; padding: 2px 8px; }
.filing-category-items { padding: 4px 8px 8px; display: grid; gap: 6px; }

@media (max-width: 1100px) {
  body { overflow: auto; }
  .workspace { grid-template-columns: 1fr; }
  .map-stage { min-height: 58vh; }
  .left-rail, .right-rail { border: 0; }
  .pricing-grid { grid-template-columns: 1fr; }
  .search-hero { align-items: start; flex-direction: column; }
  .graph-stats { min-width: 0; width: 100%; grid-template-columns: repeat(2, 1fr); }
  .search-controls, .results-layout, .correlation-row { grid-template-columns: 1fr; }
  .entity-panel { position: static; }
}


.event-list { gap: 10px; }
.event-card { background: rgba(255,255,255,0.035); border: 1px solid rgba(185,220,255,0.095); border-radius: 8px; overflow: hidden; }
.event-card summary { list-style: none; cursor: pointer; display: flex; flex-direction: row; gap: 8px; padding: 10px 11px; align-items: start; }
.event-card summary::-webkit-details-marker { display: none; }
.event-card summary::before { content: '▸'; color: var(--blue); flex-shrink: 0; margin-top: 1px; font-size: 11px; }
.event-card[open] summary::before { content: '▾'; }
.event-title-wrap { flex: 1; min-width: 0; }
.event-title-wrap strong { display: block; color: var(--text); font-size: 12px; line-height: 1.25; text-transform: capitalize; overflow-wrap: anywhere; }
.event-title-wrap em { display: block; color: #9cadb8; font-style: normal; font-size: 11px; line-height: 1.35; margin-top: 4px; overflow-wrap: anywhere; }
.event-meta-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; max-width: 130px; text-align: right; }
.event-meta-wrap b { color: var(--green); border: 1px solid rgba(44,255,154,0.18); border-radius: 999px; padding: 2px 7px; font-size: 9px; text-transform: uppercase; white-space: nowrap; }
.event-meta-wrap span { color: var(--muted); font-size: 10px; line-height: 1.3; overflow-wrap: anywhere; word-break: break-word; }
.event-detail { border-top: 1px solid rgba(185,220,255,0.08); padding: 10px 11px 12px; }
.detail-kv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.detail-kv-grid div { background: rgba(0,0,0,0.16); border: 1px solid rgba(255,255,255,0.055); border-radius: 6px; padding: 7px; min-width: 0; }
.detail-kv-grid span { display: block; color: var(--muted); font-size: 9px; letter-spacing: 0.8px; text-transform: uppercase; }
.detail-kv-grid strong { display: block; color: var(--text); font-size: 12px; margin-top: 3px; overflow-wrap: anywhere; white-space: pre-wrap; }
.detail-text, .detail-json { margin-top: 9px; color: #a8bac4; background: rgba(0,0,0,0.16); border: 1px solid rgba(255,255,255,0.055); border-radius: 6px; padding: 8px; font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-wrap; }
.detail-json { max-height: 260px; overflow: auto; }
.detail-link { display: inline-flex; margin-top: 10px; color: var(--blue); font-size: 12px; border-bottom: 1px solid rgba(56,189,248,0.3); }
#ownership-profile.profile-grid { display: block; }

.holder-table { margin-top: 12px; border-top: 1px solid rgba(255,255,255,0.07); padding-top: 8px; }
.holder-table-head { display: flex; justify-content: space-between; padding: 4px 6px; color: var(--muted); font-size: 9px; letter-spacing: 0.8px; text-transform: uppercase; }
.holder-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 6px; border-radius: 5px; font-size: 12px; }
.holder-row:hover { background: rgba(255,255,255,0.04); }
.holder-name { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 68%; }
.holder-shares { color: var(--muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }


.news-list {
  display: grid;
  gap: 12px;
}

.news-card {
  background: linear-gradient(180deg, rgba(56,189,248,0.075), rgba(255,255,255,0.028));
  border: 1px solid rgba(56,189,248,0.18);
  border-left: 3px solid rgba(56,189,248,0.72);
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
}

.news-card + .news-card {
  margin-top: 2px;
}

.news-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.news-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.news-title:hover {
  color: var(--blue);
  text-decoration: underline;
}

.news-sentiment {
  color: var(--green);
  border: 1px solid rgba(44,255,154,0.22);
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 9px;
  text-transform: uppercase;
}

.news-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  color: #91a5b0;
  font-size: 10.5px;
  line-height: 1.35;
}

.news-meta span {
  background: rgba(0,0,0,0.16);
  border: 1px solid rgba(255,255,255,0.055);
  border-radius: 999px;
  padding: 3px 7px;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.news-link {
  display: inline-flex;
  margin-top: 10px;
  color: var(--blue);
  font-size: 12px;
  border-bottom: 1px solid rgba(56,189,248,0.35);
}

/* ── Market Intelligence + Biotech Signals panels ─────────────────────────── */

.eyebrow-source {
  font-size: 10px;
  font-weight: 400;
  color: #4a6070;
  margin-left: 6px;
  text-transform: none;
  letter-spacing: 0;
}

/* Convergence score bar */
.conv-score-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.conv-label {
  font-size: 11px;
  color: #7a9ab0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}
.conv-bar-track {
  flex: 1;
  min-width: 60px;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}
.conv-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.conv-bar-bull { background: #22c55e; }
.conv-bar-neu  { background: #eab308; }
.conv-bar-bear { background: #ef4444; }
.conv-num {
  font-size: 13px;
  font-weight: 700;
  color: #e2e8f0;
  flex-shrink: 0;
}

/* Signal rows */
.sig-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}
.sig-row {
  display: grid;
  grid-template-columns: 14px auto 1fr;
  gap: 5px;
  align-items: baseline;
  font-size: 11.5px;
  line-height: 1.4;
  padding: 3px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.sig-row:last-child { border-bottom: none; }
.sig-src {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #5a7a8a;
  flex-shrink: 0;
}
.sig-text { color: #b0c4cc; }
.sig-bull { color: #22c55e; font-weight: 600; }
.sig-bear { color: #ef4444; font-weight: 600; }
.sig-neu  { color: #eab308; font-weight: 600; }
.sig-muted { color: #5a7a8a; font-size: 11px; }
.sig-subsection {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 8px 0 4px;
}
.sig-hdr {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #4a6475;
  font-weight: 600;
}

/* Congress trade list */
.congress-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 8px;
}
.congress-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  grid-template-rows: auto auto;
  gap: 2px 6px;
  font-size: 11px;
  padding: 5px 8px;
  background: rgba(0,0,0,0.18);
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,0.05);
}
.congress-type {
  grid-row: 1 / 3;
  align-self: center;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}
.congress-name { font-size: 12px; font-weight: 600; color: #d0dde5; }
.congress-meta { font-size: 10px; color: #5a7a8a; }
.congress-amt  { font-size: 11px; color: #94a3b8; text-align: right; }
.congress-date { font-size: 10px; color: #4a6070; text-align: right; }

/* BiotechSign card */
.bts-grade-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.bts-grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 800;
  border: 2px solid currentColor;
}
.bts-grade-a { color: #22c55e; border-color: #22c55e; background: rgba(34,197,94,0.1); }
.bts-grade-b { color: #84cc16; border-color: #84cc16; background: rgba(132,204,22,0.1); }
.bts-grade-c { color: #eab308; border-color: #eab308; background: rgba(234,179,8,0.1); }
.bts-grade-d { color: #ef4444; border-color: #ef4444; background: rgba(239,68,68,0.1); }
.bts-score-num {
  font-size: 20px;
  font-weight: 700;
  color: #e2e8f0;
}
.bts-signal-row {
  grid-template-columns: 52px 1fr auto !important;
}
.bts-sig-type {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #38bdf8;
  font-weight: 600;
  flex-shrink: 0;
}
.bts-date {
  font-size: 10.5px;
  color: #5a7a8a;
  text-align: right;
  white-space: nowrap;
}


/* ── Mobile — public/SEO pages + shared topbar (2026-07-10) ──
   Media-scoped only: desktop rendering unchanged. */
@media (max-width: 760px) {
  .topbar { gap: 12px; padding: 0 14px; }
  .nav {
    gap: 18px;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    mask-image: linear-gradient(to right, #000 88%, transparent);
    -webkit-mask-image: linear-gradient(to right, #000 88%, transparent);
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex-shrink: 0; padding: 10px 0; white-space: nowrap; }
  .status-pill { display: none; }
}
@media (max-width: 640px) {
  input, select, textarea { font-size: 16px; } /* prevents iOS zoom-on-focus */
}
