.causal-workspace { display: grid; gap: 18px; min-width: 0; color: var(--text, #283e32); }
.causal-heading h3 { font-size: 25px; margin: 6px 0 9px; letter-spacing: -.02em; }
.causal-heading p { max-width: 720px; line-height: 1.7; margin: 0; }
.causal-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.causal-metrics > div { display: flex; align-items: baseline; gap: 9px; padding: 15px 18px; border: 1px solid var(--border, #dbe1dc); border-radius: 12px; background: #f5f7f2; }
.causal-metrics strong { font-size: 25px; font-variant-numeric: tabular-nums; }
.causal-metrics span { font-size: 13px; color: var(--muted, #58665f); }
.causal-save-state { margin: 0; line-height: 1.6; }
.causal-actions, .causal-risk-links { display: flex; flex-wrap: wrap; gap: 8px; }
.causal-workspace button { white-space: normal; max-width: 100%; text-align: left; line-height: 1.45; }
.causal-actions button { text-align: center; }
.causal-risks > h4, .causal-cards > h4 { font-size: 16px; margin: 3px 0 12px; }
.causal-risks { display: grid; gap: 10px; }
.causal-risk { border: 1px solid #e6d8b8; border-left: 3px solid #af8130; border-radius: 10px; padding: 13px 16px; background: #fffdf7; }
.causal-risk-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.causal-risk h5 { margin: 0; font-size: 14px; }
.causal-risk p { margin: 7px 0; font-size: 13px; line-height: 1.65; }
.causal-risk-code { display: block; margin: 6px 0; color: #6b7066; font-size: 10px; letter-spacing: .025em; }
.causal-risk-links button { padding: 5px 8px; font-size: 12px; background: #fff; }
.causal-status { flex: none; font-size: 11px; font-weight: 500; border-radius: 5px; padding: 3px 7px; background: #edf1e9; color: #53634f; }
.causal-status.risk { background: #f6eacf; color: #805e1e; }
.causal-editor { display: grid; gap: 16px; min-width: 0; }
.causal-editor > legend { padding: 10px 0; font-size: 17px; font-weight: 600; }
.causal-section, .causal-card { border: 1px solid var(--border, #dbe1dc); border-radius: 12px; padding: 14px 16px; background: #fff; margin-bottom: 10px; min-width: 0; }
.causal-section > summary, .causal-card-summary { cursor: pointer; font-weight: 600; line-height: 1.6; }
.causal-card-summary .causal-status { margin-left: 10px; }
.causal-card-content { display: grid; gap: 16px; padding-top: 18px; }
.causal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.causal-editor label { display: grid; gap: 6px; min-width: 0; font-size: 13px; }
.causal-editor input, .causal-editor select, .causal-editor textarea { width: 100%; min-width: 0; box-sizing: border-box; margin: 0; }
.causal-editor textarea { resize: vertical; }
.causal-editor .causal-checkbox { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; line-height: 1.6; }
.causal-checkbox input { width: auto; margin: 4px 0 0; flex-shrink: 0; }
.causal-checkbox span { min-width: 0; }
.causal-choices { max-height: 180px; overflow: auto; border: 1px solid #e2e7dd !important; padding: 9px 12px !important; border-radius: 8px; }
.causal-choices legend { font-size: 13px; font-weight: 600; padding-inline: 4px; }
.causal-variable, .causal-edge { display: grid; gap: 12px; padding: 14px 0; border-bottom: 1px solid #e4e8e0; }
.causal-variable details { padding: 8px 0; }
.causal-variable details summary { font-size: 13px; color: var(--muted, #58665f); cursor: pointer; margin-bottom: 8px; }
.causal-variable > button, .causal-editor > button, .causal-card-content > button { width: fit-content; }
.causal-data-picker { display: grid; gap: 10px; padding: 12px; background: #f5f7f2; margin: 10px 0; }
.causal-argument { display: grid; gap: 10px; padding: 14px; background: #f7f8f4; border-radius: 9px; margin-top: 10px; }
.causal-editor h5 { font-size: 14px; margin: 0; }
.causal-diagnostics, .causal-dag { display: grid; gap: 10px; border-top: 1px solid var(--border, #dbe1dc); padding-top: 14px; }
.causal-confirmation { margin: 0; padding: 10px 12px; background: #eff3ea; border-radius: 7px; }
.causal-error, .causal-export-result { padding: 13px 16px; border-radius: 9px; background: #fff3e7; color: #78431d; }
.causal-export-result { background: #edf4eb; color: #365539; }
.causal-classification { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(100px, 1fr) auto; align-items: center; gap: 10px; margin: 12px 0; padding: 12px; background: #f5f7f2; border-radius: 8px; }
.causal-classification select { margin: 0; }
.causal-classification button { margin: 0; }
@media (max-width: 600px) {
  .causal-workspace { gap: 14px; }
  .causal-heading h3 { font-size: 22px; }
  .causal-metrics { gap: 6px; }
  .causal-metrics > div { display: grid; gap: 4px; padding: 11px 10px; }
  .causal-metrics strong { font-size: 22px; }
  .causal-metrics span { font-size: 11px; }
  .causal-grid, .causal-classification { grid-template-columns: minmax(0, 1fr); }
  .causal-risk { padding: 12px; }
  .causal-actions > button { flex: 1 1 140px; }
  .causal-section, .causal-card { padding: 12px; }
  .causal-argument { padding: 10px; }
  :is(.research-dialog, .research-region):has(.causal-workspace) { max-height: calc(100dvh - 20px); }
  :is(.research-dialog, .research-region):has(.causal-workspace) .research-tabs { padding: 8px 12px; gap: 5px; }
  :is(.research-dialog, .research-region):has(.causal-workspace) .research-tabs button { font-size: 12px; padding: 7px 9px; }
  :is(.research-dialog, .research-region):has(.causal-workspace) .dialog-content { padding: 16px; }
}
