/* Mediation Visualization Tool - Custom Styles */

/* Inputs Panel - unified input section */
.inputs-panel .card {
  margin-bottom: 1.5rem;
}

.inputs-panel .card:last-child {
  margin-bottom: 0;
}

.inputs-panel .card h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--app-text);
  font-size: 1.1rem;
}

/* Scenario Section (matches pattern from other apps) */
.scenario-section .card {
  padding: 1.5rem;
}

.scenario-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.scenario-controls label {
  font-weight: 500;
  white-space: nowrap;
}

.scenario-controls select {
  flex: 1;
  min-width: 200px;
  max-width: 400px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--app-border);
  border-radius: 6px;
  font-size: 0.95rem;
  background: white;
}

.scenario-controls select:focus {
  outline: none;
  border-color: var(--app-accent);
  box-shadow: 0 0 0 2px rgba(42, 125, 225, 0.2);
}

/* Badge variations */
.badge--secondary {
  background: #e2e8f0;
  color: #475569;
}

/* Callout boxes */
.callout {
  padding: 1rem;
  border-radius: 8px;
  margin: 1rem 0;
}

.callout--info {
  background: #f0f9ff;
  border-left: 4px solid #3b82f6;
}

.callout--warning {
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
}

.callout p {
  margin: 0;
}

/* Color classes for inline text */
.color-direct {
  color: #2a7de1;
  font-weight: 600;
}

.color-indirect {
  color: #f97316;
  font-weight: 600;
}

.color-total {
  color: #1f2937;
  font-weight: 600;
}

/* Model Types Grid */
.model-types-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.model-type-card {
  background: #f8fafc;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  padding: 1rem;
}

.model-type-card h4 {
  margin: 0 0 0.5rem 0;
  color: var(--app-accent);
}

.model-type-card .equation {
  margin: 0.5rem 0;
}

/* Configuration Section */
.config-row {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.config-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.config-group select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--app-border);
  border-radius: 6px;
  font-size: 1rem;
  min-width: 280px;
}

/* Moderation Controls */
.moderation-controls {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--app-border);
}

.toggle-group {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.toggle-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.toggle-option input[type="checkbox"],
.toggle-option input[type="radio"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Display Options Controls */
.display-options-controls {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--app-border);
}

.display-options-controls > label {
  display: block;
  margin-bottom: 0.75rem;
}

.display-options-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 0.75rem;
}

/* Uncertainty Controls */
.uncertainty-controls {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--app-border);
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: center;
}

.uncertainty-type-group {
  display: flex;
  gap: 1rem;
}

.uncertainty-type-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

/* Coefficient Grid */
.coefficient-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.coefficient-grid.parallel-grid {
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 768px) {
  .coefficient-grid.parallel-grid {
    grid-template-columns: 1fr;
  }
}

.coef-group {
  background: #f8fafc;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  padding: 1rem;
}

.coef-group h4 {
  margin: 0 0 1rem 0;
  color: var(--app-text);
  font-size: 1rem;
}

.coef-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.coef-input {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.coef-input label {
  font-size: 0.85rem;
  color: var(--app-muted);
}

.coef-input input {
  padding: 0.5rem;
  border: 1px solid var(--app-border);
  border-radius: 4px;
  font-size: 1rem;
  width: 100%;
}

.coef-input input:focus {
  outline: none;
  border-color: var(--app-accent);
  box-shadow: 0 0 0 2px rgba(42, 125, 225, 0.2);
}

.coef-formula {
  margin: 0.75rem 0 0 0;
  padding: 0.5rem;
  background: #e0f2fe;
  border-radius: 4px;
  font-family: 'Fira Code', monospace;
  font-size: 0.9rem;
  color: var(--app-accent-dark);
}

.moderated-inputs {
  background: #fef3c7;
  padding: 0.75rem;
  border-radius: 4px;
  margin-top: 0.5rem;
}

.moderated-inputs.hidden {
  display: none;
}

/* Mediator blocks for parallel model */
.mediator-block {
  background: #f8fafc;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  padding: 1rem;
}

.mediator-label {
  margin: 0 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--app-accent);
  color: var(--app-accent);
}

.direct-path-parallel {
  grid-column: 1 / -1;
}

/* Interactive Controls */
.controls-card {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.slider-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.slider-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.slider-group label {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slider-value {
  font-family: 'Fira Code', monospace;
  font-weight: 600;
  color: var(--app-accent);
  background: #e0f2fe;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.slider-row {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.slider-row input[type="range"] {
  flex: 1;
  height: 8px;
  -webkit-appearance: none;
  appearance: none;
  background: #e2e8f0;
  border-radius: 4px;
  outline: none;
}

.slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: var(--app-accent);
  border-radius: 50%;
  cursor: pointer;
}

.slider-row input[type="range"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.slider-row input[type="number"] {
  width: 80px;
  padding: 0.5rem;
  border: 1px solid var(--app-border);
  border-radius: 4px;
  font-size: 1rem;
  text-align: center;
}

.slider-row input[type="number"]:disabled {
  background: #f1f5f9;
  cursor: not-allowed;
}

#w-disabled-note {
  font-size: 0.85rem;
  font-style: italic;
}

/* Effect Summary Panel */
.effect-summary-panel {
  background: #f8fafc;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  padding: 1.5rem;
}

.effect-summary-panel h4,
.effect-summary-panel h3 {
  margin: 0 0 1rem 0;
  color: var(--app-text);
}

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

/* Vertical grid for side placement */
.effect-grid-vertical {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.effect-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
}

/* Enhanced color scheme for better distinction */
.effect-direct {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(37, 99, 235, 0.15) 100%);
  border: 2px solid #2563eb;
  border-left: 4px solid #2563eb;
}

.effect-indirect {
  background: linear-gradient(135deg, rgba(234, 88, 12, 0.08) 0%, rgba(234, 88, 12, 0.15) 100%);
  border: 2px solid #ea580c;
  border-left: 4px solid #ea580c;
}

.effect-total {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.08) 0%, rgba(15, 23, 42, 0.12) 100%);
  border: 2px solid #0f172a;
  border-left: 4px solid #0f172a;
}

.effect-label {
  font-size: 0.85rem;
  color: var(--app-muted);
  font-weight: 500;
}

.effect-value {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: 'Fira Code', monospace;
}

.effect-direct .effect-value {
  color: var(--app-accent);
}

.effect-indirect .effect-value {
  color: #f97316;
}

.effect-total .effect-value {
  color: #1f2937;
}

.effect-ci {
  font-size: 0.8rem;
  color: var(--app-muted);
  font-family: 'Fira Code', monospace;
}

/* Visualization Section */
.viz-row {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.viz-row-2col {
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.viz-row-full {
  grid-template-columns: 1fr;
}

@media (max-width: 900px) {
  .viz-row-2col {
    grid-template-columns: 1fr;
  }
}

.viz-card {
  min-height: 300px;
}

.viz-card h3 {
  margin: 0 0 1rem 0;
  color: var(--app-text);
}

.chart-container {
  width: 100%;
  height: 350px;
}

.chart-wide {
  height: 400px;
}

.diagram-container {
  width: 100%;
  height: 350px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-note {
  margin: 0.75rem 0 0 0;
  font-size: 0.85rem;
}

.chart-note .info-link {
  color: var(--app-accent, #2a7de1);
  text-decoration: none;
  font-size: 0.8rem;
  margin-left: 0.5rem;
  opacity: 0.8;
}

.chart-note .info-link:hover {
  opacity: 1;
  text-decoration: underline;
}

/* Structural Diagram SVG Styles */
.diagram-node {
  cursor: default;
}

.diagram-node circle {
  stroke-width: 2;
}

.diagram-node text {
  font-family: Inter, sans-serif;
  font-size: 14px;
  font-weight: 600;
  fill: #1f2937;
}

.diagram-arrow {
  stroke-width: 2;
  fill: none;
}

.diagram-arrow-direct {
  stroke: #2a7de1;
}

.diagram-arrow-indirect {
  stroke: #f97316;
}

.diagram-label {
  font-family: 'Fira Code', monospace;
  font-size: 12px;
  fill: #475569;
}

/* Interpretation Section */
.interpretation-content {
  padding: 1rem;
  background: #f8fafc;
  border-radius: 8px;
  border-left: 4px solid var(--app-accent);
  margin-bottom: 1rem;
}

.interpretation-content p {
  margin: 0.5rem 0;
}

.interpretation-content p:first-child {
  margin-top: 0;
}

.interpretation-content strong {
  color: var(--app-accent);
}

.export-controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Technical Documentation */
.technical-panel {
  margin-bottom: 0.5rem;
}

.technical-panel summary {
  cursor: pointer;
  padding: 1rem;
  background: #f1f5f9;
  border-radius: 6px;
  font-weight: 600;
  -webkit-user-select: none;
  user-select: none;
}

.technical-panel summary:hover {
  background: #e2e8f0;
}

.technical-panel[open] summary {
  border-radius: 6px 6px 0 0;
  margin-bottom: 0;
}

.documentation-content {
  padding: 1.5rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0 0 6px 6px;
}

.documentation-content h4 {
  margin: 1.5rem 0 0.75rem 0;
  color: var(--app-text);
}

.documentation-content h4:first-child {
  margin-top: 0;
}

.effect-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.effect-table th,
.effect-table td {
  padding: 0.75rem;
  text-align: left;
  border: 1px solid var(--app-border);
}

.effect-table th {
  background: #e2e8f0;
  font-weight: 600;
}

.effect-table tr:nth-child(even) {
  background: #f8fafc;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}

.feature-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #e2e8f0;
}

.feature-list li:last-child {
  border-bottom: none;
}

.feature-list li.included {
  color: var(--app-success);
}

.feature-list li.excluded {
  color: var(--app-muted);
}

/* Scenario Section */
.scenario-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.scenario-button {
  padding: 0.75rem 1rem;
  background: #f1f5f9;
  border: 1px solid var(--app-border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.scenario-button:hover {
  background: #e2e8f0;
  border-color: var(--app-accent);
}

.scenario-button.active {
  background: var(--app-accent);
  color: white;
  border-color: var(--app-accent);
}

/* Additional Notes styling */
.additional-notes {
  margin-top: 1rem;
  background: #f8fafc;
  border-radius: 8px;
  overflow: hidden;
}

.additional-notes summary {
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-weight: 600;
  -webkit-user-select: none;
  user-select: none;
}

.additional-notes summary:hover {
  background: #f1f5f9;
}

.additional-notes[open] summary {
  border-bottom: 1px solid var(--app-border);
}

.additional-notes > *:not(summary) {
  padding: 0 1rem;
}

.additional-notes > *:last-child {
  padding-bottom: 1rem;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .coefficient-grid {
    grid-template-columns: 1fr;
  }
  
  .coef-row {
    flex-direction: column;
  }
  
  .effect-grid {
    grid-template-columns: 1fr;
  }
  
  .slider-controls {
    grid-template-columns: 1fr;
  }
  
  .scenario-buttons {
    flex-direction: column;
  }
  
  .scenario-button {
    width: 100%;
  }
}

/* Animation for showing/hiding sections */
.fade-in {
  animation: fadeIn 0.3s ease-in;
}

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

/* Print styles */
@media print {
  .auth-bar,
  .export-controls,
  .scenario-buttons,
  .slider-controls {
    display: none;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid #e2e8f0;
  }
}

/* ============================================
   IMPORT PARAMETERS SECTION
   ============================================ */

.import-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.import-tab {
  padding: 0.75rem 1.25rem;
  background: #f1f5f9;
  border: 1px solid var(--app-border);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.import-tab:hover {
  background: #e2e8f0;
}

.import-tab.active {
  background: var(--app-accent);
  color: white;
  border-color: var(--app-accent);
}

/* Import details (collapsible) */
.import-details {
  margin-bottom: 1.5rem;
}

.import-details summary {
  cursor: pointer;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border-radius: 6px;
  color: var(--app-text-muted);
}

.import-details summary:hover {
  background: #e2e8f0;
}

.import-details[open] summary {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  margin-bottom: 1rem;
}

.import-panel {
  display: none;
  margin-top: 1rem;
}

.import-panel.active {
  display: block;
}

.import-textarea {
  width: 100%;
  min-height: 180px;
  padding: 1rem;
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 0.85rem;
  border: 1px solid var(--app-border);
  border-radius: 6px;
  resize: vertical;
  background: #f8fafc;
}

.import-textarea:focus {
  outline: none;
  border-color: var(--app-accent);
  box-shadow: 0 0 0 2px rgba(42, 125, 225, 0.2);
}

.import-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.import-status {
  font-size: 0.9rem;
}

.import-status.success {
  color: var(--app-success);
}

.import-status.error {
  color: var(--app-danger);
}

.template-downloads {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.template-example {
  margin-top: 1rem;
  background: #f8fafc;
  border-radius: 6px;
}

.template-example summary {
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-weight: 500;
}

.json-example {
  margin: 0;
  padding: 1rem;
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 0 0 6px 6px;
  font-size: 0.8rem;
  overflow-x: auto;
}

/* ============================================
   RICH SCENARIO DESCRIPTIONS
   ============================================ */

.scenario-description {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: white;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  animation: fadeIn 0.3s ease;
}

.scenario-description:empty {
  display: none;
  padding: 0;
  margin: 0;
  border: none;
}

.scenario-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--app-border);
  margin-bottom: 1rem;
}

.scenario-icon {
  font-size: 2rem;
}

.scenario-header h4 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--app-text);
  flex-grow: 1;
}

.scenario-badge {
  background: var(--app-accent);
  color: white;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.scenario-badge.pattern-full {
  background: #059669;
}

.scenario-badge.pattern-partial {
  background: #0284c7;
}

.scenario-badge.pattern-moderated {
  background: #7c3aed;
}

.scenario-badge.pattern-suppression {
  background: #dc2626;
}

.scenario-badge.pattern-parallel {
  background: #ea580c;
}

.scenario-source {
  background: #f1f5f9;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  border-left: 3px solid var(--app-accent);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.scenario-source strong {
  color: var(--app-accent);
}

.scenario-intro {
  color: var(--app-text);
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.scenario-variables {
  margin: 1.5rem 0;
}

.scenario-variables h5 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.75rem 0;
  color: var(--app-text);
  font-size: 1rem;
}

.scenario-var-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.scenario-var-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

.scenario-var-table tr:last-child td {
  border-bottom: none;
}

.scenario-var-table td:first-child {
  width: 160px;
  white-space: nowrap;
}

.var-tag {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: 'Fira Code', monospace;
}

.var-tag.predictor {
  background: #cce5ff;
  color: #004085;
  border: 1px solid #b8daff;
}

.var-tag.mediator {
  background: #ffedd5;
  color: #9a3412;
  border: 1px solid #fed7aa;
}

.var-tag.outcome {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.var-tag.moderator {
  background: #e9d5ff;
  color: #6b21a8;
  border: 1px solid #d8b4fe;
}

.scenario-coefficients {
  background: #f8fafc;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  padding: 1.25rem;
  margin: 1.5rem 0;
  overflow-x: auto;
}

.scenario-coefficients h5 {
  margin: 0 0 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.coef-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: 500px;
}

.coef-table th,
.coef-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

.coef-table th {
  background: #e2e8f0;
  font-weight: 600;
  color: #64748b;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.coef-table tbody tr:hover {
  background: #f8fafc;
}

.coef-table td:first-child {
  font-weight: 600;
  color: var(--app-text);
  white-space: nowrap;
}

.coef-table td:last-child {
  font-size: 0.8rem;
  color: #64748b;
}

.coef-table .significant {
  color: #059669;
  font-weight: 600;
}

.coef-table .not-significant {
  color: #9ca3af;
}

.effect-notes {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.6;
}

.effect-notes code {
  background: #e2e8f0;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.82em;
}

.effect-notes strong {
  color: #334155;
}

.effect-negative {
  color: #dc2626;
  font-weight: 600;
}

.scenario-context {
  margin: 1.5rem 0;
}

.scenario-context h5 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.75rem 0;
}

.context-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.context-item {
  background: white;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.context-item strong {
  display: block;
  font-size: 0.8rem;
  color: var(--app-muted);
  margin-bottom: 0.25rem;
}

.context-item span {
  color: var(--app-text);
  font-weight: 600;
}

.scenario-insights {
  margin: 1.5rem 0;
}

.scenario-insights h5 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.75rem 0;
}

.scenario-insights ul {
  margin: 0;
  padding-left: 1.5rem;
  color: var(--app-text);
}

.scenario-insights li {
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.scenario-questions {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  padding: 1.25rem;
  margin-top: 1.5rem;
}

.scenario-questions h5 {
  margin: 0 0 0.75rem 0;
  color: #0369a1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.scenario-questions ol {
  margin: 0;
  padding-left: 1.5rem;
  color: #0c4a6e;
}

.scenario-questions li {
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.scenario-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--app-border);
}
/* Mobile responsiveness for scenario tables */
@media (max-width: 768px) {
  .scenario-description {
    padding: 1rem;
  }
  
  .scenario-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .scenario-header h4 {
    font-size: 1.1rem;
  }
  
  .scenario-coefficients {
    padding: 0.75rem;
    margin: 1rem 0;
  }
  
  .coef-table {
    font-size: 0.8rem;
  }
  
  .coef-table th,
  .coef-table td {
    padding: 0.4rem 0.5rem;
  }
  
  .context-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
  
  .context-item {
    padding: 0.5rem 0.75rem;
  }
  
  .scenario-var-table td:first-child {
    width: auto;
  }
  
  .var-tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
  }
}

/* ============================================
   Mini-Diagrams
   ============================================ */

.mini-diagram-container {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mini-diagram-container svg {
  display: block;
}

/* Config row with diagram (model type dropdown) */
.config-row-with-diagram {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.config-row-with-diagram .config-row {
  flex: 1;
}

/* Moderation toggle diagrams */
.toggle-group-with-diagrams {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toggle-option-with-diagram {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toggle-option-with-diagram label {
  min-width: 140px;
}

.mini-diagram-mod-container {
  opacity: 0.7;
  transition: opacity 0.2s;
}

.toggle-option-with-diagram:hover .mini-diagram-mod-container {
  opacity: 1;
}

/* Path coefficient diagrams */
.coef-group-with-diagram {
  position: relative;
}

.coef-header-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.coef-header-row h4 {
  margin: 0;
}

.mediator-header-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.mediator-header-row .mediator-label {
  margin: 0;
}

.mini-diagram-coef-container {
  opacity: 0.8;
}

/* Responsive adjustments for mini-diagrams */
@media (max-width: 768px) {
  .config-row-with-diagram {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .toggle-option-with-diagram {
    flex-wrap: wrap;
  }
  
  .mini-diagram-container svg {
    transform: scale(0.85);
    transform-origin: left center;
  }
}