.workflow-motion {
  --workflow-blue: #0b3c5c;
  --workflow-gold: #e9ba60;
  --workflow-cyan: #7fd6ef;
  --workflow-white: #f5faff;
  --orbit-duration: 24s;
  position: relative;
  max-width: 1360px;
  margin: 40px auto 0;
  padding-top: 32px;
  border-top: 1px solid #ffffff26;
  color: var(--workflow-white);
}

.workflow-motion h3, .workflow-motion p { margin: 0; letter-spacing: 0; }
.workflow-motion [hidden] { display: none !important; }
.workflow-motion .icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.workflow-motion .icon { display: block; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.workflow-motion .motion-controls { position: absolute; top: 32px; right: 0; z-index: 2; display: flex; gap: 8px; }
.workflow-motion .motion-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--workflow-white);
  border: 1px solid #ffffff50;
  border-radius: 6px;
  background: transparent;
  font: inherit;
  cursor: pointer;
}
.workflow-motion .motion-button:hover { background: #ffffff12; border-color: var(--workflow-cyan); }
.workflow-motion .motion-button:focus-visible { outline: 3px solid var(--workflow-cyan); outline-offset: 3px; }
.workflow-motion .motion-button .icon { width: 19px; height: 19px; }
.workflow-motion .button-tooltip {
  position: absolute;
  z-index: 3;
  right: 0;
  top: calc(100% + 10px);
  padding: 7px 10px;
  border-radius: 4px;
  color: var(--workflow-blue);
  background: #fff;
  box-shadow: 0 4px 16px #00213740;
  font-size: 14px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.workflow-motion .motion-button:hover .button-tooltip,
.workflow-motion .motion-button:focus-visible .button-tooltip { opacity: 1; visibility: visible; }
.workflow-motion .workflow-animation { margin: 0; }
.workflow-motion .workflow-diagram {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) 64px minmax(170px, .66fr) 64px minmax(185px, .72fr);
  align-items: center;
  column-gap: 12px;
}
.workflow-motion .cycle-column { min-width: 0; }
.workflow-motion .monitor-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 76px;
  padding-bottom: 20px;
  color: var(--workflow-gold);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
}
.workflow-motion .monitor-indicator { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.workflow-motion .cycle-canvas { position: relative; width: 100%; aspect-ratio: 1; }
.workflow-motion .cycle-drawing { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.workflow-motion .monitor-track { fill: none; stroke: #ffffff20; stroke-width: 1; }
.workflow-motion .monitor-orbit { fill: none; stroke: var(--workflow-gold); stroke-width: 3; stroke-linecap: round; }
.workflow-motion .monitor-rotor { transform-origin: 320px 320px; }
.workflow-motion .connector-guide { fill: none; stroke: #ffffff16; stroke-width: 2; }
.workflow-motion .cycle-connector { fill: none; stroke: var(--workflow-cyan); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.workflow-motion .cycle-connectors-compact { display: none; }
.workflow-motion .cycle-center {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: 12px;
  width: 22%;
  color: #bdd9e9;
  font-size: 18px;
  font-weight: 500;
}
.workflow-motion .cycle-center img { display: block; width: 70%; max-width: 82px; height: auto; padding: 10px; border-radius: 50%; background: #fff; }
.workflow-motion .cycle-steps { list-style: none; margin: 0; padding: 0; }
.workflow-motion .cycle-step { position: absolute; width: 33%; transform: translate(-50%, -50%); text-align: center; }
.workflow-motion .step-referral { left: 50%; top: 19%; width: 41%; }
.workflow-motion .step-patient { left: 79%; top: 50%; }
.workflow-motion .step-pcr { left: 50%; top: 81%; width: 41%; }
.workflow-motion .step-qa { left: 21%; top: 50%; }
.workflow-motion .step-content { display: grid; justify-items: center; gap: 12px; padding: 10px 8px; }
.workflow-motion .step-symbol { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--workflow-cyan); }
.workflow-motion .step-number { color: #aacfe1; font-size: 12px; font-weight: 700; }
.workflow-motion .step-symbol .icon { width: 27px; height: 27px; }
.workflow-motion .step-content h3 { font-size: 18px; font-weight: 600; line-height: 1.4; text-wrap: balance; overflow-wrap: normal; }
.workflow-motion .outcome-arrow { align-self: center; margin-top: 76px; }
.workflow-motion .outcome-arrow svg { display: block; width: 100%; height: auto; overflow: visible; }
.workflow-motion .outcome-line { stroke: var(--workflow-gold); stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.workflow-motion .staff-notification { display: grid; justify-items: center; gap: 22px; margin-top: 76px; text-align: center; }
.workflow-motion .notification-symbol { position: relative; color: var(--workflow-gold); }
.workflow-motion .notification-symbol .icon { width: 36px; height: 36px; stroke-width: 1.4; }
.workflow-motion .notification-symbol span { position: absolute; right: -3px; top: -3px; width: 8px; height: 8px; border: 2px solid var(--workflow-blue); border-radius: 50%; background: #8edbbf; }
.workflow-motion .staff-notification h3 { font-size: 21px; font-weight: 550; line-height: 1.5; text-wrap: balance; }
.workflow-motion .readiness-shield { position: relative; width: 100%; max-width: 225px; aspect-ratio: 240 / 280; margin: 76px auto 0; }
.workflow-motion .shield-outline { display: block; width: 100%; height: 100%; }
.workflow-motion .shield-content { position: absolute; inset: 23% 12% auto; display: grid; justify-items: center; gap: 12px; color: var(--workflow-blue); text-align: center; }
.workflow-motion .shield-content img { display: block; width: 34%; height: auto; }
.workflow-motion .shield-content h3 { font-size: 22px; font-weight: 750; line-height: 1.25; }
.workflow-motion .shield-rule { width: 30px; height: 2px; margin-top: 2px; background: #c8952b; }

/* Keep the reveal, arrow drawing, and rotation on one pausable timeline. */
.workflow-motion .is-enhanced .reveal { opacity: 0; }
.workflow-motion .is-enhanced .draw { stroke-dasharray: 1; stroke-dashoffset: 1; }
.workflow-motion .is-running .reveal { animation: workflow-reveal .65s ease-out var(--at, 0s) both; }
.workflow-motion .is-running .step-content { animation-name: workflow-pop; animation-timing-function: cubic-bezier(.2, .8, .25, 1); }
.workflow-motion .is-running .draw { animation: workflow-draw .7s ease-in-out var(--at, 0s) both; }
.workflow-motion .is-running .monitor-rotor { animation: workflow-orbit var(--orbit-duration) linear 6.8s infinite; }
.workflow-motion .workflow-animation.is-holding { animation: workflow-cycle-hold 1.5s linear both; }
.workflow-motion .is-paused *, .workflow-motion .is-paused { animation-play-state: paused !important; }
@keyframes workflow-reveal { from { opacity: 0; } to { opacity: 1; } }
@keyframes workflow-pop { from { opacity: 0; transform: translateY(9px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes workflow-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes workflow-orbit { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes workflow-cycle-hold { from { opacity: 1; } to { opacity: 1; } }

@media (min-width: 1251px) {
  .workflow-motion { width: 90%; }
}

@media (min-width: 1101px) and (max-width: 1250px) {
  .workflow-motion .workflow-diagram { grid-template-columns: minmax(0, 1fr) 44px 162px 44px 180px; gap: 6px; }
  .workflow-motion .step-content h3 { font-size: 16px; }
  .workflow-motion .staff-notification h3 { font-size: 18px; }
  .workflow-motion .shield-content h3 { font-size: 20px; }
}

@media (max-width: 1100px) {
  .workflow-motion .motion-controls { position: relative; top: auto; right: auto; justify-content: flex-end; margin-bottom: 24px; }
  .workflow-motion .workflow-diagram { max-width: 560px; margin: auto; grid-template-columns: 1fr 72px 1fr; gap: 0 18px; }
  .workflow-motion .cycle-column { grid-column: 1 / -1; }
  .workflow-motion .cycle-exit { grid-column: 1 / -1; justify-self: center; width: 30px; height: 70px; margin: 0 0 18px; }
  .workflow-motion .cycle-exit svg { width: 70px; height: 24px; transform: translate(-20px, 23px) rotate(90deg); }
  .workflow-motion .staff-notification, .workflow-motion .shield-entry, .workflow-motion .readiness-shield { margin-top: 0; }
  .workflow-motion .staff-notification { max-width: 220px; justify-self: center; }
  .workflow-motion .readiness-shield { max-width: 210px; }
}

@media (max-width: 600px) {
  .workflow-motion { margin-top: 36px; padding-top: 24px; }
  .workflow-motion .workflow-diagram { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .workflow-motion .monitor-title { font-size: 17px; gap: 8px; padding-bottom: 16px; min-height: 66px; }
  .workflow-motion .cycle-connectors-wide { display: none; }
  .workflow-motion .cycle-connectors-compact { display: block; }
  .workflow-motion .step-referral { width: 60%; top: 18%; }
  .workflow-motion .step-pcr { width: 55%; top: 82%; }
  .workflow-motion .step-patient, .workflow-motion .step-qa { width: 35%; }
  .workflow-motion .step-content { gap: 7px; padding: 4px 3px; }
  .workflow-motion .step-content h3 { font-size: 14px; line-height: 1.32; }
  .workflow-motion .step-symbol { gap: 7px; }
  .workflow-motion .step-symbol .icon { width: 22px; height: 22px; }
  .workflow-motion .cycle-center { gap: 8px; font-size: 14px; }
  .workflow-motion .cycle-center img { width: 62px; padding: 7px; }
  .workflow-motion .staff-notification { max-width: 280px; gap: 15px; }
  .workflow-motion .staff-notification h3 { font-size: 21px; }
  .workflow-motion .outcome-arrow { width: 30px; height: 68px; justify-self: center; }
  .workflow-motion .outcome-arrow svg { width: 64px; height: 24px; transform: translate(-17px, 22px) rotate(90deg); }
  .workflow-motion .cycle-exit { margin-bottom: 10px; }
  .workflow-motion .shield-entry { margin: 8px 0 4px; }
  .workflow-motion .readiness-shield { width: 220px; }
}

@media (max-width: 370px) {
  .workflow-motion .cycle-center { font-size: 12px; }
  .workflow-motion .cycle-center img { width: 48px; }
  .workflow-motion .step-symbol .icon { width: 19px; height: 19px; }
  .workflow-motion .step-content { gap: 6px; }
  .workflow-motion .monitor-title { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .workflow-motion .workflow-animation *, .workflow-motion .workflow-animation { animation: none !important; }
  .workflow-motion .is-enhanced .reveal { opacity: 1; }
  .workflow-motion .is-enhanced .draw { stroke-dashoffset: 0; }
  .workflow-motion .motion-controls { display: none; }
}

@media print {
  .workflow-motion .motion-controls { display: none !important; }
  .workflow-motion .workflow-animation *, .workflow-motion .workflow-animation { animation: none !important; }
  .workflow-motion .is-enhanced .reveal { opacity: 1; }
  .workflow-motion .is-enhanced .draw { stroke-dashoffset: 0; }
  .workflow-motion { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
