:root {
  --journey-page-bg: #f5f8fc;
  --journey-surface: rgba(255, 255, 255, 0.92);
  --journey-border: rgba(14, 64, 87, 0.12);
  --journey-shadow: 0 24px 60px rgba(0, 15, 43, 0.10);
  --journey-soft-shadow: 0 12px 30px rgba(0, 15, 43, 0.08);
}

/*------------------Images-------------------------*/
.bottomRight3 {
  position: absolute;
  bottom: 0%;
  right: 0%;
  opacity: 0.6;
  z-index: 1;
  max-width: 15%;
  height: auto;
}

/* ---------------- Patient Journey Section ---------------- */
.pworkflow-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  margin-top: 4.8rem;
  padding: 4rem 1.5rem 1.25rem;
  gap: 0;
  overflow: hidden;
  background: radial-gradient(circle at 8% 12%, rgba(153, 216, 230, 0.42), transparent 38rem),
    radial-gradient(circle at 86% 18%, rgba(89, 114, 178, 0.20), transparent 40rem);
}

.pworkflow-section::before,
.pworkflow-section::after {
  content: '';
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
  z-index: 0;
}

/* ------------- Journey Hero Card ------------------*/

.journey-hero-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: clamp(2rem, 4vw, 3.5rem);
  border: 1px solid var(--journey-border);
  border-radius: 34px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.78)),
    linear-gradient(120deg, rgba(27, 97, 131, 0.08), rgba(31, 58, 138, 0.05));
  box-shadow: var(--journey-shadow);
  text-align: center;
  overflow: hidden;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 0.85rem;
  padding: 0.45rem 0.9rem;
  border-radius: 90px;
  background: rgba(14, 64, 87, 0.08);
  color: var(--chambray);
  font-size: 12pt;
  font-weight: 800;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}


/* Title: Centered at Top */
.title {
  font-size: 4.5rem;
  color: var(--chambray);
  text-align: center;
  font-weight: bold;
  letter-spacing: 1px;
}

journey-intro {
  max-width: 760px;
  margin: 1.25rem auto 0;
  color: #4b5d73;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  line-height: 1.7;
}

.journey-path-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2.2rem;
  text-align: left;
}

.path-summary-card {
  position: relative;
  min-height: 168px;
  padding: 1.25rem;
  border: 1px solid rgba(14, 64, 87, 0.10);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--journey-soft-shadow);
  overflow: hidden;
}

.path-summary-card::after {
  content: '';
  position: absolute;
  width: 5.5rem;
  height: 5.5rem;
  right: -1.4rem;
  top: -1.4rem;
  border-radius: 50%;
  opacity: 0.16;
}

.outpatient-card::after {
  background: var(--timeline1);
}

.inpatient-card::after {
  background: var(--timeline2);
}

.emergency-card::after {
  background: var(--timeline3);
}

.path-summary-badge {
  display: inline-flex;
  margin-bottom: 1rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
}

.outpatient-card .path-summary-badge {
  background: var(--timeline1);
}

.inpatient-card .path-summary-badge {
  background: var(--timeline2);
}

.emergency-card .path-summary-badge {
  background: var(--timeline3);
}

.path-summary-card strong {
  display: block;
  color: var(--indigo);
  font-size: 1.1rem;
  line-height: 1.25;
}

.path-summary-card p {
  margin: 0.7rem 0 0;
  color: #56657a;
  font-size: 0.93rem;
  line-height: 1.55;
}

.journey-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1.6rem;
  padding: 0.8rem 1rem;
  border-radius: 999px;
  background: rgba(14, 64, 87, 0.07);
  color: #415168;
  font-size: 0.95rem;
}

.journey-hint span {
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: var(--chambray);
  color: #fff;
  font-weight: 800;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* --------------- Timeline ----------------*/
/* CPAS Patient Journey Page Styles */

.patient-journey-timeline {
  position: relative;
  width: min(1180px, calc(100% - 2rem));
  max-width: none;
  margin: 2.25rem auto 6.4vw;
  padding: clamp(1rem, 2vw, 1.6rem);
  border: 1px solid var(--journey-border);
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 50px rgba(0, 15, 43, 0.07);
  backdrop-filter: blur(8px);
}

.patient-journey-timeline::before {
  content: 'Choose a path';
  position: absolute;
  left: 2rem;
  top: -0.85rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--chambray);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.journey-accordion+.journey-accordion {
  margin-top: 1rem;
}

.page-title {
  text-align: center;
  color: var(--chambray);
  font-size: 2.5rem;
  margin-bottom: 3rem;
}

/* Accordions */
.journey-accordion {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.side-accordions {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  width: 100%;
}

.side-accordions .journey-item.active {
  margin-bottom: 1rem;
}

.side-item-wrapper {
  /* defaults so that both take same width */
  flex: 1;
  transition: flex 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 0;
  order: 2;
}

.side-item-wrapper.expanded {
  flex: 3;
  order: 1;
}

.side-item-wrapper .timeline-container {
  margin-left: 10px;
  padding: 1rem;
  overflow: hidden;
}

/* Journey Item (Steps) */
.journey-item {
  position: relative;
  display: flex;
  /* ADDED: Activates flexbox layout */
  flex-direction: row !important;
  align-items: center;
  /* ADDED: Vertically aligns content in the middle */
  justify-content: flex-start;
  gap: 1rem;
  margin: 0;
  padding: 1rem 1.15rem;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent),
    var(--cursor-logo-medium);
  box-shadow: 0 10px 24px rgba(0, 15, 43, 0.16);
  overflow: hidden;
}

.journey-item::after {
  content: '+';
  margin-left: auto;
  inline-size: 2.25rem;
  block-size: 2.25rem;
  min-inline-size: 2.25rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.82);
  color: var(--chambray);
  font-size: 1.35rem;
  line-height: 1;
  font-weight: 700;
  transition: transform 0.25s ease, background 0.25s ease;
}

.journey-item.active::after {
  content: '–';
  transform: rotate(180deg);
  background: #fff;
}


.journey-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(0, 15, 43, 0.18);
  transform: scale(1.01);
  cursor: pointer;
}

.journey-item.active {
  outline: 3px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 18px 42px rgba(0, 15, 43, 0.20);
}

/* Icon on side of accordion item */
.journey-marker {
  flex: 0 0 auto;
  min-width: auto;
  max-width: 7.5rem;
  height: auto;
  min-height: 2.75rem;
  padding: 0.55rem 0.8rem;
  border-radius: 12px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.2rem;
  letter-spacing: 0.02em;
  font-size: clamp(0.75rem, 1vw, 1rem);
}

.journey-marker.out {
  background-color: var(--timeline1);
}

.journey-marker.in {
  background-color: var(--timeline2);
}

.journey-marker.ae {
  background-color: var(--timeline3);
}


.journey-header {
  font-size: 1.3rem;
  font-weight: bold;
  /* color: var(--indigo); */
  color: var(--accordion);
}

.journey-header {
  color: #fff;
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  line-height: 1.25;
  text-align: left;
}

/* 3. Timeline Container & Steps (Collapsed Logic) */
.timeline-container {
  transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.4s ease,
    padding 0.6s ease;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  visibility: hidden;
  margin: 0 0 0 2.2rem;
  border-left: 3px solid #e0e7ef;
  padding-top: 0;
  padding-bottom: 0;
}

.timeline-container.active {
  max-height: 10000px;
  opacity: 1;
  visibility: visible;
  padding-top: 2rem;
  padding-bottom: 2rem;
  padding-left: 20px;
}

/* Indent nested timelines */
.timeline-container .timeline-container {
  margin-left: 20px;
  border-left: 2px dashed #cbd5e1;
  /* Visual cue it's a sub-path */
  padding: 1rem;
}

/* Active Color Spine */
.timeline-container.out.active {
  border-color: var(--timeline1);
}

.timeline-container.in.active {
  border-color: var(--timeline2);
}

.timeline-container.ae.active {
  border-color: var(--timeline3);
}

/* Timeline Step */
.timeline-step {
  min-height: 0;
  position: relative;
  margin-left: 15px;
  margin-bottom: 2rem;
  padding-left: 30px;
  opacity: 0;
  /* Start hidden for the animation */
}

/* Nested Timeline Dots */
.timeline-step::after {
  content: '';
  position: absolute;
  left: -11px;
  /* Centers the dot on the line */
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 3px solid white;
  z-index: 1;
}

/* Dot Color Matches the Spine */
.timeline-container.out .timeline-step::after {
  background-color: var(--timeline1);
}

.timeline-container.in .timeline-step::after {
  background-color: var(--timeline2);
}

.timeline-container.ae .timeline-step::after {
  background-color: var(--timeline3);
}

/* Step Card */
.step-card {
  display: flex;
  align-items: center;
  background-color: var(--card);
  /* background-color: var(--cursor-logo-light); */
  border-radius: 8px;
  padding: 1rem;
  text-align: left;
  color: #333;
  box-shadow: 0px 4px 10px rgba(0, 15, 43, 0.1);
  transition: transform 0.2s ease;
}

.step-card img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  margin-right: 1.5rem;
  fill: #0e4057;
}

.step-card h2 {
  color: var(--indigo);
  margin: 0;
  text-align: start;
}

/* --- Flow Spine Setup --- */
.journey-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.flow-connector {
  width: 2px;
  height: 40px;
  background-color: #cbd5e1;
}

/* --- Branching Accordions --- */
.branch-wrapper {
  display: flex;
  width: 100%;
  max-width: 1000px;
  gap: 20px;
  margin-top: 30px;
}

.sub-accordion {
  flex: 1;
  background: #f1f5f9;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: flex 0.6s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease;
  border: 1px solid #e2e8f0;
}

.sub-accordion.active {
  flex: 3;
  background: white;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.branch-header {
  padding: 15px;
  text-align: center;
  font-weight: bold;
  color: white;
}

.branch-content {
  display: none;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.5s ease, opacity 0.3s ease;
  padding: 0 20px;
}

.sub-accordion.active .branch-content {
  display: grid;
  grid-template-rows: 1fr;
  opacity: 1;
  padding: 20px;
}

.step-card.small {
  margin-bottom: 10px;
  padding: 0.8rem;
  font-size: 0.9rem;
}

.btnIcon {
  width: 24px !important;
  height: auto !important;
  margin: 0px !important;
}


.hero-badge {
  font-size: 11px;
  font-weight: 500;
  font-family: 'Poppins';
  background: rgba(255, 255, 255, 0.15);
  color: #B5D4F4;
  padding: 4px 12px;
  border-radius: 20px;
  border: 0.5px solid rgba(255, 255, 255, 0.2);
  margin-bottom: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  width: 190px;
  text-align: center;
  margin: auto;
  margin-bottom: 20px;
}

/* --- Branch Stacking in case of small width --- */




/* --- Loop Indicator & Highlights --- */
.loop-indicator {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 30px;
  height: 30px;
  background: #1e3a8a;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  z-index: 10;
  transition: transform 0.2s;
}

.loop-indicator:hover {
  transform: rotate(-45deg) scale(1.1);
}

.swal2-popup {
  width: 70vw;
  height: 75vh;
}

.swal2-title {
  padding: 0 !important;
}

.video-swal-close {
  color: var(--white) !important;
  width: 48px !important;
  height: 48px !important;
  margin: 14px 14px 0 0 !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.08) !important;
  transition: background-color 0.2s ease, transform 0.2s ease !important;
  /* scale: 125%; */
}

.video-swal-close:hover {
  background: rgba(153, 216, 230, 0.2) !important;
  transform: scale(1.06) !important;
  color: #d15050 !important;
  scale: 125%;
}

/* 16:9 video container */
.video-modal-wrapper {
  height: 50vh;
  position: relative;
  aspect-ratio: 16 / 9;
  max-height: 70vh;
  border-radius: 18px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.14);
}


.video-swal-popup .swal2-html-container {
  margin: auto !important;
  padding: 18px 28px 30px !important;
  overflow: visible !important;
}

.video-swal-popup {
  width: min(92vw, 980px) !important;
  padding: 0 !important;
  border-radius: 24px !important;
  overflow: hidden !important;
  background-color: var(--midnight-blue);
  /* background:
    radial-gradient(circle at top right, rgba(153, 216, 230, 0.18), transparent 34%),
    linear-gradient(145deg, var(--color-firefly), #111f3f) !important; */
  color: var(--white) !important;
  box-shadow: 0 24px 70px rgba(0, 15, 43, 0.45) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
}



.video-modal-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  border-radius: 18px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.side-accordions {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: flex-start;
  width: 100%;
  min-width: 0;
}

.side-item-wrapper {
  flex: 1 1 18rem;
  transition: flex 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: min(100%, 18rem);
  max-width: 100%;
  order: 2;
}

.side-item-wrapper.expanded {
  flex: 3 1 28rem;
  min-width: 0;
  order: 1;
}

/* Stack choices in case of lack of width */
@media (max-width: 1100px) {

  .side-item-wrapper,
  .side-item-wrapper.expanded {
    flex: 1 1 100%;
    width: 100%;
  }
}

.journey-item {
  position: relative;
  display: flex;
  flex-direction: row !important;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 1rem 1.15rem;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent),
    var(--cursor-logo-medium);
  box-shadow: 0 10px 24px rgba(0, 15, 43, 0.16);
  overflow: hidden;
}



.journey-header {
  flex: 1 1 auto;
  min-width: 0;
  color: #fff;
  font-size: clamp(0.9rem, 1.2vw, 1.15rem);
  line-height: 1.25;
  text-align: left;

  /* Important: do not use anywhere here */
  overflow-wrap: normal;
  word-break: normal;
  hyphens: auto;

  /* Optional: keep closed accordion headers tidy */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


.timeline-container,
.timeline-step,
.step-card {
  min-width: 0;
  max-width: 100%;
}

.step-card h2 {
  min-width: 0;
  overflow-wrap: anywhere;
}



/* Mobile */
@media (max-width: 600px) {
  .video-swal-popup {
    width: 94vw !important;
    border-radius: 18px !important;
  }

  .video-swal-title {
    padding: 22px 56px 6px 20px !important;
    font-size: 1.1rem !important;
  }

  .video-swal-popup .swal2-html-container {
    padding: 14px 16px 22px !important;
  }

  .video-modal-wrapper {
    border-radius: 14px;
  }

  .video-modal-iframe {
    border-radius: 14px;
  }
}

@keyframes highlightPulse {
  0%,
  100% {
    box-shadow:
      var(--highlight-rest-shadow, 0 8px 24px rgba(0, 15, 43, 0.14)),
      0 0 0 0 rgba(var(--highlight-ring-rgb, 58, 152, 209), 0);
    scale: 1;
  }

  38% {
    box-shadow:
      var(--highlight-rest-shadow, 0 8px 24px rgba(0, 15, 43, 0.14)),
      0 0 0 3px rgba(var(--highlight-ring-rgb, 58, 152, 209), 0.58),
      0 0 0 9px rgba(var(--highlight-ring-rgb, 58, 152, 209), 0.16);
    scale: 1.012;
  }

  68% {
    box-shadow:
      var(--highlight-rest-shadow, 0 8px 24px rgba(0, 15, 43, 0.14)),
      0 0 0 2px rgba(var(--highlight-ring-rgb, 58, 152, 209), 0.24),
      0 0 0 14px rgba(var(--highlight-ring-rgb, 58, 152, 209), 0);
    scale: 1.006;
  }
}

.jump-highlight {
  animation: highlightPulse 1.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.step-card.jump-highlight {
  --highlight-rest-shadow: 0 4px 10px rgba(0, 15, 43, 0.1);
  --highlight-ring-rgb: 58, 152, 209;
}

.journey-item.jump-highlight {
  --highlight-rest-shadow: 0 18px 42px rgba(0, 15, 43, 0.2);
  animation: journeyHighlightPulse 1.9s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes journeyHighlightPulse {
  0%,
  100% {
    box-shadow:
      0 18px 42px rgba(0, 15, 43, 0.2),
      0 0 0 0 rgba(209, 238, 255, 0);
    scale: 1;
    filter: brightness(1);
  }

  38% {
    box-shadow:
      0 18px 42px rgba(0, 15, 43, 0.2),
      0 0 0 4px rgba(209, 238, 255, 0.92),
      0 0 0 13px rgba(58, 152, 209, 0.3);
    scale: 1.018;
    filter: brightness(1.06);
  }

  68% {
    box-shadow:
      0 18px 42px rgba(0, 15, 43, 0.2),
      0 0 0 2px rgba(209, 238, 255, 0.38),
      0 0 0 18px rgba(58, 152, 209, 0);
    scale: 1.008;
    filter: brightness(1.025);
  }
}

/* The Animation Definition */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(15px);
    /* Slide up slightly for a more natural feel */
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.timeline-container.active .timeline-step {
  animation: slideIn 0.4s ease-out forwards;
}

/* Add a slight delay to each step so they appear as the container grows */
.timeline-container.active .timeline-step:nth-child(1) {
  animation-delay: 0.2s;
}

.timeline-container.active .timeline-step:nth-child(2) {
  animation-delay: 0.3s;
}

.timeline-container.active .timeline-step:nth-child(3) {
  animation-delay: 0.4s;
}

.timeline-container.active .timeline-step:nth-child(4) {
  animation-delay: 0.5s;
}

.timeline-container.active .timeline-step:nth-child(5) {
  animation-delay: 0.6s;
}

.timeline-container.active .timeline-step:nth-child(6) {
  animation-delay: 0.7s;
}

.timeline-container.active .timeline-step:nth-child(7) {
  animation-delay: 0.8s;
}


/* Blur Step Logic */
.blur-step {
  filter: blur(4px);
  opacity: 0.5;
  pointer-events: none;
  /* Prevents clicking on blurred items */
  transition: filter 0.4s ease, opacity 0.4s ease;
}

/* Ensure the active/focused items stay sharp */
.journey-accordion,
.side-item-wrapper,
.journey-item {
  transition: filter 0.4s ease, opacity 0.4s ease;
}

/* Optional: Smooth transition for the container */
.patient-journey-timeline {
  will-change: filter;
}

.readmore {
  background-color: var(--slate-blue);
  font-family: 'Poppins', sans-serif;
  color: var(--white);
  border: solid 2px var(--chambray);
  padding: 0.6rem 1.2rem;
  border-radius: 25px;
  cursor: pointer;
  font-weight: bold;
  margin-top: auto;
  margin-left: auto;
  text-decoration: none;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  line-height: 1;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.readmore p {
  margin: 0;
  padding: 0;
  line-height: 1;
}

.readmore span {
  margin: 0;
  padding: 0;
  line-height: 1;
}

.btnIcon {
  width: 18px;
  height: 18px;
  display: block;
  flex-shrink: 0;
}

.readmore:hover {
  background-color: var(--indigo);
  transform: translateY(-2px);
  border: solid 2px var(--shakespeare);
}

h2 {
  color: var(--slate-blue);
  text-align: center;
}

/* Mobile Overrides */
@media (max-width: 768px) {

  /* 1. Header & Typography */
  .title {
    font-size: 2.5rem;
    /* Scaled down from 4.5rem */
    margin-top: 1rem;
    padding: 0 10px;
  }

  .pworkflow-section h2 {
    font-size: 1.1rem;
    padding: 0 20px;
  }

  /* 2. Timeline Container Width */
  .patient-journey-timeline {
    max-width: 100%;
    /* Use full width on mobile */
    padding: 0 15px;
    margin: 2rem auto;
  }

  /* 3. Handling the Side-by-Side Accordions */
  .side-accordions {
    flex-direction: column;
    /* Stack "Regular Visit" and "Specialist" */
    gap: 20px;
  }

  .side-item-wrapper {
    width: 100%;
    flex: none !important;
    /* Disable the flex grow/shrink logic for mobile */
  }

  /* 4. Timeline Spacing & Line */
  .timeline-container {
    margin-left: 15px;
    /* Reduce indentation */
    padding-left: 15px;
  }

  .timeline-step {
    padding-left: 20px;
    margin-left: 10px;
  }

  /* 5. Step Cards (Images and Text) */
  .step-card {
    flex-direction: column;
    /* Stack icon above text */
    align-items: flex-start;
    padding: 1.2rem;
  }

  .step-card img {
    margin-right: 0;
    margin-bottom: 1rem;
    width: 40px;
    /* Slightly smaller icons */
    height: 40px;
  }

  .step-card h2 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
  }

  .step-card p {
    font-size: 0.9rem;
    line-height: 1.4;
  }

  /* 7. Markers */
  .journey-marker {
    height: 40px;
    font-size: 1rem;
  }
}


@media (max-width: 960px) {
  .journey-path-summary {
    grid-template-columns: 1fr;
  }

  .path-summary-card {
    min-height: auto;
  }

  .side-accordions {
    flex-direction: column;
  }

  .side-item-wrapper {
    width: 100%;
    flex: none !important;
  }
}

@media (max-width: 768px) {
  .pworkflow-section {
    margin-top: 3.8rem;
    padding: 2rem 1rem 0.8rem;
  }

  .journey-hero-shell {
    padding: 1.5rem;
    border-radius: 26px;
  }

  .journey-hero-shell::before {
    display: none;
  }

  .journey-hint {
    align-items: flex-start;
    border-radius: 18px;
    text-align: left;
  }

  .patient-journey-timeline {
    width: calc(100% - 1rem);
    padding: 1rem;
    border-radius: 24px;
  }

  .patient-journey-timeline::before {
    left: 1rem;
  }

  .journey-item {
    align-items: flex-start;
    gap: 0.8rem;
    border-radius: 18px;
  }

  .journey-marker {
    min-width: auto;
    font-size: 0.78rem;
  }

  .journey-item::after {
    width: 2rem;
    height: 1.8rem;
    padding-bottom: 5px;
    flex: 0 0 auto;
  }

  .timeline-container {
    margin-left: 1rem;
  }

  .timeline-container.active {
    padding-left: 1rem;
  }

  .timeline-step {
    padding-left: 1rem;
  }

  .timeline-step::after {
    left: -1.45rem;
  }

  .step-card {
    align-items: flex-start;
  }

  .step-card img {
    margin-bottom: 0.65rem;
  }

  .readmore {
    margin-left: 0;
    margin-top: 0.75rem;
  }
}

/* =========================================================
   Mobile optimisation patch
   Keeps the desktop design, but prevents horizontal overflow,
   improves tap targets, and makes nested timelines readable on phones.
   ========================================================= */

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  background: var(--journey-page-bg);
}

img,
svg,
video,
iframe {
  max-width: 100%;
}

button,
a,
.journey-item,
.readmore,
.loop-indicator {
  -webkit-tap-highlight-color: transparent;
}

/* Fix missing dot in the original selector */
.journey-intro {
  max-width: 760px;
  margin: 1.25rem auto 0;
  color: #4b5d73;
  font-size: clamp(0.98rem, 1.5vw, 1.2rem);
  line-height: 1.7;
}

.title {
  font-size: clamp(2.15rem, 9vw, 4.5rem);
  line-height: 1.05;
  overflow-wrap: balance;
}

.pworkflow-section,
.patient-journey-timeline,
.journey-hero-shell,
.journey-path-summary,
.path-summary-card,
.timeline-container,
.timeline-step,
.step-card,
.side-accordions,
.side-item-wrapper,
.journey-item,
.journey-header {
  min-width: 0;
}

.journey-path-summary {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
}

.journey-item {
  min-height: 56px;
  touch-action: manipulation;
}

.journey-header {
  overflow-wrap: anywhere;
}

.step-card {
  gap: 1rem;
}

.step-card img {
  flex: 0 0 auto;
}

.step-card h2 {
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  line-height: 1.25;
}

.readmore {
  min-height: 44px;
  white-space: nowrap;
}

.video-modal-wrapper {
  width: 100%;
  height: auto;
}

@media (max-width: 900px) {
  .pworkflow-section {
    margin-top: 3.75rem;
    padding: 2rem 1rem 0.9rem;
  }

  .journey-hero-shell {
    padding: clamp(1.25rem, 5vw, 2rem);
    border-radius: 26px;
  }

  .patient-journey-timeline {
    width: min(100% - 1rem, 720px);
    margin: 1.5rem auto 3rem;
    padding: 1rem;
    border-radius: 24px;
  }

  .patient-journey-timeline::before {
    left: 1rem;
  }

  .side-accordions,
  .side-item-wrapper,
  .side-item-wrapper.expanded {
    display: flex;
    flex-direction: column;
    width: 100%;
    flex: 1 1 auto !important;
    min-width: 0;
  }

  .side-item-wrapper .timeline-container {
    margin-left: 0.75rem;
    padding-right: 0;
  }

  .timeline-container {
    margin-left: 0.75rem;
  }

  .timeline-container.active {
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
    padding-left: 0.9rem;
  }

  .timeline-container .timeline-container {
    margin-left: 0.5rem;
    padding-left: 0.75rem;
  }

  .timeline-step {
    margin-left: 0.45rem;
    margin-bottom: 1rem;
    padding-left: 0.85rem;
  }

  .timeline-step::after {
    left: -1.33rem;
    width: 16px;
    height: 16px;
  }

  .journey-item {
    gap: 0.7rem;
    padding: 0.85rem;
    border-radius: 18px;
  }

  .journey-item::after {
    inline-size: 2rem;
    block-size: 2rem;
    min-inline-size: 2rem;
  }

  .journey-marker {
    max-width: 6.25rem;
    min-height: 2.25rem;
    padding: 0.45rem 0.6rem;
    font-size: 0.75rem;
    text-align: center;
  }

  .step-card {
    flex-direction: row;
    align-items: center;
    padding: 0.9rem;
    border-radius: 14px;
  }

  .step-card img {
    width: 38px;
    height: 38px;
    margin: 0;
  }

  .readmore {
    margin-left: 0;
    margin-top: 0.75rem;
  }

  .journey-hint {
    width: 100%;
    justify-content: flex-start;
    border-radius: 18px;
    text-align: left;
  }
}

@media (max-width: 520px) {
  .pworkflow-section {
    padding-inline: 0.75rem;
  }

  .journey-hero-shell {
    border-radius: 20px;
  }

  .journey-intro {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  .journey-path-summary {
    gap: 0.75rem;
    margin-top: 1.25rem;
  }

  .path-summary-card {
    padding: 1rem;
    border-radius: 18px;
  }

  .patient-journey-timeline {
    width: calc(100% - 0.5rem);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0px;
  }

  .journey-accordion {
    gap: 0rem;
    margin-top: 1rem;
  }

  .journey-item {
    align-items: center;
    padding: 0.78rem;
  }

  .journey-marker {
    max-width: 5rem;
    min-height: 2rem;
    font-size: 0.68rem;
    line-height: 1.1;
  }

  .journey-header {
    font-size: 0.95rem;
    -webkit-line-clamp: 3;
  }

  .timeline-container.active {
    padding-left: 0.65rem;
  }

  .timeline-step {
    padding-left: 0.65rem;
  }

  .step-card {
    gap: 0.75rem;
    padding: 0.8rem;
  }

  .step-card img {
    width: 34px;
    height: 34px;
  }

  .step-card h2 {
    font-size: 0.98rem;
  }

  .readmore {
    width: 100%;
    justify-content: center;
    white-space: normal;
  }

  .loop-indicator {
    top: -10px;
    right: -8px;
    width: 28px;
    height: 28px;
    font-size: 18px;
  }

  .video-swal-popup {
    width: calc(100vw - 1rem) !important;
  }
}

@media (max-width: 380px) {
  .journey-item {
    gap: 0.55rem;
  }

  .journey-marker {
    display: none;
  }

  .journey-item::after {
    inline-size: 1.75rem;
    block-size: 1.75rem;
    min-inline-size: 1.75rem;
    font-size: 1.15rem;
  }

  .step-card {
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* SweetAlert video modal fix */
.video-swal-popup {
  width: min(96vw, 1100px) !important;
  max-width: 1100px !important;
  padding: 0 !important;
  height: auto;
}

.video-swal-popup .swal2-html-container {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 1.5rem 2rem 2rem !important;
}

.video-swal-popup .hero-badge {
  width: fit-content !important;
  min-width: 180px;
  margin: 0 auto 1rem !important;
  text-align: center;
}

.video-modal-wrapper {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 16 / 9;
  max-height: 72vh;
}

.video-modal-iframe {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* Fix +/- centering */
.journey-item::after {
  width: 2.25rem !important;
  height: 2.25rem !important;
  inline-size: 2.25rem !important;
  block-size: 2.25rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  line-height: 1 !important;
  font-size: 1.35rem !important;
}

.journey-item.active::after {
  line-height: 1 !important;
}

/* =========================================================
   Mobile side-accordion spacing fix
   Collapsed nested timelines previously retained padding from
   `.side-item-wrapper .timeline-container { padding: 1rem; }`,
   creating an empty gap between stacked accordion wrappers.
   ========================================================= */
@media (max-width: 900px) {
  .side-accordions {
    gap: 0.75rem;
  }

  .side-item-wrapper>.journey-item.active {
    margin-bottom: 0;
  }

  .side-item-wrapper>.timeline-container {
    margin: 0 0 0 0.75rem;
    padding: 0;
  }

  .side-item-wrapper>.timeline-container.active {
    padding: 1rem 0 1rem 0.75rem;
  }
}

/* =========================================================
   Step-card action and loop-indicator optimisation
   ========================================================= */
.step-card {
  position: relative;
  overflow: visible;
}

/* Let a text wrapper use the space between the icon and action button. */
.step-card>div:not(.loop-indicator) {
  flex: 1 1 auto;
  min-width: 0;
}

/* Keep card actions aligned to the outer-right edge. */
.step-card>.readmore {
  flex: 0 0 auto;
  align-self: center;
  margin: 0 0 0 auto;
}

/* Open timelines must allow badges to extend outside their cards. */
.timeline-container.active,
.side-item-wrapper>.timeline-container.active {
  overflow: visible;
}

.timeline-step {
  overflow: visible;
}

@media (max-width: 900px) {
  .step-card {
    width: 100%;
    flex-direction: row;
    align-items: center;
  }

  .step-card>.readmore {
    width: auto;
    min-width: max-content;
    margin: 0 0 0 auto;
    white-space: nowrap;
  }

  .loop-indicator {
    top: -0.7rem;
    right: -0.55rem;
  }
}

@media (max-width: 520px) {

  /* Cards with an action keep a stable icon / content / button layout. */
  .step-card:has(> .readmore) {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 0.65rem;
  }

  .step-card:has(> .readmore)>img {
    grid-column: 1;
  }

  .step-card:has(> .readmore)>div:not(.loop-indicator) {
    grid-column: 2;
  }

  .step-card:has(> .readmore)>.readmore {
    grid-column: 3;
    width: auto;
    min-width: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0.65rem 0.8rem;
  }

  .step-card:has(> .readmore)>.readmore .btnIcon {
    margin: 0 !important;
  }

  .loop-indicator {
    top: -0.65rem;
    right: -0.4rem;
  }
}

@media (max-width: 400px) {

  /* Preserve the right-aligned action while hiding its label on very narrow phones. */
  .step-card:has(> .readmore)>.readmore span {
    display: none;
  }
}

@media (hover:none) {
  .journey-item:hover {
    /* transform: translateY(-2px); */
    /* box-shadow: 0 16px 34px rgba(0, 15, 43, 0.18); */
    transform: scale(1);
    /* cursor: pointer; */
  }
}
