/* Atlas Design System */
:root {
  --bg: #05070b;
  --panel-bg: #0a0f1a;
  --card-bg: #0f1520;
  --card-border: #262c38;
  --accent: #c144d2;
  --accent-soft: #9f6bff;
  --text-main: #ffffff;
  --text-muted: #a6bec8;
  --pill-bg: #1f2933;
  --pill-text: #e5e7eb;
  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.6);
  --radius-lg: 18px;
  --radius-pill: 999px;
  --transition-fast: 160ms ease-out;
  --max-width: 1120px;
}

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

body {
  font-family: "Lexend", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

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

main {
  flex: 1;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 18px 16px;
}

.main-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 18px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Header */
header {
  border-bottom: 1px solid #111827;
  background: radial-gradient(circle at top left, rgba(193, 68, 210, 0.18), transparent 55%);
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(14px);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 20px 10px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
}

.header-row-nav {
  width: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  height: 30px;
  width: auto;
}

.brand-texts,
.brand-labels {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-text-main {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand-text-sub {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-muted);
}

.nav-chip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

.nav-chip-row::-webkit-scrollbar {
  height: 6px;
}

.nav-chip-row::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.4);
  border-radius: 999px;
}

.nav-chip {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--text-main);
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid #1f2937;
  background: #111827;
  transition: border-color var(--transition-fast), background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-chip:hover {
  color: var(--text-main);
  border-color: #4b5563;
  background: #1f2937;
  transform: translateY(-1px);
}

.nav-chip.is-active {
  color: var(--text-main);
  border-color: var(--accent);
  background: rgba(17, 24, 39, 0.9);
  box-shadow: 0 0 0 1px rgba(193, 68, 210, 0.4);
}

.nav-link {
  font-size: 12px;
  color: var(--text-muted);
}

.nav-link strong {
  color: var(--text-main);
}

/* Timelines */
.timeline-body {
  background: radial-gradient(1200px 600px at 20% 0%, #14264b 0%, transparent 60%),
    radial-gradient(900px 500px at 80% 10%, #1a2a5a 0%, transparent 55%),
    #0b1220;
}

.timeline-app {
  max-width: 1200px;
  margin: 22px auto;
  padding: 0 14px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.timeline-header-card {
  gap: 12px;
}

.timeline-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  justify-content: flex-end;
}

.timeline-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 220px;
  flex: 1;
}

.timeline-control-label {
  font-size: 12px;
  color: var(--text-muted);
}

.timeline-controls .btn {
  align-self: flex-end;
}

.timeline-topbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border-radius: 18px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  position: sticky;
  top: 84px;
  z-index: 10;
  backdrop-filter: blur(10px);
  width: 100%;
}

.timeline-brand {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 240px;
}

.timeline-logo {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, #7aa2ff, #b58cff);
  box-shadow: 0 10px 22px rgba(122, 162, 255, 0.25);
}

.timeline-brand h1 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.2px;
  line-height: 1.1;
}

.timeline-brand p {
  margin: 2px 0 0;
  font-size: 12px;
  color: #9bb0d3;
}

.timeline-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.timeline-field {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.timeline-field label {
  font-size: 12px;
  color: #9bb0d3;
  white-space: nowrap;
}

.timeline-field select {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #e8eefc;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 13px;
  outline: none;
  min-width: 190px;
}

.timeline-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #9bb0d3;
  padding: 10px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.timeline-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(122, 162, 255, 0.14);
  color: #e8eefc;
  padding: 10px 12px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 13px;
}

.timeline-btn:active {
  transform: translateY(1px);
}

.timeline-nav {
  gap: 8px;
  padding-left: 4px;
}

.timeline-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  width: 100%;
  position: relative;
}

.timeline-panel-header {
  padding: 14px 16px 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.12);
}

.timeline-titleblock h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0.2px;
}

.timeline-meta {
  margin-top: 6px;
  color: #9bb0d3;
  font-size: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.timeline-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.timeline-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #7aa2ff;
  box-shadow: 0 0 0 6px rgba(122, 162, 255, 0.12);
}

.timeline-legend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  color: #9bb0d3;
  font-size: 12px;
}

.timeline-swatch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.18);
}

.timeline-swatch i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.timeline-wrap {
  position: relative;
  padding: 12px 0 16px;
}

.timeline-scroller {
  overflow: auto;
  padding: 10px 10px 14px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.timeline-canvas {
  position: relative;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.06);
  min-height: 240px;
  /* width set by JS */
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

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

.timeline-year-row {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 44px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: flex-end;
  padding: 10px 10px 8px;
  gap: 10px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0));
}

.timeline-year-row span {
  color: rgba(232, 238, 252, 0.85);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.3px;
}

.timeline-month-line {
  position: absolute;
  top: 44px;
  bottom: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.06);
}

.timeline-year-line {
  position: absolute;
  top: 44px;
  bottom: 0;
  width: 2px;
  width: 2px;
  background: rgba(122, 162, 255, 0.22);
}

.timeline-year-bg {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.015);
  border-left: 1px solid rgba(255, 255, 255, 0.04);
  /* Optional: highlight alternate years lightly or just provide structure */
}

.timeline-year-bg:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

.timeline-year-label {
  position: absolute;
  top: 10px;
  font-size: 11px;
  color: rgba(155, 176, 211, 0.85);
  font-weight: 600;
  pointer-events: none;
}

.timeline-rows {
  position: relative;
  padding-top: 52px;
  padding-bottom: 16px;
}

.timeline-lane {
  position: relative;
  margin: 10px 10px 0;
  padding: 10px 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.timeline-lane-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

.timeline-lane-title strong {
  font-size: 13px;
  letter-spacing: 0.2px;
}

.timeline-lane-title small {
  color: #9bb0d3;
  font-size: 12px;
}

.timeline-bars {
  position: relative;
  min-height: 90px;
}

.timeline-bar {
  position: absolute;
  height: 28px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 10px;
  cursor: pointer;
  overflow: hidden;
  user-select: none;
  color: #e8eefc;
}

.timeline-bar:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.timeline-bar:focus {
  outline: 2px solid rgba(122, 162, 255, 0.7);
  outline-offset: 2px;
}

.timeline-bar .bar-tag {
  font-size: 11px;
  opacity: 0.9;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.12);
  white-space: nowrap;
}

.timeline-bar .bar-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  min-width: 0;
}

.timeline-bar .bar-text b {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline-bar .bar-text span {
  font-size: 11px;
  color: rgba(232, 238, 252, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.9;
}

.timeline-empty {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 24px 28px;
  color: #9bb0d3;
}

.timeline-empty strong {
  color: #e8eefc;
  font-size: 14px;
}

.timeline-footer-note {
  margin-top: 10px;
  color: #9bb0d3;
  font-size: 12px;
  padding: 0 4px;
}

.timeline-tooltip {
  position: absolute;
  z-index: 20;
  pointer-events: none;
  background: rgba(15, 26, 46, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  min-width: 220px;
  max-width: 280px;
  left: 0;
  top: 0;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.timeline-tooltip.show {
  opacity: 1;
  transform: translateY(0);
}

.tooltip-title {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 4px;
}

.tooltip-subtitle {
  color: #9bb0d3;
  font-size: 12px;
  margin-bottom: 6px;
}

.tooltip-meta {
  font-size: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tooltip-pill {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(232, 238, 252, 0.92);
}

.tooltip-topics {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tooltip-topics-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9bb0d3;
}

.tooltip-empty {
  font-size: 12px;
  color: #9bb0d3;
}

.timeline-scroller::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

.timeline-scroller::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  border: 2px solid rgba(0, 0, 0, 0.2);
}

.timeline-scroller::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.12);
}

@media (max-width: 720px) {
  .timeline-brand {
    min-width: auto;
  }

  .timeline-field select {
    min-width: 160px;
  }

  .timeline-legend {
    justify-content: flex-start;
  }

  .timeline-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .timeline-control {
    min-width: unset;
  }
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.badge {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.4);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
}

@media (max-width: 820px) {
  .brand-text-sub {
    display: none;
  }

  .brand-text-main {
    font-size: 15px;
  }

  .header-row-nav .chips-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .header-row-nav .chips-row::-webkit-scrollbar {
    height: 6px;
  }

  .header-row-nav .chips-row::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.4);
    border-radius: 999px;
  }

  .header-row-nav .chip-link {
    flex: 0 0 auto;
  }
}

@media (max-width: 720px) {
  .header-inner {
    padding-inline: 16px;
  }
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.1fr);
  gap: 20px;
  align-items: center;
}

.hero.panel {
  background: radial-gradient(circle at 10% 10%, rgba(193, 68, 210, 0.12), rgba(15, 23, 42, 0.85));
  padding: 20px 18px;
}

.hero-card,
.panel,
.card,
.form-surface {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.hero-card {
  padding: 16px;
  background: radial-gradient(circle at 10% 20%, rgba(193, 68, 210, 0.1), rgba(15, 23, 42, 0.85));
}

.hero-card-title {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 10px;
}

.hero-card-body {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: var(--radius-lg);
  padding: 14px;
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.5;
}

.hero-title {
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: 0.01em;
  margin-bottom: 8px;
}

.hero-highlight {
  color: var(--accent);
}

.hero-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 480px;
  line-height: 1.6;
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.pill {
  font-size: 11px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--pill-bg);
  color: var(--pill-text);
  border: 1px solid rgba(148, 163, 184, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tag-app {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.4);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
}

.tag-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #4ade80;
}

/* Buttons */
.btn {
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(17, 24, 39, 0.9);
  color: var(--text-main);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(120deg, #c144d2, #fda24f);
  border-color: transparent;
  color: #0b0f18;
  font-weight: 600;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(193, 68, 210, 0.6);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(148, 163, 184, 0.25);
  color: var(--text-main);
}

/* Panels and cards */
.panel {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel-title {
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.card-link,
.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  transition: border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.card:hover,
.card-link:hover {
  border-color: rgba(193, 68, 210, 0.5);
  transform: translateY(-1px);
}

.card-title {
  font-size: 18px;
  font-weight: 600;
}

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

.card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.card-link-action {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--accent);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

/* Forms */
.form-surface {
  padding: 12px;
  display: grid;
  gap: 10px;
  border: 1px solid var(--card-border);
}

.form-grid {
  display: grid;
  gap: 12px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.input,
.select,
.search-input,
.select-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--card-border);
  background: #0b1220;
  color: var(--text-main);
}

.search-input {
  flex: 1;
  min-width: 200px;
}

.search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  background: var(--panel-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 12px;
  box-shadow: var(--shadow-soft);
}

.page-title {
  font-size: 22px;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 14px;
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th,
.table td {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid var(--card-border);
}

.table thead th {
  color: var(--text-main);
  font-weight: 600;
}

/* Pagination */
.pagination {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  margin-top: 10px;
  color: var(--text-muted);
}

.page-btn,
.page-current {
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
}

.page-btn {
  border: 1px solid var(--card-border);
  background: var(--panel-bg);
  color: var(--text-main);
}

.page-current {
  background: rgba(193, 68, 210, 0.14);
  border: 1px solid rgba(193, 68, 210, 0.4);
  color: var(--text-main);
}

/* Graph layout */
.layout {
  flex: 1;
  display: flex;
  min-height: calc(100vh - 52px);
}

.graph-area {
  flex: 1 1 auto;
  min-width: 0;
  padding: 12px;
  background: radial-gradient(circle at top left, rgba(193, 68, 210, 0.12), #020617 35%, #000000 100%);
  position: relative;
}

.graph-frame {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: radial-gradient(circle at center, rgba(15, 23, 42, 0.98), #020617);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

#cy {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#topic-graph {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.graph-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(to right, rgba(31, 41, 55, 0.28) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(31, 41, 55, 0.28) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.24;
}

.graph-label {
  position: absolute;
  left: 16px;
  top: 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  z-index: 5;
}

.graph-caption {
  position: absolute;
  left: 16px;
  bottom: 10px;
  font-size: 10px;
  color: var(--text-muted);
  z-index: 5;
}

#side-panel {
  width: 340px;
  max-width: 100%;
  background: var(--panel-bg);
  border-left: 1px solid #111827;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#panel-header {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-muted);
}

#panel-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  margin-top: 2px;
}

#panel-content {
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.5;
}

#panel-content p {
  margin: 4px 0;
}

#panel-content ul {
  margin: 4px 0;
  padding-left: 16px;
}

#panel-content li {
  margin-bottom: 3px;
}

.panel-section {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #111827;
}

.panel-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.filters {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-item input {
  accent-color: #f7931a;
}

.toggle-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.toggle-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle-item input {
  accent-color: var(--accent);
}

#legend {
  margin-top: 6px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  font-size: 10px;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-color {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #374151;
}

.legend-color.central {
  background: #f7931a;
}

.legend-color.persona {
  background: #e8a87c;
}

.legend-color.inst-padre {
  background: #4b5563;
}

.legend-color.topic {
  background: #f59e0b;
}

.legend-color.inst-central {
  background: #a855f7;
}

.legend-color.inst-hija {
  background: #6366f1;
}

.legend-color.personas {
  background: #e8a87c;
}

.legend-color.line {
  border-radius: 2px;
  background: #9aa0a6;
}

.chip-pill,
.person-chip,
.chip-link {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #111827;
  border: 1px solid #1f2937;
  color: var(--text-main);
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, transform 120ms ease;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chip-pill:hover,
.person-chip:hover,
.chip-link:hover {
  background: #1f2937;
  border-color: #4b5563;
  transform: translateY(-1px);
}

#related-people,
#related-institutions,
#people-chips,
#institutions-chips,
.chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chips-row {
  margin-bottom: 6px;
}

#debug {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 320px;
  max-height: 25vh;
  background: rgba(0, 0, 0, 0.85);
  color: #e5e7eb;
  font-size: 11px;
  padding: 4px 8px;
  overflow: auto;
  z-index: 9999;
  white-space: pre-wrap;
}

footer {
  border-top: 1px solid #111827;
  padding: 14px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}

/* Responsive */
@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .layout {
    flex-direction: column;
  }

  .graph-area {
    height: 52vh;
  }

  #side-panel {
    width: 100%;
    border-left: none;
    border-top: 1px solid #111827;
  }

  #debug {
    right: 0;
  }

  #panel-title {
    font-size: 15px;
  }

  #panel-content {
    font-size: 13px;
  }
}

[data-theme="light"] {
  --bg: #f5f7fb;
  --panel-bg: #ffffff;
  --card-bg: #ffffff;
  --card-border: #d8dee8;
  --accent: #c144d2;
  --accent-soft: #a855f7;
  --text-main: #18212f;
  --text-muted: #667085;
  --pill-bg: #eef2f7;
  --pill-text: #344054;
  --shadow-soft: 0 12px 28px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] header {
  border-bottom-color: #e5e7eb;
  background: radial-gradient(circle at top left, rgba(193, 68, 210, 0.12), rgba(255, 255, 255, 0.92) 58%);
}

[data-theme="light"] .hero.panel,
[data-theme="light"] .hero-card {
  background: radial-gradient(circle at 10% 10%, rgba(193, 68, 210, 0.1), rgba(255, 255, 255, 0.96));
}

[data-theme="light"] .hero-card-body,
[data-theme="light"] .btn,
[data-theme="light"] .btn-ghost,
[data-theme="light"] .nav-chip,
[data-theme="light"] .chip-pill,
[data-theme="light"] .person-chip,
[data-theme="light"] .chip-link,
[data-theme="light"] .badge,
[data-theme="light"] .tag-app,
[data-theme="light"] .timeline-field,
[data-theme="light"] .timeline-toggle,
[data-theme="light"] .timeline-chip,
[data-theme="light"] .timeline-swatch,
[data-theme="light"] .tooltip-pill {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .btn:hover,
[data-theme="light"] .nav-chip:hover,
[data-theme="light"] .chip-pill:hover,
[data-theme="light"] .person-chip:hover,
[data-theme="light"] .chip-link:hover {
  background: #f3f4f6;
  border-color: rgba(15, 23, 42, 0.28);
}

[data-theme="light"] .nav-chip.is-active {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 1px rgba(193, 68, 210, 0.22);
}

[data-theme="light"] .timeline-body {
  background: radial-gradient(1200px 600px at 20% 0%, rgba(202, 218, 255, 0.55) 0%, transparent 60%),
    radial-gradient(900px 500px at 80% 10%, rgba(247, 203, 255, 0.4) 0%, transparent 55%),
    #f5f7fb;
}

[data-theme="light"] .timeline-topbar,
[data-theme="light"] .timeline-panel {
  border-color: rgba(15, 23, 42, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.92));
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .timeline-panel-header {
  border-bottom-color: rgba(15, 23, 42, 0.08);
  background: rgba(248, 250, 252, 0.92);
}

[data-theme="light"] .timeline-brand p,
[data-theme="light"] .timeline-field label,
[data-theme="light"] .timeline-meta,
[data-theme="light"] .timeline-legend,
[data-theme="light"] .timeline-lane-title small,
[data-theme="light"] .timeline-empty,
[data-theme="light"] .timeline-footer-note,
[data-theme="light"] .tooltip-subtitle,
[data-theme="light"] .tooltip-topics-title,
[data-theme="light"] .tooltip-empty {
  color: #667085;
}

[data-theme="light"] .timeline-field select,
[data-theme="light"] .input,
[data-theme="light"] .select,
[data-theme="light"] .search-input,
[data-theme="light"] .select-input {
  background: #ffffff;
  color: #18212f;
  border-color: rgba(15, 23, 42, 0.14);
}

[data-theme="light"] .timeline-btn {
  border-color: rgba(122, 162, 255, 0.24);
  background: rgba(122, 162, 255, 0.12);
  color: #18212f;
}

[data-theme="light"] .timeline-canvas,
[data-theme="light"] .timeline-lane {
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.02);
}

[data-theme="light"] .timeline-year-row {
  border-bottom-color: rgba(15, 23, 42, 0.08);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(248, 250, 252, 0));
}

[data-theme="light"] .timeline-year-row span,
[data-theme="light"] .timeline-empty strong,
[data-theme="light"] .tooltip-pill,
[data-theme="light"] .timeline-bar .bar-text span {
  color: #344054;
}

[data-theme="light"] .timeline-month-line {
  background: rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .timeline-year-bg {
  background: rgba(15, 23, 42, 0.015);
  border-left-color: rgba(15, 23, 42, 0.05);
}

[data-theme="light"] .timeline-year-bg:nth-child(even) {
  background: rgba(15, 23, 42, 0.03);
}

[data-theme="light"] .timeline-year-label {
  color: rgba(102, 112, 133, 0.9);
}

[data-theme="light"] .timeline-lane-title {
  border-bottom-color: rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .timeline-bar {
  border-color: rgba(15, 23, 42, 0.1);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.12);
  color: #18212f;
}

[data-theme="light"] .timeline-bar .bar-tag {
  background: rgba(255, 255, 255, 0.5);
  border-color: rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .timeline-tooltip {
  background: rgba(255, 255, 255, 0.97);
  border-color: rgba(15, 23, 42, 0.14);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .timeline-scroller::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.14);
  border-color: rgba(255, 255, 255, 0.6);
}

[data-theme="light"] .timeline-scroller::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.04);
}

[data-theme="light"] .graph-area {
  background: radial-gradient(circle at top left, rgba(193, 68, 210, 0.1), #eef2ff 32%, #f8fafc 100%);
}

[data-theme="light"] .graph-frame {
  border-color: rgba(15, 23, 42, 0.16);
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.98), #f8fafc);
}

[data-theme="light"] .graph-grid {
  background-image: linear-gradient(to right, rgba(148, 163, 184, 0.24) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.24) 1px, transparent 1px);
  opacity: 0.34;
}

[data-theme="light"] #side-panel {
  border-left-color: #e5e7eb;
}

[data-theme="light"] .panel-section,
[data-theme="light"] footer {
  border-top-color: #e5e7eb;
}

[data-theme="light"] #debug {
  background: rgba(255, 255, 255, 0.96);
  color: #344054;
}

@media (max-width: 900px) {
  [data-theme="light"] #side-panel {
    border-top-color: #e5e7eb;
  }
}

/* ========== PROJECT CONTEXT BANNER ========== */
.atlas-project-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  background: rgba(255, 0, 234, 0.06);
  border: 1px solid rgba(255, 0, 234, 0.15);
  font-family: 'Lexend', sans-serif;
  font-size: 13px;
  color: #c9d1d9;
  margin-bottom: 16px;
}
.atlas-project-label {
  font-weight: 500;
  color: #8b949e;
}
.atlas-project-name {
  font-weight: 600;
  color: #FF00EA;
}
.atlas-project-count {
  margin-left: auto;
  font-size: 12px;
  color: #8b949e;
}

[data-theme="light"] .atlas-project-banner {
  background: rgba(255, 0, 234, 0.04);
  border-color: rgba(255, 0, 234, 0.12);
  color: #344054;
}
[data-theme="light"] .atlas-project-label {
  color: #667085;
}
[data-theme="light"] .atlas-project-name {
  color: #9300D3;
}
[data-theme="light"] .atlas-project-count {
  color: #667085;
}

@media (max-width: 640px) {
  .atlas-project-banner {
    flex-wrap: wrap;
  }
  .atlas-project-count {
    margin-left: 0;
    width: 100%;
  }
}

/* ========== KNOWLEDGE PAGE ========== */
.knowledge-page {
  max-width: 920px;
  margin: 0 auto;
}

.knowledge-hero {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  padding: 32px;
}
.knowledge-hero-avatar {
  flex-shrink: 0;
}
.avatar-fallback {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  color: #ffffff;
}
.avatar-fallback--atlas {
  background: #FF00EA;
}
.avatar-fallback--inst {
  background: #7C3AED;
}

.knowledge-hero-info {
  flex: 1;
  min-width: 0;
}
.knowledge-hero-name {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text-primary, #e5e7eb);
}
.knowledge-hero-bio {
  font-size: 14px;
  color: var(--text-secondary, #9ca3af);
  margin: 0 0 8px;
  line-height: 1.6;
}
.knowledge-hero-aliases {
  font-size: 13px;
  color: var(--text-muted, #6b7280);
  margin-bottom: 8px;
}
.alias-label {
  font-weight: 500;
}
.knowledge-hero-meta {
  font-size: 13px;
  color: var(--text-muted, #6b7280);
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.knowledge-hero-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.stat-pill {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(255, 0, 234, 0.08);
  color: #FF00EA;
  font-weight: 500;
}

/* Knowledge sections */
.knowledge-section {
  margin-top: 16px;
  padding: 24px;
}
.knowledge-subtitle {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary, #e5e7eb);
  margin: 24px 0 12px;
}
.section-footer {
  margin-top: 12px;
}

/* Compact graph frame */
.graph-frame--compact {
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}
.graph-frame--compact #cy {
  height: 360px;
}

/* Timeline */
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.timeline-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #FF00EA;
  margin-top: 5px;
  flex-shrink: 0;
}
.timeline-dot--current {
  box-shadow: 0 0 0 3px rgba(255, 0, 234, 0.25);
}
.timeline-dot--party {
  background: #7C3AED;
}
.timeline-content {
  flex: 1;
  min-width: 0;
}
.timeline-role {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary, #e5e7eb);
}
.timeline-org {
  font-size: 13px;
  color: var(--text-secondary, #9ca3af);
}
.timeline-dates {
  font-size: 12px;
  color: var(--text-muted, #6b7280);
}
.timeline-period {
  font-size: 12px;
  color: var(--text-muted, #6b7280);
  font-style: italic;
}

/* Keywords */
.keyword-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.keyword-chip {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(255, 0, 234, 0.06);
  color: var(--text-primary, #e5e7eb);
  border: 1px solid rgba(255, 0, 234, 0.12);
}

/* Story card */
.card--story {
  display: block;
  margin-bottom: 12px;
}

/* Badges */
.badge--ready {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(31, 221, 141, 0.1);
  color: #1FDD8D;
  font-weight: 500;
}

/* Empty state */
.empty-state {
  font-size: 13px;
  color: var(--text-muted, #6b7280);
  font-style: italic;
  padding: 16px 0;
}

/* Button size variant */
.btn-sm {
  font-size: 12px;
  padding: 6px 12px;
}

/* Light theme overrides */
[data-theme="light"] .knowledge-hero-name {
  color: #111827;
}
[data-theme="light"] .knowledge-hero-bio {
  color: #4b5563;
}
[data-theme="light"] .knowledge-hero-aliases {
  color: #6b7280;
}
[data-theme="light"] .knowledge-hero-meta {
  color: #6b7280;
}
[data-theme="light"] .stat-pill {
  background: rgba(147, 0, 211, 0.08);
  color: #9300D3;
}
[data-theme="light"] .timeline-dot {
  background: #9300D3;
}
[data-theme="light"] .timeline-dot--party {
  background: #7C3AED;
}
[data-theme="light"] .timeline-role {
  color: #111827;
}
[data-theme="light"] .timeline-org {
  color: #4b5563;
}
[data-theme="light"] .timeline-dates,
[data-theme="light"] .timeline-period {
  color: #6b7280;
}
[data-theme="light"] .knowledge-subtitle {
  color: #111827;
}
[data-theme="light"] .keyword-chip {
  background: rgba(147, 0, 211, 0.05);
  color: #374151;
  border-color: rgba(147, 0, 211, 0.15);
}
[data-theme="light"] .badge--ready {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}
[data-theme="light"] .empty-state {
  color: #9ca3af;
}
[data-theme="light"] .avatar-fallback--atlas {
  background: #9300D3;
}
[data-theme="light"] .avatar-fallback--inst {
  background: #7C3AED;
}

/* Responsive */
@media (max-width: 640px) {
  .knowledge-hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 16px;
  }
  .knowledge-hero-stats {
    justify-content: center;
  }
  .knowledge-hero-meta {
    justify-content: center;
  }
  .graph-frame--compact #cy {
    height: 260px;
  }
}

/* ========== ORGCHART ========== */
.orgchart {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 16px 0;
}
.orgchart-ancestors {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.orgchart-connector {
  width: 2px;
  height: 16px;
  background: rgba(255, 0, 234, 0.2);
}
.orgchart-connector--short {
  height: 10px;
}
.orgchart-children {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}
.orgchart-branch {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.orgchart-grandchildren {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.orgchart-node {
  padding: 10px 16px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid rgba(255, 0, 234, 0.15);
  font-size: 13px;
  max-width: 200px;
}
.orgchart-node a {
  text-decoration: none;
  color: #FF00EA;
  font-weight: 500;
}
.orgchart-node a:hover {
  text-decoration: underline;
}
.orgchart-node--central {
  border-width: 2px;
  border-color: #FF00EA;
  font-weight: 700;
  font-size: 14px;
  background: rgba(255, 0, 234, 0.04);
}
.orgchart-node--ancestor {
  background: rgba(255, 0, 234, 0.04);
  font-size: 12px;
}
.orgchart-node--child {
  background: rgba(255, 0, 234, 0.06);
}
.orgchart-node--grandchild {
  background: rgba(255, 0, 234, 0.03);
  font-size: 12px;
  padding: 6px 12px;
}
.orgchart-meta {
  display: block;
  font-size: 11px;
  color: var(--text-muted, #6b7280);
  margin-top: 4px;
  font-weight: 400;
}

/* Breadcrumb institucional */
.breadcrumb-inst {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.breadcrumb-inst a {
  color: #FF00EA;
  text-decoration: none;
}
.breadcrumb-inst a:hover {
  text-decoration: underline;
}
.breadcrumb-sep {
  color: var(--text-muted, #6b7280);
}
.breadcrumb-current {
  color: var(--text-primary, #e5e7eb);
  font-weight: 600;
}

/* Badge tipo institución */
.badge--tipo {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(124, 58, 237, 0.1);
  color: #7C3AED;
  font-weight: 500;
}

/* Cargos list */
.cargos-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cargo-card {
  display: block;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 0, 234, 0.1);
  text-decoration: none;
  transition: background .15s;
}
.cargo-card:hover {
  background: rgba(255, 0, 234, 0.04);
}
.cargo-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary, #e5e7eb);
}
.cargo-person {
  font-size: 13px;
  color: #FF00EA;
}
.cargo-period {
  font-size: 12px;
  color: var(--text-muted, #6b7280);
}

/* Stat pill variant for institutions */
.stat-pill--inst {
  background: rgba(124, 58, 237, 0.08);
  color: #7C3AED;
}

/* Light theme overrides for orgchart/institution */
[data-theme="light"] .orgchart-connector {
  background: rgba(147, 0, 211, 0.2);
}
[data-theme="light"] .orgchart-node {
  border-color: rgba(147, 0, 211, 0.15);
}
[data-theme="light"] .orgchart-node a {
  color: #9300D3;
}
[data-theme="light"] .orgchart-node--central {
  border-color: #9300D3;
  background: rgba(147, 0, 211, 0.04);
}
[data-theme="light"] .orgchart-node--ancestor {
  background: rgba(147, 0, 211, 0.04);
}
[data-theme="light"] .orgchart-node--child {
  background: rgba(147, 0, 211, 0.06);
}
[data-theme="light"] .orgchart-node--grandchild {
  background: rgba(147, 0, 211, 0.03);
}
[data-theme="light"] .orgchart-meta {
  color: #6b7280;
}
[data-theme="light"] .breadcrumb-inst a {
  color: #9300D3;
}
[data-theme="light"] .breadcrumb-current {
  color: #111827;
}
[data-theme="light"] .breadcrumb-sep {
  color: #9ca3af;
}
[data-theme="light"] .badge--tipo {
  background: rgba(124, 58, 237, 0.1);
  color: #6d28d9;
}
[data-theme="light"] .cargo-card {
  border-color: rgba(147, 0, 211, 0.12);
}
[data-theme="light"] .cargo-card:hover {
  background: rgba(147, 0, 211, 0.04);
}
[data-theme="light"] .cargo-name {
  color: #111827;
}
[data-theme="light"] .cargo-person {
  color: #9300D3;
}
[data-theme="light"] .cargo-period {
  color: #6b7280;
}
[data-theme="light"] .stat-pill--inst {
  background: rgba(124, 58, 237, 0.08);
  color: #6d28d9;
}

/* Responsive orgchart */
@media (max-width: 640px) {
  .orgchart-children {
    flex-direction: column;
    align-items: center;
  }
  .orgchart-node {
    max-width: 260px;
    width: 100%;
  }
}

/* Mention cards */
.card--mention {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  margin-bottom: 10px;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.card--mention:hover {
  border-color: var(--accent);
  background: rgba(193, 68, 210, 0.04);
}
.card--mention .card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
  line-height: 1.35;
}
.card--mention .card-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  line-height: 1.4;
}
.card--mention .card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.card--mention .card-labels {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.keyword-chip--sm {
  font-size: 10px;
  padding: 2px 6px;
}

/* Sentiment badges */
.badge--sentiment {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}
.badge--positivo {
  background: rgba(29, 221, 141, 0.15);
  color: #1FDD8D;
}
.badge--neutro {
  background: rgba(156, 163, 175, 0.15);
  color: #9CA3AF;
}
.badge--negativo {
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
}

[data-theme="light"] .card--mention {
  background: #ffffff;
  border-color: #e5e7eb;
}
[data-theme="light"] .card--mention:hover {
  border-color: #9300D3;
  background: rgba(147, 0, 211, 0.03);
}
[data-theme="light"] .card--mention .card-title {
  color: #111827;
}
[data-theme="light"] .card--mention .card-desc {
  color: #6b7280;
}
[data-theme="light"] .badge--positivo {
  background: rgba(29, 221, 141, 0.12);
  color: #059669;
}
[data-theme="light"] .badge--neutro {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
}
[data-theme="light"] .badge--negativo {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

/* Graph status badge */
.graph-status {
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px 12px;
  margin-bottom: 8px;
  border-radius: 8px;
  background: var(--pill-bg);
}
[data-theme="light"] .graph-status {
  background: #f3f4f6;
  color: #6b7280;
}

/* Mini-timeline Gantt */
.mini-timeline {
  margin-top: 14px;
  padding: 8px 0;
  overflow-x: auto;
  border-top: 1px solid var(--card-border);
}
.mini-timeline-header {
  position: relative;
  height: 20px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--card-border);
}
.mini-timeline-year {
  position: absolute;
  font-size: 10px;
  color: var(--text-muted);
  transform: translateX(-50%);
}
.mini-timeline-rows {
  position: relative;
  margin-left: 140px;
  height: auto;
}
.mini-timeline-label {
  position: absolute;
  left: -140px;
  width: 132px;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 22px;
}
.mini-timeline-bar {
  position: absolute;
  height: 18px;
  border-radius: 4px;
  min-width: 6px;
  transition: opacity var(--transition-fast);
}
.mini-timeline-bar:hover {
  opacity: 0.8;
}
.mini-timeline-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 10px;
  color: var(--text-muted);
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  display: inline-block;
}
.legend-dot--federal { background: #3b82f6; }
.legend-dot--estatal { background: #22c55e; }
.legend-dot--municipal { background: #eab308; }
.legend-dot--partidista { background: #a855f7; }
.legend-dot--otro { background: #6b7280; }

[data-theme="light"] .mini-timeline {
  border-top-color: #e5e7eb;
}
[data-theme="light"] .mini-timeline-header {
  border-bottom-color: #e5e7eb;
}
[data-theme="light"] .mini-timeline-year {
  color: #9ca3af;
}
[data-theme="light"] .mini-timeline-label {
  color: #6b7280;
}
[data-theme="light"] .mini-timeline-legend {
  color: #9ca3af;
}
