/* Forecast Logic Canvas: flow view, stages, cards, connections. */

.epi-tech-modal .epi-tech-split-editor {
  display: grid !important;
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, 1fr) !important;
  gap: 10px !important;
}
.epi-transition-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(250px, .9fr);
  gap: 10px;
  align-items: start;
}
.epi-transition-states,
.epi-transition-order > div,
.epi-transition-example {
  display: grid;
  gap: 5px;
  margin: 8px 0;
}
.epi-transition-kind { display: grid; gap: 4px; font-size: 10px; font-weight: 800; color: var(--ps-muted); }
.epi-transition-state {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto 30px;
  gap: 6px;
  align-items: center;
  min-height: 32px;
}
.epi-transition-reorder { display: inline-flex; gap: 3px; }
.epi-transition-reorder .btn { width: 21px; min-width: 21px; height: 30px; min-height: 30px; padding: 0; border-color: var(--ps-line-strong); color: var(--ps-muted); background: var(--ps-panel); }
.epi-transition-reorder .btn:disabled { opacity: .42; cursor: not-allowed; }
.epi-transition-reorder .btn:not(:disabled):hover,
.epi-transition-reorder .btn:not(:disabled):focus-visible { border-color: #bba7df; color: #6243ad; background: #fbf8ff; }
.epi-transition-state small {
  padding: 3px 5px;
  border-radius: 4px;
  background: #f2ebff;
  color: var(--ps-purple);
  font-size: 8px;
  font-weight: 850;
}
.epi-transition-state .epi-transition-delete-state {
  display:inline-flex !important;
  width:30px;
  height:30px;
  min-width:30px;
  min-height:30px;
  align-items:center;
  justify-content:center;
  visibility:visible !important;
  opacity:1 !important;
  border:1px solid var(--ps-line-strong);
  border-radius:6px;
  background:var(--ps-panel);
  color:var(--ps-muted);
}
.epi-transition-state .epi-transition-delete-state:hover,
.epi-transition-state .epi-transition-delete-state:focus-visible { border-color:#d78b8b; background:#fff7f7; color:var(--ps-red); }
.epi-transition-order-state,
.epi-transition-example > span {
  display: grid;
  justify-items: center;
  gap: 4px;
  color: #65458f;
  font-size: 11px;
  font-weight: 750;
}
.epi-transition-order-state > span {
  width: 100%;
  padding: 6px 9px;
  border: 1px solid #dcccf1;
  border-radius: 6px;
  background: #fbf8ff;
}
.epi-transition-preview { margin-top: 10px; padding: 9px 10px; }
.epi-transition-preview .epi-tech-section-title { margin-bottom: 2px; }
.epi-transition-example { justify-items: center; }
.epi-transition-example > strong { color: var(--ps-charcoal); font-size: 11px; }
.epi-transition-example p,
.epi-transition-structure small { margin: 3px 0 0; color: var(--ps-muted); font-size: 10px; line-height: 1.4; }
.epi-transition-flow-summary { display: grid; gap: 2px; color: var(--ps-purple); font-size: 10px; font-weight: 750; }
.epi-transition-flow-summary span { display: inline-flex; align-items: center; gap: 4px; }
.epi-transition-flow-summary small { color: #8061a8; font-size: 9px; }
.epi-cohort-setup > strong { display: block; margin-bottom: 8px; }
.epi-cohort-setup > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.epi-cohort-setup .epi-timing-card { margin-top: 6px; }
.epi-lot-linked .epi-lot-lines .btn,
.epi-lot-linked .epi-lot-lines label,
.epi-lot-linked > .epi-lot-layout > .epi-lot-panel > .btn { display: none; }
.epi-lot-linked .epi-lot-lines input { pointer-events: none; border-color: transparent; background: transparent; padding-left: 0; }
.epi-lot-mode .epi-lot-layout { grid-template-columns: minmax(300px, .9fr) minmax(0, 1.35fr); align-items: start; }
.epi-lot-setup .epi-lot-lines { margin: 8px 0 12px; }
.epi-lot-setup .epi-lot-line { display: flex; align-items: center; gap: 8px; min-height: 30px; }
.epi-lot-setup .epi-lot-line > span { color: var(--ps-charcoal); font-size: 11px; font-weight: 750; }
.epi-lot-rule-card { display: grid; gap: 5px; padding: 9px 0; border-top: 1px solid var(--ps-line); }
.epi-lot-rule-card:first-of-type { border-top: 0; }
.epi-lot-rule-card > small { color: var(--ps-muted); font-size: 10px; }
.epi-lot-rule-card > label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 10px; font-weight: 750; }
.epi-lot-rule-card > label > span { display: inline-grid; grid-template-columns: 62px 12px; gap: 4px; align-items: center; }
.epi-lot-rule-card input { min-width: 0; }
.epi-lot-rule-card b { font-size: 10px; }
.epi-lot-rule-card b.ok { color: var(--ps-green); }
.epi-lot-rule-card b.bad { color: var(--ps-red); }
.epi-lot-rule-card em { color: var(--ps-muted); font-size: 10px; font-style: normal; }
.epi-lot-curves .epi-lot-curve-content { grid-template-columns: minmax(220px, .82fr) minmax(260px, 1fr); gap: 12px; align-items: stretch; }
.epi-lot-curves .epi-stateful-preview { min-width: 0; padding: 10px; }
.epi-lot-curves .epi-stateful-curve-head { gap: 8px; }
.epi-lot-curves .epi-stateful-curve-table th { white-space: nowrap; }
@media (max-width: 900px) {
  .epi-lot-mode .epi-lot-layout,
  .epi-lot-curves .epi-lot-curve-content { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .epi-cohort-setup > div { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .epi-transition-grid { grid-template-columns: 1fr; }
}
.epi-tech-modal .epi-tech-split-editor > .epi-tech-formula-block {
  min-width: 0;
  margin-top: 12px;
}
.epi-tech-modal .epi-tech-split-period {
  display: grid !important;
  grid-template-columns: 30px minmax(145px, 190px) 30px !important;
  justify-content: start;
  align-items: center;
  gap: 6px;
}
.epi-tech-modal .epi-tech-split-inputs > label {
  display: grid !important;
  grid-template-columns: minmax(110px, 130px) minmax(130px, 150px) !important;
  justify-content: start;
  align-items: center;
  gap: 8px;
}
.epi-tech-modal .epi-tech-split-inputs > label {
  min-height: 34px;
  margin: 0;
}
.epi-tech-modal .epi-tech-split-inputs > label > small {
  display: inline-block;
}
.epi-tech-modal .epi-tech-split-values .epi-tech-split-inputs {
  max-width: 310px;
}
.epi-tech-modal .epi-tech-split-values .epi-tech-split-total {
  max-width: 310px;
  margin-top: 6px;
}
.epi-tech-modal .epi-tech-split-values .epi-form-actions {
  display: flex;
  justify-content: flex-end;
  max-width: 310px;
  margin-top: 8px;
}
@media (max-width: 760px) {
  .epi-tech-modal .epi-tech-split-period {
    grid-template-columns: 30px minmax(120px, 1fr) 30px !important;
  }
  .epi-tech-modal .epi-tech-split-values .epi-tech-split-inputs,
  .epi-tech-modal .epi-tech-split-values .epi-form-actions {
    max-width: none;
  }
  .epi-tech-modal .epi-tech-split-inputs > label {
    grid-template-columns: minmax(100px, 1fr) minmax(120px, 145px) !important;
  }
}
.epi-tech-modal .epi-segment-editor {
  display: grid !important;
  grid-template-columns: 16px minmax(0, 1fr) auto auto !important;
  align-items: center;
  min-height: 34px;
  gap: 6px;
}
@media (max-width: 620px) {
  .epi-tech-modal .epi-tech-split-editor {
    grid-template-columns: 1fr !important;
  }
}

/* Shared-card Canvas redesign: Forecast Flow business view + Calculation Engine technical view */
.epi-business-view,
.epi-tech-view {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.epi-tech-view {
  position: relative;
  height: calc(100vh - 126px);
  min-height: 560px;
  overflow: hidden;
}

.epi-business-view {
  height: calc(100vh - 126px);
  min-height: 560px;
  align-content: stretch;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.epi-shared-model-note {
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr) auto 24px;
  align-items: start;
  gap: 9px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(23, 126, 137, 0.25);
  border-radius: 8px;
  color: #11636c;
  background: #edf9fa;
  font-size: 12px;
  line-height: 1.4;
}

.epi-shared-model-note.technical {
  border-color: rgba(217, 101, 50, 0.25);
  color: #9a461f;
  background: #fff6f0;
}

.epi-shared-model-note .btn {
  margin-left: auto;
}

.epi-business-toolbar {
  position: relative;
  padding: 1px 3px 3px;
}

.epi-business-toolbar h3,
.epi-business-toolbar p {
  margin: 0;
}

.epi-business-toolbar h3 {
  color: var(--ps-charcoal);
  font-size: 15px;
}

.epi-business-toolbar p {
  margin-top: 3px;
  color: var(--ps-muted);
  font-size: 11.5px;
}

.epi-business-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 2px 12px;
  align-items: center;
}

.epi-business-intro h3,
.epi-business-intro p {
  grid-column: 1;
}

.epi-business-intro > .epi-tech-minimap {
  grid-column: 2;
  grid-row: 1 / span 2;
  margin-left: 0;
}

.epi-business-actions {
  grid-column: 3;
  grid-row: 1 / span 2;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.epi-business-actions .btn {
  min-height: 30px;
  padding: 6px 9px;
  font-size: 10.5px;
}

.epi-business-actions .btn-icon {
  width: 30px;
  padding: 0;
}

.epi-business-tool-divider {
  width: 1px;
  height: 22px;
  margin: 0 2px;
  background: var(--ps-line);
}

.epi-business-zoom-label {
  min-width: 38px;
  color: var(--ps-muted);
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}

.epi-business-popover {
  position: absolute;
  z-index: 30;
  top: calc(100% + 7px);
  right: 0;
  width: min(360px, 90vw);
  padding: 8px;
  border: 1px solid var(--ps-line);
  border-radius: 9px;
  background: var(--ps-overlay);
  box-shadow: 0 16px 36px rgba(31, 41, 55, 0.18);
}

.epi-business-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--ps-line);
  border-radius: 10px;
  background: var(--ps-panel);
}

.epi-business-workspace.has-inspector {
  grid-template-columns: minmax(0, 1fr) 240px;
}

.epi-business-scroll {
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: auto;
  padding: 2px;
  background-color: var(--ps-canvas);
  background-image: radial-gradient(circle, var(--ps-dot) 1px, transparent 1px);
  background-size: 20px 20px;
}

.epi-business-canvas {
  position: relative;
  min-width: 100%;
  min-height: 100%;
  margin: 0 auto;
  transform-origin: top left;
}

.epi-business-stage {
  position: absolute;
  /* Stage shells must remain in the canvas paint layer: their backgrounds
     sit below the shared SVG, while their positioned cards sit above it. */
  overflow: visible;
  border: 1px solid color-mix(in srgb, var(--stage-color) 58%, #d7dee8);
  border-radius: 7px;
  background: color-mix(in srgb, var(--stage-color) 5%, var(--ps-mix-base));
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.035);
  will-change: left, top;
}

.epi-business-stage,
.epi-tech-flow-stage {
  box-sizing: border-box;
}

/* Stages must not create a stacking context: their surface belongs below the
   shared wire layer, while their headers and cards deliberately sit above it. */

.epi-business-card,
.epi-tech-flow-card {
  box-sizing: border-box;
}
.epi-business-card,
.epi-tech-flow-card {
  contain: layout paint;
}

.epi-business-stage.selected {
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--stage-color) 35%, transparent),
    0 8px 22px rgba(15, 23, 42, 0.08);
}

.epi-business-stage.dragging {
  z-index: 30;
  background: color-mix(in srgb, var(--stage-color) 7%, var(--ps-mix-base));
}

.epi-business-stage.dragging .epi-business-stage-head {
  cursor: grabbing;
}

.epi-business-stage.dragging.drop-invalid {
  background: #fffafa;
}

.epi-business-stage-head {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr) 18px 18px;
  gap: 5px;
  align-items: center;
  min-height: 34px;
  padding: 5px 7px;
  border-bottom: 1px solid color-mix(in srgb, var(--stage-color) 25%, #e2e8f0);
  border-radius: 6px 6px 0 0;
  color: color-mix(in srgb, var(--stage-color) 80%, #1f2937);
  background: color-mix(in srgb, var(--stage-color) 9%, var(--ps-mix-base));
  cursor: move;
  touch-action: none;
}

.epi-business-stage-head > span {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: #fff;
  background: var(--stage-color);
  font-size: 8.5px;
  font-weight: 900;
}

.epi-business-stage-head strong {
  overflow: hidden;
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.epi-business-stage-head button {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  color: var(--ps-muted);
  background: transparent;
  cursor: pointer;
}

.epi-business-stage-head .epi-business-stage-add {
  border: 1px solid color-mix(in srgb, var(--stage-color) 35%, #d7dee8);
  border-radius: 4px;
  color: var(--stage-color);
  background: rgba(255, 255, 255, 0.72);
}

.epi-business-add-card {
  position: absolute;
  z-index: 4;
  top: 39px;
  left: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: calc(100% - 16px);
  min-height: 27px;
  margin: 0;
  border: 1px dashed color-mix(in srgb, var(--stage-color) 35%, #cbd5e1);
  border-radius: 6px;
  color: color-mix(in srgb, var(--stage-color) 70%, #334155);
  background: rgba(255, 255, 255, 0.7);
  font-size: 9.5px;
  font-weight: 800;
}

.epi-business-card-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.epi-business-card {
  position: absolute;
  z-index: 6;
  min-width: 0;
  display: block;
  box-sizing: border-box;
  padding: 7px 8px;
  border: 1px solid var(--ps-line);
  border-radius: 5px;
  background: var(--ps-panel);
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.045);
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
  will-change: transform, width, height;
  transition: box-shadow 0.12s ease, border-color 0.12s ease;
}

.epi-business-card:active {
  cursor: grabbing;
}
.epi-business-card.dragging {
  z-index: 20;
  opacity: 1;
  pointer-events: none;
  border-color: var(--stage-color);
  background: var(--ps-panel);
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--stage-color) 34%, transparent),
    0 18px 38px rgba(15, 23, 42, 0.26);
}
.epi-business-card.drop-target {
  border-color: var(--ps-orange);
  box-shadow: 0 0 0 3px rgba(217, 101, 50, 0.16);
}
.epi-business-card.drop-left::after,
.epi-business-card.drop-right::after,
.epi-business-card.drop-above::after,
.epi-business-card.drop-below::after {
  content: "";
  position: absolute;
  z-index: 25;
  border-radius: 999px;
  background: var(--ps-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
  pointer-events: none;
}
.epi-business-card.drop-left::after {
  left: -5px;
  top: 6px;
  bottom: 6px;
  width: 3px;
}
.epi-business-card.drop-right::after {
  right: -5px;
  top: 6px;
  bottom: 6px;
  width: 3px;
}
.epi-business-card.drop-above::after {
  left: 6px;
  right: 6px;
  top: -5px;
  height: 3px;
}
.epi-business-card.drop-below::after {
  left: 6px;
  right: 6px;
  bottom: -5px;
  height: 3px;
}
.epi-business-card.drop-target {
  z-index: 18;
  border-color: var(--ps-blue);
  background: var(--ps-panel);
  box-shadow:
    0 0 0 3px rgba(37, 99, 235, 0.18),
    0 12px 26px rgba(37, 99, 235, 0.12);
}
.epi-business-drop-choice {
  position: absolute;
  z-index: 28;
  display: none;
  padding: 3px 6px;
  border: 1px solid var(--ps-blue);
  border-radius: 4px;
  color: var(--ps-blue);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
  font-size: 8.5px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
}
.epi-business-card.drop-target .epi-business-drop-choice {
  display: block;
}
.epi-business-drop-choice.above {
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
}
.epi-business-drop-choice.below {
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
}
.epi-business-drop-choice.left {
  top: 50%;
  left: -9px;
  transform: translate(-100%, -50%);
}
.epi-business-drop-choice.right {
  top: 50%;
  right: -9px;
  transform: translate(100%, -50%);
}
.epi-business-card.drop-above .epi-business-drop-choice.above,
.epi-business-card.drop-below .epi-business-drop-choice.below,
.epi-business-card.drop-left .epi-business-drop-choice.left,
.epi-business-card.drop-right .epi-business-drop-choice.right {
  color: #fff;
  background: var(--ps-blue);
  box-shadow: 0 5px 14px rgba(37, 99, 235, 0.28);
}
.epi-business-stage.drop-target {
  box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--stage-color) 30%, transparent);
}
.epi-business-card-moving {
  cursor: grabbing;
  user-select: none;
}
.epi-card-move-instruction {
  position: fixed;
  z-index: 80;
  top: 74px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 11px;
  border: 1px solid #bfdbfe;
  border-radius: 7px;
  color: #1e3a8a;
  background: #eff6ff;
  box-shadow: 0 8px 22px rgba(30, 58, 138, 0.14);
  font-size: 11px;
  font-weight: 700;
}
.epi-card-move-instruction button {
  border: 0;
  color: var(--ps-blue);
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.epi-business-card:hover,
.epi-business-card.selected {
  border-color: var(--stage-color);
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--stage-color) 18%, transparent),
    0 6px 14px rgba(15, 23, 42, 0.08);
}

.epi-business-card-title {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  width: 100%;
}

.epi-business-card-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: color-mix(in srgb, var(--stage-color) 78%, #334155);
}

.epi-business-card-title strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ps-charcoal);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.epi-business-card-menu {
  margin-left: auto;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  color: #6b7b8e;
  background: transparent;
}

.epi-business-card p {
  display: -webkit-box;
  overflow: hidden;
  min-height: 26px;
  margin: 6px 0 0;
  color: var(--ps-muted);
  font-size: 10.5px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  -webkit-line-clamp: 2;
}

.epi-business-card p.empty {
  color: transparent;
}

.epi-business-card-unit {
  display: block;
  min-height: 12px;
  margin-top: 5px;
  overflow: hidden;
  color: #8491a2;
  font-size: 8.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.epi-business-persistence-summary {
  display: grid;
  gap: 2px;
  min-height: 21px;
  margin-top: auto;
  overflow: hidden;
  color: var(--ps-muted);
  font-size: 8px;
  line-height: 1.25;
}

.epi-business-persistence-summary b {
  color: color-mix(in srgb, var(--stage-color) 82%, #334155);
  font-size: 8.5px;
}

.epi-business-persistence-summary span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.epi-business-persistence-journey b {
  color: var(--ps-muted);
}

.epi-card-split-summary {
  display: none;
  gap: 4px;
  align-items: center;
  min-height: 18px;
  margin-top: auto;
  padding-top: 5px;
  overflow: hidden;
}

.epi-card-split-summary button {
  display: inline-flex;
  gap: 2px;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  padding: 2px 5px;
  border: 1px solid color-mix(in srgb, var(--stage-color) 22%, #dbe3ec);
  border-radius: 999px;
  color: color-mix(in srgb, var(--stage-color) 78%, #475569);
  background: color-mix(in srgb, var(--stage-color) 7%, var(--ps-mix-base));
  font-size: 7.5px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.epi-card-split-summary button:hover,
.epi-card-split-summary button:focus-visible {
  border-color: var(--stage-color);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--stage-color) 14%, transparent);
  outline: none;
  transform: translateY(-1px);
}

.epi-card-split-summary.empty {
  color: #94a3b8;
  font-size: 8px;
}

.epi-business-type {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 4px;
  border-radius: 3px;
  color: #0d6971;
  background: #e7f7f8;
  font-size: 7px;
  font-weight: 900;
  text-transform: uppercase;
}

.epi-business-type.calculated,
.epi-business-type.output {
  color: #aa461d;
  background: #fff0e8;
}
.epi-business-type.split {
  color: #6d28d9;
  background: #f2eaff;
}
.epi-business-type.stateful { color:var(--ps-teal-text); background:#e6fffb; }
.epi-business-transition-summary { display:block; min-height:12px; margin-top:5px; overflow:hidden; color:var(--ps-purple); font-size:9px; font-weight:800; line-height:1.35; text-overflow:ellipsis; white-space:nowrap; }
.epi-business-transition-summary b { padding:0 2px; color:#8966b7; }
.epi-stateful-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:12px; }
.epi-stateful-grid label, .epi-stateful-output-options label { display:grid; gap:4px; font-size:12px; color:var(--ps-muted); }
.epi-stateful-curve-layout { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(180px,.8fr); gap:14px; margin-top:14px; }
.epi-stateful-curve-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:6px; }
.epi-stateful-curve-table { width:100%; border-collapse:collapse; font-size:12px; }
.epi-stateful-curve-table th, .epi-stateful-curve-table td { padding:4px; border-bottom:1px solid var(--ps-line); text-align:left; }
.epi-stateful-curve-table input { width:100%; min-width:0; }
.epi-stateful-preview { box-sizing:border-box; align-self:start; width:min(100%, 340px); min-height:178px; max-height:218px; overflow:hidden; border:1px solid #d7e7e5; border-radius:8px; padding:8px; color:var(--ps-teal-text); font-size:12px; }
.epi-stateful-preview svg { width:100%; height:150px; display:block; margin-top:5px; }
.epi-stateful-editor > .epi-stateful-preview { margin-top:14px; }
.epi-stateful-curve-layout .epi-stateful-preview { width:100%; }
.epi-stateful-method-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(250px,340px); gap:14px; min-height:218px; margin-top:14px; }
.epi-stateful-method-editor { min-height:178px; padding:10px; border:1px solid var(--ps-line); border-radius:8px; background:var(--ps-panel); }
.epi-stateful-method-editor::before { content:"METHOD CONFIGURATION"; display:block; margin-bottom:9px; color:var(--ps-teal-text); font-size:10px; font-weight:800; letter-spacing:.035em; }
.epi-stateful-method-layout .epi-stateful-preview { width:100%; }
.epi-stateful-method-layout .epi-stateful-preview > strong { display:none; }
.epi-stateful-method-layout .epi-stateful-preview::before { content:"PERSISTENCE CURVE PREVIEW"; display:block; color:var(--ps-teal-text); font-size:10px; font-weight:800; letter-spacing:.035em; }
.epi-stateful-parameter, .epi-stateful-parameter-grid { display:grid; gap:7px; max-width:300px; }
.epi-stateful-parameter span, .epi-stateful-parameter-grid label span { color:var(--ps-muted); font-size:12px; }
.epi-stateful-parameter small, .epi-stateful-parameter-grid small { color:var(--ps-muted); line-height:1.35; }
.epi-stateful-warning { margin-top:8px; padding:7px 8px; border-radius:6px; background:#fff7df; color:#9a6700; font-size:11px; line-height:1.35; }
.epi-stateful-advanced { margin-top:14px; overflow:hidden; border:1px solid var(--ps-line); border-radius:8px; background:#fbfefd; }
.epi-stateful-advanced summary { display:grid; grid-template-columns:16px minmax(0,1fr); gap:2px 7px; align-items:center; min-height:50px; padding:9px 11px; list-style:none; cursor:pointer; color:var(--ps-teal-text); }
.epi-stateful-advanced summary::-webkit-details-marker { display:none; }
.epi-stateful-advanced summary::before { content:"▸"; grid-row:1 / span 2; color:var(--ps-teal-text); font-size:15px; transition:transform .14s ease; }
.epi-stateful-advanced[open] summary::before { transform:rotate(90deg); }
.epi-stateful-advanced summary strong { font-size:11px; letter-spacing:.02em; text-transform:uppercase; }
.epi-stateful-advanced summary small { color:var(--ps-muted); font-weight:400; font-size:10.5px; line-height:1.3; }
.epi-stateful-rules-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; margin-top:12px; }
.epi-stateful-rules-grid label { display:grid; gap:5px; min-width:0; color:var(--ps-charcoal); font-size:12px; }
.epi-stateful-rules-grid label > span em { color:var(--ps-muted); font-style:normal; font-weight:400; }
.epi-stateful-rules-grid label small { color:var(--ps-muted); font-size:10px; line-height:1.3; }
.epi-stateful-rules-grid label.is-inactive { opacity:.68; }
.epi-stateful-advanced .epi-stateful-rules-grid { padding:0 11px 12px; margin-top:0; }
.epi-stateful-suffix { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:stretch; }
.epi-stateful-suffix input { min-width:0; border-radius:6px 0 0 6px; }
.epi-stateful-suffix b { display:flex; align-items:center; padding:0 8px; border:1px solid var(--ps-line-strong); border-left:0; border-radius:0 6px 6px 0; color:var(--ps-muted); background:var(--ps-raised); font-size:11px; }
.epi-generated-metrics > small { display:block; margin:3px 0 8px; color:var(--ps-muted); }
.epi-generated-metrics > div { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:9px; }
.epi-generated-metric { position:relative; display:grid; grid-template-columns:30px minmax(0,1fr); gap:8px; min-height:76px; padding:10px 9px 9px; border:1px solid var(--ps-line); border-radius:8px; background:var(--ps-panel); color:var(--ps-charcoal); text-align:left; cursor:pointer; }
.epi-generated-metric:hover { border-color:#91c9c3; background:#f8fffe; }
.epi-generated-metric.selected { border-color:#168f86; background:#eaf9f7; box-shadow:0 0 0 1px #168f86,0 2px 8px rgba(15,143,134,.12); }
.epi-generated-metric > i { display:grid; grid-column:1; place-items:center; width:28px; height:28px; border-radius:7px; color:var(--ps-teal-text); background:#dff5f2; font-style:normal; }
.epi-generated-metric > span:last-child { display:grid; gap:3px; min-width:0; }
.epi-generated-metric b { color:#164e63; font-size:11px; font-weight:800; }
.epi-generated-metric small { color:var(--ps-muted); font-size:10px; line-height:1.3; }
.epi-generated-check { position:absolute; top:7px; left:7px; z-index:2; display:grid; place-items:center; width:19px; height:19px; border:1px solid #8fa3b1; border-radius:4px; background:var(--ps-panel); color:transparent; }
.epi-generated-metric.selected .epi-generated-check { border-color:#087f75; background:#087f75; box-shadow:0 1px 3px rgba(8,127,117,.34); }
.epi-generated-metric.selected .epi-generated-check::after { content:"✓"; display:block; color:#fff; font:900 15px/19px Arial,sans-serif; }
.epi-generated-metric:focus-visible { outline:3px solid rgba(15,143,134,.25); outline-offset:2px; }
.epi-stateful-source-validation { display:block; min-height:14px; margin-top:3px; color:var(--ps-red); font-size:10.5px; font-weight:600; line-height:1.25; }
.epi-generated-metric:nth-child(2) > i { color:#ba4f2d; background:#ffebe3; }
.epi-generated-metric:nth-child(2).selected { border-color:#f3c5b2; background:#fff8f4; }
.epi-generated-metric:nth-child(3) > i { color:#8757b5; background:#f1e7fa; }
.epi-generated-metric:nth-child(3).selected { border-color:#d8c3ed; background:#fbf8ff; }
.epi-stateful-preview-empty, .epi-stateful-method-shell { color:var(--ps-muted); font-size:12px; padding:12px 0; }
.epi-stateful-method-shell { display:grid; gap:4px; }
.epi-stateful-advanced { color:var(--ps-charcoal); }
.epi-stateful-output-options { display:grid; gap:7px; margin-top:14px; }
.epi-stateful-output-options label { display:flex; align-items:center; gap:7px; color:var(--ps-charcoal); }
.epi-stateful-piecewise { grid-column:1 / -1; display:grid; gap:6px; }
.epi-stateful-piecewise > div { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)) 28px; gap:6px; align-items:center; }
.epi-stateful-piecewise-head { color:var(--ps-muted); font-size:11px; padding-right:34px; }
.epi-lot-mode { display:grid; gap:12px; margin-top:14px; }
.epi-lot-layout { display:grid; grid-template-columns:minmax(0,1.1fr) minmax(0,1fr); gap:14px; }
.epi-lot-panel { display:grid; gap:8px; align-content:start; min-width:0; padding:10px; border:1px solid var(--ps-line); border-radius:8px; background:#fbfefd; }
.epi-lot-panel > strong { color:var(--ps-teal-text); text-transform:uppercase; letter-spacing:.035em; font-size:10px; }
.epi-lot-panel > small, .epi-lot-progressions > small { color:var(--ps-muted); font-size:11px; }
.epi-lot-lines { display:grid; gap:5px; }
.epi-lot-line { display:grid; grid-template-columns:28px 9px minmax(0,1fr) auto; gap:6px; align-items:center; min-height:32px; }
.epi-lot-line i { width:8px; height:8px; border-radius:50%; background:var(--lot-color); }
.epi-lot-line input[type="text"], .epi-lot-line input:not([type]) { min-width:0; }
.epi-lot-line label { display:flex; align-items:center; gap:4px; font-size:10px; color:var(--ps-muted); white-space:nowrap; }
.epi-lot-progressions { display:grid; gap:6px; margin-top:7px; }
.epi-lot-rule-head, .epi-lot-rule { display:grid; grid-template-columns:1fr 1fr .72fr .9fr; gap:5px; align-items:center; }
.epi-lot-rule-head { color:var(--ps-muted); font-size:10px; }
.epi-lot-rule select, .epi-lot-rule input { min-width:0; font-size:11px; }
.epi-lot-tabs { display:flex; flex-wrap:wrap; gap:5px; }
.epi-lot-tabs button { max-width:100%; border:1px solid var(--ps-line-strong); border-radius:6px; padding:5px 7px; background:var(--ps-panel); color:var(--ps-charcoal); font-size:10px; cursor:pointer; }
.epi-lot-tabs button.selected { border-color:var(--ps-teal-text); background:#e9f7f5; color:var(--ps-teal-text); font-weight:700; }
.epi-lot-curve-content { display:grid; grid-template-columns:minmax(0,1fr) minmax(190px,.8fr); gap:10px; align-items:start; }
.epi-lot-curve-content .epi-stateful-preview { width:100%; min-height:178px; }
.epi-lot-footer { padding:8px 10px; border:1px solid #cce8e4; border-radius:7px; background:#effaf8; color:#18665f; font-size:11px; line-height:1.35; }
.epi-lot-summary { display:grid; gap:7px; margin:12px; padding:10px; border:1px solid var(--ps-line); border-radius:8px; background:#fbfefd; }
.epi-lot-summary > strong { color:var(--ps-teal-text); text-transform:uppercase; font-size:10px; letter-spacing:.04em; }
.epi-lot-summary dl { display:grid; grid-template-columns:1fr; gap:2px; margin:0; }
.epi-lot-summary dt { color:var(--ps-muted); font-size:10px; }
.epi-lot-summary dd { margin:0 0 5px; color:var(--ps-charcoal); font-size:11px; font-weight:600; }
.epi-stateful-modern { display:grid; gap:13px; }
.epi-stateful-modern .epi-stateful-top-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.epi-stateful-modern .epi-stateful-top-grid label { display:grid; gap:5px; min-width:0; color:var(--ps-charcoal); font-size:10px; font-weight:800; letter-spacing:.04em; text-transform:uppercase; }
.epi-cohort-foundation { display:grid; grid-template-columns:minmax(190px,.75fr) minmax(0,1.25fr); gap:12px; padding:11px; border:1px solid #dcebe9; border-radius:9px; background:#fcfefe; }
.epi-cohort-timing, .epi-cohort-dimensions { display:grid; gap:7px; min-width:0; }
.epi-cohort-timing > strong, .epi-cohort-dimensions > strong { color:var(--ps-teal-text); font-size:10px; font-weight:800; letter-spacing:.04em; text-transform:uppercase; }
.epi-timing-card { display:flex; align-items:center; gap:8px; padding:8px; border:1px solid #bce8e0; border-radius:7px; background:#effbf8; color:var(--ps-teal-text); }
.epi-timing-card > span { display:grid; gap:2px; min-width:0; }.epi-timing-card b { font-size:12px; }.epi-timing-card small, .epi-cohort-dimensions > small { color:var(--ps-muted); font-size:10px; line-height:1.3; }.epi-timing-card em { margin-left:auto; padding:2px 5px; border-radius:4px; background:#d3f4ed; color:#087f75; font-size:8px; font-style:normal; font-weight:800; text-transform:uppercase; }
.epi-timing-override { justify-self:start; border:0; padding:2px 0; background:transparent; color:var(--ps-teal-text); font-size:10px; cursor:pointer; }.epi-timing-options { display:flex; flex-wrap:wrap; gap:6px; }.epi-timing-options label { font-size:10px; color:#475569; }
.epi-dimension-select { display:grid; grid-template-columns:minmax(0,1fr) 138px; min-height:36px; border:1px solid var(--ps-line-strong); border-radius:7px; background:var(--ps-input); overflow:hidden; }.epi-dimension-select > div { display:flex; flex-wrap:wrap; align-content:center; gap:4px; padding:4px 6px; }.epi-dimension-select button { border:0; border-radius:5px; padding:4px 6px; background:#e5f6f3; color:var(--ps-teal-text); font-size:10px; cursor:pointer; }.epi-dimension-select select { min-width:0; border:0; border-left:1px solid var(--ps-line); border-radius:0; background:var(--ps-input); font-size:10px; }.epi-dimension-select small { align-self:center; color:#94a3b8; font-size:10px; }.epi-dimension-empty { color:#9a6700; font-size:10px; }
.epi-stateful-modern .epi-stateful-method-layout { margin-top:0; }.epi-stateful-modern .epi-stateful-method-editor::before { content:"CUSTOM RETENTION CURVE"; }.epi-stateful-modern .epi-stateful-preview::before { content:"RETENTION CURVE PREVIEW"; }
.epi-stateful-modern .epi-generated-metrics > div { grid-template-columns:repeat(3,minmax(0,1fr)); }.epi-stateful-modern .epi-generated-metric { min-height:82px; padding:12px 10px 10px 37px; }.epi-stateful-modern .epi-generated-check { width:21px; height:21px; top:9px; left:9px; }.epi-stateful-modern .epi-generated-metric:nth-child(4) > i { color:#2563a7; background:#e2efff; }.epi-stateful-modern .epi-generated-metric:nth-child(4).selected { border-color:#bcd4f1; background:#f5f9ff; }
.epi-stateful-modern .epi-lot-panel { border-color:#d7e8e7; background:linear-gradient(180deg,#fcffff,#f8fcfc); }.epi-stateful-modern .epi-lot-line { padding:4px 5px; border:1px solid #e4ecef; border-radius:6px; background:var(--ps-panel); }.epi-stateful-modern .epi-lot-tabs button.selected { box-shadow:0 0 0 1px rgba(15,118,110,.12); }.epi-stateful-modern .epi-lot-footer { margin-top:0; }
.epi-tech-save { background:#0f8b83 !important; border-color:#0f8b83 !important; color:#fff !important; }.epi-tech-save:hover:not(:disabled) { background:#08766f !important; border-color:#08766f !important; }
.epi-stateful-modern .epi-lot-layout { grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr); gap:16px; align-items:stretch; }
.epi-stateful-modern .epi-lot-panel { gap:9px; padding:12px; overflow:hidden; }
.epi-stateful-modern .epi-lot-line { grid-template-columns:22px 9px minmax(0,1fr) auto; min-height:28px; gap:5px; padding:3px 5px; }
.epi-stateful-modern .epi-lot-line .btn { width:22px; height:22px; padding:0; }
.epi-stateful-modern .epi-lot-lines + .btn { width:100%; justify-content:center; margin-top:1px; }
.epi-stateful-modern .epi-lot-progressions { min-width:0; gap:5px; }
.epi-stateful-modern .epi-lot-rule-head, .epi-stateful-modern .epi-lot-rule { grid-template-columns:minmax(65px,1fr) minmax(65px,1fr) minmax(51px,.56fr) minmax(66px,.7fr); gap:4px; min-width:0; }
.epi-stateful-modern .epi-lot-rule-head { font-size:9px; line-height:1.15; }
.epi-stateful-modern .epi-lot-rule select, .epi-stateful-modern .epi-lot-rule input { width:100%; min-width:0; height:29px; padding:3px 4px; font-size:10px; }
.epi-stateful-modern .epi-lot-rule-head span:nth-child(3), .epi-stateful-modern .epi-lot-rule-head span:nth-child(4) { text-align:center; }
.epi-stateful-modern .epi-lot-rule.is-terminal input:disabled { color:var(--ps-muted); background:#f1f5f9; cursor:not-allowed; }
.epi-stateful-modern .epi-lot-tabs { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px; }
.epi-stateful-modern .epi-lot-tabs button { min-width:0; height:29px; padding:4px 6px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-align:left; }
.epi-stateful-modern .epi-lot-curve-content { grid-template-columns:minmax(180px,.9fr) minmax(265px,1.1fr); gap:12px; }
.epi-stateful-modern .epi-lot-curve-content .epi-stateful-curve-head { min-height:29px; margin-bottom:8px; }
.epi-stateful-modern .epi-lot-curve-content .epi-stateful-curve-head strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; }
.epi-stateful-modern .epi-lot-curve-content .epi-stateful-preview { min-width:0; min-height:202px; max-height:none; padding:10px; }
.epi-stateful-modern .epi-lot-curve-content .epi-stateful-preview svg { height:166px; }
.epi-stateful-modern .epi-lot-preview-name { display:block; margin:3px 0 5px; overflow:hidden; color:var(--ps-charcoal); font-size:12px; font-weight:750; line-height:1.25; text-overflow:ellipsis; white-space:nowrap; }
.epi-stateful-modern .epi-lot-curve-content .epi-stateful-preview > strong { display:none; }
.epi-stateful-modern .epi-lot-curve-content .epi-stateful-curve-table { width:100%; table-layout:fixed; }
.epi-stateful-modern .epi-lot-curve-content .epi-stateful-curve-table th:first-child, .epi-stateful-modern .epi-lot-curve-content .epi-stateful-curve-table td:first-child { width:38%; }
.epi-stateful-modern .epi-lot-curve-content .epi-stateful-curve-table th:nth-child(2), .epi-stateful-modern .epi-lot-curve-content .epi-stateful-curve-table td:nth-child(2) { width:42%; }
.epi-stateful-modern .epi-lot-curve-content .epi-stateful-curve-table th:last-child, .epi-stateful-modern .epi-lot-curve-content .epi-stateful-curve-table td:last-child { width:34px; padding-right:0; }
.epi-stateful-modern .epi-lot-curve-content .epi-stateful-curve-table input { width:100%; min-width:0; padding-left:7px; padding-right:7px; }
.epi-stateful-modern .epi-lot-curve-content .epi-stateful-curve-table .btn { width:28px; height:28px; padding:0; }
.epi-stateful-modern .epi-lot-footer { padding:8px 11px; min-height:0; }
.epi-stateful-modern .epi-generated-metrics-lot > div { grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; }
.epi-stateful-modern .epi-generated-metrics-lot .epi-generated-metric { min-width:0; min-height:88px; padding:12px 8px 9px 35px; }
.epi-stateful-modern .epi-generated-metrics-lot .epi-generated-metric b { font-size:10px; }.epi-stateful-modern .epi-generated-metrics-lot .epi-generated-metric small { font-size:9.5px; }

/* Approved LOT persistence layout: one selected treatment line at a time. */
.epi-stateful-modern .epi-lot-approved { gap:10px; margin-top:0; }
.epi-stateful-modal-subtitle { display:block; margin-top:2px; color:var(--ps-muted); font-size:10px; font-weight:400; }
.epi-lot-summary-strip { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:0; overflow:hidden; border:1px solid #d8e8e7; border-radius:9px; background:var(--ps-panel); }
.epi-lot-summary-strip > :not(.epi-lot-summary-info) { display:grid; gap:3px; min-height:55px; padding:10px 13px; border-right:1px solid #e6eeee; }
.epi-lot-summary-strip > :not(.epi-lot-summary-info) > span, .epi-lot-journey > strong, .epi-lot-configure > strong { color:var(--ps-teal-text); font-size:10px; font-weight:800; letter-spacing:.04em; text-transform:uppercase; }
.epi-lot-summary-strip > label select { width:100%; min-width:0; height:29px; padding:3px 24px 3px 7px; border:1px solid var(--ps-line-strong); border-radius:6px; background:var(--ps-input); color:var(--ps-charcoal); font-size:11px; font-weight:650; }
.epi-lot-summary-info { grid-column:1 / -1; display:flex; align-items:center; gap:7px; min-width:0; padding:8px 12px; border-top:1px solid #e6eeee; color:var(--ps-muted); font-size:10.5px; }
.epi-lot-summary-info > span { min-width:0; }
.epi-lot-summary-info label { display:flex; align-items:center; gap:6px; margin-left:auto; white-space:nowrap; color:var(--ps-muted); font-size:10px; font-weight:700; }
.epi-lot-track-chips { display:flex; gap:4px; }.epi-lot-track-chips button { border:0; border-radius:5px; padding:4px 6px; background:#e5f6f3; color:var(--ps-teal-text); font-size:10px; cursor:pointer; }
.epi-lot-summary-info select { width:62px; height:27px; padding:2px 5px; font-size:10px; }
.epi-lot-journey, .epi-lot-configure { display:grid; gap:8px; padding:10px; border:1px solid #dcebe9; border-radius:9px; background:#fcfefe; }
.epi-lot-journey > div { display:flex; align-items:center; justify-content:center; gap:9px; min-width:0; }
.epi-lot-journey > div:not(.epi-lot-journey-heading):not(.epi-embedded-journey-editor) { justify-content:flex-start; overflow-x:auto; overflow-y:hidden; padding:1px 2px 5px; scrollbar-gutter:stable; }
.epi-lot-journey > div:not(.epi-lot-journey-heading):not(.epi-embedded-journey-editor) > span { flex:0 0 minmax(150px,1fr); min-width:150px; padding:10px 11px; border:1px solid color-mix(in srgb, var(--lot-color) 30%, white); border-radius:999px; background:color-mix(in srgb, var(--lot-color) 8%, white); color:var(--ps-charcoal); font-size:11px; font-weight:750; text-align:center; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.epi-lot-journey > div:not(.epi-lot-journey-heading):not(.epi-embedded-journey-editor) > b { flex:0 0 auto; color:#94a3b8; font-size:20px; line-height:1; }.epi-lot-journey small { color:var(--ps-muted); font-size:10px; }
.epi-lot-journey-heading { display:grid !important; grid-template-columns:minmax(180px,.8fr) minmax(0,1.2fr); align-items:start !important; justify-content:stretch !important; gap:12px !important; }
.epi-lot-journey-heading label, .epi-lot-track-by { display:grid; gap:5px; min-width:0; }
.epi-lot-journey-heading label > strong, .epi-lot-track-by > strong { color:var(--ps-teal-text); font-size:10px; font-weight:800; letter-spacing:.04em; text-transform:uppercase; }
.epi-lot-track-by em { color:#94a3b8; font-size:9px; font-style:normal; }
.epi-lot-journey-heading select, .epi-lot-track-by select { min-height:31px; min-width:0; border:1px solid var(--ps-line-strong); border-radius:6px; background:var(--ps-input); color:var(--ps-charcoal); font-size:11px; }
.epi-lot-track-by > div { display:flex; align-items:center; gap:6px; min-width:0; }
.epi-lot-track-by .epi-lot-track-chips { min-width:0; flex:1; align-items:center; }
.epi-lot-track-by .epi-lot-track-chips small { color:var(--ps-muted); white-space:nowrap; }
.epi-lot-track-by select, .epi-lot-track-by .btn { width:auto; flex:0 1 150px; min-height:31px; padding:4px 7px; }
.epi-lot-add-line { justify-self:start; min-height:30px; padding:5px 9px; font-size:11px; }
.epi-embedded-journey-editor { display:grid; gap:5px; max-width:100%; overflow-x:auto; overflow-y:hidden; padding:1px 2px 5px; scrollbar-gutter:stable; }
.epi-embedded-journey-row { display:grid; grid-template-columns:auto minmax(180px,1fr) auto auto; min-width:390px; align-items:center; gap:6px; padding:5px; border:1px solid #e1e8ee; border-radius:7px; background:var(--ps-panel); }
.epi-journey-order { display:flex; gap:2px; }.epi-journey-order .btn { display:inline-flex; align-items:center; justify-content:center; width:25px; min-height:27px; padding:0; opacity:1; visibility:visible; }.epi-journey-order .btn svg, .epi-journey-delete svg { display:block; width:13px; height:13px; stroke:currentColor; }
.epi-embedded-journey-row input { min-width:0; min-height:29px; padding:5px 7px; border:1px solid var(--ps-line-strong); border-radius:5px; color:var(--ps-charcoal); font-size:11px; }
.epi-embedded-journey-row em { padding:3px 5px; border-radius:4px; background:#f0eaff; color:#6f51c5; font-size:8px; font-style:normal; font-weight:800; letter-spacing:.04em; }
.epi-journey-delete { display:inline-flex; align-items:center; justify-content:center; width:29px; min-height:29px; padding:0; color:var(--ps-muted); opacity:1; visibility:visible; }
.epi-generic-journey .epi-lot-journey > div > span { --lot-color:#7c5ce0; }
.epi-generic-journey-note { display:grid; gap:5px; padding:11px; border:1px dashed #d8d0f2; border-radius:7px; background:#fbfaff; color:var(--ps-muted); font-size:11px; }
.epi-generic-journey-note strong { color:#5b3fb1; font-size:12px; }
.epi-lot-approved .epi-lot-tabs { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px; }
.epi-lot-approved .epi-lot-tabs button { height:35px; min-width:0; padding:5px 8px; overflow:hidden; border-color:var(--ps-line-strong); text-align:center; text-overflow:ellipsis; white-space:nowrap; }
.epi-lot-approved .epi-lot-tabs button.selected { border-color:#0f8b83; box-shadow:0 0 0 1px rgba(15,139,131,.15); background:#eaf8f6; }
.epi-lot-selected-grid { display:grid; grid-template-columns:minmax(180px,.9fr) minmax(230px,1.2fr) minmax(180px,.9fr); gap:10px; align-items:stretch; }
.epi-lot-selected-card { display:grid; align-content:start; gap:8px; min-width:0; padding:10px; border:1px solid #d9e7e7; border-radius:8px; background:var(--ps-panel); }
.epi-lot-selected-card > strong { color:var(--ps-charcoal); font-size:11px; line-height:1.35; }.epi-lot-selected-card > small { color:var(--ps-muted); font-size:10px; }
.epi-lot-points { grid-template-rows:auto minmax(0,1fr) auto; min-height:0; max-height:292px; }
.epi-lot-points .epi-retention-point-delete svg { display:block; width:13px; height:13px; stroke:currentColor; }
.epi-lot-points .epi-stateful-curve-table td:first-child { width:43%; }.epi-lot-points .epi-stateful-curve-table td:nth-child(2) { width:43%; }.epi-lot-points .epi-stateful-curve-table td:last-child { width:30px; }
.epi-lot-points .epi-stateful-curve-table { width:100%; table-layout:fixed; align-self:start; }.epi-lot-points .epi-stateful-curve-table thead, .epi-lot-points .epi-stateful-curve-table tbody tr { display:table; width:100%; table-layout:fixed; }.epi-lot-points .epi-stateful-curve-table tbody { display:block; max-height:174px; overflow-y:auto; overflow-x:hidden; padding-right:9px; box-sizing:border-box; scrollbar-gutter:stable; }.epi-lot-points .epi-stateful-curve-table th { white-space:nowrap; font-size:10px; }.epi-lot-points .epi-stateful-curve-table th:first-child { width:43%; }.epi-lot-points .epi-stateful-curve-table th:nth-child(2) { width:43%; }.epi-lot-points .epi-stateful-curve-table th:last-child { width:30px; }.epi-lot-points .epi-stateful-curve-table input { width:100%; min-width:0; }.epi-lot-points .epi-stateful-curve-table .btn { width:27px; height:27px; padding:0; }.epi-lot-points .epi-retention-point-delete { display:inline-flex; align-items:center; justify-content:center; color:var(--ps-muted); opacity:1; visibility:visible; }.epi-lot-points .epi-retention-point-delete:disabled { color:#94a3b8; opacity:.55; cursor:not-allowed; }.epi-lot-points > .btn { width:100%; justify-content:center; }
.epi-lot-chart .epi-stateful-preview { min-height:216px; padding:4px 0 0; border:0; background:transparent; }.epi-lot-chart .epi-stateful-preview svg { width:100%; height:184px; }.epi-lot-chart .epi-stateful-preview > strong { display:none; }
.epi-lot-exit label { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:8px; padding:9px; border:1px solid #e6eeee; border-radius:7px; background:#fbfefd; color:#475569; font-size:11px; }.epi-lot-exit label b { display:flex; align-items:center; gap:4px; }.epi-lot-exit input { width:62px; min-width:0; }.epi-lot-exit em { padding:10px; border-radius:7px; background:var(--ps-raised); color:var(--ps-muted); font-size:11px; font-style:normal; font-weight:750; }.epi-lot-exit em small { color:#94a3b8; font-weight:400; }.epi-lot-exit-total { display:flex; justify-content:space-between; padding-top:7px; border-top:1px solid var(--ps-line); color:var(--ps-charcoal); font-size:11px; }.epi-lot-exit-total.ok b { color:#0f8b83; }.epi-lot-exit-total.bad b { color:var(--ps-orange-text); }
.epi-stateful-modern .epi-stateful-advanced { margin-top:0; }.epi-stateful-modern .epi-stateful-rules-grid { grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); }.epi-stateful-modern .epi-generated-metrics { margin-top:0; overflow:hidden; border:1px solid var(--ps-line); border-radius:8px; background:#fbfefd; }.epi-stateful-modern .epi-generated-metrics summary { display:grid; grid-template-columns:16px minmax(0,1fr); gap:2px 7px; align-items:center; min-height:50px; padding:9px 11px; list-style:none; cursor:pointer; }.epi-stateful-modern .epi-generated-metrics summary::-webkit-details-marker { display:none; }.epi-stateful-modern .epi-generated-metrics summary::before { content:"▸"; grid-row:1 / span 2; color:var(--ps-teal-text); font-size:15px; }.epi-stateful-modern .epi-generated-metrics[open] summary::before { transform:rotate(90deg); }.epi-stateful-modern .epi-generated-metrics summary strong { color:var(--ps-teal-text); font-size:11px; letter-spacing:.02em; text-transform:uppercase; }.epi-stateful-modern .epi-generated-metrics summary small { color:var(--ps-muted); font-size:10px; }.epi-stateful-modern .epi-generated-metrics-controls { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:9px; padding:0 10px 10px; }.epi-stateful-modern .epi-generated-metrics-lot .epi-generated-metrics-controls { grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; }.epi-generated-metric .epi-generated-check { line-height:0; }.epi-generated-metric .epi-generated-check svg { display:block; width:13px; height:13px; stroke:currentColor; }
.epi-stateful-modern .epi-generated-output-list { display:grid; grid-template-columns:1fr; gap:7px; padding:0 10px 9px; }.epi-generated-lot-group { border:1px solid #dce8eb; border-radius:7px; background:var(--ps-panel); overflow:hidden; }.epi-generated-lot-group summary { display:flex !important; grid-template-columns:none !important; justify-content:space-between; min-height:34px !important; padding:7px 10px !important; color:#164e63; }.epi-generated-lot-group summary::before { display:none; }.epi-generated-lot-group summary strong { color:#164e63 !important; font-size:11px !important; text-transform:none !important; }.epi-generated-lot-group summary small { color:var(--ps-muted); }.epi-stateful-modern .epi-generated-lot-group > div { display:grid !important; grid-template-columns:1fr !important; gap:5px; padding:0 7px 7px; }.epi-generated-output-row { display:grid; grid-template-columns:22px minmax(0,1fr) 14px; align-items:center; gap:7px; min-height:36px; padding:6px 7px; border:1px solid #e3ebee; border-radius:6px; background:var(--ps-panel); color:var(--ps-charcoal); text-align:left; cursor:pointer; }.epi-generated-output-row:hover,.epi-generated-output-row.selected { border-color:#73bdb6; background:#f0fbfa; }.epi-generated-output-row i { display:grid; place-items:center; color:var(--ps-teal-text); font-style:normal; }.epi-generated-output-row span { display:grid; gap:1px; min-width:0; }.epi-generated-output-row b { overflow:hidden; color:#164e63; font-size:10.5px; text-overflow:ellipsis; white-space:nowrap; }.epi-generated-output-row small { color:var(--ps-muted); font-size:9.5px; }.epi-generated-output-row em { color:#94a3b8; font-style:normal; }.epi-generated-output-detail { display:grid; gap:5px; margin:0 10px 10px; padding:9px 10px; border:1px solid #cfe7e4; border-radius:7px; background:#f8fffe; }.epi-generated-output-detail > strong { color:var(--ps-teal-text); font-size:11px; }.epi-generated-output-detail dl { display:grid; grid-template-columns:auto minmax(0,1fr); gap:3px 8px; margin:0; font-size:10px; }.epi-generated-output-detail dt { color:var(--ps-muted); }.epi-generated-output-detail dd { margin:0; color:var(--ps-charcoal); font-weight:650; }.epi-generated-output-standalone { grid-template-columns:repeat(auto-fit,minmax(170px,1fr)) !important; }
.epi-standalone-tabs { margin:10px 0; grid-template-columns:repeat(2,minmax(0,1fr)) !important; }.epi-cohort-matrix { display:grid; gap:9px; padding:10px; border:1px solid #dce8eb; border-radius:8px; background:#fbfefd; }.epi-cohort-matrix-head { display:flex; align-items:end; justify-content:space-between; gap:10px; }.epi-cohort-matrix-head > div { display:grid; gap:3px; }.epi-cohort-matrix-head strong { color:#164e63; font-size:12px; }.epi-cohort-matrix-head small { color:var(--ps-muted); font-size:10px; }.epi-cohort-matrix-head label { display:grid; gap:3px; min-width:150px; color:var(--ps-teal-text); font-size:9px; font-weight:800; letter-spacing:.04em; text-transform:uppercase; }.epi-cohort-matrix-head select { min-height:29px; border:1px solid var(--ps-line-strong); border-radius:6px; background:var(--ps-input); color:var(--ps-charcoal); font-size:11px; }.epi-cohort-matrix-scroll { max-height:300px; overflow:auto; border:1px solid #e2eaee; border-radius:6px; background:var(--ps-panel); }.epi-cohort-matrix table { min-width:max-content; width:100%; border-collapse:separate; border-spacing:0; font-size:10.5px; }.epi-cohort-matrix th,.epi-cohort-matrix td { min-width:84px; padding:7px 9px; border-right:1px solid #edf1f3; border-bottom:1px solid #edf1f3; text-align:right; white-space:nowrap; }.epi-cohort-matrix thead th { position:sticky; top:0; z-index:2; background:var(--ps-matrix-head); color:#164e63; font-weight:800; }.epi-cohort-matrix th:first-child { position:sticky; left:0; z-index:1; min-width:120px; background:var(--ps-panel); text-align:left; color:var(--ps-charcoal); }.epi-cohort-matrix thead th:first-child { z-index:3; background:var(--ps-matrix-head); }.epi-cohort-matrix-total th,.epi-cohort-matrix-total td { border-top:1px solid #9ecfc9; background:#effaf8; color:var(--ps-teal-text); font-weight:800; }.epi-cohort-matrix-total th:first-child { background:#effaf8; }.epi-cohort-matrix tbody tr:last-child > * { border-bottom:0; }
.epi-cohort-matrix-actions { display:flex !important; align-items:end; gap:7px; }.epi-cohort-export { position:relative; }.epi-cohort-export summary { list-style:none; min-height:29px; padding:6px 9px; cursor:pointer; white-space:nowrap; }.epi-cohort-export summary::-webkit-details-marker { display:none; }.epi-cohort-export > div { position:absolute; right:0; z-index:5; display:grid; min-width:190px; padding:5px; border:1px solid var(--ps-line-strong); border-radius:6px; background:var(--ps-panel); box-shadow:0 7px 18px rgba(15,23,42,.14); }.epi-cohort-export button { min-height:29px; border:0; border-radius:4px; background:transparent; color:var(--ps-charcoal); text-align:left; font-size:11px; }.epi-cohort-export button:hover { background:#effaf8; color:var(--ps-teal-text); }

/* Final Persistence UI cleanup — display-only. */
.epi-stateful-modern { gap:16px; }.epi-stateful-modern .epi-lot-track-by,.epi-stateful-modern .epi-cohort-foundation { display:none; }.epi-stateful-modern label > span,.epi-stateful-modern .epi-lot-journey > strong,.epi-stateful-modern .epi-lot-configure > strong { font-size:10px; font-weight:800; letter-spacing:.04em; text-transform:uppercase; }.epi-stateful-modern input,.epi-stateful-modern select { min-height:32px; border-radius:6px; }.epi-stateful-modern .epi-stateful-top-grid { gap:10px; padding:10px; border:1px solid #d7e8e6; border-radius:8px; background:#fbfefd; }.epi-stateful-modern .epi-standalone-tabs,.epi-stateful-modern .epi-lot-inner-tabs { display:flex; width:max-content; max-width:100%; gap:3px; padding:3px; border:1px solid #d9e5e7; border-radius:7px; background:var(--ps-raised); }.epi-stateful-modern .epi-lot-tabs button { min-height:32px; padding:5px 10px; border-radius:5px; background:var(--ps-panel); font-size:11px; font-weight:700; }.epi-stateful-modern .epi-standalone-tabs button.selected,.epi-stateful-modern .epi-lot-inner-tabs button:nth-child(1).selected { border-color:#71b8b1; background:#eaf8f6; color:var(--ps-teal-text); }.epi-stateful-modern .epi-lot-inner-tabs button:nth-child(2).selected { border-color:#efbd8c; background:#fff5e9; color:var(--ps-orange-text); }.epi-stateful-modern .epi-lot-inner-tabs button:nth-child(3).selected { border-color:#9dc5ef; background:#eef6ff; color:var(--ps-blue); }.epi-stateful-modern .epi-lot-journey { grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:8px; padding:9px 11px; border-color:#dfd5f3; background:#fbf9ff; }.epi-stateful-modern .epi-lot-journey > strong { color:var(--ps-purple); }.epi-stateful-modern .epi-lot-journey > small { grid-column:2; margin:0; color:var(--ps-purple); }.epi-stateful-modern .epi-lot-journey > div:not(.epi-embedded-journey-editor) { grid-column:2; display:flex; align-items:center; gap:6px; overflow:hidden; padding:0; }.epi-stateful-modern .epi-lot-journey > div:not(.epi-embedded-journey-editor) > span { flex:0 1 auto; min-width:0; padding:4px 8px; border-color:#dacbf3; background:#f4f0fc; color:var(--ps-purple); font-size:10.5px; }.epi-stateful-modern .epi-lot-journey .epi-lot-add-line { grid-column:3; grid-row:1 / span 2; min-height:28px; padding:4px 8px; color:var(--ps-purple); }.epi-stateful-modern .epi-lot-journey .epi-embedded-journey-editor { grid-column:1 / -1; }.epi-stateful-modern .epi-lot-persistence-layout { grid-template-columns:minmax(0,.78fr) minmax(0,1.22fr); }.epi-stateful-modern .epi-lot-persistence-layout .epi-lot-chart .epi-stateful-preview { min-height:250px; }.epi-stateful-modern .epi-lot-persistence-layout .epi-lot-chart .epi-stateful-preview svg { height:214px; }.epi-stateful-modern .epi-lot-exit { border-color:#f0cfaa; background:#fffaf5; }.epi-stateful-modern .epi-lot-exit .epi-lot-exit-total.ok b { color:var(--ps-green); }.epi-stateful-modern .epi-cohort-matrix { border-color:#cfe0f2; background:#fbfdff; }.epi-stateful-modern .epi-cohort-matrix-head strong { color:var(--ps-blue); }.epi-stateful-modern .epi-cohort-matrix thead th { background:#eef6ff; color:var(--ps-blue); }.epi-stateful-modern .epi-cohort-matrix tbody tr:nth-child(even) { background:#f8fbff; }.epi-stateful-modern .epi-cohort-matrix-total { background:#e9f3ff !important; font-weight:800; }.epi-stateful-modern .epi-generated-output-standalone { grid-template-columns:1fr !important; }.epi-stateful-modern .epi-generated-output-row { min-height:34px; border-radius:5px; }.epi-stateful-modern .epi-generated-output-row small { display:inline; margin-left:7px; }.epi-stateful-modern .epi-generated-output-row span { display:block; }
@media (max-width:960px) { .epi-lot-selected-grid { grid-template-columns:minmax(160px,.85fr) minmax(210px,1.15fr) minmax(160px,.85fr); }.epi-lot-journey > div { gap:5px; }.epi-lot-journey > div > span { padding:8px 6px; font-size:10px; } }
@media (max-width:760px) { .epi-lot-summary-strip, .epi-lot-selected-grid, .epi-lot-journey-heading { grid-template-columns:1fr; }.epi-lot-summary-info { grid-column:auto; flex-wrap:wrap; }.epi-lot-summary-info label { margin-left:0; }.epi-lot-journey > div { align-items:stretch; flex-direction:column; }.epi-lot-journey > div > b { align-self:center; transform:rotate(90deg); }.epi-stateful-modern .epi-generated-metrics-controls, .epi-stateful-modern .epi-generated-metrics-lot .epi-generated-metrics-controls { grid-template-columns:repeat(2,minmax(0,1fr)); }.epi-lot-track-by > div { flex-wrap:wrap; }.epi-lot-track-by select { flex-basis:150px; } }
@media (max-width:760px) { .epi-lot-journey > div:not(.epi-lot-journey-heading):not(.epi-embedded-journey-editor) { align-items:center; flex-direction:row; }.epi-lot-journey > div:not(.epi-lot-journey-heading):not(.epi-embedded-journey-editor) > b { align-self:center; transform:none; } }
@media (max-width:860px) { .epi-stateful-modern .epi-lot-curve-content { grid-template-columns:minmax(0,1fr); }.epi-stateful-modern .epi-lot-curve-content .epi-stateful-preview { min-height:188px; }.epi-stateful-modern .epi-generated-metrics-lot > div { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:900px) { .epi-stateful-modern .epi-lot-layout { grid-template-columns:1fr; }.epi-stateful-modern .epi-lot-rule-head, .epi-stateful-modern .epi-lot-rule { grid-template-columns:1fr 1fr .62fr .76fr; } }
@media (min-width:720px) and (max-width:900px) { .epi-stateful-modern .epi-lot-layout { grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr); } }
@media (max-width:820px) { .epi-stateful-modern .epi-stateful-top-grid, .epi-cohort-foundation { grid-template-columns:1fr; }.epi-stateful-modern .epi-generated-metrics > div { grid-template-columns:1fr; } }
@media (max-width:900px) { .epi-lot-layout, .epi-lot-curve-content { grid-template-columns:1fr; } }
@media (max-width:700px) { .epi-stateful-grid, .epi-stateful-curve-layout { grid-template-columns:1fr; } }
@media (max-width:700px) { .epi-stateful-method-layout { grid-template-columns:1fr; min-height:0; } }
@media (max-width:900px) { .epi-stateful-rules-grid, .epi-generated-metrics > div { grid-template-columns:repeat(2,minmax(0,1fr)); } }

.epi-business-port {
  position: absolute;
  z-index: 5;
  top: 50%;
  width: 8px;
  height: 8px;
  padding: 0;
  border: 2px solid var(--stage-color);
  border-radius: 50%;
  background: var(--ps-panel);
  opacity: 0.62;
  transform: translateY(-50%);
  transition:
    opacity 0.15s ease,
    background 0.15s ease;
}

.epi-business-port.in {
  left: -5px;
}
.epi-business-port.out {
  right: -5px;
}
.epi-business-card:hover .epi-business-port,
.epi-business-port:hover,
.epi-business-port.active {
  opacity: 1;
  background: var(--stage-color);
}

body.epi-business-connecting {
  cursor: crosshair;
  user-select: none;
}
body.epi-business-connecting .epi-business-card {
  cursor: default;
}
body.epi-business-connecting .epi-business-port.in {
  opacity: 1;
  width: 12px;
  height: 12px;
  left: -7px;
  border-width: 2px;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--stage-color) 15%, transparent);
}
body.epi-business-connecting .epi-business-port.in.connection-target {
  background: var(--ps-blue);
  border-color: var(--ps-blue);
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.2);
  transform: translateY(-50%) scale(1.12);
}

.epi-business-wire-preview {
  position: fixed;
  z-index: 9999;
  inset: 0;
  width: 100vw;
  height: 100vh;
  overflow: visible;
  pointer-events: none;
}
.epi-business-wire-preview path {
  fill: none;
  stroke: var(--ps-blue);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 2px rgba(37, 99, 235, 0.22));
}
.epi-business-wire-preview circle {
  fill: var(--ps-blue);
}

.epi-business-conn-layer {
  position: absolute;
  /* canvas/stage surfaces < wires < card bodies and controls */
  z-index: 1;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}

.epi-business-conn {
  fill: none;
  stroke: var(--connector-color, #344a62);
  stroke-width: 1.5;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

/* Route classes only control geometry/weight; colour belongs to the source stage. */
.epi-business-conn.epi-connector--intra-stage {
  stroke-width: 1.45;
  opacity: 0.98;
}

.epi-business-conn.epi-connector--inter-stage {
  stroke-width: 1.65;
  opacity: 0.98;
}

.epi-business-conn.inferred {
  stroke-dasharray: 4 3;
  opacity: 0.58;
}

/* Formula-derived links retain their dashed relationship cue, but stage
   hierarchy always wins over the generic inferred-link opacity. */
.epi-business-conn.epi-connector--intra-stage.inferred {
  opacity: 0.98;
}

.epi-business-conn.epi-connector--inter-stage.inferred {
  opacity: 0.98;
}

.epi-business-conn-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 14;
  pointer-events: stroke;
}

.epi-business-conn-delete {
  opacity: 0;
  pointer-events: all;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.epi-business-conn-group:hover .epi-business-conn-delete,
.epi-business-conn-delete:focus {
  opacity: 1;
}
.epi-business-conn-group:hover .epi-business-conn {
  opacity: 1;
  stroke-width: 1.9;
}

/* Card hover keeps direct relationships prominent while quietly receding the
   rest of the graph. Source-stage colour remains unchanged in every state. */
.epi-business-conn-layer.epi-connector-focus .epi-business-conn-group {
  transition: opacity 0.15s ease;
}
.epi-business-conn-layer.epi-connector-focus .epi-business-conn-group.epi-connector-muted {
  opacity: 0.24;
}
.epi-business-conn-layer.epi-connector-focus .epi-business-conn-group.epi-connector-related .epi-business-conn {
  opacity: 1;
}
.epi-business-conn-delete circle {
  fill: var(--ps-panel);
  stroke: var(--ps-red);
  stroke-width: 1.1;
}
.epi-business-conn-delete path {
  fill: none;
  stroke: var(--ps-red);
  stroke-width: 1.25;
  stroke-linecap: round;
}

#epi-business-arrow-intra path {
  fill: #1f2937;
  stroke: #1f2937;
  stroke-width: 0.4;
}

#epi-business-arrow-inter path {
  fill: #1f2937;
  stroke: #1f2937;
  stroke-width: 0.4;
}

.epi-business-split-row-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 7px;
  align-items: center;
}

.epi-business-split-remove {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--ps-line-strong);
  border-radius: 7px;
  color: var(--ps-muted);
  background: var(--ps-panel);
  cursor: pointer;
}

.epi-business-split-remove:hover:not(:disabled) {
  color: var(--ps-red);
  border-color: #fca5a5;
  background: #fff7f7;
}

.epi-business-split-remove:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.epi-test-flow-card-title strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.epi-business-undo {
  gap: 6px;
}

.epi-branch-form-context {
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid #b9dfe4;
  border-radius: 7px;
  color: #0d6971;
  background: #f0fafb;
  font-size: 11px;
}

.epi-business-stage-empty {
  position: absolute;
  z-index: 4;
  top: 44px;
  left: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  min-height: 60px;
  border: 1px dashed #d4dde7;
  border-radius: 7px;
  color: #8491a2;
  background: rgba(255, 255, 255, 0.55);
  font-size: 10.5px;
}

.epi-business-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 9px;
  color: var(--ps-muted);
  text-align: center;
}

.epi-business-empty h3,
.epi-business-empty p {
  margin: 0;
}
.epi-business-empty h3 {
  color: var(--ps-charcoal);
}

.epi-business-inspector,
.epi-tech-nav,
.epi-tech-properties {
  min-width: 0;
  border-left: 1px solid var(--ps-line);
  background: var(--ps-panel);
}

.epi-business-guidance-panel {
  align-self: start;
  min-height: 0;
  margin: 11px 10px;
  overflow: hidden;
  border: 1.5px dashed #2d9aa2;
  border-radius: 8px;
  background: #fbffff;
}

.epi-business-guidance-title {
  display: grid;
  justify-items: center;
  gap: 1px;
  padding: 14px 10px 10px;
  color: #14747c;
  font-size: 10px;
  line-height: 1.25;
  text-align: center;
}

.epi-business-selected-card {
  display: grid;
  gap: 6px;
  margin: 0 10px 4px;
  padding: 9px;
  border: 1px solid var(--ps-line);
  border-radius: 6px;
  background: var(--ps-panel);
}

.epi-business-selected-card small {
  color: var(--ps-muted);
  font-size: 8.5px;
  text-transform: uppercase;
}
.epi-business-selected-card strong {
  overflow: hidden;
  color: var(--ps-charcoal);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.epi-business-selected-card > div {
  display: flex;
  gap: 4px;
}
.epi-business-selected-card > div button {
  flex: 1;
  padding: 4px;
  border: 1px solid var(--ps-line);
  border-radius: 4px;
  color: #5b6879;
  background: var(--ps-panel);
  font-size: 8.5px;
}

.epi-business-form,
.epi-tech-property-grid {
  display: grid;
  gap: 8px;
  padding: 13px;
}

.epi-business-form label,
.epi-tech-property-grid label,
.epi-tech-field > span,
.epi-tech-editor-grid span,
.epi-tech-connections label > span {
  color: #526071;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.epi-business-form input,
.epi-business-form select,
.epi-business-form textarea,
.epi-tech-view input,
.epi-tech-view select,
.epi-tech-view textarea {
  width: 100%;
  border: 1px solid var(--ps-line-strong);
  border-radius: 6px;
  color: var(--ps-charcoal);
  background: var(--ps-input);
  font-size: 12px;
}

.epi-business-editor-backdrop {
  position: fixed;
  z-index: 140;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(30, 41, 59, 0.18);
  backdrop-filter: blur(2px);
}

.epi-business-editor {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(640px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  overflow: hidden;
  border: 1px solid var(--ps-line-strong);
  border-radius: 12px;
  background: var(--ps-panel);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.25);
}

.epi-business-editor-compact {
  width: min(520px, calc(100vw - 40px));
}

.epi-business-editor-foot-end {
  justify-content: flex-end;
}

.epi-business-editor-head,
.epi-business-editor-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}

.epi-business-editor-head {
  border-bottom: 1px solid #e4e9ef;
}
.epi-business-editor-foot {
  justify-content: space-between;
  border-top: 1px solid #e4e9ef;
  background: var(--ps-raised);
}
.epi-business-editor-head span {
  color: var(--ps-teal-text);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}
.epi-business-editor-head h3 {
  margin: 2px 0 0;
  color: var(--ps-charcoal);
  font-size: 17px;
}

.epi-business-editor-body {
  display: grid;
  gap: 12px;
  overflow: auto;
  padding: 16px;
}

.epi-business-editor-body label {
  display: grid;
  gap: 5px;
  color: #526071;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.epi-business-editor-body input,
.epi-business-editor-body select,
.epi-business-editor-body textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--ps-line-strong);
  border-radius: 7px;
  color: var(--ps-charcoal);
  background: var(--ps-input);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
}

.epi-business-editor-body textarea {
  min-height: 88px;
  resize: vertical;
}
.epi-business-editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.epi-business-editor-note {
  margin: -4px 0 0;
  color: var(--ps-muted);
  font-size: 10px;
}

.epi-business-split-fields {
  display: grid;
  gap: 10px;
  padding: 11px;
  border: 1px solid #dce5ee;
  border-radius: 8px;
  background: var(--ps-canvas);
}
.epi-business-split-fields[hidden] {
  display: none;
}
.epi-business-split-fields > div:first-child {
  display: grid;
  gap: 2px;
}
.epi-business-split-fields strong {
  color: var(--ps-charcoal);
  font-size: 11px;
}
.epi-business-split-fields small {
  color: var(--ps-muted);
  font-size: 9.5px;
}

.epi-business-branch-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  max-height: 150px;
  overflow: auto;
}

.epi-business-branch-list label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid #dce5ee;
  border-radius: 6px;
  background: var(--ps-panel);
  cursor: pointer;
}

.epi-business-branch-list input {
  width: 14px;
  min-height: 14px;
  height: 14px;
  padding: 0;
  accent-color: var(--ps-teal);
}
.epi-business-branch-list span {
  overflow: hidden;
  color: #46566b;
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.epi-business-split-names {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.epi-business-split-names label {
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid #dce5ee;
  border-radius: 7px;
  background: var(--ps-panel);
}

.epi-business-split-names label > span {
  color: var(--ps-muted);
  font-size: 9px;
  font-weight: 800;
}

.epi-toast {
  position: fixed;
  z-index: 4020;
  top: 84px;
  right: 22px;
  display: flex;
  align-items: center;
  gap: 9px;
  width: min(430px, calc(100vw - 44px));
  min-height: 44px;
  padding: 10px 11px;
  border: 1px solid rgba(36, 124, 138, 0.28);
  border-radius: 9px;
  color: #175f68;
  background: rgba(247, 254, 254, 0.98);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16);
  animation: epi-toast-lifecycle 4s ease both;
}

.epi-toast:hover {
  animation-play-state: paused;
}
.epi-toast-icon {
  display: grid;
  place-items: center;
  flex: 0 0 23px;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  color: #fff;
  background: var(--ps-teal);
}
.epi-toast-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.epi-toast strong {
  font-size: 11px;
  line-height: 1.35;
}
.epi-toast-copy span {
  font-size: 10px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.epi-toast-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.epi-toast button {
  padding: 3px 5px;
  border: 0;
  color: var(--ps-teal-dark);
  background: transparent;
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
}
.epi-toast .epi-toast-close {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  color: var(--ps-muted);
}

@media (max-width: 520px) {
  .epi-toast {
    grid-template-columns: 23px minmax(0, 1fr) 24px;
  }
  .epi-toast-actions {
    grid-column: 2;
    justify-content: flex-start;
  }
}

@keyframes epi-toast-lifecycle {
  0% {
    opacity: 0;
    transform: translateY(-8px);
  }
  8%,
  84% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-5px);
  }
}

.epi-business-delete-action {
  display: grid;
  gap: 4px;
  justify-items: start;
}
.epi-business-delete-action small {
  color: var(--ps-red);
  font-size: 8.5px;
}
.epi-danger-outline {
  border-color: rgba(220, 38, 38, 0.55);
  color: var(--ps-red);
  background: var(--ps-panel);
}
.epi-danger-outline:hover {
  border-color: var(--ps-red);
  background: #fff5f5;
}

.epi-business-form input,
.epi-business-form select,
.epi-tech-view input,
.epi-tech-view select {
  min-height: 36px;
  padding: 7px 9px;
}
.epi-business-form textarea,
.epi-tech-view textarea {
  min-height: 76px;
  padding: 9px;
  resize: vertical;
}
.epi-configure-card {
  justify-content: center;
  margin-top: 5px;
}

.epi-business-guidance {
  display: grid;
  gap: 13px;
  padding: 12px 13px 16px;
}

.epi-business-guidance strong {
  color: var(--ps-charcoal);
  font-size: 14px;
}
.epi-business-guidance span {
  display: flex;
  gap: 7px;
  align-items: center;
  color: #526071;
  font-size: 9.5px;
  line-height: 1.25;
}
.epi-business-guidance svg {
  color: var(--ps-teal-text);
}
.epi-business-guidance.technical svg {
  color: var(--ps-orange-text);
}

.epi-business-tip {
  display: flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  max-width: 100%;
  padding: 7px 10px;
  border: 1px dashed rgba(29, 78, 216, 0.28);
  border-radius: 7px;
  color: #315b9a;
  background: #f6f9ff;
  font-size: 10px;
}

.epi-tech-workspace {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: 0;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--ps-line);
  border-radius: 10px;
  background: var(--ps-panel);
}

.epi-tech-nav {
  border-right: 1px solid var(--ps-line);
  border-left: 0;
}

.epi-tech-flow-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 7px 10px 10px;
  background: var(--ps-raised);
}

.epi-tech-flow-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  flex-wrap: nowrap;
  min-height: 48px;
  padding: 0 1px 6px;
}

.epi-tech-flow-toolbar > div:first-child {
  flex: 1 1 auto;
  min-width: 220px;
}

.epi-tech-flow-toolbar h3,
.epi-tech-flow-toolbar p {
  margin: 0;
}
.epi-tech-flow-toolbar h3 {
  color: var(--ps-charcoal);
  font-size: 14px;
}
.epi-tech-flow-toolbar p {
  margin-top: 2px;
  color: var(--ps-muted);
  font-size: 10.5px;
}
.epi-tech-flow-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.epi-tech-flow-actions .btn {
  min-height: 30px;
  padding: 6px 9px;
  font-size: 10px;
}
.epi-tech-flow-actions .btn-icon {
  width: 30px;
  padding: 0;
}

.epi-tech-flow-scroll {
  position: relative;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: auto;
  border: 1px solid var(--ps-line);
  border-radius: 8px;
  background-color: var(--ps-canvas);
  background-image: radial-gradient(circle, var(--ps-dot) 1px, transparent 1px);
  background-size: 20px 20px;
}

.epi-tech-flow-canvas {
  position: relative;
  min-width: 100%;
  min-height: 100%;
  transform-origin: top left;
}

.epi-tech-flow-stage {
  position: absolute;
  overflow: visible;
  border: 1px solid color-mix(in srgb, var(--stage-color) 46%, #d7dee8);
  border-radius: 7px;
  background: color-mix(in srgb, var(--stage-color) 4%, var(--ps-mix-base));
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.035);
}

.epi-tech-flow-stage-head {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 5px;
  align-items: center;
  min-height: 34px;
  padding: 5px 7px;
  border-bottom: 1px solid color-mix(in srgb, var(--stage-color) 22%, #e2e8f0);
  border-radius: 6px 6px 0 0;
  color: color-mix(in srgb, var(--stage-color) 80%, #1f2937);
  background: color-mix(in srgb, var(--stage-color) 9%, var(--ps-mix-base));
}

.epi-tech-flow-stage-head > span {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: #fff;
  background: var(--stage-color);
  font-size: 8.5px;
  font-weight: 900;
}

.epi-tech-flow-stage-head strong {
  overflow: hidden;
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.epi-tech-flow-stage-head small {
  color: color-mix(in srgb, var(--stage-color) 65%, #64748b);
  font-size: 7.5px;
  font-weight: 800;
}
.epi-tech-flow-card-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.epi-tech-flow-card {
  position: absolute;
  z-index: 6;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  min-width: 0;
  padding: 6px 7px;
  overflow: hidden;
  border: 1px solid var(--ps-line);
  border-radius: 5px;
  background: var(--ps-panel);
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.045);
  cursor: pointer;
  pointer-events: auto;
}

.epi-tech-flow-card:hover,
.epi-tech-flow-card.selected {
  border-color: var(--stage-color);
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--stage-color) 18%, transparent),
    0 7px 16px rgba(15, 23, 42, 0.09);
}

/* A cross-stage dependency has a secondary, stage-native endpoint cue.
   The arrow remains the primary directional affordance. */
.epi-business-card.epi-inter-stage-participant,
.epi-tech-flow-card.epi-inter-stage-participant {
  border-width: 2px;
  border-color: var(--stage-color);
}

.epi-tech-flow-card-title {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  width: 100%;
}
.epi-tech-flow-card-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: color-mix(in srgb, var(--stage-color) 78%, #334155);
}
.epi-tech-flow-card-title strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ps-charcoal);
  font-size: 9.5px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.epi-tech-flow-card-title .epi-business-type {
  flex: 0 0 auto;
  margin: 0 0 0 auto;
}
.epi-tech-flow-card p {
  display: -webkit-box;
  flex: 0 1 auto;
  overflow: hidden;
  min-height: 0;
  max-height: 36px;
  margin: 7px 0 0;
  color: #67768a;
  font-size: 9px;
  line-height: 1.3;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}
.epi-tech-flow-card p.empty {
  color: transparent;
}
.epi-tech-flow-unit {
  display: block;
  flex: 0 0 auto;
  min-height: 10px;
  margin-top: auto;
  padding-top: 4px;
  overflow: hidden;
  color: #8491a2;
  font-size: 7.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.epi-tech-flow-empty {
  position: absolute;
  z-index: 4;
  top: 44px;
  left: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  min-height: 50px;
  border: 1px dashed #d4dde7;
  border-radius: 6px;
  color: #8491a2;
  background: rgba(255, 255, 255, 0.65);
  font-size: 9.5px;
}

.epi-tech-flow-add {
  position: absolute;
  z-index: 4;
  right: 8px;
  bottom: 8px;
  left: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 27px;
  border: 0;
  border-top: 1px solid color-mix(in srgb, var(--stage-color) 20%, #dbe3ec);
  color: color-mix(in srgb, var(--stage-color) 78%, #334155);
  background: transparent;
  font-size: 9px;
  font-weight: 850;
}

.epi-tech-minimap {
  position: static;
  display: grid;
  flex: 0 0 162px;
  width: 162px;
  margin-left: auto;
  padding: 2px 2px 0;
  border: 1px solid var(--ps-line);
  border-radius: 7px;
  background: var(--ps-panel);
  box-shadow: 0 2px 7px rgba(15, 23, 42, 0.05);
  pointer-events: auto;
  cursor: default;
}
.epi-tech-minimap strong {
  padding-left: 2px;
  color: #526071;
  font-size: 7px;
  line-height: 1;
}
.epi-tech-minimap svg {
  display: block;
  overflow: visible;
}
.epi-tech-mm-stage,
.epi-tech-mm-card {
  cursor: pointer;
}
.epi-tech-mm-stage-bg {
  pointer-events: none;
}
.epi-tech-mm-stage-hit {
  fill: transparent;
  stroke: transparent;
  pointer-events: all;
}
.epi-tech-mm-card-hit {
  fill: transparent;
  pointer-events: all;
}
.epi-tech-mm-card-visual {
  fill: var(--ps-panel);
  fill-opacity: 0.96;
  stroke-width: 0.85;
  pointer-events: none;
}
.epi-tech-mm-stage:focus,
.epi-tech-mm-card:focus {
  outline: none;
}
.epi-tech-mm-stage:focus .epi-tech-mm-stage-hit,
.epi-tech-mm-card:focus .epi-tech-mm-card-visual {
  stroke: var(--ps-orange);
  stroke-width: 1.8;
}
.epi-business-card.epi-minimap-focus {
  outline: 3px solid rgba(217, 101, 50, 0.82);
  outline-offset: 2px;
  box-shadow:
    0 0 0 5px rgba(217, 101, 50, 0.14),
    0 10px 24px rgba(217, 101, 50, 0.2);
}
.epi-business-stage.epi-minimap-focus {
  outline: 2px solid rgba(217, 101, 50, 0.72);
  outline-offset: 3px;
  box-shadow: 0 0 0 5px rgba(217, 101, 50, 0.1);
}

.epi-tech-flow-tip {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 7px 9px;
  border: 1px dashed rgba(29, 78, 216, 0.25);
  border-radius: 6px;
  color: #315b9a;
  background: #f6f9ff;
  font-size: 9.5px;
}

.epi-tech-modal-backdrop {
  position: fixed;
  z-index: 4000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(38, 50, 65, 0.32);
  backdrop-filter: blur(3px);
}

/* Demo-only NOVA entry point and notice. Kept isolated from shared modal/button styles. */
button.btn.epi-nova-entry {
  border-color: #a98ae7;
  background: #eee5ff;
  color: #5d369f;
  box-shadow: none;
}
.btn.epi-nova-entry:hover,
.btn.epi-nova-entry:focus-visible {
  border-color: #8d69d7;
  background: #e2d2ff;
  color: #4a277f;
  outline: none;
}
.btn.epi-nova-entry:focus-visible {
  box-shadow: 0 0 0 3px rgba(169, 138, 231, 0.32);
}
.epi-nova-modal-backdrop {
  position: fixed;
  z-index: 4050;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(38, 50, 65, 0.32);
  backdrop-filter: blur(3px);
}
.epi-nova-modal {
  position: relative;
  width: min(390px, calc(100vw - 32px));
  padding: 28px 30px 24px;
  border: 1px solid #ded3f5;
  border-radius: 14px;
  background: var(--ps-overlay);
  box-shadow: 0 24px 70px rgba(66, 37, 119, 0.22);
  text-align: center;
}
.epi-nova-modal-close {
  position: absolute;
  top: 11px;
  right: 11px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ps-muted);
  cursor: pointer;
}
.epi-nova-modal-close:hover,
.epi-nova-modal-close:focus-visible {
  background: #f5f0ff;
  color: #6039ad;
  outline: none;
}
.epi-nova-modal-mark {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 13px;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, var(--ps-overlay) 0, #efe7ff 37%, #d9c8ff 100%);
  color: #7042c8;
}
.epi-nova-modal-eyebrow {
  margin: 0;
  color: #7042c8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.epi-nova-modal h2 {
  margin: 6px 0 11px;
  color: var(--ps-charcoal);
  font-size: 18px;
  line-height: 1.25;
}
.epi-nova-modal-status {
  margin: 0 0 14px;
  color: #7042c8;
  font-size: 13px;
  font-weight: 800;
}
.epi-nova-modal-copy {
  margin: 0 auto 20px;
  color: #526070;
  font-size: 12px;
  line-height: 1.6;
}
.epi-nova-modal-confirm {
  min-width: 100px;
  border-color: #a98ae7;
  background: #f6f1ff;
  color: #5d369f;
}
.epi-nova-modal-confirm:hover,
.epi-nova-modal-confirm:focus-visible {
  border-color: #8d69d7;
  background: #ece2ff;
  color: #4a277f;
  outline: none;
}

.epi-tech-modal {
  position: relative;
  z-index: 4010;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1380px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: hidden;
  border: 1px solid #d8e1eb;
  border-radius: 11px;
  background: var(--ps-overlay);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
}

.epi-tech-modal.epi-tech-discard-confirm {
  z-index: 4030;
}
.epi-tech-discard-scrim { position:absolute; z-index:4020; inset:0; background:rgba(15,23,42,.42); }
.epi-tech-discard-dialog { position:absolute; z-index:4030; top:50%; left:50%; width:min(360px,calc(100vw - 48px)); transform:translate(-50%,-50%); padding:20px; border:1px solid #d8e1eb; border-radius:10px; background:var(--ps-overlay); box-shadow:0 22px 52px rgba(15,23,42,.28); }
.epi-tech-discard-dialog h3 { margin:0; color:var(--ps-charcoal); font-size:16px; }
.epi-tech-discard-dialog p { margin:8px 0 18px; color:var(--ps-muted); font-size:13px; }
.epi-tech-discard-dialog > div { display:flex; justify-content:flex-end; gap:8px; }

.epi-tech-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--ps-line);
  background: var(--ps-overlay);
}
.epi-tech-modal-head span {
  color: var(--ps-teal-text);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.epi-tech-modal-head h2 {
  margin: 2px 0 0;
  color: var(--ps-charcoal);
  font-size: 16px;
}
.epi-tech-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.epi-tech-modal .epi-tech-nova-entry {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 11px;
}
.epi-tech-split-nova-entry {
  min-height: 29px;
  padding: 4px 9px;
  font-size: 10.5px;
  white-space: nowrap;
}
.epi-tech-modal .epi-tech-nova-helper {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid #ded3f5;
  border-radius: 7px;
  background: #faf7ff;
  color: #6741b3;
  font-size: 11px;
  line-height: 1.4;
}
.epi-tech-modal .epi-tech-nova-helper svg {
  flex: 0 0 auto;
  margin-top: 1px;
}

.epi-tech-modal-body {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 0.85fr);
  min-height: 0;
  overflow: hidden;
  overflow-x: hidden;
}
.epi-tech-modal .epi-tech-editor {
  overflow: auto;
  overflow-x: hidden;
  padding: 14px;
}
.epi-tech-modal .epi-tech-properties {
  display: flex;
  flex-direction: column;
  overflow: auto;
  border-left: 1px solid var(--ps-line);
}

.epi-tech-inline-fill {
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--ps-line);
  border-radius: 8px;
  background: var(--ps-panel);
}

.epi-tech-inline-fill > .epi-fill-panel-title {
  min-height: 42px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--ps-line);
}

.epi-tech-inline-fill .epi-fill-panel-body {
  min-height: 260px;
  padding: 12px;
}

.epi-tech-inline-fill .epi-fill-chart {
  flex-basis: 240px;
  width: 240px;
}
.epi-tech-modal .epi-tech-property-grid label:last-child {
  grid-column: 1 / -1;
}
.epi-tech-modal .epi-output-toggle {
  margin-top: auto;
}
.epi-tech-readonly {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--ps-line-strong);
  border-radius: 7px;
  color: #344256;
  background: #f3f6f9;
  font-size: 12px;
  font-weight: 750;
  cursor: default;
}

.epi-tech-search {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 10px 8px;
  padding: 0 9px;
  border: 1px solid var(--ps-line);
  border-radius: 6px;
  color: var(--ps-muted);
}

.epi-tech-search input {
  min-height: 34px;
  padding: 0;
  border: 0;
  outline: 0;
}

.epi-tech-tree {
  max-height: 575px;
  overflow: auto;
  padding: 2px 10px 14px;
}

.epi-tech-tree-stage {
  margin-bottom: 12px;
}
.epi-tech-tree-stage > div {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 6px;
  align-items: center;
  margin-bottom: 4px;
}
.epi-tech-tree-stage > div > span {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: #fff;
  background: var(--stage-color);
  font-size: 9px;
  font-weight: 900;
}
.epi-tech-tree-stage > div strong {
  color: color-mix(in srgb, var(--stage-color) 72%, #26364a);
  font-size: 11px;
}
.epi-tech-tree-stage > button {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  gap: 5px;
  align-items: center;
  width: 100%;
  min-height: 29px;
  padding: 5px 6px 5px 24px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: #48566a;
  background: transparent;
  text-align: left;
}
.epi-tech-tree-stage > button:hover,
.epi-tech-tree-stage > button.active {
  border-color: color-mix(in srgb, var(--stage-color) 45%, #dbe3ec);
  background: color-mix(in srgb, var(--stage-color) 8%, var(--ps-mix-base));
}
.epi-tech-tree-stage > button span {
  overflow: hidden;
  font-size: 10.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.epi-tech-tree-stage > button small {
  padding: 2px 4px;
  border-radius: 3px;
  color: #0d6971;
  background: #e7f7f8;
  font-size: 7.5px;
  font-weight: 900;
  text-transform: uppercase;
}
.epi-tech-no-cards {
  display: block;
  padding: 5px 0 2px 24px;
  color: var(--ps-muted);
}

.epi-tech-editor {
  min-width: 0;
  overflow: auto;
  padding: 14px;
  background: var(--ps-raised);
}

.epi-tech-empty {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  color: var(--ps-muted);
  text-align: center;
}
.epi-tech-empty h3,
.epi-tech-empty p {
  margin: 0;
  max-width: 430px;
}
.epi-tech-empty h3 {
  color: var(--ps-charcoal);
}

.epi-tech-editor-grid,
.epi-tech-property-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.epi-tech-editor-grid label,
.epi-tech-field,
.epi-tech-property-grid label,
.epi-tech-connections label {
  display: grid;
  gap: 5px;
}
.epi-tech-field {
  margin-top: 10px;
}

.epi-tech-formula-block,
.epi-tech-preview,
.epi-tech-connections,
.epi-tech-input-note {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--ps-line);
  border-radius: 8px;
  background: var(--ps-panel);
}

.epi-tech-section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}
.epi-tech-section-title strong,
.epi-tech-section-title small {
  display: block;
}
.epi-tech-section-title strong {
  color: var(--ps-charcoal);
  font-size: 12px;
}
.epi-tech-section-title small {
  margin-top: 2px;
  color: var(--ps-muted);
  font-size: 10px;
}
.epi-tech-split-editor {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.epi-tech-split-editor .epi-tech-formula-block {
  margin-top: 12px;
  padding: 10px;
}
.epi-tech-split-period {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 30px;
  gap: 6px;
  align-items: center;
}
.epi-tech-split-period .btn {
  min-height: 34px;
  padding: 0;
}
.epi-tech-split-inputs label {
  display: grid;
  grid-template-columns: minmax(78px, 1fr) minmax(100px, 0.8fr);
  gap: 8px;
  align-items: center;
}
.epi-tech-split-inputs {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}
.epi-tech-split-inputs label > span:first-child {
  color: #526071;
  font-size: 10px;
  font-weight: 850;
}
.epi-tech-split-inputs label small {
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 8px;
  font-weight: 850;
  white-space: nowrap;
}
.epi-tech-split-inputs label small.auto {
  color: #087f5b;
  background: #e7f8f1;
}
.epi-tech-split-inputs label small.editable {
  color: #526071;
  background: #f1f5f9;
}
.epi-tech-split-inputs input[readonly] {
  color: var(--ps-muted);
  background: #f1f5f9;
  border-color: var(--ps-line);
}
.epi-tech-split-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  padding: 7px 9px;
  border: 1px solid var(--ps-line);
  border-radius: 6px;
  color: #526071;
  font-size: 10px;
}
.epi-tech-split-total.ok {
  border-color: rgba(14, 159, 110, 0.28);
  background: rgba(14, 159, 110, 0.08);
  color: var(--ps-green);
}
.epi-tech-split-total.bad {
  border-color: rgba(220, 38, 38, 0.28);
  background: rgba(220, 38, 38, 0.06);
  color: var(--ps-red);
}
.epi-tech-split-total small {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: inherit;
  font-size: 9px;
}
.epi-tech-split-values .epi-form-actions {
  margin-top: 10px;
}
.epi-tech-split-preview-lines {
  display: grid;
  gap: 6px;
}
.epi-tech-split-preview-period {
  color: var(--ps-teal-text);
  font-size: 10px;
}
.epi-tech-split-preview-lines > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid #edf1f5;
}
.epi-tech-split-preview-lines > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.epi-tech-split-preview-lines strong {
  color: var(--ps-charcoal);
  font-size: 11px;
}
.epi-tech-split-preview-lines span {
  color: var(--ps-muted);
  font-size: 10px;
  text-align: right;
}
.epi-tech-split-preview-empty {
  color: var(--ps-muted);
  font-size: 11px;
  line-height: 1.45;
}
.epi-formula-operators {
  display: flex;
  gap: 4px;
}
.epi-formula-operators button {
  width: 27px;
  height: 27px;
  padding: 0;
  border: 1px solid var(--ps-line-strong);
  border-radius: 5px;
  color: #46566b;
  background: var(--ps-panel);
  font-weight: 900;
}
.epi-formula-rich-editor {
  min-height: 84px;
  padding: 9px 10px;
  overflow: auto;
  border: 1px solid var(--ps-line-strong);
  border-radius: 6px;
  color: var(--ps-charcoal);
  background: var(--ps-input);
  font:
    12px/1.6 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  white-space: pre-wrap;
  word-break: break-word;
}
.epi-formula-rich-editor:focus {
  border-color: var(--ps-teal);
  outline: 2px solid rgba(23, 126, 137, 0.12);
}
.epi-formula-rich-editor mark {
  padding: 1px 3px;
  border: 1px solid var(--stage-color);
  border-radius: 3px;
  color: var(--ps-charcoal);
  background: var(--stage-tint);
}
.epi-formula-section-label {
  margin-top: 10px;
  color: #526277;
  font-size: 10px;
  font-weight: 800;
}
.epi-tech-tokens {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.epi-tech-tokens button {
  padding: 5px 7px;
  border: 1px solid #b9dfe2;
  border-radius: 5px;
  color: #11636c;
  background: #effafa;
  font-size: 9.5px;
  font-weight: 750;
}
.epi-stage-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  color: #68778b;
  font-size: 9px;
}
.epi-stage-legend span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.epi-stage-legend i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.epi-tech-tokens .epi-variable-chip {
  display: inline-flex;
  align-items: center;
  border-color: var(--stage-border);
  color: var(--ps-charcoal);
  background: var(--stage-tint);
}
.epi-tech-tokens .epi-variable-chip:focus-visible {
  outline: 2px solid var(--ps-teal);
  outline-offset: 2px;
}
.epi-stage-readonly {
  border-color: var(--stage-border) !important;
  color: var(--stage-color) !important;
  background: var(--stage-tint) !important;
}
.epi-tech-input-note {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #53657a;
  font-size: 11.5px;
}

.epi-tech-preview-row {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow-x: auto;
  padding: 8px 0 2px;
}

.epi-tech-preview-row > div {
  min-width: 120px;
  text-align: center;
}
.epi-tech-preview-row span,
.epi-tech-preview-row strong {
  display: block;
}
.epi-tech-preview-row span {
  color: var(--ps-muted);
  font-size: 9.5px;
}
.epi-tech-preview-row strong {
  margin-top: 4px;
  color: var(--ps-charcoal);
  font-size: 16px;
}
.epi-tech-preview-row .result {
  margin-left: auto;
  padding-left: 14px;
  border-left: 1px solid var(--ps-line);
}
.epi-tech-preview-row .result strong {
  color: var(--ps-teal-text);
}

.epi-tech-preview-formula > div,
.epi-tech-preview-formula .result {
  text-align: left;
  font-family: inherit;
}

.epi-tech-preview-formula > div {
  min-width: 0;
}
.epi-tech-preview-formula span {
  display: block;
  color: var(--ps-charcoal);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}
.epi-tech-preview-formula strong {
  display: block;
  margin-top: 2px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}
.epi-tech-preview-formula small {
  display: block;
  margin-top: 2px;
  color: var(--ps-muted);
  font-family: inherit;
  font-size: 10px;
  font-weight: 400;
  line-height: 1.35;
}

.epi-tech-properties {
  overflow: auto;
}
.epi-tech-property-grid {
  padding: 12px;
}
.epi-tech-connections {
  margin: 0 12px 12px;
}
.epi-tech-add-connection {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 5px;
}
.epi-tech-add-connection .btn {
  min-height: 36px;
  padding: 0;
}
.epi-tech-connection-group {
  display: grid;
  gap: 5px;
  margin-top: 10px;
}
.epi-tech-connection-group > span {
  color: #66768a;
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}
.epi-tech-connection-group > div {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.epi-tech-connection-group button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 7px;
  border: 1px solid #d8e1eb;
  border-radius: 5px;
  color: #4d5d72;
  background: var(--ps-raised);
  font-size: 9.5px;
}
.epi-tech-connection-group small {
  color: var(--ps-muted);
}

.epi-output-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 12px 12px;
  padding: 11px;
  border: 1px solid var(--ps-line);
  border-radius: 8px;
  background: var(--ps-panel);
}

.epi-output-toggle span,
.epi-output-toggle strong,
.epi-output-toggle small {
  display: block;
}
.epi-output-toggle strong {
  color: var(--ps-charcoal);
  font-size: 11px;
}
.epi-output-toggle small {
  margin-top: 2px;
  color: var(--ps-muted);
  font-size: 9.5px;
}
.epi-output-toggle input {
  width: 34px;
  height: 18px;
  accent-color: var(--ps-teal);
}
.epi-tech-save {
  width: calc(100% - 24px);
  justify-content: center;
  margin: 0 12px 14px;
}

.epi-tech-handoff {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--ps-line);
  border-radius: 8px;
  color: #67768a;
  background: var(--ps-panel);
  font-size: 10.5px;
}

.epi-tech-handoff strong {
  margin-right: 10px;
  color: var(--ps-charcoal);
}
.epi-tech-handoff span.active {
  color: var(--ps-orange-text);
  font-weight: 850;
}

@media (max-width: 1180px) {
  .epi-business-workspace.has-inspector {
    grid-template-columns: minmax(0, 1fr) 220px;
  }
  .epi-tech-workspace {
    grid-template-columns: 230px minmax(400px, 1fr);
    overflow: auto;
  }
  .epi-tech-workspace > .epi-tech-properties {
    grid-column: 1 / -1;
    border-top: 1px solid var(--ps-line);
    border-left: 0;
  }
}

@media (max-width: 820px) {
  .epi-business-intro {
    grid-template-columns: 1fr;
  }
  .epi-business-intro > .epi-tech-minimap {
    display: none;
  }
  .epi-business-actions {
    grid-column: 1;
    grid-row: auto;
    margin-top: 6px;
  }
  .epi-business-workspace {
    grid-template-columns: 1fr;
  }
  .epi-business-inspector {
    border-top: 1px solid var(--ps-line);
    border-left: 0;
  }
  .epi-tech-workspace {
    grid-template-columns: 1fr;
  }
  .epi-tech-nav,
  .epi-tech-workspace > .epi-tech-properties {
    border: 0;
    border-top: 1px solid var(--ps-line);
  }
  .epi-tech-handoff {
    overflow-x: auto;
    justify-content: flex-start;
  }
  .epi-tech-modal-body {
    grid-template-columns: 1fr;
    overflow: auto;
  }
  .epi-tech-modal .epi-tech-editor,
  .epi-tech-modal .epi-tech-properties {
    overflow: visible;
  }
  .epi-tech-modal .epi-tech-properties {
    border-top: 1px solid var(--ps-line);
    border-left: 0;
  }
  .epi-tech-split-editor {
    grid-template-columns: 1fr;
  }
}

/* Epi Model Builder */

/* Persistence refinement: display-only spacing and compact routing/output treatment. */
.epi-stateful-modern .epi-stateful-mode { display:grid; grid-template-columns:150px minmax(220px,340px); align-items:center; gap:12px; margin:4px 0 12px; padding:10px 12px; border:1px solid #dce8eb; border-radius:8px; background:var(--ps-panel); }
.epi-stateful-modern .epi-stateful-mode > span { color:var(--ps-charcoal); font-size:10px; font-weight:800; letter-spacing:.04em; text-transform:uppercase; }
.epi-stateful-modern .epi-stateful-mode select { height:32px; min-height:32px; }
.epi-stateful-modern .epi-lot-points > .btn { margin-top:9px; min-height:29px; padding:4px 8px; color:#475569; font-size:10.5px; }
.epi-stateful-modern .epi-lot-exit-routing { gap:7px; padding:9px 10px; border-color:#dce5e9; border-left:3px solid #e8a35d; background:var(--ps-panel); }
.epi-stateful-modern .epi-routing-method { display:flex; align-items:center; gap:10px; min-height:28px; }
.epi-stateful-modern .epi-routing-method strong { color:var(--ps-charcoal); font-size:10px; font-weight:800; letter-spacing:.04em; text-transform:uppercase; }
.epi-stateful-modern .epi-routing-method span { padding:4px 8px; border:1px solid #dce5e9; border-radius:5px; background:var(--ps-raised); color:#475569; font-size:11px; font-weight:700; }
.epi-stateful-modern .epi-lot-exit-routing .epi-stateful-curve-table { margin:0; }
.epi-stateful-modern .epi-lot-exit-routing .epi-stateful-curve-table th,.epi-stateful-modern .epi-lot-exit-routing .epi-stateful-curve-table td { padding:6px 8px; font-size:10.5px; }
.epi-stateful-modern .epi-lot-exit-routing .epi-stateful-curve-table input { height:28px; min-height:28px; }
.epi-stateful-modern .epi-lot-exit-routing .epi-lot-routing-total th,.epi-stateful-modern .epi-lot-exit-routing .epi-lot-routing-total td { border-top:1px solid var(--ps-line-strong); background:var(--ps-raised); color:var(--ps-charcoal); font-weight:800; }
.epi-stateful-modern .epi-lot-exit-routing .epi-lot-routing-total.is-valid th:last-child { color:var(--ps-green); }
.epi-stateful-modern .epi-lot-exit-routing .epi-lot-routing-total.is-invalid th:last-child { color:#b91c1c; }
.epi-stateful-modern .epi-lot-exit-routing > small { margin:0; color:var(--ps-muted); font-size:10px; }
.epi-stateful-modern .epi-generated-output-row { grid-template-columns:18px minmax(0,1fr) auto; gap:8px; min-height:32px; padding:5px 7px; border-color:#e5ecef; border-radius:5px; cursor:default; }
.epi-stateful-modern .epi-generated-output-row:hover { border-color:#e5ecef; background:var(--ps-panel); }
.epi-stateful-modern .epi-generated-output-row i { color:var(--ps-green); }
.epi-stateful-modern .epi-generated-output-row b { min-width:0; color:var(--ps-charcoal); font-size:10.5px; font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.epi-stateful-modern .epi-generated-output-row small { margin:0; color:var(--ps-muted); font-size:10px; white-space:nowrap; }
.epi-stateful-modern .epi-generated-lot-group summary { min-height:32px !important; padding:6px 9px !important; }
.epi-stateful-modern .epi-generated-lot-group > div { gap:3px; padding:0 7px 7px; }
.epi-stateful-modern .epi-generated-output-row input { width:14px; height:14px; margin:0; accent-color:var(--ps-green); cursor:pointer; }

/* ---- Forecast Flow card motion -------------------------------------------
   Position transitions are armed only while a card is held. Outside a drag the
   canvas repaints by replacing innerHTML, where a transition can never fire
   anyway, and leaving these on would make ordinary renders feel laggy. */
/* Everything that MOVES during a drag moves by transform, the one property the
   compositor animates without laying the page out again. left/top are never
   transitioned here: they relayout the canvas on every frame.

   will-change is deliberately absent — a transform transition is promoted
   automatically, and declaring it on every card would allocate a layer per card
   for the length of the drag. */
.epi-business-canvas.epi-flow-reflowing .epi-business-card {
  transition: transform 190ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* A stage never moves during a drag, but it does resize when it gains or loses
   a row, and size has no transform equivalent. Animating it is affordable only
   because a drag frame reads no geometry: with nothing forcing a synchronous
   flush, the browser folds this into its own layout phase rather than doing it
   once per rect query. At most two stages are ever in flight. */
.epi-business-canvas.epi-flow-reflowing .epi-business-stage {
  transition:
    width 190ms cubic-bezier(0.22, 1, 0.36, 1),
    height 190ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Gated on .ready so the ghost's first placement does not slide in from the
   stage's top-left corner. */
.epi-flow-slot-ghost.ready {
  transition:
    left 190ms cubic-bezier(0.22, 1, 0.36, 1),
    top 190ms cubic-bezier(0.22, 1, 0.36, 1),
    width 190ms cubic-bezier(0.22, 1, 0.36, 1),
    height 190ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* The held card is pinned to the cursor, so it must never ease. */
.epi-business-canvas.epi-flow-reflowing .epi-business-card.dragging {
  transition: none;
}

/* Wires are drawn from committed geometry and would point at stale positions
   for the length of the drag. They are dimmed rather than redrawn per frame,
   and the drop's re-render puts them back. */
.epi-business-canvas.epi-flow-reflowing .epi-business-conn-layer {
  opacity: 0.16;
  transition: opacity 140ms ease;
}

/* The destination slot. Without it the gap the other cards open around the
   airborne card reads as an accidental hole rather than a target. */
.epi-flow-slot-ghost {
  position: absolute;
  z-index: 5;
  box-sizing: border-box;
  border: 1px dashed color-mix(in srgb, var(--stage-color, #177e89) 60%, transparent);
  border-radius: 5px;
  background: color-mix(in srgb, var(--stage-color, #177e89) 8%, transparent);
  pointer-events: none;
}

/* The glide across the drop. Applied to a freshly rendered element that has
   been offset back to where the card was let go, then cleared. */
.epi-business-card.epi-flow-flip {
  z-index: 21;
  transition:
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    width 220ms cubic-bezier(0.22, 1, 0.36, 1),
    height 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
  .epi-business-canvas.epi-flow-reflowing .epi-business-card,
  .epi-business-canvas.epi-flow-reflowing .epi-business-stage,
  .epi-business-card.epi-flow-flip,
  .epi-flow-slot-ghost.ready {
    transition: none;
  }
}


/* Dark theme needs a stronger stage tint: 5-9% of a stage colour mixed into a
   dark panel is imperceptible. Light mode keeps its original 5/7/9%. */
html:not([data-theme="light"]) .epi-business-stage {
  background: color-mix(in srgb, var(--stage-color) 12%, var(--ps-mix-base));
}

html:not([data-theme="light"]) .epi-business-stage.dragging {
  background: color-mix(in srgb, var(--stage-color) 16%, var(--ps-mix-base));
}

html:not([data-theme="light"]) .epi-business-stage-head {
  background: color-mix(in srgb, var(--stage-color) 20%, var(--ps-mix-base));
}


/* Stage colour used as text. --stage-color-text is emitted alongside
   --stage-color and is already lifted to 4.5:1 on the panel by readableOn. */
html:not([data-theme="light"]) .epi-business-stage-head {
  color: var(--stage-color-text, var(--ps-charcoal));
}

html:not([data-theme="light"]) .epi-tech-flow-stage-head {
  color: var(--stage-color-text, var(--ps-charcoal));
}
