/* Workflow section: an auto-advancing, clickable step diagram. Everything is prefixed wf-. */
.wf { --wf-accent: #2f6fd6; --wf-ink: #1f2328; --wf-muted: #5c6470; --wf-line: #e3e6eb;
      --wf-orange: #f07a1a; --wf-red: #d64545; --wf-green: #2e9b57; color: var(--wf-ink); }

/* step bar */
.wf-steps { display: flex; gap: 6px; margin-bottom: 10px; }
.wf-step { flex: 1 1 0; min-width: 0; position: relative; border: 0; border-radius: 8px; background: #f2f4f7;
           padding: 7px 6px 10px; cursor: pointer; text-align: left; font: inherit; color: var(--wf-muted);
           display: flex; align-items: center; gap: 6px; transition: background .2s; }
.wf-step:hover { background: #e9edf3; }
.wf-step:focus-visible { outline: 2px solid var(--wf-accent); outline-offset: 2px; }
.wf-num { flex: 0 0 22px; height: 22px; border-radius: 50%; background: #c9ced6; color: #fff; font-size: 12px;
          font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.wf-lbl { font-size: 12.5px; font-weight: 600; line-height: 1.15; overflow: hidden; }
.wf-step.is-active { background: #e6eefb; color: var(--wf-ink); }
.wf-step.is-active .wf-num, .wf-step.is-done .wf-num { background: var(--wf-accent); }
.wf-bar { position: absolute; left: 8px; right: 8px; bottom: 4px; height: 3px; border-radius: 2px; overflow: hidden; }
.wf-step.is-active .wf-bar { background: #cdd8ea; }
.wf-bar i { display: block; height: 100%; width: 0; background: var(--wf-accent); }
.wf-step.is-done .wf-bar i { width: 100%; background: transparent; }
@keyframes wf-fill { from { width: 0; } to { width: 100%; } }

/* stage and panels */
.wf-stage { position: relative; height: 480px; border: 1px solid var(--wf-line); border-radius: 12px;
            background: #fff; overflow: hidden; }
.wf-panel { position: absolute; inset: 0; display: flex; gap: 16px; padding: 16px 18px; opacity: 0;
            visibility: hidden; transition: opacity .45s ease, visibility 0s linear .45s; }
.wf-panel.is-active { opacity: 1; visibility: visible; transition: opacity .45s ease; }
.wf-text { flex: 0 0 27%; font-size: 14px; line-height: 1.45; }
.wf-text h3 { font-size: 17px; font-weight: 700; margin: 0 0 8px; color: var(--wf-ink); line-height: 1.25; }
.wf-text p { margin: 0 0 8px; color: #3a414a; }
.wf-sym { display: inline-block; margin-top: 4px; padding: 3px 8px; border-radius: 6px; background: #f2f4f7;
          font-family: "Times New Roman", Times, serif; font-size: 15px; color: #222; }
.wf-media { flex: 1 1 auto; min-width: 0; position: relative; }

/* entrance animation: children fade/rise in after --d when their panel becomes active */
.wf-in { opacity: 0; }
.wf-panel.is-active .wf-in { animation: wf-rise .55s ease-out forwards; animation-delay: var(--d, 0s); }
@keyframes wf-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.wf.is-paused .wf-bar i { animation-play-state: paused !important; }   /* pause stops advancing, not the panel */

/* figures */
.wf-fig { margin: 0; display: flex; flex-direction: column; align-items: center; }
.wf-fig img { display: block; max-width: 100%; border-radius: 6px; }
.wf-fig figcaption, .wf-cap { font-size: 11.5px; color: var(--wf-muted); text-align: center; margin-top: 3px;
                               line-height: 1.25; }
.wf-row { display: flex; gap: 10px; align-items: flex-end; justify-content: center; }
.wf-col { display: flex; flex-direction: column; gap: 8px; }
.wf-photo img { box-shadow: 0 1px 4px rgba(0,0,0,.18); }

/* chips, quotes, code */
.wf-chips { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; }
.wf-chip { font-family: Menlo, Consolas, monospace; font-size: 11.5px; padding: 2px 7px; border-radius: 10px;
           background: #eef2f7; color: #2b3440; white-space: nowrap; }
.wf-chip.is-blue { background: #e2ecfb; color: #1d4f9f; }
.wf-chip.is-orange { background: #fdeedd; color: #a24d06; }
.wf-chip.is-red { background: #fbe4e4; color: #9b2525; }
.wf-chip.is-green { background: #e1f3e8; color: #1d6b3c; }
.wf-dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.wf-quote { font-size: 12px; line-height: 1.35; padding: 4px 8px; border-left: 3px solid #b9c6da; background: #f7f9fc;
            border-radius: 0 6px 6px 0; color: #333; }
.wf-quote b { color: #1d4f9f; }
.wf-quote span { display: block; color: #7a8290; font-size: 10.5px; margin-top: 1px; }
.wf-code { margin: 0; font-family: Menlo, Consolas, monospace; font-size: 11px; line-height: 1.38; background: #f6f8fa;
           border: 1px solid #e5e8ec; border-radius: 6px; padding: 7px 9px; white-space: pre; overflow: hidden;
           color: #24292f; }
.wf-code .k { color: #cf222e; } .wf-code .f { color: #8250df; } .wf-code .c { color: #6e7781; }
.wf-code .s { color: #0a3069; } .wf-code .n { color: #0550ae; }
.wf-plan { font-size: 11.5px; line-height: 1.35; color: #333; }
.wf-plan div { padding: 2px 0 2px 34px; text-indent: -34px; }
.wf-plan b { display: inline-block; width: 30px; text-indent: 0; color: var(--wf-accent); font-family: Menlo, Consolas, monospace; font-size: 11px; }
.wf-msg { font-family: Menlo, Consolas, monospace; font-size: 11px; line-height: 1.35; padding: 5px 8px;
          border-radius: 6px; background: #f6f8fa; border: 1px solid #e5e8ec; color: #24292f; }
.wf-msg.is-err { border-color: #f2c4c4; background: #fdf3f3; color: #8b1e1e; }
.wf-msg.is-ok { border-color: #bfe3cc; background: #f2fbf5; color: #1d6b3c; }
.wf-msg.is-warn { border-color: #f5d9b8; background: #fff8ef; color: #8a4a06; }

/* crossfade A <-> B (loops while the panel is active) */
.wf-swap { position: relative; display: inline-block; }
.wf-swap > img { display: block; }
.wf-swap > .wf-b { position: absolute; left: 0; top: 0; width: 100%; height: 100%; opacity: 0; }
.wf-panel.is-active .wf-swap > .wf-b { animation: wf-x var(--t, 5s) ease-in-out infinite; animation-delay: var(--d2, 1.2s); }
.wf-swap-lbl { display: grid; margin-top: 3px; }
.wf-swap-lbl > span { grid-area: 1 / 1; text-align: center; font-size: 11.5px; line-height: 1.25; color: var(--wf-muted); }
.wf-swap-lbl > .wf-b { opacity: 0; }
.wf-panel.is-active .wf-swap-lbl > .wf-a { animation: wf-xa var(--t, 5s) ease-in-out infinite; animation-delay: var(--d2, 1.2s); }
.wf-panel.is-active .wf-swap-lbl > .wf-b { animation: wf-x var(--t, 5s) ease-in-out infinite; animation-delay: var(--d2, 1.2s); }
@keyframes wf-x  { 0%, 30% { opacity: 0; } 42%, 85% { opacity: 1; } 97%, 100% { opacity: 0; } }
@keyframes wf-xa { 0%, 30% { opacity: 1; } 42%, 85% { opacity: 0; } 97%, 100% { opacity: 1; } }

/* timed sequence: states stacked, each shown for --len after --d; the last one stays */
.wf-seq { position: relative; }
.wf-seq > .wf-st { position: absolute; inset: 0; opacity: 0; }
.wf-panel.is-active .wf-seq > .wf-st { animation: wf-slot var(--len, 2s) linear forwards; animation-delay: var(--d, 0s); }
.wf-panel.is-active .wf-seq > .wf-st.is-last { animation: wf-rise .5s ease-out forwards; animation-delay: var(--d, 0s); }
@keyframes wf-slot { 0% { opacity: 0; } 10%, 90% { opacity: 1; } 100% { opacity: 0; } }

/* the loop timeline (t = 0, 1, 2, T) */
.wf-tl { display: flex; gap: 4px; justify-content: center; margin-bottom: 6px; }
.wf-tl span { font-family: inherit; font-style: normal; font-size: 12px; padding: 1px 9px;
              border-radius: 10px; background: #eef1f5; color: #6a7280; opacity: .55; }
.wf-panel.is-active .wf-tl span { animation: wf-tick var(--len, 2s) linear forwards; animation-delay: var(--d, 0s); }
.wf-panel.is-active .wf-tl span.is-last { animation: wf-tick-last .3s linear forwards; animation-delay: var(--d, 0s); }
@keyframes wf-tick { 0% { opacity: .55; } 5%, 95% { opacity: 1; background: #2f6fd6; color: #fff; } 100% { opacity: .55; } }
@keyframes wf-tick-last { to { opacity: 1; background: #2f6fd6; color: #fff; } }

/* defect cards (refinement) */
.wf-defects { display: flex; gap: 10px; }
.wf-defect { flex: 1 1 0; min-width: 0; border: 1px solid var(--wf-line); border-radius: 8px; padding: 6px; background: #fbfcfd; }
.wf-defect .wf-pair { display: flex; gap: 4px; }
.wf-defect .wf-pair > * { flex: 1 1 0; min-width: 0; }
.wf-defect img { width: 100%; height: 175px; object-fit: cover; border-radius: 4px; display: block; }
.wf-defect .wf-swap { width: 100%; }
.wf-defect p { font-size: 11px; line-height: 1.3; margin: 5px 2px 4px; color: #3a414a; min-height: 43px; }
.wf-verdicts { display: flex; gap: 4px; flex-wrap: wrap; }

/* rejected photo */
.wf-reject { position: relative; display: inline-block; }
.wf-reject::before, .wf-reject::after { content: ""; position: absolute; left: 50%; top: 50%; width: 120%; height: 4px;
    background: var(--wf-red); border-radius: 2px; opacity: 0; }
.wf-panel.is-active .wf-reject::before { animation: wf-cross1 .4s ease-out forwards; animation-delay: var(--dx, 3s); }
.wf-panel.is-active .wf-reject::after { animation: wf-cross2 .4s ease-out forwards; animation-delay: var(--dx, 3s); }
@keyframes wf-cross1 { from { opacity: 0; transform: translate(-50%, -50%) rotate(52deg) scaleX(.2); } to { opacity: .9; transform: translate(-50%, -50%) rotate(52deg); } }
@keyframes wf-cross2 { from { opacity: 0; transform: translate(-50%, -50%) rotate(-52deg) scaleX(.2); } to { opacity: .9; transform: translate(-50%, -50%) rotate(-52deg); } }

/* arrows between stages */
.wf-arrow { align-self: center; color: #9aa4b2; font-size: 20px; line-height: 1; padding: 0 2px; }

/* controls */
.wf-ctl { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 8px; }
.wf-ctl button { border: 1px solid var(--wf-line); background: #fff; border-radius: 16px; min-width: 34px; height: 28px;
                 cursor: pointer; font-size: 13px; color: #3a414a; padding: 0 10px; }
.wf-ctl button:hover { background: #f2f4f7; }
.wf-credits { font-size: 11px; color: #8a919c; margin-top: 6px; text-align: center; }

/* narrow screens: one panel at a time in normal flow */
@media (max-width: 860px) {
  .wf-steps { flex-wrap: wrap; }
  .wf-step { flex: 1 1 22%; }
  .wf-stage { height: auto; }
  .wf-panel { position: relative; inset: auto; display: none; flex-direction: column; }
  .wf-panel.is-active { display: flex; }
  .wf-text { flex: none; }
  .wf-defects { flex-direction: column; }
  .wf-row { flex-wrap: wrap; }
  .wf-media > .wf-col, .wf-media > .wf-row > .wf-col { flex: 1 1 100% !important; max-width: none !important; }
  .wf-seq { min-height: 420px; }
  .wf-lbl { font-size: 11.5px; }
  .wf-arrow { display: none; }
  .wf-code { font-size: 10px; }
}
/* user 11-22 edits: two larger refinement cases; the four cities' heroes in a 2 x 2 grid */
.wf-defects-2 .wf-defect img { height: 250px; }
.wf-cities { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; align-content: center; }
.wf-cities .wf-fig img { width: 100%; height: 170px; object-fit: contain; }
@media (max-width: 900px) { .wf-cities { grid-template-columns: 1fr; } .wf-cities .wf-fig img { height: auto; } }
