/* Recipient Pathway View (v6) — responsive toolbar
   Keeps the Pathway Completion Paths and Back buttons visible
   on small / mobile screens.

   Root cause: pathways-v2/pathways.css hides ALL .toolbar elements at
   ≤599px via `.toolbar { display: none }`. The v6 recipient toolbar div
   carries that class, so the whole header disappears on phones.
   We use `.pv5-recipient-view` as a scope guard to undo that rule without
   touching the v2 editor toolbar. */

/* ── always: ensure the v6 recipient toolbar is never hidden by v2 rule ─ */
.pv5-recipient-view .rpv6-toolbar {
  display: flex !important;
}

/* ── small tablets / large phones (≤ 768px) ─────────────────────────── */
@media (max-width: 768px) {
  .pv5-recipient-view .rpv6-toolbar {
    flex-wrap: wrap;
    gap: 12px;
  }

  /* Buttons block drops to its own row, full width */
  .pv5-recipient-view .rpv6-buttons {
    width: 100%;
    justify-content: flex-start !important;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 0 !important;
  }

  /* Each button occupies at least half the row */
  .pv5-recipient-view .rpv6-buttons .btn {
    flex: 1 1 auto;
    min-width: 140px;
    margin-right: 0 !important;
  }

  /* Legend indicator (= Credentials Achieved) shrinks gracefully */
  .pv5-recipient-view .rpv6-buttons .bord-no {
    flex: 1 1 auto;
    min-width: 140px;
    text-align: left;
    margin-right: 0 !important;
  }
}

/* ── phones (≤ 599px) ───────────────────────────────────────────────── */
@media (max-width: 599px) {
  /* Hide the final-credential thumbnail to save space */
  .pv5-recipient-view .rpv6-toolbar .pv5-toolbar-img-wrap {
    display: none;
  }

  /* Buttons stack vertically, full width for easy tapping */
  .pv5-recipient-view .rpv6-buttons {
    flex-direction: column;
  }

  .pv5-recipient-view .rpv6-buttons .btn,
  .pv5-recipient-view .rpv6-buttons .bord-no {
    width: 100%;
  }
}

/* ════════════════════════════════════════════════════════════════════════
   Paths-Check modal — responsive
   The overlay is missing right/bottom so it doesn't cover the full
   viewport; and .pv5-paths-dialog has min-width: 700px which overflows
   on any phone.
   ════════════════════════════════════════════════════════════════════════ */

/* Fix overlay not covering full screen (right/bottom were absent) */
.pv5-showpaths-dialog-overlay {
  right: 0;
  bottom: 0;
}

/* Close button is inside .pv5-paths-body (overflow-y: auto), so it scrolls
   out of view when there are many paths. Make it sticky at the bottom of
   the scroll area so it is always visible. The white background + border-top
   prevent it from blending into the scrolling content. */
.pv5-paths-body .pv5-dialog-actions {
  position: sticky;
  bottom: 0;
  background: #fff;
  padding-top: 12px;
  margin-top: 16px;
  border-top: 1px solid #e5e7eb;
}

/* ── tablets (≤ 768px) ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  .pv5-paths-dialog {
    min-width: unset;
    width: 95vw;
    max-height: 90vh;
    padding: 20px 16px;
  }
}

/* ── phones (≤ 599px) ───────────────────────────────────────────────── */
@media (max-width: 599px) {
  .pv5-paths-dialog {
    width: 98vw;
    max-height: 88vh;
    padding: 16px 12px;
    border-radius: 8px;
  }

  /* Stack each step below the previous instead of side-by-side */
  .pv5-path-steps {
    flex-direction: column;
    align-items: stretch;
  }

  .pv5-path-step-wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  /* Step card fills the full width */
  .pv5-path-step {
    width: 100%;
    box-sizing: border-box;
  }

  /* Allow the credential name to wrap instead of truncating */
  .pv5-path-step-name {
    white-space: normal;
  }

  /* Remove the max-width constraint so names use the full card */
  .pv5-path-step-info {
    max-width: none;
    flex: 1;
  }

  /* Rotate the right-arrow to point down for vertical flow */
  .pv5-path-arrow .fa-arrow-right {
    display: inline-block;
    transform: rotate(90deg);
  }
}
