#variables-explorer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 60px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #e0e0e0;
}

.ve-header {
  margin-bottom: 24px;
}

.ve-subtitle {
  color: #999;
  font-size: 0.95em;
  line-height: 1.5;
  margin: 0;
}
.ve-subtitle a { color: #e94560; text-decoration: none; }
.ve-subtitle a:hover { text-decoration: underline; }

/* Stats cards */
.ve-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.ve-stat-card {
  background: #1a1a2e;
  border: 1px solid #2a2a3e;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}
.ve-stat-number {
  display: block;
  font-size: 1.8em;
  font-weight: 700;
  color: #e94560;
}
.ve-stat-label {
  display: block;
  font-size: 0.8em;
  color: #888;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Controls */
.ve-controls {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.ve-search-wrap { flex: 2; min-width: 200px; }
.ve-filter-wrap { flex: 1; min-width: 150px; }
.ve-sort-wrap { flex: 1; min-width: 150px; }

#ve-search, #ve-category-filter, #ve-sort {
  width: 100%;
  padding: 10px 14px;
  background: #16213e;
  border: 1px solid #2a2a3e;
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 0.9em;
  box-sizing: border-box;
}
#ve-search:focus, #ve-category-filter:focus, #ve-sort:focus {
  outline: none;
  border-color: #e94560;
}
#ve-search::placeholder { color: #666; }

.ve-count {
  font-size: 0.85em;
  color: #888;
  margin-bottom: 8px;
}

/* Table */
.ve-table-wrap {
  overflow-x: auto;
}
.ve-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
}
.ve-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}
.ve-table th {
  background: #16213e;
  color: #aaa;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 0.8em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #2a2a3e;
}
.ve-th-num, .ve-th-cert { text-align: right; width: 70px; }
.ve-th-cat { width: 120px; }

.ve-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #1a1a2e;
}
.ve-table tr { cursor: pointer; transition: background 0.15s; }
.ve-table tbody tr:hover { background: #1a1a2e; }

.ve-var-id {
  font-weight: 600;
  color: #e0e0e0;
  display: block;
}
.ve-var-label {
  font-size: 0.8em;
  color: #888;
}

.ve-cat-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.ve-cat-financial { background: #1b3a4b; color: #4fc3f7; }
.ve-cat-social { background: #3a1b4b; color: #ce93d8; }
.ve-cat-healthcare { background: #1b4b3a; color: #81c784; }
.ve-cat-operational { background: #4b3a1b; color: #ffb74d; }
.ve-cat-environmental { background: #1b4b1b; color: #a5d6a7; }
.ve-cat-government_operations { background: #2e2e4b; color: #9fa8da; }
.ve-cat-energy { background: #4b4b1b; color: #fff176; }
.ve-cat-infrastructure { background: #4b2e1b; color: #ffab91; }
.ve-cat-education { background: #1b2e4b; color: #90caf9; }
.ve-cat-housing { background: #4b1b2e; color: #f48fb1; }
.ve-cat-social_services { background: #2e1b4b; color: #b39ddb; }
.ve-cat-indigenous { background: #4b1b1b; color: #ef9a9a; }
.ve-cat-employment { background: #1b4b4b; color: #80cbc4; }
.ve-cat-uncategorized { background: #2a2a2a; color: #999; }

.ve-num { text-align: right; font-variant-numeric: tabular-nums; }
.ve-num-zero { color: #555; }
.ve-num-high { color: #e94560; font-weight: 600; }

.ve-cert-bar {
  display: inline-block;
  height: 6px;
  border-radius: 3px;
  background: #e94560;
  min-width: 2px;
}
.ve-cert-track {
  display: inline-block;
  width: 50px;
  height: 6px;
  border-radius: 3px;
  background: #2a2a3e;
  margin-right: 6px;
  vertical-align: middle;
}
.ve-cert-value {
  font-size: 0.8em;
  color: #888;
  vertical-align: middle;
}

.ve-loading {
  text-align: center;
  color: #666;
  padding: 40px;
  font-style: italic;
}

/* Detail overlay */
.ve-detail-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  overflow-y: auto;
  padding: 40px 20px;
}
.ve-detail-overlay.active { display: flex; justify-content: center; align-items: flex-start; }

.ve-detail-panel {
  background: #0f0f23;
  border: 1px solid #2a2a3e;
  border-radius: 12px;
  padding: 32px;
  max-width: 900px;
  width: 100%;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.ve-detail-close {
  position: absolute;
  top: 12px; right: 16px;
  background: none;
  border: none;
  color: #888;
  font-size: 1.8em;
  cursor: pointer;
  line-height: 1;
}
.ve-detail-close:hover { color: #e94560; }

.ve-detail-title {
  font-size: 1.4em;
  font-weight: 700;
  margin: 0 0 4px;
}
.ve-detail-varid {
  font-size: 0.9em;
  color: #888;
  font-family: monospace;
  margin-bottom: 16px;
}
.ve-detail-desc {
  color: #aaa;
  margin-bottom: 20px;
  line-height: 1.5;
}

.ve-detail-section {
  margin-bottom: 24px;
}
.ve-detail-section h3 {
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #e94560;
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #2a2a3e;
}

.ve-edge-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.ve-edge-list li {
  padding: 6px 0;
  border-bottom: 1px solid #1a1a2e;
  font-size: 0.9em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ve-edge-var { color: #e0e0e0; cursor: pointer; }
.ve-edge-var:hover { color: #e94560; }
.ve-edge-weight {
  font-size: 0.8em;
  color: #888;
  font-variant-numeric: tabular-nums;
}
.ve-edge-cat {
  font-size: 0.7em;
  color: #666;
  margin-left: 8px;
}

.ve-constraint-card {
  background: #16213e;
  border: 1px solid #2a2a3e;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 8px;
}
.ve-constraint-name { font-weight: 600; color: #e0e0e0; }
.ve-constraint-meta {
  font-size: 0.8em;
  color: #888;
  margin-top: 4px;
}
.ve-constraint-basis {
  font-size: 0.8em;
  color: #666;
  margin-top: 6px;
  font-style: italic;
  line-height: 1.4;
}
.ve-constraint-provisions {
  font-size: 0.75em;
  color: #4fc3f7;
  margin-top: 4px;
}

.ve-no-data {
  color: #555;
  font-style: italic;
  font-size: 0.9em;
}

/* Responsive */
@media (max-width: 768px) {
  .ve-stats { grid-template-columns: repeat(2, 1fr); }
  .ve-controls { flex-direction: column; }
  .ve-th-cert, .ve-table td:last-child { display: none; }
}
