/* n8n page styling (builds on your existing site style.css) */

.n8n-hero{ padding: 52px 0 18px; }
.n8n-hero__grid{
  display:grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 22px;
  align-items: start;
}
.n8n-hero__cta{ display:flex; gap: 12px; flex-wrap: wrap; margin: 16px 0 16px; }

.trust{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 10px;
}
.trust__item{
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
}
.trust__k{ font-weight: 950; }
.trust__v{ margin-top: 6px; color: rgba(240,244,255,0.60); font-weight: 700; font-size: 13.5px; }

.panel__head{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
}
.panel__body{ padding: 14px; }
.panel__metric{ display:flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.panel__metric:last-child{ border-bottom: 0; }
.panel__metricK{ font-weight: 900; }
.panel__metricV{ color: rgba(240,244,255,0.68); font-weight: 750; text-align: right; }
.panel__note{
  margin-top: 12px;
  color: rgba(240,244,255,0.62);
  line-height: 1.6;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 12px;
  border-radius: 14px;
}
.panel__footer{ padding: 14px; }

.demo-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.demo-card{
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  padding: 16px;
}
.demo-card__title{
  font-weight: 950;
  margin-bottom: 12px;
}

.form{ display:grid; gap: 12px; }
.field label{
  display:block;
  font-weight: 800;
  font-size: 13px;
  color: rgba(240,244,255,0.78);
  margin-bottom: 6px;
}
.field input, .field textarea{
  width:100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(10, 12, 18, 0.55);
  color: rgba(240,244,255,0.92);
  outline: none;
}
.field input:focus, .field textarea:focus{
  border-color: rgba(0,255,170,0.35);
  box-shadow: 0 0 0 4px rgba(0,255,170,0.08);
}

.form-note{
  margin-top: 10px;
  color: rgba(240,244,255,0.70);
  font-weight: 700;
  min-height: 18px;
}

.demo-output{
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.demo-output__title{ font-weight: 950; margin-bottom: 8px; }
.demo-output__list{
  margin: 0;
  padding-left: 18px;
  color: rgba(240,244,255,0.65);
  line-height: 1.7;
  font-weight: 650;
}

.preview{ display:grid; gap: 12px; }
.preview__label{
  font-weight: 900;
  color: rgba(240,244,255,0.78);
  margin-bottom: 6px;
}
.preview__box{
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(10, 12, 18, 0.55);
  padding: 12px;
  min-height: 140px;
}
.preview__dim{ color: rgba(240,244,255,0.55); font-weight: 650; }
.preview__hint{
  color: rgba(240,244,255,0.55);
  font-weight: 650;
  font-size: 13px;
}

.sheet{ display:grid; gap: 8px; }
.sheet__row{
  display:grid;
  grid-template-columns: 1.1fr 1.6fr 1fr 1fr;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  font-weight: 750;
  color: rgba(240,244,255,0.78);
}
.sheet__head{
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.10);
  font-weight: 900;
}
.dim{ color: rgba(240,244,255,0.50); font-weight: 650; }

/* Simulator wrap (adapted from your code) */
.sim-wrap{
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
  overflow: hidden;
  box-shadow: 0 18px 60px rgba(0,0,0,0.25);
}
.sim-topbar{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sim-brand{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  user-select:none;
}
.sim-dot{
  width:10px;height:10px;border-radius:50%;
  background: rgba(0,255,170,0.95);
  box-shadow: 0 0 0 6px rgba(0,255,170,0.12);
}
.sim-brand strong{ font-weight: 800; }
.sim-brand span{ color: rgba(240,244,255,0.62); font-size: 12px; }

.sim-controls{
  display:flex;
  gap: 10px;
  align-items:center;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
}
.sim-btn{
  appearance:none;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: rgba(240,244,255,0.92);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
  font-weight: 800;
  font-size: 13px;
}
.sim-btn:hover{ transform: translateY(-1px); border-color: rgba(255,255,255,.24); background: rgba(255,255,255,.10); }
.sim-btn:active{ transform: translateY(0px); }
.sim-btn.primary{
  border-color: rgba(0,255,170,.35);
  background: rgba(0,255,170,.12);
}
.sim-btn.primary:hover{
  border-color: rgba(0,255,170,.55);
  background: rgba(0,255,170,.18);
}

.sim-speed{
  display:flex;
  align-items:center;
  gap: 8px;
  color: rgba(240,244,255,0.62);
  font-size: 12px;
  padding-left: 6px;
}
.sim-speed input[type="range"]{ width: 120px; }

.sim-stage{
  position: relative;
  height: 520px;
  background:
    radial-gradient(900px 520px at 20% 10%, rgba(0,255,170,0.10), transparent 60%),
    radial-gradient(900px 520px at 80% 30%, rgba(140,120,255,0.10), transparent 60%),
    rgba(8,10,16,0.35);
}

.sim-canvas{
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
svg.connections{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  pointer-events:none;
  overflow: visible;
}

.node{
  position:absolute;
  min-width: 220px;
  max-width: 280px;
  padding: 14px 14px 12px 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.06));
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
  backdrop-filter: blur(10px);
  user-select:none;
  cursor: grab;
  touch-action: none;
}
.node.dragging{
  cursor: grabbing;
  border-color: rgba(255,255,255,.22);
  box-shadow: 0 16px 70px rgba(0,0,0,.45), 0 12px 40px rgba(0,0,0,.35);
}

.handle{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,.10);
  touch-action: none;
}
.badge{
  font-size: 11px;
  color: rgba(255,255,255,.85);
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  white-space: nowrap;
}
.node h3{ margin:0; font-size: 14px; font-weight: 900; letter-spacing: .2px; }
.node p{ margin:0; font-size: 12px; color: rgba(240,244,255,0.62); line-height: 1.35; }

.ports{ margin-top: 10px; display:flex; justify-content:space-between; gap: 8px; }
.port{
  width: 12px; height: 12px; border-radius: 999px;
  background: rgba(255,255,255,.20);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 0 0 6px rgba(255,255,255,.06);
}
.port.out{ background: rgba(0,255,170,.20); border-color: rgba(0,255,170,.35); box-shadow: 0 0 0 6px rgba(0,255,170,.12); }
.port.in { background: rgba(255,255,255,.18); }

.node.idle{ opacity: .92; }
.node.active{
  border-color: rgba(0,255,170,.55);
  box-shadow: 0 14px 60px rgba(0,255,170,.16), 0 12px 40px rgba(0,0,0,.35);
}
.node.done{
  border-color: rgba(34,197,94,.40);
  box-shadow: 0 14px 60px rgba(34,197,94,.12), 0 12px 40px rgba(0,0,0,.35);
}
.node.done .badge{ background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.25); }
.node.active .badge{ background: rgba(0,255,170,.14); border-color: rgba(0,255,170,.28); }

.edge-base{ fill:none; stroke: rgba(255,255,255,.22); stroke-width: 3; stroke-linecap: round; }
.edge-flow{
  fill:none;
  stroke: rgba(0,255,170,0.95);
  stroke-width: 3.5;
  stroke-linecap: round;
  filter: drop-shadow(0 0 8px rgba(0,255,170,.28));
}
.edge-done{
  stroke: rgba(34,197,94,.70);
  filter: drop-shadow(0 0 8px rgba(34,197,94,.22));
}

.sim-hint{
  padding: 10px 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
  color: rgba(240,244,255,0.62);
  font-size: 12px;
}
.kbd{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New";
  font-size: 11px;
  color: rgba(255,255,255,.85);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  padding: 2px 6px;
  border-radius: 8px;
  margin: 0 4px;
}

/* responsive */
@media (max-width: 980px){
  .n8n-hero__grid{ grid-template-columns: 1fr; }
  .demo-grid{ grid-template-columns: 1fr; }
  .trust{ grid-template-columns: 1fr; }
  .sim-topbar{ flex-direction: column; align-items: flex-start; }
}

/* -----------------------------
   FIX: nodes too wide / off-page
------------------------------ */

/* Let the simulator stage scroll horizontally if the layout is wider than the viewport */
.sim-stage{
  overflow: auto;                 /* enables x-scroll when required */
  -webkit-overflow-scrolling: touch;
}

/* Make the canvas big enough to hold the workflow, but still scrollable on smaller screens */
.sim-canvas{
  min-width: 1280px;              /* adjust if you add more nodes */
}

/* Shrink nodes */
.node{
  min-width: 170px;
  max-width: 200px;
  padding: 10px 10px 9px 10px;
  border-radius: 14px;
}

/* Smaller title + copy */
.node h3{
  font-size: 12.5px;
}
.node p{
  font-size: 11px;
  line-height: 1.3;
}

/* Smaller header strip inside node */
.handle{
  margin-bottom: 6px;
  padding-bottom: 6px;
}

/* Smaller badge */
.badge{
  font-size: 10px;
  padding: 3px 7px;
}

/* Smaller ports */
.port{
  width: 10px;
  height: 10px;
  box-shadow: 0 0 0 5px rgba(255,255,255,.06);
}
.port.out{
  box-shadow: 0 0 0 5px rgba(0,255,170,.12);
}

/* On mobile: even smaller */
@media (max-width: 560px){
  .sim-canvas{ min-width: 1100px; }
  .node{ min-width: 155px; max-width: 185px; }
  .node h3{ font-size: 12px; }
  .node p{ font-size: 10.5px; }
}
/* -----------------------------
   RESPONSIVE WORKFLOW DISPLAY
   Desktop: simulator
   Mobile: stacked steps
------------------------------ */

.mobile-flow{
  display:none; /* hidden by default (desktop) */
}

.mobile-flow__card{
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  padding: 16px;
}

.mobile-flow__title{
  font-weight: 950;
  margin-bottom: 4px;
}
.mobile-flow__sub{
  color: rgba(240,244,255,0.62);
  font-weight: 700;
  margin-bottom: 12px;
}

.mobile-steps{
  display:grid;
  gap: 10px;
}
.mstep{
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(10, 12, 18, 0.55);
  padding: 12px;
}
.mstep--optional{
  opacity: 0.9;
}
.mstep__badge{
  display:inline-flex;
  align-items:center;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 11px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: rgba(240,244,255,0.80);
}
.mstep__name{
  margin-top: 8px;
  font-weight: 950;
}
.mstep__desc{
  margin-top: 4px;
  color: rgba(240,244,255,0.62);
  font-weight: 650;
  line-height: 1.5;
  font-size: 13.5px;
}

/* Breakpoint: switch to mobile-friendly stacked flow */
@media (max-width: 820px){
  /* hide simulator on small screens */
  .sim-wrap{ display:none; }

  /* show mobile flow */
  .mobile-flow{ display:block; }

  /* also tidy controls elsewhere */
  .demo-grid{ grid-template-columns: 1fr; }
  .n8n-hero__cta{ gap: 10px; }
}
