.constitutional-dashboard {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #e0e0e0;
}

.constitutional-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.constitutional-header h2 {
  color: #f0c040;
  font-size: 1.8rem;
  margin-bottom: 0.3rem;
}

.constitutional-subtitle {
  color: #999;
  font-size: 0.95rem;
}

.constitutional-subtitle span {
  color: #f0c040;
  font-weight: bold;
}

/* Tabs */
.constitutional-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #333;
  margin-bottom: 1rem;
}

.tab-btn {
  padding: 0.6rem 1.2rem;
  background: #1a1a2e;
  color: #999;
  border: 1px solid #333;
  border-bottom: none;
  cursor: pointer;
  font-size: 0.95rem;
  border-radius: 6px 6px 0 0;
  transition: all 0.2s;
}

.tab-btn:hover { color: #e0e0e0; background: #252540; }
.tab-btn.active { color: #f0c040; background: #252540; border-color: #f0c040; }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Graph */
.graph-controls {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  background: #1a1a2e;
  border-radius: 6px;
}

.graph-controls label { color: #999; font-size: 0.85rem; }
.graph-controls select { background: #252540; color: #e0e0e0; border: 1px solid #444; padding: 0.3rem; border-radius: 4px; }

#graph-container {
  width: 100%;
  height: 550px;
  background: #0d0d1a;
  border: 1px solid #333;
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}

#graph-container svg { width: 100%; height: 100%; }

.graph-tooltip {
  display: none;
  position: absolute;
  background: #1a1a2e;
  border: 1px solid #f0c040;
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  font-size: 0.85rem;
  color: #e0e0e0;
  max-width: 300px;
  pointer-events: none;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.graph-tooltip strong { color: #f0c040; }

/* Scoreboard */
.scoreboard-controls {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  background: #1a1a2e;
  border-radius: 6px;
}

.scoreboard-controls label { color: #999; font-size: 0.85rem; }
.scoreboard-controls select,
.scoreboard-controls input[type="range"] { background: #252540; color: #e0e0e0; border: 1px solid #444; border-radius: 4px; }

.scoreboard {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.scoreboard th {
  background: #1a1a2e;
  color: #f0c040;
  padding: 0.5rem;
  text-align: left;
  border-bottom: 2px solid #333;
  position: sticky;
  top: 0;
}

.scoreboard td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid #222;
}

.scoreboard tr:hover { background: #1a1a2e; }

.score-bar {
  display: inline-block;
  height: 10px;
  border-radius: 3px;
  margin-right: 0.5rem;
  vertical-align: middle;
}

.dim-tag {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  margin: 0.1rem;
  border-radius: 3px;
  font-size: 0.75rem;
  background: #252540;
  color: #999;
}

.dim-tag.jurisdictional_scope { border-left: 3px solid #4a90d9; }
.dim-tag.paramountcy_charter { border-left: 3px solid #e74c3c; }
.dim-tag.rights_process { border-left: 3px solid #2ecc71; }
.dim-tag.fiscal_fidelity { border-left: 3px solid #f39c12; }
.dim-tag.indigenous_rights { border-left: 3px solid #9b59b6; }
.dim-tag.language_rights { border-left: 3px solid #1abc9c; }

/* Detail */
.detail-select { margin-bottom: 1rem; }
.detail-select select { background: #252540; color: #e0e0e0; border: 1px solid #444; padding: 0.4rem; border-radius: 4px; min-width: 300px; }

.doctrine-detail { min-height: 300px; }

.doctrine-card {
  background: #1a1a2e;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 1.2rem;
  margin-bottom: 1rem;
}

.doctrine-card h3 { color: #f0c040; margin: 0 0 0.5rem 0; }
.doctrine-card .meta { color: #888; font-size: 0.85rem; margin-bottom: 0.8rem; }
.doctrine-card .text-basis { color: #ccc; font-size: 0.9rem; line-height: 1.5; margin-bottom: 1rem; border-left: 3px solid #f0c040; padding-left: 0.8rem; }

.doctrine-card .section-title { color: #f0c040; font-size: 0.95rem; margin: 1rem 0 0.4rem 0; font-weight: bold; }

.var-list, .topic-list { list-style: none; padding: 0; margin: 0; }
.var-list li, .topic-list li {
  padding: 0.3rem 0;
  border-bottom: 1px solid #222;
  font-size: 0.85rem;
}
.var-list li:last-child, .topic-list li:last-child { border-bottom: none; }

.severity-badge {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: bold;
}

.severity-high { background: #7d2020; color: #ff6b6b; }
.severity-medium { background: #6b5a1e; color: #f0c040; }
.severity-low { background: #1e4d2e; color: #6bff8b; }

/* Certainty badges */
.certainty-badge {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: bold;
  cursor: help;
}

.certainty-high { background: #1e4d2e; color: #6bff8b; }
.certainty-medium { background: #6b5a1e; color: #f0c040; }
.certainty-low { background: #7d2020; color: #ff6b6b; }

/* Provisions list */
.provisions-list { margin: 0; padding: 0; }

.provision-item {
  padding: 0.6rem;
  margin-bottom: 0.4rem;
  background: #0d0d1a;
  border: 1px solid #333;
  border-radius: 4px;
}

.provision-header { margin-bottom: 0.3rem; font-size: 0.9rem; }
.provision-header strong { color: #f0c040; }
.provision-act { color: #666; font-size: 0.8rem; margin-left: 0.5rem; }
.provision-text { color: #aaa; font-size: 0.82rem; line-height: 1.4; border-left: 2px solid #444; padding-left: 0.6rem; }

/* Relationship type badges */
.rel-badge {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: bold;
  text-transform: uppercase;
  margin-right: 0.3rem;
}

.rel-primary { background: #1e3a5f; color: #4a90d9; }
.rel-supporting { background: #3a2e1e; color: #e67e22; }

/* Case list */
.case-list { margin: 0; padding: 0; }

.case-item {
  padding: 0.5rem;
  margin-bottom: 0.3rem;
  border-bottom: 1px solid #222;
}

.case-item:last-child { border-bottom: none; }
.case-header { font-size: 0.9rem; margin-bottom: 0.2rem; }
.case-header strong { color: #e0e0e0; }
.case-meta { color: #888; font-size: 0.8rem; }
.case-significance { color: #aaa; font-size: 0.82rem; margin-top: 0.2rem; }

.case-status {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: bold;
  text-transform: uppercase;
  margin-left: 0.3rem;
}

.status-good { background: #1e4d2e; color: #6bff8b; }
.status-modified { background: #6b5a1e; color: #f0c040; }
.status-overruled { background: #7d2020; color: #ff6b6b; }

/* Node colors for D3 graph */
.node-core { fill: #f0c040; }
.node-judge_text_aligned { fill: #4a90d9; }
.node-judge_ultra_vires { fill: #e74c3c; }
.node-jurisdictional_overreach { fill: #e67e22; }
.node-modern_shift { fill: #2ecc71; }
.node-domain { fill: #666; }
