/* Mobile and tablet fixes for the homepage problem section
   ("Procurement today runs on...": .gap-head, .ill, .gflow).
   Load AFTER the design-system stylesheets. Media-query rules only: the desktop layout is untouched.
   Logical properties throughout so the same rules hold on a right-to-left page. */

/* ── tablet and below: the seven steps stop being seven squeezed columns ──────
   The design system's own 2-column rule for this width is overridden by a later
   unconditional .gflow__row rule, so the strip stayed 7 columns down to phone width.
   Here: steps kept in the ERP become slim rows, the four that fail become cards, 2 by 2. */
@media (max-width:1000px){
  .gap-head .ill{max-width:560px;margin-inline:auto}

  .gflow .gflow__row{grid-template-columns:repeat(2,minmax(0,1fr))}
  .gflow .gflow__s{border-inline:0;border-block-end:1.5px solid rgba(143,214,255,.22)}
  .gflow .gflow__s:nth-child(even){border-inline-end:1.5px solid rgba(143,214,255,.22)}
  .gflow .gflow__s:nth-last-child(-n+2){border-block-end:0}

  /* a step that stays on the record: number, name, where it lives, tick at the far end */
  .gflow .gflow__s--erp{flex-direction:row;flex-wrap:wrap;align-items:center;gap:4px 12px;
    min-height:56px;padding-block:14px;padding-inline:clamp(16px,2.6vw,22px) 46px}
  .gflow .gflow__s--erp:first-child{grid-column:1 / -1}
  .gflow .gflow__s--erp b{font-size:16px;overflow-wrap:normal}
  .gflow .gflow__s--erp span{font-size:14px}
  .gflow .gflow__s--erp::after{left:auto;right:auto;inset-inline-end:16px;top:50%;margin-top:-8px;
    width:16px;height:16px}

  /* a step that fails: its small scene is sized by the card, never by a fixed width */
  .gflow .gflow__s--hot{padding:22px clamp(16px,2.6vw,22px) 20px}
  .gflow .gflow__s--hot b{font-size:18px}
  .gflow .gflow__how{font-size:13px}
  /* 280px keeps the widest scene label (it overhangs its viewBox) inside the card */
  .gflow .gflow__fig{max-width:280px;width:100%;margin-block:10px 0;margin-inline:auto}
  /* direction:ltr keeps the labels drawn inside the scenes on their anchors on a right-to-left page */
  .gflow .gflow__art,
  .gflow .gflow__art.ba__svg{min-width:0;max-width:100%;direction:ltr}
  .gflow .gflow__s strong{margin-top:10px;font-size:clamp(18px,2.5vw,21px)}
  .gflow .gflow__s p{font-size:15px}

  .gflow .gflow__legend{gap:10px 24px}
  .gflow .gflow__legend span{white-space:normal}
}

/* ── phone: one column, in the order the purchase happens ─────────────────── */
@media (max-width:620px){
  .gap-head{gap:22px}
  /* labels on the picture: the container-unit size bottoms out at 11px and the
     sub-label at under 9px, so they get a readable floor here */
  .gap-head .ill__l{font-size:13px}
  .gap-head .ill__l small{font-size:12px}

  .gflow .gflow__row{grid-template-columns:minmax(0,1fr)}
  .gflow .gflow__s,
  .gflow .gflow__s:nth-child(even){border-inline-end:0}
  .gflow .gflow__s:nth-last-child(-n+2){border-block-end:1.5px solid rgba(143,214,255,.22)}
  .gflow .gflow__s:last-child{border-block-end:0}
  .gflow .gflow__legend{flex-direction:column;align-items:flex-start;font-size:13.5px}
}
