.workflow-page { background: var(--pf-page-background, #00030c) !important; }
.workflow-main { padding-bottom: 20px; }

.workflow-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, .82fr);
  align-items: center;
  min-height: 390px;
  overflow: hidden;
}

.workflow-hero > img {
  justify-self: end;
  width: min(100%, 620px);
  height: 380px;
  object-fit: contain;
  object-position: right center;
  filter: drop-shadow(0 28px 42px rgba(0,0,0,.45));
}

.workflow-intro { position: relative; z-index: 2; max-width: 800px; }
.workflow-intro h1 { margin: 0 0 18px; font-size: clamp(3.3rem, 4.9vw, 5rem); line-height: .96; letter-spacing: -.06em; }
.workflow-intro h1 span { display: block; }
.workflow-intro h1 span:last-child { color: var(--green); }
.workflow-intro p { max-width: 700px; margin: 0; color: var(--muted); font-size: 1.08rem; }
.workflow-intro .eyebrow { margin: 0 0 14px; color: var(--green); font-size: .86rem; }

@media (min-width: 981px) {
  .workflow-intro { align-self: start; margin-top: 14px; }
}

.workflow-path {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-areas: "one two three four" "eight seven six five";
  gap: 28px 34px;
  padding-top: 14px;
}

.step-1 { grid-area: one; }.step-2 { grid-area: two; }.step-3 { grid-area: three; }.step-4 { grid-area: four; }
.step-5 { grid-area: five; }.step-6 { grid-area: six; }.step-7 { grid-area: seven; }.step-8 { grid-area: eight; }

.flow-step {
  position: relative;
  min-width: 0;
  min-height: 190px;
  padding: 20px;
  border: 1px solid rgba(151,226,54,.28);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(3,16,18,.96), rgba(3,10,16,.96));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 14px 32px rgba(0,0,0,.18);
}

.flow-step::after {
  content: "→";
  position: absolute;
  z-index: 3;
  top: 50%;
  right: -27px;
  color: var(--green);
  font-size: 1.35rem;
  transform: translateY(-50%);
}

.step-4::after { content: "↓"; top: auto; right: 50%; bottom: -29px; transform: translateX(50%); }
.step-5::after,.step-6::after,.step-7::after { content: "←"; right: auto; left: -27px; }
.step-8::after { content: none; }

.flow-number {
  position: absolute;
  top: 12px;
  right: 16px;
  color: rgba(151,226,54,.08);
  font-size: 4.1rem;
  line-height: 1;
  font-weight: 950;
  letter-spacing: -.04em;
}

.flow-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 18px;
  border: 1px solid rgba(151,226,54,.36);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(151,226,54,.13), rgba(151,226,54,.045));
}

.flow-icon img,.flow-icon svg { width: 29px; height: 29px; }
.flow-icon svg { fill: none; stroke: var(--green); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.flow-step h2 { position: relative; z-index: 1; margin: 0 0 8px; font-size: 1.12rem; line-height: 1.15; }
.flow-step p { position: relative; z-index: 1; margin: 0; color: rgba(244,247,241,.68); font-size: .9rem; line-height: 1.42; }

.workflow-result { margin-top: 34px !important; }

.workflow-details { display: grid; gap: 20px; margin-top: 28px; }
.workflow-detail-card { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 30px; align-items: stretch; padding: 30px; border: 1px solid rgba(151,226,54,.24); border-radius: 14px; background: linear-gradient(145deg,rgba(8,22,27,.97),rgba(3,11,17,.95)); box-shadow: 0 22px 58px rgba(0,0,0,.22); overflow: hidden; }
.workflow-detail-card.is-reversed .workflow-detail-copy { order: 2; }
.workflow-detail-card.is-reversed .workflow-detail-visual { order: 1; }
.workflow-detail-copy { align-self: center; }
.workflow-detail-copy .section-kicker { margin: 0 0 8px; font-size: .74rem; }
.workflow-detail-copy h2 { margin: 0 0 12px; font-size: clamp(1.75rem,2.5vw,2.35rem); letter-spacing: -.035em; }
.workflow-detail-copy > p:not(.section-kicker) { max-width: 880px; margin: 0 0 20px; color: #c2cac2; line-height: 1.65; }
.workflow-detail-copy ul { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px 24px; margin: 0 0 20px; padding: 0; list-style: none; }
.workflow-detail-copy li { position: relative; padding-left: 24px; color: #d9dfd9; font-size: .93rem; }
.workflow-detail-copy li::before { content: "✓"; position: absolute; left: 0; top: 1px; width: 15px; height: 15px; display: grid; place-items: center; border: 1px solid var(--green); border-radius: 50%; color: var(--green); font-size: .68rem; font-weight: 900; }
.workflow-detail-result { padding: 13px 15px; border: 1px solid rgba(255,255,255,.07); border-radius: 8px; background: rgba(255,255,255,.045); color: #cbd2cb; font-size: .88rem; line-height: 1.5; }
.workflow-detail-result strong { color: var(--green); }
.workflow-detail-visual { position: relative; min-height: 340px; overflow: hidden; border: 1px solid rgba(151,226,54,.28); border-radius: 12px; background: #050e14; box-shadow: inset 0 0 46px rgba(151,226,54,.07); }
.workflow-detail-visual::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg,rgba(3,11,17,.22),transparent 22%,transparent 78%,rgba(3,11,17,.18)); }
.workflow-detail-visual img { display: block; width: 100%; height: 100%; min-height: 340px; object-fit: cover; object-position: center; }

.workflow-result-line {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 11px;
  width: auto;
  padding: 0;
  border: 0;
  background: none;
  font: 500 .88rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.workflow-result-line i { color: var(--green); font-style: normal; }
.workflow-result-line strong { color: var(--green); }

@media (max-width: 1100px) {
  .workflow-path { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "one two" "four three" "five six" "eight seven"; }
  .flow-step::after { content: none; }
  .step-1::after,.step-5::after { content: "→"; right: -27px; left: auto; top: 50%; bottom: auto; transform: translateY(-50%); }
  .step-3::after,.step-7::after { content: "←"; right: auto; left: -27px; top: 50%; bottom: auto; transform: translateY(-50%); }
  .step-2::after,.step-4::after,.step-6::after { content: "↓"; top: auto; right: 50%; bottom: -29px; transform: translateX(50%); }
}

@media (max-width: 980px) {
  .workflow-hero { grid-template-columns: 1fr; padding-top: 48px; }
  .workflow-hero > img { justify-self: center; width: min(100%, 620px); height: 330px; object-position: center; }
  .workflow-detail-card { grid-template-columns: 1fr; }
  .workflow-detail-card.is-reversed .workflow-detail-copy,.workflow-detail-card.is-reversed .workflow-detail-visual { order: initial; }
}

@media (max-width: 680px) {
  .workflow-hero { min-height: 0; padding-top: 34px; }
  .workflow-intro h1 { font-size: 2.85rem; line-height: 1; }
  .workflow-hero > img { height: 270px; }
  .workflow-path { display: block; padding-left: 30px; }
  .flow-step { min-height: 0; margin-bottom: 16px; }
  .flow-step::before { content: ""; position: absolute; left: -22px; top: 24px; bottom: -18px; width: 2px; background: rgba(151,226,54,.28); }
  .flow-step::after { content: "↓" !important; left: -29px !important; right: auto !important; top: auto !important; bottom: -19px !important; transform: none !important; font-size: 1rem; }
  .step-8::before { bottom: 50%; }
  .step-8::after { content: none !important; }
  .workflow-result-line { flex-wrap: wrap; }
  .workflow-detail-card { padding: 24px 20px; gap: 24px; }
  .workflow-detail-copy ul { grid-template-columns: 1fr; }
  .workflow-detail-visual,.workflow-detail-visual img { min-height: 240px; }
}

@media (max-width: 420px) {
  .workflow-intro h1 { font-size: 2.5rem; }
  .workflow-intro p { font-size: 1rem; }
  .workflow-hero > img { height: 240px; }
  .workflow-path { padding-left: 24px; }
  .flow-step { padding: 18px; }
}
