/* ========================================
   RETRAITES CALCULATOR - MAIN STYLES
   ========================================
   Organized CSS structure for the French retirement calculator
   Sections: Base, Layout, Components, Charts, Sources, Equity, Dark Mode
   ======================================== */

/* ========================================
   BASE STYLES
   ======================================== */

body {
  font-family: "Georgia", serif;
  background: #f4e8d1;
  color: #2c1810;
  margin: 0;
  padding: 10px;
  font-size: 14px;
}

h1 {
  text-align: center;
  color: #8b0000;
  border-bottom: 1px solid #8b0000;
  padding-bottom: 5px;
  margin-bottom: 10px;
  font-size: 18px;
}

/* ========================================
   FORM AND INPUT STYLES
   ======================================== */

form {
  max-width: 530px;
  margin: 0 auto;
  background: #fff;
  padding: 10px;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

label {
  display: block;
  margin: 5px 0 2px;
  font-weight: bold;
  font-size: 12px;
}

input,
select {
  width: 100%;
  padding: 4px;
  margin-bottom: 5px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 14px;
}

input:focus,
select:focus {
  outline: none;
  box-shadow: 0 0 5px rgba(139, 0, 0, 0.3);
}

/* ========================================
   RESULTS SECTION
   ======================================== */

#results {
  max-width: 600px;
  margin: 10px auto 0;
  padding: 15px;
  background: #f9f5e7;
  border-radius: 5px;
  font-size: 12px;
}

.result-item {
  margin: 5px 0;
  padding: 5px;
  background: #f9f9f9;
  border-left: 3px solid #8b0000;
  font-size: 11px;
}

.warning {
  color: #8b0000;
  font-style: italic;
  text-align: center;
  font-size: 11px;
  margin: 5px 0;
}

/* ========================================
   MAIN COMPARISON TABLE
   ======================================== */

.main-comparison-table {
  background: white;
  border-radius: 8px;
  padding: 20px;
  border: 1px solid #ddd;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.main-comparison-table h3 {
  text-align: center;
  color: #8b0000;
  margin-bottom: 20px;
  font-size: 16px;
  border-bottom: 2px solid #8b0000;
  padding-bottom: 10px;
}

.main-comparison-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.main-comparison-table th {
  background: #f8f8f8;
  padding: 12px 8px;
  border: 1px solid #ddd;
  font-weight: bold;
  text-align: center;
  color: #333;
}

.main-comparison-table td {
  padding: 10px 8px;
  border: 1px solid #ddd;
  text-align: center;
}

.regime-header {
  font-weight: bold;
  font-size: 13px;
  padding: 12px 8px !important;
  background: #f5f5f5 !important;
  color: #333 !important;
  border-left: 3px solid #8b0000 !important;
}

.metric-primary {
  background: #f0f0f0 !important;
  font-weight: bold;
}

.metric-secondary {
  background: #f8f8f8 !important;
}

.best-value {
  background: #e8f5e8 !important;
  font-weight: bold;
  color: #2e7d32;
}

.worst-value {
  background: #ffebee !important;
  font-weight: bold;
  color: #c62828;
}

/* ========================================
   REGIME DETAIL CARDS
   ======================================== */

.regime-details {
  margin-top: 15px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 15px;
}

.regime-detail-card {
  background: white;
  border-radius: 5px;
  padding: 15px;
  border: 1px solid #ddd;
  font-size: 11px;
}

.regime-detail-card h4 {
  margin: 0 0 10px 0;
  font-size: 12px;
  text-align: center;
  padding: 8px;
  border-radius: 3px;
}

.regime-detail-card .description {
  font-size: 10px;
  color: #666;
  text-align: center;
  line-height: 1.3;
}

.regime-detail-card.prive h4 {
  background: #e3f2fd;
  color: #1976d2;
}

.regime-detail-card.public h4 {
  background: #f3e5f5;
  color: #7b1fa2;
}

.regime-detail-card.special h4 {
  background: #fff3e0;
  color: #f57c00;
}

/* ========================================
   CHARTS AND VISUALIZATION
   ======================================== */

.chart-container {
  background: white;
  border-radius: 8px;
  padding: 20px;
  border: 1px solid #ddd;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.chart-title {
  text-align: center;
  color: #8b0000;
  margin-bottom: 20px;
  font-size: 16px;
  border-bottom: 2px solid #8b0000;
  padding-bottom: 10px;
}

.chart-row {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  font-size: 12px;
}

.chart-label {
  width: 120px;
  font-weight: bold;
  text-align: right;
  padding-right: 15px;
}

.chart-bar-container {
  flex: 1;
  height: 24px;
  background: #f0f0f0;
  border-radius: 12px;
  position: relative;
  margin-right: 10px;
}

.chart-bar {
  height: 100%;
  border-radius: 12px;
  transition: width 0.3s ease;
  position: relative;
}

.chart-bar.prive {
  background: linear-gradient(90deg, #2196f3, #64b5f6);
}

.chart-bar.public {
  background: linear-gradient(90deg, #9c27b0, #ba68c8);
}

.chart-bar.special {
  background: linear-gradient(90deg, #ff9800, #ffb74d);
}

.chart-value {
  width: 60px;
  text-align: left;
  font-weight: bold;
  color: #333;
}

.section-title {
  color: #8b0000;
  font-size: 13px;
  margin-bottom: 10px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 5px;
}

.section-title.margin-top {
  margin-top: 20px;
}

/* ========================================
   SOURCES SECTION
   ======================================== */

#sources {
  max-width: 540px;
  margin: 0 auto 10px;
  margin-top: 20px;
  font-size: 11px;
  background: linear-gradient(135deg, #f5e3e2 0%, #f0d8d7 100%);
  border-radius: 8px;
  padding: 15px 20px;
  border: 1px solid #e0c5c4;
  box-shadow: 0 2px 6px rgba(139, 0, 0, 0.08);
}

#sources strong {
  color: #8b0000;
  font-size: 12px;
  display: block;
  margin-bottom: 8px;
  border-bottom: 1px solid #e0c5c4;
  padding-bottom: 4px;
}

#sources ul {
  margin: 8px 0 12px 0;
  padding: 0;
  list-style: none;
}

#sources li {
  margin: 6px 0;
  padding: 6px 0 6px 20px;
  position: relative;
  border-left: 2px solid transparent;
  transition: all 0.2s ease;
}

#sources li:hover {
  border-left-color: #8b0000;
  background: rgba(255, 255, 255, 0.5);
  padding-left: 24px;
}

#sources li::before {
  content: "📄";
  position: absolute;
  left: 0;
  top: 6px;
  font-size: 10px;
}

#sources a {
  color: #5d4037;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

#sources a:hover {
  color: #8b0000;
  text-decoration: underline;
}

#sources a:visited {
  color: #6d4c41;
}

#sources p {
  margin: 8px 0 0 0;
  font-style: italic;
  color: #795548;
  font-size: 10px;
  text-align: center;
  padding-top: 8px;
  border-top: 1px solid #e8d1d0;
}

/* ========================================
   INTER-REGIME EQUITY SECTION
   ======================================== */

#inter-regime-equity {
  max-width: 1200px;
  margin: 20px auto 0;
  padding: 20px;
  background: #f9f5e7;
  border-radius: 8px;
  font-size: 12px;
  border: 1px solid #ddd;
}

.inter-regime-container {
  background: white;
  border-radius: 8px;
  padding: 20px;
  border: 1px solid #ddd;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.convergence-selector {
  background: #e8f4fd;
  border: 1px solid #b3d9f2;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  text-align: center;
}

.convergence-selector label {
  display: inline-block;
  font-weight: bold;
  font-size: 12px;
  margin-right: 10px;
  color: #1976d2;
}

.convergence-selector select {
  display: inline-block;
  width: auto;
  min-width: 300px;
  padding: 6px 12px;
  font-size: 12px;
  border: 1px solid #b3d9f2;
  border-radius: 4px;
  background: white;
}

.convergence-selector small {
  display: block;
  margin-top: 8px;
  font-size: 10px;
  color: #666;
  font-style: italic;
}

.equity-metrics-summary {
  margin-bottom: 25px;
}

.equity-metrics-summary h4 {
  color: #8b0000;
  margin-bottom: 15px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 5px;
  font-size: 14px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 15px;
  margin-bottom: 20px;
}

.metric-card {
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 12px;
}

.metric-card h5 {
  color: #333;
  margin: 0 0 10px 0;
  font-size: 11px;
  text-align: center;
  border-bottom: 1px solid #ddd;
  padding-bottom: 5px;
}

.metric-values {
  font-size: 10px;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  margin: 5px 0;
  padding: 3px 0;
}

.metric-row span {
  color: #666;
}

.metric-row strong {
  color: #333;
}

.good-equity {
  color: #2e7d32 !important;
  font-weight: bold;
}

.medium-equity {
  color: #f57c00 !important;
  font-weight: bold;
}

.poor-equity {
  color: #c62828 !important;
  font-weight: bold;
}

.regime-comparison-bars {
  margin-top: 20px;
}

.regime-comparison-bars h5 {
  color: #333;
  margin-bottom: 15px;
  font-size: 12px;
  text-align: center;
}

.regime-bar-row {
  margin-bottom: 12px;
}

.regime-bar-label {
  font-size: 11px;
  font-weight: bold;
  margin-bottom: 4px;
  color: #333;
}

.regime-bar-container {
  background: #f0f0f0;
  border-radius: 4px;
  padding: 2px;
  min-height: 44px;
}

.regime-bar {
  height: 18px;
  border-radius: 3px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  margin-bottom: 2px;
}

.regime-bar.vous-bar.prive {
  background: linear-gradient(90deg, #2196f3, #64b5f6);
}

.regime-bar.vous-bar.public {
  background: linear-gradient(90deg, #9c27b0, #ba68c8);
}

.regime-bar.vous-bar.special {
  background: linear-gradient(90deg, #ff9800, #ffb74d);
}

.regime-bar.boomer-bar.prive {
  background: linear-gradient(90deg, #1976d2, #42a5f5);
}

.regime-bar.boomer-bar.public {
  background: linear-gradient(90deg, #7b1fa2, #ab47bc);
}

.regime-bar.boomer-bar.special {
  background: linear-gradient(90deg, #f57c00, #ffa726);
}

.bar-value {
  color: white;
  font-size: 9px;
  font-weight: bold;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
}

.bar-legend {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 15px;
  font-size: 10px;
  flex-wrap: wrap;
}

.legend-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.legend-section h6 {
  margin: 0 0 5px 0;
  font-size: 10px;
  font-weight: bold;
  color: #333;
  text-decoration: underline;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 2px 0;
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  border: 1px solid #ddd;
}

.legend-color.prive-regime {
  background: linear-gradient(90deg, #2196f3, #64b5f6);
}

.legend-color.public-regime {
  background: linear-gradient(90deg, #9c27b0, #ba68c8);
}

.legend-color.special-regime {
  background: linear-gradient(90deg, #ff9800, #ffb74d);
}

.legend-color.generation-vous {
  background: #888;
  opacity: 1;
}

.legend-color.generation-boomer {
  background: #888;
  opacity: 0.7;
}

.convergence-scenarios {
  margin: 25px 0;
}

.convergence-scenarios h4 {
  color: #8b0000;
  margin-bottom: 15px;
  border-bottom: 2px solid #8b0000;
  padding-bottom: 5px;
  font-size: 14px;
}

.convergence-target-info {
  background: #e8f5e8;
  border: 1px solid #c8e6c9;
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 15px;
  text-align: center;
  font-size: 11px;
}

.target-ratio {
  color: #2e7d32;
  font-weight: bold;
  font-size: 12px;
}

.convergence-table-container {
  overflow-x: auto;
  margin: 20px 0;
  border-radius: 8px;
}

.convergence-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.convergence-table th {
  background: #f5f5f5;
  color: #333;
  padding: 8px 6px;
  text-align: center;
  font-size: 9px;
  font-weight: 600;
  border: 1px solid #ddd;
  white-space: nowrap;
}

.convergence-table thead tr:first-child th {
  background: #e9e9e9;
  font-size: 10px;
  font-weight: 700;
  padding: 10px 8px;
  color: #222;
}

.convergence-table td {
  padding: 8px 6px;
  text-align: center;
  border: 1px solid #ddd;
  font-size: 9px;
  line-height: 1.3;
}

.convergence-table .regime-name {
  background: #f8f8f8;
  font-weight: bold;
  text-align: left;
  padding-left: 10px;
  min-width: 120px;
}

.convergence-table .current-ratio {
  background: #fff3cd;
  font-weight: bold;
}

.convergence-table .target-ratio {
  background: #e8f5e8;
  font-weight: bold;
  color: #2e7d32;
}

.convergence-table .positive-adj {
  background: #ffebee;
  color: #c62828;
  font-weight: bold;
}

.convergence-table .negative-adj {
  background: #e8f5e8;
  color: #2e7d32;
  font-weight: bold;
}

.convergence-table .lever-cell {
  font-size: 9px;
  line-height: 1.2;
}

.convergence-table .lever-cell small {
  font-size: 8px;
  color: #666;
  font-style: italic;
  display: block;
}

.feasibility-score {
  padding: 5px !important;
}

.score-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  font-size: 8px;
  font-weight: bold;
  color: white;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3);
}

.score-circle.high-score {
  background: linear-gradient(135deg, #4caf50, #66bb6a);
}

.score-circle.medium-score {
  background: linear-gradient(135deg, #ff9800, #ffb74d);
}

.score-circle.low-score {
  background: linear-gradient(135deg, #f44336, #ef5350);
}

.convergence-impact {
  background: #f0f8ff;
  border: 1px solid #b3d9f2;
  border-radius: 6px;
  padding: 15px;
  margin-top: 20px;
}

.convergence-impact h5 {
  color: #1976d2;
  margin: 0 0 10px 0;
  font-size: 12px;
  border-bottom: 1px solid #b3d9f2;
  padding-bottom: 5px;
}

.impact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 15px;
  font-size: 10px;
}

.impact-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.impact-label {
  color: #666;
  margin-bottom: 5px;
}

.impact-value {
  font-weight: bold;
  font-size: 11px;
  color: #333;
}

.convergence-summary-box {
  background: linear-gradient(135deg, #e8f4fd 0%, #f0f8ff 100%);
  border-radius: 8px;
  padding: 15px;
  border: 1px solid #b3d9f2;
  margin-top: 20px;
  text-align: center;
}

.convergence-summary-box h4 {
  color: #1976d2;
  margin: 0 0 10px 0;
  font-size: 14px;
}

/* ========================================
   RESPONSIVE DESIGN FOR INTER-REGIME
   ======================================== */

@media (max-width: 768px) {
  .metrics-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .impact-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .convergence-selector select {
    min-width: 250px;
  }
}

@media (min-width: 1400px) {
  #inter-regime-equity {
    max-width: 1400px;
  }

  .metrics-grid {
    gap: 20px;
  }

  .convergence-table {
    font-size: 11px;
  }

  .convergence-table th {
    font-size: 10px;
    padding: 10px 8px;
  }

  .convergence-table td {
    font-size: 10px;
    padding: 10px 8px;
  }
}

/* ========================================
   EQUITY SCENARIOS SECTION
   ======================================== */

#equity-scenarios {
  max-width: 600px;
  margin: 20px auto 0;
  padding: 20px;
  background: #f9f5e7;
  border-radius: 8px;
  font-size: 12px;
  border: 1px solid #ddd;
}

.equity-container {
  background: white;
  border-radius: 8px;
  padding: 20px;
  border: 1px solid #ddd;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.equity-title {
  text-align: center;
  color: #8b0000;
  margin-bottom: 20px;
  font-size: 16px;
  border-bottom: 2px solid #8b0000;
  padding-bottom: 10px;
}

.scenario-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.scenario-card {
  background: #f8f8f8;
  border-radius: 8px;
  padding: 15px;
  border: 1px solid #e0e0e0;
}

.scenario-card h4 {
  color: #8b0000;
  margin: 0 0 10px 0;
  font-size: 13px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 5px;
}

.adjustment-item {
  margin: 8px 0;
  padding: 8px;
  background: white;
  border-radius: 4px;
  font-size: 11px;
  border-left: 3px solid #8b0000;
}

.adjustment-value {
  font-weight: bold;
  color: #2e7d32;
}

.adjustment-negative {
  color: #c62828;
}

.summary-box {
  background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
  border-radius: 8px;
  padding: 15px;
  border: 1px solid #c8e6c9;
  margin-top: 20px;
  text-align: center;
}

.summary-box h4 {
  color: #2e7d32;
  margin: 0 0 10px 0;
  font-size: 14px;
}

.regime-section-title {
  color: #8b0000;
  margin-bottom: 15px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 5px;
  font-size: 13px;
}

.equity-grid-title {
  color: #8b0000;
  margin-bottom: 20px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 5px;
  font-size: 14px;
  text-align: center;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  font-size: 11px;
  text-align: left;
}

.summary-note {
  margin-top: 15px;
  font-size: 10px;
  font-style: italic;
  text-align: center;
}

/* Ratio selector */
.ratio-selector {
  background: #f0f8ff;
  border: 1px solid #b0d4f1;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  text-align: center;
}

.ratio-selector label {
  display: inline-block;
  font-weight: bold;
  font-size: 12px;
  margin-right: 10px;
  color: #2c5aa0;
}

.ratio-selector select {
  display: inline-block;
  width: auto;
  min-width: 250px;
  padding: 6px 12px;
  font-size: 12px;
  border: 1px solid #b0d4f1;
  border-radius: 4px;
  background: white;
}

.ratio-selector small {
  display: block;
  margin-top: 8px;
  font-size: 10px;
  color: #666;
  font-style: italic;
}

/* Explanation box */
.explanation-box {
  background: #f0f8ff;
  border: 1px solid #b0d4f1;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 20px;
  font-size: 10px;
}

.explanation-box strong {
  color: #2c5aa0;
  font-size: 11px;
}

.explanation-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.explanation-grid div small {
  color: #666;
}

.explanation-note {
  margin: 8px 0 0 0;
  text-align: center;
  font-style: italic;
  color: #5a5a5a;
}

/* Scenarios table */
.scenarios-table-container {
  overflow-x: auto;
  margin: 20px 0;
  border-radius: 8px;
}

.scenarios-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.scenarios-table th {
  background: #f5f5f5;
  color: #333;
  padding: 8px 6px;
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  border: 1px solid #ddd;
  white-space: nowrap;
}

.scenarios-table thead tr:first-child th {
  background: #e9e9e9;
  font-size: 11px;
  font-weight: 700;
  padding: 10px 8px;
  color: #222;
}

.scenarios-table thead tr:last-child th {
  background: #f5f5f5;
  font-size: 10px;
  font-weight: 500;
  padding: 8px 6px;
  color: #444;
}

.scenarios-table td {
  padding: 8px 6px;
  text-align: center;
  border: 1px solid #ddd;
  font-size: 10px;
  line-height: 1.3;
}

.scenarios-table .regime-name {
  background: #f8f8f8;
  font-weight: bold;
  text-align: left;
  padding-left: 10px;
  min-width: 120px;
}

.scenarios-table .equity-current {
  background: #fff3cd;
  font-weight: bold;
}

.scenarios-table .feasibility {
  font-size: 14px;
  min-width: 40px;
}

.scenarios-table .feasible {
  background: #e8f5e8;
}

.scenarios-table .not-feasible {
  background: #ffebee;
}

.scenarios-table small {
  font-size: 8px;
  color: #666;
  font-style: italic;
  display: block;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Tablet and desktop optimizations */
@media (min-width: 768px) {
  #equity-scenarios {
    max-width: 1000px;
    padding: 15px;
  }

  .scenario-grid {
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 10px;
  }

  .scenario-card {
    padding: 8px;
  }

  .scenario-card h4 {
    font-size: 11px;
    margin: 0 0 6px 0;
    padding-bottom: 3px;
  }

  .adjustment-item {
    margin: 4px 0;
    padding: 4px 6px;
    font-size: 9px;
    line-height: 1.2;
  }

  .adjustment-value,
  .adjustment-negative {
    font-size: 9px;
  }
}

@media (min-width: 1200px) {
  #equity-scenarios {
    max-width: 1300px;
    padding: 18px;
  }

  .equity-container {
    max-width: none;
    margin: 20px auto 0;
    padding: 20px;
  }

  .scenario-grid {
    gap: 12px;
  }

  .scenario-card {
    padding: 10px;
  }

  .scenario-card h4 {
    font-size: 12px;
    margin: 0 0 8px 0;
    padding-bottom: 4px;
  }

  .adjustment-item {
    margin: 5px 0;
    padding: 5px 8px;
    font-size: 10px;
    line-height: 1.3;
  }

  .adjustment-value,
  .adjustment-negative {
    font-size: 10px;
  }
}

@media (min-width: 1400px) {
  #equity-scenarios {
    max-width: 1500px;
    padding: 20px;
  }

  .scenario-grid {
    gap: 15px;
  }

  .scenario-card {
    padding: 12px;
  }

  .scenario-card h4 {
    font-size: 13px;
    margin: 0 0 10px 0;
    padding-bottom: 5px;
  }

  .adjustment-item {
    margin: 6px 0;
    padding: 6px 10px;
    font-size: 11px;
    line-height: 1.4;
  }
}

/* ========================================
   DARK MODE
   ======================================== */

@media (prefers-color-scheme: dark) {
  /* Base dark mode */
  body {
    background: #1a1a1a;
    color: #e0e0e0;
  }

  h1 {
    color: #ff6b6b;
    border-bottom-color: #ff6b6b;
  }

  /* Form dark mode */
  form {
    background: #2d2d2d;
    border: 1px solid #555;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  }

  label {
    color: #e0e0e0;
  }

  input,
  select {
    background: #3d3d3d;
    color: #e0e0e0;
    border: 1px solid #555;
  }

  input:focus,
  select:focus {
    border-color: #ff6b6b;
    outline: none;
    box-shadow: 0 0 5px rgba(255, 107, 107, 0.3);
  }

  /* Results dark mode */
  #results {
    background: #2a2a2a;
    border: 1px solid #555;
  }

  .result-item {
    background: #3d3d3d;
    color: #e0e0e0;
    border-left-color: #ff6b6b;
  }

  .warning {
    color: #ff6b6b;
  }

  /* Table dark mode */
  .main-comparison-table {
    background: #2d2d2d;
    border-color: #555;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  }

  .main-comparison-table h3 {
    color: #ff6b6b;
    border-bottom-color: #ff6b6b;
  }

  .main-comparison-table th {
    background: #404040;
    color: #f0f0f0;
    border-color: #555;
  }

  .main-comparison-table td {
    color: #e0e0e0;
    border-color: #555;
    background: #383838;
  }

  .main-comparison-table .regime-header {
    background: #555 !important;
    color: #f0f0f0 !important;
    border-left: 3px solid #ff6b6b !important;
  }

  .main-comparison-table .metric-primary {
    background: #4a4a4a !important;
    color: #f0f0f0 !important;
  }

  .main-comparison-table .metric-secondary {
    background: #454545 !important;
    color: #e0e0e0 !important;
  }

  .best-value {
    background: #2e5a2e !important;
    color: #a5d6a7 !important;
    border: 1px solid #4caf50 !important;
  }

  .worst-value {
    background: #5a2e2e !important;
    color: #ef9a9a !important;
    border: 1px solid #f44336 !important;
  }

  /* Cards dark mode */
  .regime-detail-card {
    background: #3d3d3d;
    border-color: #555;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  }

  .regime-detail-card .description {
    color: #bbb;
  }

  .regime-detail-card.prive h4 {
    background: #1e3a5f;
    color: #64b5f6;
  }

  .regime-detail-card.public h4 {
    background: #3e2c4a;
    color: #ba68c8;
  }

  .regime-detail-card.special h4 {
    background: #4a3429;
    color: #ffb74d;
  }

  /* Charts dark mode */
  .chart-container {
    background: #2d2d2d;
    border-color: #555;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  }

  .chart-title {
    color: #ff6b6b;
    border-bottom-color: #ff6b6b;
  }

  .chart-label {
    color: #e0e0e0;
  }

  .chart-bar-container {
    background: #555;
  }

  .chart-value {
    color: #e0e0e0;
  }

  .section-title {
    color: #ff6b6b;
    border-bottom-color: #555;
  }

  /* Sources dark mode */
  #sources {
    background: linear-gradient(135deg, #3d2e2e 0%, #452c2c 100%);
    border-color: #5a3838;
    box-shadow: 0 2px 6px rgba(255, 107, 107, 0.1);
  }

  #sources strong {
    color: #ff6b6b;
    border-bottom-color: #5a3838;
  }

  #sources li:hover {
    border-left-color: #ff6b6b;
    background: rgba(255, 255, 255, 0.1);
  }

  #sources a {
    color: #c4a484;
  }

  #sources a:hover {
    color: #ff6b6b;
  }

  #sources a:visited {
    color: #b39583;
  }

  #sources p {
    color: #a08070;
    border-top-color: #5a3838;
  }

  /* Equity scenarios dark mode */
  #equity-scenarios {
    background: #2a2a2a;
    border-color: #555;
  }

  .equity-container {
    background: #2d2d2d;
    border-color: #555;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  }

  .equity-title {
    color: #ff6b6b;
    border-bottom-color: #ff6b6b;
  }

  .scenario-card {
    background: #404040;
    border-color: #555;
  }

  .scenario-card h4 {
    color: #ff6b6b;
    border-bottom-color: #555;
  }

  .adjustment-item {
    background: #3d3d3d;
    color: #e0e0e0;
    border-left-color: #ff6b6b;
  }

  .adjustment-value {
    color: #a5d6a7;
  }

  .adjustment-negative {
    color: #ef9a9a;
  }

  .summary-box {
    background: linear-gradient(135deg, #2e5a2e 0%, #3d6b3d 100%);
    border-color: #4caf50;
  }

  .summary-box h4 {
    color: #a5d6a7;
  }

  .regime-section-title,
  .equity-grid-title {
    color: #ff6b6b;
    border-bottom-color: #555;
  }

  .ratio-selector {
    background: #2a3a4a;
    border-color: #4a5a6a;
  }

  .ratio-selector label {
    color: #64b5f6;
  }

  .ratio-selector select {
    background: #3d3d3d;
    color: #e0e0e0;
    border-color: #555;
  }

  .ratio-selector small {
    color: #aaa;
  }

  /* Explanation box dark mode */
  .explanation-box {
    background: #2a3a4a;
    border-color: #4a5a6a;
    color: #e0e0e0;
  }

  .explanation-box strong {
    color: #64b5f6;
  }

  .explanation-grid div small {
    color: #aaa;
  }

  .explanation-note {
    color: #ccc;
  }

  .explanation-note strong {
    color: #64b5f6;
  }

  /* Scenarios table dark mode */
  .scenarios-table {
    background: #2d2d2d;
  }

  .scenarios-table th {
    background: #404040;
    color: #e0e0e0;
    border-color: #555;
  }

  .scenarios-table thead tr:first-child th {
    background: #353535;
    color: #f0f0f0;
  }

  .scenarios-table thead tr:last-child th {
    background: #404040;
    color: #e0e0e0;
  }

  .scenarios-table td {
    border-color: #555;
    color: #e0e0e0;
  }

  .scenarios-table .regime-name {
    background: #404040;
  }

  .scenarios-table .equity-current {
    background: #4a3d00;
    color: #fff3cd;
  }

  .scenarios-table .feasible {
    background: #2e5a2e;
  }

  .scenarios-table .not-feasible {
    background: #5a2e2e;
  }

  .scenarios-table small {
    color: #aaa;
  }

  .scenarios-table-container {
    background: #2a2a2a;
  }

  /* Inter-regime equity dark mode */
  #inter-regime-equity {
    background: #2a2a2a;
    border-color: #555;
  }

  .inter-regime-container {
    background: #2d2d2d;
    border-color: #555;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  }

  .convergence-selector {
    background: #2a3a4a;
    border-color: #4a5a6a;
  }

  .convergence-selector label {
    color: #64b5f6;
  }

  .convergence-selector select {
    background: #3d3d3d;
    color: #e0e0e0;
    border-color: #555;
  }

  .convergence-selector small {
    color: #aaa;
  }

  .equity-metrics-summary h4 {
    color: #ff6b6b;
    border-bottom-color: #555;
  }

  .metric-card {
    background: #404040;
    border-color: #555;
  }

  .metric-card h5 {
    color: #e0e0e0;
    border-bottom-color: #555;
  }

  .metric-row span {
    color: #aaa;
  }

  .metric-row strong {
    color: #e0e0e0;
  }

  .regime-comparison-bars h5 {
    color: #e0e0e0;
  }

  .regime-bar-label {
    color: #e0e0e0;
  }

  .regime-bar-container {
    background: #555;
  }

  .legend-section h6 {
    color: #e0e0e0;
  }

  .legend-color {
    border-color: #555;
  }

  .legend-color.generation-vous {
    background: #aaa;
  }

  .legend-color.generation-boomer {
    background: #aaa;
  }

  .convergence-scenarios h4 {
    color: #ff6b6b;
    border-bottom-color: #ff6b6b;
  }

  .convergence-target-info {
    background: #2e5a2e;
    border-color: #4caf50;
    color: #e0e0e0;
  }

  .target-ratio {
    color: #a5d6a7;
  }

  .convergence-table {
    background: #2d2d2d;
  }

  .convergence-table th {
    background: #404040;
    color: #e0e0e0;
    border-color: #555;
  }

  .convergence-table thead tr:first-child th {
    background: #353535;
    color: #f0f0f0;
  }

  .convergence-table td {
    border-color: #555;
    color: #e0e0e0;
  }

  .convergence-table .regime-name {
    background: #404040;
  }

  .convergence-table .current-ratio {
    background: #4a3d00;
    color: #fff3cd;
  }

  .convergence-table .target-ratio {
    background: #2e5a2e;
    color: #a5d6a7;
  }

  .convergence-table .positive-adj {
    background: #5a2e2e;
    color: #ef9a9a;
  }

  .convergence-table .negative-adj {
    background: #2e5a2e;
    color: #a5d6a7;
  }

  .convergence-table .lever-cell small {
    color: #aaa;
  }

  .convergence-impact {
    background: #2a3a4a;
    border-color: #4a5a6a;
    color: #e0e0e0;
  }

  .convergence-impact h5 {
    color: #64b5f6;
    border-bottom-color: #4a5a6a;
  }

  .impact-label {
    color: #aaa;
  }

  .impact-value {
    color: #e0e0e0;
  }

  .convergence-summary-box {
    background: linear-gradient(135deg, #2a3a4a 0%, #3a4a5a 100%);
    border-color: #4a5a6a;
    color: #e0e0e0;
  }

  .convergence-summary-box h4 {
    color: #64b5f6;
  }

  /* Dark mode responsive adjustments */
  @media (min-width: 768px) {
    .scenario-card {
      background: #404040;
    }
  }

  /* Footer dark mode */
  small,
  footer {
    color: #aaa !important;
  }
}
