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

.manual-card .hint {
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.manual-controls {
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.example-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.data-actions {
  margin-top: 1rem;
  border-top: 1px solid var(--app-border);
  padding-top: 1rem;
}

.template-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}
.column-selectors {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.regression-equation-card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}
.regression-equation-text {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.1rem;
  background: #f1f4f8;
  padding: 1rem;
  border-radius: 8px;
  color: #1e40af;
  margin: 0;
  text-align: center;
}
.regression-equation-text em {
  font-style: normal;
  color: #1d4ed8; /* A slightly different blue to stand out */
}
.tool-directory,
.chart-card,
.metrics-panel,
.summary-section {
  /* Rely on shared styles; this file only tweaks layout where needed. */
}
.predictor-list.stacked .predictor-row.stacked-row {
  display: block;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 8px;
}

.predictor-row.stacked-row label {
  display: inline-block;
  margin-right: 8px;
}

.predictor-row.stacked-row .predictor-type,
.predictor-row.stacked-row .predictor-ref-wrapper {
  display: inline-block;
  margin-right: 8px;
  margin-top: 6px;
}

.predictor-row.stacked-row .predictor-ref-wrapper {
  margin-left: 4px;
}

.effect-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.effect-controls .range-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.effect-controls .custom-range {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.effect-nonfocal-levels {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.effect-nonfocal-levels label {
  font-size: 0.875rem;
}

.effect-constants-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px 12px;
  background: #f9fafb;
  margin-top: 8px;
}

.effect-constants-card h4 {
  margin: 0 0 4px 0;
  font-size: 0.95rem;
}

/* Loading overlay for model fitting */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-overlay.active {
  display: flex;
}

.loading-content {
  background: #ffffff;
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.25);
  text-align: center;
  max-width: 320px;
}

/* ===== PSM-Specific Styles ===== */

/* Variable selection grid for PSM */
.psm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.covariates-column {
  grid-column: span 2;
}

@media (max-width: 600px) {
  .covariates-column {
    grid-column: span 1;
  }
}

/* Matching options grid */
.matching-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.matching-option {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.matching-option label {
  font-weight: 500;
}

.matching-option input[type="number"] {
  max-width: 120px;
}

/* Matching summary stats grid */
.matching-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.stat-item {
  text-align: center;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.stat-label {
  display: block;
  font-size: 0.85rem;
  color: var(--app-muted);
  margin-bottom: 0.25rem;
}

.stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--app-text);
}

/* ATT display */
.att-display {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: flex-start;
}

.att-main {
  flex: 0 0 auto;
}

.att-label {
  display: block;
  font-size: 0.9rem;
  color: var(--app-muted);
  margin-bottom: 0.25rem;
}

.att-value {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--app-accent);
}

.att-details {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.att-detail {
  font-size: 0.95rem;
}

.att-detail .label {
  color: var(--app-muted);
  margin-right: 0.5rem;
}

/* Outcome means */
.outcome-means-grid {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  padding-top: 1rem;
  border-top: 1px solid var(--app-border);
}

.outcome-mean .label {
  color: var(--app-muted);
  margin-right: 0.5rem;
}

/* Balance table styling */
.balance-table td.smd-good {
  color: #059669;
  font-weight: 600;
}

.balance-table td.smd-ok {
  color: #d97706;
  font-weight: 600;
}

.balance-table td.smd-bad {
  color: #dc2626;
  font-weight: 600;
}

/* Propensity model section */
.propensity-model-details summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.5rem 0;
}

.ps-model-metrics {
  font-size: 0.95rem;
  color: var(--app-muted);
}

/* Treatment effect card highlight */
.treatment-effect-card {
  border-left: 4px solid var(--app-accent);
}

/* Professor Mode Redaction Styles */
.professor-mode-redacted {
  position: relative;
}

.professor-mode-redacted:not(.interpretation-aid) {
  opacity: 0.6;
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  padding: 1rem;
  border-radius: 0.375rem;
  font-style: italic;
}

.professor-mode-redacted .redact-note {
  font-size: 0.8em;
  color: #6b7280;
  font-style: italic;
  margin-left: 0.5rem;
}

.professor-mode-redacted.interpretation-aid {
  pointer-events: none;
}

.professor-mode-redacted.interpretation-aid summary::after {
  content: " (hidden)";
  font-size: 0.8em;
  color: #9ca3af;
}

/* Interpretation Aid Content Styling */
.interpretation-content {
  padding: 0.5rem 0;
}

.interpretation-content h4 {
  margin: 1rem 0 0.5rem 0;
  padding-bottom: 0.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--app-accent, #2563eb);
  border-bottom: 1px solid var(--app-border, #e5e7eb);
}

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

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