/* ResearchProgress — premium biotech timeline */
.rp-root {
  --rp-orange: var(--pg-accent, #ff7a1a);
  --rp-orange-light: #fff2e8;
  --rp-purple: var(--pg-violet, #7c5cfc);
  --rp-purple-light: #f1eeff;
  --rp-text: var(--pg-navy, #1d2230);
  --rp-text-secondary: var(--pg-muted, #667085);
  --rp-border: #e9ecf2;
  --rp-surface: #f7f8fa;
  --rp-success: #22a06b;
  margin: 1.25rem 0 0;
  animation: rpFadeIn 0.55s ease both;
}

@keyframes rpFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.rp-status-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92) 0%, rgba(247, 248, 250, 0.95) 100%);
  border: 1px solid var(--rp-border);
  border-radius: 20px;
  padding: 1.25rem 1.35rem;
  box-shadow: 0 4px 24px rgba(29, 34, 48, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  margin-bottom: 1.25rem;
}

.rp-status-card--below {
  margin-top: 1.25rem;
  margin-bottom: 0;
}

.rp-status-card__eta {
  color: var(--rp-text-secondary);
  font-size: 0.88rem;
  line-height: 1.5;
}

.rp-status-card__eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rp-text-secondary);
  margin-bottom: 0.35rem;
}

.rp-status-card__title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--rp-text);
  margin: 0 0 0.5rem;
  line-height: 1.25;
}

.rp-status-card__summary {
  color: var(--rp-text-secondary);
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0 0 0.75rem;
}

.rp-status-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-size: 0.78rem;
  color: var(--rp-text-secondary);
}

.rp-status-card__meta strong {
  color: var(--rp-text);
  font-weight: 600;
}

.rp-status-card__order {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 8px;
  background: var(--rp-orange-light);
  color: #c2410c;
  font-family: "Space Grotesk", monospace;
  font-size: 0.75rem;
  font-weight: 600;
}

.rp-alert {
  border-radius: 14px;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.88rem;
  line-height: 1.5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.rp-alert--warning {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  color: #92400e;
}

.rp-alert--error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
}

/* Desktop horizontal timeline */
.rp-timeline-h {
  display: none;
  position: relative;
  padding: 1.55rem 0 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

@media (min-width: 992px) {
  .rp-timeline-h { display: block; }
  .rp-timeline-v { display: none; }
}

.rp-timeline-h__track {
  display: flex;
  align-items: flex-start;
  min-width: max(100%, 680px);
  gap: 0;
  position: relative;
}

.rp-timeline-h__track::before {
  content: "";
  position: absolute;
  top: 26px;
  left: 24px;
  right: 24px;
  height: 2px;
  background: var(--rp-border);
  z-index: 0;
}

.rp-h-step {
  flex: 1;
  min-width: 96px;
  text-align: center;
  position: relative;
  z-index: 1;
  padding: 0 0.25rem;
  transition: transform 0.35s ease;
}

.rp-h-step--completed {
  transform: translateY(-6px);
}

.rp-h-step--current {
  transform: translateY(-12px);
}

.rp-h-step__head {
  position: relative;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.65rem;
}

.rp-marker {
  width: 36px;
  height: 36px;
  margin: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--rp-surface);
  border: 2px solid var(--rp-border);
  color: var(--rp-text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
  flex-shrink: 0;
  overflow: hidden;
  isolation: isolate;
}

.rp-check-icon {
  display: block;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.rp-h-step--completed .rp-marker {
  background: linear-gradient(135deg, var(--rp-orange) 0%, var(--rp-purple) 100%);
  border: none;
  color: #fff;
  box-shadow: 0 6px 18px rgba(255, 122, 26, 0.32);
  width: 40px;
  height: 40px;
}

.rp-h-step--completed .rp-check-icon {
  width: 24px;
  height: 24px;
}

.rp-h-step--current .rp-marker {
  width: 46px;
  height: 46px;
  background: #fff;
  border: 2px solid transparent;
  background-image: linear-gradient(#fff, #fff), var(--pg-grad, linear-gradient(135deg, #ff7a1a, #7c5cfc));
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow: 0 0 0 4px rgba(255, 122, 26, 0.12), 0 8px 28px rgba(124, 92, 252, 0.2);
  animation: rpPulse 2.4s ease-in-out infinite;
}

@keyframes rpPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(255, 122, 26, 0.1), 0 8px 24px rgba(124, 92, 252, 0.15); }
  50% { box-shadow: 0 0 0 8px rgba(255, 122, 26, 0.06), 0 10px 32px rgba(124, 92, 252, 0.22); }
}

.rp-h-step--warning .rp-marker {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #b45309;
}

.rp-h-step--error .rp-marker {
  background: #fef2f2;
  border-color: #ef4444;
  color: #dc2626;
}

.rp-h-step__label {
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--rp-text-secondary);
  max-width: 100px;
  margin: 0 auto;
}

.rp-h-step--completed .rp-h-step__label,
.rp-h-step--current .rp-h-step__label {
  color: var(--rp-text);
}

.rp-h-step__date {
  font-size: 0.62rem;
  color: var(--rp-text-secondary);
  margin-top: 0.25rem;
  opacity: 0.85;
}

.rp-now-badge {
  display: inline-block;
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: var(--pg-grad, linear-gradient(135deg, #ff7a1a, #7c5cfc));
  color: #fff;
  margin-bottom: 0.35rem;
}

.rp-now-badge--float {
  position: absolute;
  top: -2.35rem;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  white-space: nowrap;
  z-index: 2;
  pointer-events: none;
}

/* Current step detail card (desktop) */
.rp-current-detail {
  display: none;
  margin-top: 1rem;
  padding: 1.1rem 1.25rem;
  border-radius: 16px;
  background: var(--rp-purple-light);
  border: 1px solid rgba(124, 92, 252, 0.15);
}

@media (min-width: 992px) {
  .rp-current-detail { display: block; }
}

.rp-current-detail__title {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1rem;
  margin: 0 0 0.35rem;
}

.rp-current-detail__desc {
  font-size: 0.88rem;
  color: var(--rp-text-secondary);
  margin: 0;
  line-height: 1.55;
}

/* Mobile vertical timeline */
.rp-timeline-v {
  position: relative;
  padding-left: 0.25rem;
}

.rp-v-step {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 0 0.85rem;
  padding-bottom: 1.25rem;
  position: relative;
  transition: transform 0.35s ease;
}

.rp-v-step--completed {
  transform: translateY(-4px);
}

.rp-v-step--completed .rp-marker {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--rp-orange) 0%, var(--rp-purple) 100%);
  border: none;
  color: #fff;
  box-shadow: 0 6px 18px rgba(255, 122, 26, 0.32);
}

.rp-v-step--completed .rp-check-icon {
  width: 24px;
  height: 24px;
}

.rp-v-step--current {
  transform: translateY(-8px);
}

.rp-v-step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 40px;
  bottom: 0;
  width: 2px;
  background: var(--rp-border);
}

.rp-v-step--completed:not(:last-child)::before {
  background: linear-gradient(180deg, var(--rp-orange), var(--rp-purple));
}

.rp-v-step__marker-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.rp-v-step .rp-marker {
  margin: 0;
}

.rp-v-step__body {
  padding-top: 0.35rem;
}

.rp-v-step__title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--rp-text);
  margin: 0 0 0.25rem;
}

.rp-v-step--upcoming .rp-v-step__title {
  color: var(--rp-text-secondary);
  font-weight: 600;
}

.rp-v-step__desc {
  font-size: 0.82rem;
  color: var(--rp-text-secondary);
  line-height: 1.5;
  margin: 0;
}

.rp-v-step--current .rp-v-step__desc {
  display: block;
}

.rp-v-step--upcoming .rp-v-step__desc {
  display: none;
}

.rp-v-step--current,
.rp-v-step--warning,
.rp-v-step--error {
  margin-left: -0.5rem;
  margin-right: -0.5rem;
  padding: 0.75rem 0.5rem 1.25rem;
  border-radius: 16px;
}

.rp-v-step--current {
  background: rgba(241, 238, 255, 0.45);
  border: 1px solid rgba(124, 92, 252, 0.12);
}

.rp-v-step--warning {
  background: rgba(255, 251, 235, 0.65);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.rp-v-step--error {
  background: rgba(254, 242, 242, 0.65);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.rp-v-step--current .rp-v-step__desc,
.rp-v-step--warning .rp-v-step__desc,
.rp-v-step--error .rp-v-step__desc {
  display: block;
}

.rp-v-step__date {
  font-size: 0.72rem;
  color: var(--rp-text-secondary);
  margin-top: 0.35rem;
}

@media (prefers-reduced-motion: reduce) {
  .rp-root { animation: none; }
  .rp-h-step--current .rp-marker { animation: none; }
}
