/* ===================================================
   LUNG TEST — Matching UI Mockup Design
   =================================================== */

        :root {
            --lg: #0a4e3c;
            --lg-light: #e8f5f1;
            --lg-mid: #16a34a;
            --lg-yellow: #f59e0b;
            --lg-red: #ef4444;
        }

        /* Page */
        .lung-page {
            min-height: 100vh;
            background: #f8faf9;
            padding-bottom: 80px;
        }

        /* Breadcrumb */
        .breadcrumb {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 0.9rem;
            color: #64748b;
            margin-bottom: 24px;
            flex-wrap: wrap;
        }

        .breadcrumb a {
            text-decoration: none;
            color: var(--lg);
            font-weight: 500;
            transition: color .2s;
        }

        .breadcrumb a:hover {
            color: var(--lg-mid);
        }

        .breadcrumb .sep {
            color: #cbd5e1;
        }

        .breadcrumb .current {
            color: #475569;
            font-weight: 600;
        }

        /* ── Page Header ── */
        .lung-page-header {
            background: white;
            border-radius: 20px;
            padding: 32px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 24px;
            margin-bottom: 24px;
            box-shadow: 0 4px 20px rgba(10, 78, 60, 0.04);
            border: 1px solid #e8f0eb;
            position: relative;
            overflow: hidden;
        }

        .lung-header-left {
            display: flex;
            align-items: flex-start;
            gap: 24px;
            flex: 1;
        }

        .lung-header-icon {
            width: 76px;
            height: 76px;
            background: #f0fdf4;
            border: 1px solid #dcfce7;
            border-radius: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        .lung-header-text h1 {
            font-family: var(--font-sans);
            font-size: 2.1rem;
            font-weight: 800;
            color: var(--lg);
            margin-bottom: 4px;
            line-height: 1.2;
        }

        .lung-header-text .sub {
            font-size: 0.95rem;
            font-weight: 700;
            color: #16a34a;
            margin-bottom: 8px;
        }

        .lung-header-text p {
            color: #64748b;
            font-size: 0.92rem;
            line-height: 1.6;
            max-width: 600px;
            margin: 0;
        }

        .lung-header-illustration {
            width: 140px;
            height: 140px;
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        /* ── Full-Width How It Works Card ── */
        .how-it-works-card {
            background: white;
            border-radius: 20px;
            padding: 28px 32px;
            margin-bottom: 24px;
            box-shadow: 0 4px 20px rgba(10, 78, 60, 0.04);
            border: 1px solid #e8f0eb;
        }

        .how-it-works-card .section-h {
            font-size: 1rem;
            font-weight: 800;
            color: var(--lg);
            margin-bottom: 20px;
        }

        .how-steps-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
        }

        .how-step-item {
            flex: 1;
            display: flex;
            align-items: center;
            gap: 16px;
            background: #f8faf9;
            padding: 16px 20px;
            border-radius: 16px;
            border: 1px solid #eef4f1;
        }

        .how-step-icon {
            width: 48px;
            height: 48px;
            border-radius: 14px;
            background: #e8f5f1;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--lg);
            flex-shrink: 0;
        }

        .how-step-text {
            font-size: 0.88rem;
            color: #475569;
            line-height: 1.45;
        }

        .how-step-text strong {
            display: block;
            color: var(--lg);
            font-size: 0.92rem;
        }

        .how-step-arrow {
            color: #94a3b8;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        /* ── 2-Column Grid ── */
        .lung-grid {
            display: grid;
            grid-template-columns: 1.05fr 0.95fr;
            gap: 24px;
            align-items: start;
        }

        /* ── Left Interactive Card ── */
        .lung-card-left {
            background: white;
            border-radius: 20px;
            padding: 32px 28px;
            box-shadow: 0 4px 20px rgba(10, 78, 60, 0.04);
            border: 1px solid #e8f0eb;
        }

        .phase-title {
            font-family: var(--font-sans);
            font-size: 1.75rem;
            font-weight: 800;
            color: var(--lg);
            text-align: center;
            margin-bottom: 6px;
        }

        .phase-subtitle {
            font-size: 0.92rem;
            color: #64748b;
            text-align: center;
            margin-bottom: 28px;
        }

        /* ── ARC RING ── */
        .arc-ring-wrap {
            position: relative;
            width: 280px;
            height: 280px;
            margin: 0 auto 24px;
        }

        .arc-ring-svg {
            width: 100%;
            height: 100%;
            display: block;
        }

        .arc-timer-inner {
            position: absolute;
            inset: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            pointer-events: none;
        }

        .arc-timer-num {
            font-size: 4.5rem;
            font-weight: 800;
            line-height: 1;
            color: var(--lg);
            font-variant-numeric: tabular-nums;
            transition: color .4s ease;
            font-family: var(--font-sans);
        }

        .arc-timer-unit {
            font-size: 0.88rem;
            color: #94a3b8;
            font-weight: 500;
            margin-top: 2px;
            letter-spacing: .5px;
        }

        .arc-ring-wrap.holding .arc-ring-svg {
            filter: drop-shadow(0 0 20px rgba(16, 185, 129, 0.45));
            animation: ringPulse 1.2s ease-in-out infinite alternate;
        }

        @keyframes ringPulse {
            0% {
                transform: scale(1);
            }

            100% {
                transform: scale(1.02);
            }
        }

        /* ── HOLD BREATH PILL BUTTON ── */
        .btn-hold-pill {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
            width: 100%;
            max-width: 280px;
            margin: 0 auto;
            padding: 17px 24px;
            background: var(--lg);
            color: white;
            border: none;
            border-radius: 50px;
            font-family: var(--font-sans);
            font-weight: 700;
            font-size: 1.1rem;
            cursor: pointer;
            box-shadow: 0 6px 24px rgba(10, 78, 60, .30);
            transition: background .2s ease, transform .2s ease;
            touch-action: none;
            user-select: none;
            -webkit-user-select: none;
            position: relative;
            overflow: hidden;
        }

        .btn-hold-pill:hover:not(.pressing) {
            background: #06382b;
            transform: translateY(-2px);
            box-shadow: 0 8px 28px rgba(10, 78, 60, .40);
        }

        .btn-hold-pill.pressing {
            background: linear-gradient(135deg, #0a4e3c, #16a34a) !important;
            animation: holdPulsing 1s ease-in-out infinite alternate;
        }

        .btn-hold-pill i {
            color: #ffffff !important;
            font-size: 1.5rem;
        }

        .btn-hold-pill.pressing i {
            display: inline-block;
            color: #ffffff !important;
            animation: lungIconBeat 0.7s ease-in-out infinite alternate;
        }

        @keyframes holdPulsing {
            0% {
                transform: scale(0.96);
                box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7), 0 4px 18px rgba(10, 78, 60, 0.4);
            }

            50% {
                transform: scale(1.01);
                box-shadow: 0 0 0 18px rgba(16, 185, 129, 0), 0 10px 32px rgba(16, 185, 129, 0.6);
            }

            100% {
                transform: scale(0.96);
                box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7), 0 4px 18px rgba(10, 78, 60, 0.4);
            }
        }

        @keyframes lungIconBeat {
            0% {
                transform: scale(1);
            }

            100% {
                transform: scale(1.28);
            }
        }

        .btn-hold-pill .pill-lung-icon {
            width: 28px;
            height: 28px;
            flex-shrink: 0;
        }

        .spacebar-tip {
            text-align: center;
            font-size: 0.8rem;
            color: #94a3b8;
            margin-top: 12px;
        }

        .spacebar-tip kbd {
            background: #f1f5f9;
            padding: 2px 8px;
            border-radius: 5px;
            border: 1px solid #e2e8f0;
            color: #475569;
            font-family: var(--font-sans);
        }

        .info-panel {
            background: #f0fdf4;
            border-radius: 14px;
            border: 1px solid #dcfce7;
            padding: 16px 18px;
            display: flex;
            align-items: flex-start;
            gap: 14px;
            margin-top: 24px;
        }

        .info-panel-icon {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background: #dcfce7;
            color: var(--lg);
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        .info-panel p {
            margin: 0;
            font-size: 0.87rem;
            color: #475569;
            line-height: 1.6;
        }

        .info-panel strong {
            color: #1e293b;
            display: block;
            margin-bottom: 2px;
            font-size: 0.9rem;
        }

        .step-progress {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            padding: 20px 10px 0;
            position: relative;
            margin-top: 24px;
        }

        .step-progress::before {
            content: '';
            position: absolute;
            top: 32px;
            left: 8%;
            right: 8%;
            height: 2px;
            background: #e2e8f0;
            z-index: 0;
        }

        .step-line-fill {
            position: absolute;
            top: 32px;
            left: 8%;
            height: 2px;
            background: var(--lg);
            z-index: 1;
            transition: width .5s ease;
            width: 0%;
        }

        .step-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            position: relative;
            z-index: 2;
            flex: 1;
        }

        .step-num {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: white;
            border: 2px solid #e2e8f0;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.82rem;
            font-weight: 700;
            color: #94a3b8;
            transition: all .3s ease;
        }

        .step-num.done {
            background: var(--lg);
            border-color: var(--lg);
            color: white;
        }

        .step-num.active {
            background: white;
            border-color: var(--lg);
            color: var(--lg);
            box-shadow: 0 0 0 4px rgba(10, 78, 60, .12);
        }

        .step-label {
            font-size: 0.73rem;
            color: #94a3b8;
            text-align: center;
            font-weight: 600;
            line-height: 1.3;
        }

        .step-label.active {
            color: var(--lg);
        }

        .step-label.done {
            color: #475569;
        }

        /* ── Result Phase ── */
        .result-anim-stage {
            position: relative;
            width: 220px;
            height: 220px;
            margin: 0 auto 16px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .result-pulse-ring {
            position: absolute;
            inset: 0;
            border-radius: 50%;
            border: 3px solid rgba(34, 197, 94, .2);
            animation: pulsering 2s ease-in-out infinite;
        }

        .result-pulse-ring.r2 {
            animation-delay: .5s;
        }

        @keyframes pulsering {

            0%,
            100% {
                transform: scale(.88);
                opacity: .7;
            }

            50% {
                transform: scale(1.05);
                opacity: .2;
            }
        }

        .result-circle {
            width: 180px;
            height: 180px;
            border-radius: 50%;
            background: linear-gradient(135deg, #f0fdf4, #e9f5ee);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 4px;
            box-shadow: 0 8px 32px rgba(10, 78, 60, .12);
        }

        .result-time-big {
            font-size: 3rem;
            font-weight: 800;
            color: var(--lg);
            line-height: 1;
            font-variant-numeric: tabular-nums;
        }

        .btn-try-again {
            width: 100%;
            padding: 15px;
            background: var(--lg);
            color: white;
            border: none;
            border-radius: 14px;
            font-family: var(--font-sans);
            font-weight: 700;
            font-size: 1rem;
            cursor: pointer;
            transition: all .25s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            box-shadow: 0 4px 16px rgba(10, 78, 60, .25);
            margin-top: 20px;
        }

        .btn-try-again:hover {
            background: #06382b;
            transform: translateY(-2px);
        }

        [data-phase] {
            display: none;
        }

        [data-phase].active {
            display: flex;
            flex-direction: column;
        }

        /* ── Right Column Cards ── */
        .lung-right-col {
            display: flex;
            flex-direction: column;
            gap: 24px;
        }

        .right-card {
            background: white;
            border-radius: 20px;
            padding: 24px 28px;
            box-shadow: 0 4px 20px rgba(10, 78, 60, 0.04);
            border: 1px solid #e8f0eb;
        }

        /* Best Score Card */
        .best-score-card {
            display: flex;
            align-items: center;
            gap: 20px;
        }

        .best-score-icon-box {
            width: 56px;
            height: 56px;
            border-radius: 16px;
            background: #e8f5f1;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--lg);
            flex-shrink: 0;
        }

        .best-score-meta .label {
            font-size: 0.88rem;
            font-weight: 600;
            color: #64748b;
            margin-bottom: 2px;
        }

        .best-score-meta .val {
            font-size: 2.5rem;
            font-weight: 800;
            color: var(--lg);
            line-height: 1;
            font-variant-numeric: tabular-nums;
        }

        .best-score-meta .val span {
            font-size: 1rem;
            font-weight: 600;
            color: #64748b;
            margin-left: 4px;
        }

        .result-banner {
            border-radius: 14px;
            padding: 16px 18px;
            margin-bottom: 22px;
            display: none;
            animation: slideIn .4s ease;
        }

        .result-banner.show {
            display: block;
        }

        @keyframes slideIn {
            from {
                opacity: 0;
                transform: translateY(-10px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .result-banner.below {
            background: #fef2f2;
            border-left: 4px solid #ef4444;
        }

        .result-banner.normal {
            background: #fffbeb;
            border-left: 4px solid #f59e0b;
        }

        .result-banner.excellent {
            background: #f0fdf4;
            border-left: 4px solid #22c55e;
        }

        .result-banner-title {
            font-size: 1.1rem;
            font-weight: 800;
            margin-bottom: 4px;
        }

        .result-banner.below .result-banner-title {
            color: #dc2626;
        }

        .result-banner.normal .result-banner-title {
            color: #d97706;
        }

        .result-banner.excellent .result-banner-title {
            color: #16a34a;
        }

        .result-banner p {
            font-size: 0.87rem;
            color: #475569;
            margin: 0;
            line-height: 1.5;
        }

        .section-h {
            font-family: var(--font-sans);
            font-weight: 800;
            font-size: 1rem;
            color: #1e293b;
            margin-bottom: 16px;
        }

        /* Result Guide Cards */
        .result-guide-list {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .rg-card {
            display: flex;
            align-items: center;
            gap: 16px;
            padding: 16px 20px;
            border-radius: 16px;
            border: 1.5px solid transparent;
        }

        .rg-card.below {
            background: #fff5f5;
            border-color: #ffe3e3;
        }

        .rg-card.normal {
            background: #fffbeb;
            border-color: #fef08a;
        }

        .rg-card.excellent {
            background: #f0fdf4;
            border-color: #bbf7d0;
        }

        .rg-card-icon {
            width: 44px;
            height: 44px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        .rg-card.below .rg-card-icon {
            background: #fee2e2;
            color: #dc2626;
        }

        .rg-card.normal .rg-card-icon {
            background: #fef3c7;
            color: #d97706;
        }

        .rg-card.excellent .rg-card-icon {
            background: #dcfce7;
            color: #16a34a;
        }

        .rg-card-content {
            flex: 1;
        }

        .rg-card-range {
            font-weight: 800;
            font-size: 0.95rem;
            margin-bottom: 2px;
        }

        .rg-card.below .rg-card-range {
            color: #dc2626;
        }

        .rg-card.normal .rg-card-range {
            color: #d97706;
        }

        .rg-card.excellent .rg-card-range {
            color: #16a34a;
        }

        .rg-card-desc {
            font-size: 0.82rem;
            color: #475569;
            margin-bottom: 2px;
            font-weight: 600;
        }

        .rg-card-advice {
            font-size: 0.8rem;
            color: #64748b;
        }

        /* Tips Card */
        .tips-list {
            display: flex;
            flex-direction: column;
            gap: 16px;
        }

        .tip-row {
            display: flex;
            align-items: flex-start;
            gap: 14px;
        }

        .tip-icon-check {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            background: #dcfce7;
            color: #16a34a;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            margin-top: 2px;
        }

        .tip-info strong {
            display: block;
            font-size: 0.9rem;
            color: #1e293b;
            margin-bottom: 2px;
        }

        .tip-info span {
            font-size: 0.82rem;
            color: #64748b;
        }

        /* Bottom Medical Disclaimer */
        .lung-disclaimer-card {
            background: #fffdf5;
            border-radius: 20px;
            padding: 24px 32px;
            margin-top: 28px;
            margin-bottom: 28px;
            border: 1px solid #fef08a;
            display: flex;
            align-items: flex-start;
            gap: 20px;
            box-shadow: 0 4px 20px rgba(245, 158, 11, 0.04);
        }

        .disclaimer-icon-box {
            width: 48px;
            height: 48px;
            border-radius: 14px;
            background: #fef3c7;
            color: #d97706;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        .disclaimer-text h4 {
            font-size: 0.95rem;
            font-weight: 800;
            color: #b45309;
            margin-bottom: 4px;
        }

        .disclaimer-text p {
            font-size: 0.86rem;
            color: #78350f;
            margin: 0;
            line-height: 1.6;
        }

        /* Responsive */
        @media(max-width: 850px) {
            .lung-grid {
                grid-template-columns: 1fr;
            }

            .lung-page-header {
                flex-direction: column;
                align-items: flex-start;
                padding: 24px;
            }

            .lung-header-left {
                flex-direction: column;
                gap: 16px;
            }

            .lung-header-illustration {
                display: none;
            }

            .how-steps-row {
                flex-direction: column;
                gap: 12px;
            }

            .how-step-arrow {
                display: none;
            }

            .how-step-item {
                width: 100%;
            }

            .how-it-works-card {
                padding: 20px;
            }

            .lung-card-left {
                padding: 24px 18px;
            }

            .right-card {
                padding: 20px;
            }

            .lung-disclaimer-card {
                flex-direction: column;
                padding: 20px;
                gap: 12px;
            }
        }

        /* Confetti */
        .confetti-wrap {
            position: fixed;
            inset: 0;
            pointer-events: none;
            z-index: 9999;
        }

        .confetti-piece {
            position: absolute;
            width: 10px;
            height: 10px;
            border-radius: 2px;
            animation: confettiFall linear forwards;
        }

        @keyframes confettiFall {
            0% {
                transform: translateY(-20px) rotate(0deg);
                opacity: 1;
            }

            100% {
                transform: translateY(100vh) rotate(720deg);
                opacity: 0;
            }
        }