:root {
  /* Dark Theme (Default) */
  --bg-main: #0b0f14;
  --bg-sidebar: #0f1419;
  --bg-topbar: linear-gradient(180deg, #1e272e 0%, #1a2229 100%);
  --bg-panel-header: linear-gradient(180deg, #1a2229 0%, #12161a 100%);
  --bg-card: #1a2229;
  --bg-modal: rgba(26, 32, 44, 0.95);
  --bg-modal-overlay: rgba(0, 0, 0, 0.5);
  --bg-secondary: #111827;
  --bg-tertiary: #0f172a;
  --modal-solid-bg: #111827;
  --modal-panel-solid-bg: #0f172a;
  --border-color: #334155;
  --text-secondary: #cbd5e1;
  --bg-card-glass: rgba(255, 255, 255, 0.04);
  --bg-card-glass-hover: rgba(255, 255, 255, 0.06);
  --text-main: #eceff1;
  --text-muted: #90a4ae;
  --text-dim: #cfd8dc;
  --border-main: #263238;
  --border-muted: #1f2a33;
  --accent-color: #00e5ff;
  --accent-soft: rgba(0, 229, 255, 0.15);
  --accent-border: rgba(0, 229, 255, 0.32);
  --input-bg: #111827;
  --input-text: #eceff1;
  --canvas-bg: #0b0f14;
  --table-head-bg: rgba(0, 0, 0, 0.3);
  --table-border: #4a5568;
  --chart-grid: rgba(255, 255, 255, 0.06);
  --chart-axis: #90a4ae;
  --chart-label: #b0bec5;
  --chart-panel-bg: rgba(255, 255, 255, 0.03);
  --shadow-main: 0 4px 6px rgba(0,0,0,0.3);
  --shadow-color: rgba(0, 0, 0, 0.8);
}

body.light-theme {
  /* Light Theme */
  --bg-main: #f3f6f9;
  --bg-sidebar: #f0f9ff;
  --bg-topbar: linear-gradient(180deg, #bae6fd 0%, #e0f2fe 100%);
  --bg-panel-header: linear-gradient(180deg, #e0f2fe 0%, #f0f9ff 100%);
  --bg-card: #ffffff;
  --bg-modal: rgba(255, 255, 255, 0.98);
  --bg-modal-overlay: rgba(255, 255, 255, 0.5);
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --modal-solid-bg: #ffffff;
  --modal-panel-solid-bg: #f8fafc;
  --border-color: #cbd5e1;
  --text-secondary: #334155;
  --bg-card-glass: rgba(0, 0, 0, 0.03);
  --bg-card-glass-hover: rgba(0, 0, 0, 0.05);
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-dim: #475569;
  --border-main: #bae6fd;
  --border-muted: #e0f2fe;
  --accent-color: #0f766e;
  --accent-soft: rgba(15, 118, 110, 0.11);
  --accent-border: rgba(15, 118, 110, 0.28);
  --input-bg: #ffffff;
  --input-text: #0f172a;
  --canvas-bg: #eef3f7;
  --table-head-bg: #e8eef5;
  --table-border: #64748b;
  --chart-grid: rgba(15, 23, 42, 0.12);
  --chart-axis: #334155;
  --chart-label: #1e293b;
  --chart-panel-bg: #ffffff;
  --shadow-main: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-color: rgba(0, 0, 0, 0.2);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
  overflow: hidden;
  transition: background 0.3s, color 0.3s;
}

#hier-v4-dialog,
#hrl-v4-dialog,
#v4OptResultModal,
#v3v4CompareModal {
  background-color: var(--modal-solid-bg) !important;
  opacity: 1 !important;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* 頂部工具列 */
#topBar {
  height: 50px;
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border-main);
  display: flex;
  align-items: center;
  padding: 0 15px;
  gap: 15px;
  z-index: 1000;
  transition: all 0.3s;
}

#menuBtn {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: var(--border-main);
  color: var(--text-main);
  border: 1px solid #455a64;
  cursor: pointer;
  font-size: 18px;
}

body.light-theme #topBar h1,
body.light-theme #userInfo,
body.light-theme .panel-header .group {
  color: var(--text-main) !important;
}

body.light-theme .panel-header h3 {
  color: #0f172a;
}

body.light-theme #menuBtn {
  background: #ffffff;
  border-color: var(--border-main);
  color: #334155;
}

.menu {
  position: absolute;
  top: 55px;
  left: 15px;
  min-width: 180px;
  background: rgba(20, 24, 28, 0.98);
  border: 1px solid #455a64;
  border-radius: 8px;
  z-index: 1001;
  overflow: hidden;
}

body.light-theme .menu {
  background: rgba(255, 255, 255, 0.98);
  border-color: var(--border-main);
  box-shadow: var(--shadow-main);
}

.menu.hidden {
  display: none;
}

.menu a {
  display: block;
  padding: 12px 15px;
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px solid #37474f;
  transition: background 0.2s;
}

body.light-theme .menu a {
  color: var(--text-dim);
  border-bottom-color: var(--border-muted);
}

.menu a:hover {
  background: var(--border-main);
}

body.light-theme .menu a:hover {
  background: #f1f5f9;
}

.menu a:last-child {
  border-bottom: none;
}

/* 主容器 */
#mainContainer {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* 左側面板：單線圖 */
#leftPanel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-main);
  border-right: 1px solid var(--border-main);
}

.panel-header {
  padding: 12px 15px;
  background: var(--bg-panel-header);
  border-bottom: 1px solid var(--border-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-header h3 {
  font-size: 15px;
  color: var(--text-main);
  font-weight: 600;
}

#sldCanvas {
  flex: 1;
  overflow: auto;
  padding: 20px;
  position: relative;
  background: var(--canvas-bg);
}

#sldSvg {
  min-width: 100%;
  min-height: 100%;
}

/* 右側面板：控制與結果 */
#rightPanel {
  width: 420px;
  display: flex;
  flex-direction: column;
  background: var(--bg-sidebar);
  overflow-y: auto;
}

.control-section {
  border-bottom: 1px solid var(--border-muted);
  padding: 15px;
}

.results-section {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.section-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.auto-sim-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  cursor: pointer;
}

/* 控制組 */
.control-group {
  margin-bottom: 20px;
}

.control-group h4 {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-muted);
}

.switches-container,
.controls-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 開關項目 */
.switch-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--bg-card);
  border-radius: 6px;
  border: 1px solid var(--border-main);
  transition: all 0.2s;
}

.switch-item:hover {
  background: var(--border-muted);
  border-color: var(--border-main);
}

.switch-item.disabled {
  opacity: 0.5;
  background: var(--bg-main);
}

.switch-label {
  font-size: 13px;
  color: var(--text-main);
  font-weight: 500;
}

.switch-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--border-main);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.3s;
}

.switch-toggle.on {
  background: #4caf50;
}

.switch-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
}

.switch-toggle.on::after {
  transform: translateX(20px);
}

/* 滑動控制項目 */
.control-item {
  padding: 10px;
  background: var(--bg-card);
  border-radius: 6px;
  border: 1px solid var(--border-main);
}

.control-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.control-item-label {
  font-size: 13px;
  color: var(--text-main);
  font-weight: 500;
}

.control-item-value {
  font-size: 13px;
  color: var(--accent-color);
  font-weight: 600;
}

.control-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border-main);
  outline: none;
  cursor: pointer;
}

.control-slider::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-color);
  cursor: pointer;
}

.control-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-color);
  cursor: pointer;
  border: none;
}

/* 按鈕樣式 */
.action-buttons {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.btn-primary {
  flex: 1;
  padding: 12px 24px;
  background: linear-gradient(135deg, #00b4db 0%, #0083b0 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px rgba(0, 131, 176, 0.2);
  text-transform: uppercase;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(0, 131, 176, 0.3);
  background: linear-gradient(135deg, #00c6ff 0%, #0072ff 100%);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  background: #2d3748;
  color: #718096;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

body.light-theme .btn-primary:disabled {
  background: #e2e8f0;
  color: #94a3b8;
}

.btn-primary.running {
  background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
  color: #1a202c;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(253, 160, 133, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(253, 160, 133, 0); }
  100% { box-shadow: 0 0 0 0 rgba(253, 160, 133, 0); }
}

/* ─── 情境狀態燈號動畫 ─── */
@keyframes statusPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.86); }
}
@keyframes statusPulseOrange {
  0%, 100% { box-shadow: 0 0 8px #fb923c, 0 0 16px rgba(251,146,60,0.45); }
  50% { box-shadow: 0 0 3px #fb923c, 0 0 6px rgba(251,146,60,0.18); }
}
@keyframes statusPulseRed {
  0%, 100% { box-shadow: 0 0 10px #ef4444, 0 0 22px rgba(239,68,68,0.55); transform: scale(1); }
  50% { box-shadow: 0 0 4px #ef4444, 0 0 10px rgba(239,68,68,0.22); transform: scale(0.88); }
}

/* 燈號容器 */
#scenario-status-indicator {
  user-select: none;
  transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}
#scenario-status-indicator.status-normal {
  background: rgba(76,175,80,0.08);
  border-color: rgba(76,175,80,0.25);
}
#scenario-status-indicator.status-milp {
  background: rgba(0,188,212,0.10);
  border-color: rgba(0,188,212,0.30);
}
#scenario-status-indicator.status-contingency {
  background: rgba(251,146,60,0.12);
  border-color: rgba(251,146,60,0.40);
}
#scenario-status-indicator.status-emergency {
  background: rgba(239,68,68,0.12);
  border-color: rgba(239,68,68,0.45);
}
body.light-theme #scenario-status-indicator {
  background: rgba(255, 255, 255, 0.85) !important;
  border-color: rgba(0, 0, 0, 0.18) !important;
}
body.light-theme #scenario-status-indicator.status-normal {
  background: rgba(76, 175, 80, 0.12) !important;
  border-color: rgba(56, 142, 60, 0.55) !important;
}
body.light-theme #scenario-status-indicator.status-milp {
  background: rgba(2, 136, 209, 0.10) !important;
  border-color: rgba(2, 136, 209, 0.55) !important;
}
body.light-theme #scenario-status-indicator.status-contingency {
  background: rgba(230, 81, 0, 0.10) !important;
  border-color: rgba(230, 81, 0, 0.55) !important;
}
body.light-theme #scenario-status-indicator.status-emergency {
  background: rgba(198, 40, 40, 0.10) !important;
  border-color: rgba(198, 40, 40, 0.55) !important;
}
/* 燈號 label 文字在淺色主題下要深色 */
body.light-theme #status-label {
  filter: brightness(0.72) saturate(1.6);
}

.btn-secondary {
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(4px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.2);
  color: white;
}

body.light-theme .btn-secondary,
body.light-theme .btn-sm,
body.light-theme .btn-icon {
  background: #ffffff;
  color: #334155;
  border-color: #cbd5e1;
}

body.light-theme .btn-secondary:hover,
body.light-theme .btn-sm:hover,
body.light-theme .btn-icon:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #94a3b8;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #a0aec0;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-sm:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.btn-sm.active {
  background: rgba(0, 229, 255, 0.15);
  border-color: rgba(0, 229, 255, 0.3);
  color: var(--accent-color);
}

body.light-theme .btn-sm.active {
  background: var(--accent-soft);
  border-color: var(--accent-border);
}

.btn-icon {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
}

/* 狀態指示器 */
.status-indicator {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: #2d3748;
  color: #a0aec0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-indicator::before {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-indicator.running {
  background: rgba(237, 137, 54, 0.15);
  color: #ed8936;
}

.status-indicator.success {
  background: rgba(72, 187, 120, 0.15);
  color: #48bb78;
}

.status-indicator.error {
  background: rgba(245, 101, 101, 0.15);
  color: #f56565;
}

/* Tab樣式 */
.result-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 20px;
  background: rgba(0, 0, 0, 0.2);
  padding: 4px;
  border-radius: 8px;
}

body.light-theme .result-tabs {
  background: #e8eef5;
}

.tab-btn {
  flex: 1;
  padding: 8px 12px;
  background: transparent;
  color: #718096;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

body.light-theme .tab-btn {
  color: #64748b;
}

.tab-btn:hover {
  color: #cbd5e0;
}

body.light-theme .tab-btn:hover {
  color: #0f172a;
}

.tab-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

body.light-theme .tab-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 表格樣式 */
.table-wrapper {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

body.light-theme .table-wrapper {
  border-color: var(--border-main);
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.results-table thead {
  background: var(--table-head-bg);
}

.results-table th {
  padding: 12px 16px;
  text-align: left;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-muted);
}

.results-table td {
  padding: 12px 16px;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-muted);
}

.results-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

body.light-theme .results-table tbody tr:hover {
  background: #f8fafc;
}

/* 狀態徽章 */
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.status-badge.normal {
  background: rgba(72, 187, 120, 0.2);
  color: #68d391;
}

.status-badge.warning {
  background: rgba(237, 137, 54, 0.2);
  color: #f6ad55;
}

.status-badge.danger {
  background: rgba(245, 101, 101, 0.2);
  color: #fc8181;
}

/* EV Scheduler Styles */
.ev-tabs {
  padding: 0;
  gap: 0;
}

.ev-tab-btn {
  flex: 1;
  padding: 12px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #718096;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.ev-tab-btn:hover {
  color: #cbd5e0;
  background: rgba(255, 255, 255, 0.02);
}

.ev-tab-btn.active {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
  background: rgba(0, 229, 255, 0.05);
}

.ev-schedule-table input,
.ev-schedule-table select {
  width: 100%;
  background: var(--input-bg) !important;
  border: 1px solid var(--border-main) !important;
  color: var(--input-text) !important;
  padding: 6px 10px !important;
  border-radius: 6px !important;
  font-size: 13px;
  transition: all 0.2s;
}

.ev-schedule-table input:focus,
.ev-schedule-table select:focus {
  border-color: var(--accent-color) !important;
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.2);
}

/* Modal Animation */
@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-content {
  animation: modalSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  background: var(--bg-modal) !important;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

body.light-theme .modal {
  background-color: rgba(15, 23, 42, 0.22) !important;
}

body.light-theme .modal-content {
  color: var(--text-main) !important;
  border-color: var(--border-main) !important;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18) !important;
}

body.light-theme .modal [style*="background:#2d3748"],
body.light-theme .modal [style*="background-color:#2d3748"],
body.light-theme .modal [style*="background:#1a202c"],
body.light-theme .modal [style*="background-color:#1a202c"],
body.light-theme .modal [style*="background:#0f172a"],
body.light-theme .modal [style*="background-color:#0f172a"],
body.light-theme .modal [style*="background:#1e293b"],
body.light-theme .modal [style*="background-color:#1e293b"],
body.light-theme .modal [style*="background:#0f1623"],
body.light-theme .modal [style*="background:#0a0d14"],
body.light-theme .modal [style*="background:rgba(22,28,36"] {
  background: var(--bg-card) !important;
  background-color: var(--bg-card) !important;
  color: var(--text-main) !important;
  border-color: var(--border-main) !important;
}

body.light-theme #opendssResultModal {
  background: rgba(15, 23, 42, 0.22) !important;
}

body.light-theme #opendssResultModal > div,
body.light-theme #opendssStatusLog,
body.light-theme #detailedResults {
  background: var(--bg-card) !important;
  color: var(--text-main) !important;
  border-color: var(--border-main) !important;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
}

body.light-theme #opendssResultModal [style*="border-bottom"] {
  border-color: var(--border-muted) !important;
}

body.light-theme #opendssResultModal h2,
body.light-theme #opendssResultModal button {
  color: var(--text-main) !important;
}

body.light-theme .opendss-tab {
  color: var(--text-muted) !important;
}

body.light-theme .opendss-tab.active {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
}

body.light-theme #opendssResultModal .opendss-tab.active {
  color: var(--accent-color) !important;
  border-bottom-color: var(--accent-color) !important;
}

body.light-theme #opendssModalStatus,
body.light-theme #opendssStatusLog,
body.light-theme #detailedResults,
body.light-theme #detailedResults div,
body.light-theme #detailedResults table,
body.light-theme #detailedResults td {
  color: #1e293b !important;
}

body.light-theme #detailedResults h3 {
  color: #0f766e !important;
  border-bottom-color: #cbd5e1 !important;
}

body.light-theme #detailedResults strong {
  color: #15803d !important;
}

body.light-theme #opendssStatusLog [style*="color:#90a4ae"],
body.light-theme #opendssStatusLog [style*="color: #90a4ae"],
body.light-theme #detailedResults [style*="color:#90a4ae"],
body.light-theme #detailedResults [style*="color: #90a4ae"],
body.light-theme #detailedResults [style*="color:#b0bec5"],
body.light-theme #detailedResults [style*="color: #b0bec5"],
body.light-theme #detailedResults [style*="color:#cfd8dc"],
body.light-theme #detailedResults [style*="color: #cfd8dc"] {
  color: #475569 !important;
}

body.light-theme #detailedResults [style*="color:#00e5ff"],
body.light-theme #detailedResults [style*="color: #00e5ff"],
body.light-theme #detailedResults [style*="color:#03a9f4"],
body.light-theme #detailedResults [style*="color: #03a9f4"] {
  color: #0369a1 !important;
}

body.light-theme #opendssModalStatus[style*="color:#4caf50"],
body.light-theme #opendssModalStatus[style*="color: #4caf50"],
body.light-theme #opendssStatusLog [style*="color:#4caf50"],
body.light-theme #opendssStatusLog [style*="color: #4caf50"],
body.light-theme #detailedResults [style*="color:#4caf50"],
body.light-theme #detailedResults [style*="color: #4caf50"] {
  color: #15803d !important;
}

body.light-theme #opendssStatusLog [style*="color:#ff9800"],
body.light-theme #opendssStatusLog [style*="color: #ff9800"],
body.light-theme #detailedResults [style*="color:#ff9800"],
body.light-theme #detailedResults [style*="color: #ff9800"],
body.light-theme #detailedResults [style*="color:#ffc107"],
body.light-theme #detailedResults [style*="color: #ffc107"] {
  color: #c2410c !important;
}

body.light-theme #opendssStatusLog [style*="color:#f44336"],
body.light-theme #opendssStatusLog [style*="color: #f44336"],
body.light-theme #detailedResults [style*="color:#f44336"],
body.light-theme #detailedResults [style*="color: #f44336"] {
  color: #dc2626 !important;
}

body.light-theme #detailedResults [style*="color:#9c27b0"],
body.light-theme #detailedResults [style*="color: #9c27b0"] {
  color: #7e22ce !important;
}

body.light-theme #sriModal > div {
  background: rgba(255, 255, 255, 0.96) !important;
  color: var(--text-main) !important;
  border-color: var(--border-main) !important;
  box-shadow: 0 32px 64px rgba(15, 23, 42, 0.18) !important;
}

body.light-theme #sriModal [style*="background: rgba(0,0,0"],
body.light-theme #sriModal [style*="background:rgba(0,0,0"] {
  background: #f8fafc !important;
  border-color: var(--border-muted) !important;
}

body.light-theme #scenarioSchedulerModal .modal-content {
  background: #ffffff !important;
  color: #1e293b !important;
}

body.light-theme #scenarioSchedulerModal [style*="background:#0f172a"],
body.light-theme #scenarioSchedulerModal [style*="background:#1e293b"] {
  background: #f8fafc !important;
  border-color: var(--border-main) !important;
}

body.light-theme #timelineDropZone {
  background: #eef3f7 !important;
  border-color: #cbd5e1 !important;
}

body.light-theme #scenarioSchedulerModal h3,
body.light-theme #scenarioSchedulerModal label,
body.light-theme #scenarioSchedulerModal label span,
body.light-theme #scenarioSchedulerModal [style*="color:#cbd5e0"],
body.light-theme #scenarioSchedulerModal [style*="color: #cbd5e0"] {
  color: #1f2937 !important;
}

body.light-theme #scenarioSchedulerModal input[type="checkbox"] {
  accent-color: #0f766e;
}

body.light-theme #scenarioSchedulerModal .draggable-event[data-type="emergency_island"] {
  background: #dbeafe !important;
  color: #1d4ed8 !important;
  border-color: #60a5fa !important;
}

body.light-theme #scenarioSchedulerModal .draggable-event[data-type="fault_mode"] {
  background: #dbeafe !important;
  color: #1d4ed8 !important;
  border-color: #60a5fa !important;
}

body.light-theme #scenarioSchedulerModal .draggable-event[data-type="low_frequency_shed"] {
  background: #fee2e2 !important;
  color: #b91c1c !important;
  border-color: #f87171 !important;
}

body.light-theme .bus-load-item {
  background: #ffffff !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border-main);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

body.light-theme .bus-load-item [style*="color:#e2e8f0"],
body.light-theme .bus-load-item [style*="color:#a0aec0"] {
  color: var(--text-main) !important;
}

body.light-theme .bus-load-item [style*="border-top:1px solid #2d3748"] {
  border-top-color: var(--border-muted) !important;
}

body.light-theme #cost-resil-v3-dialog,
body.light-theme #cost-resil-dialog,
body.light-theme #cost-resil-v2-dialog,
body.light-theme #resilience-zone-dialog {
  background: #ffffff !important;
  color: var(--text-main) !important;
  border-color: var(--accent-color) !important;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18) !important;
}

body.light-theme #cost-resil-v3-dialog label,
body.light-theme #cost-resil-dialog label,
body.light-theme #cost-resil-v2-dialog label,
body.light-theme #resilience-zone-dialog label {
  background: #f8fafc !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border-muted);
}

body.light-theme #cost-resil-v3-dialog [style*="background:rgba"],
body.light-theme #cost-resil-dialog [style*="background:rgba"],
body.light-theme #cost-resil-v2-dialog [style*="background:rgba"],
body.light-theme #resilience-zone-dialog [style*="background:rgba"] {
  background: #f8fafc !important;
  color: var(--text-dim) !important;
  border-color: var(--border-main) !important;
}

body.light-theme #ablationStudyModal > div,
body.light-theme #v3DetailTableModal {
  background: #ffffff !important;
  color: var(--text-main) !important;
  border-color: var(--border-main) !important;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18) !important;
}

body.light-theme #ablationStudyModal [style*="background:rgba(0,0,0"],
body.light-theme #v3DetailTableModal [style*="background:rgba(0,0,0"],
body.light-theme #ablationStudyModal [style*="background:#151530"],
body.light-theme #ablationStudyModal [style*="background:#1a1a30"],
body.light-theme #ablationStudyModal [style*="background:#1e1e38"],
body.light-theme #v3DetailTableModal [style*="background:rgba(255,255,255,0.04"],
body.light-theme #v3DetailTableModal [style*="background:rgba(255,255,255,0.02"] {
  background: #f8fafc !important;
  color: var(--text-main) !important;
  border-color: var(--border-muted) !important;
}

body.light-theme #ablationStudyModal th,
body.light-theme #ablationStudyModal td,
body.light-theme #v3DetailTableModal th,
body.light-theme #v3DetailTableModal td {
  border-color: var(--border-muted) !important;
}

body.light-theme #ablationStudyModal {
  background: rgba(148, 163, 184, 0.28) !important;
}

body.light-theme #ablationStudyModal > div {
  background: #f3f7fb !important;
  color: #0f172a !important;
  border-color: #9fb1c5 !important;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18) !important;
}

body.light-theme #ablationStudyModal h2,
body.light-theme #ablationStudyModal h3,
body.light-theme #ablationStudyModal table,
body.light-theme #ablationStudyModal th,
body.light-theme #ablationStudyModal td,
body.light-theme #ablationStudyModal span,
body.light-theme #ablationStudyModal div {
  text-shadow: none !important;
}

body.light-theme #ablationStudyModal [style*="background:rgba(0,0,0,0.3"],
body.light-theme #ablationStudyModal [style*="background: rgba(0,0,0,0.3"],
body.light-theme #ablationStudyModal [style*="background:rgba(0,0,0,0.1"],
body.light-theme #ablationStudyModal [style*="background: rgba(0,0,0,0.1"],
body.light-theme #ablationStudyModal [style*="background:rgba(255,255,255,0.06"],
body.light-theme #ablationStudyModal [style*="background: rgba(255,255,255,0.06"] {
  background: #e8eff6 !important;
  border-color: #c1cedd !important;
}

body.light-theme #ablationStudyModal [style*="background:rgba(255,235,59,0.08"],
body.light-theme #ablationStudyModal [style*="background: rgba(255,235,59,0.08"] {
  background: #fff7ed !important;
  color: #7c2d12 !important;
  border-color: #fdba74 !important;
}

body.light-theme #ablationStudyModal thead,
body.light-theme #ablationStudyModal tr[style*="background:var(--shadow-color)"],
body.light-theme #ablationStudyModal tr[style*="background: var(--shadow-color)"],
body.light-theme #ablationStudyModal tr[style*="background:rgba(0,0,0,0.3"],
body.light-theme #ablationStudyModal tr[style*="background: rgba(0,0,0,0.3"] {
  background: #dbe7f2 !important;
}

body.light-theme #ablationStudyModal [style*="background:#151530"],
body.light-theme #ablationStudyModal [style*="background: #151530"],
body.light-theme #ablationStudyModal [style*="background:#1a1a30"],
body.light-theme #ablationStudyModal [style*="background: #1a1a30"],
body.light-theme #ablationStudyModal [style*="background:#1e1e38"],
body.light-theme #ablationStudyModal [style*="background: #1e1e38"] {
  background: #dbe7f2 !important;
}

body.light-theme #ablationStudyModal [style*="background:#00e5ff"],
body.light-theme #ablationStudyModal [style*="background: #00e5ff"] {
  background: #0891b2 !important;
}

body.light-theme #ablationStudyModal [style*="background:#ffa726"],
body.light-theme #ablationStudyModal [style*="background: #ffa726"] {
  background: #d97706 !important;
}

body.light-theme #ablationStudyModal [style*="background:#78909c"],
body.light-theme #ablationStudyModal [style*="background: #78909c"] {
  background: #64748b !important;
}

body.light-theme #ablationStudyModal [style*="linear-gradient(135deg, #ffeb3b"],
body.light-theme #ablationStudyModal [style*="linear-gradient(135deg,#ffeb3b"] {
  background: #0f766e !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

body.light-theme #ablationStudyModal [style*="color:#fff"],
body.light-theme #ablationStudyModal [style*="color: #fff"],
body.light-theme #ablationStudyModal [style*="color:#ffffff"],
body.light-theme #ablationStudyModal [style*="color: #ffffff"],
body.light-theme #ablationStudyModal [style*="color:#e0e0e0"],
body.light-theme #ablationStudyModal [style*="color: #e0e0e0"] {
  color: #0f172a !important;
}

body.light-theme #ablationStudyModal [style*="color:#fff9c4"],
body.light-theme #ablationStudyModal [style*="color: #fff9c4"],
body.light-theme #ablationStudyModal [style*="color:#ffeb3b"],
body.light-theme #ablationStudyModal [style*="color: #ffeb3b"],
body.light-theme #ablationStudyModal [style*="color:#ffc107"],
body.light-theme #ablationStudyModal [style*="color: #ffc107"],
body.light-theme #ablationStudyModal [style*="color:#ffd54f"],
body.light-theme #ablationStudyModal [style*="color: #ffd54f"] {
  color: #b45309 !important;
}

body.light-theme #ablationStudyModal [style*="color:#00e5ff"],
body.light-theme #ablationStudyModal [style*="color: #00e5ff"] {
  color: #0891b2 !important;
}

body.light-theme #ablationStudyModal [style*="color:#ffa726"],
body.light-theme #ablationStudyModal [style*="color: #ffa726"] {
  color: #c2410c !important;
}

body.light-theme #ablationStudyModal [style*="color:#4caf50"],
body.light-theme #ablationStudyModal [style*="color: #4caf50"],
body.light-theme #ablationStudyModal [style*="color:#66ff88"],
body.light-theme #ablationStudyModal [style*="color: #66ff88"] {
  color: #15803d !important;
}

body.light-theme #ablationStudyModal [style*="color:#ff7777"],
body.light-theme #ablationStudyModal [style*="color: #ff7777"] {
  color: #dc2626 !important;
}

body.light-theme #ablationStudyModal [style*="color:#78909c"],
body.light-theme #ablationStudyModal [style*="color: #78909c"],
body.light-theme #ablationStudyModal [style*="color:#888"],
body.light-theme #ablationStudyModal [style*="color: #888"] {
  color: #475569 !important;
}

body.light-theme #ablationStudyModal button[style*="color:#fff"],
body.light-theme #ablationStudyModal button[style*="color: #fff"],
body.light-theme #ablationStudyModal button[style*="color:#ffffff"],
body.light-theme #ablationStudyModal button[style*="color: #ffffff"] {
  color: #0f172a !important;
}

body.light-theme #ablationStudyModal button[style*="background:#0f766e"],
body.light-theme #ablationStudyModal button[style*="background: #0f766e"],
body.light-theme #ablationStudyModal button[style*="linear-gradient(135deg, #ffeb3b"],
body.light-theme #ablationStudyModal button[style*="linear-gradient(135deg,#ffeb3b"] {
  color: #ffffff !important;
}

body.light-theme #ablationStudyModal h2,
body.light-theme #ablationStudyModal h3 {
  color: #0f766e !important;
}

body.light-theme input,
body.light-theme select,
body.light-theme textarea {
  background-color: var(--input-bg) !important;
  color: var(--input-text) !important;
  border-color: var(--border-main) !important;
}

body.light-theme .modal table {
  color: #0f172a !important;
}

body.light-theme .modal th,
body.light-theme .modal td {
  border-color: var(--table-border) !important;
}

body.light-theme .modal thead tr,
body.light-theme .modal tr[style*="background:#2d3748"],
body.light-theme .modal tr[style*="background: #2d3748"] {
  background: var(--table-head-bg) !important;
}

body.light-theme .modal [style*="color:#e2e8f0"],
body.light-theme .modal [style*="color: #e2e8f0"],
body.light-theme .modal [style*="color:#e0e0e0"],
body.light-theme .modal [style*="color: #e0e0e0"],
body.light-theme .modal [style*="color:#cbd5e1"],
body.light-theme .modal [style*="color: #cbd5e1"] {
  color: #0f172a !important;
}

body.light-theme .modal [style*="color:#90a4ae"],
body.light-theme .modal [style*="color: #90a4ae"],
body.light-theme .modal [style*="color:#78909c"],
body.light-theme .modal [style*="color: #78909c"],
body.light-theme .modal [style*="color:#607d8b"],
body.light-theme .modal [style*="color: #607d8b"],
body.light-theme .modal [style*="color:#546e7a"],
body.light-theme .modal [style*="color: #546e7a"],
body.light-theme .modal [style*="color:#a0aec0"],
body.light-theme .modal [style*="color: #a0aec0"],
body.light-theme .modal [style*="color:#9e9e9e"],
body.light-theme .modal [style*="color: #9e9e9e"] {
  color: #475569 !important;
}

body.light-theme .modal [style*="color:#f44336"],
body.light-theme .modal [style*="color: #f44336"],
body.light-theme .modal [style*="color:#f87171"],
body.light-theme .modal [style*="color: #f87171"] {
  color: #dc2626 !important;
}

body.light-theme .modal [style*="color:#ff9800"],
body.light-theme .modal [style*="color: #ff9800"],
body.light-theme .modal [style*="color:#ffa726"],
body.light-theme .modal [style*="color: #ffa726"],
body.light-theme .modal [style*="color:#fbbf24"],
body.light-theme .modal [style*="color: #fbbf24"] {
  color: #c2410c !important;
}

body.light-theme .modal [style*="color:#4caf50"],
body.light-theme .modal [style*="color: #4caf50"],
body.light-theme .modal [style*="color:#4ade80"],
body.light-theme .modal [style*="color: #4ade80"] {
  color: #15803d !important;
}

body.light-theme .modal [style*="color:#00e5ff"],
body.light-theme .modal [style*="color: #00e5ff"],
body.light-theme .modal [style*="color:#38bdf8"],
body.light-theme .modal [style*="color: #38bdf8"] {
  color: #0369a1 !important;
}

body.light-theme .modal [style*="color:#c084fc"],
body.light-theme .modal [style*="color: #c084fc"],
body.light-theme .modal [style*="color:#ab47bc"],
body.light-theme .modal [style*="color: #ab47bc"] {
  color: #7e22ce !important;
}

body.light-theme .modal [style*="background:rgba(255,255,255,0.03"],
body.light-theme .modal [style*="background: rgba(255,255,255,0.03"],
body.light-theme .modal [style*="background:rgba(255,255,255,0.04"],
body.light-theme .modal [style*="background: rgba(255,255,255,0.04"],
body.light-theme .modal [style*="background:rgba(255,255,255,0.05"],
body.light-theme .modal [style*="background: rgba(255,255,255,0.05"],
body.light-theme .modal [style*="background:rgba(255,255,255,0.06"],
body.light-theme .modal [style*="background: rgba(255,255,255,0.06"],
body.light-theme .modal [style*="background:rgba(0,0,0,0.1"],
body.light-theme .modal [style*="background: rgba(0,0,0,0.1"],
body.light-theme .modal [style*="background:rgba(0,0,0,0.15"],
body.light-theme .modal [style*="background: rgba(0,0,0,0.15"],
body.light-theme .modal [style*="background:rgba(0,0,0,0.2"],
body.light-theme .modal [style*="background: rgba(0,0,0,0.2"],
body.light-theme .modal [style*="background-color:#1a202c"],
body.light-theme .modal [style*="background-color: #1a202c"],
body.light-theme .modal [style*="background:#2d3748"],
body.light-theme .modal [style*="background: #2d3748"],
body.light-theme .modal [style*="background-color:#2d3748"],
body.light-theme .modal [style*="background-color: #2d3748"] {
  background: #f8fafc !important;
  background-color: #f8fafc !important;
  border-color: var(--border-main) !important;
}

body.light-theme #scenarioResultsModal {
  background-color: rgba(148, 163, 184, 0.28) !important;
}

body.light-theme #scenarioResultsModal .modal-content {
  background: #f8fafc !important;
  color: #0f172a !important;
  border-color: #9fb1c5 !important;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18) !important;
}

body.light-theme #scenarioResultsModal h2 {
  color: #0f766e !important;
}

body.light-theme #scenarioResultsModal h3,
body.light-theme #scenarioResultsModal table,
body.light-theme #scenarioResultsModal th,
body.light-theme #scenarioResultsModal td {
  color: #0f172a !important;
}

body.light-theme #scenarioResultsModal select {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #9fb1c5 !important;
}

body.light-theme #scenarioResultsModal button[style*="background:#1f2937"],
body.light-theme #scenarioResultsModal button[style*="background: #1f2937"] {
  background: #e8eef5 !important;
  color: #0f172a !important;
  border-color: #9fb1c5 !important;
}

body.light-theme #scenarioResultsModal button[style*="background:#0f766e"],
body.light-theme #scenarioResultsModal button[style*="background: #0f766e"],
body.light-theme #scenarioResultsModal button[style*="background:#0e7490"],
body.light-theme #scenarioResultsModal button[style*="background: #0e7490"] {
  background: #0f766e !important;
  color: #ffffff !important;
  border-color: #0d9488 !important;
}

body.light-theme #scenarioResultsModal [style*="background:var(--bg-main)"],
body.light-theme #scenarioResultsModal [style*="background: var(--bg-main)"] {
  background: #ffffff !important;
  border-color: #9fb1c5 !important;
  color: #0f172a !important;
}

body.light-theme #scenarioResultsModal [style*="background:#1f1608"],
body.light-theme #scenarioResultsModal [style*="background: #1f1608"],
body.light-theme #scenarioResultsModal [style*="background:#1c1007"],
body.light-theme #scenarioResultsModal [style*="background: #1c1007"],
body.light-theme #scenarioResultsModal [style*="background:#2b1603"],
body.light-theme #scenarioResultsModal [style*="background: #2b1603"],
body.light-theme #scenarioResultsModal [style*="background:#78350f"],
body.light-theme #scenarioResultsModal [style*="background: #78350f"] {
  background: #fff7ed !important;
  border-color: #fdba74 !important;
  color: #7c2d12 !important;
}

body.light-theme #scenarioResultsModal [style*="background:#042f2e"],
body.light-theme #scenarioResultsModal [style*="background: #042f2e"] {
  background: #ccfbf1 !important;
  border-color: #5eead4 !important;
  color: #134e4a !important;
}

body.light-theme #scenarioResultsModal [style*="background:#450a0a"],
body.light-theme #scenarioResultsModal [style*="background: #450a0a"] {
  background: #fee2e2 !important;
  border-color: #fca5a5 !important;
  color: #991b1b !important;
}

body.light-theme #scenarioResultsModal [style*="border:1px solid #1f2937"],
body.light-theme #scenarioResultsModal [style*="border: 1px solid #1f2937"] {
  border-color: #9fb1c5 !important;
}

body.light-theme #scenarioResultsModal [style*="color:#94a3b8"],
body.light-theme #scenarioResultsModal [style*="color: #94a3b8"],
body.light-theme #scenarioResultsModal [style*="color:#64748b"],
body.light-theme #scenarioResultsModal [style*="color: #64748b"],
body.light-theme #scenarioResultsModal [style*="color:#546e7a"],
body.light-theme #scenarioResultsModal [style*="color: #546e7a"] {
  color: #475569 !important;
}

body.light-theme #scenarioResultsModal [style*="color:#5eead4"],
body.light-theme #scenarioResultsModal [style*="color: #5eead4"],
body.light-theme #scenarioResultsModal [style*="color:#99f6e4"],
body.light-theme #scenarioResultsModal [style*="color: #99f6e4"] {
  color: #0f766e !important;
}

body.light-theme #scenarioResultsModal [style*="color:#86efac"],
body.light-theme #scenarioResultsModal [style*="color: #86efac"],
body.light-theme #scenarioResultsModal [style*="color:#4ade80"],
body.light-theme #scenarioResultsModal [style*="color: #4ade80"] {
  color: #047857 !important;
}

body.light-theme #scenarioResultsModal [style*="color:#fbbf24"],
body.light-theme #scenarioResultsModal [style*="color: #fbbf24"],
body.light-theme #scenarioResultsModal [style*="color:#fcd34d"],
body.light-theme #scenarioResultsModal [style*="color: #fcd34d"],
body.light-theme #scenarioResultsModal [style*="color:#fde68a"],
body.light-theme #scenarioResultsModal [style*="color: #fde68a"] {
  color: #b45309 !important;
}

body.light-theme #scenarioResultsModal [style*="color:#f87171"],
body.light-theme #scenarioResultsModal [style*="color: #f87171"],
body.light-theme #scenarioResultsModal [style*="color:#fca5a5"],
body.light-theme #scenarioResultsModal [style*="color: #fca5a5"],
body.light-theme #scenarioResultsModal [style*="color:#fecaca"],
body.light-theme #scenarioResultsModal [style*="color: #fecaca"] {
  color: #dc2626 !important;
}

body.light-theme #scenarioResultsModal [style*="color:#93c5fd"],
body.light-theme #scenarioResultsModal [style*="color: #93c5fd"] {
  color: #2563eb !important;
}

body.light-theme #scenarioResultsModal thead,
body.light-theme #scenarioResultsModal thead[style*="background:var(--bg-main)"],
body.light-theme #scenarioResultsModal thead[style*="background: var(--bg-main)"] {
  background: #e2e8f0 !important;
  color: #334155 !important;
}

body.light-theme #scenarioResultsModal tbody tr {
  background: #ffffff !important;
}

body.light-theme #scenarioResultsModal div[style*="overflow:auto"] {
  background: #ffffff !important;
  border-color: #9fb1c5 !important;
}

body.light-theme #scenarioResultsModal button[style*="background:#0f766e"] span,
body.light-theme #scenarioResultsModal button[style*="background: #0f766e"] span {
  color: #d1fae5 !important;
}

body.light-theme #scenarioResultsModal button[style*="background:#1f2937"] span,
body.light-theme #scenarioResultsModal button[style*="background: #1f2937"] span {
  color: #047857 !important;
}

body.light-theme #touPricingModal .modal-content,
body.light-theme #modeCurveModal .modal-content {
  background: #ffffff !important;
  color: #0f172a !important;
}

body.light-theme #touPricingModal h3,
body.light-theme #touPricingModal h4,
body.light-theme #touPricingModal table,
body.light-theme #touPricingModal th,
body.light-theme #touPricingModal td,
body.light-theme #modeCurveModal h2 {
  color: #0f172a !important;
}

body.light-theme #touPricingModal [style*="border-top: 1px solid #4a5568"],
body.light-theme #touPricingModal [style*="border-top:1px solid #4a5568"] {
  border-top-color: var(--table-border) !important;
}

body.light-theme #touPricingModal [style*="color:#f44336"],
body.light-theme #touPricingModal [style*="color: #f44336"] {
  color: #dc2626 !important;
}

body.light-theme #touPricingModal [style*="color:#ff9800"],
body.light-theme #touPricingModal [style*="color: #ff9800"] {
  color: #c2410c !important;
}

body.light-theme #touPricingModal [style*="color:#4caf50"],
body.light-theme #touPricingModal [style*="color: #4caf50"] {
  color: #15803d !important;
}

body.light-theme #sriModal > div {
  background: #edf3f8 !important;
}

body.light-theme #sriModal .sri-glass-card {
  background: #f7fafc !important;
  border-color: #cbd8e6 !important;
  color: #0f172a !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

body.light-theme #sriModal .sri-glass-card:hover {
  background: #eef4fa !important;
}

body.light-theme #sriModal .sri-card-label,
body.light-theme #sriModal .sri-card-unit,
body.light-theme #sriModalSubtitle,
body.light-theme #sri24hPlaceholder,
body.light-theme #sriRLPanel [style*="color:#78909c"],
body.light-theme #sriRLPanel [style*="color: #78909c"] {
  color: #475569 !important;
}

body.light-theme #sriModal .sri-score-ring {
  background: conic-gradient(var(--ring-color, #0f766e) var(--ring-pct, 0%), rgba(15, 23, 42, 0.10) 0%) !important;
}

body.light-theme #sriModal .sri-score-ring::after {
  background: #ffffff !important;
}

body.light-theme #sriModal .sri-tab {
  color: #475569 !important;
}

body.light-theme #sriModal .sri-tab.active {
  color: #0f766e !important;
  border-bottom-color: #0f766e !important;
}

body.light-theme #sriDualBody {
  background: #edf3f8 !important;
}

body.light-theme #sriModal [style*="background:rgba(255,255,255,0.03"],
body.light-theme #sriModal [style*="background: rgba(255,255,255,0.03"],
body.light-theme #sriModal [style*="background:rgba(255,255,255,0.04"],
body.light-theme #sriModal [style*="background: rgba(255,255,255,0.04"],
body.light-theme #sriModal [style*="background:rgba(0,0,0,0.15"],
body.light-theme #sriModal [style*="background: rgba(0,0,0,0.15"],
body.light-theme #sriModal [style*="background:rgba(0,0,0,0.1"],
body.light-theme #sriModal [style*="background: rgba(0,0,0,0.1"] {
  background: #e8eff6 !important;
  border-color: #c1cedd !important;
}

body.light-theme #sriModal canvas,
body.light-theme #modeCurveModal canvas {
  background: #f1f5f9 !important;
  border-radius: 10px;
}

body.light-theme #sriModal h2,
body.light-theme #sriModal h3,
body.light-theme #sriModal h4,
body.light-theme #sriModal table,
body.light-theme #sriModal th,
body.light-theme #sriModal td {
  color: #0f172a !important;
}

body.light-theme #sriModal th,
body.light-theme #sriModal td {
  border-color: #b6c6d6 !important;
}

body.light-theme #sriModal thead,
body.light-theme #sriModal thead tr {
  background: #dfe9f3 !important;
}

body.light-theme #sriTimeSlider {
  background: #dbeafe !important;
}

body.light-theme #sriTimeSlider::-webkit-slider-thumb {
  background: #0f766e !important;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.14) !important;
}

body.light-theme #v3DetailTableModal {
  background: #e8eff6 !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.20) !important;
}

body.light-theme #v3DetailTableModal table {
  background: #f3f7fb !important;
  color: #0f172a !important;
}

body.light-theme #v3DetailTableModal th {
  background: #d9e4ef !important;
  color: #1e293b !important;
  border-color: #94a3b8 !important;
  font-weight: 800 !important;
}

body.light-theme #v3DetailTableModal td {
  color: #1e293b !important;
  border-color: #b6c6d6 !important;
  font-weight: 650 !important;
}

body.light-theme #v3DetailTableModal [style*="color:#bdbdbd"],
body.light-theme #v3DetailTableModal [style*="color: #bdbdbd"],
body.light-theme #v3DetailTableModal [style*="color:#9e9e9e"],
body.light-theme #v3DetailTableModal [style*="color: #9e9e9e"],
body.light-theme #v3DetailTableModal [style*="color:#90a4ae"],
body.light-theme #v3DetailTableModal [style*="color: #90a4ae"],
body.light-theme #v3DetailTableModal [style*="color:#546e7a"],
body.light-theme #v3DetailTableModal [style*="color: #546e7a"],
body.light-theme #v3DetailTableModal [style*="color:var(--text-muted)"],
body.light-theme #v3DetailTableModal [style*="color: var(--text-muted)"] {
  color: #334155 !important;
}

body.light-theme #v3DetailTableModal [style*="color:var(--text-main)"],
body.light-theme #v3DetailTableModal [style*="color: var(--text-main)"],
body.light-theme #v3DetailTableModal [style*="color:#e0e0e0"],
body.light-theme #v3DetailTableModal [style*="color: #e0e0e0"] {
  color: #0f172a !important;
}

body.light-theme #v3DetailTableModal [style*="background:rgba(255,255,255,0.02"],
body.light-theme #v3DetailTableModal [style*="background: rgba(255,255,255,0.02"],
body.light-theme #v3DetailTableModal [style*="background:rgba(255,255,255,0.03"],
body.light-theme #v3DetailTableModal [style*="background: rgba(255,255,255,0.03"],
body.light-theme #v3DetailTableModal [style*="background:rgba(255,255,255,0.04"],
body.light-theme #v3DetailTableModal [style*="background: rgba(255,255,255,0.04"],
body.light-theme #v3DetailTableModal [style*="background:rgba(0,229,255,0.04"],
body.light-theme #v3DetailTableModal [style*="background: rgba(0,229,255,0.04"],
body.light-theme #v3DetailTableModal [style*="background:rgba(0,229,255,0.06"],
body.light-theme #v3DetailTableModal [style*="background: rgba(0,229,255,0.06"] {
  background: #edf4fa !important;
}

body.light-theme #v3DetailTableModal [style*="background:rgba(248,113,113"],
body.light-theme #v3DetailTableModal [style*="background: rgba(248,113,113"] {
  background: #fee2e2 !important;
}

body.light-theme #v3DetailTableModal [style*="background:rgba(251,191,36"],
body.light-theme #v3DetailTableModal [style*="background: rgba(251,191,36"] {
  background: #fef3c7 !important;
}

body.light-theme #v3DetailTableModal [style*="background:rgba(74,222,128"],
body.light-theme #v3DetailTableModal [style*="background: rgba(74,222,128"] {
  background: #dcfce7 !important;
}

body.light-theme #v3DetailTableModal [style*="color:#4ade80"],
body.light-theme #v3DetailTableModal [style*="color: #4ade80"],
body.light-theme #v3DetailTableModal [style*="color:#4caf50"],
body.light-theme #v3DetailTableModal [style*="color: #4caf50"] {
  color: #15803d !important;
}

body.light-theme #v3DetailTableModal [style*="color:#fbbf24"],
body.light-theme #v3DetailTableModal [style*="color: #fbbf24"],
body.light-theme #v3DetailTableModal [style*="color:#ff9800"],
body.light-theme #v3DetailTableModal [style*="color: #ff9800"] {
  color: #b45309 !important;
}

body.light-theme #v3DetailTableModal [style*="color:#f87171"],
body.light-theme #v3DetailTableModal [style*="color: #f87171"] {
  color: #dc2626 !important;
}

body.light-theme #v3DetailTableModal [style*="color:#00e5ff"],
body.light-theme #v3DetailTableModal [style*="color: #00e5ff"],
body.light-theme #v3DetailTableModal [style*="color:#38bdf8"],
body.light-theme #v3DetailTableModal [style*="color: #38bdf8"] {
  color: #0369a1 !important;
}

body.light-theme #flexGridAllocModal {
  background: rgba(226, 232, 240, 0.72) !important;
}

body.light-theme #flexGridAllocModal > div,
body.light-theme #flexGridAllocModal [style*="background: linear-gradient(135deg, #1a1a2e"],
body.light-theme #flexGridAllocModal [style*="background:linear-gradient(135deg, #1a1a2e"] {
  background: #e8eff6 !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.20) !important;
}

body.light-theme #flexGridAllocModal h2,
body.light-theme #flexGridAllocModal h3,
body.light-theme #flexGridAllocModal table,
body.light-theme #flexGridAllocModal th,
body.light-theme #flexGridAllocModal td {
  color: #0f172a !important;
}

body.light-theme #flexGridAllocModal table {
  background: #f3f7fb !important;
}

body.light-theme #flexGridAllocModal thead,
body.light-theme #flexGridAllocModal thead tr,
body.light-theme #flexGridAllocModal [style*="background:var(--shadow-color)"],
body.light-theme #flexGridAllocModal [style*="background: var(--shadow-color)"] {
  background: #dbe7f2 !important;
}

body.light-theme #flexGridAllocModal th,
body.light-theme #flexGridAllocModal td {
  border-color: #b6c6d6 !important;
}

body.light-theme #flexGridAllocModal [style*="background: rgba(0,0,0,0.35"],
body.light-theme #flexGridAllocModal [style*="background:rgba(0,0,0,0.35"],
body.light-theme #flexGridAllocModal [style*="background: rgba(0,0,0,0.3"],
body.light-theme #flexGridAllocModal [style*="background:rgba(0,0,0,0.3"],
body.light-theme #flexGridAllocModal [style*="background: rgba(0,0,0,0.15"],
body.light-theme #flexGridAllocModal [style*="background:rgba(0,0,0,0.15"],
body.light-theme #flexGridAllocModal [style*="background: rgba(0,0,0,0.1"],
body.light-theme #flexGridAllocModal [style*="background:rgba(0,0,0,0.1"],
body.light-theme #flexGridAllocModal [style*="background:#151530"],
body.light-theme #flexGridAllocModal [style*="background: #151530"],
body.light-theme #flexGridAllocModal [style*="background:#1a1a2e"],
body.light-theme #flexGridAllocModal [style*="background: #1a1a2e"],
body.light-theme #flexGridAllocModal [style*="background:#1a1a30"],
body.light-theme #flexGridAllocModal [style*="background: #1a1a30"],
body.light-theme #flexGridAllocModal [style*="background:#1e1e38"],
body.light-theme #flexGridAllocModal [style*="background: #1e1e38"] {
  background: #f3f7fb !important;
}

body.light-theme #flexGridAllocModal [style*="background: rgba(255,255,255,0.02"],
body.light-theme #flexGridAllocModal [style*="background:rgba(255,255,255,0.02"],
body.light-theme #flexGridAllocModal [style*="background: rgba(255,255,255,0.03"],
body.light-theme #flexGridAllocModal [style*="background:rgba(255,255,255,0.03"],
body.light-theme #flexGridAllocModal [style*="background: rgba(255,255,255,0.06"],
body.light-theme #flexGridAllocModal [style*="background:rgba(255,255,255,0.06"],
body.light-theme #flexGridAllocModal [style*="background: rgba(255,255,255,0.08"],
body.light-theme #flexGridAllocModal [style*="background:rgba(255,255,255,0.08"],
body.light-theme #flexGridAllocModal [style*="background: rgba(255,255,255,0.1"],
body.light-theme #flexGridAllocModal [style*="background:rgba(255,255,255,0.1"] {
  background: #e1eaf3 !important;
}

body.light-theme #flexGridAllocModal [style*="border:1px solid rgba(255,255,255"],
body.light-theme #flexGridAllocModal [style*="border: 1px solid rgba(255,255,255"],
body.light-theme #flexGridAllocModal [style*="border-bottom:1px solid rgba(255,255,255"],
body.light-theme #flexGridAllocModal [style*="border-bottom: 1px solid rgba(255,255,255"],
body.light-theme #flexGridAllocModal [style*="border-top:2px solid rgba(0,229,255"],
body.light-theme #flexGridAllocModal [style*="border-top: 2px solid rgba(0,229,255"],
body.light-theme #flexGridAllocModal [style*="border-bottom:2px solid rgba(0,229,255"],
body.light-theme #flexGridAllocModal [style*="border-bottom: 2px solid rgba(0,229,255"] {
  border-color: #b6c6d6 !important;
}

body.light-theme #flexGridAllocModal [style*="color:#e0e0e0"],
body.light-theme #flexGridAllocModal [style*="color: #e0e0e0"],
body.light-theme #flexGridAllocModal [style*="color:#cbd5e1"],
body.light-theme #flexGridAllocModal [style*="color: #cbd5e1"],
body.light-theme #flexGridAllocModal [style*="color:#fff"],
body.light-theme #flexGridAllocModal [style*="color: #fff"] {
  color: #0f172a !important;
}

body.light-theme #flexGridAllocModal [style*="color:#aaa"],
body.light-theme #flexGridAllocModal [style*="color: #aaa"],
body.light-theme #flexGridAllocModal [style*="color:#888"],
body.light-theme #flexGridAllocModal [style*="color: #888"],
body.light-theme #flexGridAllocModal [style*="color:#666"],
body.light-theme #flexGridAllocModal [style*="color: #666"] {
  color: #334155 !important;
}

body.light-theme #flexGridAllocModal [style*="color:#00e5ff"],
body.light-theme #flexGridAllocModal [style*="color: #00e5ff"] {
  color: #0369a1 !important;
}

body.light-theme #flexGridAllocModal [style*="color:#ffeb3b"],
body.light-theme #flexGridAllocModal [style*="color: #ffeb3b"],
body.light-theme #flexGridAllocModal [style*="color:#ffd54f"],
body.light-theme #flexGridAllocModal [style*="color: #ffd54f"],
body.light-theme #flexGridAllocModal [style*="color:#ffb74d"],
body.light-theme #flexGridAllocModal [style*="color: #ffb74d"],
body.light-theme #flexGridAllocModal [style*="color:#ffc107"],
body.light-theme #flexGridAllocModal [style*="color: #ffc107"],
body.light-theme #flexGridAllocModal [style*="color:#ff9800"],
body.light-theme #flexGridAllocModal [style*="color: #ff9800"] {
  color: #b45309 !important;
}

body.light-theme #flexGridAllocModal [style*="color:#66ff88"],
body.light-theme #flexGridAllocModal [style*="color: #66ff88"],
body.light-theme #flexGridAllocModal [style*="color:#69f0ae"],
body.light-theme #flexGridAllocModal [style*="color: #69f0ae"],
body.light-theme #flexGridAllocModal [style*="color:#4caf50"],
body.light-theme #flexGridAllocModal [style*="color: #4caf50"],
body.light-theme #flexGridAllocModal [style*="color:#81c784"],
body.light-theme #flexGridAllocModal [style*="color: #81c784"] {
  color: #15803d !important;
}

body.light-theme #flexGridAllocModal [style*="color:#ff7777"],
body.light-theme #flexGridAllocModal [style*="color: #ff7777"],
body.light-theme #flexGridAllocModal [style*="color:#ff8a80"],
body.light-theme #flexGridAllocModal [style*="color: #ff8a80"],
body.light-theme #flexGridAllocModal [style*="color:#f44336"],
body.light-theme #flexGridAllocModal [style*="color: #f44336"],
body.light-theme #flexGridAllocModal [style*="color:#ef9a9a"],
body.light-theme #flexGridAllocModal [style*="color: #ef9a9a"] {
  color: #dc2626 !important;
}

body.light-theme #flexGridAllocModal [style*="color:#ba68c8"],
body.light-theme #flexGridAllocModal [style*="color: #ba68c8"],
body.light-theme #flexGridAllocModal [style*="color:#c084fc"],
body.light-theme #flexGridAllocModal [style*="color: #c084fc"] {
  color: #7e22ce !important;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

body.light-theme ::-webkit-scrollbar-track {
  background: #e2e8f0;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

body.light-theme ::-webkit-scrollbar-thumb {
  background: #cbd5e1;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Highlighted Feeder Style */
.highlighted-feeder {
  stroke: var(--accent-color) !important;
  stroke-width: 4px !important;
  filter: drop-shadow(0 0 5px var(--accent-color));
  animation: pulse-line 1.5s infinite;
}

@keyframes pulse-line {
  0% {
    stroke-opacity: 1;
  }

  50% {
    stroke-opacity: 0.5;
  }

  100% {
    stroke-opacity: 1;
  }
}

/* Scenario Scheduler Timeline UI Styles */
.draggable-event {
  transition: transform 0.2s, box-shadow 0.2s;
  user-select: none;
}

.draggable-event:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.timeline-track {
  display: flex;
  position: relative;
}

.timeline-event-block {
  position: absolute;
  top: 10px;
  bottom: 10px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  color: white;
  cursor: grab;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  transition: box-shadow 0.2s;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: none;
  touch-action: none;
}

.timeline-event-block:active {
  cursor: grabbing;
}

.timeline-event-block.dragging {
  z-index: 20;
  box-shadow: 0 8px 18px rgba(0,0,0,0.45);
}

.timeline-event-block:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.6);
  z-index: 10;
}

.timeline-event-block .resize-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 8px;
  cursor: col-resize;
  background: rgba(255, 255, 255, 0.2);
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 2;
}

.timeline-event-block:hover .resize-handle {
  opacity: 1;
}

.timeline-event-block .resize-handle.left {
  left: 0;
}

.timeline-event-block .resize-handle.right {
  right: 0;
}

.timeline-event-block .delete-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  background: rgba(0,0,0,0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 3;
}

.timeline-event-block:hover .delete-btn {
  opacity: 1;
}

.timeline-event-block .delete-btn:hover {
  background: rgba(255,0,0,0.8);
}


/* Make SRI Modal Title gradient highly visible in both dark and light modes */
#sriModalTitle {
  background: linear-gradient(135deg, #00e5ff, #00e676) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
}

body.light-theme #sriModalTitle {
  background: linear-gradient(135deg, #0284c7, #0f766e) !important; /* Beautiful deep ocean blue-cyan to rich dark emerald teal! */
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
}
