/* FlowKit — generic left-sources → center-process → right-outcomes stage */

:root {
  --fk-page-bg: #050408;
  --fk-stage-bg: #0c0b12;
  --fk-stage-border: #1c1b26;
  --fk-text: #e6e4ee;
  --fk-text-dim: #8b8a98;
  --fk-text-faint: #55545f;
  --fk-wire: #2b2a36;
  --fk-panel: #14131c;
  --fk-panel-border: #232230;
  --fk-accent: #a78bfa;
  --fk-amber: #f0a832;
  --fk-font: 'Poppins', 'Segoe UI', system-ui, sans-serif;
}

.fk-root, .fk-root *, .fk-root *::before, .fk-root *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* the root is the "page" a stage lives on: let it fill the viewport for a
 * full-screen app, or give it a fixed size and let FlowKit.embed() scale it */
.fk-root {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--fk-page-bg);
  font-family: var(--fk-font);
  color: var(--fk-text);
  overflow: hidden;
  transform-origin: 0 0;
}
.fk-embed { position: relative; width: 100%; overflow: hidden; border-radius: 18px; }
.fk-out { font-family: inherit; text-align: left; color: inherit; cursor: pointer; }
.fk-root button:focus-visible { outline: 2px solid var(--fk-accent); outline-offset: 4px; }
.fk-paused *, .fk-paused *::before, .fk-paused *::after { animation-play-state: paused !important; }
.fk-stop[aria-pressed="true"] .sq { border-radius: 0; background: transparent; width: 0; height: 0; border-top: 7px solid transparent; border-bottom: 7px solid transparent; border-left: 10px solid #cfcdd9; }
@media (prefers-reduced-motion: reduce) { .fk-root *, .fk-root *::before, .fk-root *::after { animation: none !important; transition: none !important; } }

/* soft purple/pink corner glows on the page, outside the stage */
.fk-root::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(520px 300px at -2% -4%, rgba(219, 39, 119, 0.16), transparent 65%),
    radial-gradient(620px 340px at 102% -6%, rgba(147, 51, 234, 0.18), transparent 65%),
    radial-gradient(500px 300px at 103% 104%, rgba(147, 51, 234, 0.10), transparent 65%);
  z-index: 0;
}

.fk-stage {
  position: absolute;
  inset: 10px 64px 10px 64px;
  border-radius: 26px;
  background:
    radial-gradient(900px 480px at 78% -8%, rgba(124, 58, 237, 0.09), transparent 60%),
    radial-gradient(700px 420px at 12% -10%, rgba(124, 58, 237, 0.05), transparent 60%),
    linear-gradient(180deg, #0d0c14 0%, #0a0910 100%);
  border: 1px solid var(--fk-stage-border);
  overflow: hidden;
  z-index: 1;
}

/* ---- wires ---- */
.fk-wires {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.fk-wire { stroke: var(--fk-wire); stroke-width: 1.4; fill: none; }
.fk-arrow { stroke: #565564; stroke-width: 1.5; fill: none; }

.fk-pulse {
  fill: none;
  stroke-width: 3.6;
  stroke-linecap: round;
  filter: drop-shadow(0 0 5px rgba(196, 181, 253, 0.55));
  animation: fk-pulse-run var(--dur, 5.2s) linear infinite;
  animation-delay: var(--delay, 0s);
}
.fk-pulse.fk-pulse-soft {
  stroke-width: 3;
  opacity: 0.55;
  filter: drop-shadow(0 0 3px rgba(196, 181, 253, 0.35));
}
.fk-pulse-tail {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  opacity: 0.35;
  animation: fk-pulse-run var(--dur, 5.2s) linear infinite;
  animation-delay: var(--delay, 0s);
}
@keyframes fk-pulse-run {
  from { stroke-dashoffset: 0; }
  to   { stroke-dashoffset: -100; }
}

.fk-spark {
  fill: none;
  stroke-width: 4.2;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(216, 180, 254, 0.7));
}

/* dashed feedback loop */
.fk-loop {
  stroke: #34333f;
  stroke-width: 1.6;
  stroke-dasharray: 5 7;
  fill: none;
}

/* ---- headers ---- */
.fk-header {
  position: absolute;
  top: 112px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.24em;
  color: var(--fk-text-dim);
  text-transform: uppercase;
  white-space: nowrap;
}
.fk-header-left { left: 26px; }
.fk-header-right { right: 40px; }

/* ---- stop button ---- */
.fk-stop {
  position: absolute;
  top: 28px;
  right: 32px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #1d1c26;
  border: 1px solid #2b2a37;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.fk-stop .sq {
  width: 12px;
  height: 12px;
  border-radius: 3.5px;
  background: #cfcdd9;
}

/* ---- sources (left) ---- */
.fk-sources {
  position: absolute;
  left: 26px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 45px;
  width: 265px;
}
.fk-src {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  height: 46px;
}
.fk-src .lbl {
  font-size: 17.5px;
  font-weight: 400;
  color: #c9c7d3;
  transition: color 0.3s;
}
.fk-src .ico {
  width: 22px;
  height: 22px;
  color: #8d8c9b;
  display: flex;
  align-items: center;
}
.fk-src .ico svg { width: 22px; height: 22px; }
.fk-src .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4b4a58;
  flex: none;
}
.fk-src.fk-active .lbl { color: #ffffff; font-weight: 500; }
.fk-src.fk-active .dot { background: #8d8c9b; }

/* ---- outcomes (right) ---- */
.fk-outcomes {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 38px;
  width: 268px;
}
.fk-out {
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(180deg, #17161f 0%, #131219 100%);
  border: 1px solid #26252f;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 16px;
  font-size: 16.5px;
  font-weight: 400;
  color: #d6d4de;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.fk-out .ico { width: 21px; height: 21px; display: flex; align-items: center; }
.fk-out .ico svg { width: 21px; height: 21px; }
.fk-out:hover { border-color: #3a3948; }
.fk-out.fk-active {
  border-color: color-mix(in srgb, var(--accent, #f0a832) 75%, transparent);
  box-shadow: 0 0 22px color-mix(in srgb, var(--accent, #f0a832) 18%, transparent),
              inset 0 0 14px color-mix(in srgb, var(--accent, #f0a832) 5%, transparent);
  color: #ffffff;
}

/* ---- center card ---- */
.fk-card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 474px;
  border-radius: 22px;
  background:
    radial-gradient(420px 220px at 50% 0%, rgba(124, 58, 237, 0.07), transparent 70%),
    linear-gradient(180deg, rgba(22, 21, 31, 0.92) 0%, rgba(15, 14, 22, 0.96) 100%);
  border: 1px solid #2a2937;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  padding: 22px 26px 20px;
}
.fk-card.fk-card-dashed {
  border: 1.5px dashed #3d3c4c;
  background: linear-gradient(180deg, rgba(18, 17, 26, 0.85) 0%, rgba(13, 12, 20, 0.92) 100%);
}

.fk-card-head {
  display: flex;
  align-items: center;
  gap: 11px;
}
.fk-card-head .logo { width: 24px; height: 24px; display: flex; }
.fk-card-head .logo svg { width: 24px; height: 24px; }
.fk-card-head .brand {
  font-size: 19px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.01em;
}
.fk-card-head .tag {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.26em;
  color: #777684;
  margin-left: 6px;
  text-transform: uppercase;
}
.fk-card-head .menu {
  margin-left: auto;
  display: flex;
  gap: 5px;
}
.fk-card-head .menu i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #504f5e;
}

.fk-card-body { flex: 1; position: relative; }

.fk-card-foot {
  display: flex;
  align-items: center;
  margin-top: 6px;
}
.fk-card-foot .salida {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.24em;
  color: #777684;
  text-transform: uppercase;
}
.fk-card-foot .salida-val {
  font-size: 17px;
  font-weight: 600;
  color: var(--fk-amber);
  margin-left: 12px;
}
.fk-card-foot .viewtoggle {
  margin-left: auto;
  margin-right: 30px;
  font-size: 15.5px;
  color: #8b8a98;
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
}
.fk-card-foot .viewtoggle svg { width: 13px; height: 13px; }

/* ---- callout ---- */
.fk-callout {
  position: absolute;
  width: 246px;
  border-radius: 16px;
  background: linear-gradient(180deg, #141320 0%, #100f18 100%);
  border: 1px solid #2a2937;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.55);
  padding: 17px 19px 15px;
  z-index: 5;
}
.fk-callout .co-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--fk-amber);
  text-transform: uppercase;
  margin-bottom: 9px;
}
.fk-callout .co-tag i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fk-amber);
}
.fk-callout .co-line1 { font-size: 16px; color: #b9b7c4; margin-bottom: 3px; }
.fk-callout .co-line2 { font-size: 17px; font-weight: 600; color: #ffffff; }
.fk-callout .co-div { height: 1px; background: #242332; margin: 13px 0 11px; }
.fk-callout .co-value {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.fk-callout .co-value b { font-size: 22px; font-weight: 700; color: var(--fk-amber); }
.fk-callout .co-value span { font-size: 15px; color: #8b8a98; }

/* ---- chips (events riding a wire) ---- */
.fk-chip {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 9px;
  height: 38px;
  padding: 0 16px 0 14px;
  border-radius: 10px;
  background: #15141d;
  border: 1px solid #2a2937;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  font-size: 16px;
  color: #ffffff;
  white-space: nowrap;
  z-index: 4;
}
.fk-chip i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #60a5fa;
  flex: none;
}

/* ---- feedback label ---- */
.fk-feedback {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15.5px;
  color: #96959f;
}
.fk-feedback svg { width: 18px; height: 18px; color: #96959f; }

/* ---- view: orbit ---- */
.fk-orbit {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fk-orbit svg { overflow: visible; }
.fk-orbit .ring {
  fill: none;
  stroke: rgba(96, 94, 118, 0.8);
  stroke-width: 1.4;
  stroke-dasharray: 0.1 6.5;
  stroke-linecap: round;
}
.fk-orbit .core { fill: #a78bfa; }
.fk-orbit .core-glow { fill: var(--fk-core-glow); }
.fk-orbit .rot { animation: fk-rot var(--rdur, 70s) linear infinite; transform-origin: center; }
@keyframes fk-rot { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ---- view: panel grid ---- */
.fk-grid {
  position: absolute;
  inset: 8px 0 6px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 1fr;
  gap: 14px;
}
.fk-panel {
  border-radius: 12px;
  background: linear-gradient(180deg, #16151f 0%, #121118 100%);
  border: 1px solid #232230;
  padding: 12px 15px 8px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.fk-panel .pt {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: #9b9aa9;
  text-transform: uppercase;
  margin-bottom: 6px;
  white-space: nowrap;
}
.fk-panel .pv { flex: 1; min-height: 0; }
.fk-panel .pv svg { width: 100%; height: 100%; }
/* A narrow embed reads in process order instead of shrinking labels. */
.fk-compact { overflow: visible; }
.fk-compact::before { display: none; }
.fk-compact .fk-stage { position: relative; inset: auto; display: flex; flex-direction: column; gap: 14px; padding: 24px 16px; border-radius: 14px; overflow: visible; }
.fk-compact .fk-wires, .fk-compact .fk-chip { display: none; }
.fk-compact .fk-header { position: static; font-size: 10px; letter-spacing: .12em; }
.fk-compact .fk-header-left { order: 0; padding-right: 35px; }
.fk-compact .fk-sources { order: 1; position: static; transform: none; width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.fk-compact .fk-src { justify-content: flex-start; gap: 7px; height: 32px; }
.fk-compact .fk-src .lbl { font-size: 12px; }
.fk-compact .fk-src .ico { width: 16px; height: 16px; }
.fk-compact .fk-src .dot { width: 5px; height: 5px; }
.fk-compact .fk-card { order: 2; position: relative; inset: auto; transform: none; width: 100%; padding: 17px 15px; border-radius: 13px; margin-top: 22px; box-shadow: none; }
.fk-compact .fk-card::before { content: ''; position: absolute; left: 50%; top: -25px; width: 2px; height: 24px; background: linear-gradient(#4a405f,#b9a2ff); }
.fk-compact .fk-card-head { gap: 8px; }
.fk-compact .fk-card-head .brand { font-size: 15px; }
.fk-compact .fk-card-head .tag { font-size: 9px; letter-spacing: .08em; }
.fk-compact .fk-card-head .menu { display: none; }
.fk-compact .fk-card-body { min-width: 0; overflow: hidden; }
.fk-compact .fk-card-body svg { max-width: 100%; }
.fk-compact .fk-card-foot { flex-wrap: wrap; row-gap: 10px; }
.fk-compact .fk-card-foot .salida { font-size: 9px; }
.fk-compact .fk-card-foot .salida-val { font-size: 12px; margin-left: 8px; }
.fk-compact .viewtoggle { font-size: 12px; margin: 0 0 0 auto; }
.fk-compact .fk-header-right { order: 3; margin-top: 10px; }
.fk-compact .fk-outcomes { order: 4; position: static; transform: none; width: 100%; gap: 8px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
.fk-compact .fk-out { font-size: 12px; height: 42px; border-radius: 7px; padding: 0 9px; gap: 8px; white-space: normal; }
.fk-compact .fk-out .ico { width: 17px; min-width: 17px; }
.fk-compact .fk-callout { order: 5; position: relative; left: auto !important; top: auto !important; width: 100%; margin-top: 4px; box-shadow: none; }
.fk-compact .fk-feedback { order: 6; position: static; transform: none; font-size: 11px; justify-content: center; margin-top: 8px; }
.fk-compact .fk-stop { right: 12px; top: 12px; width: 30px; height: 30px; }
