.qd-page {
  --qd-ink: #07111f;
  --qd-surface: #0b1829;
  --qd-cyan: #22d3ee;
  --qd-blue: #3b82f6;
  --qd-green: #34d399;
  --qd-amber: #fbbf24;
  --qd-rose: #fb7185;
}

.piq-page {
  --piq-violet: #8b5cf6;
}

.piq-flow-step {
  position: relative;
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 0.85rem;
  padding-bottom: 1.55rem;
}

.piq-flow-step:not(:last-child)::after {
  position: absolute;
  top: 2.5rem;
  bottom: 0.2rem;
  left: 1.2rem;
  width: 1px;
  background: rgba(148, 163, 184, 0.28);
  content: "";
}

.piq-flow-step > span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  background: #fff;
  color: #0891b2;
  font-size: 0.72rem;
  font-weight: 800;
}

.dark .piq-flow-step > span {
  background: #0c1726;
}

.piq-flow-step.is-active > span {
  border-color: rgba(34, 211, 238, 0.45);
  background: #0891b2;
  box-shadow: 0 0 0 7px rgba(34, 211, 238, 0.12);
  color: #fff;
}

.piq-flow-step strong {
  display: block;
  padding-top: 0.15rem;
  font-size: 0.9rem;
}

.piq-flow-step p {
  margin-top: 0.2rem;
  color: rgba(71, 85, 105, 0.78);
  font-size: 0.75rem;
  line-height: 1.5;
}

.dark .piq-flow-step p {
  color: rgba(255, 255, 255, 0.52);
}

.piq-stat {
  display: flex;
  min-height: 8.2rem;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(148, 163, 184, 0.23);
  border-radius: 18px;
  background: #fff;
  padding: 1rem;
}

.dark .piq-stat {
  border-color: rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.035);
}

.piq-stat span,
.piq-stat small {
  color: rgba(71, 85, 105, 0.72);
  font-size: 0.7rem;
}

.dark .piq-stat span,
.dark .piq-stat small {
  color: rgba(255, 255, 255, 0.5);
}

.piq-stat strong {
  color: #07111f;
  font-size: 1.4rem;
  font-variant-numeric: tabular-nums;
}

.dark .piq-stat strong {
  color: #fff;
}

.qd-page h1 {
  font-size: clamp(2.35rem, 5vw, 4.8rem) !important;
  line-height: 0.98 !important;
  letter-spacing: -0.05em !important;
}

.qd-page h2 {
  font-size: clamp(1.8rem, 3.2vw, 3rem) !important;
  line-height: 1.06 !important;
  letter-spacing: -0.04em !important;
}

.qd-page h3 {
  font-size: 1rem !important;
  line-height: 1.4 !important;
  letter-spacing: 0 !important;
}

.qd-grid-field {
  background-image:
    linear-gradient(rgba(103, 232, 249, 0.065) 1px, transparent 1px),
    linear-gradient(90deg, rgba(103, 232, 249, 0.065) 1px, transparent 1px);
  background-size: 32px 32px;
}

.qd-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: #0891b2;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.qd-kicker::before {
  width: 1.65rem;
  height: 1px;
  background: currentColor;
  content: "";
}

.qd-draft-rail {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid rgba(14, 165, 183, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 16px 50px rgba(7, 17, 31, 0.15);
  padding: 0.65rem 0.9rem;
  color: #0f6475;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  backdrop-filter: blur(18px);
}

.dark .qd-draft-rail {
  border-color: rgba(103, 232, 249, 0.2);
  background: rgba(7, 17, 31, 0.9);
  color: #67e8f9;
}

.qd-draft-rail::before {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: #22d3ee;
  box-shadow: 0 0 0 5px rgba(34, 211, 238, 0.13);
  content: "";
}

.qd-dashboard {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 30px;
  background: rgba(4, 11, 21, 0.84);
  box-shadow: 0 34px 100px -38px rgba(34, 211, 238, 0.65);
  backdrop-filter: blur(18px);
}

.qd-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.qd-dashboard-metric {
  background: #0a1626;
  padding: 1.15rem;
}

.qd-sparkline {
  filter: drop-shadow(0 8px 12px rgba(34, 211, 238, 0.15));
}

.qd-status-dot {
  width: 0.52rem;
  height: 0.52rem;
  border-radius: 999px;
  background: #34d399;
  box-shadow: 0 0 0 6px rgba(52, 211, 153, 0.12);
  animation: qd-pulse 2.7s ease-in-out infinite;
}

.qd-card {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.75);
  padding: 1.35rem;
}

.dark .qd-card {
  border-color: rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.035);
}

.qd-card-icon {
  display: grid;
  width: 2.6rem;
  height: 2.6rem;
  place-items: center;
  border-radius: 13px;
  background: rgba(6, 182, 212, 0.11);
  color: #0891b2;
}

.dark .qd-card-icon {
  color: #67e8f9;
}

.qd-analysis-shell {
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.23);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 28px 90px -45px rgba(15, 23, 42, 0.3);
}

.dark .qd-analysis-shell {
  border-color: rgba(255, 255, 255, 0.09);
  background: #0c1726;
}

.qd-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 999px;
  padding: 0.35rem 0.62rem;
  color: #475569;
  font-size: 0.68rem;
  font-weight: 700;
}

.dark .qd-chip {
  border-color: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}

.qd-risk-bar {
  position: relative;
  height: 0.52rem;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.dark .qd-risk-bar {
  background: rgba(255, 255, 255, 0.08);
}

.qd-risk-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22d3ee, #3b82f6);
}

.qd-step {
  position: relative;
  padding-left: 3.7rem;
}

.qd-step-number {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  width: 2.65rem;
  height: 2.65rem;
  place-items: center;
  border-radius: 999px;
  background: #07111f;
  color: #67e8f9;
  font-size: 0.73rem;
  font-weight: 800;
}

.qd-step:not(:last-child)::after {
  position: absolute;
  top: 2.85rem;
  bottom: -1.2rem;
  left: 1.3rem;
  border-left: 1px dashed rgba(14, 165, 183, 0.38);
  content: "";
}

.qd-nav-card {
  border: 1px solid rgba(148, 163, 184, 0.23);
  border-radius: 18px;
  padding: 1rem 1.1rem;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.qd-nav-card:hover {
  transform: translateY(-2px);
  border-color: rgba(6, 182, 212, 0.48);
  background: rgba(34, 211, 238, 0.045);
}

@keyframes qd-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(0.74);
    opacity: 0.65;
  }
}

@media (max-width: 767px) {
  .qd-dashboard-grid {
    grid-template-columns: 1fr;
  }
  .qd-draft-rail {
    right: 0.8rem;
    bottom: 0.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .qd-status-dot {
    animation: none;
  }
  .qd-nav-card {
    transition: none;
  }
}
