/* ══════════════════════════════════════════════════════
 MORPHISM - qualify.css
 Multi-step business diagnostic form.
══════════════════════════════════════════════════════ */

    .qual-hero {
 min-height: 90vh;
 padding: calc(var(--header-h) + 72px) 0 100px;
 position: relative;
 overflow: hidden;
}

/* Italic "free" + extra paint box so background-clip:text doesn't clip glyphs. */
.qual-hero h1 em.morph-text {
 font-style: italic;
 padding: 0 0.12em;
 margin: 0 -0.06em;
}

@media (prefers-reduced-motion: reduce) {
 .qual-hero h1 em.morph-text { animation: none; }
}

/* ── Diagnostic shell ─────────────────────────────── */
.qd {
 margin-top: 48px;
 border: 1px solid var(--border);
 border-radius: var(--radius-lg);
 background: var(--white);
 box-shadow: var(--shadow-elevated);
 overflow: visible;
}

/* ── Progress strip ───────────────────────────────── */
.qd-progress {
 display: flex;
 align-items: center;
 justify-content: space-between;
 gap: 24px;
 padding: 18px 28px;
 border-bottom: 1px solid var(--border);
 background: linear-gradient(180deg, #fafbff 0%, #ffffff 100%);
 flex-wrap: wrap;
}

.qd-progress-meta {
 display: flex;
 flex-direction: column;
 gap: 2px;
 min-width: 180px;
}

.qd-step-label {
 font-family: var(--mono);
 font-size: 9px;
 font-weight: 400;
 letter-spacing: 0.22em;
 text-transform: uppercase;
 color: var(--violet);
}

.qd-step-name {
 font-family: var(--sans);
 font-size: 15px;
 font-weight: 500;
 color: var(--ink);
 letter-spacing: -0.01em;
}

.qd-progress-bar {
 flex: 1 1 220px;
 height: 4px;
 background: #ececf5;
 border-radius: 2px;
 overflow: hidden;
 min-width: 180px;
}

.qd-progress-fill {
 height: 100%;
 background: linear-gradient(90deg, var(--violet) 0%, #8c6dff 100%);
 width: 20%;
 transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
 box-shadow: 0 0 12px rgba(91, 61, 232, 0.45);
 position: relative;
 overflow: hidden;
}

.qd-progress-fill::after {
 content: '';
 position: absolute;
 top: 0; bottom: 0;
 left: -45%;
 width: 45%;
 background: linear-gradient(90deg,
 transparent 0%,
 rgba(255, 255, 255, 0.55) 50%,
 transparent 100%);
 animation: qdProgressShimmer 2.4s linear infinite;
}

@keyframes qdProgressShimmer {
 0% { left: -45%; }
 100% { left: 110%; }
}

.qd-step-dots {
 display: flex;
 gap: 6px;
}

.qd-dot {
 font-family: var(--mono);
 font-size: 9px;
 font-weight: 400;
 letter-spacing: 0.1em;
 color: var(--ink-light);
 background: transparent;
 border: 1px solid var(--border);
 border-radius: 2px;
 padding: 6px 9px;
 cursor: pointer;
 transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.qd-dot:hover { color: var(--ink-muted); border-color: var(--ink-muted); }
.qd-dot.is-complete {
 color: var(--violet);
 border-color: var(--violet-border);
 background: var(--violet-dim);
}
.qd-dot.is-active {
 color: var(--white);
 background: var(--ink);
 border-color: var(--ink);
}

/* ── Layout grid ──────────────────────────────────── */
.qd-grid {
 display: grid;
 grid-template-columns: minmax(0, 1fr) 320px;
 gap: 0;
}

.qd-stage {
 position: relative;
 padding: 48px 44px;
 min-height: 540px;
 border-right: 1px solid var(--border);
 min-width: 0;
}

/* ── Step blocks ──────────────────────────────────── */
.qd-step {
 display: none;
 animation: qdStepIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.qd-step.is-active { display: block; }

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

.qd-step-head {
 margin-bottom: 32px;
}

.qd-eyebrow {
 display: inline-flex;
 align-items: center;
 gap: 8px;
 font-family: var(--mono);
 font-size: 10px;
 font-weight: 400;
 letter-spacing: 0.2em;
 text-transform: uppercase;
 color: var(--ink-light);
 margin-bottom: 12px;
}

.qd-eyebrow::before {
 content: '';
 width: 5px;
 height: 5px;
 border-radius: 50%;
 background: var(--violet);
 box-shadow: 0 0 0 0 rgba(91, 61, 232, 0.55);
 animation: qdDotPulse 1.8s ease-out infinite;
 flex-shrink: 0;
}

@keyframes qdDotPulse {
 0% { box-shadow: 0 0 0 0 rgba(91, 61, 232, 0.55); }
 70% { box-shadow: 0 0 0 9px rgba(91, 61, 232, 0); }
 100% { box-shadow: 0 0 0 0 rgba(91, 61, 232, 0); }
}

.qd-step-title {
 font-family: var(--sans);
 font-size: clamp(22px, 2.6vw, 28px);
 font-weight: 500;
 letter-spacing: -0.025em;
 color: var(--ink);
 margin: 0 0 8px;
 line-height: 1.2;
}

.qd-step-sub {
 font-family: var(--mono);
 font-size: 11px;
 font-weight: 300;
 color: var(--ink-muted);
 line-height: 1.7;
 letter-spacing: 0.02em;
 margin: 0;
 max-width: 520px;
}

/* ── Question rows ────────────────────────────────── */
.qd-q {
 margin-bottom: 28px;
 min-width: 0;
}

.qd-label {
 display: block;
 font-family: var(--mono);
 font-size: 10px;
 font-weight: 400;
 letter-spacing: 0.2em;
 text-transform: uppercase;
 color: var(--ink-muted);
 margin-bottom: 12px;
}

/* ── Chips (single + multi) ───────────────────────── */
.qd-chips {
 display: flex;
 flex-wrap: wrap;
 gap: 8px;
}

.qd-chip {
 font-family: var(--mono);
 font-size: 11px;
 font-weight: 400;
 letter-spacing: 0.04em;
 color: var(--ink);
 background: var(--white);
 border: 1px solid var(--border);
 border-radius: 2px;
 padding: 10px 14px;
 cursor: pointer;
 transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.12s ease;
      position: relative;
    }

.qd-chip:hover {
 border-color: var(--ink);
 background: #fafafa;
}

.qd-chip.is-selected {
 border-color: var(--violet);
 background: var(--violet);
 color: var(--white);
 box-shadow: 0 4px 14px rgba(91, 61, 232, 0.22);
}

.qd-chips--multi .qd-chip.is-selected {
 background: var(--violet-dim);
 color: var(--violet);
 border-color: var(--violet-border);
 box-shadow: none;
}

.qd-chips--multi .qd-chip.is-selected::before {
 content: '✓ ';
 font-weight: 700;
 margin-right: 2px;
}

.qd-chip:active { transform: translateY(1px); }

/* Ripple ring fired once when a chip becomes selected (qualify.js
 adds .is-just-selected for ~650ms). */
.qd-chip.is-just-selected::after {
 content: '';
 position: absolute;
 inset: -3px;
 border-radius: 4px;
 border: 1px solid var(--violet);
 pointer-events: none;
 animation: qdChipRipple 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes qdChipRipple {
 0% { transform: scale(0.94); opacity: 0.75; }
 100% { transform: scale(1.18); opacity: 0; }
}

/* ── Inputs (reuse cf- styles, slight overrides) ──── */
.qd-select,
.qd-textarea {
 background: var(--white);
}

.qd .cf-select.qd-select {
 min-width: 0;
 max-width: 100%;
 overflow: hidden;
 text-overflow: ellipsis;
 white-space: nowrap;
}

.qd-textarea { min-height: 100px; }

/* ── Divider ──────────────────────────────────────── */
.qd-divider {
 height: 1px;
 background: var(--border);
 margin: 36px 0 8px;
}

/* ── Consent ──────────────────────────────────────── */
.qd-consent {
 margin-top: 18px;
}

.qd-consent-row {
 display: flex;
 align-items: flex-start;
 gap: 10px;
 font-family: var(--mono);
 font-size: 11px;
 font-weight: 300;
 color: var(--ink-muted);
 line-height: 1.6;
 letter-spacing: 0.02em;
 cursor: pointer;
}

.qd-consent-row input[type="checkbox"] {
 margin-top: 3px;
 accent-color: var(--violet);
 width: 14px;
 height: 14px;
 cursor: pointer;
}

/* ── Side panel ───────────────────────────────────── */
.qd-side {
 padding: 36px 28px;
 background: linear-gradient(180deg, #fafbff 0%, #f4f3fa 100%);
 display: flex;
 flex-direction: column;
 gap: 20px;
}

.qd-side-card {
 border: 1px solid var(--border);
 border-radius: var(--radius-md);
 background: var(--white);
 padding: 24px 22px;
 box-shadow: var(--shadow-elevated);
}

.qd-side-eyebrow {
 font-family: var(--mono);
 font-size: 9px;
 font-weight: 400;
 letter-spacing: 0.22em;
 text-transform: uppercase;
 color: var(--violet);
 margin-bottom: 8px;
}

.qd-side-title {
 font-family: var(--sans);
 font-size: 17px;
 font-weight: 500;
 color: var(--ink);
 letter-spacing: -0.015em;
 margin-bottom: 6px;
}

.qd-side-sub {
 font-family: var(--mono);
 font-size: 10px;
 font-weight: 300;
 color: var(--ink-muted);
 line-height: 1.6;
 letter-spacing: 0.02em;
 margin: 0 0 18px;
}

.qd-summary {
 display: flex;
 flex-direction: column;
 gap: 0;
 border-top: 1px solid var(--border);
}

.qd-sum-row {
 display: flex;
 align-items: center;
 justify-content: space-between;
 padding: 9px 0;
 border-bottom: 1px dashed var(--border);
 font-family: var(--mono);
 font-size: 10px;
 letter-spacing: 0.04em;
 gap: 10px;
}

.qd-sum-k {
 color: var(--ink-light);
 text-transform: uppercase;
 letter-spacing: 0.14em;
 font-size: 9px;
 white-space: nowrap;
}

.qd-sum-v {
 color: var(--ink);
 font-weight: 400;
 text-align: right;
 max-width: 60%;
 overflow: hidden;
 text-overflow: ellipsis;
 white-space: nowrap;
 transition: color 0.2s ease;
}

.qd-sum-row.is-set .qd-sum-v { color: var(--violet); }
.qd-sum-row.just-updated .qd-sum-v {
 animation: qdSumPulse 0.5s ease;
}

@keyframes qdSumPulse {
 0% { color: var(--violet); transform: translateX(2px); }
 100% { color: var(--violet); transform: translateX(0); }
}

.qd-side-meter {
 margin-top: 18px;
 padding-top: 16px;
 border-top: 1px solid var(--border);
}

.qd-side-meter-label {
 display: flex;
 justify-content: space-between;
 font-family: var(--mono);
 font-size: 9px;
 letter-spacing: 0.18em;
 text-transform: uppercase;
 color: var(--ink-light);
 margin-bottom: 8px;
}

.qd-side-meter-bar {
 height: 4px;
 background: #ececf5;
 border-radius: 2px;
 overflow: hidden;
}

.qd-side-meter-fill {
 height: 100%;
 width: 0%;
 background: linear-gradient(90deg, var(--violet) 0%, #8c6dff 100%);
 transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.qd-trust {
 display: flex;
 gap: 12px;
 align-items: flex-start;
 padding: 14px 16px;
 border: 1px dashed var(--violet-border);
 border-radius: var(--radius-md);
 background: var(--violet-dim);
}

.qd-trust-icon {
 font-size: 14px;
 color: var(--violet);
 line-height: 1.2;
 flex-shrink: 0;
}

.qd-trust-title {
 font-family: var(--mono);
 font-size: 10px;
 font-weight: 500;
 letter-spacing: 0.06em;
 color: var(--ink);
 margin-bottom: 4px;
}

.qd-trust-body {
 font-family: var(--mono);
 font-size: 10px;
 font-weight: 300;
 color: var(--ink-muted);
 line-height: 1.6;
 letter-spacing: 0.02em;
}

/* ── Controls ─────────────────────────────────────── */
.qd-controls {
 padding: 22px 28px;
 background: #fafbff;
 display: flex;
 align-items: center;
 justify-content: space-between;
 flex-wrap: wrap;
 gap: 14px;
}

.qd-controls--top {
 padding: 16px 28px;
 border-top: 1px solid var(--border);
 border-bottom: 1px solid var(--border);
 background: linear-gradient(180deg, #fcfdff 0%, #f6f7fc 100%);
}

.qd-controls--bottom {
 border-top: 1px solid var(--border);
}

.qd-error {
 font-family: var(--mono);
 font-size: 11px;
 color: var(--red);
 letter-spacing: 0.04em;
 min-height: 16px;
 flex: 1 1 200px;
}

.qd-buttons {
 display: flex;
 gap: 10px;
 align-items: center;
 margin-left: auto;
}

.qd-back:disabled {
 opacity: 0.4;
 cursor: not-allowed;
}

.qd-submit[disabled] {
 opacity: 0.7;
 cursor: progress;
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 960px) {
 .qd-grid {
 grid-template-columns: minmax(0, 1fr);
 }

 .qd-stage {
 padding: 36px 24px;
 border-right: none;
 border-bottom: 1px solid var(--border);
 min-height: 0;
 }

 .qd-side {
 padding: 28px 24px;
 }

 .qd-progress {
 padding: 16px 20px;
 }

 .qd-step-dots {
 flex-wrap: wrap;
 justify-content: flex-start;
 }
}

@media (max-width: 600px) {
 .qual-hero {
 padding: calc(var(--header-h) + 48px) 0 72px;
 }

 .qd { margin-top: 32px; }

 .qd-progress {
 flex-direction: column;
 align-items: flex-start;
 gap: 14px;
 }

 .qd-step-dots {
 width: 100%;
 justify-content: space-between;
 }

 .qd-stage {
 padding: 28px 20px;
 }

 .qd .cf-select.qd-select {
 font-size: 16px;
 }

 .qd-controls {
 padding: 18px 20px;
 }

 .qd-buttons {
 width: 100%;
 justify-content: space-between;
 }

 .qd-buttons .btn {
 flex: 1 1 auto;
 padding: 12px 16px;
 }

 .cf-row { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════
 Alive layer - particles, aurora, engine badge, live card
══════════════════════════════════════════════════════ */

/* Particle canvas behind the hero (shared.js initParticleCanvas).
 z-index sits above grid-bg (0) but below the container (2). */
.qd-particles {
 position: absolute;
 inset: 0;
 width: 100%;
 height: 100%;
 pointer-events: none;
 z-index: 1;
}

/* Soft drifting aurora behind the form */
.qd-aurora {
 position: absolute;
 top: -120px;
 right: -160px;
 width: 620px;
 height: 620px;
 border-radius: 50%;
 background: radial-gradient(closest-side,
 rgba(91, 61, 232, 0.18) 0%,
 rgba(91, 61, 232, 0.06) 40%,
 transparent 75%);
 filter: blur(28px);
 pointer-events: none;
 z-index: 0;
 animation: qdAuroraDrift 18s ease-in-out infinite alternate;
}

@keyframes qdAuroraDrift {
 0% { transform: translate(0, 0) scale(1); opacity: 0.95; }
 50% { transform: translate(-40px, 30px) scale(1.04); opacity: 1; }
 100% { transform: translate(20px, -20px) scale(0.98); opacity: 0.85; }
}

@media (prefers-reduced-motion: reduce) {
 .qd-aurora,
 .qd-progress-fill::after,
 .qd-engine-dot,
 .qd-eyebrow::before,
 .qd-live-radar::before,
 .qd-live-radar::after { animation: none !important; }
}

/* Hero "live engine" badge (replaces plain eyebrow) */
.qd-engine-badge {
 display: inline-flex !important;
 align-items: center;
 gap: 9px;
 padding: 7px 13px 7px 11px;
 border: 1px solid var(--violet-border);
 background: var(--violet-dim);
 border-radius: 2px;
 color: var(--violet);
 font-family: var(--mono);
 font-size: 10px;
 font-weight: 400;
 letter-spacing: 0.18em;
 text-transform: uppercase;
}

.qd-engine-dot {
 display: inline-block;
 width: 6px;
 height: 6px;
 border-radius: 50%;
 background: var(--violet);
 box-shadow: 0 0 0 0 rgba(91, 61, 232, 0.55);
 animation: qdEnginePulse 1.8s ease-out infinite;
}

@keyframes qdEnginePulse {
 0% { box-shadow: 0 0 0 0 rgba(91, 61, 232, 0.55); transform: scale(1); }
 70% { box-shadow: 0 0 0 10px rgba(91, 61, 232, 0); transform: scale(1.05); }
 100% { box-shadow: 0 0 0 0 rgba(91, 61, 232, 0); transform: scale(1); }
}

/* Animated angle for the rotating conic-gradient on the live card.
 @property lets us animate the gradient's `from` angle directly,
 which spins the colours in place without resizing or transforming
 the element - so the aura stays tightly hugging the card. */
@property --qd-aura-angle {
 syntax: '<angle>';
 inherits: false;
 initial-value: 0deg;
}

/* Wrapper that holds the rotating RGB aura behind the live card.
 The ::before sits just outside the card border and acts as a thin
 blurred "halo" that rotates through the brand spectrum. */
.qd-live-wrap {
 position: relative;
 border-radius: var(--radius-md);
 isolation: isolate;
}

.qd-live-wrap::before {
 content: '';
 position: absolute;
 inset: -3px;
 border-radius: calc(var(--radius-md) + 3px);
 background: conic-gradient(
 from var(--qd-aura-angle, 0deg),
 #5b3de8,
 #8c6dff,
 #38bdf8,
 #34d399,
 #fbbf24,
 #ec4899,
 #5b3de8
 );
 filter: blur(6px);
 opacity: 0.75;
 z-index: -1;
 pointer-events: none;
 animation: qdLiveAura 5s linear infinite;
}

@keyframes qdLiveAura {
 to { --qd-aura-angle: 360deg; }
}

@media (prefers-reduced-motion: reduce) {
 .qd-live-wrap::before { animation: none; opacity: 0.45; }
}

/* Live ML engine card in the side panel */
.qd-live {
 display: flex;
 align-items: center;
 gap: 14px;
 padding: 14px 16px;
 border: 1px solid var(--border);
 border-radius: var(--radius-md);
 background: linear-gradient(180deg, #ffffff 0%, #fafbff 100%);
 box-shadow: var(--shadow-elevated);
 position: relative;
 overflow: hidden;
}

.qd-live::before {
 content: '';
 position: absolute;
 top: 0; bottom: 0;
 left: -50%;
 width: 50%;
 background: linear-gradient(90deg,
 transparent 0%,
 rgba(91, 61, 232, 0.06) 50%,
 transparent 100%);
 animation: qdLiveSweep 4s linear infinite;
 pointer-events: none;
}

@keyframes qdLiveSweep {
 0% { left: -50%; }
 100% { left: 110%; }
}

@media (prefers-reduced-motion: reduce) {
 .qd-live::before { animation: none; }
}

.qd-live-radar {
 position: relative;
 width: 32px;
 height: 32px;
 border-radius: 50%;
 background: radial-gradient(circle at center,
 rgba(91, 61, 232, 0.20) 0%,
 rgba(91, 61, 232, 0.04) 60%,
 transparent 100%);
 flex-shrink: 0;
}

.qd-live-radar::before,
.qd-live-radar::after {
 content: '';
 position: absolute;
 inset: 4px;
 border-radius: 50%;
 border: 1px solid rgba(91, 61, 232, 0.5);
 animation: qdRadar 2.6s ease-out infinite;
 opacity: 0;
}

.qd-live-radar::after { animation-delay: 1.3s; }

@keyframes qdRadar {
 0% { transform: scale(0.35); opacity: 0.85; }
 100% { transform: scale(1.6); opacity: 0; }
}

.qd-live-radar-dot {
 position: absolute;
 top: 50%; left: 50%;
 width: 7px; height: 7px;
 margin: -3.5px 0 0 -3.5px;
 background: var(--violet);
 border-radius: 50%;
 box-shadow: 0 0 10px rgba(91, 61, 232, 0.8);
}

.qd-live-text { min-width: 0; flex: 1; position: relative; z-index: 1; }

.qd-live-label {
 font-family: var(--mono);
 font-size: 9px;
 font-weight: 400;
 letter-spacing: 0.22em;
 text-transform: uppercase;
 color: var(--violet);
 margin-bottom: 4px;
}

.qd-live-status {
 font-family: var(--mono);
 font-size: 11px;
 font-weight: 300;
 color: var(--ink-muted);
 letter-spacing: 0.02em;
 white-space: nowrap;
 overflow: hidden;
 text-overflow: ellipsis;
}

.qd-live-status.is-fade-in {
 animation: qdStatusIn 0.4s ease-out;
}

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

/* ══════════════════════════════════════════════════════
 Opportunity Index - hero gauge in the side card
══════════════════════════════════════════════════════ */
.qd-opp {
 margin: 4px 0 22px;
 padding-bottom: 22px;
 border-bottom: 1px solid var(--border);
}

.qd-opp-head {
 display: flex;
 justify-content: space-between;
 align-items: center;
 gap: 8px;
 margin-bottom: 8px;
}

.qd-opp-label {
 font-family: var(--mono);
 font-size: 9px;
 font-weight: 400;
 letter-spacing: 0.22em;
 text-transform: uppercase;
 color: var(--ink-muted);
}

.qd-opp-tier {
 font-family: var(--mono);
 font-size: 9px;
 font-weight: 500;
 letter-spacing: 0.16em;
 text-transform: uppercase;
 color: var(--ink-light);
 padding: 4px 8px;
 border-radius: 2px;
      border: 1px solid var(--border);
 background: #fafafa;
 transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.qd-opp-tier[data-tier="latent"] { color: var(--ink-muted); }
.qd-opp-tier[data-tier="emerging"] { color: #d97706; border-color: rgba(217, 119, 6, 0.3); background: rgba(217, 119, 6, 0.06); }
.qd-opp-tier[data-tier="material"] { color: var(--violet); border-color: var(--violet-border); background: var(--violet-dim); }
.qd-opp-tier[data-tier="high"] { color: #ffffff; border-color: var(--violet); background: var(--violet); }

.qd-opp-score-wrap {
 display: flex;
 align-items: baseline;
 gap: 4px;
 margin-bottom: 10px;
}

.qd-opp-score {
 font-family: var(--sans);
 font-size: 56px;
 font-weight: 600;
 line-height: 1;
 letter-spacing: -0.04em;
 color: var(--ink);
 background: linear-gradient(180deg, var(--ink) 0%, #2a2440 100%);
 -webkit-background-clip: text;
 background-clip: text;
 color: transparent;
 transition: color 0.4s ease;
}

.qd-opp.is-elevated .qd-opp-score {
 background: linear-gradient(180deg, var(--violet) 0%, #8c6dff 100%);
 -webkit-background-clip: text;
 background-clip: text;
 color: transparent;
}

.qd-opp-score-suffix {
 font-family: var(--mono);
 font-size: 13px;
 font-weight: 300;
 color: var(--ink-light);
 letter-spacing: 0.04em;
}

.qd-opp-bar {
 position: relative;
 height: 6px;
 background: #ececf5;
 border-radius: 3px;
 overflow: hidden;
}

.qd-opp-bar-fill {
 height: 100%;
 width: 0%;
 background: linear-gradient(90deg, #d97706 0%, var(--violet) 50%, #8c6dff 100%);
      border-radius: 3px;
 transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
 box-shadow: 0 0 14px rgba(91, 61, 232, 0.45);
}

.qd-opp-bar-median {
 position: absolute;
 top: -2px;
 bottom: -2px;
 left: 58%;
 width: 1px;
 background: var(--ink);
 opacity: 0.35;
}

.qd-opp-foot {
 display: flex;
 justify-content: space-between;
 align-items: center;
 margin-top: 8px;
 font-family: var(--mono);
 font-size: 9px;
 letter-spacing: 0.06em;
 color: var(--ink-light);
}

.qd-opp-median-label {
 text-transform: uppercase;
 letter-spacing: 0.12em;
}

/* Pulse the score when it bumps. JS adds .qd-opp-score--bump briefly. */
.qd-opp-score--bump {
 animation: qdOppBump 0.5s ease-out;
}

@keyframes qdOppBump {
 0% { transform: scale(1); }
 40% { transform: scale(1.08); }
 100% { transform: scale(1); }
}

/* ══════════════════════════════════════════════════════
 Micro-insight banner (between steps)
══════════════════════════════════════════════════════ */
.qd-insight {
 display: flex;
 align-items: flex-start;
 gap: 12px;
 margin-bottom: 28px;
 padding: 14px 16px 14px 18px;
 border: 1px solid var(--violet-border);
 border-left: 3px solid var(--violet);
 border-radius: var(--radius-md);
 background: linear-gradient(180deg, rgba(91, 61, 232, 0.04) 0%, rgba(91, 61, 232, 0.02) 100%);
 position: relative;
 animation: qdInsightIn 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.qd-insight[hidden] { display: none; }

@keyframes qdInsightIn {
 from { opacity: 0; transform: translateY(-6px); }
 to { opacity: 1; transform: translateY(0); }
}

.qd-insight-icon {
 font-size: 14px;
 color: var(--violet);
 line-height: 1.2;
 flex-shrink: 0;
 margin-top: 2px;
}

.qd-insight-body { flex: 1; min-width: 0; }

.qd-insight-eyebrow {
 font-family: var(--mono);
 font-size: 9px;
 font-weight: 400;
 letter-spacing: 0.22em;
 text-transform: uppercase;
 color: var(--violet);
 margin-bottom: 4px;
}

.qd-insight-text {
 font-family: var(--mono);
 font-size: 12px;
 font-weight: 300;
 line-height: 1.65;
 color: var(--ink);
 letter-spacing: 0.02em;
}

.qd-insight-close {
 background: none;
 border: none;
 color: var(--ink-light);
 font-size: 18px;
 line-height: 1;
 cursor: pointer;
 padding: 4px 6px;
 border-radius: 2px;
 transition: color 0.15s ease, background 0.15s ease;
 flex-shrink: 0;
}

.qd-insight-close:hover { color: var(--ink); background: rgba(0, 0, 0, 0.04); }

/* ══════════════════════════════════════════════════════
 Conditional question block (model-specific follow-up)
══════════════════════════════════════════════════════ */
.qd-cond {
 margin: -12px 0 28px;
 padding: 18px 18px 6px;
 border: 1px dashed var(--violet-border);
 border-radius: var(--radius-md);
 background: linear-gradient(180deg, rgba(91, 61, 232, 0.03) 0%, transparent 100%);
 animation: qdCondIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.qd-cond[hidden] { display: none; }

@keyframes qdCondIn {
 from { opacity: 0; transform: translateY(-4px); max-height: 0; }
 to { opacity: 1; transform: translateY(0); max-height: 600px; }
}

.qd-cond-tag {
 display: inline-flex;
 align-items: center;
 gap: 6px;
 font-family: var(--mono);
 font-size: 9px;
 font-weight: 400;
 letter-spacing: 0.18em;
 text-transform: uppercase;
 color: var(--violet);
 margin-bottom: 12px;
}

.qd-cond-tag::before {
 content: '↳';
 font-size: 12px;
 line-height: 1;
}

.qd-cond-variant[hidden] { display: none; }

.qd-cond-variant .qd-q { margin-bottom: 6px; }

/* ══════════════════════════════════════════════════════
 Stack constellation (SVG node graph)
══════════════════════════════════════════════════════ */
.qd-network {
 margin: 4px 0 32px;
 padding: 18px 20px 16px;
 border: 1px solid var(--border);
 border-radius: var(--radius-md);
 background: linear-gradient(180deg, #0c0e16 0%, #07080d 100%);
 box-shadow: 0 24px 64px rgba(91, 61, 232, 0.15), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
 position: relative;
 overflow: hidden;
}

.qd-network::before {
 content: '';
 position: absolute;
 inset: 0;
 background:
 radial-gradient(600px 300px at 50% 50%, rgba(91, 61, 232, 0.12), transparent 70%),
 radial-gradient(circle at 50% 50%, transparent 0, rgba(255, 255, 255, 0.015) 1px, transparent 2px) 0 0 / 24px 24px;
 pointer-events: none;
}

.qd-network-head {
 display: flex;
 justify-content: space-between;
 align-items: center;
 gap: 12px;
 margin-bottom: 6px;
 position: relative;
 z-index: 1;
}

.qd-network-eyebrow {
 display: inline-flex;
 align-items: center;
 gap: 8px;
 font-family: var(--mono);
 font-size: 9px;
 font-weight: 400;
 letter-spacing: 0.22em;
 text-transform: uppercase;
 color: rgba(140, 109, 255, 0.95);
}

.qd-network-eyebrow::before {
 content: '';
 width: 5px;
 height: 5px;
 border-radius: 50%;
 background: #8c6dff;
 box-shadow: 0 0 8px rgba(140, 109, 255, 0.85);
 animation: qdDotPulse 1.8s ease-out infinite;
}

.qd-network-meta {
 font-family: var(--mono);
 font-size: 10px;
 letter-spacing: 0.06em;
 color: rgba(255, 255, 255, 0.55);
}

.qd-network-svg {
 display: block;
 width: 100%;
 height: 280px;
 position: relative;
 z-index: 1;
}

.qd-network-legend {
 display: flex;
 flex-wrap: wrap;
 gap: 12px 16px;
 padding-top: 10px;
 margin-top: 4px;
 border-top: 1px solid rgba(255, 255, 255, 0.06);
 font-family: var(--mono);
 font-size: 9px;
 letter-spacing: 0.1em;
 text-transform: uppercase;
 color: rgba(255, 255, 255, 0.55);
 position: relative;
 z-index: 1;
}

.qd-network-legend-item {
 display: inline-flex;
 align-items: center;
 gap: 6px;
}

.qd-network-swatch {
 width: 10px;
 height: 10px;
 border-radius: 50%;
 display: inline-block;
}

.qd-network-swatch[data-cat="crm"] { background: #8c6dff; box-shadow: 0 0 6px rgba(140, 109, 255, 0.7); }
.qd-network-swatch[data-cat="finance"] { background: #38bdf8; box-shadow: 0 0 6px rgba(56, 189, 248, 0.65); }
.qd-network-swatch[data-cat="ops"] { background: #c084fc; box-shadow: 0 0 6px rgba(192, 132, 252, 0.65); }
.qd-network-swatch[data-cat="ecom"] { background: #fbbf24; box-shadow: 0 0 6px rgba(251, 191, 36, 0.6); }
.qd-network-swatch[data-cat="auto"] { background: #34d399; box-shadow: 0 0 6px rgba(52, 211, 153, 0.6); }

.qd-network-dash {
 display: inline-block;
 width: 16px;
 height: 1px;
 background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.55) 0 4px, transparent 4px 7px);
}

/* SVG node + link styling */
.qd-net-center circle {
 fill: rgba(91, 61, 232, 0.18);
 stroke: var(--violet);
 stroke-width: 1.5;
}

.qd-net-center-pulse {
 fill: none;
 stroke: var(--violet);
 stroke-width: 1;
 opacity: 0.5;
 transform-box: fill-box;
 transform-origin: center;
 animation: qdNetPulse 2.4s ease-out infinite;
}

@keyframes qdNetPulse {
 0% { transform: scale(0.6); opacity: 0.7; }
 100% { transform: scale(1.5); opacity: 0; }
}

.qd-net-center text {
 font-family: var(--mono);
 font-size: 10px;
 font-weight: 500;
 letter-spacing: 0.18em;
 fill: rgba(255, 255, 255, 0.95);
 text-transform: uppercase;
}

.qd-net-empty {
 font-family: var(--mono);
 font-size: 11px;
 fill: rgba(255, 255, 255, 0.45);
 letter-spacing: 0.04em;
}

.qd-net-link {
 stroke-width: 1;
 fill: none;
}

.qd-net-link--core {
 stroke: rgba(255, 255, 255, 0.18);
 stroke-dasharray: 1000;
 stroke-dashoffset: 1000;
 animation: qdNetDraw 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
 animation-delay: calc(var(--i, 0) * 50ms + 100ms);
}

.qd-net-link--integration {
 stroke: rgba(140, 109, 255, 0.55);
 stroke-dasharray: 4 5;
 stroke-width: 1.2;
 opacity: 0;
 /* Two animations: a one-shot fade-in, then continuous flowing dashes
 to make the link feel "live" with energy moving along it. */
 animation:
 qdNetIntegrationIn 0.5s ease-out 700ms forwards,
 qdNetIntegrationFlow 1.6s linear infinite;
 animation-delay: 700ms, calc(900ms + var(--i, 0) * 70ms);
 filter: drop-shadow(0 0 4px rgba(140, 109, 255, 0.4));
 transition: opacity 0.2s ease, stroke-width 0.2s ease, stroke 0.2s ease;
}

@keyframes qdNetDraw {
 to { stroke-dashoffset: 0; }
}

@keyframes qdNetIntegrationIn {
 to { opacity: 1; }
}

/* 9px = one dasharray cycle (4 + 5). Animate to -9 for forward flow. */
@keyframes qdNetIntegrationFlow {
 to { stroke-dashoffset: -9; }
}

.qd-net-node {
 opacity: 0;
 transform-box: fill-box;
 transform-origin: center;
 animation: qdNetNodeIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
 animation-delay: calc(var(--i, 0) * 60ms + 200ms);
 cursor: pointer;
 transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Invisible widened hit-area so hover/tap targets work cleanly without
 bloating the visual node. Explicitly strip every paint property so
 no category styling can leak onto it. */
.qd-net-node .qd-net-hit {
 fill: transparent !important;
 stroke: none !important;
 filter: none !important;
 pointer-events: all;
}

@keyframes qdNetNodeIn {
 from { opacity: 0; transform: scale(0.3); }
 to { opacity: 1; transform: scale(1); }
}

/* Style only the VISIBLE dot - not the invisible .qd-net-hit overlay. */
.qd-net-node .qd-net-dot {
 stroke-width: 1.5;
 transition: r 0.2s ease, filter 0.2s ease;
}

.qd-net-node[data-cat="crm"] .qd-net-dot { fill: rgba(140, 109, 255, 0.22); stroke: #8c6dff; filter: drop-shadow(0 0 6px rgba(140, 109, 255, 0.55)); }
.qd-net-node[data-cat="finance"] .qd-net-dot { fill: rgba(56, 189, 248, 0.20); stroke: #38bdf8; filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.5)); }
.qd-net-node[data-cat="ops"] .qd-net-dot { fill: rgba(192, 132, 252, 0.20); stroke: #c084fc; filter: drop-shadow(0 0 6px rgba(192, 132, 252, 0.5)); }
.qd-net-node[data-cat="ecom"] .qd-net-dot { fill: rgba(251, 191, 36, 0.18); stroke: #fbbf24; filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.5)); }
.qd-net-node[data-cat="auto"] .qd-net-dot { fill: rgba(52, 211, 153, 0.18); stroke: #34d399; filter: drop-shadow(0 0 6px rgba(52, 211, 153, 0.5)); }

.qd-net-node text {
 font-family: var(--mono);
 font-size: 10px;
 font-weight: 400;
 fill: rgba(255, 255, 255, 0.85);
 letter-spacing: 0.02em;
}

.qd-net-node:hover .qd-net-dot {
 filter: drop-shadow(0 0 12px rgba(140, 109, 255, 0.85));
}

/* ── Focus mode: hovering a node dims everything else and lights
 up the hovered node plus its directly-connected siblings & links.
 JS toggles .is-focusing on the SVG and .is-active on the matches. */
.qd-network-svg.is-focusing .qd-net-node { opacity: 0.22; }
.qd-network-svg.is-focusing .qd-net-link { opacity: 0.1; }
.qd-network-svg.is-focusing .qd-net-link--core { opacity: 0.06; }
.qd-network-svg.is-focusing .qd-net-center { opacity: 0.4; }

.qd-network-svg.is-focusing .qd-net-node.is-active { opacity: 1; transform: scale(1.12); }
.qd-network-svg.is-focusing .qd-net-link--core.is-active { opacity: 1; stroke: rgba(255, 255, 255, 0.5); stroke-width: 1.5; }
.qd-network-svg.is-focusing .qd-net-link--integration.is-active {
 opacity: 1;
 stroke: rgba(140, 109, 255, 1);
 stroke-width: 1.8;
 filter: drop-shadow(0 0 8px rgba(140, 109, 255, 0.85));
}

.qd-net-node.is-leaving {
 animation: qdNetNodeOut 0.28s ease-in forwards !important;
}

@keyframes qdNetNodeOut {
 from { opacity: 1; transform: scale(1); }
 to { opacity: 0; transform: scale(0.4); }
}

/* ── Floating tooltip ────────────────────────────────── */
.qd-net-tip {
 position: absolute;
 pointer-events: none;
 padding: 8px 12px;
 background: rgba(10, 11, 16, 0.96);
 border: 1px solid rgba(140, 109, 255, 0.45);
 border-radius: var(--radius-sm);
 font-family: var(--mono);
 font-size: 11px;
 color: rgba(255, 255, 255, 0.92);
 letter-spacing: 0.02em;
 z-index: 10;
 transform: translate(-50%, calc(-100% - 14px));
 white-space: nowrap;
 box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
 opacity: 0;
 transition: opacity 0.15s ease;
}

.qd-net-tip:not([hidden]) { opacity: 1; }

.qd-net-tip-name {
 font-family: var(--sans);
 font-size: 13px;
 font-weight: 500;
 color: #ffffff;
 letter-spacing: -0.005em;
}

.qd-net-tip-meta {
 display: flex;
 gap: 8px;
 margin-top: 3px;
 font-size: 10px;
 color: rgba(255, 255, 255, 0.55);
 letter-spacing: 0.08em;
 text-transform: uppercase;
}

.qd-net-tip-meta .qd-net-tip-cat-dot {
 width: 7px;
 height: 7px;
 border-radius: 50%;
 display: inline-block;
 margin-right: 4px;
 vertical-align: middle;
 position: relative;
 top: -1px;
}

.qd-net-tip-hint {
 margin-top: 6px;
 padding-top: 6px;
 border-top: 1px dashed rgba(255, 255, 255, 0.15);
 font-size: 9px;
 letter-spacing: 0.12em;
 text-transform: uppercase;
 color: rgba(140, 109, 255, 0.9);
}

/* Tooltip pointer arrow */
.qd-net-tip::after {
 content: '';
 position: absolute;
 bottom: -5px;
 left: 50%;
 transform: translateX(-50%) rotate(45deg);
 width: 8px;
 height: 8px;
 background: rgba(10, 11, 16, 0.96);
 border-right: 1px solid rgba(140, 109, 255, 0.45);
 border-bottom: 1px solid rgba(140, 109, 255, 0.45);
}

/* ── Legend hint line ────────────────────────────────── */
.qd-network-legend-hint {
 flex: 0 0 100%;
 margin-top: 4px;
 font-family: var(--mono);
 font-size: 9px;
 letter-spacing: 0.14em;
 text-transform: uppercase;
 color: rgba(140, 109, 255, 0.85);
}

@media (prefers-reduced-motion: reduce) {
 .qd-net-link--core,
 .qd-net-link--integration,
 .qd-net-node,
 .qd-net-center-pulse {
 animation: none !important;
 opacity: 1 !important;
 stroke-dashoffset: 0 !important;
 transform: none !important;
 }
}

@media (max-width: 600px) {
 .qd-network-svg { height: 240px; }
 .qd-network-head { flex-direction: column; align-items: flex-start; gap: 4px; }
 .qd-opp-score { font-size: 48px; }
}
