/* Grafo · Karmaşık Olay İşleme / State-machine senaryo tasarımcısı --------- */
.cep-dialog {
  --cep-bg: #050a12;
  --cep-panel: #080f19;
  --cep-panel-2: #0b1522;
  --cep-panel-3: #0e1b2a;
  --cep-canvas: #060c15;
  --cep-line: rgba(137, 163, 183, .16);
  --cep-line-strong: rgba(137, 163, 183, .27);
  --cep-text: #dce8ef;
  --cep-text-strong: #f1f7fa;
  --cep-muted: #718795;
  --cep-dim: #526a77;
  --cep-cyan: #40d8e8;
  --cep-cyan-rgb: 64, 216, 232;
  --cep-gold: #e3c45f;
  --cep-gold-rgb: 227, 196, 95;
  --cep-green: #50e39d;
  --cep-red: #ff6259;
  --cep-purple: #aa83ff;
  --cep-orange: #ff9d5c;
  position: fixed;
  z-index: 76;
  inset: 50% auto auto 50%;
  width: min(1460px, calc(100vw - 48px));
  height: min(920px, calc(100dvh - 48px));
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(var(--cep-gold-rgb), .25);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(9, 15, 25, .998), rgba(4, 8, 15, .995));
  box-shadow: 0 40px 130px rgba(0, 0, 0, .72), inset 0 1px rgba(255, 255, 255, .04);
  color: var(--cep-text);
  font-family: Manrope, Inter, "DM Sans", sans-serif;
  opacity: 0;
  transform: translate(-50%, calc(-50% + 18px)) scale(.985);
}

/* Builder navigation added for touch and keyboard parity ---------------- */
.cep-mobile-builder-tabs {
  display: none;
}

.cep-state-order {
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--cep-line);
  border-radius: 9px;
  background: rgba(var(--cep-cyan-rgb), .055);
  color: var(--cep-cyan);
}

.cep-state-order:disabled {
  cursor: not-allowed;
  opacity: .28;
}

@media (max-width: 760px) {
  .cep-mobile-builder-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    flex: 0 0 48px;
    gap: 4px;
    padding: 4px 7px;
    border-bottom: 1px solid var(--cep-line);
    background: rgba(5, 10, 18, .96);
  }

  .cep-mobile-builder-tabs button {
    min-width: 0;
    min-height: 40px;
    border: 1px solid transparent;
    border-radius: 11px;
    background: transparent;
    color: var(--cep-muted);
    font-size: 7px;
    font-weight: 850;
    letter-spacing: .1em;
  }

  .cep-mobile-builder-tabs button.active {
    border-color: rgba(var(--cep-cyan-rgb), .3);
    background: rgba(var(--cep-cyan-rgb), .1);
    color: var(--cep-cyan);
  }

  .cep-state-order {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
  }
}

.cep-dialog[open] {
  opacity: 1;
  transform: translate(-50%, -50%);
  animation: cep-dialog-in .24s cubic-bezier(.2, .8, .2, 1);
}

.cep-dialog::backdrop {
  background: rgba(2, 5, 11, .78);
  backdrop-filter: blur(9px) saturate(.82);
}

.cep-dialog,
.cep-dialog * {
  box-sizing: border-box;
}

.cep-dialog :is(button, input, select, textarea) {
  font: inherit;
}

.cep-dialog button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.cep-dialog :is(button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid rgba(var(--cep-cyan-rgb), .78);
  outline-offset: 2px;
}

.cep-dialog [hidden] {
  display: none !important;
}

.cep-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% -15%, rgba(var(--cep-cyan-rgb), .09), transparent 33%),
    radial-gradient(circle at 2% 110%, rgba(var(--cep-gold-rgb), .055), transparent 30%),
    linear-gradient(145deg, rgba(9, 15, 25, .995), rgba(4, 8, 15, .99));
}

/* Entry point in the operations tab strip -------------------------------- */
.cep-launch {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 112px;
  height: 32px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #718492;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .11em;
  white-space: nowrap;
}

.cep-launch:hover,
.cep-launch:focus-visible,
.cep-launch.active,
.cep-launch[aria-expanded="true"] {
  border-color: rgba(var(--cep-cyan-rgb), .27);
  background: rgba(var(--cep-cyan-rgb), .09);
  color: var(--cep-cyan);
}

.cep-launch > i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cep-green);
  box-shadow: 0 0 9px rgba(80, 227, 157, .72);
}

.cep-launch > b,
.cep-launch > small {
  display: grid;
  place-items: center;
  min-width: 19px;
  height: 18px;
  margin-left: 2px;
  padding: 0 5px;
  border-radius: 999px;
  background: #111d2b;
  color: #8296a4;
  font-size: 7px;
}

/* Header and view navigation --------------------------------------------- */
.cep-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 0 0 auto;
  min-height: 82px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--cep-line);
  background: linear-gradient(90deg, rgba(12, 22, 35, .98), rgba(7, 11, 19, .94));
}

.cep-head::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: -1px;
  left: 18px;
  height: 1px;
  background: linear-gradient(90deg, rgba(var(--cep-cyan-rgb), .46), rgba(var(--cep-gold-rgb), .18), transparent 74%);
}

.cep-brand-icon,
.cep-head-icon {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(var(--cep-cyan-rgb), .28);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(var(--cep-cyan-rgb), .12), rgba(var(--cep-cyan-rgb), .035));
  color: var(--cep-cyan);
  box-shadow: inset 0 1px rgba(255, 255, 255, .035), 0 0 25px rgba(var(--cep-cyan-rgb), .06);
}

.cep-brand-icon svg,
.cep-head-icon svg,
.cep-dialog button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cep-title {
  min-width: 0;
}

.cep-title > span,
.cep-eyebrow {
  display: block;
  color: var(--cep-cyan);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.cep-title h2 {
  margin: 4px 0 2px;
  color: var(--cep-text-strong);
  font-size: 19px;
  font-weight: 760;
  letter-spacing: .025em;
}

.cep-title p {
  margin: 0;
  color: var(--cep-muted);
  font-size: 8px;
  line-height: 1.45;
}

.cep-view-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 42px;
  margin-left: auto;
  padding: 4px;
  border: 1px solid var(--cep-line);
  border-radius: 13px;
  background: rgba(4, 9, 16, .62);
}

.cep-view-tabs button {
  min-width: 92px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--cep-muted);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: .11em;
}

.cep-view-tabs button:hover,
.cep-view-tabs button[aria-selected="true"],
.cep-view-tabs button.active {
  border-color: rgba(var(--cep-cyan-rgb), .22);
  background: rgba(var(--cep-cyan-rgb), .105);
  color: var(--cep-cyan);
}

.cep-head-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.cep-head-actions > button,
.cep-close,
.cep-icon-btn {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--cep-line);
  border-radius: 13px;
  background: #0a111c;
  color: #91a5b1;
}

.cep-head-actions > button:hover,
.cep-close:hover,
.cep-icon-btn:hover {
  border-color: rgba(var(--cep-cyan-rgb), .4);
  background: rgba(var(--cep-cyan-rgb), .08);
  color: var(--cep-cyan);
}

.cep-close {
  font-size: 24px;
  font-weight: 300;
  line-height: 1;
}

.cep-status-pill,
.cep-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--cep-line);
  border-radius: 999px;
  background: rgba(8, 14, 23, .78);
  color: #8da2ad;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: .09em;
  white-space: nowrap;
}

.cep-status-pill > i,
.cep-badge > i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--status-color, var(--cep-green));
  box-shadow: 0 0 8px color-mix(in srgb, var(--status-color, var(--cep-green)) 70%, transparent);
}

.cep-badge.warn { --status-color: var(--cep-gold); color: #dccb92; }
.cep-badge.danger { --status-color: var(--cep-red); color: #ff948d; }
.cep-badge.info { --status-color: var(--cep-cyan); color: #8de3eb; }

/* Shared controls --------------------------------------------------------- */
.cep-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--cep-line);
  border-radius: 11px;
  background: #0a121e;
  color: #96aab5;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .075em;
  white-space: nowrap;
}

.cep-btn:hover {
  border-color: rgba(var(--cep-cyan-rgb), .34);
  background: #0d1c29;
  color: #b9dce2;
}

.cep-btn.primary {
  border-color: rgba(var(--cep-cyan-rgb), .4);
  background: linear-gradient(135deg, #123d4b, #0b2834);
  color: var(--cep-cyan);
  box-shadow: inset 0 1px rgba(255, 255, 255, .035), 0 8px 22px rgba(0, 0, 0, .15);
}

.cep-btn.gold {
  border-color: rgba(var(--cep-gold-rgb), .36);
  background: rgba(var(--cep-gold-rgb), .1);
  color: var(--cep-gold);
}

.cep-btn.danger {
  border-color: rgba(255, 98, 89, .3);
  background: rgba(255, 98, 89, .075);
  color: #ff8b84;
}

.cep-btn:disabled,
.cep-icon-btn:disabled {
  cursor: not-allowed;
  opacity: .4;
}

.cep-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  color: #8297a3;
  font-size: 8px;
  cursor: pointer;
}

.cep-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.cep-switch > i {
  position: relative;
  flex: 0 0 34px;
  width: 34px;
  height: 20px;
  border: 1px solid var(--cep-line-strong);
  border-radius: 999px;
  background: #111c29;
  transition: .18s ease;
}

.cep-switch > i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #6b7e89;
  transition: transform .18s ease, background .18s ease;
}

.cep-switch input:checked + i {
  border-color: rgba(var(--cep-cyan-rgb), .4);
  background: rgba(var(--cep-cyan-rgb), .17);
}

.cep-switch input:checked + i::after {
  background: var(--cep-cyan);
  box-shadow: 0 0 9px rgba(var(--cep-cyan-rgb), .65);
  transform: translateX(14px);
}

.cep-switch input:focus-visible + i {
  outline: 2px solid rgba(var(--cep-cyan-rgb), .7);
  outline-offset: 2px;
}

/* Dashboard / scenario catalogue ----------------------------------------- */
.cep-scenario-view {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.cep-scenario-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 18px 10px;
}

.cep-scenario-kpis > article,
.cep-scenario-kpi {
  position: relative;
  min-width: 0;
  min-height: 70px;
  padding: 11px 13px;
  overflow: hidden;
  border: 1px solid var(--cep-line);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(15, 28, 42, .84), rgba(7, 13, 22, .76));
}

.cep-scenario-kpis > article::after,
.cep-scenario-kpi::after {
  content: "";
  position: absolute;
  right: -20px;
  bottom: -32px;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--kpi-color, var(--cep-cyan));
  filter: blur(34px);
  opacity: .15;
}

.cep-scenario-kpis :is(span, b, small),
.cep-scenario-kpi :is(span, b, small) {
  position: relative;
  z-index: 1;
  display: block;
}

.cep-scenario-kpis span,
.cep-scenario-kpi span {
  color: #718693;
  font-size: 6.5px;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.cep-scenario-kpis b,
.cep-scenario-kpi b {
  margin-top: 4px;
  color: var(--kpi-color, var(--cep-cyan));
  font-size: 22px;
  line-height: 1;
}

.cep-scenario-kpis small,
.cep-scenario-kpi small {
  margin-top: 4px;
  color: #5d7280;
  font-size: 7px;
}

.cep-scenario-kpis .active { --kpi-color: var(--cep-green); }
.cep-scenario-kpis .error { --kpi-color: var(--cep-red); }
.cep-scenario-kpis .waiting { --kpi-color: var(--cep-gold); }
.cep-scenario-kpis .sources { --kpi-color: var(--cep-purple); }

.cep-scenario-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px auto;
  gap: 9px;
  padding: 0 18px 12px;
  border-bottom: 1px solid var(--cep-line);
}

.cep-search,
.cep-scenario-toolbar > label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--cep-line);
  border-radius: 11px;
  background: #070d17;
  color: var(--cep-cyan);
}

.cep-search svg,
.cep-scenario-toolbar > label svg {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
}

.cep-search input,
.cep-scenario-toolbar > label input {
  min-width: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--cep-text);
  font-size: 9px;
}

.cep-search input::placeholder,
.cep-scenario-toolbar > label input::placeholder {
  color: #506775;
}

.cep-scenario-toolbar select {
  min-width: 0;
  height: 40px;
  padding: 0 34px 0 11px;
  border: 1px solid var(--cep-line);
  border-radius: 11px;
  background: #080f1a;
  color: #a9bbc6;
  font-size: 8px;
  font-weight: 700;
}

.cep-scenario-content {
  display: grid;
  grid-template-columns: minmax(320px, .8fr) minmax(460px, 1.2fr);
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.cep-scenario-list {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  min-height: 0;
  padding: 11px;
  overflow: auto;
  border-right: 1px solid var(--cep-line);
  background: rgba(4, 9, 16, .46);
  scrollbar-width: thin;
  scrollbar-color: #193242 transparent;
}

.cep-scenario-card {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 72px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(13, 23, 36, .88), rgba(8, 14, 23, .76));
  color: var(--cep-text);
  text-align: left;
}

.cep-scenario-card:hover {
  border-color: rgba(var(--cep-cyan-rgb), .2);
  background: #0d1a28;
}

.cep-scenario-card.active,
.cep-scenario-card[aria-selected="true"] {
  border-color: rgba(var(--cep-cyan-rgb), .38);
  background: linear-gradient(110deg, rgba(18, 63, 76, .72), rgba(10, 21, 33, .93));
  box-shadow: inset 2px 0 var(--cep-cyan);
}

.cep-scenario-glyph {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid color-mix(in srgb, var(--scenario-color, var(--cep-cyan)) 35%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--scenario-color, var(--cep-cyan)) 10%, transparent);
  color: var(--scenario-color, var(--cep-cyan));
}

.cep-scenario-card-copy {
  min-width: 0;
}

.cep-scenario-card-copy :is(b, span, small) {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cep-scenario-card-copy b {
  color: #dce7ec;
  font-size: 9px;
}

.cep-scenario-card-copy span {
  margin-top: 4px;
  color: #8da1ac;
  font-size: 7.5px;
}

.cep-scenario-card-copy small {
  margin-top: 3px;
  color: #5d7380;
  font-size: 6.5px;
}

.cep-scenario-state {
  display: grid;
  justify-items: end;
  gap: 6px;
  color: #718692;
  font-size: 6.5px;
  font-weight: 800;
}

.cep-scenario-state > i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--scenario-state, var(--cep-green));
  box-shadow: 0 0 8px color-mix(in srgb, var(--scenario-state, var(--cep-green)) 70%, transparent);
}

.cep-scenario-detail {
  min-width: 0;
  min-height: 0;
  padding: 14px 16px 18px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #193242 transparent;
}

.cep-scenario-detail-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--cep-line);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(13, 24, 37, .88), rgba(7, 13, 22, .8));
}

.cep-scenario-detail-head > div {
  min-width: 0;
}

.cep-scenario-detail-head h3 {
  margin: 4px 0 3px;
  color: var(--cep-text-strong);
  font-size: 17px;
}

.cep-scenario-detail-head p {
  margin: 0;
  color: var(--cep-muted);
  font-size: 8px;
  line-height: 1.45;
}

.cep-scenario-detail-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  margin-left: auto;
}

.cep-scenario-stats,
.cep-scenario-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin: 9px 0 0;
}

.cep-scenario-stats > div,
.cep-scenario-meta > div {
  min-height: 56px;
  padding: 9px;
  border: 1px solid var(--cep-line);
  border-radius: 10px;
  background: rgba(8, 14, 23, .66);
}

.cep-scenario-stats dt,
.cep-scenario-meta dt {
  color: #627783;
  font-size: 6px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.cep-scenario-stats dd,
.cep-scenario-meta dd {
  margin: 5px 0 0;
  color: #c1d1d8;
  font-size: 9px;
  line-height: 1.35;
}

.cep-scenario-section {
  margin-top: 9px;
  padding: 12px;
  border: 1px solid var(--cep-line);
  border-radius: 13px;
  background: rgba(7, 13, 22, .66);
}

.cep-scenario-section > header,
.cep-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.cep-scenario-section > header span,
.cep-section-head span {
  color: #7e929e;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.cep-scenario-section > header b,
.cep-section-head b {
  color: #a3b6bf;
  font-size: 8px;
}

.cep-scenario-empty {
  display: grid;
  place-items: center;
  min-height: 230px;
  padding: 28px;
  color: #647985;
  text-align: center;
}

.cep-scenario-empty b {
  display: block;
  margin-bottom: 7px;
  color: #adbec6;
  font-size: 12px;
}

.cep-scenario-empty p {
  max-width: 360px;
  margin: 0;
  font-size: 8px;
  line-height: 1.55;
}

/* Builder navigation ------------------------------------------------------ */
.cep-builder-view {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.cep-builder-head {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 54px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--cep-line);
  background: rgba(5, 10, 18, .7);
}

.cep-builder-name {
  min-width: 0;
}

.cep-builder-name b,
.cep-builder-name span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cep-builder-name b {
  color: #dfe9ee;
  font-size: 10px;
}

.cep-builder-name span {
  margin-top: 3px;
  color: #607784;
  font-size: 7px;
}

.cep-builder-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.cep-stage-strip {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 42px;
  padding: 5px 14px;
  overflow-x: auto;
  border-bottom: 1px solid var(--cep-line);
  background: #070d16;
  scrollbar-width: none;
}

.cep-stage-strip::-webkit-scrollbar {
  display: none;
}

.cep-stage-strip button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: 0 0 auto;
  min-width: 102px;
  height: 32px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #6c818e;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: .09em;
}

.cep-stage-strip button > i {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #111e2c;
  color: #738995;
  font-size: 7px;
  font-style: normal;
}

.cep-stage-strip button[aria-selected="true"],
.cep-stage-strip button.active {
  border-color: rgba(var(--cep-cyan-rgb), .23);
  background: rgba(var(--cep-cyan-rgb), .09);
  color: var(--cep-cyan);
}

.cep-stage-strip button[aria-selected="true"] > i,
.cep-stage-strip button.active > i {
  background: rgba(var(--cep-cyan-rgb), .16);
  color: var(--cep-cyan);
}

/* Three-panel state-machine workspace ------------------------------------ */
.cep-builder {
  display: grid;
  grid-template-columns: 238px minmax(440px, 1fr) 312px;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.cep-palette,
.cep-canvas,
.cep-inspector {
  min-width: 0;
  min-height: 0;
}

.cep-palette {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--cep-line);
  background: rgba(5, 10, 18, .76);
}

.cep-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 46px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--cep-line);
}

.cep-panel-head > div {
  min-width: 0;
}

.cep-panel-head h3 {
  margin: 0;
  color: #d8e4e9;
  font-size: 10px;
}

.cep-panel-head p {
  margin: 3px 0 0;
  color: #5e7481;
  font-size: 6.5px;
}

.cep-palette-scroll,
.cep-inspector-scroll {
  min-height: 0;
  padding: 9px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #1a3444 transparent;
}

.cep-palette-section + .cep-palette-section,
.cep-inspector-section + .cep-inspector-section {
  margin-top: 10px;
}

.cep-palette-section > header,
.cep-inspector-section > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 26px;
  margin-bottom: 5px;
  color: #607784;
  font-size: 6px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.cep-palette-section > header b,
.cep-inspector-section > header b {
  color: #80949e;
  font-size: 6.5px;
}

.cep-palette-items {
  display: grid;
  gap: 5px;
}

.cep-palette-item {
  --item-color: var(--cep-cyan);
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 50px;
  padding: 6px 8px;
  border: 1px solid var(--cep-line);
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(14, 25, 39, .86), rgba(8, 14, 23, .83));
  color: #aabdc6;
  text-align: left;
  cursor: grab;
}

.cep-palette-item:active {
  cursor: grabbing;
}

.cep-palette-item:hover,
.cep-palette-item:focus-visible {
  border-color: color-mix(in srgb, var(--item-color) 42%, transparent);
  background: color-mix(in srgb, var(--item-color) 8%, #0b1521);
}

.cep-palette-item.trigger { --item-color: var(--cep-cyan); }
.cep-palette-item.condition { --item-color: var(--cep-purple); }
.cep-palette-item.action { --item-color: var(--cep-gold); }
.cep-palette-item.delay { --item-color: var(--cep-orange); }

.cep-palette-glyph {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid color-mix(in srgb, var(--item-color) 35%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--item-color) 10%, transparent);
  color: var(--item-color);
}

.cep-palette-copy {
  min-width: 0;
}

.cep-palette-copy b,
.cep-palette-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cep-palette-copy b {
  color: #c8d7de;
  font-size: 8px;
}

.cep-palette-copy span {
  margin-top: 3px;
  color: #647b88;
  font-size: 6.5px;
}

.cep-palette-item > em {
  color: #4e6673;
  font-size: 15px;
  font-style: normal;
  text-align: center;
}

.cep-canvas {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--cep-canvas);
}

.cep-canvas-toolbar {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-height: 46px;
  padding: 6px 9px;
  border-bottom: 1px solid var(--cep-line);
  background: rgba(7, 13, 22, .93);
}

.cep-canvas-toolbar .cep-icon-btn {
  flex-basis: 34px;
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.cep-canvas-toolbar .cep-zoom-value {
  min-width: 45px;
  color: #728895;
  font-size: 7px;
  font-weight: 800;
  text-align: center;
}

.cep-canvas-toolbar .cep-canvas-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: #667c88;
  font-size: 7px;
}

.cep-canvas-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cep-green);
  box-shadow: 0 0 8px rgba(80, 227, 157, .65);
}

.cep-canvas-stage {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 320px;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y;
  background-color: var(--cep-canvas);
  background-image:
    linear-gradient(rgba(86, 119, 141, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(86, 119, 141, .07) 1px, transparent 1px),
    linear-gradient(rgba(86, 119, 141, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(86, 119, 141, .025) 1px, transparent 1px);
  background-size: 80px 80px, 80px 80px, 16px 16px, 16px 16px;
  box-shadow: inset 0 0 90px rgba(0, 0, 0, .2);
}

.cep-canvas-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  min-width: 900px;
  min-height: 600px;
  pointer-events: none;
  background: radial-gradient(circle at 50% 42%, rgba(var(--cep-cyan-rgb), .035), transparent 42%);
}

.cep-canvas-empty {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  max-width: 300px;
  padding: 24px;
  color: #59707d;
  text-align: center;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.cep-canvas-empty b {
  margin-bottom: 6px;
  color: #91a5b0;
  font-size: 10px;
}

.cep-canvas-empty span {
  font-size: 7px;
  line-height: 1.55;
}

.cep-edges,
.cep-edge-layer {
  position: absolute;
  z-index: 1;
  inset: 0;
  min-width: 900px;
  min-height: 600px;
  overflow: visible;
  pointer-events: none;
}

.cep-edge {
  fill: none;
  stroke: #294858;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.cep-edge.active,
.cep-edge[data-active="true"] {
  stroke: var(--cep-cyan);
  filter: drop-shadow(0 0 4px rgba(var(--cep-cyan-rgb), .55));
  stroke-dasharray: 7 6;
  animation: cep-flow .8s linear infinite;
}

.cep-edge.error {
  stroke: var(--cep-red);
}

.cep-node {
  --node-color: var(--cep-cyan);
  position: absolute;
  z-index: 2;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: 196px;
  min-height: 66px;
  padding: 9px;
  border: 1px solid color-mix(in srgb, var(--node-color) 34%, var(--cep-line));
  border-radius: 13px;
  background: linear-gradient(140deg, rgba(15, 28, 43, .98), rgba(7, 14, 23, .985));
  box-shadow: 0 12px 28px rgba(0, 0, 0, .28), inset 0 1px rgba(255, 255, 255, .035);
  color: #c4d3da;
  cursor: grab;
  user-select: none;
}

.cep-node:active,
.cep-node.dragging {
  cursor: grabbing;
}

.cep-node:hover {
  border-color: color-mix(in srgb, var(--node-color) 55%, transparent);
}

.cep-node.selected,
.cep-node[aria-selected="true"] {
  border-color: var(--node-color);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--node-color) 14%, transparent), 0 14px 36px rgba(0, 0, 0, .34);
}

.cep-node.trigger { --node-color: var(--cep-cyan); }
.cep-node.condition { --node-color: var(--cep-purple); }
.cep-node.action { --node-color: var(--cep-gold); }
.cep-node.delay { --node-color: var(--cep-orange); }
.cep-node.error { --node-color: var(--cep-red); }

.cep-node-glyph {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid color-mix(in srgb, var(--node-color) 38%, transparent);
  border-radius: 11px;
  background: color-mix(in srgb, var(--node-color) 11%, transparent);
  color: var(--node-color);
}

.cep-node-copy {
  min-width: 0;
}

.cep-node-copy :is(b, span, small) {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cep-node-copy b {
  color: #d6e2e7;
  font-size: 8px;
}

.cep-node-copy span {
  margin-top: 3px;
  color: #6f8591;
  font-size: 6.5px;
}

.cep-node-copy small {
  margin-top: 3px;
  color: var(--node-color);
  font-size: 6px;
  font-weight: 800;
  letter-spacing: .06em;
}

.cep-node-menu {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #627987;
}

.cep-node-menu:hover {
  background: rgba(var(--cep-cyan-rgb), .08);
  color: var(--cep-cyan);
}

.cep-node-port {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  padding: 0;
  border: 2px solid #08111b;
  border-radius: 50%;
  background: var(--node-color);
  box-shadow: 0 0 8px color-mix(in srgb, var(--node-color) 60%, transparent);
  transform: translateY(-50%);
}

.cep-node-port.in { left: -7px; }
.cep-node-port.out { right: -7px; }

.cep-minimap {
  position: absolute;
  z-index: 4;
  right: 12px;
  bottom: 12px;
  width: 128px;
  height: 82px;
  overflow: hidden;
  border: 1px solid var(--cep-line-strong);
  border-radius: 10px;
  background: rgba(6, 12, 21, .9);
  box-shadow: 0 10px 25px rgba(0, 0, 0, .25);
}

.cep-minimap::after {
  content: "";
  position: absolute;
  inset: 14px 22px 20px 17px;
  border: 1px solid rgba(var(--cep-cyan-rgb), .35);
  background: rgba(var(--cep-cyan-rgb), .04);
}

.cep-inspector {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-left: 1px solid var(--cep-line);
  background: rgba(6, 11, 19, .87);
}

.cep-inspector-section {
  padding: 10px;
  border: 1px solid var(--cep-line);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(13, 23, 36, .74), rgba(7, 13, 22, .7));
}

.cep-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.cep-field + .cep-field {
  margin-top: 9px;
}

.cep-field > label,
.cep-field > span,
.cep-field legend {
  color: #667d89;
  font-size: 6px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.cep-field :is(input, select, textarea),
.cep-input {
  width: 100%;
  min-width: 0;
  height: 39px;
  padding: 0 10px;
  border: 1px solid var(--cep-line);
  border-radius: 9px;
  outline: 0;
  background: #070e18;
  color: #bed0d8;
  font-size: 8px;
}

.cep-field textarea {
  height: auto;
  min-height: 74px;
  padding-top: 9px;
  resize: vertical;
}

.cep-field :is(input, select, textarea):focus,
.cep-input:focus {
  border-color: rgba(var(--cep-cyan-rgb), .48);
  box-shadow: 0 0 0 2px rgba(var(--cep-cyan-rgb), .07);
}

.cep-field :is(input, textarea)::placeholder {
  color: #4e6572;
}

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

.cep-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 36px;
  color: #8398a3;
  font-size: 7px;
  line-height: 1.4;
  cursor: pointer;
}

.cep-check input {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  accent-color: var(--cep-cyan);
}

.cep-source-list,
.cep-action-list,
.cep-condition-list {
  display: grid;
  gap: 6px;
}

.cep-source-row,
.cep-action-row,
.cep-condition-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 7px 6px 10px;
  border: 1px solid var(--cep-line);
  border-radius: 10px;
  background: #09121d;
}

.cep-source-row :is(b, span),
.cep-action-row :is(b, span),
.cep-condition-row :is(b, span) {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cep-source-row b,
.cep-action-row b,
.cep-condition-row b {
  color: #b8c9d1;
  font-size: 7.5px;
}

.cep-source-row span,
.cep-action-row span,
.cep-condition-row span {
  margin-top: 3px;
  color: #607683;
  font-size: 6px;
}

.cep-inspector-empty {
  display: grid;
  place-items: center;
  flex: 1 1 auto;
  min-height: 220px;
  padding: 24px;
  color: #607682;
  text-align: center;
}

.cep-inspector-empty b {
  display: block;
  margin-bottom: 6px;
  color: #a6b8c1;
  font-size: 10px;
}

.cep-inspector-empty span {
  font-size: 7px;
  line-height: 1.5;
}

/* Simulation console ------------------------------------------------------ */
.cep-sim-panel {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.cep-sim-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--cep-line);
  background: rgba(5, 10, 18, .7);
}

.cep-sim-toolbar > :first-child {
  min-width: 0;
}

.cep-sim-toolbar h3 {
  margin: 0;
  color: #dfe9ee;
  font-size: 10px;
}

.cep-sim-toolbar p {
  margin: 3px 0 0;
  color: #607784;
  font-size: 7px;
}

.cep-sim-toolbar-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.cep-sim-body {
  display: grid;
  grid-template-columns: minmax(300px, .72fr) minmax(420px, 1.28fr);
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.cep-sim-events {
  min-height: 0;
  padding: 10px;
  overflow: auto;
  border-right: 1px solid var(--cep-line);
  background: rgba(5, 10, 18, .65);
  scrollbar-width: thin;
  scrollbar-color: #193242 transparent;
}

.cep-sim-event {
  --event-color: var(--cep-cyan);
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 58px;
  padding: 8px;
  border: 1px solid var(--cep-line);
  border-radius: 11px;
  background: rgba(10, 18, 29, .84);
}

.cep-sim-event + .cep-sim-event {
  margin-top: 6px;
}

.cep-sim-event.matched { --event-color: var(--cep-green); }
.cep-sim-event.rejected { --event-color: var(--cep-red); }
.cep-sim-event.waiting { --event-color: var(--cep-gold); }

.cep-sim-event > i {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid color-mix(in srgb, var(--event-color) 35%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--event-color) 10%, transparent);
  color: var(--event-color);
  font-style: normal;
}

.cep-sim-event-copy {
  min-width: 0;
}

.cep-sim-event-copy :is(b, span, small) {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cep-sim-event-copy b { color: #cbd9df; font-size: 8px; }
.cep-sim-event-copy span { margin-top: 3px; color: #6c828e; font-size: 6.5px; }
.cep-sim-event-copy small { margin-top: 3px; color: var(--event-color); font-size: 6px; }

.cep-sim-event time {
  color: #5f7581;
  font-size: 6.5px;
  white-space: nowrap;
}

.cep-sim-console {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  background: #060b13;
}

.cep-sim-console-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 43px;
  padding: 7px 11px;
  border-bottom: 1px solid var(--cep-line);
  color: #7d929e;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: .1em;
}

.cep-sim-console-head > i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cep-green);
  box-shadow: 0 0 8px rgba(80, 227, 157, .65);
}

.cep-sim-console-head button {
  margin-left: auto;
}

.cep-sim-log {
  min-height: 0;
  flex: 1 1 auto;
  padding: 10px 12px 18px;
  overflow: auto;
  color: #8398a3;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 7px;
  line-height: 1.7;
  scrollbar-width: thin;
  scrollbar-color: #193242 transparent;
}

.cep-sim-log-row {
  display: grid;
  grid-template-columns: 74px 64px minmax(0, 1fr);
  gap: 9px;
  padding: 5px 7px;
  border-radius: 7px;
}

.cep-sim-log-row:hover {
  background: rgba(var(--cep-cyan-rgb), .04);
}

.cep-sim-log-row time { color: #536b78; }
.cep-sim-log-row > b { color: var(--log-color, var(--cep-cyan)); font-size: inherit; }
.cep-sim-log-row.error { --log-color: var(--cep-red); }
.cep-sim-log-row.action { --log-color: var(--cep-gold); }
.cep-sim-log-row.success { --log-color: var(--cep-green); }

.cep-sim-progress {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #172432;
}

.cep-sim-progress > i {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cep-cyan), var(--cep-green));
  box-shadow: 0 0 9px rgba(var(--cep-cyan-rgb), .48);
  transition: width .25s ease;
}

/* Footer ------------------------------------------------------------------ */
.cep-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-height: 58px;
  padding: 9px 14px max(9px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--cep-line);
  background: #070c15;
}

.cep-foot-note {
  min-width: 0;
  color: #5f7581;
  font-size: 7px;
  line-height: 1.45;
}

.cep-foot-note b {
  color: #9eb0ba;
  font-weight: 700;
}

.cep-foot-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  margin-left: auto;
}

/* Toast and confirm layers ------------------------------------------------ */
.cep-toast {
  position: absolute;
  z-index: 12;
  right: 18px;
  bottom: 72px;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: min(380px, calc(100% - 36px));
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid rgba(var(--cep-cyan-rgb), .25);
  border-radius: 12px;
  background: rgba(8, 17, 28, .96);
  box-shadow: 0 14px 38px rgba(0, 0, 0, .4);
  color: #a9bbc4;
  font-size: 8px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: .2s ease;
}

.cep-toast.show,
.cep-toast[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.cep-toast.success { border-color: rgba(80, 227, 157, .28); }
.cep-toast.error { border-color: rgba(255, 98, 89, .3); }

/* Light theme ------------------------------------------------------------- */
body.light-theme .cep-dialog {
  --cep-bg: #edf4f5;
  --cep-panel: #f5f9fa;
  --cep-panel-2: #e7f1f3;
  --cep-panel-3: #dfecee;
  --cep-canvas: #e7eff1;
  --cep-line: rgba(43, 77, 94, .14);
  --cep-line-strong: rgba(43, 77, 94, .23);
  --cep-text: #294a59;
  --cep-text-strong: #153542;
  --cep-muted: #5c7681;
  --cep-dim: #718994;
  --cep-cyan: #147d8e;
  --cep-cyan-rgb: 20, 125, 142;
  --cep-gold: #9a7614;
  --cep-gold-rgb: 154, 118, 20;
  --cep-green: #17885a;
  --cep-red: #cf443c;
  --cep-purple: #7253bb;
  --cep-orange: #bd642d;
  border-color: rgba(154, 118, 20, .25);
  background: #f4f8f9;
  box-shadow: 0 34px 100px rgba(21, 52, 64, .33), inset 0 1px rgba(255, 255, 255, .75);
}

body.light-theme .cep-dialog::backdrop {
  background: rgba(18, 44, 55, .42);
}

body.light-theme .cep-shell {
  background:
    radial-gradient(circle at 82% -12%, rgba(20, 125, 142, .08), transparent 35%),
    linear-gradient(145deg, #f7fafb, #edf4f5);
}

body.light-theme .cep-head {
  background: linear-gradient(105deg, #e7f1f3, #f6f9fa);
}

body.light-theme .cep-title h2,
body.light-theme .cep-panel-head h3,
body.light-theme .cep-builder-name b,
body.light-theme .cep-sim-toolbar h3,
body.light-theme .cep-scenario-detail-head h3,
body.light-theme .cep-scenario-empty b,
body.light-theme .cep-inspector-empty b {
  color: #173744;
}

body.light-theme .cep-brand-icon,
body.light-theme .cep-head-icon,
body.light-theme .cep-head-actions > button,
body.light-theme .cep-close,
body.light-theme .cep-icon-btn,
body.light-theme .cep-btn,
body.light-theme .cep-view-tabs,
body.light-theme .cep-status-pill,
body.light-theme .cep-badge {
  background: rgba(239, 246, 247, .94);
  color: #506d78;
}

body.light-theme .cep-view-tabs button[aria-selected="true"],
body.light-theme .cep-view-tabs button.active,
body.light-theme .cep-stage-strip button[aria-selected="true"],
body.light-theme .cep-stage-strip button.active {
  background: rgba(20, 125, 142, .1);
  color: #147d8e;
}

body.light-theme .cep-btn.primary {
  border-color: rgba(20, 125, 142, .3);
  background: linear-gradient(135deg, #d2e9ec, #e7f2f4);
  color: #147d8e;
}

body.light-theme .cep-btn.gold {
  background: rgba(154, 118, 20, .08);
}

body.light-theme .cep-scenario-kpis > article,
body.light-theme .cep-scenario-kpi,
body.light-theme .cep-scenario-card,
body.light-theme .cep-scenario-detail-head,
body.light-theme .cep-scenario-stats > div,
body.light-theme .cep-scenario-meta > div,
body.light-theme .cep-scenario-section,
body.light-theme .cep-inspector-section,
body.light-theme .cep-palette-item,
body.light-theme .cep-sim-event {
  background: linear-gradient(135deg, #e9f1f3, #f5f8f9);
}

body.light-theme .cep-scenario-card:hover,
body.light-theme .cep-scenario-card.active,
body.light-theme .cep-scenario-card[aria-selected="true"] {
  background: linear-gradient(110deg, #d7ecef, #eef5f6);
}

body.light-theme .cep-scenario-card-copy b,
body.light-theme .cep-scenario-stats dd,
body.light-theme .cep-scenario-meta dd,
body.light-theme .cep-palette-copy b,
body.light-theme .cep-node-copy b,
body.light-theme .cep-sim-event-copy b {
  color: #294a59;
}

body.light-theme .cep-search,
body.light-theme .cep-scenario-toolbar > label,
body.light-theme .cep-scenario-toolbar select,
body.light-theme .cep-field :is(input, select, textarea),
body.light-theme .cep-input,
body.light-theme .cep-source-row,
body.light-theme .cep-action-row,
body.light-theme .cep-condition-row {
  background: #f8fbfb;
  color: #294a59;
}

body.light-theme .cep-search input,
body.light-theme .cep-scenario-toolbar > label input {
  color: #294a59;
}

body.light-theme .cep-scenario-list,
body.light-theme .cep-palette,
body.light-theme .cep-inspector,
body.light-theme .cep-builder-head,
body.light-theme .cep-sim-toolbar,
body.light-theme .cep-sim-events {
  background: rgba(232, 241, 243, .75);
}

body.light-theme .cep-stage-strip,
body.light-theme .cep-canvas-toolbar,
body.light-theme .cep-foot {
  background: #eaf2f4;
}

body.light-theme .cep-canvas,
body.light-theme .cep-canvas-stage {
  background-color: #e7eff1;
}

body.light-theme .cep-canvas-stage {
  background-image:
    linear-gradient(rgba(42, 85, 101, .09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42, 85, 101, .09) 1px, transparent 1px),
    linear-gradient(rgba(42, 85, 101, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42, 85, 101, .035) 1px, transparent 1px);
}

body.light-theme .cep-node {
  background: linear-gradient(140deg, rgba(247, 251, 251, .99), rgba(228, 239, 242, .99));
  box-shadow: 0 12px 28px rgba(28, 63, 76, .15), inset 0 1px #fff;
}

body.light-theme .cep-node-port {
  border-color: #edf4f5;
}

body.light-theme .cep-minimap,
body.light-theme .cep-sim-console,
body.light-theme .cep-toast {
  background: rgba(240, 247, 248, .97);
}

body.light-theme .cep-sim-log {
  color: #496773;
}

/* Tablet ------------------------------------------------------------------ */
@media (max-width: 1100px) {
  .cep-dialog {
    width: calc(100vw - 24px);
    height: calc(100dvh - 24px);
  }

  .cep-builder {
    grid-template-columns: 210px minmax(400px, 1fr) 280px;
  }

  .cep-view-tabs button {
    min-width: 74px;
  }

  .cep-scenario-content {
    grid-template-columns: 320px minmax(420px, 1fr);
  }

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

@media (max-width: 900px) {
  .cep-title p,
  .cep-head .cep-status-pill {
    display: none;
  }

  .cep-view-tabs {
    margin-left: auto;
  }

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

  .cep-scenario-content {
    grid-template-columns: 300px minmax(380px, 1fr);
    overflow-x: auto;
  }

  .cep-builder {
    grid-template-columns: 200px minmax(520px, 1fr) 280px;
    overflow-x: auto;
  }
}

/* Mobile: full-height bottom sheet + horizontally staged builder ---------- */
@media (max-width: 760px) {
  .cep-launch {
    min-width: 44px;
    height: 44px;
    padding: 0 12px;
  }

  .cep-dialog {
    inset: max(4px, env(safe-area-inset-top)) 4px max(4px, env(safe-area-inset-bottom));
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    border-radius: 24px 24px 14px 14px;
    transform: translateY(24px);
  }

  .cep-dialog[open] {
    transform: none;
    animation: cep-sheet-in .25s cubic-bezier(.2, .8, .2, 1);
  }

  .cep-head {
    min-height: 72px;
    padding: 17px 10px 9px;
  }

  .cep-head::before {
    content: "";
    position: absolute;
    top: 7px;
    left: 50%;
    width: 42px;
    height: 4px;
    border-radius: 99px;
    background: #344654;
    transform: translateX(-50%);
  }

  .cep-head::after {
    right: 10px;
    left: 10px;
  }

  .cep-brand-icon,
  .cep-head-icon {
    display: none;
  }

  .cep-title {
    flex: 1 1 auto;
  }

  .cep-title h2 {
    max-width: 56vw;
    overflow: hidden;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .cep-view-tabs {
    order: 3;
    width: 100%;
    height: 48px;
    margin: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .cep-view-tabs::-webkit-scrollbar {
    display: none;
  }

  .cep-view-tabs button {
    flex: 1 0 auto;
    min-width: 82px;
    height: 38px;
  }

  .cep-head:has(.cep-view-tabs) {
    flex-wrap: wrap;
  }

  .cep-head-actions > :not(.cep-close),
  .cep-head-actions .cep-status-pill {
    display: none;
  }

  .cep-head-actions,
  .cep-close {
    flex-basis: 44px;
  }

  .cep-scenario-kpis {
    grid-template-columns: repeat(4, minmax(118px, 1fr));
    gap: 7px;
    padding: 9px 9px 8px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .cep-scenario-kpis::-webkit-scrollbar {
    display: none;
  }

  .cep-scenario-kpis > article,
  .cep-scenario-kpi {
    min-height: 66px;
    scroll-snap-align: start;
  }

  .cep-scenario-toolbar {
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 6px;
    padding: 0 9px 9px;
  }

  .cep-search,
  .cep-scenario-toolbar > label,
  .cep-scenario-toolbar select,
  .cep-scenario-toolbar .cep-btn {
    height: 44px;
    min-height: 44px;
  }

  .cep-scenario-toolbar select {
    min-width: 44px;
    width: 44px;
    padding: 0;
    color: transparent;
  }

  .cep-scenario-toolbar .cep-btn {
    grid-column: 1 / -1;
  }

  .cep-scenario-content {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }

  .cep-scenario-list {
    flex: 1 1 auto;
    min-height: 0;
    padding: 8px;
    border-right: 0;
  }

  .cep-scenario-card {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    min-height: 72px;
  }

  .cep-scenario-detail {
    position: absolute;
    z-index: 7;
    inset: auto 5px 5px;
    max-height: min(74dvh, 640px);
    padding: 22px 10px calc(16px + env(safe-area-inset-bottom));
    overflow: auto;
    border: 1px solid rgba(var(--cep-gold-rgb), .2);
    border-radius: 24px 24px 12px 12px;
    background: linear-gradient(145deg, rgba(10, 17, 28, .995), rgba(5, 10, 18, .995));
    box-shadow: 0 -22px 70px rgba(0, 0, 0, .54);
    transform: translateY(calc(100% + 32px));
    transition: transform .23s cubic-bezier(.2, .8, .2, 1);
  }

  .cep-scenario-detail::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 50%;
    width: 42px;
    height: 4px;
    border-radius: 99px;
    background: #344654;
    transform: translateX(-50%);
  }

  .cep-scenario-detail.open,
  .cep-scenario-detail[aria-hidden="false"] {
    transform: none;
  }

  .cep-scenario-detail-head {
    display: block;
  }

  .cep-scenario-detail-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    margin: 10px 0 0;
  }

  .cep-scenario-detail-actions .cep-btn {
    min-height: 44px;
  }

  .cep-builder-head {
    min-height: 52px;
    padding: 6px 9px;
  }

  .cep-builder-head-actions .cep-btn:not(.primary),
  .cep-builder-head .cep-status-pill {
    display: none;
  }

  .cep-builder-head-actions .cep-btn,
  .cep-builder-head-actions .cep-icon-btn {
    min-width: 44px;
    min-height: 44px;
  }

  .cep-stage-strip {
    position: relative;
    z-index: 6;
    min-height: 52px;
    padding: 4px 7px;
    scroll-snap-type: x proximity;
  }

  .cep-stage-strip button {
    min-width: 116px;
    height: 44px;
    scroll-snap-align: center;
  }

  .cep-builder {
    display: grid;
    grid-template-columns: minmax(292px, 82vw) minmax(100vw, 1fr) minmax(310px, 88vw);
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .cep-builder::-webkit-scrollbar {
    display: none;
  }

  .cep-palette,
  .cep-canvas,
  .cep-inspector {
    width: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .cep-builder[data-mobile-panel="palette"] {
    scroll-snap-type: none;
  }

  .cep-builder[data-mobile-panel="canvas"] {
    scroll-snap-type: none;
    transform: translateX(-82vw);
  }

  .cep-builder[data-mobile-panel="inspector"] {
    scroll-snap-type: none;
    transform: translateX(calc(-82vw - 100vw));
  }

  .cep-palette {
    border-right: 1px solid var(--cep-line);
  }

  .cep-palette-scroll,
  .cep-inspector-scroll {
    padding: 8px;
  }

  .cep-palette-item {
    grid-template-columns: 44px minmax(0, 1fr) 22px;
    min-height: 58px;
  }

  .cep-palette-glyph {
    width: 44px;
    height: 44px;
  }

  .cep-panel-head {
    min-height: 48px;
  }

  .cep-canvas-toolbar {
    min-height: 52px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .cep-canvas-toolbar::-webkit-scrollbar {
    display: none;
  }

  .cep-canvas-toolbar .cep-icon-btn {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
  }

  .cep-canvas-stage {
    min-height: 420px;
  }

  .cep-node {
    min-height: 68px;
  }

  .cep-node-menu,
  .cep-node-port {
    min-width: 44px;
    min-height: 44px;
  }

  .cep-node-port {
    top: 50%;
    width: 18px;
    min-width: 18px;
    height: 18px;
    min-height: 18px;
  }

  .cep-field :is(input, select),
  .cep-input,
  .cep-source-row,
  .cep-action-row,
  .cep-condition-row,
  .cep-switch,
  .cep-check {
    min-height: 44px;
  }

  .cep-check input {
    width: 20px;
    height: 20px;
  }

  .cep-sim-toolbar {
    min-height: 58px;
    padding: 7px 9px;
  }

  .cep-sim-toolbar-actions .cep-btn,
  .cep-sim-toolbar-actions .cep-icon-btn {
    min-width: 44px;
    min-height: 44px;
  }

  .cep-sim-toolbar-actions .cep-btn span {
    display: none;
  }

  .cep-sim-body {
    display: flex;
    flex-direction: column;
  }

  .cep-sim-events {
    flex: 0 0 min(36dvh, 280px);
    border-right: 0;
    border-bottom: 1px solid var(--cep-line);
  }

  .cep-sim-event {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    min-height: 64px;
  }

  .cep-sim-event > i {
    width: 44px;
    height: 44px;
  }

  .cep-sim-log {
    font-size: 7.5px;
  }

  .cep-sim-log-row {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 5px 8px;
    min-height: 44px;
  }

  .cep-sim-log-row > :last-child {
    grid-column: 1 / -1;
  }

  .cep-foot {
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
    min-height: 64px;
    padding: 7px 9px max(9px, env(safe-area-inset-bottom));
  }

  .cep-foot-note {
    display: none;
  }

  .cep-foot-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    margin: 0;
  }

  .cep-foot-actions .cep-btn {
    min-height: 46px;
  }

  .cep-toast {
    right: 9px;
    bottom: calc(70px + env(safe-area-inset-bottom));
    left: 9px;
    max-width: none;
  }

  body.light-theme .cep-head::before,
  body.light-theme .cep-scenario-detail::before {
    background: #a8bac1;
  }

  body.light-theme .cep-scenario-detail {
    background: linear-gradient(145deg, rgba(248, 251, 252, .998), rgba(235, 243, 245, .998));
  }
}

@media (max-width: 460px) {
  .cep-title > span {
    font-size: 6px;
  }

  .cep-title h2 {
    max-width: 64vw;
    font-size: 14px;
  }

  .cep-view-tabs button {
    min-width: 78px;
    padding: 0 9px;
  }

  .cep-scenario-kpis {
    grid-template-columns: repeat(4, 112px);
  }

  .cep-scenario-stats,
  .cep-scenario-meta,
  .cep-field-row {
    grid-template-columns: 1fr;
  }

  .cep-scenario-detail-actions {
    grid-template-columns: 1fr;
  }

  .cep-minimap {
    display: none;
  }
}

@media (max-height: 700px) and (min-width: 761px) {
  .cep-head {
    min-height: 68px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .cep-scenario-kpis {
    display: none;
  }

  .cep-builder-head,
  .cep-stage-strip {
    min-height: 42px;
  }

  .cep-foot {
    min-height: 50px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cep-dialog,
  .cep-dialog[open],
  .cep-scenario-card,
  .cep-node,
  .cep-edge,
  .cep-sim-progress > i,
  .cep-toast,
  .cep-switch > i,
  .cep-switch > i::after,
  .cep-scenario-detail,
  .cep-builder {
    scroll-behavior: auto;
    animation: none !important;
    transition: none !important;
  }
}

@keyframes cep-dialog-in {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 16px)) scale(.985); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

@keyframes cep-sheet-in {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}

@keyframes cep-flow {
  to { stroke-dashoffset: -13; }
}

/* Runtime markup compatibility --------------------------------------------
   The event-processing runtime deliberately keeps its HTML compact. These
   rules map that production markup onto the richer component primitives
   above without making layout dependent on generated wrapper elements. */
.cep-content {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.cep-content[data-view="dashboard"] {
  overflow: hidden;
}

.cep-content[data-view="builder"] {
  overflow: hidden;
}

.cep-adapter,
.cep-engine-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--cep-line);
  border-radius: 999px;
  background: rgba(8, 14, 23, .78);
  color: #8398a3;
  font-size: 6.5px;
  font-weight: 800;
  letter-spacing: .1em;
  white-space: nowrap;
}

.cep-adapter > i,
.cep-engine-state > i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.cep-adapter > i {
  background: var(--cep-gold);
  box-shadow: 0 0 8px rgba(var(--cep-gold-rgb), .65);
}

.cep-engine-state > i {
  background: var(--cep-green);
  box-shadow: 0 0 8px rgba(80, 227, 157, .65);
}

/* Dashboard markup */
.cep-scenario-kpis > article {
  --kpi-color: var(--kpi, var(--cep-cyan));
}

.cep-scenario-workspace {
  display: grid;
  grid-template-columns: minmax(300px, 350px) minmax(0, 1fr);
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.cep-scenario-list-pane {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--cep-line);
  background: rgba(4, 9, 16, .46);
}

.cep-scenario-list-pane > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: 0 0 auto;
  min-height: 40px;
  padding: 8px 11px 6px;
  color: #6d828e;
  font-size: 6.5px;
  font-weight: 800;
  letter-spacing: .14em;
}

.cep-scenario-list-pane > header b {
  color: #9bafb9;
  font-size: 7px;
  letter-spacing: 0;
}

.cep-scenario-list-pane .cep-scenario-list {
  flex: 1 1 auto;
  border-right: 0;
  background: transparent;
}

.cep-scenario-card {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "status mode"
    "name name"
    "meta meta";
  gap: 5px 9px;
  min-height: 88px;
  padding: 10px 11px;
}

.cep-scenario-card > .cep-status {
  grid-area: status;
  justify-self: start;
}

.cep-scenario-card > b {
  grid-area: name;
  min-width: 0;
  overflow: hidden;
  color: #dce7ec;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cep-scenario-card > small {
  grid-area: meta;
  min-width: 0;
  overflow: hidden;
  color: #627884;
  font-size: 6.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cep-scenario-card > em {
  grid-area: mode;
  align-self: center;
  color: #6e8490;
  font-size: 6px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: .08em;
}

.cep-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 22px;
  padding: 0 7px;
  border: 1px solid color-mix(in srgb, var(--status, var(--cep-cyan)) 28%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--status, var(--cep-cyan)) 8%, transparent);
  color: color-mix(in srgb, var(--status, var(--cep-cyan)) 84%, white);
  font-size: 6px;
  font-weight: 800;
  letter-spacing: .07em;
  white-space: nowrap;
}

.cep-status > i {
  flex: 0 0 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--status, var(--cep-cyan));
  box-shadow: 0 0 7px color-mix(in srgb, var(--status, var(--cep-cyan)) 65%, transparent);
}

.cep-empty {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 170px;
  padding: 24px;
  color: #607682;
  text-align: center;
}

.cep-empty > b,
.cep-empty > span {
  display: block;
}

.cep-empty > b {
  margin-bottom: 6px;
  color: #a7b9c2;
  font-size: 10px;
}

.cep-empty > span {
  max-width: 340px;
  font-size: 7px;
  line-height: 1.5;
}

.cep-empty > .cep-btn {
  margin-top: 12px;
}

.cep-scenario-workspace > .cep-scenario-detail {
  position: static;
  min-width: 0;
  min-height: 0;
  max-height: none;
  padding: 14px 16px 18px;
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
  scrollbar-width: thin;
  scrollbar-color: #193242 transparent;
}

.cep-scenario-workspace > .cep-scenario-detail::before {
  display: none;
}

.cep-detail-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 13px;
  border: 1px solid var(--cep-line);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(13, 24, 37, .88), rgba(7, 13, 22, .8));
}

.cep-detail-head > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
}

.cep-detail-head h3 {
  margin: 6px 0 3px;
  color: var(--cep-text-strong);
  font-size: 17px;
}

.cep-detail-head p {
  margin: 0;
  color: var(--cep-muted);
  font-size: 8px;
  line-height: 1.5;
}

.cep-detail-head > div:last-child {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
}

.cep-health {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  margin-top: 9px;
  padding: 8px 11px;
  border: 1px solid rgba(80, 227, 157, .2);
  border-radius: 11px;
  background: rgba(80, 227, 157, .055);
}

.cep-health > span {
  color: var(--cep-green);
  font-size: 6.5px;
  font-weight: 800;
  letter-spacing: .08em;
  white-space: nowrap;
}

.cep-health > b {
  min-width: 0;
  overflow: hidden;
  color: #a9c9bc;
  font-size: 7.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cep-health > small {
  color: #607a70;
  font-size: 6.5px;
  white-space: nowrap;
}

.cep-health.error {
  border-color: rgba(255, 98, 89, .24);
  background: rgba(255, 98, 89, .06);
}

.cep-health.error > span { color: var(--cep-red); }
.cep-health.error > b { color: #d29a97; }

.cep-flow-preview {
  margin-top: 9px;
  padding: 11px;
  overflow: hidden;
  border: 1px solid var(--cep-line);
  border-radius: 13px;
  background: rgba(7, 13, 22, .66);
}

.cep-flow-preview > header,
.cep-sources > header,
.cep-sim-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 24px;
  margin-bottom: 8px;
  color: #718692;
  font-size: 6.5px;
  font-weight: 800;
  letter-spacing: .13em;
}

.cep-flow-preview > header b,
.cep-sources > header b,
.cep-sim-panel > header b,
.cep-sim-panel > header small {
  color: #9cb0ba;
  font-size: 7px;
  letter-spacing: 0;
}

.cep-flow-preview .cep-stage-strip,
.cep-canvas-stage .cep-stage-strip {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: max-content;
  min-width: 100%;
  min-height: 0;
  padding: 8px;
  overflow: visible;
  border: 0;
  background: transparent;
}

.cep-flow-preview .cep-stage-strip {
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #193242 transparent;
}

.cep-stage-strip > .cep-edge {
  display: grid;
  place-items: center;
  flex: 0 0 20px;
  min-width: 20px;
  color: #3b5a69;
  font-size: 16px;
  stroke: none;
  animation: none;
}

.cep-flow-preview .cep-node,
.cep-canvas-stage .cep-node {
  position: relative;
  inset: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex: 0 0 178px;
  width: 178px;
  min-width: 178px;
  min-height: 78px;
  flex-direction: column;
  gap: 2px;
  padding: 10px 11px;
  text-align: left;
  transform: none;
}

.cep-flow-preview .cep-node.start,
.cep-flow-preview .cep-node.end,
.cep-canvas-stage .cep-node.start,
.cep-canvas-stage .cep-node.end {
  flex-basis: 116px;
  width: 116px;
  min-width: 116px;
  border-style: dashed;
  cursor: default;
}

.cep-stage-strip > .cep-node > small,
.cep-stage-strip > .cep-node > b,
.cep-stage-strip > .cep-node > span,
.cep-stage-strip > .cep-node > em {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cep-stage-strip > .cep-node > small {
  color: var(--node-color, var(--cep-cyan));
  font-size: 6px;
  font-weight: 800;
  letter-spacing: .09em;
}

.cep-stage-strip > .cep-node > b {
  margin-top: 3px;
  color: #d6e2e7;
  font-size: 8px;
}

.cep-stage-strip > .cep-node > span {
  margin-top: 2px;
  color: #738995;
  font-size: 6.5px;
}

.cep-stage-strip > .cep-node > em {
  margin-top: 2px;
  color: #5c7481;
  font-size: 6px;
  font-style: normal;
}

.cep-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 9px;
}

.cep-detail-grid > section {
  min-width: 0;
  min-height: 86px;
  padding: 11px;
  border: 1px solid var(--cep-line);
  border-radius: 12px;
  background: rgba(8, 14, 23, .66);
}

.cep-detail-grid > section > span,
.cep-detail-grid > section > b,
.cep-detail-grid > section > small {
  display: block;
}

.cep-detail-grid > section > span {
  color: #687f8b;
  font-size: 6px;
  font-weight: 800;
  letter-spacing: .12em;
}

.cep-detail-grid > section > b {
  margin-top: 7px;
  color: #beced5;
  font-size: 8px;
}

.cep-detail-grid > section > small {
  margin-top: 4px;
  color: #617783;
  font-size: 6.5px;
  line-height: 1.4;
}

.cep-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.cep-chip-list > b {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid rgba(var(--cep-cyan-rgb), .18);
  border-radius: 999px;
  background: rgba(var(--cep-cyan-rgb), .055);
  color: #99cfd5;
  font-size: 6.5px;
}

.cep-chip-list > b > small {
  color: #607985;
  font-size: 5.5px;
}

.cep-record-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--cep-line);
}

/* Builder markup */
.cep-content > .cep-builder {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.cep-builder-grid {
  display: grid;
  grid-template-columns: 238px minmax(440px, 1fr) 320px;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.cep-builder-head {
  flex: 0 0 auto;
}

.cep-builder-head > label {
  display: grid;
  gap: 4px;
  min-width: 130px;
}

.cep-builder-head > label:nth-of-type(1) {
  flex: 1 1 240px;
  max-width: 390px;
}

.cep-builder-head > label > span,
.cep-canvas-toolbar > label > span {
  color: #637985;
  font-size: 5.5px;
  font-weight: 800;
  letter-spacing: .11em;
}

.cep-builder-head > label :is(input, select),
.cep-canvas-toolbar > label select {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 9px;
  border: 1px solid var(--cep-line);
  border-radius: 9px;
  outline: 0;
  background: #070e18;
  color: #b8cbd3;
  font-size: 8px;
}

.cep-builder-head > label :is(input, select):focus,
.cep-canvas-toolbar > label select:focus {
  border-color: rgba(var(--cep-cyan-rgb), .46);
  box-shadow: 0 0 0 2px rgba(var(--cep-cyan-rgb), .07);
}

.cep-validation {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--cep-line);
  border-radius: 999px;
  color: #7b909c;
  font-size: 6.5px;
  font-weight: 800;
  white-space: nowrap;
}

.cep-validation.valid {
  border-color: rgba(80, 227, 157, .22);
  background: rgba(80, 227, 157, .06);
  color: var(--cep-green);
}

.cep-validation.error {
  border-color: rgba(255, 98, 89, .25);
  background: rgba(255, 98, 89, .06);
  color: #ff8b84;
}

.cep-builder-grid > .cep-palette,
.cep-builder-grid > .cep-inspector {
  display: block;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #193242 transparent;
}

.cep-builder-grid > .cep-palette > header,
.cep-builder-grid > .cep-inspector > header {
  position: sticky;
  z-index: 3;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 46px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--cep-line);
  background: rgba(7, 13, 22, .97);
  color: #6b818d;
  font-size: 6px;
  font-weight: 800;
  letter-spacing: .12em;
}

.cep-builder-grid > .cep-inspector > header {
  display: flex;
  align-items: center;
  gap: 5px;
}

.cep-builder-grid > .cep-inspector > header > b {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: #aebfc7;
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cep-builder-grid > .cep-inspector > header > button,
.cep-action-editor > header > button,
.cep-custom-source > button,
.cep-sources > div > span > button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--cep-line);
  border-radius: 9px;
  background: #09111c;
  color: #758b97;
}

.cep-builder-grid > .cep-inspector > header > button:hover,
.cep-action-editor > header > button:hover,
.cep-sources > div > span > button:hover {
  border-color: rgba(255, 98, 89, .28);
  background: rgba(255, 98, 89, .07);
  color: #ff8b84;
}

.cep-palette-section,
.cep-builder-grid > .cep-inspector > .cep-inspector-section {
  margin: 9px;
  padding: 10px;
}

.cep-palette-section {
  border: 1px solid var(--cep-line);
  border-radius: 12px;
  background: rgba(8, 14, 23, .58);
}

.cep-palette-section > h3,
.cep-inspector-section > h3 {
  margin: 0 0 8px;
  color: #687f8b;
  font-size: 6px;
  font-weight: 800;
  letter-spacing: .14em;
}

.cep-palette-section > .cep-palette-item + .cep-palette-item {
  margin-top: 5px;
}

.cep-palette-section > .cep-palette-item {
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-areas:
    "glyph title"
    "glyph meta";
}

.cep-palette-section > .cep-palette-item > i {
  display: grid;
  grid-area: glyph;
  place-items: center;
  align-self: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(var(--cep-cyan-rgb), .24);
  border-radius: 9px;
  background: rgba(var(--cep-cyan-rgb), .07);
  color: var(--cep-cyan);
  font-size: 14px;
  font-style: normal;
}

.cep-palette-section > .cep-palette-item > b {
  grid-area: title;
  align-self: end;
  min-width: 0;
  overflow: hidden;
  color: #c7d6dc;
  font-size: 7.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cep-palette-section > .cep-palette-item > small {
  grid-area: meta;
  align-self: start;
  min-width: 0;
  overflow: hidden;
  color: #607783;
  font-size: 6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cep-palette-section > .cep-palette-item.compact {
  min-height: 44px;
}

.cep-palette-section > .cep-palette-item.added {
  border-color: rgba(80, 227, 157, .26);
  background: rgba(80, 227, 157, .055);
}

.cep-palette-section > .cep-palette-item.added > i {
  border-color: rgba(80, 227, 157, .28);
  background: rgba(80, 227, 157, .08);
  color: var(--cep-green);
}

.cep-custom-source {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 5px;
  margin-top: 7px;
}

.cep-custom-source > span {
  grid-column: 1 / -1;
  color: #637985;
  font-size: 5.5px;
  font-weight: 800;
  letter-spacing: .1em;
}

.cep-custom-source > input {
  min-width: 0;
  height: 34px;
  padding: 0 9px;
  border: 1px solid var(--cep-line);
  border-radius: 9px;
  outline: 0;
  background: #070e18;
  color: #bed0d8;
  font-size: 7.5px;
}

.cep-builder-grid > .cep-canvas {
  min-width: 0;
  min-height: 0;
}

.cep-canvas-toolbar > div {
  min-width: 0;
  margin-right: auto;
}

.cep-canvas-toolbar > div > span,
.cep-canvas-toolbar > div > b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cep-canvas-toolbar > div > span {
  color: #718793;
  font-size: 6px;
  font-weight: 800;
  letter-spacing: .12em;
}

.cep-canvas-toolbar > div > b {
  margin-top: 3px;
  color: #acbec6;
  font-size: 7px;
}

.cep-canvas-toolbar > label:not(.cep-live-edit) {
  display: grid;
  gap: 3px;
  flex: 0 0 150px;
}

.cep-live-edit,
.cep-mock {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  color: #7b909c;
  font-size: 6px;
  font-weight: 800;
  cursor: pointer;
}

.cep-live-edit > input,
.cep-mock > input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.cep-live-edit > i,
.cep-mock > i {
  position: relative;
  flex: 0 0 32px;
  width: 32px;
  height: 19px;
  border: 1px solid var(--cep-line-strong);
  border-radius: 999px;
  background: #111c29;
}

.cep-live-edit > i::after,
.cep-mock > i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #6b7e89;
  transition: transform .18s ease, background .18s ease;
}

.cep-live-edit > input:checked + i,
.cep-mock > input:checked + i {
  border-color: rgba(var(--cep-cyan-rgb), .4);
  background: rgba(var(--cep-cyan-rgb), .17);
}

.cep-live-edit > input:checked + i::after,
.cep-mock > input:checked + i::after {
  background: var(--cep-cyan);
  box-shadow: 0 0 8px rgba(var(--cep-cyan-rgb), .6);
  transform: translateX(13px);
}

.cep-live-edit > input:focus-visible + i,
.cep-mock > input:focus-visible + i {
  outline: 2px solid rgba(var(--cep-cyan-rgb), .7);
  outline-offset: 2px;
}

.cep-canvas-stage {
  display: block;
  padding: 0;
}

.cep-canvas-stage > .cep-stage-strip {
  margin: clamp(42px, 10vh, 86px) 24px 36px;
}

.cep-canvas-empty.has-states {
  display: none;
}

.cep-sources {
  flex: 0 0 auto;
  min-width: 0;
  padding: 8px 10px;
  border-top: 1px solid var(--cep-line);
  background: rgba(7, 13, 22, .92);
}

.cep-sources > header {
  min-height: 18px;
  margin-bottom: 6px;
}

.cep-sources > div {
  display: flex;
  gap: 6px;
  padding-bottom: 1px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #193242 transparent;
}

.cep-sources > div > span {
  display: grid;
  grid-template-columns: 7px auto 28px;
  grid-template-areas:
    "dot name close"
    "dot type close";
  align-items: center;
  gap: 1px 7px;
  flex: 0 0 auto;
  min-width: 128px;
  min-height: 42px;
  padding: 5px 5px 5px 9px;
  border: 1px solid var(--cep-line);
  border-radius: 10px;
  background: #09121d;
}

.cep-sources > div > span > i {
  grid-area: dot;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cep-green);
  box-shadow: 0 0 7px rgba(80, 227, 157, .6);
}

.cep-sources > div > span > b {
  grid-area: name;
  color: #b9cad2;
  font-size: 7px;
}

.cep-sources > div > span > small {
  grid-area: type;
  color: #607783;
  font-size: 5.5px;
}

.cep-sources > div > span > button {
  grid-area: close;
  width: 28px;
  height: 28px;
}

.cep-builder-grid > .cep-inspector > .cep-empty {
  min-height: 100%;
}

.cep-action-editor {
  padding: 8px;
  border: 1px solid var(--cep-line);
  border-radius: 11px;
  background: #09121d;
}

.cep-action-editor + .cep-action-editor {
  margin-top: 7px;
}

.cep-action-editor > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  margin: -3px 0 6px;
  color: #718793;
  font-size: 6px;
  font-weight: 800;
  letter-spacing: .1em;
}

.cep-action-editor > header > button {
  width: 30px;
  height: 30px;
}

.cep-action-editor .cep-field-row {
  gap: 6px;
}

.cep-action-editor .cep-field + .cep-field,
.cep-action-editor .cep-field-row + .cep-field-row,
.cep-action-editor .cep-field + .cep-field-row,
.cep-action-editor .cep-field-row + .cep-field,
.cep-action-editor .cep-mock {
  margin-top: 7px;
}

.cep-inspector-section > .cep-btn.add {
  width: 100%;
  min-height: 38px;
  margin-top: 8px;
  border-style: dashed;
}

/* The simulation is an expandable tray within the canvas, not a full view. */
.cep-canvas > .cep-sim-panel {
  flex: 0 1 190px;
  min-height: 112px;
  max-height: 190px;
  border-top: 1px solid rgba(var(--cep-gold-rgb), .2);
  background: rgba(6, 11, 19, .98);
}

.cep-canvas > .cep-sim-panel > header {
  flex: 0 0 auto;
  min-height: 38px;
  margin: 0;
  padding: 7px 10px;
  border-bottom: 1px solid var(--cep-line);
}

.cep-canvas > .cep-sim-panel > header > div {
  min-width: 0;
}

.cep-canvas > .cep-sim-panel > header span,
.cep-canvas > .cep-sim-panel > header b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cep-canvas > .cep-sim-panel > header span {
  color: var(--cep-gold);
  font-size: 6px;
}

.cep-canvas > .cep-sim-panel > header b {
  margin-top: 3px;
}

.cep-canvas > .cep-sim-panel .cep-sim-log {
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 7px 9px 10px;
  overflow: auto;
  font-family: inherit;
}

.cep-canvas > .cep-sim-panel .cep-sim-event {
  min-height: 50px;
}

.cep-canvas > .cep-sim-panel .cep-sim-event + .cep-sim-event {
  margin-top: 0;
}

.cep-canvas > .cep-sim-panel .cep-sim-event > div {
  min-width: 0;
}

.cep-canvas > .cep-sim-panel .cep-sim-event > div > b,
.cep-canvas > .cep-sim-panel .cep-sim-event > div > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cep-canvas > .cep-sim-panel .cep-sim-event > div > b {
  color: #cbd9df;
  font-size: 7.5px;
}

.cep-canvas > .cep-sim-panel .cep-sim-event > div > span {
  margin-top: 3px;
  color: #6c828e;
  font-size: 6px;
}

.cep-canvas > .cep-sim-panel .cep-sim-event > i {
  font-size: 7px;
}

.cep-canvas > .cep-sim-panel .cep-sim-event > time {
  font-size: 6px;
}

/* Runtime footer */
.cep-foot > span {
  min-width: 0;
  overflow: hidden;
  color: #8398a3;
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cep-foot > span[data-tone="success"] { color: var(--cep-green); }
.cep-foot > span[data-tone="error"] { color: #ff8b84; }

.cep-foot > small {
  margin-left: auto;
  color: #526a77;
  font-size: 6px;
  text-align: right;
}

/* Runtime compatibility · light theme */
body.light-theme .cep-adapter,
body.light-theme .cep-engine-state,
body.light-theme .cep-builder-head > label :is(input, select),
body.light-theme .cep-canvas-toolbar > label select,
body.light-theme .cep-custom-source > input,
body.light-theme .cep-builder-grid > .cep-inspector > header > button,
body.light-theme .cep-action-editor > header > button,
body.light-theme .cep-custom-source > button,
body.light-theme .cep-sources > div > span > button {
  background: #f4f9fa;
  color: #506d78;
}

body.light-theme .cep-scenario-list-pane,
body.light-theme .cep-builder-grid > .cep-palette,
body.light-theme .cep-builder-grid > .cep-inspector {
  background: rgba(232, 241, 243, .72);
}

body.light-theme .cep-builder-grid > .cep-palette > header,
body.light-theme .cep-builder-grid > .cep-inspector > header,
body.light-theme .cep-sources,
body.light-theme .cep-canvas > .cep-sim-panel {
  background: rgba(239, 246, 247, .98);
}

body.light-theme .cep-detail-head,
body.light-theme .cep-flow-preview,
body.light-theme .cep-detail-grid > section,
body.light-theme .cep-palette-section,
body.light-theme .cep-action-editor,
body.light-theme .cep-sources > div > span {
  background: linear-gradient(135deg, #e9f1f3, #f5f8f9);
}

body.light-theme .cep-scenario-card > b,
body.light-theme .cep-detail-head h3,
body.light-theme .cep-detail-grid > section > b,
body.light-theme .cep-palette-section > .cep-palette-item > b,
body.light-theme .cep-stage-strip > .cep-node > b,
body.light-theme .cep-canvas > .cep-sim-panel .cep-sim-event > div > b {
  color: #294a59;
}

body.light-theme .cep-live-edit > i,
body.light-theme .cep-mock > i {
  background: #d9e7ea;
}

/* Runtime compatibility · responsive */
@media (max-width: 1100px) {
  .cep-builder-grid {
    grid-template-columns: 210px minmax(420px, 1fr) 285px;
  }

  .cep-scenario-workspace {
    grid-template-columns: 310px minmax(0, 1fr);
  }

  .cep-builder-head > label:nth-of-type(1) {
    max-width: 260px;
  }
}

@media (max-width: 900px) and (min-width: 761px) {
  .cep-builder-grid {
    grid-template-columns: 200px minmax(520px, 1fr) 280px;
    overflow-x: auto;
  }

  .cep-scenario-workspace {
    grid-template-columns: 290px minmax(420px, 1fr);
    overflow-x: auto;
  }

  .cep-builder-head {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .cep-builder-head > * {
    flex: 0 0 auto;
  }
}

@media (max-width: 760px) {
  .cep-content {
    min-height: 0;
  }

  .cep-content[data-view="dashboard"] {
    display: block;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .cep-adapter,
  .cep-engine-state {
    display: none;
  }

  .cep-scenario-toolbar {
    position: sticky;
    z-index: 4;
    top: 0;
    grid-template-columns: minmax(0, 1fr) 112px;
    padding-top: 7px;
    background: rgba(7, 12, 21, .97);
  }

  .cep-scenario-toolbar select {
    width: 112px;
    min-width: 112px;
    padding: 0 28px 0 9px;
    color: #a9bbc6;
  }

  .cep-scenario-toolbar .cep-btn {
    grid-column: 1 / -1;
  }

  .cep-scenario-workspace {
    display: flex;
    min-height: auto;
    flex-direction: column;
    overflow: visible;
  }

  .cep-scenario-list-pane {
    flex: 0 0 auto;
    max-height: min(40dvh, 360px);
    overflow: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--cep-line);
  }

  .cep-scenario-list-pane .cep-scenario-list {
    min-height: 170px;
    overflow: auto;
  }

  .cep-scenario-workspace > .cep-scenario-detail {
    position: static;
    inset: auto;
    display: block;
    flex: 0 0 auto;
    min-height: 420px;
    max-height: none;
    padding: 10px 9px calc(18px + env(safe-area-inset-bottom));
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transform: none;
    transition: none;
  }

  .cep-scenario-workspace > .cep-scenario-detail::before {
    display: none;
  }

  .cep-detail-head {
    display: block;
  }

  .cep-detail-head > div:last-child {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 10px;
  }

  .cep-detail-head .cep-btn,
  .cep-record-actions .cep-btn {
    min-height: 44px;
  }

  .cep-health {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .cep-health > span {
    grid-column: 1 / -1;
  }

  .cep-health > b {
    white-space: normal;
  }

  .cep-flow-preview .cep-node,
  .cep-canvas-stage .cep-node {
    flex-basis: 166px;
    width: 166px;
    min-width: 166px;
  }

  .cep-record-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .cep-content > .cep-builder {
    display: flex;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
  }

  .cep-builder-head {
    display: flex;
    flex: 0 0 auto;
    min-height: 60px;
    padding: 7px 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .cep-builder-head::-webkit-scrollbar {
    display: none;
  }

  .cep-builder-head > * {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .cep-builder-head > label {
    min-width: 150px;
  }

  .cep-builder-head > label:nth-of-type(1) {
    flex-basis: 210px;
    max-width: none;
  }

  .cep-builder-head > label :is(input, select),
  .cep-canvas-toolbar > label select {
    height: 44px;
  }

  .cep-validation {
    min-height: 44px;
  }

  .cep-builder-grid {
    display: grid;
    grid-template-columns: repeat(3, 100%);
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .cep-builder-grid::-webkit-scrollbar {
    display: none;
  }

  .cep-builder-grid > .cep-palette,
  .cep-builder-grid > .cep-canvas,
  .cep-builder-grid > .cep-inspector {
    width: 100%;
    min-height: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .cep-builder-grid > .cep-palette,
  .cep-builder-grid > .cep-inspector {
    overflow-y: auto;
  }

  .cep-builder-grid > .cep-palette > header,
  .cep-builder-grid > .cep-inspector > header {
    min-height: 52px;
  }

  .cep-palette-section > .cep-palette-item,
  .cep-palette-section > .cep-palette-item.compact {
    min-height: 56px;
  }

  .cep-palette-section > .cep-palette-item > i {
    width: 44px;
    height: 44px;
  }

  .cep-palette-section > .cep-palette-item {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .cep-custom-source {
    grid-template-columns: minmax(0, 1fr) 44px;
  }

  .cep-custom-source > input,
  .cep-custom-source > button,
  .cep-builder-grid > .cep-inspector > header > button,
  .cep-action-editor > header > button,
  .cep-sources > div > span > button,
  .cep-inspector-section > .cep-btn.add {
    min-width: 44px;
    width: auto;
    min-height: 44px;
    height: 44px;
  }

  .cep-canvas-toolbar {
    align-items: center;
    gap: 8px;
    min-height: 58px;
    overflow-x: auto;
  }

  .cep-canvas-toolbar > div {
    flex: 0 0 178px;
  }

  .cep-canvas-toolbar > label:not(.cep-live-edit) {
    flex-basis: 150px;
  }

  .cep-live-edit,
  .cep-mock {
    min-height: 44px;
  }

  .cep-canvas-stage {
    min-height: 330px;
  }

  .cep-canvas-stage > .cep-stage-strip {
    margin: 42px 18px 28px;
  }

  .cep-sources {
    padding-right: 8px;
    padding-left: 8px;
  }

  .cep-sources > div > span {
    min-height: 50px;
  }

  .cep-canvas > .cep-sim-panel {
    flex-basis: 210px;
    max-height: 210px;
  }

  .cep-canvas > .cep-sim-panel .cep-sim-event {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    min-height: 58px;
  }

  .cep-canvas > .cep-sim-panel .cep-sim-event > i {
    width: 44px;
    height: 44px;
  }

  .cep-action-editor {
    padding: 9px;
  }

  .cep-field :is(input, select),
  .cep-action-editor .cep-mock {
    min-height: 44px;
  }

  .cep-foot {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-height: 48px;
    padding: 7px 10px max(7px, env(safe-area-inset-bottom));
  }

  .cep-foot > small {
    display: none;
  }

  .cep-foot > span {
    text-align: center;
  }
}

@media (max-width: 460px) {
  .cep-scenario-toolbar {
    grid-template-columns: minmax(0, 1fr) 104px;
  }

  .cep-scenario-toolbar select {
    width: 104px;
    min-width: 104px;
  }

  .cep-detail-grid {
    grid-template-columns: 1fr;
  }

  .cep-detail-head > div:last-child,
  .cep-record-actions {
    grid-template-columns: 1fr;
  }

  .cep-record-actions .cep-btn {
    width: 100%;
  }

  .cep-health {
    grid-template-columns: 1fr;
  }

  .cep-health > small {
    white-space: normal;
  }

  .cep-builder-grid {
    grid-template-columns: repeat(3, 100%);
  }

  .cep-canvas-toolbar > .cep-live-edit > span {
    display: none;
  }

  .cep-field-row {
    grid-template-columns: 1fr;
  }
}
