:root {
  --bg: #0b1120;
  --panel: #0f172a;
  --accent: #22c55e;
  --accent-2: #38bdf8;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --border: #1e293b;
  --shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

body.theme-light {
  --bg: #f4f4f5;
  --panel: #ffffff;
  --accent: #0f766e;
  --accent-2: #2563eb;
  --text: #020617;
  --muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 12px 35px rgba(15, 23, 42, 0.12);
}

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

body {
  margin: 0;
  font-family: var(--font);
  background: radial-gradient(120% 140% at 15% 20%, rgba(56, 189, 248, 0.15), transparent 35%),
              radial-gradient(120% 140% at 85% 0%, rgba(34, 197, 94, 0.1), transparent 40%),
              var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.35s ease, color 0.35s ease, box-shadow 0.35s ease;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

.topbar {
  padding: 28px 32px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

 .topbar-actions {
  position: absolute;
  top: 28px;
  right: 32px;
  display: flex;
  gap: 8px;
}

/* Info Button */
.btn-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-info:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent-2);
}

.btn-info svg {
  width: 18px;
  height: 18px;
}

.btn-theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.7);
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.btn-theme:hover {
  background: rgba(15, 23, 42, 0.95);
  border-color: var(--accent-2);
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.45);
}

.btn-theme__icon {
  font-size: 18px;
  line-height: 1;
}

.btn-theme__icon--light {
  display: none;
}

body.theme-light .btn-theme {
  background: rgba(255, 255, 255, 0.9);
}

body.theme-light .btn-theme__icon--dark {
  display: none;
}

body.theme-light .btn-theme__icon--light {
  display: inline;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  max-width: 700px;
  max-height: 85vh;
  width: 90%;
  display: flex;
  flex-direction: column;
  transform: translateY(20px);
  transition: transform 0.2s ease;
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 20px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.15s ease;
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.info-section {
  margin-bottom: 24px;
}

.info-section:last-child {
  margin-bottom: 0;
}

.info-section h3 {
  font-size: 16px;
  margin-bottom: 10px;
  color: var(--accent-2);
}

.info-section h4 {
  font-size: 14px;
  margin: 14px 0 8px 0;
  color: var(--text);
  font-weight: 600;
}

.info-section h4:first-of-type {
  margin-top: 10px;
}

.info-section ul ul {
  margin-top: 4px;
  padding-left: 18px;
}

.info-section ul ul li {
  margin-bottom: 3px;
  font-size: 13px;
  color: var(--muted);
}

.info-section p {
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 10px;
}

.info-section ul {
  margin: 0;
  padding-left: 20px;
  color: var(--text);
}

.info-section li {
  margin-bottom: 6px;
  line-height: 1.6;
}

.info-section code {
  background: rgba(99, 102, 241, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 13px;
  color: var(--accent-2);
}

@media (max-width: 680px) {
  .topbar-actions {
    position: static;
    align-self: flex-start;
    margin-top: 8px;
  }

  .btn-info span {
    display: none;
  }
}

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

.brand__dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.6);
  transform-origin: center;
  animation: brandPulse 2.8s ease-in-out infinite;
}

@keyframes brandPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.6);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 26px rgba(56, 189, 248, 0.9);
  }
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.tagline {
  color: var(--muted);
  max-width: 900px;
}

.page {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 18px;
  padding: 0 20px 20px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.panel--inputs {
  position: sticky;
  top: 88px;
  align-self: start;
}

.panel--results {
  min-height: 70vh;
}

.group {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 14px;
}

.group__header {
  margin-bottom: 12px;
}

.group__header p {
  color: var(--muted);
}

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

.grid--split {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.field span {
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
}

/* Field Label Tooltips */
.field-label {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.3);
  padding-bottom: 1px;
  display: inline-block;
}

.field-label::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  width: 260px;
  padding: 10px 12px;
  background: #1e293b;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: all 0.15s ease;
  z-index: 50;
  pointer-events: none;
  white-space: normal;
}

.field-label:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.field-label::before {
  content: '';
  position: absolute;
  left: 20px;
  bottom: calc(100% + 2px);
  border: 6px solid transparent;
  border-top-color: #1e293b;
  opacity: 0;
  visibility: hidden;
  transition: all 0.15s ease;
  z-index: 51;
}

.field-label:hover::before {
  opacity: 1;
  visibility: visible;
}

.field--checkbox .field-label {
  border-bottom: none;
  padding-bottom: 0;
}

input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  background: #0b162a;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="number"]:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

/* Accessibility: Focus-visible für Keyboard-Navigation */
input[type="number"]:focus-visible,
select:focus-visible,
button:focus-visible,
.btn:focus-visible,
.tab:focus-visible,
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

/* Skip Link für Keyboard-Navigation */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--accent);
  color: #0b1120;
  padding: 12px 24px;
  z-index: 1000;
  font-weight: 700;
  text-decoration: none;
  border-radius: 0 0 8px 0;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
}

.mode-switch {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--text);
}

.mode-switch input {
  margin-right: 6px;
  accent-color: var(--accent);
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.btn {
  font-weight: 700;
  border: none;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0b1120;
  box-shadow: 0 10px 30px rgba(34, 197, 94, 0.25);
}

.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 40px rgba(34, 197, 94, 0.35);
}

.btn--secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn--secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent-2);
}

.btn:active {
  transform: translateY(0);
}

.btn-group {
  display: flex;
  gap: 8px;
}

.btn-group .btn {
  flex: 1;
  padding: 10px 12px;
  font-size: 14px;
}

.hint {
  color: var(--muted);
  font-size: 13px;
}

.message {
  min-height: 20px;
  font-weight: 600;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0 8px;
}

.legend {
  display: flex;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot--total { background: #f59e0b; }
.dot--real { background: #22c55e; }

.graph-wrapper {
  background: #0b162a;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  position: relative;
  min-height: 260px;
}

canvas#graph {
  width: 100%;
  height: 320px;
  display: block;
}

.table-wrapper {
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #0b162a;
}

table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text);
  font-size: 14px;
}

thead {
  background: rgba(255, 255, 255, 0.04);
}

th, td {
  padding: 10px 12px;
  text-align: right;
  border-bottom: 1px solid var(--border);
}

th:first-child, td:first-child { text-align: left; }
th:nth-child(2), td:nth-child(2) { text-align: left; }

tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.02);
}

tbody tr:hover {
  background: rgba(56, 189, 248, 0.05);
}

.footer {
  text-align: center;
  padding: 16px;
  color: var(--muted);
  font-size: 13px;
}

.tooltip {
  position: fixed;
  background: #0f172a;
  color: var(--text);
  border: 1px solid var(--accent-2);
  padding: 10px 12px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.1s ease;
  white-space: pre-line;
  z-index: 20;
}

.tooltip[data-visible="true"] {
  opacity: 1;
}

/* Hover-Tooltips für Stat-Karten */
.stat-hint[data-tooltip],
.stat-card .stat-value[data-tooltip] {
  position: relative;
  cursor: help;
}

.stat-hint[data-tooltip]::after,
.stat-card .stat-value[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  width: 280px;
  max-width: 70vw;
  padding: 10px 12px;
  background: #1e293b;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: all 0.15s ease;
  z-index: 40;
  pointer-events: none;
  white-space: normal;
}

.stat-hint[data-tooltip]::before,
.stat-card .stat-value[data-tooltip]::before {
  content: '';
  position: absolute;
  left: 14px;
  bottom: calc(100% + 2px);
  border: 6px solid transparent;
  border-top-color: #1e293b;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: all 0.15s ease;
  z-index: 41;
  pointer-events: none;
}

.stat-hint[data-tooltip]:hover::after,
.stat-hint[data-tooltip]:hover::before,
.stat-card .stat-value[data-tooltip]:hover::after,
.stat-card .stat-value[data-tooltip]:hover::before {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

@media (max-width: 1100px) {
  .page {
    grid-template-columns: 1fr;
  }
  .panel--inputs {
    position: static;
  }
}

@media (max-width: 680px) {
  .grid {
    grid-template-columns: 1fr;
  }
  canvas#graph,
  canvas#mc-graph {
    height: 260px;
  }
  
  .tabs {
    flex-direction: column;
  }
  
  .tab {
    justify-content: flex-start;
  }
  
  .mc-highlight {
    flex-direction: column;
    text-align: center;
  }
  
  .mc-highlight-meta {
    text-align: center;
  }
  
  .mc-highlight-value {
    font-size: 36px;
  }
}

/* Deaktivierte Felder */
.field--disabled {
  opacity: 0.5;
  pointer-events: none;
}

.field--disabled input {
  background: rgba(255, 255, 255, 0.03);
}

input:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* Checkbox-Feld */
.field--checkbox {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  grid-column: 1 / -1;
  padding: 8px 0;
}

.field--checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.field--checkbox span {
  font-weight: 500;
  font-size: 14px;
}

/* Field Hint */
.field-hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

/* Warning Style für LIFO und andere rechtliche Hinweise */
.field--warning .field-label {
  color: #fbbf24;
}

.field-hint--warning {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
  border-left: 2px solid #f59e0b;
}

/* Select-Elemente */
select {
  width: 100%;
  padding: 10px 12px;
  background: #0b162a;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

select:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

select option {
  background: #0f172a;
  color: var(--text);
}

/* Statistik-Panel */
.stats-panel {
  margin-top: 8px;
  background: #0b162a;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

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

.stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

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

/* Klickbare Stat-Karten */
.stat-card--clickable {
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.stat-card--clickable:hover {
  border-color: var(--accent-2);
  background: rgba(56, 189, 248, 0.08);
}

.stat-card--clickable:active {
  transform: scale(0.98);
}

.stat-toggle-hint {
  font-size: 10px;
  padding: 2px 6px;
  background: rgba(56, 189, 248, 0.2);
  border-radius: 4px;
  color: var(--accent-2);
  margin-left: 6px;
  vertical-align: middle;
}

.stat-toggle-hint--active {
  background: rgba(34, 197, 94, 0.2);
  color: var(--accent);
}

/* Warnung bei Vermögensaufbrauch */
.stat-warning {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  min-height: 20px;
}

.stat-warning:empty {
  display: none;
}

.stat-warning--ok {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #22c55e;
}

.stat-warning--warning {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #f59e0b;
}

.stat-warning--critical {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

/* Tab System */
.tabs {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.2);
  padding: 6px;
  border-radius: 12px;
  margin-bottom: 16px;
}

.tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.tab--active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.tab-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.tab-badge {
  background: var(--accent);
  color: #0b1120;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 700;
}

.tab-content {
  display: none;
}

.tab-content--active {
  display: block;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Monte-Carlo Empty State */
.mc-empty-state {
  text-align: center;
  padding: 60px 30px;
  background: rgba(99, 102, 241, 0.05);
  border: 1px dashed rgba(99, 102, 241, 0.3);
  border-radius: var(--radius);
}

.mc-empty-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  color: rgba(99, 102, 241, 0.5);
}

.mc-empty-icon svg {
  width: 100%;
  height: 100%;
}

.mc-empty-state h3 {
  color: var(--text);
  margin-bottom: 12px;
  font-size: 20px;
}

.mc-empty-state p {
  color: var(--muted);
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.6;
}

.mc-empty-hint {
  margin-top: 16px !important;
  font-size: 13px;
  opacity: 0.7;
}

/* MC Highlight Card */
.mc-highlight {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.1));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.mc-highlight-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mc-highlight-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.mc-highlight-value {
  font-size: 42px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.mc-highlight-value.success-high { color: #22c55e; }
.mc-highlight-value.success-medium { color: #f59e0b; }
.mc-highlight-value.success-low { color: #ef4444; }

.mc-highlight-hint {
  font-size: 13px;
  color: var(--muted);
}

.mc-highlight-meta {
  font-size: 13px;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}

/* MC Textuelle Zusammenfassung */
.mc-summary {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(56, 189, 248, 0.05));
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
}

.mc-summary-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
}

.mc-summary-text strong {
  color: var(--accent);
}

/* Comparison Section */
.comparison-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.comparison-table-wrapper {
  overflow-x: auto;
  margin-top: 20px;
}

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

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

.comparison-table th {
  background: rgba(99, 102, 241, 0.1);
  font-weight: 600;
  color: var(--text);
}

.comparison-table td:first-child {
  color: var(--muted);
}

.comparison-table tr:hover {
  background: rgba(99, 102, 241, 0.05);
}

/* MC Progress Bar */
.mc-progress-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 8px;
}

.mc-progress-bar progress {
  flex: 1;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
}

.mc-progress-bar progress::-webkit-progress-bar {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.mc-progress-bar progress::-webkit-progress-value {
  background: linear-gradient(90deg, #8b5cf6, #6366f1);
  border-radius: 4px;
}

.mc-progress-bar progress::-moz-progress-bar {
  background: linear-gradient(90deg, #8b5cf6, #6366f1);
  border-radius: 4px;
}

.mc-progress-bar span {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

/* Stats Grid for MC */
.stats-grid--mc {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.stat-card--worst {
  border-color: rgba(251, 146, 60, 0.3);
  background: rgba(251, 146, 60, 0.05);
}

.stat-card--worst .stat-value {
  color: #fb923c;
}

.stat-card--best {
  border-color: rgba(56, 189, 248, 0.3);
  background: rgba(56, 189, 248, 0.05);
}

.stat-card--best .stat-value {
  color: #38bdf8;
}

/* Kapitalerhalt-Modus */
.stat-card--capital-preservation {
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.05);
}

.stat-card--capital-preservation .stat-value {
  color: #f59e0b;
}

.stat-card--capital-preservation.stat-card--active {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.1);
}

.stat-card--capital-preservation.stat-card--active .stat-value {
  color: #fbbf24;
  font-weight: 700;
}

.stat-card--capital-preservation .stat-hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

/* Monte-Carlo Simulation */
.btn--accent {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: white;
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.25);
}

.btn--accent:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 40px rgba(99, 102, 241, 0.35);
}

.btn--accent:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.mc-results {
  /* Results container - shown when simulation completes */
  display: block;
}

.stat-card--mc {
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(99, 102, 241, 0.05);
}

.stat-card--mc .stat-hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

.stat-value--success {
  color: #22c55e;
}

.stat-value--warning {
  color: #f59e0b;
}

.stat-value--danger {
  color: #ef4444;
}

.mc-chart-section {
  margin-top: 20px;
}

canvas#mc-graph {
  width: 100%;
  height: 320px;
  display: block;
}

.dot--mc-median {
  background: #f59e0b;
}

.dot--mc-50 {
  background: rgba(99, 102, 241, 0.35);
}

.dot--mc-80 {
  background: rgba(99, 102, 241, 0.15);
}

.dot--mc-p5 {
  background: #ef4444;
  opacity: 0.6;
}

.dot--mc-p95 {
  background: #22c55e;
  opacity: 0.6;
}

.legend--wrap {
  flex-wrap: wrap;
  gap: 8px 16px;
}

/* Stats Toggle (Nominal/Real) */
.stats-toggle {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.2);
  padding: 4px;
  border-radius: 8px;
}

.stats-toggle-btn {
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.stats-toggle-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.stats-toggle-btn--active {
  background: rgba(34, 197, 94, 0.3);
  color: var(--text);
}

.stats-section {
  animation: fadeIn 0.2s ease;
}

.stats-section--hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.mc-additional-stats {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.mc-stats-section {
  margin-bottom: 16px;
}

.mc-stats-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mc-stats-icon {
  width: 16px;
  height: 16px;
  stroke: var(--accent-2);
}

.mc-stats-desc {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
  line-height: 1.5;
}

.mc-stats-desc strong {
  color: var(--text);
}

/* SoRR Main Card */
.stat-card--sorr-main {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.1)) !important;
  border-color: rgba(99, 102, 241, 0.3) !important;
}

.stat-card--sorr-main .stat-value {
  color: #a78bfa;
}

/* Chart Scale Toggle */
.chart-controls {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.2);
  padding: 4px;
  border-radius: 8px;
}

.btn-scale {
  padding: 6px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-scale:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.btn-scale--active {
  background: rgba(99, 102, 241, 0.3);
  color: var(--text);
}

.mc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 12px;
}

/* Druckansicht */
@media print {
  body {
    background: white;
    color: black;
  }
  
  .topbar, .footer, .actions, .tooltip, .legend {
    display: none !important;
  }
  
  .page {
    display: block;
  }
  
  .panel {
    background: white;
    border: 1px solid #ccc;
    box-shadow: none;
    break-inside: avoid;
    margin-bottom: 20px;
  }
  
  .panel--inputs {
    display: none;
  }
  
  .graph-wrapper {
    background: white;
    border: 1px solid #ccc;
  }
  
  .table-wrapper {
    background: white;
  }
  
  table {
    color: black;
  }
  
  th, td {
    border: 1px solid #ccc;
  }
  
  thead {
    background: #f0f0f0;
  }
  
  tbody tr:nth-child(odd) {
    background: #f9f9f9;
  }
  
  .result-header h2 {
    color: black;
  }
  
  .eyebrow {
    color: #666;
  }
  
  .stats-panel {
    background: white;
    border: 1px solid #ccc;
  }
  
  .stat-card {
    background: #f9f9f9;
    border: 1px solid #ccc;
  }
  
  .stat-label {
    color: #666;
  }
  
  .stat-value {
    color: black;
  }
}

/* Export Dropdown */
.export-dropdown {
  position: relative;
  display: inline-block;
}

.export-menu {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-width: 200px;
  z-index: 100;
  overflow: hidden;
}

.export-menu.active {
  display: block;
}

.export-menu-section {
  padding: 8px 0;
}

.export-menu-section:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

.export-menu-title {
  display: block;
  padding: 4px 14px 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
}

.export-menu-item {
  display: block;
  width: 100%;
  padding: 8px 14px;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
}

.export-menu-item:hover {
  background: rgba(99, 102, 241, 0.15);
}

.export-menu-item:disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.export-menu-item:disabled:hover {
  background: transparent;
}

/* ============ Neue UI-Elemente für Verbesserungen ============ */

/* Warnungen für optimistische Parameter */
.mc-warnings {
  margin-bottom: 16px;
}

.mc-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 8px;
  color: #fbbf24;
  font-size: 14px;
  line-height: 1.5;
}

.mc-warning-icon {
  flex-shrink: 0;
  font-size: 18px;
}

.mc-warning-text {
  flex: 1;
}

/* Schweregrade für Warnungen */
.mc-warning--critical {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.5);
  color: #f87171;
}

.mc-warning--critical .mc-warning-icon {
  color: #ef4444;
}

/* Verbrauchsjahre-Info */
.mc-depletion-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  color: #f87171;
  font-size: 14px;
  line-height: 1.5;
  margin-top: 12px;
}

.mc-depletion-info--warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

.mc-depletion-icon {
  flex-shrink: 0;
  font-size: 20px;
}

.mc-depletion-text {
  flex: 1;
}

.mc-depletion-text strong {
  color: inherit;
}

/* Zweite Erfolgsdefinition (Soft-Erfolg) */
.mc-highlight-secondary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: rgba(99, 102, 241, 0.08);
  border-radius: 6px;
  margin-top: 10px;
}

.mc-highlight-label-small {
  font-size: 12px;
  color: var(--muted);
}

.mc-highlight-value-small {
  font-size: 16px;
  font-weight: 600;
  color: var(--accent-2);
}

/* SoRR-Erklärung */
.mc-sorr-explanation {
  background: rgba(99, 102, 241, 0.08);
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  margin: 12px 0 16px;
  border-radius: 0 8px 8px 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}

.mc-sorr-explanation p {
  margin: 0;
}

.mc-sorr-explanation strong {
  color: var(--accent);
}

/* Shortfall-Erklärungstext direkt sichtbar */
.shortfall-explanation {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.4;
}

/* ============ OPTIMIZATION STYLES ============ */

.mc-optimize-start {
  margin: 16px 0 8px;
  text-align: right;
}

/* Optimize Button */
.btn--optimize {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn--optimize:hover:not(:disabled) {
  background: linear-gradient(135deg, #9d74f7, #7c7ff2);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.btn--optimize:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(139, 92, 246, 0.3);
}

.btn--optimize .btn-icon {
  width: 18px;
  height: 18px;
}

.btn--small {
  padding: 6px 12px;
  font-size: 13px;
}

/* Optimization Results Panel */
.optimization-results {
  margin-top: 24px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(99, 102, 241, 0.05));
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: var(--radius);
}

.optimization-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.optimization-header h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  color: var(--text);
  margin: 0;
}

.optimization-icon {
  width: 24px;
  height: 24px;
  color: #a78bfa;
}

.optimization-mode {
  font-size: 13px;
  color: var(--muted);
  background: rgba(139, 92, 246, 0.2);
  padding: 4px 12px;
  border-radius: 20px;
}

/* Progress */
.optimization-progress {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  margin-bottom: 16px;
}

.optimization-progress progress {
  flex: 1;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  -webkit-appearance: none;
  appearance: none;
}

.optimization-progress progress::-webkit-progress-bar {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.optimization-progress progress::-webkit-progress-value {
  background: linear-gradient(90deg, #8b5cf6, #22c55e);
  border-radius: 4px;
}

#optimize-progress-text {
  font-size: 13px;
  color: var(--muted);
  min-width: 180px;
}

/* Result Panel */
.optimization-result-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.optimization-params h4,
.optimization-metrics h4 {
  font-size: 14px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

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

.optimization-param {
  background: rgba(255, 255, 255, 0.05);
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.param-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.param-value {
  font-size: 18px;
  font-weight: 700;
  color: #a78bfa;
}

/* Actions */
.optimization-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.optimization-actions .btn {
  display: flex;
  align-items: center;
  gap: 8px;
}

.optimization-actions .btn-icon {
  width: 16px;
  height: 16px;
}

/* Error */
.optimization-error {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 10px;
  color: #f87171;
}

.optimization-error-icon {
  font-size: 24px;
}

.optimization-error-text {
  font-size: 14px;
}

/* ============ VERSION 2.0 ADDITIONS ============ */

/* Szenario Header */
.scenario-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  padding: 4px 0 8px 0;
  background: transparent;
  border-radius: 0;
  margin-bottom: 8px;
  border: none;
}

.scenario-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.scenario-tab {
  padding: 8px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.scenario-tab:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--primary);
}

.scenario-tab--active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.scenario-tab--add {
  padding: 8px 12px;
  background: transparent;
  border-style: dashed;
}

.scenario-tab--add svg {
  width: 16px;
  height: 16px;
}

.scenario-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* Preset Section */
.preset-section {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--panel);
  border-radius: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.preset-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.preset-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.preset-btn {
  padding: 6px 12px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 6px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  transform: translateY(-1px);
}

/* Wizard Modal */
.modal--wizard {
  max-width: 500px;
}

.wizard-content {
  padding: 24px;
}

.wizard-progress {
  margin-bottom: 24px;
}

.wizard-progress span {
  font-size: 13px;
  color: var(--muted);
}

.wizard-progress-bar {
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  margin-top: 8px;
  overflow: hidden;
}

.wizard-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.3s ease;
}

.wizard-content h3 {
  font-size: 20px;
  margin-bottom: 8px;
}

.wizard-content p {
  color: var(--muted);
  margin-bottom: 24px;
}

.wizard-field {
  margin-bottom: 24px;
}

.wizard-field input,
.wizard-field select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--fg);
  font-size: 16px;
}

.wizard-field input:focus,
.wizard-field select:focus {
  border-color: var(--primary);
  outline: none;
}

.wizard-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.wizard-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--muted);
  cursor: pointer;
}

/* Risiko-Widget */
.risk-widget-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
}

.risk-widget {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 16px;
  min-width: 280px;
}

.risk-widget-header h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--fg);
}

.risk-widget-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.risk-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: 8px;
}

.risk-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
}

.risk-item--good .risk-indicator { background: #22c55e; }
.risk-item--warning .risk-indicator { background: #f59e0b; }
.risk-item--bad .risk-indicator { background: #ef4444; }
.risk-item--unknown .risk-indicator { background: var(--muted); }

.risk-label {
  font-size: 13px;
  color: var(--muted);
  flex: 1;
}

.risk-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
}

/* Message Toast */
.message {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 12px 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  font-size: 14px;
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}

.message:not(:empty) {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.message--success {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.3);
  color: #22c55e;
}

.message--error {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.message--warning {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.3);
  color: #f59e0b;
}

.message--info {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
  color: var(--primary);
}

/* Phase Badge */
.phase-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.phase-badge--anspar {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
}

.phase-badge--entnahme {
  background: rgba(139, 92, 246, 0.2);
  color: #a78bfa;
}

/* Stress-Test Dropdown */
.stress-test-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.stress-test-section label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

#stress_scenario {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
  font-size: 14px;
}

/* MC Chart Options */
.mc-chart-options {
  display: flex;
  gap: 16px;
  padding: 12px 16px;
  background: var(--panel);
  border-radius: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.mc-chart-option {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mc-chart-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.mc-chart-option label {
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}

/* Button Variations */
.btn--small {
  padding: 6px 12px;
  font-size: 13px;
}

.btn--ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}

.btn--ghost:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--primary);
  color: var(--primary);
}

.btn--danger {
  background: #ef4444;
  border-color: #ef4444;
}

.btn--danger:hover {
  background: #dc2626;
}

/* Field Disabled State */
.field--disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* Comparison View */
.comparison-section {
  padding: 20px;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
}

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

.comparison-table th {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
}

.comparison-table .scenario-a { color: #f59e0b; }
.comparison-table .scenario-b { color: #3b82f6; }
.comparison-table .scenario-c { color: #8b5cf6; }

/* Responsive Adjustments */
@media (max-width: 680px) {
  .scenario-header {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
  
  .scenario-tabs {
    justify-content: center;
  }
  
  .scenario-actions {
    justify-content: center;
  }
  
  .preset-section {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .risk-widget-container {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }
  
  .risk-widget {
    min-width: auto;
    width: 100%;
  }
  
  .risk-widget-grid {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .risk-item {
    flex: 1;
    min-width: 100px;
  }
}

/* Print Styles */
@media print {
  .risk-widget-container,
  .scenario-header,
  .preset-section,
  .message {
    display: none !important;
  }
}

/* Light Theme Adjustments */
body.theme-light .scenario-header {
  background: rgba(99, 102, 241, 0.08);
}

body.theme-light .preset-btn {
  background: rgba(99, 102, 241, 0.08);
}

body.theme-light .risk-widget {
  background: white;
}

body.theme-light .risk-item {
  background: #f5f5f5;
}
