/* ============================================
   COST ADVISOR — Conversational UI + Deck Report
   ============================================ */

/* ========================
   MODE TOGGLE (Hero)
   ======================== */
.mode-toggle {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 28px;
    flex-wrap: wrap;
}

.mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px 28px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(232, 223, 208, 0.3));
    backdrop-filter: blur(12px);
    border: 2px solid rgba(45, 90, 71, 0.12);
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    min-width: 180px;
}

.mode-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 32px rgba(45, 90, 71, 0.12);
    border-color: rgba(45, 90, 71, 0.25);
}

.mode-btn:active {
    transform: scale(0.97);
    transition-duration: 0.08s;
}

.mode-btn--active {
    border-color: var(--color-hunter);
    background: linear-gradient(135deg, rgba(45, 90, 71, 0.08), rgba(212, 168, 83, 0.06));
    box-shadow: 0 4px 24px rgba(45, 90, 71, 0.15);
}

.mode-icon {
    font-size: 24px;
}

.mode-label {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 15px;
    color: var(--color-charcoal);
    letter-spacing: 0.5px;
}

.mode-desc {
    font-size: 12px;
    color: var(--color-charcoal-light);
    font-family: 'Inter', sans-serif;
}

/* ========================
   QUICK MODE OVERLAY/MODAL
   ======================== */
.qm-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(26, 61, 46, 0.35);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.qm-overlay.open {
    display: flex;
    opacity: 1;
}

.qm-modal {
    position: relative;
    width: 100%;
    max-width: 500px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.93) 0%, rgba(232, 223, 208, 0.15) 100%);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(45, 90, 71, 0.12);
    border-radius: 28px;
    padding: 36px 28px 28px;
    box-shadow:
        0 24px 80px rgba(26, 61, 46, 0.18),
        0 0 0 1px rgba(255, 255, 255, 0.4) inset;
    transform: translateY(30px) scale(0.94);
    opacity: 0;
    transition: all 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    max-height: 90vh;
    overflow-y: auto;
}

.qm-overlay.open .qm-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.qm-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(45, 90, 71, 0.06);
    border: 1px solid rgba(45, 90, 71, 0.08);
    font-size: 15px;
    color: var(--color-charcoal);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.qm-close:hover {
    background: rgba(45, 90, 71, 0.1);
    transform: rotate(90deg) scale(1.1);
}

.qm-close:active {
    transform: scale(0.9);
}

/* --- Progress Bar --- */
.qm-progress {
    height: 4px;
    border-radius: 4px;
    background: rgba(45, 90, 71, 0.06);
    margin-bottom: 28px;
    overflow: hidden;
    position: relative;
}

.qm-progress-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #2D5A47, #3d7a5e, #D4A853);
    width: 25%;
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.qm-progress-fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: -2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #D4A853;
    box-shadow: 0 0 8px rgba(212, 168, 83, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.qm-overlay.open .qm-progress-fill::after {
    opacity: 1;
}

/* --- Steps --- */
.qm-step {
    display: none;
    animation: qmStepIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.qm-step.active {
    display: block;
}

.qm-step-label {
    font-family: 'Rajdhani', sans-serif;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #D4A853;
    font-weight: 700;
    opacity: 0.8;
    margin-bottom: 8px;
}

.qm-question {
    font-family: 'Playfair Display', serif;
    font-size: 23px;
    color: var(--color-charcoal);
    margin: 0 0 22px;
    line-height: 1.3;
}

/* --- Sport Grid --- */
.qm-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.qm-sport-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 8px;
    border-radius: 16px;
    background: linear-gradient(160deg, rgba(45, 90, 71, 0.03) 0%, rgba(232, 223, 208, 0.08) 100%);
    border: 2px solid rgba(45, 90, 71, 0.06);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    /* Stagger animation — index set by JS via --i */
    animation: qmTileStagger 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: calc(var(--i, 0) * 55ms);
}

.qm-sport-tile:hover {
    background: linear-gradient(160deg, rgba(45, 90, 71, 0.06), rgba(212, 168, 83, 0.06));
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 6px 20px rgba(45, 90, 71, 0.1);
    border-color: rgba(45, 90, 71, 0.15);
}

.qm-sport-tile:active {
    transform: scale(0.94);
    transition-duration: 0.08s;
}

.qm-sport-tile.selected {
    border-color: var(--color-hunter);
    background: linear-gradient(135deg, rgba(45, 90, 71, 0.1), rgba(212, 168, 83, 0.08));
    box-shadow: 0 0 0 3px rgba(45, 90, 71, 0.08), 0 4px 16px rgba(45, 90, 71, 0.12);
    animation: qmSelectPulse 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.qm-sport-tile .qm-sport-emoji {
    font-size: 30px;
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.qm-sport-tile:hover .qm-sport-emoji {
    transform: scale(1.15);
}

.qm-sport-tile .qm-sport-name {
    font-size: 11px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    color: var(--color-charcoal);
    text-align: center;
    letter-spacing: 0.3px;
}

/* --- Pill Selectors --- */
.qm-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.qm-pill {
    padding: 12px 24px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(45, 90, 71, 0.03), rgba(232, 223, 208, 0.08));
    border: 2px solid rgba(45, 90, 71, 0.1);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    color: var(--color-charcoal);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.qm-pill:hover {
    border-color: rgba(45, 90, 71, 0.3);
    background: linear-gradient(135deg, rgba(45, 90, 71, 0.06), rgba(212, 168, 83, 0.06));
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 4px 16px rgba(45, 90, 71, 0.1);
}

.qm-pill:active {
    transform: scale(0.95);
    transition-duration: 0.08s;
}

.qm-pill.selected {
    border-color: var(--color-hunter);
    background: linear-gradient(135deg, #2D5A47, #3d7a5e);
    color: #fff;
    box-shadow: 0 4px 16px rgba(45, 90, 71, 0.25);
    animation: qmSelectPulse 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- Level Cards --- */
.qm-level-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.qm-level-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 18px;
    border-radius: 16px;
    background: linear-gradient(160deg, rgba(45, 90, 71, 0.02), rgba(232, 223, 208, 0.06));
    border: 2px solid rgba(45, 90, 71, 0.06);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.qm-level-card:hover {
    background: linear-gradient(160deg, rgba(45, 90, 71, 0.06), rgba(212, 168, 83, 0.06));
    transform: translateX(4px);
    border-color: rgba(45, 90, 71, 0.2);
    box-shadow: 0 4px 20px rgba(45, 90, 71, 0.08);
}

.qm-level-card:active {
    transform: scale(0.97);
    transition-duration: 0.08s;
}

.qm-level-card.selected {
    border-color: var(--color-hunter);
    background: linear-gradient(135deg, rgba(45, 90, 71, 0.08), rgba(212, 168, 83, 0.06));
    box-shadow: 0 0 0 3px rgba(45, 90, 71, 0.06), 0 4px 16px rgba(45, 90, 71, 0.12);
    animation: qmSelectPulse 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.qm-level-icon {
    font-size: 26px;
    flex-shrink: 0;
}

.qm-level-info h4 {
    margin: 0;
    font-size: 15px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    color: var(--color-charcoal);
    letter-spacing: 0.3px;
}

.qm-level-info p {
    margin: 3px 0 0;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    color: var(--color-charcoal-light);
    line-height: 1.4;
}

/* --- State Search --- */
.qm-state-search {
    margin-bottom: 12px;
}

.qm-state-input {
    width: 100%;
    padding: 14px 18px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(45, 90, 71, 0.03), rgba(232, 223, 208, 0.06));
    border: 1.5px solid rgba(45, 90, 71, 0.1);
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    color: var(--color-charcoal);
    outline: none;
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    box-sizing: border-box;
}

.qm-state-input:focus {
    border-color: var(--color-hunter);
    box-shadow: 0 0 0 3px rgba(45, 90, 71, 0.08);
}

.qm-state-input::placeholder {
    color: #999;
}

.qm-state-list {
    max-height: 220px;
    overflow-y: auto;
}

.qm-state-list::-webkit-scrollbar {
    width: 4px;
}

.qm-state-list::-webkit-scrollbar-thumb {
    background: rgba(45, 90, 71, 0.15);
    border-radius: 4px;
}

/* --- Back Button --- */
.qm-back {
    display: block;
    margin-top: 18px;
    background: none;
    border: none;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    color: var(--color-hunter);
    cursor: pointer;
    opacity: 0;
    transform: translateX(-8px);
    animation: qmBackIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
    transition: opacity 0.2s ease;
}

.qm-back:hover {
    opacity: 1 !important;
    text-decoration: underline;
}

/* --- Result Card --- */
.qm-result-card {
    text-align: center;
    padding: 32px 24px;
    background: linear-gradient(160deg,
            rgba(255, 255, 255, 0.9) 0%,
            rgba(232, 223, 208, 0.15) 50%,
            rgba(212, 168, 83, 0.04) 100%);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(45, 90, 71, 0.1);
    box-shadow:
        0 20px 60px rgba(45, 90, 71, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    animation: qmResultIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
    position: relative;
    overflow: hidden;
}

/* Accent gradient bar at top */
.qm-result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2D5A47, #3d7a5e, #D4A853);
    border-radius: 4px 4px 0 0;
}

.qm-result-badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    background: linear-gradient(135deg, #2D5A47, #3d7a5e);
    color: #fff;
    font-size: 11px;
    font-family: 'Rajdhani', sans-serif;
    letter-spacing: 1.5px;
    font-weight: 700;
    margin-bottom: 12px;
}

.qm-result-sport {
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: var(--color-charcoal-light);
    margin-bottom: 8px;
    line-height: 1.4;
}

.qm-result-number {
    font-family: 'Rajdhani', sans-serif;
    font-size: 60px;
    font-weight: 700;
    color: #D4A853;
    line-height: 1;
    margin-bottom: 4px;
    text-shadow: 0 2px 12px rgba(212, 168, 83, 0.15);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.qm-result-number.landed {
    animation: qmNumberLand 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.qm-result-label {
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: var(--color-charcoal-light);
    margin-bottom: 12px;
}

.qm-result-range {
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    color: var(--color-charcoal-light);
    padding: 8px 16px;
    background: rgba(45, 90, 71, 0.04);
    border-radius: 10px;
    display: inline-block;
    margin-bottom: 8px;
}

/* Insight bar */
.qm-result-insight {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    margin: 8px 0 16px;
    border-radius: 12px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    animation: qmInsightIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.8s both;
}

.qm-result-insight.insight-high {
    background: rgba(239, 68, 68, 0.06);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.12);
}

.qm-result-insight.insight-avg {
    background: rgba(45, 90, 71, 0.06);
    color: #2D5A47;
    border: 1px solid rgba(45, 90, 71, 0.12);
}

.qm-result-insight.insight-low {
    background: rgba(34, 197, 94, 0.06);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.12);
}

.qm-result-breakdown {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 22px;
    text-align: left;
}

.qm-breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 10px;
    background: rgba(45, 90, 71, 0.02);
    transition: background 0.2s ease;
}

.qm-breakdown-row:nth-child(odd) {
    background: rgba(45, 90, 71, 0.04);
}

.qm-breakdown-row .cat-name {
    color: var(--color-charcoal);
    font-family: 'Inter', sans-serif;
}

.qm-breakdown-row .cat-val {
    font-weight: 700;
    color: var(--color-hunter);
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
}

/* --- Actions --- */
.qm-result-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.qm-action-primary {
    padding: 14px 28px;
    border-radius: 14px;
    background: linear-gradient(135deg, #2D5A47, #3d7a5e);
    color: #fff;
    border: none;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 4px 16px rgba(45, 90, 71, 0.2);
}

.qm-action-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 28px rgba(45, 90, 71, 0.25);
}

.qm-action-primary:active {
    transform: scale(0.96);
    transition-duration: 0.08s;
}

.qm-action-secondary {
    padding: 14px 28px;
    border-radius: 14px;
    background: transparent;
    color: var(--color-hunter);
    border: 1.5px solid rgba(45, 90, 71, 0.2);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.qm-action-secondary:hover {
    border-color: var(--color-hunter);
    background: rgba(45, 90, 71, 0.04);
    transform: translateY(-1px);
}

.qm-action-secondary:active {
    transform: scale(0.96);
    transition-duration: 0.08s;
}

.qm-result-footer {
    padding-top: 14px;
    border-top: 1px solid rgba(45, 90, 71, 0.06);
}

.qm-waitlist-link {
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    color: #D4A853;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
}

.qm-waitlist-link:hover {
    color: #b8956e;
}

/* --- QM Animations --- */
@keyframes qmStepIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(10px);
        filter: blur(4px);
    }

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

@keyframes qmTileStagger {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(8px);
    }

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

@keyframes qmResultIn {
    from {
        opacity: 0;
        transform: scale(0.92);
        filter: blur(6px);
    }

    to {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
}

@keyframes qmSelectPulse {
    0% {
        transform: scale(1);
    }

    40% {
        transform: scale(1.06);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes qmNumberLand {
    0% {
        transform: scale(1);
    }

    40% {
        transform: scale(1.08);
        text-shadow: 0 4px 24px rgba(212, 168, 83, 0.35);
    }

    100% {
        transform: scale(1);
        text-shadow: 0 2px 12px rgba(212, 168, 83, 0.15);
    }
}

@keyframes qmBackIn {
    from {
        opacity: 0;
        transform: translateX(-12px);
    }

    to {
        opacity: 0.7;
        transform: translateX(0);
    }
}

@keyframes qmInsightIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

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

/* --- Exit Choreography --- */
.qm-modal--closing {
    transform: scale(0.94);
    opacity: 0;
    filter: blur(6px);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.3s ease,
        filter 0.35s ease;
}

/* --- Geo-Detected Pill --- */
.qm-pill--geo {
    background: linear-gradient(135deg, rgba(45, 90, 71, 0.12), rgba(212, 168, 83, 0.1));
    border: 2px solid rgba(45, 90, 71, 0.35);
    color: #2D5A47;
    font-weight: 700;
    order: -1;
    animation: qmSelectPulse 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.qm-geo-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #D4A853;
    background: rgba(212, 168, 83, 0.12);
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
}

/* --- Seasonal Tip --- */
.qm-seasonal-tip {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    margin-top: 12px;
    background: linear-gradient(135deg, rgba(212, 168, 83, 0.08), rgba(45, 90, 71, 0.06));
    border: 1px solid rgba(212, 168, 83, 0.2);
    border-radius: 10px;
    font-size: 13px;
    color: #2D5A47;
    font-family: 'Inter', sans-serif;
    animation: qmInsightIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) 1s both;
}

.qm-seasonal-tip.visible {
    display: flex;
}

/* --- Follow-up Suggestion Chips --- */
.qm-followup-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
    justify-content: center;
}

.qm-suggestion-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(45, 90, 71, 0.06), rgba(232, 223, 208, 0.3));
    border: 1.5px solid rgba(45, 90, 71, 0.15);
    color: #2D5A47;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    animation: qmChipIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) calc(1s + var(--i, 0) * 0.1s) both;
}

.qm-suggestion-chip:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 4px 16px rgba(45, 90, 71, 0.12);
    border-color: rgba(45, 90, 71, 0.3);
    background: linear-gradient(135deg, rgba(45, 90, 71, 0.1), rgba(212, 168, 83, 0.08));
}

.qm-suggestion-chip:active {
    transform: scale(0.95);
    transition-duration: 0.08s;
}

@keyframes qmChipIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.9);
    }

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

/* --- Result Card Shimmer Glow --- */
.qm-result-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(212, 168, 83, 0.1), transparent 40%, rgba(45, 90, 71, 0.06), transparent 80%, rgba(212, 168, 83, 0.06));
    pointer-events: none;
    opacity: 0;
    animation: qmShimmer 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.3s forwards;
}

@keyframes qmShimmer {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* --- Prefers Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {

    .qm-sport-tile,
    .qm-pill,
    .qm-level-card,
    .qm-suggestion-chip,
    .qm-seasonal-tip,
    .qm-result-insight,
    .qm-result-card::after,
    .qm-back {
        animation: none !important;
    }

    .qm-step.active {
        animation: none !important;
    }

    .qm-modal--closing {
        transition-duration: 0.01s !important;
    }

    .qm-progress-fill {
        transition-duration: 0.15s !important;
        transition-timing-function: ease !important;
    }

    .qm-result-number.landed {
        animation: none !important;
    }

    .qm-sport-tile:hover,
    .qm-pill:hover,
    .qm-level-card:hover,
    .qm-suggestion-chip:hover,
    .mode-btn:hover {
        transform: none !important;
    }

    .qm-overlay.open .qm-modal {
        animation: none !important;
        opacity: 1;
        transform: scale(1);
    }
}

/* --- QM Responsive --- */
@media (max-width: 500px) {
    .qm-modal {
        padding: 28px 20px 20px;
        border-radius: 20px;
    }

    .qm-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .qm-question {
        font-size: 19px;
    }

    .qm-result-number {
        font-size: 46px;
    }

    .qm-result-breakdown {
        grid-template-columns: 1fr;
    }

    .mode-toggle {
        flex-direction: column;
        align-items: center;
    }

    .mode-btn {
        min-width: 200px;
    }

    .qm-followup-suggestions {
        flex-direction: column;
        align-items: stretch;
    }

    .qm-suggestion-chip {
        justify-content: center;
    }
}


.advisor-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 16px;
}

/* --- Phase Visibility --- */
.advisor-phase {
    display: none;
}

.advisor-phase.active {
    display: block;
}

/* ========================
   PHASE 1: CHAT ADVISOR
   ======================== */
.advisor-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 180px);
    min-height: 500px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(45, 90, 71, 0.1);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.06);
}

.advisor-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--color-hunter) 0%, #1a3d2e 100%);
    color: #fff;
}

.advisor-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.advisor-header-info h3 {
    margin: 0;
    font-family: 'Rajdhani', sans-serif;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.advisor-header-info span {
    font-size: 12px;
    opacity: 0.7;
}

.advisor-header-status {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    opacity: 0.8;
}

.advisor-header-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4ade80;
    animation: statusPulse 2s ease infinite;
}

/* --- Chat Thread --- */
.advisor-thread {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scroll-behavior: smooth;
}

.advisor-thread::-webkit-scrollbar {
    width: 4px;
}

.advisor-thread::-webkit-scrollbar-thumb {
    background: rgba(45, 90, 71, 0.15);
    border-radius: 4px;
}

/* --- Message Bubbles --- */
.msg {
    display: flex;
    gap: 8px;
    max-width: 85%;
    animation: msgIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.msg--bot {
    align-self: flex-start;
}

.msg--user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    margin-top: 2px;
}

.msg--bot .msg-avatar {
    background: var(--color-hunter);
    color: #fff;
}

.msg--user .msg-avatar {
    background: var(--color-sand);
    color: var(--color-charcoal);
}

.msg-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.5;
    font-family: 'Inter', sans-serif;
}

.msg--bot .msg-bubble {
    background: #f0f4f2;
    color: var(--color-charcoal);
    border-bottom-left-radius: 6px;
}

.msg--user .msg-bubble {
    background: var(--color-hunter);
    color: #fff;
    border-bottom-right-radius: 6px;
}

/* --- Typing Indicator --- */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-hunter);
    opacity: 0.4;
    animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

/* --- Quick Reply Chips --- */
.advisor-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 20px 12px;
    min-height: 0;
    transition: all 0.3s ease;
}

.advisor-chips:empty {
    padding: 0;
}

.chip {
    padding: 8px 16px;
    border-radius: 20px;
    background: #fff;
    border: 1.5px solid rgba(45, 90, 71, 0.2);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: var(--color-hunter);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.chip:hover {
    background: var(--color-hunter);
    color: #fff;
    border-color: var(--color-hunter);
    transform: translateY(-1px);
}

.chip:active {
    transform: scale(0.96);
}

/* --- Input Bar --- */
.advisor-input-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid rgba(45, 90, 71, 0.08);
    background: rgba(255, 255, 255, 0.8);
}

.advisor-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    background: transparent;
    color: var(--color-charcoal);
    padding: 8px 0;
}

.advisor-input::placeholder {
    color: #999;
}

.advisor-mic,
.advisor-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.advisor-mic {
    background: #f5f5f5;
    color: var(--color-charcoal);
}

.advisor-mic:hover {
    background: #e8e8e8;
}

.advisor-mic.recording {
    background: #ef4444;
    color: #fff;
    animation: micPulse 1s ease infinite;
}

.advisor-mic.hidden {
    display: none;
}

.advisor-send {
    background: var(--color-hunter);
    color: #fff;
}

.advisor-send:hover {
    background: #1a3d2e;
    transform: scale(1.05);
}

/* ========================
   PHASE 2: PRESENTATION DECK
   ======================== */
.deck-container {
    animation: deckEnter 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.deck-header {
    text-align: center;
    margin-bottom: 32px;
}

.deck-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    color: var(--color-hunter);
    margin: 0 0 4px;
}

.deck-header p {
    font-size: 14px;
    color: var(--color-charcoal-light);
    margin: 0;
}

/* --- Card Stack --- */
.deck-stack {
    position: relative;
    width: 100%;
    min-height: 380px;
    perspective: 1200px;
    margin-bottom: 24px;
}

.deck-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(45, 90, 71, 0.1);
    border-radius: 24px;
    padding: 36px 28px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s ease;
    will-change: transform, opacity;
}

.deck-card.active {
    z-index: 3;
    transform: translateY(0) scale(1);
    opacity: 1;
}

.deck-card.next {
    z-index: 2;
    transform: translateY(14px) scale(0.97);
    opacity: 0.6;
    pointer-events: none;
}

.deck-card.queued {
    z-index: 1;
    transform: translateY(28px) scale(0.94);
    opacity: 0.3;
    pointer-events: none;
}

.deck-card.past {
    z-index: 0;
    transform: translateY(-40px) scale(0.9);
    opacity: 0;
    pointer-events: none;
}

.deck-card.hidden {
    display: none;
}

.deck-card-label {
    font-family: 'Rajdhani', sans-serif;
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--color-hunter);
    opacity: 0.6;
    margin-bottom: 12px;
}

.deck-card h3 {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    color: var(--color-charcoal);
    margin: 0 0 16px;
}

.deck-big-number {
    font-family: 'Rajdhani', sans-serif;
    font-size: 56px;
    font-weight: 700;
    color: var(--color-hunter);
    line-height: 1;
    margin-bottom: 4px;
}

.deck-big-label {
    font-size: 14px;
    color: var(--color-charcoal-light);
    margin-bottom: 20px;
}

/* --- Donut inside deck card --- */
.deck-donut-row {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    flex-wrap: wrap;
}

.deck-donut {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
}

.deck-donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.deck-donut-center strong {
    font-family: 'Rajdhani', sans-serif;
    font-size: 18px;
    color: var(--color-hunter);
    display: block;
}

.deck-donut-center small {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
}

.deck-legend {
    flex: 1;
    min-width: 180px;
}

.deck-legend-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.deck-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    flex-shrink: 0;
}

.deck-legend-name {
    flex: 1;
    color: var(--color-charcoal);
}

.deck-legend-val {
    font-weight: 600;
    color: var(--color-hunter);
    font-family: 'Rajdhani', sans-serif;
}

/* --- Bar Charts --- */
.deck-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.deck-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.deck-bar-label {
    width: 120px;
    font-size: 13px;
    color: var(--color-charcoal);
    text-align: right;
    flex-shrink: 0;
}

.deck-bar-track {
    flex: 1;
    height: 22px;
    background: rgba(45, 90, 71, 0.06);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.deck-bar-fill {
    height: 100%;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--color-hunter), #4ade80);
    width: 0;
    transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.deck-bar-fill.you {
    background: linear-gradient(90deg, var(--color-hunter), var(--color-gold));
}

.deck-bar-val {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-charcoal);
    width: 70px;
    flex-shrink: 0;
}

/* --- Projection bars (vertical) --- */
.deck-proj {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 12px;
    height: 180px;
    margin: 16px 0;
}

.deck-proj-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.deck-proj-bar {
    width: 100%;
    max-width: 60px;
    border-radius: 8px 8px 0 0;
    background: linear-gradient(0deg, var(--color-hunter), #4ade80);
    transition: height 1s cubic-bezier(0.22, 1, 0.36, 1);
    min-height: 0;
}

.deck-proj-val {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-hunter);
    font-family: 'Rajdhani', sans-serif;
}

.deck-proj-label {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

/* --- Comparison grid --- */
.deck-comps {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.deck-comp-item {
    text-align: center;
    padding: 16px 12px;
    background: rgba(45, 90, 71, 0.04);
    border-radius: 16px;
}

.deck-comp-num {
    font-family: 'Rajdhani', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: var(--color-hunter);
    line-height: 1.1;
}

.deck-comp-label {
    font-size: 12px;
    color: var(--color-charcoal-light);
    margin-top: 4px;
}

/* --- Savings card --- */
.deck-savings {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.deck-saving-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.deck-saving-row span:first-child {
    font-size: 14px;
    color: var(--color-charcoal);
}

.deck-saving-row strong {
    font-family: 'Rajdhani', sans-serif;
    color: var(--color-hunter);
    font-size: 16px;
}

/* --- Deck Navigation --- */
.deck-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px 0;
}

.deck-nav-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    border: 1.5px solid rgba(45, 90, 71, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: var(--color-hunter);
    transition: all 0.2s ease;
}

.deck-nav-btn:hover {
    background: var(--color-hunter);
    color: #fff;
    border-color: var(--color-hunter);
}

.deck-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.deck-nav-btn:disabled:hover {
    background: #fff;
    color: var(--color-hunter);
    border-color: rgba(45, 90, 71, 0.15);
}

.deck-nav-dots {
    display: flex;
    gap: 6px;
}

.deck-nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(45, 90, 71, 0.15);
    transition: all 0.3s ease;
    cursor: pointer;
}

.deck-nav-dot.active {
    background: var(--color-hunter);
    width: 24px;
    border-radius: 4px;
}

/* --- Narrator Bar --- */
.narrator-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, var(--color-hunter) 0%, #1a3d2e 100%);
    border-radius: 16px;
    padding: 14px 20px;
    margin-top: 16px;
    color: #fff;
}

.narrator-play {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.narrator-play:hover {
    background: rgba(255, 255, 255, 0.25);
}

.narrator-info {
    flex: 1;
}

.narrator-info-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 13px;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.narrator-info-status {
    font-size: 14px;
    font-weight: 500;
}

.narrator-eq {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 20px;
}

.narrator-eq-bar {
    width: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.5);
    transition: height 0.15s ease;
}

.narrator-eq.playing .narrator-eq-bar {
    animation: eqBounce 0.8s ease-in-out infinite alternate;
}

.narrator-eq-bar:nth-child(1) {
    animation-delay: 0s;
}

.narrator-eq-bar:nth-child(2) {
    animation-delay: 0.15s;
}

.narrator-eq-bar:nth-child(3) {
    animation-delay: 0.3s;
}

.narrator-eq-bar:nth-child(4) {
    animation-delay: 0.1s;
}

.narrator-eq-bar:nth-child(5) {
    animation-delay: 0.25s;
}

/* --- CTA at bottom of deck --- */
.deck-cta {
    text-align: center;
    margin-top: 24px;
    padding: 24px;
    background: rgba(45, 90, 71, 0.04);
    border-radius: 20px;
    border: 1px solid rgba(45, 90, 71, 0.1);
}

.deck-cta p {
    font-size: 15px;
    color: var(--color-charcoal-light);
    margin: 0 0 12px;
}

/* --- Restart btn --- */
.advisor-restart {
    display: block;
    margin: 20px auto 0;
    padding: 10px 24px;
    background: none;
    border: 1.5px solid rgba(45, 90, 71, 0.2);
    border-radius: 12px;
    font-size: 14px;
    color: var(--color-hunter);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
}

.advisor-restart:hover {
    background: var(--color-hunter);
    color: #fff;
    border-color: var(--color-hunter);
}

/* ========================
   ANIMATIONS
   ======================== */
@keyframes msgIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

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

@keyframes typingBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-6px);
    }
}

@keyframes micPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    50% {
        box-shadow: 0 0 0 12px rgba(239, 68, 68, 0);
    }
}

@keyframes statusPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

@keyframes deckEnter {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes eqBounce {
    0% {
        height: 4px;
    }

    100% {
        height: 18px;
    }
}

/* ========================
   RESPONSIVE
   ======================== */
@media (max-width: 640px) {
    .advisor-container {
        height: calc(100vh - 140px);
        border-radius: 16px;
    }

    .msg {
        max-width: 92%;
    }

    .deck-big-number {
        font-size: 42px;
    }

    .deck-donut-row {
        flex-direction: column;
        align-items: center;
    }

    .deck-comps {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .deck-card {
        padding: 28px 20px;
    }

    .deck-bar-label {
        width: 90px;
        font-size: 12px;
    }
}