/* ── Credential click tooltip ────────────────────────────────────────── */
.cred-compact-popup {
  position: absolute;
  z-index: 4999 !important;
  width: 260px;
  background: #fff;
  border: 1px solid #ccc;
  box-shadow: 0px 2px 10px rgba(0,0,0,0.2);
  padding: 16px;
}
.cred-compact-popup h4 {
  margin: 0 0 5px;
  font-weight: 600;
}
.cred-compact-popup p {
  margin: 0 0 5px;
  font-size: 12px;
}
.cred-compact-popup button {
  margin-right: 5px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.cred-compact-popup a {
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
}
.mt-18px { margin-top: 18px; }

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

   Root cause: pathways-globals.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 `.recipient-view` as a scope guard to undo that rule without
   touching the editor toolbar. */

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

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

  /* Buttons block drops to its own row, full width */
  .recipient-view .pw-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 */
  .recipient-view .pw-buttons .btn {
    flex: 1 1 auto;
    min-width: 140px;
    margin-right: 0 !important;
  }

  /* Legend indicator (= Credentials Achieved) shrinks gracefully */
  .recipient-view .pw-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 */
  .recipient-view .pw-toolbar .pw-toolbar-img-wrap {
    display: none;
  }

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

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

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

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

/* ng-include injects an anonymous wrapper div between .paths-dialog (flex
   column) and .paths-body, breaking the flex chain. Give it flex item
   properties so .paths-body gets a bounded height and can scroll. */
.paths-dialog > [ng-include] {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Close button is inside .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. */
.paths-body .pw-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) {
  .paths-dialog {
    min-width: unset;
    width: 95vw;
    max-height: 90vh;
    padding: 20px 16px;
  }
}

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

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

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

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

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

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

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