:root {
  /* ── Base surfaces ── */
  --base:           #F8F7F4;
  --surface-0:      #FFFFFF;
  --surface-1:      #FAFAF9;
  --surface-2:      #F4F3F0;
  --surface-raised: rgba(255, 255, 255, 0.97);

  /* ── Brand palette ── */
  --c-fil:               #f0012d;
  --c-fil-glow:          rgba(240, 1, 45, 0.08);
  --c-fil-subtle:        rgba(240, 1, 45, 0.06);
  --c-blue:              #1d4ed8;
  --c-blue-glow:         rgba(29, 78, 216, 0.07);
  --c-founder:           #dc2626;
  --c-f2024:             #1d4ed8;
  --c-f2025:             #2563eb;
  --c-f2026:             #3b82f6;
  --c-friend:            #64748b;
  --c-sponsor-main:      #1e293b;
  --c-sponsor-community: #334155;
  --c-sponsor-service:   #475569;

  /* ── Link colors — dark on light bg ── */
  --l-founder:            rgba(220, 38, 38, 0.28);
  --l-f2024:              rgba(29, 78, 216, 0.28);
  --l-f2025:              rgba(37, 99, 235, 0.20);
  --l-f2026:              rgba(59, 130, 246, 0.16);
  --l-friend:             rgba(100, 116, 139, 0.13);
  --l-affiliation:        rgba(24, 24, 27, 0.10);
  --l-works-at:           rgba(24, 24, 27, 0.08);
  --l-sponsor-main:       rgba(30, 41, 59, 0.22);
  --l-sponsor-community:  rgba(51, 65, 85, 0.16);
  --l-sponsor-service:    rgba(71, 85, 105, 0.13);

  /* ── Legacy compat ── */
  --bg-app:            var(--base);
  --bg-app-deep:       var(--surface-1);
  --bg-panel:          var(--surface-raised);
  --bg-surface:        rgba(24, 24, 27, 0.04);
  --bg-surface-strong: rgba(24, 24, 27, 0.07);
  --bg-surface-soft:   rgba(24, 24, 27, 0.025);

  /* ── Borders ── */
  --border:        rgba(24, 24, 27, 0.09);
  --border-strong: rgba(24, 24, 27, 0.16);
  --border-accent: rgba(240, 1, 45, 0.22);

  /* ── Text ── */
  --text-primary:   #18181B;
  --text-secondary: #3F3F46;
  --text-muted:     #71717A;
  --text-faint:     #A1A1AA;

  /* ── Layout ── */
  --header-h:   68px;
  --panel-w:    375px;
  --sidebar-w:  236px;
  --radius:     10px;
  --radius-lg:  16px;
  --radius-xl:  22px;

  /* ── Shadows ── */
  --shadow-soft: 0 2px 12px rgba(24, 24, 27, 0.07);
  --shadow-deep: 0 16px 48px rgba(24, 24, 27, 0.12), 0 4px 12px rgba(24, 24, 27, 0.06);
  --shadow-pop:  0 0 0 1px rgba(24, 24, 27, 0.07), 0 8px 24px rgba(24, 24, 27, 0.08);

  /* ── Fonts ── */
  --font-body:    "Plus Jakarta Sans", system-ui, sans-serif;
  --font-heading: "Instrument Serif", Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--base);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(circle, rgba(24, 24, 27, 0.055) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 85% 75% at 50% 42%, rgba(0,0,0,0.5) 20%, transparent 88%);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  background: none;
}

.icon-shell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ui-icon {
  width: 16px;
  height: 16px;
}

/* ── Header ─────────────────────────────────────── */
#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  height: var(--header-h);
  padding: 0 24px;
  background: rgba(252, 251, 249, 0.94);
  border-bottom: 1px solid rgba(24, 24, 27, 0.07);
  backdrop-filter: blur(20px) saturate(200%);
  -webkit-backdrop-filter: blur(20px) saturate(200%);
  transform: translateZ(0);
}

#header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--c-fil) 0%, rgba(240,1,45,0.4) 18%, rgba(29,78,216,0.3) 58%, transparent 100%);
}

.header-brand {
  display: flex;
  align-items: center;
  min-width: 0;
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  cursor: pointer;
  user-select: none;
}

.logo-mark {
  width: 56px;
  height: auto;
  flex-shrink: 0;
  transition: opacity 0.2s ease;
  opacity: 0.82;
  filter: invert(1) brightness(0);
}

.logo:hover .logo-mark {
  opacity: 1;
}

.logo-copy {
  min-width: 0;
}

.logo-text {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.025em;
  white-space: nowrap;
  color: var(--text-primary);
}

.logo-sub {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 1px;
}

/* ── Header Nav ──────────────────────────────────── */
.header-nav {
  display: flex;
  align-items: center;
  gap: 0;
  margin-left: auto;
  flex-shrink: 0;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: var(--header-h);
  padding: 0 15px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: -0.015em;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  transition: color 0.18s, border-color 0.18s;
}

.nav-tab:hover {
  color: var(--text-primary);
}

.nav-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--c-fil);
  font-weight: 600;
}

.nav-tab-ext {
  border-left: 1px solid rgba(24, 24, 27, 0.09);
  border-bottom-color: transparent !important;
  padding-left: 18px;
  margin-left: 6px;
  color: var(--text-muted);
}

.nav-tab-ext:hover {
  color: var(--text-secondary);
  background: transparent;
}

.nav-ext-icon {
  width: 10px;
  height: 10px;
  opacity: 0.45;
  flex-shrink: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* ── Search / Skill ────────────────────────────────── */
#skill-wrap {
  display: none;
}

#skill-wrap,
#search-wrap {
  position: relative;
  flex: none;
  width: 100%;
}

#skill-select,
#search {
  width: 100%;
  min-height: 34px;
  padding: 0 10px 0 31px;
  border-radius: var(--radius);
  border: 1px solid rgba(24, 24, 27, 0.10);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 400;
  outline: none;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

#skill-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 30px;
  cursor: pointer;
}

#skill-select:focus,
#search:focus {
  border-color: rgba(29, 78, 216, 0.35);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.08);
}

#skill-select option {
  color: #18181b;
  background: #fff;
}

#search::placeholder {
  color: var(--text-faint);
}

.skill-icon,
.search-icon {
  position: absolute;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
}

.skill-arrow {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
}

.skill-arrow .ui-icon {
  width: 12px;
  height: 12px;
}

.toolbar-btn {
  min-height: 30px;
  padding: 0 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(24, 24, 27, 0.10);
  background: transparent;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
  letter-spacing: -0.01em;
}

.toolbar-btn:hover {
  border-color: rgba(24, 24, 27, 0.18);
  background: rgba(24, 24, 27, 0.05);
  color: var(--text-secondary);
}

/* ── Filter chips ────────────────────────────────── */
.filter-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 2px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.filter-chips::-webkit-scrollbar {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

.chip:hover {
  background: rgba(24, 24, 27, 0.06);
  color: var(--text-secondary);
}

.chip.active {
  color: var(--text-secondary);
  background: rgba(24, 24, 27, 0.06);
  box-shadow: inset 3px 0 0 currentColor;
}

.chip .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  opacity: 0.55;
  transition: opacity 0.14s;
}

.chip.active .dot {
  opacity: 1;
}

.chip-label {
  line-height: 1;
  flex: 1;
}

.chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 5px;
  background: rgba(24, 24, 27, 0.07);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

/* Per-type active states */
.chip[data-type="fil"].active {
  color: var(--c-fil);
  background: var(--c-fil-subtle);
  box-shadow: inset 3px 0 0 var(--c-fil);
}
.chip[data-type="founder"].active {
  color: var(--c-founder);
  background: rgba(220, 38, 38, 0.07);
  box-shadow: inset 3px 0 0 var(--c-founder);
}
.chip[data-type="fellow_2024"].active {
  color: var(--c-f2024);
  background: var(--c-blue-glow);
  box-shadow: inset 3px 0 0 var(--c-f2024);
}
.chip[data-type="fellow_2025"].active {
  color: var(--c-f2025);
  background: rgba(37, 99, 235, 0.07);
  box-shadow: inset 3px 0 0 var(--c-f2025);
}
.chip[data-type="fellow_2026"].active {
  color: var(--c-f2026);
  background: rgba(59, 130, 246, 0.07);
  box-shadow: inset 3px 0 0 var(--c-f2026);
}
.chip[data-type="fil_friend"].active {
  color: var(--c-friend);
  background: rgba(100, 116, 139, 0.07);
  box-shadow: inset 3px 0 0 var(--c-friend);
}
.chip[data-type="sponsor_main"].active {
  color: var(--c-sponsor-main);
  background: rgba(30, 41, 59, 0.07);
  box-shadow: inset 3px 0 0 var(--c-sponsor-main);
}
.chip[data-type="sponsor_community"].active {
  color: var(--c-sponsor-community);
  background: rgba(51, 65, 85, 0.07);
  box-shadow: inset 3px 0 0 var(--c-sponsor-community);
}
.chip[data-type="sponsor_service"].active {
  color: var(--c-sponsor-service);
  background: rgba(71, 85, 105, 0.07);
  box-shadow: inset 3px 0 0 var(--c-sponsor-service);
}
.chip[data-type="organization"].active {
  color: #52525b;
  background: rgba(82, 82, 91, 0.07);
  box-shadow: inset 3px 0 0 #52525b;
}

/* ── App layout ────────────────────────────────────── */
#app {
  display: flex;
  height: 100vh;
  padding-top: var(--header-h);
}

/* ── Left Sidebar ─────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface-0);
  border-right: 1px solid rgba(24, 24, 27, 0.09);
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
  z-index: 50;
}

#sidebar #search-wrap,
#sidebar #skill-wrap {
  flex: none;
  min-width: 0;
  max-width: none;
  width: 100%;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  padding: 20px 0 12px;
}

.sidebar-section-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 0 18px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(24, 24, 27, 0.07);
}

#sidebar #search-wrap {
  padding: 14px 12px 6px;
}

#search-results {
  padding: 0 10px 8px;
}

.search-results-label {
  padding: 6px 8px 5px;
  color: var(--text-faint);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.search-result-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  min-height: 44px;
  padding: 8px 9px;
  border-radius: var(--radius);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: background 0.14s ease;
}

.search-result-item:hover {
  background: rgba(24, 24, 27, 0.06);
}

.search-result-name {
  font-size: 11px;
  font-weight: 650;
}

.search-result-meta {
  color: var(--text-muted);
  font-size: 9.5px;
  line-height: 1.35;
}

#sidebar #skill-wrap {
  padding: 0 12px 6px;
}

#sidebar .filter-chips {
  flex-direction: column;
  flex-wrap: nowrap;
  overflow-x: visible;
  overflow-y: visible;
  gap: 1px;
  padding: 0 8px;
}

#sidebar .chip {
  justify-content: flex-start;
  border-radius: var(--radius);
  min-height: 33px;
  font-size: 11px;
  padding: 0 10px;
}

#sidebar .chip:hover {
  transform: none;
}

#sidebar .chip-count {
  margin-left: auto;
  font-size: 9.5px;
  background: rgba(24, 24, 27, 0.06);
  border-radius: 5px;
  padding: 1px 6px;
  min-width: auto;
}

#sidebar .chip.active .chip-count {
  background: rgba(24, 24, 27, 0.12);
}

.sidebar-bottom {
  margin-top: auto;
  padding: 12px 12px 16px;
  border-top: 1px solid rgba(24, 24, 27, 0.07);
}

#sidebar .toolbar-btn {
  width: 100%;
  font-size: 10.5px;
  min-height: 32px;
  border-radius: var(--radius);
}

/* ── Sidebar view tabs ──────────────────────────────── */
#sidebar-view-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sv-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 2px 9px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-faint);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  margin-bottom: -1px;
}

.sv-tab svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.sv-tab:hover {
  color: var(--text-secondary);
  background: var(--bg-surface);
}

.sv-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--c-fil);
}

/* ── sidebar-main-content wrapper ────────────────────── */
#sidebar-main-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

#sidebar-main-content.sv-hidden { display: none; }

/* ── Talent panel ────────────────────────────────────── */
#talent-panel {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  padding: 14px 0 16px;
}

#talent-panel[aria-hidden="false"] { display: flex; }

.tp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.tp-title {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.tp-clear {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.13s;
}
.tp-clear:hover { color: var(--c-fil); }

.tp-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 10px;
}

.tp-group {
  padding: 10px 0 4px;
  border-bottom: 1px solid var(--border);
}

.tp-group:last-child { border-bottom: none; }

.tp-group-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 7px;
}

.tp-group-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tp-empty {
  font-size: 12px;
  color: var(--text-faint);
  padding: 8px 2px;
}

.skill-bubble {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border-radius: 99px;
  border: 1px solid;
  cursor: pointer;
  background: transparent;
  transition: background 0.13s, border-color 0.13s, transform 0.13s;
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.2;
  text-align: left;
}

.skill-bubble:hover { transform: translateY(-1px); }

.sb-count {
  font-size: 9px;
  font-weight: 700;
  opacity: 0.55;
  flex-shrink: 0;
}

.skill-bubble.sb-fil {
  color: #b91c1c;
  border-color: rgba(240,1,45,0.22);
  background: rgba(240,1,45,0.04);
}
.skill-bubble.sb-fil:hover,
.skill-bubble.sb-fil.sb-active {
  background: rgba(240,1,45,0.10);
  border-color: rgba(240,1,45,0.45);
}

.skill-bubble.sb-navy {
  color: #011559;
  border-color: rgba(1,21,89,0.22);
  background: rgba(1,21,89,0.04);
}
.skill-bubble.sb-navy:hover,
.skill-bubble.sb-navy.sb-active {
  background: rgba(1,21,89,0.10);
  border-color: rgba(1,21,89,0.45);
}

.skill-bubble.sb-blue {
  color: #1d4ed8;
  border-color: rgba(24,134,245,0.22);
  background: rgba(24,134,245,0.04);
}
.skill-bubble.sb-blue:hover,
.skill-bubble.sb-blue.sb-active {
  background: rgba(24,134,245,0.12);
  border-color: rgba(24,134,245,0.45);
}

/* dark theme adjustments */
html[data-theme="dark"] .sv-tab.active { border-bottom-color: var(--c-fil); }

html[data-theme="dark"] .skill-bubble.sb-fil {
  color: #f87171;
  border-color: rgba(240,1,45,0.28);
  background: rgba(240,1,45,0.07);
}
html[data-theme="dark"] .skill-bubble.sb-fil:hover,
html[data-theme="dark"] .skill-bubble.sb-fil.sb-active {
  background: rgba(240,1,45,0.15);
}

html[data-theme="dark"] .skill-bubble.sb-navy {
  color: #93c5fd;
  border-color: rgba(100,160,255,0.22);
  background: rgba(100,160,255,0.06);
}
html[data-theme="dark"] .skill-bubble.sb-navy:hover,
html[data-theme="dark"] .skill-bubble.sb-navy.sb-active {
  background: rgba(100,160,255,0.14);
}

html[data-theme="dark"] .skill-bubble.sb-blue {
  color: #60a5fa;
  border-color: rgba(96,165,250,0.25);
  background: rgba(96,165,250,0.06);
}
html[data-theme="dark"] .skill-bubble.sb-blue:hover,
html[data-theme="dark"] .skill-bubble.sb-blue.sb-active {
  background: rgba(96,165,250,0.14);
}

/* ── Canvas ─────────────────────────────────────────── */
#canvas-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  background: var(--base);
}

#network-svg {
  width: 100%;
  height: 100%;
  display: block;
  background: transparent;
}

/* Hide map controls when an overlay is open */
body:has(#events-view.visible) #zoom-controls,
body:has(#events-view.visible) #view-controls,
body:has(#benefits-view.visible) #zoom-controls,
body:has(#benefits-view.visible) #view-controls,
body:has(#timeline-view[aria-hidden="false"]) #zoom-controls,
body:has(#timeline-view[aria-hidden="false"]) #view-controls {
  display: none;
}

/* ── Zoom controls ───────────────────────────────────── */
#zoom-controls {
  position: absolute;
  left: 20px;
  bottom: 52px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 5px;
  border: 1px solid rgba(24, 24, 27, 0.10);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  box-shadow: var(--shadow-pop);
}

.zoom-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.zoom-btn:hover {
  background: rgba(24, 24, 27, 0.07);
  color: var(--text-primary);
}

/* ── Legal note ──────────────────────────────────────── */
#legal-note {
  position: absolute;
  left: 16px;
  bottom: 14px;
  z-index: 60;
  max-width: min(920px, calc(100% - 96px));
  color: rgba(24, 24, 27, 0.35);
  font-size: 7.6px;
  line-height: 1.05;
  letter-spacing: 0.015em;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.legal-note-mark {
  margin-right: 4px;
  color: rgba(24, 24, 27, 0.5);
}

#legal-note a {
  color: rgba(24, 24, 27, 0.45);
  text-decoration: none;
}

#legal-note a:hover {
  text-decoration: underline;
}

/* ── Graph links ─────────────────────────────────────── */
.link {
  stroke-linecap: round;
  transition: opacity 0.18s ease;
}

.link-is_founder        { stroke: var(--l-founder);           stroke-width: 1.6; }
.link-is_fellow_2024    { stroke: var(--l-f2024);             stroke-width: 1.3; }
.link-is_fellow_2025    { stroke: var(--l-f2025);             stroke-width: 1.3; }
.link-is_fellow_2026    { stroke: var(--l-f2026);             stroke-width: 1.3; }
.link-is_fil_friend     { stroke: var(--l-friend);            stroke-width: 1; stroke-dasharray: 3 5; }
.link-affiliated_with   { stroke: var(--l-affiliation);       stroke-width: 1; stroke-dasharray: 2 4; }
.link-works_at          { stroke: var(--l-works-at);          stroke-width: 0.8; stroke-dasharray: 3 6; }
.link-has_main_sponsor  { stroke: var(--l-sponsor-main);      stroke-width: 1.6; stroke-dasharray: 6 4; }
.link-has_community_sponsor { stroke: var(--l-sponsor-community); stroke-width: 1.3; stroke-dasharray: 4 4; }
.link-has_service_sponsor   { stroke: var(--l-sponsor-service);   stroke-width: 1.1; stroke-dasharray: 3 4; }

/* ── Graph nodes ─────────────────────────────────────── */
.node {
  cursor: pointer;
}

.node circle {
  stroke-width: 1.5;
  transition: r 0.18s ease, filter 0.18s ease, opacity 0.18s ease;
}

.node:hover circle {
  filter: brightness(0.88) drop-shadow(0 2px 8px rgba(24, 24, 27, 0.18));
}

.node-label {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 500;
  fill: rgba(24, 24, 27, 0.68);
  text-anchor: middle;
  dominant-baseline: hanging;
  pointer-events: none;
  transition: opacity 0.18s ease, fill 0.18s ease;
}

.node-fil .node-label {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 400;
  fill: var(--text-primary);
}

.node-fil_friend .node-label,
.node-sponsor_service .node-label,
.node-organization .node-label {
  opacity: 0;
}

.node:hover .node-label,
.node.highlighted .node-label,
.node.selected .node-label,
.node.focus-org .node-label,
.node.focus-member .node-label,
.node.skill-match .node-label,
.node-fil .node-label,
.node-founder .node-label,
.node-fellow_2024 .node-label,
.node-fellow_2025 .node-label,
.node-fellow_2026 .node-label,
.node-sponsor_main .node-label {
  opacity: 1;
}

.node-user-ring {
  fill: none;
  stroke: rgba(24, 24, 27, 0.6);
  stroke-width: 1.4;
  stroke-dasharray: 3 2;
}

.node.skill-match .main {
  filter: brightness(0.9);
}

.node.selected circle.main {
  stroke: var(--c-fil);
  stroke-width: 3;
  filter: brightness(0.92) drop-shadow(0 0 12px rgba(240, 1, 45, 0.22));
}

.node.focus-org circle.main,
.node.focus-member circle.main {
  stroke: var(--c-blue);
  stroke-width: 2.4;
  filter: brightness(0.94) drop-shadow(0 0 8px rgba(29, 78, 216, 0.16));
}

.node.focus-skill circle.main {
  stroke: rgba(180, 83, 9, 0.56);
  stroke-width: 2;
}

.node.voice-skill-match .main {
  filter: brightness(0.88) drop-shadow(0 0 10px rgba(180, 83, 9, 0.25));
}

.node.dimmed circle,
.node.dimmed .node-label {
  opacity: 0.1;
}

.link.dimmed {
  opacity: 0.04;
}

.node.highlighted circle {
  filter: brightness(0.9) drop-shadow(0 0 10px rgba(24, 24, 27, 0.14));
}

.node.highlighted .node-label {
  fill: var(--text-primary);
}

.graph-root.zoom-low .node-label {
  opacity: 0;
}

.graph-root.zoom-low .node-fil .node-label,
.graph-root.zoom-low .node.selected .node-label,
.graph-root.zoom-low .node.highlighted .node-label {
  opacity: 1;
}

.graph-root.zoom-mid .node-fil_friend:not(.highlighted):not(.selected) .node-label,
.graph-root.zoom-mid .node-sponsor_service:not(.highlighted):not(.selected) .node-label,
.graph-root.zoom-mid .node-organization:not(.highlighted):not(.selected) .node-label {
  opacity: 0;
}

.graph-root.zoom-high .node:not(.dimmed) .node-label {
  opacity: 1;
}

/* ── Panel overlay ───────────────────────────────────── */
#panel-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 88;
  background: rgba(24, 24, 27, 0.28);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

/* ── Detail panel ────────────────────────────────────── */
#detail-panel {
  width: var(--panel-w);
  flex-shrink: 0;
  border-left: 1px solid rgba(24, 24, 27, 0.09);
  background: var(--surface-0);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(24, 24, 27, 0.10) transparent;
}

.panel-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 22px 22px 18px;
  border-bottom: 1px solid rgba(24, 24, 27, 0.08);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.panel-close-btn {
  display: none;
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(24, 24, 27, 0.05);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.16s, color 0.16s;
}

.panel-close-btn:hover {
  background: rgba(24, 24, 27, 0.10);
  color: var(--text-primary);
}

@media (max-width: 840px) {
  .panel-close-btn {
    display: flex;
  }

  .panel-header {
    position: relative;
    padding-right: 50px;
  }
}

.panel-hero {
  display: flex;
  gap: 14px;
  align-items: center;
}

.panel-card-actions {
  display: flex;
  gap: 7px;
  margin-top: 14px;
}

.btn-card-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(24, 24, 27, 0.04);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-card-action:hover {
  background: rgba(24, 24, 27, 0.08);
  color: var(--text-primary);
  border-color: rgba(24, 24, 27, 0.16);
}
.btn-card-action:disabled { opacity: 0.5; cursor: default; }
.btn-card-action .ui-icon { width: 14px; height: 14px; }

/* ── Toast ──────────────────────────────────────────── */
.fil-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: rgba(24, 24, 27, 0.94);
  color: #fafaf9;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(24, 24, 27, 0.2);
  backdrop-filter: blur(20px);
  opacity: 0;
  transition: opacity 0.22s, transform 0.22s;
  pointer-events: none;
  z-index: 9999;
  white-space: nowrap;
}
.fil-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.panel-media {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 1.5px solid rgba(24, 24, 27, 0.12);
  background: rgba(24, 24, 27, 0.05);
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(24, 24, 27, 0.04), var(--shadow-soft);
}

.panel-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.panel-media.is-logo {
  border-radius: var(--radius);
  background: rgba(24, 24, 27, 0.03);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(24, 24, 27, 0.09);
}

.panel-media.is-logo img {
  object-fit: contain;
  padding: 12px;
}

.panel-media.is-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  color: var(--c-fil);
  background: rgba(240, 1, 45, 0.07);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.panel-heading {
  min-width: 0;
}

.panel-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.panel-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 0 9px;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.panel-type-badge .ui-icon {
  width: 12px;
  height: 12px;
}

.special-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 12px 18px 4px;
}

.special-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.special-badge.is-more {
  background: rgba(24, 24, 27, 0.035);
  color: var(--text-muted);
  border-color: rgba(24, 24, 27, 0.10);
}

.special-badge .ui-icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

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

.career-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.career-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(24, 24, 27, 0.04);
  color: var(--text-muted);
  flex-shrink: 0;
}

.career-icon .ui-icon {
  width: 13px;
  height: 13px;
}

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

.career-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.career-company {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.panel-title {
  font-family: var(--font-heading);
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.panel-subtitle {
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.panel-body {
  padding: 18px 20px 24px;
}

.org-intel-item span {
  display: block;
  margin-bottom: 4px;
  color: var(--text-faint);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.org-intel-item strong {
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.35;
}

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

.org-intel-item {
  padding: 11px;
  border-radius: var(--radius);
  border: 1px solid rgba(24, 24, 27, 0.08);
  background: rgba(255, 255, 255, 0.44);
}

/* ── Panel body sections ─────────────────────────────── */
.detail-section {
  margin-bottom: 24px;
}

.detail-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.detail-section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(24, 24, 27, 0.08);
}

.detail-section-title::before {
  display: none;
}

.detail-desc {
  color: var(--text-secondary);
  font-size: 12.5px;
  line-height: 1.85;
}

/* ── Meta block ─────────────────────────────────────── */
.detail-meta-block {
  padding: 14px 15px;
  border-radius: var(--radius);
  border: 1px solid rgba(24, 24, 27, 0.08);
  background: rgba(24, 24, 27, 0.025);
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.meta-title-row,
.meta-org-row {
  display: flex;
  gap: 9px;
  align-items: center;
}

.meta-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  flex-shrink: 0;
}

.meta-icon.meta-icon-role {
  background: rgba(29, 78, 216, 0.08);
  border: 1px solid rgba(29, 78, 216, 0.16);
  color: #1d4ed8;
}

.meta-icon.meta-icon-org {
  background: rgba(24, 24, 27, 0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.meta-icon .ui-icon {
  width: 13px;
  height: 13px;
}

.meta-title-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.meta-org-text {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ── Skill tags ──────────────────────────────────────── */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid rgba(29, 78, 216, 0.16);
  background: rgba(29, 78, 216, 0.06);
  color: #1d4ed8;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background 0.14s, border-color 0.14s;
}

.tag-pill:hover {
  background: rgba(29, 78, 216, 0.10);
  border-color: rgba(29, 78, 216, 0.26);
}

.tag-pill.is-neutral {
  border-color: rgba(24, 24, 27, 0.10);
  background: rgba(24, 24, 27, 0.04);
  color: var(--text-secondary);
}

/* ── Highlights ──────────────────────────────────────── */
.highlight-list {
  display: grid;
  gap: 9px;
}

.highlight-item {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid rgba(180, 83, 9, 0.13);
  background: rgba(251, 191, 36, 0.05);
  border-left: 3px solid rgba(180, 83, 9, 0.42);
  transition: border-color 0.18s, background 0.18s;
}

.highlight-item:hover {
  border-color: rgba(180, 83, 9, 0.22);
  border-left-color: rgba(180, 83, 9, 0.65);
  background: rgba(251, 191, 36, 0.08);
}

.highlight-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
  color: #b45309;
}

.highlight-mark .ui-icon {
  width: 13px;
  height: 13px;
}

.highlight-text {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.7;
}

/* ── Info rows ───────────────────────────────────────── */
.info-list {
  display: grid;
  gap: 8px;
}

.info-row {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 12px;
}

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(24, 24, 27, 0.04);
  color: var(--c-f2024);
  flex-shrink: 0;
}

.info-icon .ui-icon {
  width: 13px;
  height: 13px;
}

.info-value {
  color: var(--text-secondary);
  line-height: 1.55;
}

.detail-note {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(240, 1, 45, 0.14);
  background: rgba(240, 1, 45, 0.05);
  color: #991b1b;
  font-size: 11.5px;
  line-height: 1.7;
}

.summary-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(24, 24, 27, 0.04);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
}

.summary-pill .summary-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.connection-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.similar-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.connection-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: rgba(24, 24, 27, 0.03);
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.connection-item:hover {
  border-color: rgba(24, 24, 27, 0.09);
  background: rgba(24, 24, 27, 0.06);
}

.connection-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.connection-name {
  flex: 1;
  min-width: 0;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
}

.connection-name small {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.35;
  text-transform: none;
}

.connection-rel {
  color: var(--text-faint);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.panel-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.panel-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(24, 24, 27, 0.10);
  background: rgba(24, 24, 27, 0.04);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 11.5px;
  font-weight: 500;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.panel-link:hover {
  border-color: rgba(24, 24, 27, 0.18);
  background: rgba(24, 24, 27, 0.07);
  color: var(--text-primary);
}

.panel-link.is-source {
  background: rgba(24, 24, 27, 0.025);
}

/* ── Panel default state ─────────────────────────────── */
#panel-default {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 100%;
  padding: 40px 24px;
  text-align: center;
}

.panel-default-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  border: 1px solid rgba(240, 1, 45, 0.18);
  background: rgba(240, 1, 45, 0.06);
  color: var(--c-fil);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 6px rgba(240, 1, 45, 0.04);
}

.panel-default-icon .ui-icon {
  width: 26px;
  height: 26px;
}

.panel-default-text {
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.75;
  max-width: 200px;
}

/* ── Tooltip ─────────────────────────────────────────── */
#tooltip {
  position: fixed;
  display: none;
  z-index: 200;
  max-width: 220px;
  padding: 10px 13px;
  border-radius: var(--radius);
  border: 1px solid rgba(24, 24, 27, 0.12);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow: var(--shadow-deep);
  pointer-events: none;
}

#tooltip .tt-name {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

#tooltip .tt-role {
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 11px;
}

#tooltip .tt-org {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 10.5px;
  line-height: 1.45;
}

#detail-panel::-webkit-scrollbar { width: 4px; }
#detail-panel::-webkit-scrollbar-track { background: transparent; }
#detail-panel::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(24, 24, 27, 0.12); }

.insight-view {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 58;
  overflow-y: auto;
  padding: 0;
  background: var(--base);
}

.insight-view.visible {
  display: block;
}

.pathfinder-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 18px;
}

.pathfinder-controls select {
  min-height: 38px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-0);
  color: var(--text-primary);
  padding: 0 11px;
  outline: none;
}

.path-output,
.health-card,
.health-metric {
  border: 1px solid rgba(24, 24, 27, 0.08);
  border-radius: var(--radius);
  background: var(--surface-0);
}

.path-output {
  padding: 16px;
}

.path-summary {
  margin-bottom: 12px;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.path-chain {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.path-node {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  max-width: 190px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(24, 24, 27, 0.08);
  background: rgba(24, 24, 27, 0.03);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}

.path-node span {
  font-size: 12px;
  font-weight: 700;
}

.path-node small,
.path-empty {
  color: var(--text-muted);
  font-size: 10px;
}

.health-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.health-metric {
  padding: 16px;
}

.health-metric span,
.health-card h3 {
  display: block;
  color: var(--text-faint);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.health-metric strong {
  display: block;
  margin-top: 7px;
  font-size: 24px;
  color: var(--text-primary);
}

.health-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.health-card {
  padding: 16px;
}

.health-card h3 {
  margin: 0 0 12px;
}

.health-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.health-list button {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--radius);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}

.health-list button:hover {
  background: rgba(24, 24, 27, 0.05);
}

.health-list span {
  font-size: 12px;
  font-weight: 650;
}

.health-list small {
  color: var(--text-muted);
  font-size: 10px;
}

.health-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.health-tags span {
  padding: 7px 9px;
  border-radius: 999px;
  border: 1px solid rgba(24, 24, 27, 0.08);
  background: rgba(24, 24, 27, 0.035);
  color: var(--text-secondary);
  font-size: 11px;
}

/* ── View controls ───────────────────────────────────── */
#view-controls {
  position: fixed;
  right: 20px;
  bottom: 52px;
  z-index: 200;
  display: flex;
  flex-direction: row;
  gap: 2px;
  padding: 5px;
  border: 1px solid rgba(24, 24, 27, 0.10);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  box-shadow: var(--shadow-pop);
}

.view-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.view-btn:hover {
  background: rgba(24, 24, 27, 0.07);
  color: var(--text-secondary);
}

.view-btn.active {
  background: rgba(29, 78, 216, 0.08);
  color: var(--c-blue);
  border-color: rgba(29, 78, 216, 0.18);
}

.view-divider-vertical {
  width: 1px;
  background: rgba(24, 24, 27, 0.08);
  margin: 4px 3px;
}

/* ── Timeline view ───────────────────────────────────── */
#timeline-view {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 55;
  overflow-y: auto;
  padding: 28px 32px 80px;
  background: var(--base);
}

#timeline-view.visible {
  display: block;
}

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

.timeline-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.timeline-close {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(24, 24, 27, 0.04);
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s;
}

.timeline-close:hover {
  background: rgba(24, 24, 27, 0.08);
  border-color: var(--border-strong);
}

.timeline-track {
  position: relative;
  padding-left: 24px;
  border-left: 2px solid rgba(24, 24, 27, 0.10);
}

.timeline-year {
  position: relative;
  margin-bottom: 32px;
}

.timeline-year-badge {
  position: absolute;
  left: -35px;
  top: 0;
  width: 48px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--c-f2024);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(29, 78, 216, 0.22);
}

.timeline-year-badge.f-2025 {
  background: var(--c-f2025);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}
.timeline-year-badge.f-2026 {
  background: var(--c-f2026);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.timeline-items {
  display: grid;
  gap: 10px;
}

.timeline-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border-radius: 14px;
  border: 1px solid rgba(24, 24, 27, 0.08);
  background: var(--surface-0);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.timeline-card:hover {
  border-color: rgba(29, 78, 216, 0.20);
  background: rgba(29, 78, 216, 0.04);
  transform: translateX(5px);
  box-shadow: var(--shadow-soft);
}

.timeline-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(24, 24, 27, 0.10);
}

.timeline-body {
  min-width: 0;
}

.timeline-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.timeline-meta {
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Compare overlay ─────────────────────────────────── */
#compare-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(24, 24, 27, 0.35);
  backdrop-filter: blur(5px);
}

#compare-overlay.visible {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.compare-dialog {
  width: min(900px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 20px;
  border: 1px solid rgba(24, 24, 27, 0.10);
  background: var(--surface-0);
  backdrop-filter: blur(32px) saturate(140%);
  -webkit-backdrop-filter: blur(32px) saturate(140%);
  box-shadow: var(--shadow-deep);
}

.compare-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(24, 24, 27, 0.08);
}

.compare-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 400;
  color: var(--text-primary);
}

.compare-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(24, 24, 27, 0.04);
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s;
}

.compare-close:hover {
  background: rgba(24, 24, 27, 0.08);
  border-color: var(--border-strong);
}

.compare-body {
  padding: 22px;
}

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.compare-col {
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(24, 24, 27, 0.025);
}

.compare-col-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.compare-col-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(24, 24, 27, 0.12);
}

.compare-col-name {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 400;
  color: var(--text-primary);
}

.compare-col-role {
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-muted);
}

.compare-section {
  margin-top: 16px;
}

.compare-section-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.compare-match {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(5, 150, 105, 0.22);
  background: rgba(5, 150, 105, 0.07);
  color: #059669;
  font-size: 11px;
  font-weight: 500;
}

.compare-prompt {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ── Primary btn ─────────────────────────────────────── */
.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(29, 78, 216, 0.28);
  background: rgba(29, 78, 216, 0.08);
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.primary-btn:hover {
  border-color: rgba(29, 78, 216, 0.4);
  background: rgba(29, 78, 216, 0.14);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.12);
}

.primary-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* ── Event node meta block ───────────────────────────── */
.event-meta-block {
  border-color: rgba(180, 83, 9, 0.20);
  background: rgba(251, 191, 36, 0.05);
}

.meta-icon.meta-icon-event {
  background: rgba(180, 83, 9, 0.08);
  border: 1px solid rgba(180, 83, 9, 0.20);
  color: #b45309;
}

/* ── Benefits list (sponsor panel) ──────────────────── */
.benefits-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.benefit-card {
  border-radius: 12px;
  border: 1px solid rgba(180, 83, 9, 0.14);
  background: rgba(251, 191, 36, 0.04);
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: border-color 0.18s, transform 0.18s;
}

.benefit-card:hover {
  border-color: rgba(180, 83, 9, 0.26);
  transform: translateY(-1px);
}

.benefit-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.benefit-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: rgba(180, 83, 9, 0.08);
  border: 1px solid rgba(180, 83, 9, 0.18);
  color: #b45309;
  flex-shrink: 0;
}

.benefit-icon .ui-icon { width: 14px; height: 14px; }

.benefit-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.benefit-desc {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  padding-left: 36px;
}

.benefit-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-left: 36px;
}

.benefit-code {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  font-family: monospace;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(180, 83, 9, 0.07);
  border: 1px solid rgba(180, 83, 9, 0.22);
  color: #b45309;
}

.benefit-code .ui-icon { width: 11px; height: 11px; }

.benefit-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid rgba(29, 78, 216, 0.22);
  background: rgba(29, 78, 216, 0.06);
  color: #1d4ed8;
  text-decoration: none;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.benefit-cta:hover {
  background: rgba(29, 78, 216, 0.12);
  border-color: rgba(29, 78, 216, 0.35);
}

.benefit-cta .ui-icon { width: 11px; height: 11px; }

.benefit-expiry {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-left: auto;
}

/* ── Shared overlay view shell ───────────────────────── */
#events-view,
#benefits-view {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  overflow-y: auto;
  background: var(--base);
}

#events-view.visible,
#benefits-view.visible {
  display: block;
}

.overlay-view-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 40px 22px;
  border-bottom: 1px solid rgba(24, 24, 27, 0.09);
  background: rgba(248, 247, 244, 0.94);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
}

.overlay-view-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.overlay-view-title .ui-icon {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.overlay-view-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  border: 1px solid rgba(24, 24, 27, 0.10);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.14s, color 0.14s, transform 0.2s;
}

.overlay-view-close:hover {
  background: rgba(24, 24, 27, 0.07);
  color: var(--text-primary);
  transform: rotate(90deg);
}

.overlay-view-body {
  padding: 32px 40px 80px;
  max-width: 1480px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

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

/* ── Events view ─────────────────────────────────────── */
.ev-section { margin-bottom: 56px; }

.ev-section-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.ev-section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(24, 24, 27, 0.08);
}
.ev-section-upcoming { color: #b45309; }

.ev-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(390px, 1fr));
  gap: 20px;
}

/* ── Event card ──────────────────────────────────────── */
.ev-card {
  border-radius: 20px;
  background: var(--surface-0);
  box-shadow: 0 2px 16px rgba(24, 24, 27, 0.08), 0 1px 4px rgba(24, 24, 27, 0.04);
  border: 1px solid rgba(24, 24, 27, 0.05);
  display: flex;
  flex-direction: column;
  padding: 22px;
  transition: box-shadow 0.22s, transform 0.22s;
}

.ev-card:hover {
  box-shadow: 0 12px 36px rgba(24, 24, 27, 0.13), 0 2px 8px rgba(24, 24, 27, 0.06);
  transform: translateY(-3px);
}

.ev-card-upcoming {
  border-color: rgba(180, 83, 9, 0.10);
}

.ev-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.ev-type-tag {
  display: inline-flex;
  align-items: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ev-c, #2563eb);
  font-family: ui-monospace, "JetBrains Mono", monospace;
  background: var(--ev-bg, rgba(37, 99, 235, 0.08));
  padding: 4px 9px;
  border-radius: 6px;
}

.ev-upcoming-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #b45309;
  font-family: ui-monospace, "JetBrains Mono", monospace;
  background: rgba(180, 83, 9, 0.08);
  padding: 4px 9px;
  border-radius: 6px;
}

.ev-pulse-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #b45309;
  flex-shrink: 0;
  display: inline-block;
  animation: ev-pulse 2s ease-in-out infinite;
}

@keyframes ev-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.2; } }

.ev-card-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.ev-card-location {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.ev-loc-icon { width: 11px; height: 11px; flex-shrink: 0; opacity: 0.45; }

.ev-card-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 16px;
}

.ev-card-people-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
}

.ev-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--surface-0);
  margin-right: -7px;
  flex-shrink: 0;
  background: rgba(24, 24, 27, 0.07);
}
.ev-avatar-fallback { display: inline-block; }
.ev-avatar-more { font-size: 11px; font-weight: 600; color: var(--text-muted); margin-left: 14px; }

.ev-card-stats {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.ev-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 11px 8px;
  border-radius: 12px;
  background: rgba(24, 24, 27, 0.04);
}

.ev-stat-label {
  font-size: 9px;
  font-weight: 500;
  color: var(--text-faint);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ev-stat-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  text-align: center;
}

.ev-card-cta {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 13px 16px;
  border-radius: 12px;
  background: var(--text-primary);
  color: #fff;
  text-align: center;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: opacity 0.16s;
  margin-top: auto;
}
.ev-card-cta:hover { opacity: 0.84; }

@media (max-width: 840px) {
  .overlay-view-header { padding: 18px 18px 14px; }
  .overlay-view-body { padding: 4px 18px 80px; }
}

/* ── Benefits view ───────────────────────────────────── */
.bv-sponsor-section {
  margin-bottom: 48px;
}

.bv-section-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-family: ui-monospace, "JetBrains Mono", monospace;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.bv-section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(24, 24, 27, 0.08);
}

.bv-section-label-name {
  color: var(--text-secondary);
  font-weight: 700;
}

.bv-benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.bv-benefit-card {
  border-radius: 20px;
  background: var(--surface-0);
  box-shadow: 0 2px 16px rgba(24, 24, 27, 0.08), 0 1px 4px rgba(24, 24, 27, 0.04);
  border: 1px solid rgba(24, 24, 27, 0.05);
  display: flex;
  flex-direction: column;
  padding: 22px;
  transition: box-shadow 0.22s, transform 0.22s;
}

.bv-benefit-card:hover {
  box-shadow: 0 12px 36px rgba(24, 24, 27, 0.12), 0 2px 8px rgba(24, 24, 27, 0.06);
  transform: translateY(-3px);
}

.bv-benefit-card-img {
  width: calc(100% + 44px);
  margin: -22px -22px 18px;
  height: 140px;
  overflow: hidden;
  border-radius: 20px 20px 0 0;
  position: relative;
  background: rgba(24, 24, 27, 0.06);
}

.bv-benefit-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bv-benefit-card-img-label {
  position: absolute;
  bottom: 10px;
  left: 14px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.90);
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  letter-spacing: 0.02em;
}

.bv-benefit-body {
  flex: 1;
  margin-bottom: 16px;
}

.bv-benefit-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}

.bv-benefit-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.65;
}

.bv-benefit-stats {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.bv-benefit-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 8px;
  border-radius: 12px;
  background: rgba(24, 24, 27, 0.04);
}

.bv-stat-label {
  font-size: 9px;
  font-weight: 500;
  color: var(--text-faint);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.bv-stat-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  font-family: ui-monospace, "JetBrains Mono", monospace;
  text-align: center;
}

.bv-benefit-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bv-cta {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 13px 16px;
  border-radius: 12px;
  background: var(--text-primary);
  color: #fff;
  text-align: center;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: opacity 0.16s;
}
.bv-cta:hover { opacity: 0.84; }

.bv-code-chip {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(24, 24, 27, 0.06);
  border: none;
  font-size: 12px;
  font-weight: 600;
  font-family: ui-monospace, "JetBrains Mono", monospace;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: center;
  letter-spacing: 0.03em;
  transition: background 0.14s, color 0.14s;
}
.bv-code-chip:hover {
  background: rgba(24, 24, 27, 0.10);
  color: var(--text-primary);
}

.bv-expiry {
  font-size: 10px;
  color: var(--text-faint);
  font-family: ui-monospace, "JetBrains Mono", monospace;
  text-align: center;
  letter-spacing: 0.04em;
}

.bv-empty-note {
  margin-top: 20px;
  padding: 18px 22px;
  border-radius: 14px;
  border: 1px dashed rgba(24, 24, 27, 0.12);
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bv-empty-count { font-weight: 600; color: var(--text-secondary); }
.bv-empty-hint { font-size: 11px; opacity: 0.65; }
.bv-empty-hint code {
  font-family: monospace;
  background: rgba(24, 24, 27, 0.07);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ── FIL Dost Directory ─────────────────────────────── */
.fd-intro {
  margin-bottom: 32px;
}

.fd-intro-count {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.fd-intro-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 6px;
  max-width: 560px;
  line-height: 1.65;
}

.fd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.fd-card {
  display: flex;
  gap: 15px;
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid rgba(24, 24, 27, 0.09);
  background: var(--surface-0);
  align-items: flex-start;
  transition: border-color 0.18s, box-shadow 0.20s, transform 0.20s;
  cursor: default;
}

.fd-card:hover {
  border-color: rgba(100, 116, 139, 0.22);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(24, 24, 27, 0.09);
}

.fd-photo {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(24, 24, 27, 0.08);
  background: var(--surface-2);
}

.fd-photo-fallback {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(100, 116, 139, 0.10);
  border: 2px solid rgba(100, 116, 139, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--font-heading);
  font-size: 20px;
  color: #64748b;
}

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

.fd-name {
  font-family: var(--font-heading);
  font-size: 15.5px;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fd-title {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.fd-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.fd-badge {
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid;
}

.fd-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 9px;
  transition: color 0.14s;
  text-decoration: none;
}

.fd-link:hover {
  color: #1d4ed8;
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 1180px) {
  :root {
    --panel-w: 320px;
    --sidebar-w: 206px;
  }
  .nav-tab {
    padding: 0 10px;
    font-size: 11px;
  }
}

@media (max-width: 860px) {
  .header-nav {
    display: none;
  }
}

@media (max-width: 980px) {
  :root {
    --panel-w: 290px;
    --sidebar-w: 196px;
  }
}

@media (max-width: 840px) {
  :root {
    --panel-w: 0px;
    --sidebar-w: 0px;
  }

  #sidebar {
    display: none;
  }

  #detail-panel {
    position: fixed;
    top: var(--header-h);
    right: 0;
    bottom: 0;
    z-index: 90;
    width: min(92vw, 380px);
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: none;
    box-shadow: -8px 0 32px rgba(24, 24, 27, 0.10);
  }

  #detail-panel.panel-open {
    transform: translateX(0);
  }

  #panel-overlay.panel-overlay-visible {
    display: block;
  }

  #panel-default {
    display: none;
  }

  #zoom-controls {
    left: 12px;
    bottom: 52px;
  }

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

  .pathfinder-controls,
  .health-grid,
  .health-columns {
    grid-template-columns: 1fr;
  }

  #view-controls {
    right: 12px;
    bottom: 52px;
  }
}

@media (max-width: 640px) {
  #header {
    padding: 0 14px;
  }

  .logo-mark {
    width: 48px;
  }

  .logo-text {
    font-size: 13px;
  }

  #zoom-controls {
    left: auto;
    right: 12px;
    bottom: 44px;
  }

  #legal-note {
    left: 12px;
    bottom: 10px;
    max-width: calc(100% - 74px);
    font-size: 6.8px;
  }
}

@media (max-width: 840px) {
  .bv-benefits-grid { grid-template-columns: 1fr; }
}

/* ── Accessibility ──────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Theme toggle button ────────────────────────────── */
.nav-divider {
  width: 1px;
  height: 18px;
  background: var(--border-strong);
  margin: 0 4px;
  flex-shrink: 0;
}

.theme-toggle {
  display: flex;
  align-items: center;
  padding: 3px;
  gap: 0;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: border-color 0.18s, background 0.18s;
}

.theme-toggle:hover {
  border-color: var(--border-strong);
  background: var(--surface-1);
}

.theme-pill {
  position: absolute;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-0);
  box-shadow: 0 1px 4px rgba(24, 24, 27, 0.14), 0 0 0 1px rgba(24, 24, 27, 0.08);
  transition: left 0.24s cubic-bezier(0.34, 1.56, 0.64, 1);
  left: 3px;
  top: 3px;
  pointer-events: none;
}

html[data-theme="dark"] .theme-pill {
  left: calc(100% - 29px);
  background: rgba(30, 50, 100, 0.95);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.10);
}

.theme-toggle-icon {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  color: var(--text-faint);
  transition: color 0.2s;
  flex-shrink: 0;
}

.theme-toggle-icon svg { width: 13px; height: 13px; }

html[data-theme="light"] .theme-toggle-icon-sun { color: var(--text-secondary); }
html[data-theme="dark"]  .theme-toggle-icon-moon { color: rgba(238, 242, 255, 0.85); }

/* ── Dark theme overrides ──────────────────────────── */
html[data-theme="dark"] {
  --base:           #0d1d42;
  --surface-0:      rgba(16, 32, 76, 0.97);
  --surface-1:      rgba(14, 28, 68, 0.80);
  --surface-2:      rgba(11, 22, 58, 0.97);
  --surface-raised: rgba(18, 35, 82, 0.99);

  --bg-app:         #0d1d42;
  --bg-panel:       rgba(14, 28, 68, 0.97);
  --bg-surface:     rgba(255, 255, 255, 0.055);
  --bg-surface-strong: rgba(255, 255, 255, 0.095);
  --bg-surface-soft:   rgba(255, 255, 255, 0.028);

  --text-primary:   #eef2ff;
  --text-secondary: rgba(238, 242, 255, 0.82);
  --text-muted:     rgba(238, 242, 255, 0.55);
  --text-faint:     rgba(238, 242, 255, 0.35);

  --border:        rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.15);
  --border-accent: rgba(240, 1, 45, 0.35);

  --shadow-soft: 0 2px 12px rgba(0, 0, 0, 0.32);
  --shadow-deep: 0 16px 48px rgba(0, 0, 0, 0.55), 0 4px 12px rgba(0, 0, 0, 0.32);
  --shadow-pop:  0 0 0 1px rgba(255, 255, 255, 0.07), 0 8px 24px rgba(0, 0, 0, 0.44);

  --l-founder:           rgba(255, 95, 121, 0.30);
  --l-f2024:             rgba(25, 142, 255, 0.28);
  --l-f2025:             rgba(105, 187, 255, 0.20);
  --l-f2026:             rgba(154, 215, 255, 0.15);
  --l-friend:            rgba(168, 217, 255, 0.12);
  --l-affiliation:       rgba(255, 255, 255, 0.10);
  --l-works-at:          rgba(255, 255, 255, 0.08);
  --l-sponsor-main:      rgba(77, 127, 255, 0.22);
  --l-sponsor-community: rgba(107, 147, 255, 0.16);
  --l-sponsor-service:   rgba(138, 173, 255, 0.13);
}

html[data-theme="dark"] body {
  background:
    radial-gradient(ellipse 55% 40% at 6% 12%,  rgba(240, 1, 45, 0.15)    0%, transparent 100%),
    radial-gradient(ellipse 60% 44% at 96% 6%,  rgba(25, 142, 255, 0.13)  0%, transparent 100%),
    radial-gradient(ellipse 50% 38% at 72% 88%, rgba(20, 55, 150, 0.20)   0%, transparent 100%),
    linear-gradient(160deg, #0d1d42 0%, #102248 30%, #12286a 60%, #0f2260 100%);
}

html[data-theme="dark"] body::before {
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 42%, rgba(0,0,0,0.4) 20%, transparent 88%);
}

html[data-theme="dark"] #header {
  background: rgba(11, 24, 60, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] #header::after {
  background: linear-gradient(90deg, var(--c-fil) 0%, rgba(240,1,45,0.5) 18%, rgba(25,142,255,0.4) 58%, transparent 100%);
}

html[data-theme="dark"] .logo-mark {
  filter: none;
  opacity: 0.92;
}

html[data-theme="dark"] .logo:hover .logo-mark {
  opacity: 1;
}

html[data-theme="dark"] #sidebar {
  background: rgba(10, 22, 56, 0.98);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  scrollbar-color: rgba(255, 255, 255, 0.10) transparent;
}

html[data-theme="dark"] #sidebar .sidebar-section-label::after {
  background: rgba(255, 255, 255, 0.07);
}

html[data-theme="dark"] #sidebar .chip-count {
  background: rgba(255, 255, 255, 0.07);
}

html[data-theme="dark"] #sidebar .chip.active .chip-count {
  background: rgba(255, 255, 255, 0.14);
}

html[data-theme="dark"] .sidebar-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

html[data-theme="dark"] #canvas-wrap {
  background: transparent;
}

html[data-theme="dark"] #detail-panel {
  background: rgba(10, 22, 56, 0.98);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  scrollbar-color: rgba(255, 255, 255, 0.10) transparent;
}

html[data-theme="dark"] .panel-header {
  background: rgba(10, 22, 58, 0.97);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

html[data-theme="dark"] .panel-close-btn {
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .panel-close-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .node-label {
  fill: rgba(238, 242, 255, 0.72);
}

html[data-theme="dark"] .node-fil .node-label {
  fill: #eef2ff;
}

html[data-theme="dark"] .node-fil_friend .node-label,
html[data-theme="dark"] .node-sponsor_service .node-label,
html[data-theme="dark"] .node-organization .node-label {
  fill: rgba(238, 242, 255, 0.55);
}

html[data-theme="dark"] .node:hover .node-label,
html[data-theme="dark"] .node.highlighted .node-label,
html[data-theme="dark"] .node.skill-match .node-label {
  fill: #ffffff;
}

html[data-theme="dark"] .node.dimmed .node-label {
  fill: rgba(238, 242, 255, 0.20);
}

html[data-theme="dark"] .nodes .node:not(.node-organization) circle.main {
  stroke: rgba(255, 255, 255, 0.15);
}

html[data-theme="dark"] .nodes .node-fil circle.main {
  stroke: rgba(240, 1, 45, 0.45) !important;
}

html[data-theme="dark"] .nodes .node-organization circle.main {
  fill: #0a1628;
}

html[data-theme="dark"] #zoom-controls,
html[data-theme="dark"] #view-controls {
  background: rgba(10, 22, 56, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

html[data-theme="dark"] .zoom-btn,
html[data-theme="dark"] .view-btn {
  color: rgba(238, 242, 255, 0.70);
}

html[data-theme="dark"] .zoom-btn:hover,
html[data-theme="dark"] .view-btn:hover,
html[data-theme="dark"] .view-btn.active {
  background: rgba(255, 255, 255, 0.09);
  color: #eef2ff;
}

html[data-theme="dark"] .view-divider-vertical {
  background: rgba(255, 255, 255, 0.09);
}

html[data-theme="dark"] #legal-note {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: rgba(238, 242, 255, 0.42);
}

html[data-theme="dark"] #legal-note a {
  color: rgba(238, 242, 255, 0.60);
}

html[data-theme="dark"] #panel-overlay {
  background: rgba(0, 0, 0, 0.52);
}

html[data-theme="dark"] #timeline-view,
html[data-theme="dark"] #events-view,
html[data-theme="dark"] #benefits-view {
  background: #0d1d42;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .overlay-view-header,
html[data-theme="dark"] .timeline-header {
  background: rgba(11, 24, 60, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .timeline-card {
  background: rgba(5, 18, 56, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .ev-card {
  background: rgba(5, 18, 56, 0.80);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.30), 0 1px 4px rgba(0, 0, 0, 0.18);
}

html[data-theme="dark"] #search {
  background: rgba(14, 28, 72, 0.80);
  border: 1px solid rgba(255, 255, 255, 0.11);
  color: #eef2ff;
}

html[data-theme="dark"] #search::placeholder {
  color: rgba(238, 242, 255, 0.38);
}

html[data-theme="dark"] #skill-select:focus,
html[data-theme="dark"] #search:focus {
  border-color: rgba(25, 142, 255, 0.40);
  background: rgba(5, 18, 56, 0.90);
  box-shadow: 0 0 0 3px rgba(25, 142, 255, 0.12);
}

html[data-theme="dark"] #skill-select {
  background: rgba(14, 28, 72, 0.80);
  border: 1px solid rgba(255, 255, 255, 0.11);
  color: #eef2ff;
}

html[data-theme="dark"] #tooltip {
  background: rgba(10, 22, 56, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: #eef2ff;
}

html[data-theme="dark"] .theme-toggle {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.13);
}

html[data-theme="dark"] .theme-toggle:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.18);
}

html[data-theme="dark"] .nav-divider {
  background: rgba(255, 255, 255, 0.10);
}

html[data-theme="dark"] .nav-tab {
  color: rgba(238, 242, 255, 0.72);
}

html[data-theme="dark"] .nav-tab:hover,
html[data-theme="dark"] .nav-tab.active {
  color: #eef2ff;
  background: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .nav-tab-ext {
  border: none;
  border-left: 1px solid rgba(255, 255, 255, 0.10);
  background: transparent;
}

html[data-theme="dark"] .chip {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(238, 242, 255, 0.72);
}

html[data-theme="dark"] .chip:hover {
  background: rgba(255, 255, 255, 0.10);
  color: #eef2ff;
}

html[data-theme="dark"] .toolbar-btn {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: rgba(238, 242, 255, 0.70);
}

html[data-theme="dark"] .toolbar-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #eef2ff;
}

html[data-theme="dark"] .node-user-ring {
  stroke: rgba(238, 242, 255, 0.55);
}

html[data-theme="dark"] .chip.active {
  color: #eef2ff;
}

html[data-theme="dark"] .fd-card {
  background: rgba(5, 18, 56, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .fd-card:hover {
  border-color: rgba(100, 116, 139, 0.30);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .fd-photo {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .fd-photo-fallback {
  background: rgba(100, 116, 139, 0.15);
  border-color: rgba(100, 116, 139, 0.22);
  color: #94a3b8;
}

html[data-theme="dark"] .ev-card:hover {
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.44), 0 2px 8px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .ev-section-label::after {
  background: rgba(255, 255, 255, 0.07);
}

html[data-theme="dark"] .ev-avatar {
  border-color: rgba(5, 18, 56, 0.9);
  background: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .ev-stat {
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .ev-card-cta {
  background: rgba(238, 242, 255, 0.90);
  color: #0d1d42;
}

html[data-theme="dark"] .bv-benefit-card {
  background: rgba(5, 18, 56, 0.80);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.30);
}

html[data-theme="dark"] .bv-benefit-card:hover {
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.44);
}

html[data-theme="dark"] .bv-section-label::after {
  background: rgba(255, 255, 255, 0.07);
}

html[data-theme="dark"] .bv-benefit-stat {
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .bv-cta {
  background: rgba(238, 242, 255, 0.90);
  color: #0d1d42;
}

html[data-theme="dark"] .bv-code-chip {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(238, 242, 255, 0.72);
}

html[data-theme="dark"] .bv-code-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(238, 242, 255, 0.95);
}

html[data-theme="dark"] .fd-intro-count {
  color: #eef2ff;
}

html[data-theme="dark"] #events-view,
html[data-theme="dark"] #benefits-view {
  background: #0d1d42;
}
