:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #111827;
  --muted: #5f6b7a;
  --line: #dfe7f0;
  --accent: #246b8f;
  --accent-strong: #184a66;
  --accent-soft: #e5f2f7;
  --success: #2c7a5a;
  --warn: #fff7df;
  --shadow: 0 18px 42px rgba(25, 40, 58, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #ffffff 0, var(--bg) 320px),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.personal-site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(16, 20, 26, 0.12);
  background: rgba(247, 248, 251, 0.9);
  backdrop-filter: blur(20px);
}

.personal-site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
  padding: 16px 0;
}

.personal-brand-group,
.personal-nav-links {
  display: inline-flex;
  align-items: center;
}

.personal-brand-group {
  gap: 16px;
}

.personal-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #10141a;
  font-size: clamp(2rem, 4vw, 2.7rem);
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.personal-brand::before {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  content: "";
  background: linear-gradient(135deg, #2563eb, #0f9f8a);
  box-shadow: 0 0 24px rgba(37, 99, 235, 0.55);
}

.personal-project-pill,
.personal-nav-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(16, 20, 26, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  color: #344154;
  font-weight: 900;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
}

.personal-project-pill {
  min-height: 48px;
  padding: 8px 18px;
  border-color: rgba(37, 99, 235, 0.32);
  color: #2563eb;
  box-shadow: 0 0 0 7px rgba(37, 99, 235, 0.07), 0 12px 28px rgba(37, 99, 235, 0.16);
  font-size: clamp(1.25rem, 2.5vw, 1.8rem);
}

.personal-nav-links {
  gap: 10px;
}

.personal-nav-links a {
  min-height: 42px;
  padding: 9px 15px;
  font-size: 1.18rem;
}

.personal-project-pill:hover,
.personal-nav-links a:hover {
  border-color: rgba(37, 99, 235, 0.28);
  color: #2563eb;
  background: #fff;
}

@media (max-width: 860px) {
  .personal-site-nav {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .personal-brand-group {
    flex-wrap: wrap;
  }

  .personal-nav-links {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }
}

.app-topbar {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid rgba(216, 224, 234, 0.9);
  background: rgba(248, 250, 252, 0.92);
  backdrop-filter: blur(14px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: calc(100vw - 16px);
  margin: 0 auto;
  padding: 14px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 850;
}

.brand strong,
.brand span {
  display: block;
}

.brand-copy {
  min-width: 0;
}

.brand strong {
  font-size: 0.98rem;
}

.brand span {
  color: var(--muted);
  font-size: 0.8rem;
}

.shell {
  width: calc(100vw - 16px);
  margin: 0 auto;
  padding: 18px 0 40px;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  overflow-x: auto;
}

.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 13px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

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

.tab.active {
  background: var(--panel);
  color: var(--accent-strong);
  box-shadow: 0 1px 4px rgba(25, 40, 58, 0.08);
}

.guide-tab {
  border: 1px solid rgba(37, 99, 235, 0.42);
  cursor: pointer;
  font: inherit;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.14), 0 12px 28px rgba(37, 99, 235, 0.26);
  animation: guideTabBounce 2.8s ease-in-out infinite;
}

.brand-guide-tab {
  flex: 0 0 auto;
  padding: 0 15px;
}

.guide-tab:hover,
.guide-tab:focus-visible {
  border-color: rgba(29, 78, 216, 0.7);
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  color: #fff;
  box-shadow: 0 0 0 7px rgba(37, 99, 235, 0.18), 0 14px 32px rgba(37, 99, 235, 0.32);
}

.onboarding-overlay[hidden] {
  display: none;
}

.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
}

.onboarding-scrim {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.28);
  cursor: not-allowed;
  pointer-events: auto;
}

.onboarding-spotlight {
  position: fixed;
  z-index: 82;
  border: 2px solid rgba(36, 107, 143, 0.92);
  border-radius: 18px;
  background: transparent;
  box-shadow:
    0 0 0 8px rgba(36, 107, 143, 0.14),
    0 18px 54px rgba(15, 23, 42, 0.2);
  pointer-events: none;
  transition:
    top 320ms cubic-bezier(0.22, 1, 0.36, 1),
    left 320ms cubic-bezier(0.22, 1, 0.36, 1),
    width 320ms cubic-bezier(0.22, 1, 0.36, 1),
    height 320ms cubic-bezier(0.22, 1, 0.36, 1);
  animation: onboardingPulse 1.8s ease-in-out infinite;
}

.onboarding-spotlight::after {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 13px;
  height: 13px;
  border: 2px solid #fff;
  border-radius: 50%;
  content: "";
  background: #246b8f;
  box-shadow: 0 10px 24px rgba(36, 107, 143, 0.34);
  animation: onboardingClick 1.1s ease-in-out infinite;
}

.onboarding-card {
  position: fixed;
  z-index: 84;
  width: min(360px, calc(100vw - 32px));
  border: 1px solid rgba(226, 237, 245, 0.98);
  border-radius: 24px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.22);
  pointer-events: auto;
  transition:
    top 320ms cubic-bezier(0.22, 1, 0.36, 1),
    left 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.onboarding-card h2 {
  margin-bottom: 10px;
  font-size: 1.25rem;
}

.onboarding-card p:not(.eyebrow) {
  margin-bottom: 18px;
  color: var(--muted);
  line-height: 1.55;
}

.onboarding-actions {
  display: flex;
  justify-content: flex-end;
  gap: 32px;
}

@keyframes guideTabBounce {
  0%, 72%, 100% {
    transform: translateY(0);
  }
  82% {
    transform: translateY(-4px);
  }
  90% {
    transform: translateY(0);
  }
  95% {
    transform: translateY(-2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .guide-tab {
    animation: none;
  }
}

@keyframes onboardingPulse {
  0%, 100% {
    box-shadow:
      0 0 0 8px rgba(36, 107, 143, 0.14),
      0 18px 54px rgba(15, 23, 42, 0.2);
  }
  50% {
    box-shadow:
      0 0 0 14px rgba(36, 107, 143, 0.08),
      0 20px 62px rgba(15, 23, 42, 0.24);
  }
}

@keyframes onboardingClick {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(0.72);
    opacity: 0.7;
  }
}

.header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.header-analysis-window {
  display: inline-grid;
  margin-top: 14px;
  max-width: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.header-analysis-window label {
  color: var(--accent-strong);
  font-size: 0.95rem;
  font-weight: 900;
}

.header-analysis-window input[data-analysis-days] {
  margin-top: 8px;
  min-height: 52px;
  max-width: 170px;
  border-width: 2px;
  color: var(--text);
  font-size: 1.55rem;
  font-weight: 950;
  text-align: center;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent-strong);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 2.35rem;
  line-height: 1.05;
}

h2 {
  margin-bottom: 18px;
  font-size: 1rem;
  font-weight: 850;
}

.section-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  min-height: 24px;
  height: 24px;
  margin-right: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: var(--panel-soft);
  color: var(--accent-strong);
  box-shadow: 0 2px 8px rgba(25, 40, 58, 0.08);
  cursor: pointer;
  vertical-align: middle;
}

.section-toggle:hover,
.section-toggle:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  outline: none;
  transform: none;
}

.section-toggle::before {
  content: "";
  width: 0;
  height: 0;
  margin: 2px 0 0;
  border-top: 7px solid currentColor;
  border-right: 5px solid transparent;
  border-left: 5px solid transparent;
}

.section-toggle[aria-expanded="false"]::before {
  margin: 0 0 0 2px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid currentColor;
  border-right: 0;
}

.dag-canvas-panel .section-toggle {
  width: 36px;
  min-height: 36px;
  height: 36px;
  margin-right: 10px;
}

.dag-canvas-panel .section-toggle::before {
  border-top-width: 9px;
  border-right-width: 7px;
  border-left-width: 7px;
}

.dag-canvas-panel .section-toggle[aria-expanded="false"]::before {
  border-top-width: 7px;
  border-bottom-width: 7px;
  border-left-width: 9px;
}

.panel,
.metrics article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel {
  padding: 22px;
  margin-bottom: 18px;
}

.workflow-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 22px;
  padding: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.workflow-section.panel {
  padding: 22px;
}

.workflow-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
  padding-bottom: 16px;
}

.workflow-heading h2 {
  margin-bottom: 5px;
  font-size: 1.35rem;
  line-height: 1.18;
}

.workflow-step-label {
  margin: 0 0 7px;
  color: var(--accent-strong);
  font-size: 0.86rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: none;
}

.dag-workflow-heading {
  align-items: center;
}

.dag-analysis-days {
  display: grid;
  gap: 7px;
  min-width: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--panel-soft);
}

.dag-analysis-days span {
  color: var(--accent-strong);
  font-size: 0.86rem;
  font-weight: 900;
  text-transform: none;
}

.dag-analysis-days input {
  width: 100%;
  min-height: 40px;
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 950;
  text-align: center;
}

.workbench {
  --workbench-left-width: 470px;
  display: grid;
  grid-template-columns: minmax(320px, var(--workbench-left-width)) 12px minmax(420px, 1fr);
  gap: 8px;
  align-items: start;
}

.workbench.is-resizing {
  user-select: none;
  cursor: col-resize;
}

.workbench.is-output-condensed {
  grid-template-columns: minmax(320px, var(--workbench-left-width)) 12px minmax(420px, 1fr);
}

.workbench.is-output-condensed .workbench-output {
  grid-column: 3;
}

.workbench.is-output-condensed .workbench-controls,
.workbench.is-output-condensed .workbench-resizer {
  max-height: min(560px, calc(100vh - 108px));
  min-height: 0;
}

.workbench-controls {
  grid-column: 1;
  position: sticky;
  top: 86px;
  max-height: calc(100vh - 108px);
  overflow: auto;
}

.workbench-resizer {
  grid-column: 2;
  position: sticky;
  top: 86px;
  align-self: stretch;
  min-width: 12px;
  width: 12px;
  min-height: calc(100vh - 108px);
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
  cursor: col-resize;
}

.workbench-resizer:hover,
.workbench-resizer:focus-visible {
  background: var(--accent-soft);
  outline: none;
  transform: none;
}

.workbench-resizer span {
  display: block;
  width: 3px;
  height: 56px;
  margin: 28px auto 0;
  border-radius: 999px;
  background: var(--line);
  transition: background 120ms ease;
}

.workbench-resizer:hover span,
.workbench-resizer:focus-visible span,
.workbench.is-resizing .workbench-resizer span {
  background: var(--accent);
}

.workbench-controls .grid {
  grid-template-columns: 1fr;
}

.workbench-controls .entity-table {
  min-width: 760px;
}

.workbench-controls .entity-table td:nth-child(2),
.workbench-controls .entity-table td:nth-child(3) {
  width: 170px;
  min-width: 170px;
}

.workbench-controls .entity-table select {
  min-width: 150px;
}

.method-equation {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-soft);
}

.method-equation strong {
  color: var(--text);
  font-size: 0.92rem;
}

.method-equation code {
  display: block;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: var(--surface);
  color: var(--accent-strong);
  font-size: 0.9rem;
  font-weight: 850;
  white-space: nowrap;
}

.method-equation span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.workbench-output {
  grid-column: 3;
  grid-row: 1;
  min-width: 0;
}

.workbench-output .result-card {
  min-width: 0;
  overflow-x: auto;
  scrollbar-gutter: stable;
}

.workbench-running {
  display: none;
  min-height: 156px;
}

.workbench-running h2,
.workbench-running p {
  margin-bottom: 0;
}

.workbench-output.is-running .workbench-running {
  display: flex;
}

.workbench-output.is-running > :not(.workbench-running) {
  opacity: 0.42;
}

.workbench-empty {
  display: grid;
  align-content: center;
  min-height: 280px;
}

.analysis-progress {
  display: grid;
  gap: 18px;
  width: 100%;
}

.analysis-progress-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.analysis-progress-heading h2,
.analysis-progress-heading p {
  margin-bottom: 0;
}

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

.analysis-step-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 850;
  white-space: nowrap;
}

.analysis-step-tab::before {
  content: "";
  width: 9px;
  height: 9px;
  border: 2px solid currentColor;
  border-radius: 999px;
  opacity: 0.56;
}

.analysis-step-tab.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.analysis-step-tab.complete {
  border-color: rgba(44, 122, 90, 0.34);
  background: #ecf8f2;
  color: var(--success);
}

.analysis-step-tab.complete::before {
  content: "✓";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: var(--success);
  background: var(--success);
  color: #fff;
  font-size: 0.82rem;
  line-height: 1;
  opacity: 1;
}

.analysis-progress-card {
  display: grid;
  gap: 16px;
}

.model-summary {
  display: grid;
  gap: 16px;
}

.result-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.model-summary h2,
.model-summary p,
.model-summary dl {
  margin-bottom: 0;
}

.model-summary dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.model-summary dl > div:last-child {
  grid-column: 1 / -1;
}

.model-summary dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
  text-transform: none;
}

.model-summary dd {
  margin: 0;
  color: var(--text);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.model-summary .shadow-text {
  display: inline-block;
  margin-left: 6px;
  color: var(--muted);
}

.summary-chip {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  max-width: 100%;
  margin: 0 8px 8px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--panel-soft);
}

.summary-chip small {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.effect-estimate-card {
  display: grid;
  gap: 18px;
}

.effect-estimate {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--panel-soft);
}

.effect-estimate strong {
  color: var(--accent-strong);
  font-size: 2.2rem;
  line-height: 1;
}

.effect-estimate span {
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 850;
}

.effect-estimate small {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 750;
}

.method-primary-result {
  border-left: 5px solid var(--accent);
}

.method-card-heading,
.method-results-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.method-card-heading h2,
.method-card-heading p,
.method-results-heading h2,
.method-results-heading p {
  margin-bottom: 0;
}

.method-card-heading h2 {
  margin-bottom: 5px;
}

.method-results-section {
  display: grid;
  gap: 18px;
}

.method-results-group {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.method-results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 18px;
  align-items: stretch;
}

.method-results-grid .method-result-card,
.method-results-section .method-result-card {
  margin-bottom: 0;
}

.method-result-card {
  display: grid;
  gap: 18px;
}

.result-validation-card {
  border-color: #e7c362;
  background: #fffaf0;
}

.result-validation-list {
  display: grid;
  gap: 10px;
}

.result-validation-list article {
  border: 1px solid #edd48a;
  border-radius: 8px;
  padding: 12px;
  background: #fffdf7;
}

.result-validation-list strong,
.result-validation-list p {
  margin: 0;
}

.result-validation-list p {
  margin-top: 4px;
  color: #6a5014;
}

.method-line-chart {
  display: grid;
  grid-template-columns: 42px minmax(360px, 1fr);
  gap: 10px;
  min-height: 280px;
  overflow-x: auto;
}

.method-chart-plot {
  position: relative;
  min-height: 250px;
  padding-bottom: 28px;
}

.method-chart-plot svg {
  display: block;
  width: 100%;
  min-width: 360px;
  height: 230px;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0, #f8fafc 100%);
}

.method-chart-line {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.series-control {
  color: #246b8f;
  stroke: #246b8f;
}

.series-treatment {
  color: #b65f2a;
  stroke: #b65f2a;
}

.series-observed {
  color: #2c7a5a;
  stroke: #2c7a5a;
}

.series-predicted {
  color: #5d5fef;
  stroke: #5d5fef;
}

.method-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 850;
}

.method-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.method-chart-legend i {
  width: 18px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
}

.method-histogram {
  display: flex;
  align-items: end;
  gap: 7px;
  min-height: 230px;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 12px 8px 0;
  overflow-x: auto;
  background: var(--panel-soft);
}

.method-histogram-bin {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: end;
  justify-items: center;
  gap: 8px;
  flex: 1 0 42px;
  height: 210px;
}

.method-histogram-bin span {
  display: block;
  width: 100%;
  min-height: 4px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
}

.method-histogram-bin small {
  max-width: 56px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.axis-caption {
  margin: -8px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  text-align: center;
}

.love-plot {
  display: grid;
  gap: 10px;
}

.love-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.7fr) minmax(180px, 1fr) minmax(82px, auto);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--panel-soft);
}

.love-row strong {
  color: var(--text);
  font-size: 0.94rem;
}

.love-row > span {
  justify-self: end;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 850;
  white-space: nowrap;
}

.love-bars {
  display: grid;
  gap: 5px;
}

.love-bar {
  display: block;
  min-width: 3px;
  height: 8px;
  border-radius: 999px;
}

.love-bar.before {
  background: #2c7a5a;
}

.love-bar.after {
  background: #b65f2a;
}

.ess-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ess-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel-soft);
}

.ess-grid span,
.ess-grid strong {
  display: block;
}

.ess-grid span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
  text-transform: none;
}

.ess-grid strong {
  margin-top: 4px;
  color: var(--accent-strong);
  font-size: 1.6rem;
  line-height: 1;
}

.counterfactual-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

.counterfactual-table th {
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.86rem;
  text-transform: none;
}

.counterfactual-table td {
  color: var(--text);
  font-weight: 750;
}

.counterfactual-table tr:last-child td {
  border-bottom: 0;
}

.advanced-results-card {
  padding: 0;
  overflow: hidden;
}

.advanced-results-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  cursor: pointer;
}

.advanced-results-card summary strong,
.advanced-results-card summary small {
  display: block;
}

.advanced-results-card summary small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.advanced-results-grid {
  padding: 0 24px 24px;
}

.influence-list {
  display: grid;
  gap: 10px;
}

.influence-row {
  display: grid;
  grid-template-columns: minmax(96px, 0.6fr) minmax(160px, 1fr) 80px;
  gap: 12px;
  align-items: center;
}

.influence-row span {
  display: block;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
}

.influence-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.influence-row em {
  justify-self: end;
  color: var(--muted);
  font-style: normal;
  font-weight: 850;
}

.saved-analysis-list {
  display: grid;
  gap: 14px;
}

.saved-analysis-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
}

.saved-analysis-row h2,
.saved-analysis-row p {
  margin-bottom: var(--space-1);
}

.saved-analysis-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: flex-end;
}

.saved-analysis-actions form {
  margin: 0;
}

.report-header {
  align-items: flex-start;
}

.report-card {
  max-width: 1180px;
}

.report-dag-image {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
}

.report-dag-image svg {
  display: block;
  width: 100%;
  min-width: 620px;
  height: auto;
}

.report-variable-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-3);
}

.report-variable-grid article {
  display: grid;
  gap: var(--space-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
  background: var(--surface);
}

.report-variable-grid strong {
  color: #101828;
  font-size: 1rem;
}

.report-variable-grid span,
.report-variable-grid small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.saved-analysis-card {
  padding: 0;
  overflow: hidden;
}

.saved-analysis-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  cursor: pointer;
}

.saved-analysis-card summary strong,
.saved-analysis-card summary small {
  display: block;
}

.saved-analysis-card summary small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.saved-analysis-meta {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.saved-analysis-meta em {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--muted);
  font-size: 0.86rem;
  font-style: normal;
  font-weight: 850;
}

.saved-model-summary,
.saved-result-section {
  margin: 0 20px 20px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  overflow-x: auto;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-heading h2,
.panel-heading p {
  margin-bottom: 0;
}

.compact-heading {
  margin-bottom: 12px;
}

.compact p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.settings-form,
label {
  display: grid;
  gap: 8px;
}

.settings-form {
  gap: 16px;
}

.hidden-form {
  display: none;
}

.add-sensor-panel {
  background:
    linear-gradient(180deg, rgba(229, 242, 247, 0.75), rgba(255, 255, 255, 0)),
    var(--panel);
}

.add-sensor-form {
  display: grid;
  grid-template-columns: minmax(210px, 1.05fr) minmax(150px, 0.55fr) minmax(260px, 1.3fr) auto;
  gap: 12px;
  align-items: end;
}

.field-section {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel-soft);
}

.histogram-section {
  gap: 14px;
}

.histogram-stat {
  align-self: flex-start;
  min-width: max-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--panel);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 850;
}

.histogram {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  min-height: 240px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px 16px 14px;
  background: var(--panel);
  cursor: crosshair;
}

.histogram-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px 0 34px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  text-align: right;
}

.histogram-plot {
  position: relative;
  display: grid;
  grid-template-rows: minmax(150px, 1fr) auto auto;
  gap: 8px;
  min-width: 0;
}

.histogram-bars {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  min-height: 160px;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 10px 8px 0;
}

.density-overlay {
  position: absolute;
  inset: 10px 8px 0;
  z-index: 2;
  width: calc(100% - 16px);
  height: calc(100% - 10px);
  overflow: visible;
  pointer-events: none;
}

.density-area {
  fill: rgba(36, 107, 143, 0.16);
  filter: drop-shadow(0 10px 16px rgba(36, 107, 143, 0.2));
}

.density-line {
  fill: none;
  stroke: var(--accent-strong);
  stroke-width: 2.2;
  vector-effect: non-scaling-stroke;
}

.outcome-density {
  z-index: 3;
}

.histogram-bar {
  position: relative;
  flex: 1;
  min-width: 18px;
  z-index: 1;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  opacity: 0.34;
}

.histogram-bar span {
  position: absolute;
  right: 50%;
  bottom: calc(100% + 5px);
  transform: translateX(50%);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.histogram-x-axis {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.histogram-x-axis span {
  display: grid;
  gap: 2px;
}

.histogram-x-axis small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  opacity: 0.72;
}

.axis-label {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
  text-transform: none;
}

.y-label {
  position: absolute;
  top: 50%;
  left: -38px;
  transform: translateY(-50%) rotate(-90deg);
}

.x-label {
  justify-self: center;
}

.histogram-marker {
  position: absolute;
  z-index: 4;
  top: 10px;
  bottom: 0;
  left: 50%;
  width: 2px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(44, 122, 90, 0.14);
  pointer-events: none;
}

.histogram-readout {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.exposure-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.exposure-summary article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel);
}

.exposure-summary span {
  display: block;
  font-size: 1.45rem;
  font-weight: 900;
}

.exposure-summary strong {
  display: block;
  margin-top: 2px;
  color: var(--accent-strong);
  font-size: 0.92rem;
}

.exposure-summary p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.probability-plot,
.importance-plot {
  display: grid;
  gap: 10px;
}

.prediction-time-chart,
.roc-chart {
  display: grid;
  grid-template-columns: 38px minmax(500px, 1fr);
  gap: 8px;
  min-width: 548px;
  min-height: 300px;
  margin-bottom: 14px;
}

.causal-chart {
  min-height: 280px;
}

.response-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 18px;
}

.response-grid h2 {
  margin-bottom: 10px;
}

.mini-response-chart {
  position: relative;
  min-height: 230px;
  padding-bottom: 30px;
}

.mini-response-chart svg {
  display: block;
  width: 100%;
  height: 190px;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.strategy-list,
.positivity-list {
  display: grid;
  gap: 10px;
}

.strategy-list article {
  display: grid;
  grid-template-columns: minmax(120px, 0.5fr) minmax(120px, 1fr) 90px;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-soft);
}

.strategy-list code {
  overflow-wrap: anywhere;
  color: var(--accent-strong);
  font-weight: 850;
}

.strategy-list span {
  justify-self: end;
  color: var(--text);
  font-weight: 900;
}

.dag-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.dag-canvas-panel {
  position: relative;
  min-width: 0;
}

.dag-toolbar {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.dag-toolbar .active,
.dag-toolbar [aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.dag-cycle-warning {
  border: 1px solid #d34b4b;
  border-radius: 8px;
  margin: 12px 0;
  padding: 12px 14px;
  background: #fff1f1;
  color: #8f1f1f;
  font-size: 0.95rem;
  font-weight: 850;
}

.dag-cycle-warning[hidden] {
  display: none !important;
}

.dag-editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--dag-sidebar-width, 360px);
  gap: 14px;
  align-items: stretch;
}

.dag-properties-sidebar {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  min-width: 280px;
  max-width: none;
  max-height: min(680px, calc(100vh - 210px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel-soft);
}

.dag-sidebar-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
  padding-bottom: 12px;
}

.dag-sidebar-resize-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -7px;
  z-index: 5;
  width: 14px;
  cursor: ew-resize;
}

.dag-sidebar-resize-handle::before {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 6px;
  width: 3px;
  border-radius: 999px;
  background: var(--line);
}

.dag-properties-sidebar.is-resizing .dag-sidebar-resize-handle::before,
.dag-sidebar-resize-handle:hover::before {
  background: var(--accent);
}

.dag-sidebar-topbar strong {
  color: var(--accent-strong);
  font-size: 0.95rem;
  font-weight: 900;
}

.dag-editor-layout .dag-scroll {
  grid-column: 1;
  grid-row: 1;
}

.dag-properties-placeholder {
  display: grid;
  align-content: center;
  min-height: 260px;
  color: var(--muted);
}

.dag-properties-placeholder h3,
.dag-properties-panel h3,
.sidebar-section h4 {
  margin: 0;
}

.dag-properties-placeholder p {
  margin: 8px 0 0;
}

.dag-properties-panel {
  display: grid;
  gap: 12px;
}

.dag-properties-placeholder[hidden],
.dag-properties-panel[hidden] {
  display: none !important;
}

.dag-properties-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.sidebar-tabs {
  display: grid;
  gap: 8px;
}

.sidebar-tabs button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}

.sidebar-tabs button span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: inherit;
  font-size: 0.82rem;
}

.sidebar-tabs button.active,
.sidebar-tabs button:hover,
.sidebar-tabs button:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
  outline: none;
}

.sidebar-tabs button.active span {
  background: var(--accent);
  color: #fff;
}

.sidebar-tab-panel {
  display: grid;
  gap: 10px;
}

.sidebar-tab-panel[hidden] {
  display: none !important;
}

[data-sidebar-binary-control][hidden] {
  display: none !important;
}

.sidebar-section {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.sidebar-section h4 {
  color: var(--accent-strong);
  font-size: 0.86rem;
  font-weight: 900;
  text-transform: none;
}

.sidebar-advanced-settings {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.sidebar-advanced-settings > summary {
  cursor: pointer;
  padding: 10px 12px;
  color: var(--accent-strong);
  font-size: 0.88rem;
  font-weight: 850;
}

.sidebar-advanced-settings > label,
.sidebar-advanced-settings > .dag-time-grid {
  margin: 0 12px 12px;
}

.sidebar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sidebar-histogram {
  min-height: 150px;
}

.dag-scroll {
  width: 100%;
  max-height: min(680px, calc(100vh - 210px));
  min-height: 460px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(rgba(216, 224, 234, 0.45) 1px, transparent 1px),
    linear-gradient(90deg, rgba(216, 224, 234, 0.45) 1px, transparent 1px),
    var(--surface);
  background-size: 32px 32px;
  cursor: grab;
}

.dag-scroll.is-panning {
  cursor: grabbing;
}

.dag-scroll.is-resizing {
  max-height: none;
}

.dag-scroll.is-fit {
  min-height: 0;
  max-height: none;
}

.dag-canvas {
  position: relative;
  width: 1800px;
  min-height: 620px;
  transform-origin: top left;
  background:
    linear-gradient(rgba(216, 224, 234, 0.45) 1px, transparent 1px),
    linear-gradient(90deg, rgba(216, 224, 234, 0.45) 1px, transparent 1px),
    var(--surface);
  background-size: 32px 32px;
}

.dag-edges {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: auto;
}

.dag-edges line,
.dag-edges polyline,
.dag-edges path[data-rendered-edge] {
  fill: none;
  stroke: var(--accent-strong);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-opacity: 0.88;
  vector-effect: non-scaling-stroke;
  pointer-events: stroke;
  cursor: pointer;
  transition:
    stroke 160ms ease,
    stroke-width 160ms ease,
    stroke-opacity 160ms ease,
    filter 160ms ease;
}

.dag-edges polyline:hover,
.dag-edges path[data-rendered-edge]:hover {
  stroke-width: 3.2;
  stroke-opacity: 1;
}

.dag-edges polyline.is-selected,
.dag-edges path[data-rendered-edge].is-selected {
  stroke: #b42318;
  stroke-width: 4;
  stroke-opacity: 1;
  filter: drop-shadow(0 0 6px rgba(180, 35, 24, 0.22));
}

.dag-selection-count {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 var(--space-3);
  background: var(--panel-soft);
  color: var(--muted-strong);
  font-size: 0.88rem;
  font-weight: 620;
}

.dag-edges .dag-draft-edge {
  stroke: var(--success);
  stroke-dasharray: 8 6;
  stroke-width: 2.6;
}

.dag-edges .dag-cycle-edge {
  stroke: #c62828;
  stroke-width: 3;
}

.dag-edges marker path {
  fill: var(--accent-strong);
}

.dag-edges #dag-arrow-selected path {
  fill: #b42318;
}

.dag-node {
  position: absolute;
  z-index: 3;
  display: block;
  width: 240px;
  min-width: 220px;
  max-width: 280px;
  height: 112px;
  min-height: 100px;
  max-height: 140px;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 14px 58px 24px 16px;
  background: var(--panel);
  box-shadow: 0 14px 30px rgba(25, 40, 58, 0.13);
  cursor: grab;
}

.dag-node.has-cycle {
  border-color: #c62828;
  background: #fff1f1;
  box-shadow:
    0 0 0 4px rgba(198, 40, 40, 0.18),
    0 10px 22px rgba(25, 40, 58, 0.13);
}

.dag-node-title {
  position: absolute;
  top: 14px;
  right: 58px;
  left: 16px;
  z-index: 20;
  display: block;
  min-height: 1.35rem;
  padding: 0;
  color: #111827;
  font-size: 1.18rem;
  font-weight: 950;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: transparent;
}

.dag-node-summary {
  display: none;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.dag-time-shadow {
  position: absolute;
  z-index: 1;
  top: 14px;
  right: 16px;
  transform: none;
  color: rgba(76, 92, 113, 0.22);
  font-size: 0.9rem;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1;
  pointer-events: none;
}

.dag-role-shadow {
  position: absolute;
  z-index: 1;
  right: 58px;
  left: 16px;
  bottom: 14px;
  color: rgba(76, 92, 113, 0.28);
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.dag-time-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.dag-encoding-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(140px, 0.7fr);
  gap: 8px;
  align-items: end;
}

.dag-variable-settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(190px, 1fr));
  gap: 10px;
  align-items: end;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.dag-node-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.dag-node-tabs button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 12px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
  cursor: pointer;
}

.dag-node-tabs button.active,
.dag-node-tabs button:hover,
.dag-node-tabs button:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
  outline: none;
  transform: none;
}

.dag-node-tab-panel {
  display: grid;
  gap: 8px;
}

.dag-node-histogram {
  display: grid;
  grid-template-rows: auto minmax(74px, 1fr) auto auto auto;
  gap: 6px;
  min-height: 120px;
}

.dag-node > .dag-node-histogram {
  display: none !important;
}

.dag-histogram-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.dag-histogram-meta strong {
  color: var(--text);
}

.dag-histogram-bars {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 100%;
  min-height: 74px;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 6px 4px 0;
  background: var(--surface);
}

.dag-density {
  inset: 6px 4px 0;
  width: calc(100% - 8px);
  height: calc(100% - 6px);
}

.dag-histogram-bin {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  flex: 1;
  height: 100%;
  cursor: pointer;
}

.dag-histogram-bin i {
  display: block;
  width: 100%;
  min-height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--accent);
}

.dag-threshold-marker {
  position: absolute;
  top: 4px;
  bottom: 0;
  z-index: 3;
  width: 2px;
  background: #9b5c1c;
  box-shadow: 0 0 0 3px rgba(155, 92, 28, 0.14);
  pointer-events: none;
}

.dag-histogram-axis {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.dag-histogram-readout {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.dag-histogram-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 116px;
}

.dag-histogram-loading .spinner {
  width: 22px;
  height: 22px;
  border-width: 2px;
}

.dag-distribution-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.dag-stat-chip {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 8px;
  background: var(--panel-soft);
}

.dag-stat-chip.wide {
  grid-column: 1 / -1;
}

.dag-stat-chip span,
.dag-stat-chip small {
  display: block;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.dag-stat-chip strong {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 880;
}

.dag-overlay-plot {
  position: relative;
  min-height: 180px;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.dag-overlay-layer,
.dag-overlay-density {
  position: absolute;
  inset: 0;
}

.dag-overlay-layer.color-0 .density-line,
.dag-overlay-legend .color-0 i {
  stroke: #246b8f;
  background: #246b8f;
}

.dag-overlay-layer.color-1 .density-line,
.dag-overlay-legend .color-1 i {
  stroke: #2c7a5a;
  background: #2c7a5a;
}

.dag-overlay-layer.color-2 .density-line,
.dag-overlay-legend .color-2 i {
  stroke: #9b5c1c;
  background: #9b5c1c;
}

.dag-overlay-layer.color-3 .density-line,
.dag-overlay-legend .color-3 i {
  stroke: #6f5aa8;
  background: #6f5aa8;
}

.dag-overlay-layer.color-4 .density-line,
.dag-overlay-legend .color-4 i {
  stroke: #b84444;
  background: #b84444;
}

.dag-overlay-layer .density-area {
  fill: transparent;
}

.dag-overlay-legend {
  display: grid;
  gap: 6px;
}

.dag-overlay-legend span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.dag-overlay-legend i {
  width: 12px;
  min-width: 12px;
  height: 12px;
  border-radius: 999px;
}

.dag-overlay-legend small {
  color: var(--muted);
  font-weight: 700;
}

.dag-canvas.is-connecting .dag-node {
  cursor: crosshair;
}

.dag-node.is-dragging {
  z-index: 4;
  cursor: grabbing;
  box-shadow: 0 22px 48px rgba(25, 40, 58, 0.22);
}

.dag-node.is-dragging,
.dag-node.is-group-dragging,
.dag-node.is-resizing {
  z-index: 10;
}

.dag-resize-handle {
  position: absolute;
  z-index: 11;
}

.dag-resize-handle.horizontal {
  top: 44px;
  right: -7px;
  bottom: 34px;
  width: 14px;
  cursor: ew-resize;
}

.dag-resize-handle.vertical {
  right: 34px;
  bottom: -7px;
  left: 34px;
  height: 14px;
  cursor: ns-resize;
}

.dag-resize-handle.corner {
  right: 8px;
  bottom: 8px;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
}

.dag-resize-handle.horizontal::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 4px;
  width: 4px;
  height: 54px;
  border-radius: 999px;
  background: var(--line);
  transform: translateY(-50%);
}

.dag-resize-handle.vertical::before {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 74px;
  height: 4px;
  border-radius: 999px;
  background: var(--line);
  transform: translateX(-50%);
}

.dag-resize-handle.corner::before,
.dag-resize-handle.corner::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
}

.dag-resize-handle.corner::before {
  width: 16px;
  height: 16px;
}

.dag-resize-handle.corner::after {
  width: 9px;
  height: 9px;
}

.dag-resize-handle.horizontal:hover::before,
.dag-resize-handle.vertical:hover::before {
  background: var(--accent);
}

.dag-section-resize-handle {
  position: absolute;
  right: 14px;
  bottom: 8px;
  left: 14px;
  height: 18px;
  cursor: ns-resize;
}

.dag-section-resize-handle::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 50%;
  width: 86px;
  height: 4px;
  border-radius: 999px;
  background: var(--line);
  transform: translateX(-50%);
}

.dag-section-resize-handle:hover::before {
  background: var(--accent);
}

.dag-node.is-selected {
  z-index: 8;
  border-color: var(--accent-strong);
  background: #f3fbfd;
  box-shadow:
    0 0 0 4px rgba(36, 107, 143, 0.2),
    0 18px 42px rgba(25, 40, 58, 0.18);
}

.dag-selection-rect {
  position: absolute;
  z-index: 6;
  border: 1px solid var(--accent);
  background: rgba(36, 107, 143, 0.12);
  pointer-events: none;
}

.dag-canvas.is-group-dragging .dag-node.is-selected {
  cursor: grabbing;
}

.dag-node.is-connect-target {
  outline: 3px solid rgba(44, 122, 90, 0.24);
  outline-offset: 3px;
}

.dag-connect-handle {
  position: absolute;
  z-index: 5;
  width: 18px;
  min-height: 18px;
  height: 18px;
  border: 2px solid var(--panel);
  border-radius: 999px;
  padding: 0;
  background: var(--accent);
  box-shadow: 0 2px 8px rgba(25, 40, 58, 0.22);
  cursor: crosshair;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease, background 120ms ease;
}

.dag-node:hover .dag-connect-handle,
.dag-node:focus-within .dag-connect-handle,
.dag-node.is-dragging .dag-connect-handle,
.dag-canvas.is-connecting .dag-connect-handle {
  opacity: 1;
  pointer-events: auto;
}

.dag-connect-handle:hover,
.dag-connect-handle:focus-visible {
  border-color: var(--panel);
  background: var(--success);
  outline: none;
}

.dag-connect-handle.top {
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
}

.dag-connect-handle.right {
  top: 50%;
  right: -10px;
  transform: translateY(-50%);
}

.dag-connect-handle.bottom {
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
}

.dag-connect-handle.left {
  top: 50%;
  left: -10px;
  transform: translateY(-50%);
}

.dag-node.exposure {
  border-color: var(--accent);
  background: #eef8fb;
}

.dag-node.covariate {
  border-color: #7b8da3;
}

.dag-node.outcome {
  border-color: var(--success);
  background: #eef8f3;
}

.dag-node.latent {
  border-style: dashed;
  border-color: #8a6f2a;
  background: #fff8e5;
}

.dag-node label {
  gap: 4px;
  font-size: 0.92rem;
}

.dag-edge-list {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.dag-edge-store,
.dag-edge-store[hidden] {
  display: none !important;
}

.dag-actions {
  display: flex;
  justify-content: flex-end;
}

.dag-edge-row {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-soft);
}

.prediction-y-axis {
  position: relative;
  height: 244px;
  margin-top: 8px;
}

.prediction-y-axis span {
  position: absolute;
  right: 0;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.prediction-plot {
  position: relative;
  min-width: 0;
  height: 286px;
  padding: 8px 10px 34px 4px;
}

.prediction-plot svg {
  display: block;
  width: 100%;
  height: 244px;
  overflow: visible;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.prediction-gridline {
  stroke: var(--line);
  stroke-width: 0.35;
  vector-effect: non-scaling-stroke;
}

.prediction-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.2;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.ci-line {
  stroke: rgba(24, 74, 102, 0.34);
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
}

.effect-point {
  fill: var(--accent-strong);
  stroke: var(--panel);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.prediction-markers {
  position: absolute;
  top: 8px;
  right: 10px;
  left: 4px;
  height: 244px;
  pointer-events: none;
}

.prediction-point {
  position: absolute;
  width: 14px;
  height: 14px;
  transform: translate(-50%, -50%);
  border: 2px solid var(--accent-strong);
  border-radius: 999px;
  background: var(--panel);
  box-shadow: 0 0 0 2px var(--panel);
}

.prediction-point.event {
  border-color: var(--success);
  background: var(--success);
}

.roc-baseline {
  stroke: var(--muted);
  stroke-dasharray: 7 7;
  stroke-width: 1.2;
  opacity: 0.62;
  vector-effect: non-scaling-stroke;
}

.auc-score {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--accent-strong);
  font-size: 0.86rem;
  white-space: nowrap;
}

.prediction-threshold {
  position: absolute;
  left: 4px;
  right: 10px;
  top: calc(8px + 122px);
  border-top: 1px dashed rgba(100, 113, 132, 0.72);
  pointer-events: none;
}

.prediction-x-axis {
  position: relative;
  height: 24px;
  margin: 6px 10px 0 4px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.prediction-x-axis span {
  position: absolute;
  transform: translateX(-50%);
  white-space: nowrap;
}

.probability-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.probability-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.probability-legend i {
  width: 11px;
  height: 11px;
  border: 2px solid var(--accent-strong);
  border-radius: 999px;
  background: var(--panel);
}

.probability-legend i.event {
  border-color: var(--success);
  background: var(--success);
}

.compact-probability-list {
  min-width: 548px;
  max-height: 260px;
  overflow: auto;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.probability-row,
.importance-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 58px 70px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 0.86rem;
}

.importance-row {
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1fr) 70px;
}

.probability-track,
.importance-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
}

.probability-fill,
.importance-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
}

.probability-row strong,
.importance-row strong {
  color: var(--text);
  font-size: 0.84rem;
}

.forest-plot {
  display: grid;
  gap: 12px;
}

.forest-row {
  display: grid;
  grid-template-columns: minmax(92px, 0.7fr) minmax(260px, 1fr) minmax(150px, 0.8fr);
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-soft);
}

.forest-row strong {
  font-size: 0.98rem;
}

.forest-row > span {
  justify-self: end;
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 850;
  white-space: nowrap;
}

.forest-axis {
  position: relative;
  height: 28px;
}

.forest-axis::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: 2px;
  transform: translateY(-50%);
  background: var(--line);
}

.forest-zero {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: var(--zero-x);
  width: 2px;
  background: rgba(95, 107, 122, 0.58);
}

.forest-ci {
  position: absolute;
  top: 50%;
  height: 4px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: rgba(36, 107, 143, 0.42);
}

.forest-point {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translate(-50%, -50%);
  border: 2px solid var(--panel);
  border-radius: 999px;
  background: var(--accent-strong);
  box-shadow: 0 0 0 1px var(--accent-strong);
}

.probability-row em {
  justify-self: start;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--muted);
  font-style: normal;
  font-size: 0.86rem;
  font-weight: 800;
}

.probability-row em.event {
  border-color: rgba(44, 122, 90, 0.32);
  background: rgba(44, 122, 90, 0.1);
  color: var(--success);
}

.equation,
.latex-equation {
  overflow-x: auto;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-soft);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.9rem;
  white-space: nowrap;
}

.latex-equation p {
  margin: 0;
}

.latex-equation p + p {
  margin-top: 8px;
}

.distribution-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-soft);
}

.distribution-details + .distribution-details {
  margin-top: 10px;
}

.distribution-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  color: var(--text);
  font-weight: 850;
}

.distribution-details small {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.distribution-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 130px;
  margin-top: 14px;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 8px 6px 0;
  background: var(--panel);
}

.distribution-point {
  display: flex;
  align-items: flex-end;
  flex: 1;
  height: 100%;
}

.distribution-point span {
  display: block;
  width: 100%;
  min-height: 4px;
  border-radius: 4px 4px 0 0;
  background: var(--accent);
}

.coverage-warning {
  border: 1px solid #ead38d;
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--warn);
  color: #6a5014;
}

label {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 750;
}

.shadow-text {
  min-height: 1.1rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  opacity: 0.72;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  background: var(--panel);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea {
  resize: vertical;
}

.grid,
.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 16px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

button:hover,
.button:hover {
  border-color: #aab8c6;
  transform: translateY(-1px);
}

.primary,
button[type="submit"] {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.primary:hover,
button[type="submit"]:hover {
  background: var(--accent-strong);
}

button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
}

.analysis-loading {
  display: none;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel-soft);
}

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

.analysis-loading strong,
.analysis-loading p {
  margin: 0;
}

.analysis-loading p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.9rem;
}

.analysis-results {
  scroll-margin-top: 96px;
  font-size: 1.04rem;
  line-height: 1.5;
}

.analysis-results .result-card {
  padding: 26px;
}

.analysis-results h2 {
  margin-bottom: 20px;
  font-size: 1.22rem;
  line-height: 1.22;
}

.analysis-results .model-summary h2 {
  font-size: 1.35rem;
}

.analysis-results .muted {
  font-size: 1rem;
  line-height: 1.45;
}

.analysis-results .model-summary dl {
  gap: 16px;
}

.analysis-results .model-summary dt {
  font-size: 0.86rem;
}

.analysis-results .model-summary dd {
  font-size: 1.06rem;
  line-height: 1.35;
}

.analysis-results .summary-chip {
  min-width: 118px;
  padding: 10px 12px;
  font-size: 1rem;
}

.analysis-results .summary-chip small {
  font-size: 1.05rem;
}

.analysis-results .axis-label,
.analysis-results .prediction-y-axis span,
.analysis-results .prediction-x-axis {
  font-size: 0.88rem;
}

.analysis-results .strategy-list article,
.analysis-results .importance-row {
  font-size: 1rem;
}

.analysis-results .strategy-list span,
.analysis-results .importance-row strong {
  font-size: 1.02rem;
}

.result-card {
  opacity: 0;
  transform: translateY(14px);
  animation: resultReveal 520ms ease forwards;
}

.result-card:nth-child(1) {
  animation-delay: 80ms;
}

.result-card:nth-child(2) {
  animation-delay: 220ms;
}

.result-card:nth-child(3) {
  animation-delay: 360ms;
}

.result-card:nth-child(4) {
  animation-delay: 500ms;
}

.result-card:nth-child(5) {
  animation-delay: 640ms;
}

@keyframes resultReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.spinner,
.button-spinner {
  display: inline-block;
  border: 3px solid rgba(36, 107, 143, 0.18);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

.spinner {
  width: 34px;
  height: 34px;
}

.button-spinner {
  width: 16px;
  height: 16px;
  margin-right: 8px;
  border-width: 2px;
  border-top-color: #fff;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.small-button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.88rem;
}

.metrics {
  margin-bottom: 18px;
}

.secondary-metrics {
  margin-top: 16px;
}

.metrics article {
  padding: 18px;
}

.metrics span {
  display: block;
  font-size: 2rem;
  font-weight: 900;
}

.secondary-metrics span {
  font-size: 1.45rem;
}

.metrics p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.notice {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #ead38d;
  border-radius: 8px;
  background: var(--warn);
  color: #6a5014;
}

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

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.sensor-map-table {
  min-width: 940px;
}

.entity-table {
  min-width: 980px;
}

.entity-table td:first-child {
  width: 100%;
}

.entity-table td:nth-child(2),
.entity-table td:nth-child(3) {
  width: 220px;
  min-width: 220px;
}

.entity-table td:nth-child(4) {
  width: 132px;
  min-width: 132px;
}

.entity-table select {
  min-width: 190px;
}

.covariate-distribution-row td {
  padding-top: 0;
}

.mini-histogram {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-soft);
}

.mini-histogram-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.mini-histogram-header strong {
  color: var(--text);
}

.mini-histogram-header span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.mini-histogram-subtitle {
  margin: -2px 0 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.mini-association {
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--panel);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 850;
}

.mini-histogram-bars {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 140px;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 8px 6px 0;
  background: var(--panel);
}

.binary-level-bars {
  gap: 18px;
}

.mini-histogram-bin {
  position: relative;
  flex: 1;
  min-width: 14px;
  height: 100%;
  z-index: 3;
}

.binary-level-bars .mini-histogram-bin {
  min-width: 120px;
}

.mini-histogram .density-overlay {
  inset: 8px 6px 0;
  z-index: 2;
  width: calc(100% - 12px);
  height: calc(100% - 8px);
}

.covariate-density .density-area,
.exposed-density .density-area {
  fill: transparent;
  filter: none;
}

.covariate-density .density-line {
  stroke: var(--accent-strong);
}

.exposed-density {
  z-index: 4;
}

.exposed-density .density-line {
  stroke: #cc5f2f;
}

.mini-bar-pair {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: end;
  gap: 5px;
  height: 100%;
}

.mini-count-bar,
.mini-exposed-bar {
  position: relative;
  display: block;
  min-height: 4px;
  border-radius: 4px 4px 0 0;
}

.mini-count-bar {
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
}

.mini-exposed-bar {
  background: linear-gradient(180deg, #f1a33c, #cc5f2f);
}

.mini-count-bar b,
.mini-exposed-bar b {
  position: absolute;
  right: 50%;
  bottom: calc(100% + 3px);
  transform: translateX(50%);
  font-size: 0.82rem;
  font-weight: 800;
}

.mini-count-bar b {
  color: var(--muted);
}

.mini-exposed-bar b {
  color: #9b4327;
}

.mini-exposed-count {
  position: absolute;
  right: 50%;
  bottom: -30px;
  transform: translateX(50%);
  color: #9b4327;
  font-size: 0.82rem;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.binary-level-label {
  position: absolute;
  right: 50%;
  bottom: -30px;
  transform: translateX(50%);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 850;
  text-align: center;
  white-space: nowrap;
}

.mini-histogram-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.mini-histogram-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mini-histogram-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.mini-histogram-legend .count {
  background: var(--accent);
}

.mini-histogram-legend .exposed {
  background: #cc5f2f;
}

.mini-histogram-legend .curve {
  background: linear-gradient(90deg, var(--accent), #cc5f2f);
}

.mini-histogram-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 34px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.entity-table td:last-child {
  width: 1%;
  white-space: nowrap;
}

.sensor-map-table textarea {
  min-height: 64px;
}

.sensor-map-table td:nth-child(2) {
  width: 160px;
}

.sensor-map-table td:last-child {
  width: 1%;
  white-space: nowrap;
}

.sensor-id {
  color: var(--accent-strong);
  font-weight: 800;
  white-space: nowrap;
}

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

tbody tr:hover {
  background: rgba(36, 107, 143, 0.04);
}

th {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
  text-transform: none;
}

.empty-state {
  margin-bottom: 0;
  border: 1px dashed #b9c5d2;
  border-radius: 8px;
  padding: 16px;
  background: var(--panel-soft);
  color: var(--muted);
}

@media (max-width: 760px) {
  .topbar-inner {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .brand {
    justify-content: space-between;
  }

  .header {
    align-items: stretch;
    flex-direction: column;
  }

  .workbench {
    grid-template-columns: 1fr;
  }

  .workbench-controls {
    grid-column: 1;
    position: static;
    max-height: none;
  }

  .workbench-resizer {
    display: none;
  }

  .workbench-output {
    grid-column: 1;
    grid-row: auto;
  }

  h1 {
    font-size: 2rem;
  }

  .grid,
  .metrics,
  .add-sensor-form,
  .probability-row,
  .importance-row {
    grid-template-columns: 1fr;
  }
}

/* Modern SaaS design system pass */
:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --surface: #ffffff;
  --panel: #ffffff;
  --panel-soft: #f9fafb;
  --text: #111827;
  --muted: #667085;
  --muted-strong: #475467;
  --line: #e5e7eb;
  --line-strong: #d0d5dd;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: #eff6ff;
  --success: #12805c;
  --warn: #fff7ed;
  --danger: #b42318;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 10px 28px rgba(16, 24, 40, 0.06);
  --shadow-subtle: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-focus: 0 0 0 4px rgba(37, 99, 235, 0.12);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
}

html {
  font-size: 16px;
  text-rendering: optimizeLegibility;
}

body {
  background: var(--bg);
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.55;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
p,
button,
input,
select,
textarea,
th,
td,
label {
  letter-spacing: 0;
}

h1 {
  margin-bottom: 0;
  color: #101828;
  font-size: 2rem;
  font-weight: 760;
  line-height: 1.15;
}

h2 {
  margin-bottom: var(--space-3);
  color: #101828;
  font-size: 1.18rem;
  font-weight: 720;
  line-height: 1.3;
}

h3 {
  color: #101828;
  font-size: 1.04rem;
  font-weight: 700;
  line-height: 1.35;
}

h4 {
  color: #101828;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.35;
}

p {
  color: var(--muted-strong);
}

.shell {
  width: min(100% - 48px, 1680px);
  margin: 0 auto;
  padding: var(--space-8) 0 72px;
}

.app-topbar {
  border-bottom: 1px solid rgba(229, 231, 235, 0.9);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.02);
}

.topbar-inner {
  width: min(100% - 48px, 1680px);
  gap: var(--space-6);
  padding: var(--space-3) 0;
}

.brand {
  gap: var(--space-3);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #111827;
  font-size: 0.82rem;
  font-weight: 760;
}

.brand strong {
  color: #101828;
  font-size: 0.96rem;
  font-weight: 720;
}

.brand span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
}

.tabs {
  gap: var(--space-1);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: var(--space-1);
  background: #f3f4f6;
}

.tab {
  min-height: 34px;
  border-radius: 8px;
  padding: 0 var(--space-3);
  color: var(--muted-strong);
  font-size: 0.9rem;
  font-weight: 620;
}

.tab:hover {
  background: rgba(255, 255, 255, 0.72);
  color: #101828;
}

.tab.active {
  background: var(--surface);
  color: #101828;
  box-shadow: var(--shadow-subtle);
}

.header {
  align-items: flex-start;
  margin-bottom: var(--space-8);
}

.title-header {
  justify-content: center;
  margin-bottom: var(--space-12);
  padding: var(--space-6) 0 var(--space-4);
  text-align: center;
}

.title-header h1 {
  font-size: clamp(2.45rem, 3.6vw, 3.25rem);
}

.eyebrow,
.workflow-step-label,
.dag-analysis-days span,
.model-summary dt,
.ess-grid span,
th,
.sensor-histogram-stat span,
.axis-caption {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 620;
  letter-spacing: 0;
  text-transform: none;
}

.eyebrow,
.workflow-step-label {
  margin: 0 0 var(--space-2);
}

.muted,
.shadow-text,
.analysis-loading p,
.saved-analysis-card summary small,
.advanced-results-card summary small,
.method-equation span {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 450;
  line-height: 1.5;
}

.panel,
.metrics article,
.workflow-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-subtle);
}

.panel {
  margin-bottom: var(--space-6);
  padding: var(--space-6);
}

.workflow-section,
.workflow-section.panel {
  margin-bottom: var(--space-8);
  padding: var(--space-6);
  box-shadow: var(--shadow);
}

.workflow-heading,
.panel-heading,
.dag-properties-header,
.result-section-heading,
.method-card-heading,
.method-results-heading {
  gap: var(--space-4);
}

.workflow-heading {
  margin-bottom: var(--space-6);
  border-bottom: 1px solid var(--line);
  padding-bottom: var(--space-5);
}

.workflow-heading h2 {
  margin-bottom: var(--space-1);
  font-size: 1.34rem;
  font-weight: 740;
}

.panel-heading {
  margin-bottom: var(--space-5);
}

.panel-heading h2,
.panel-heading p,
.result-section-heading h2,
.result-section-heading p {
  margin-bottom: 0;
}

.workbench {
  --workbench-left-width: 448px;
  grid-template-columns: minmax(340px, var(--workbench-left-width)) 12px minmax(480px, 1fr);
  gap: var(--space-2);
}

.workbench-controls,
.dag-properties-sidebar {
  border-radius: var(--radius);
  box-shadow: var(--shadow-subtle);
}

.workbench-controls {
  padding: var(--space-6);
}

.settings-form,
.add-sensor-form,
.dag-properties-panel,
.sidebar-tab-panel,
.analysis-progress,
.model-summary,
.method-result-card {
  gap: var(--space-4);
}

label {
  display: grid;
  gap: var(--space-2);
  color: var(--muted-strong);
  font-size: 0.92rem;
  font-weight: 620;
  line-height: 1.35;
}

input,
select,
textarea {
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 10px var(--space-3);
  background: var(--surface);
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 450;
  box-shadow: 0 1px 1px rgba(16, 24, 40, 0.02);
}

input::placeholder,
textarea::placeholder {
  color: #98a2b3;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #b8c0cc;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: var(--shadow-focus);
}

input.has-error,
select.has-error,
textarea.has-error {
  border-color: #fda29b;
  background: #fffafa;
}

.field-error {
  color: var(--danger);
  font-size: 0.86rem;
  font-weight: 560;
}

.field-error[hidden] {
  display: none;
}

button,
.button {
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 0 var(--space-4);
  background: var(--surface);
  color: #101828;
  font-size: 0.92rem;
  font-weight: 620;
  box-shadow: var(--shadow-subtle);
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, color 140ms ease, transform 140ms ease;
}

button:hover,
.button:hover {
  border-color: #b8c0cc;
  background: #f9fafb;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
  transform: translateY(-1px);
}

.primary,
button[type="submit"] {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.18), 0 8px 18px rgba(37, 99, 235, 0.14);
}

.primary:hover,
button[type="submit"]:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

.small-button {
  min-height: 34px;
  padding: 0 var(--space-3);
  font-size: 0.88rem;
}

.danger-button {
  border-color: #fecdca;
  background: #fffafa;
  color: var(--danger);
}

.danger-button:hover {
  border-color: #fda29b;
  background: #fff1f0;
  color: #912018;
}

.method-equation {
  gap: var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
  background: var(--panel-soft);
}

.method-equation strong {
  font-size: 0.98rem;
  font-weight: 700;
}

.method-equation code,
.equation,
.latex-equation {
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  background: var(--surface);
  color: #344054;
  font-size: 0.9rem;
  font-weight: 560;
}

.method-latex-equation {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  color: #101828;
  font-size: 1.02rem;
  line-height: 1.5;
}

.method-latex-equation mjx-container {
  margin: 0 !important;
  min-width: max-content;
}

.method-equation-summary {
  display: block;
}

.method-equation-box {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-3);
  background: var(--surface);
}

.method-equation-scroll {
  overflow-x: hidden;
  overflow-y: hidden;
  min-width: 0;
  padding: var(--space-1);
}

.method-equation-scroll.is-scrollable {
  overflow-x: auto;
  padding-bottom: var(--space-2);
}

.method-equation-scale {
  display: inline-block;
  min-width: 100%;
  color: #101828;
  font-size: 1em;
  line-height: 1.5;
  transition: font-size 160ms ease;
}

.method-equation-scale mjx-container {
  margin: 0 !important;
  min-width: max-content;
}

.equation-explain-toggle {
  justify-self: start;
  min-height: 34px;
  border-color: transparent;
  padding: 0 var(--space-2);
  background: transparent;
  color: var(--accent-strong);
  box-shadow: none;
}

.equation-explain-toggle:hover,
.equation-explain-toggle:focus-visible {
  border-color: var(--accent-soft);
  background: var(--accent-soft);
  color: var(--accent-strong);
  box-shadow: none;
}

.equation-explanation {
  display: grid;
  gap: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-5);
  background: var(--panel-soft);
}

.equation-explanation[hidden] {
  display: none;
}

.equation-explanation-grid {
  display: grid;
  gap: var(--space-4);
}

.equation-explanation section {
  display: grid;
  gap: var(--space-2);
}

.equation-explanation h4,
.equation-explanation p,
.equation-explanation ul,
.equation-symbol-list {
  margin: 0;
}

.equation-explanation h4 {
  color: #101828;
  font-size: 0.94rem;
  font-weight: 700;
}

.equation-explanation p,
.equation-explanation li,
.equation-symbol-list dd {
  color: var(--muted-strong);
  font-size: 0.92rem;
  line-height: 1.55;
}

.equation-explanation ul {
  padding-left: 1.15rem;
}

.equation-symbol-list {
  display: grid;
  gap: var(--space-2);
}

.equation-symbol-list div {
  display: grid;
  grid-template-columns: minmax(84px, 0.35fr) minmax(0, 1fr);
  gap: var(--space-3);
  border-top: 1px solid var(--line);
  padding-top: var(--space-2);
}

.equation-symbol-list dt {
  color: #101828;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.88rem;
  font-weight: 700;
}

.equation-symbol-list dd {
  margin: 0;
}

.equation-technical-details {
  border-top: 1px solid var(--line);
  padding-top: var(--space-3);
}

.equation-technical-details summary {
  color: var(--muted-strong);
  font-size: 0.9rem;
  font-weight: 650;
  cursor: pointer;
}

.equation-technical-details p {
  margin-top: var(--space-2);
}

.dag-analysis-days {
  gap: var(--space-2);
  min-width: 188px;
  border-radius: var(--radius);
  padding: var(--space-3);
  background: var(--surface);
  box-shadow: var(--shadow-subtle);
}

.dag-analysis-days input {
  min-height: 44px;
  font-size: 1.3rem;
  font-weight: 720;
}

.dag-toolbar,
.sidebar-actions,
.analysis-step-tabs,
.method-chart-legend,
.saved-analysis-meta {
  gap: var(--space-2);
}

.dag-editor-layout {
  gap: var(--space-5);
}

.dag-properties-sidebar {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: var(--space-5);
}

.dag-sidebar-topbar {
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--line);
  padding-bottom: var(--space-4);
}

.dag-sidebar-topbar strong,
.dag-properties-placeholder h3,
.dag-properties-panel h3 {
  color: #101828;
  font-size: 1rem;
  font-weight: 720;
}

.dag-properties-placeholder {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: var(--space-5);
  background: var(--panel-soft);
}

.sidebar-tabs {
  gap: var(--space-2);
}

.sidebar-tabs button {
  justify-content: flex-start;
  min-height: 42px;
  border-radius: 10px;
  padding: 0 var(--space-3);
  background: var(--surface);
  font-size: 0.92rem;
  font-weight: 640;
  text-align: left;
  box-shadow: none;
}

.sidebar-tabs button span {
  width: 24px;
  height: 24px;
  background: #eef2ff;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 720;
}

.sidebar-tabs button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.sidebar-tab-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-5);
  background: var(--surface);
}

.sidebar-tab-panel h4 {
  margin: 0;
}

.dag-scroll {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: #fbfcfe;
}

.dag-canvas {
  background-color: #fbfcfe;
  background-image:
    linear-gradient(rgba(17, 24, 39, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 24, 39, 0.045) 1px, transparent 1px);
  background-size: 24px 24px;
}

.dag-node {
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.08);
}

.dag-node:hover {
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
}

.dag-node.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12), 0 10px 30px rgba(16, 24, 40, 0.14);
}

.dag-node-title {
  color: #101828;
  font-size: 1.12rem;
  font-weight: 760;
}

.dag-role-shadow,
.dag-time-shadow {
  color: rgba(71, 84, 103, 0.52);
  font-weight: 650;
}

.dag-connect-handle {
  border-color: var(--surface);
  background: var(--accent);
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.24);
}

.dag-cycle-warning,
.coverage-warning,
.result-validation-card {
  border-color: #fedf89;
  border-radius: var(--radius);
  background: #fffbeb;
  color: #7a4b00;
}

.analysis-step-tab {
  min-height: 36px;
  border-radius: 999px;
  padding: 0 var(--space-3);
  background: var(--surface);
  color: var(--muted-strong);
  font-size: 0.88rem;
  font-weight: 620;
}

.analysis-step-tab.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.analysis-step-tab.complete {
  border-color: #abefc6;
  background: #ecfdf3;
  color: var(--success);
}

.analysis-results {
  font-size: 1rem;
  line-height: 1.55;
}

.analysis-results .result-card,
.method-result-card {
  padding: var(--space-6);
}

.method-primary-result {
  position: relative;
  overflow: hidden;
  border-left: 0;
  border-color: rgba(37, 99, 235, 0.24);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 20px 48px rgba(37, 99, 235, 0.1);
}

.method-primary-result::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--accent);
}

.effect-estimate {
  gap: var(--space-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: var(--space-8);
  background: #f8fbff;
}

.effect-estimate strong {
  color: #101828;
  font-size: clamp(2.6rem, 4vw, 4.4rem);
  font-weight: 760;
  line-height: 0.95;
}

.effect-estimate span {
  color: var(--accent-strong);
  font-size: 1.08rem;
  font-weight: 650;
}

.effect-estimate small {
  color: var(--muted);
  font-size: 0.94rem;
}

.effect-interpretation {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-5);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.98rem;
  font-weight: 560;
  line-height: 1.55;
}

.clinician-summary-card {
  display: grid;
  gap: var(--space-5);
}

.clinician-summary-card h2 {
  max-width: 920px;
  margin-bottom: 0;
  color: #101828;
  font-size: clamp(1.9rem, 3vw, 3.1rem);
  line-height: 1.05;
}

.clinician-answer {
  max-width: 920px;
  margin: 0;
  color: #344054;
  font-size: 1.12rem;
  line-height: 1.65;
}

.clinician-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-4);
}

.clinician-summary-grid article {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 14px;
  padding: var(--space-4);
  background: #f8fbff;
}

.clinician-summary-grid span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.clinician-summary-grid strong {
  color: #101828;
  font-size: 1.08rem;
  line-height: 1.25;
}

.clinician-summary-grid small {
  color: var(--muted);
  font-weight: 650;
}

.clinician-cause-chain {
  display: grid;
  gap: var(--space-3);
  border: 1px solid rgba(34, 197, 94, 0.18);
  border-radius: 14px;
  padding: var(--space-4) var(--space-5);
  background: #f0fdf4;
}

.clinician-cause-chain strong {
  color: #14532d;
}

.clinician-cause-chain ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 1.1rem;
}

.clinician-cause-chain li {
  color: #1f2937;
  font-weight: 650;
}

.clinician-caveat {
  margin: 0;
  border: 1px solid #fed7aa;
  border-radius: 14px;
  padding: var(--space-4) var(--space-5);
  background: #fff7ed;
  color: #7c2d12;
  font-size: 0.96rem;
  line-height: 1.55;
}

.technical-results-details {
  display: grid;
  gap: var(--space-5);
}

.technical-results-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: var(--space-4) var(--space-5);
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  color: #101828;
  cursor: pointer;
  list-style: none;
}

.technical-results-details > summary::-webkit-details-marker {
  display: none;
}

.technical-results-details > summary::after {
  content: "+";
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 1.2rem;
  font-weight: 800;
}

.technical-results-details[open] > summary::after {
  content: "-";
}

.technical-results-details > summary span {
  display: grid;
  gap: 3px;
}

.technical-results-details > summary strong {
  font-size: 1rem;
}

.technical-results-details > summary small {
  color: var(--muted);
  font-weight: 650;
}

.technical-results-content {
  display: grid;
  gap: var(--space-6);
}

.method-results-section,
.method-results-grid,
.method-results-group,
.response-grid,
.grid,
.metrics,
.saved-analysis-list {
  gap: var(--space-6);
}

.method-results-heading {
  padding: 0 var(--space-1);
}

.method-results-heading h2 {
  margin-bottom: 0;
}

.method-result-card {
  min-height: 100%;
  box-shadow: var(--shadow-subtle);
}

.method-line-chart {
  grid-template-columns: 48px minmax(420px, 1fr);
  gap: var(--space-3);
  min-height: 320px;
}

.method-chart-plot {
  min-height: 284px;
}

.method-chart-plot svg,
.mini-response-chart svg,
.prediction-plot svg {
  border-color: var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.method-chart-line,
.prediction-line {
  stroke-width: 3;
}

.prediction-gridline {
  stroke: #eef2f6;
}

.method-chart-legend {
  justify-content: flex-start;
  color: var(--muted-strong);
  font-size: 0.9rem;
  font-weight: 620;
}

.method-histogram,
.distribution-bars {
  border-color: var(--line);
  border-radius: 10px;
  padding: var(--space-4) var(--space-3) 0;
  background: var(--surface);
}

.method-histogram-bin span,
.distribution-point span {
  background: var(--accent);
}

.love-row,
.forest-row,
.strategy-list article,
.result-validation-list article,
.ess-grid article,
.summary-chip,
.distribution-details,
.probability-row,
.importance-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.love-row,
.forest-row,
.strategy-list article,
.ess-grid article,
.probability-row,
.importance-row {
  padding: var(--space-3);
}

.ess-grid strong {
  color: #101828;
  font-size: 1.7rem;
  font-weight: 740;
}

.counterfactual-table,
table {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

th,
td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--line);
}

th {
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 620;
  text-transform: none;
}

td {
  color: var(--muted-strong);
  font-size: 0.94rem;
}

tbody tr:hover {
  background: #f9fafb;
}

.advanced-results-card {
  border-radius: var(--radius);
}

.advanced-results-card summary,
.saved-analysis-card summary {
  padding: var(--space-5) var(--space-6);
}

.advanced-results-grid {
  padding: 0 var(--space-6) var(--space-6);
}

.saved-model-summary,
.saved-result-section {
  margin: 0 var(--space-6) var(--space-6);
  padding-top: var(--space-5);
}

.saved-analysis-meta em {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px var(--space-3);
  background: var(--panel-soft);
  color: var(--muted-strong);
  font-size: 0.84rem;
  font-weight: 620;
}

.notice,
.empty-state {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-4);
  background: var(--surface);
  color: var(--muted-strong);
  box-shadow: var(--shadow-subtle);
}

.empty-state {
  border-style: dashed;
  background: var(--panel-soft);
}

.spinner,
.button-spinner {
  border-color: rgba(37, 99, 235, 0.14);
  border-top-color: var(--accent);
}

@media (max-width: 1080px) {
  .workbench,
  .workbench.is-output-condensed {
    grid-template-columns: 1fr;
  }

  .workbench-controls,
  .workbench-output,
  .workbench.is-output-condensed .workbench-output {
    grid-column: 1;
    grid-row: auto;
  }

  .workbench-resizer {
    display: none;
  }

  .method-results-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .shell,
  .topbar-inner {
    width: min(100% - 24px, 1680px);
  }

  .shell {
    padding-top: var(--space-5);
  }

  h1 {
    font-size: 1.72rem;
  }

  .workflow-section,
  .workflow-section.panel,
  .panel,
  .analysis-results .result-card {
    padding: var(--space-4);
  }

  .workflow-heading,
  .dag-workflow-heading,
  .result-section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .dag-toolbar {
    flex-wrap: wrap;
  }

  .dag-editor-layout {
    grid-template-columns: 1fr;
  }

  .dag-properties-sidebar,
  .dag-scroll {
    grid-column: 1;
  }

  .method-line-chart {
    grid-template-columns: 40px minmax(320px, 1fr);
  }

  .effect-estimate {
    padding: var(--space-5);
  }
}

/* Visual-only SaaS polish: preserve layout, spacing, order, and workflows. */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-soft: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --muted-strong: #334155;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: #eff6ff;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 18px 50px rgba(15, 23, 42, 0.07);
  --shadow-subtle: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.04);
  --shadow-focus: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

body {
  background:
    radial-gradient(circle at 18% 0%, rgba(37, 99, 235, 0.14), transparent 30rem),
    radial-gradient(circle at 82% 8%, rgba(37, 99, 235, 0.08), transparent 28rem),
    linear-gradient(rgba(37, 99, 235, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.035) 1px, transparent 1px),
    var(--bg);
  background-attachment: fixed, fixed, fixed, fixed, fixed;
  background-size: auto, auto, 28px 28px, 28px 28px, auto;
  color: var(--text);
}

.app-topbar {
  border-bottom-color: rgba(226, 232, 240, 0.78);
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(18px);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.brand-mark {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
}

.brand strong,
h1,
h2,
h3,
h4,
.dag-node-title,
.effect-estimate strong {
  color: var(--text);
}

h1,
h2,
h3,
h4 {
  font-weight: 780;
}

.tabs {
  border-color: rgba(226, 232, 240, 0.92);
  background: rgba(241, 245, 249, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.tab.active {
  color: var(--accent-strong);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 8px 20px rgba(15, 23, 42, 0.06);
}

.panel,
.metrics article,
.workflow-section,
.analysis-results .result-card,
.method-result-card,
.saved-analysis-card,
.saved-analysis-row {
  border-color: rgba(226, 232, 240, 0.92);
  background: var(--panel);
  box-shadow: var(--shadow-subtle);
}

.workflow-section,
.workflow-section.panel,
.method-primary-result {
  box-shadow: var(--shadow);
}

.workflow-heading,
.panel-heading,
.dag-sidebar-topbar,
.equation-technical-details,
th,
td {
  border-color: rgba(226, 232, 240, 0.88);
}

.workbench-controls,
.dag-properties-sidebar,
.sidebar-tab-panel,
.dag-scroll,
.method-equation,
.method-equation-box,
.equation-explanation,
.effect-estimate,
.effect-interpretation,
.analysis-progress,
.model-summary,
.summary-chip,
.love-row,
.forest-row,
.strategy-list article,
.result-validation-list article,
.ess-grid article,
.probability-row,
.importance-row,
.distribution-details,
table,
.counterfactual-table,
.notice,
.empty-state {
  border-color: rgba(226, 232, 240, 0.92);
  background-color: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-subtle);
}

.method-equation,
.equation-explanation,
.empty-state,
.dag-properties-placeholder,
.method-histogram,
.distribution-bars,
th,
.saved-analysis-meta em {
  background-color: rgba(248, 250, 252, 0.92);
}

input,
select,
textarea {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 1px 1px rgba(15, 23, 42, 0.02);
}

input:hover,
select:hover,
textarea:hover {
  border-color: #94a3b8;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: var(--shadow-focus);
}

button,
.button {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  box-shadow: var(--shadow-subtle);
}

button:hover,
.button:hover {
  border-color: #94a3b8;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 12px 28px rgba(15, 23, 42, 0.08);
}

.primary,
button[type="submit"] {
  border-color: var(--accent);
  background: linear-gradient(180deg, #3b82f6, var(--accent));
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.18), 0 14px 28px rgba(37, 99, 235, 0.18);
}

.primary:hover,
button[type="submit"]:hover {
  border-color: var(--accent-strong);
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
}

.dag-canvas {
  background-color: rgba(255, 255, 255, 0.72);
  background-image:
    radial-gradient(circle at 18% 8%, rgba(37, 99, 235, 0.08), transparent 18rem),
    linear-gradient(rgba(37, 99, 235, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.055) 1px, transparent 1px);
  background-size: auto, 24px 24px, 24px 24px;
}

.dag-node {
  border-color: rgba(37, 99, 235, 0.16);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 14px 30px rgba(15, 23, 42, 0.07);
}

.dag-node:hover {
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08), 0 18px 38px rgba(15, 23, 42, 0.1);
}

.dag-node.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.13), 0 18px 42px rgba(37, 99, 235, 0.12);
}

.dag-node.exposure,
.dag-node.covariate,
.dag-node.outcome,
.dag-node.latent {
  background: rgba(255, 255, 255, 0.98);
}

.analysis-step-tab,
.sidebar-tabs button,
.dag-analysis-days,
.method-chart-plot svg,
.mini-response-chart svg,
.prediction-plot svg {
  border-color: rgba(226, 232, 240, 0.92);
  background: rgba(255, 255, 255, 0.92);
}

.analysis-step-tab.active,
.sidebar-tabs button.active,
.dag-node-tabs button.active,
.tab:hover,
.section-toggle:hover,
.section-toggle:focus-visible {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.analysis-step-tab.complete {
  border-color: rgba(18, 128, 92, 0.2);
  background: #ecfdf5;
}

.method-primary-result::before,
.method-histogram-bin span,
.distribution-point span,
.mini-histogram-legend .count,
.dag-connect-handle,
.dag-threshold-marker {
  background: var(--accent);
}

.effect-estimate {
  background:
    linear-gradient(180deg, rgba(239, 246, 255, 0.95), rgba(255, 255, 255, 0.94));
}

.effect-interpretation {
  border-color: rgba(37, 99, 235, 0.16);
  background:
    linear-gradient(180deg, rgba(239, 246, 255, 0.94), rgba(255, 255, 255, 0.82));
}

tbody tr:hover {
  background: rgba(248, 250, 252, 0.95);
}

/* Leadership demo polish: visual refinements only. */
:root {
  --bg: #f8fafc;
  --panel: rgba(255, 255, 255, 0.96);
  --panel-soft: #f8fafc;
  --line: #e6edf5;
  --line-strong: #cbd5e1;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: #eff6ff;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 22px 60px rgba(15, 23, 42, 0.08);
  --shadow-subtle: 0 1px 2px rgba(15, 23, 42, 0.035), 0 10px 28px rgba(15, 23, 42, 0.045);
}

* {
  scrollbar-color: rgba(148, 163, 184, 0.38) transparent;
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.38);
  background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.5);
  background-clip: content-box;
}

body {
  background:
    radial-gradient(circle at 12% -8%, rgba(37, 99, 235, 0.16), transparent 34rem),
    radial-gradient(circle at 86% 0%, rgba(37, 99, 235, 0.09), transparent 32rem),
    linear-gradient(rgba(37, 99, 235, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.028) 1px, transparent 1px),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 36rem);
  background-attachment: fixed, fixed, fixed, fixed, fixed;
  background-size: auto, auto, 30px 30px, 30px 30px, auto;
}

h1 {
  font-size: clamp(2.15rem, 3vw, 2.75rem);
  font-weight: 820;
}

.workflow-heading h2 {
  font-size: clamp(1.45rem, 2vw, 1.8rem);
  font-weight: 820;
}

.panel-heading h2,
.result-section-heading h2,
.method-results-heading h2,
.analysis-progress-heading h2 {
  font-size: 1.28rem;
  font-weight: 800;
}

.dag-properties-panel h3,
.dag-sidebar-topbar strong {
  font-size: 1.08rem;
  font-weight: 800;
}

.eyebrow,
.workflow-step-label {
  color: var(--accent-strong);
  font-weight: 720;
}

.panel,
.workflow-section,
.workbench-controls,
.dag-properties-sidebar,
.sidebar-tab-panel,
.analysis-results .result-card,
.method-result-card,
.saved-analysis-card,
.saved-analysis-row {
  border-color: rgba(226, 237, 245, 0.96);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.92));
  box-shadow: var(--shadow-subtle);
}

.workflow-section,
.workflow-section.panel,
.method-primary-result {
  box-shadow: var(--shadow);
}

.workflow-heading {
  border-bottom-color: rgba(226, 237, 245, 0.92);
}

.app-topbar {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(22px);
}

.brand-mark {
  background: linear-gradient(135deg, #3b82f6, var(--accent-strong));
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.24);
}

.tabs {
  background: rgba(241, 245, 249, 0.68);
}

.tab.active,
.tab:hover {
  color: var(--accent-strong);
}

.guide-tab,
.guide-tab:hover,
.guide-tab:focus-visible {
  color: #fff;
}

.guide-tab {
  border-color: rgba(37, 99, 235, 0.42);
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.14), 0 12px 28px rgba(37, 99, 235, 0.26);
}

.guide-tab:hover,
.guide-tab:focus-visible {
  border-color: rgba(29, 78, 216, 0.7);
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  box-shadow: 0 0 0 7px rgba(37, 99, 235, 0.18), 0 14px 32px rgba(37, 99, 235, 0.32);
}

input,
select,
textarea,
button,
.button {
  border-color: rgba(203, 213, 225, 0.9);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
}

.primary,
button[type="submit"] {
  background: linear-gradient(180deg, #3b82f6, var(--accent));
}

.dag-scroll {
  border-color: rgba(226, 237, 245, 0.96);
  background:
    radial-gradient(circle at 18% 10%, rgba(37, 99, 235, 0.07), transparent 18rem),
    rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), var(--shadow-subtle);
}

.dag-canvas {
  background-color: rgba(255, 255, 255, 0.7);
  background-image:
    radial-gradient(circle at 16% 10%, rgba(37, 99, 235, 0.08), transparent 20rem),
    linear-gradient(rgba(37, 99, 235, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.045) 1px, transparent 1px);
  background-size: auto, 28px 28px, 28px 28px;
}

.dag-node {
  border-color: rgba(37, 99, 235, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 250, 252, 0.98));
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 16px 36px rgba(15, 23, 42, 0.08);
}

.dag-node.exposure,
.dag-node.covariate,
.dag-node.outcome,
.dag-node.latent {
  border-color: rgba(37, 99, 235, 0.2);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 250, 252, 0.98));
}

.dag-node.is-selected {
  border-color: var(--accent);
  background:
    linear-gradient(180deg, rgba(239, 246, 255, 0.98), rgba(255, 255, 255, 0.98));
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14), 0 20px 46px rgba(37, 99, 235, 0.15);
}

.dag-edges line,
.dag-edges polyline,
.dag-edges path[data-rendered-edge] {
  stroke: var(--accent);
}

.dag-edges marker path {
  fill: var(--accent);
}

.sidebar-tabs button,
.analysis-step-tab,
.dag-node-tabs button {
  border-color: rgba(226, 237, 245, 0.96);
}

.sidebar-tabs button.active,
.analysis-step-tab.active,
.dag-node-tabs button.active {
  border-color: rgba(37, 99, 235, 0.32);
  background: var(--accent-soft);
}

.method-primary-result {
  border-color: rgba(37, 99, 235, 0.18);
}

.effect-estimate {
  border-color: rgba(37, 99, 235, 0.12);
  background:
    radial-gradient(circle at 12% 0%, rgba(37, 99, 235, 0.11), transparent 18rem),
    linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(255, 255, 255, 0.94));
}

.effect-interpretation {
  border-color: rgba(37, 99, 235, 0.16);
  background:
    linear-gradient(180deg, rgba(239, 246, 255, 0.95), rgba(255, 255, 255, 0.86));
}

.exposed-density .density-line {
  stroke: var(--accent);
  stroke-dasharray: 5 5;
}

.mini-exposed-bar {
  background: linear-gradient(180deg, #93c5fd, var(--accent-strong));
}

.mini-histogram-legend .exposed {
  background: #93c5fd;
}

.mini-histogram-legend .curve {
  background: linear-gradient(90deg, #bfdbfe, var(--accent));
}

.dag-overlay-layer.color-0 .density-line,
.dag-overlay-layer.color-1 .density-line,
.dag-overlay-layer.color-2 .density-line,
.dag-overlay-layer.color-3 .density-line,
.dag-overlay-layer.color-4 .density-line {
  stroke: var(--accent);
}

.dag-overlay-legend .color-0 i,
.dag-overlay-legend .color-1 i,
.dag-overlay-legend .color-2 i,
.dag-overlay-legend .color-3 i,
.dag-overlay-legend .color-4 i {
  background: var(--accent);
}

/* Causal DAG bubble-card layout: visual structure only, existing DOM and behavior stay intact. */
.workflow-dag-section.panel.dag-canvas-panel {
  overflow: visible;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.workflow-dag-section .dag-workflow-heading {
  align-items: center;
  border: 1px solid rgba(226, 237, 245, 0.98);
  border-radius: 30px;
  margin: 0 0 24px;
  padding: 24px 26px;
  background:
    radial-gradient(circle at 12% 0%, rgba(37, 99, 235, 0.08), transparent 22rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 250, 252, 0.94));
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 22px 58px rgba(15, 23, 42, 0.08);
}

.workflow-dag-section .dag-workflow-heading h2 {
  font-size: clamp(1.65rem, 2.2vw, 2.1rem);
  letter-spacing: 0;
}

.workflow-dag-section .dag-workflow-heading .muted {
  max-width: 720px;
  color: #64748b;
  font-size: 0.98rem;
}

.workflow-dag-section .dag-header-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  max-width: 680px;
  max-height: 180px;
  overflow: hidden;
  opacity: 1;
  transform: translateY(0) scale(1);
  transform-origin: top right;
  transition:
    opacity 260ms ease,
    transform 360ms cubic-bezier(0.22, 1, 0.36, 1),
    max-width 360ms cubic-bezier(0.22, 1, 0.36, 1),
    max-height 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

.workflow-dag-section.is-dag-collapsed .dag-header-controls {
  max-width: 0;
  max-height: 0;
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  pointer-events: none;
}

.workflow-dag-section .dag-analysis-days,
.workflow-dag-section .dag-toolbar .button,
.workflow-dag-section .dag-selection-count {
  border-color: rgba(203, 213, 225, 0.82);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
}

.dag-tools-shell {
  display: grid;
  grid-template-rows: 1fr;
  overflow: hidden;
  opacity: 1;
  transform: translateY(0) scale(1);
  transform-origin: top center;
  transition:
    grid-template-rows 560ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 320ms ease,
    transform 560ms cubic-bezier(0.22, 1, 0.36, 1);
}

.dag-tools-shell > .dag-editor-layout {
  min-height: 0;
  padding: 0 2px 8px;
  margin: 0 -2px -8px;
}

.workflow-dag-section.is-dag-collapsed .dag-tools-shell {
  grid-template-rows: 0fr;
  opacity: 0;
  transform: translateY(-12px) scale(0.985);
  pointer-events: none;
}

.workflow-dag-section .dag-editor-layout {
  grid-template-columns: minmax(0, 1fr) minmax(320px, var(--dag-sidebar-width, 360px));
  gap: 24px;
  align-items: stretch;
}

.workflow-dag-section .dag-scroll,
.workflow-dag-section .dag-properties-sidebar {
  border: 1px solid rgba(226, 237, 245, 0.98);
  border-radius: 30px;
  background:
    radial-gradient(circle at 18% 6%, rgba(37, 99, 235, 0.07), transparent 20rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.93));
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 22px 54px rgba(15, 23, 42, 0.075);
}

.workflow-dag-section .dag-scroll,
.workflow-dag-section .dag-properties-sidebar,
.workflow-dag-section .dag-section-resize-handle {
  opacity: 1;
  transform: translateY(0) scale(1);
  transform-origin: top center;
  transition:
    opacity 420ms ease,
    transform 560ms cubic-bezier(0.22, 1, 0.36, 1);
}

.workflow-dag-section .dag-properties-sidebar {
  transition-delay: 60ms;
}

.workflow-dag-section .dag-scroll {
  transition-delay: 120ms;
}

.workflow-dag-section .dag-section-resize-handle {
  transition-delay: 150ms;
}

.workflow-dag-section.is-dag-collapsed .dag-scroll,
.workflow-dag-section.is-dag-collapsed .dag-properties-sidebar,
.workflow-dag-section.is-dag-collapsed .dag-section-resize-handle {
  opacity: 0;
  transform: translateY(-18px) scale(0.96);
}

.workflow-dag-section.is-dag-collapsed .dag-section-resize-handle {
  pointer-events: none;
}

.workflow-dag-section .dag-scroll {
  min-height: 520px;
  max-height: min(720px, calc(100vh - 220px));
}

.workflow-dag-section .dag-canvas {
  background-color: transparent;
  background-image:
    radial-gradient(circle at 18% 10%, rgba(37, 99, 235, 0.075), transparent 20rem),
    linear-gradient(rgba(37, 99, 235, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.04) 1px, transparent 1px);
  background-size: auto, 30px 30px, 30px 30px;
}

.workflow-dag-section .dag-properties-sidebar {
  padding: 24px;
}

.workflow-dag-section .dag-sidebar-topbar {
  border-bottom-color: rgba(226, 237, 245, 0.86);
}

.workflow-dag-section .dag-properties-placeholder,
.workflow-dag-section .sidebar-tab-panel {
  border-color: rgba(226, 237, 245, 0.96);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.workflow-dag-section .dag-cycle-warning {
  border-radius: 22px;
  margin: 0 0 20px;
  box-shadow: var(--shadow-subtle);
}

@media (max-width: 760px) {
  .workflow-dag-section .dag-workflow-heading {
    align-items: stretch;
    flex-direction: column;
    border-radius: 24px;
    padding: var(--space-4);
  }

  .workflow-dag-section .dag-header-controls {
    align-items: stretch;
    flex-direction: column;
    max-width: none;
    max-height: 320px;
  }

  .workflow-dag-section.is-dag-collapsed .dag-header-controls {
    max-height: 0;
  }

  .workflow-dag-section .dag-editor-layout {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .workflow-dag-section .dag-properties-sidebar,
  .workflow-dag-section .dag-scroll {
    grid-column: 1;
    border-radius: 24px;
  }

  .workflow-dag-section .dag-scroll {
    min-height: 460px;
  }
}

/* Step 2 bubble-card workflow: visual only, preserves existing analysis controls and output flow. */
.workflow-analysis-section {
  overflow: visible;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.workflow-analysis-section .analysis-workflow-heading {
  align-items: center;
  border: 1px solid rgba(226, 237, 245, 0.98);
  border-radius: 30px;
  margin: 0 0 24px;
  padding: 24px 26px;
  background:
    radial-gradient(circle at 12% 0%, rgba(37, 99, 235, 0.08), transparent 22rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 250, 252, 0.94));
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 22px 58px rgba(15, 23, 42, 0.08);
}

.workflow-analysis-section .analysis-workflow-heading h2 {
  font-size: clamp(1.65rem, 2.2vw, 2.1rem);
  letter-spacing: 0;
}

.workflow-analysis-section .section-toggle {
  width: 36px;
  min-height: 36px;
  height: 36px;
  margin-right: 10px;
}

.workflow-analysis-section .section-toggle::before {
  border-top-width: 9px;
  border-right-width: 7px;
  border-left-width: 7px;
}

.workflow-analysis-section .section-toggle[aria-expanded="false"]::before {
  border-top-width: 7px;
  border-bottom-width: 7px;
  border-left-width: 9px;
}

.workflow-analysis-section .analysis-workflow-heading .muted {
  max-width: 720px;
  color: #64748b;
  font-size: 0.98rem;
}

.analysis-tools-shell {
  display: grid;
  grid-template-rows: 1fr;
  overflow: hidden;
  opacity: 1;
  transform: translateY(0) scale(1);
  transform-origin: top center;
  transition:
    grid-template-rows 560ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 320ms ease,
    transform 560ms cubic-bezier(0.22, 1, 0.36, 1);
}

.analysis-tools-shell > .workbench {
  min-height: 0;
  padding: 0 2px 8px;
  margin: 0 -2px -8px;
}

.workflow-analysis-section.is-analysis-collapsed .analysis-tools-shell {
  grid-template-rows: 0fr;
  opacity: 0;
  transform: translateY(-12px) scale(0.985);
  pointer-events: none;
}

.workflow-analysis-section .workbench-controls,
.workflow-analysis-section .workbench-resizer,
.workflow-analysis-section .workbench-output {
  opacity: 1;
  transform: translateY(0) scale(1);
  transform-origin: top center;
  transition:
    opacity 420ms ease,
    transform 560ms cubic-bezier(0.22, 1, 0.36, 1);
}

.workflow-analysis-section .workbench-controls {
  transition-delay: 60ms;
}

.workflow-analysis-section .workbench-resizer {
  transition-delay: 90ms;
}

.workflow-analysis-section .workbench-output {
  transition-delay: 120ms;
}

.workflow-analysis-section.is-analysis-collapsed .workbench-controls,
.workflow-analysis-section.is-analysis-collapsed .workbench-resizer,
.workflow-analysis-section.is-analysis-collapsed .workbench-output {
  opacity: 0;
  transform: translateY(-18px) scale(0.96);
}

.workflow-analysis-section .workbench,
.workflow-analysis-section .workbench.is-output-condensed {
  grid-template-columns: minmax(320px, var(--workbench-left-width, 448px)) 12px minmax(420px, 1fr);
  gap: 18px;
  align-items: stretch;
}

.workflow-analysis-section .workbench-controls,
.workflow-analysis-section .workbench-output {
  border: 1px solid rgba(226, 237, 245, 0.98);
  border-radius: 28px;
  background:
    radial-gradient(circle at 16% 4%, rgba(37, 99, 235, 0.055), transparent 18rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.93));
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 18px 46px rgba(15, 23, 42, 0.07);
}

.workflow-analysis-section .workbench-controls {
  padding: 24px;
}

.workflow-analysis-section .workbench-output {
  display: grid;
  align-content: start;
  gap: 18px;
  min-height: 420px;
  padding: 24px;
}

.workflow-analysis-section .workbench-output.is-running {
  align-content: stretch;
}

.workflow-analysis-section .workbench-output .panel {
  margin-bottom: 0;
}

.workflow-analysis-section .workbench-empty,
.workflow-analysis-section .workbench-running,
.workflow-analysis-section .analysis-results .result-card,
.workflow-analysis-section .method-result-card,
.workflow-analysis-section .method-results-group,
.workflow-analysis-section .advanced-results-card {
  border-color: rgba(226, 237, 245, 0.96);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 1px 2px rgba(15, 23, 42, 0.025);
}

.workflow-analysis-section .workbench-empty {
  min-height: 100%;
}

.workflow-analysis-section .workbench-output > .workbench-empty,
.workflow-analysis-section .workbench-output > .workbench-running {
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.workflow-analysis-section .workbench-output > .workbench-running .analysis-progress {
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.workflow-analysis-section .panel-heading.compact-heading {
  border-bottom: 1px solid rgba(226, 237, 245, 0.86);
  margin-bottom: 18px;
  padding-bottom: 16px;
}

.workflow-analysis-section .panel-heading.compact-heading h2,
.workflow-analysis-section .workbench-empty h2 {
  font-size: 1.28rem;
  font-weight: 820;
}

.workflow-analysis-section .method-equation,
.workflow-analysis-section .analysis-progress,
.workflow-analysis-section .effect-estimate,
.workflow-analysis-section .effect-interpretation {
  border-color: rgba(226, 237, 245, 0.96);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.86);
}

.workflow-analysis-section .workbench-resizer {
  align-self: stretch;
  border-radius: 999px;
}

.workflow-analysis-section .workbench-resizer:hover,
.workflow-analysis-section .workbench-resizer:focus-visible {
  background: rgba(37, 99, 235, 0.08);
}

@media (max-width: 1080px) {
  .workflow-analysis-section .workbench,
  .workflow-analysis-section .workbench.is-output-condensed {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .workflow-analysis-section .workbench-controls,
  .workflow-analysis-section .workbench-output,
  .workflow-analysis-section .workbench.is-output-condensed .workbench-output {
    grid-column: 1;
    grid-row: auto;
  }

  .workflow-analysis-section .workbench-resizer {
    display: none;
  }
}

@media (max-width: 760px) {
  .workflow-analysis-section {
    padding: 0;
  }

  .workflow-analysis-section .analysis-workflow-heading {
    align-items: stretch;
    flex-direction: column;
    border-radius: 24px;
    margin-bottom: var(--space-4);
    padding: var(--space-4);
  }

  .workflow-analysis-section .workbench-controls,
  .workflow-analysis-section .workbench-output {
    border-radius: 24px;
    padding: var(--space-4);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dag-tools-shell,
  .analysis-tools-shell,
  .workflow-dag-section .dag-header-controls,
  .workflow-dag-section .dag-scroll,
  .workflow-dag-section .dag-properties-sidebar,
  .workflow-dag-section .dag-section-resize-handle,
  .workflow-analysis-section .workbench-controls,
  .workflow-analysis-section .workbench-resizer,
  .workflow-analysis-section .workbench-output {
    transition: none;
  }

  .workflow-dag-section.is-dag-collapsed .dag-tools-shell,
  .workflow-dag-section.is-dag-collapsed .dag-header-controls,
  .workflow-dag-section.is-dag-collapsed .dag-scroll,
  .workflow-dag-section.is-dag-collapsed .dag-properties-sidebar,
  .workflow-dag-section.is-dag-collapsed .dag-section-resize-handle,
  .workflow-analysis-section.is-analysis-collapsed .analysis-tools-shell,
  .workflow-analysis-section.is-analysis-collapsed .workbench-controls,
  .workflow-analysis-section.is-analysis-collapsed .workbench-resizer,
  .workflow-analysis-section.is-analysis-collapsed .workbench-output {
    transform: none;
  }
}
