        .glassmorphism {
            backdrop-filter: blur(16px);
            background: rgba(39, 39, 42, 0.4);
            border: 1px solid rgba(161, 161, 170, 0.2);
        }

        .loading-spinner {
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            from {
                transform: rotate(0deg);
            }

            to {
                transform: rotate(360deg);
            }
        }

        .fade-in {
            animation: fadeIn 0.5s ease-in;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(20px);
            }

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

        /* ── Stage progress animation ── */
        .stage-row {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px 0;
            opacity: 0.35;
            transition: opacity 0.4s ease, transform 0.3s ease;
        }

        .stage-row.active {
            opacity: 1;
        }

        .stage-row.complete {
            opacity: 0.7;
        }

        .stage-icon {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            flex-shrink: 0;
            background: #27272A;
            border: 2px solid #3F3F46;
            transition: all 0.4s ease;
        }

        .stage-row.active .stage-icon {
            background: rgba(162, 89, 255, 0.15);
            border-color: #A259FF;
        }

        .stage-row.complete .stage-icon {
            background: rgba(0, 191, 166, 0.15);
            border-color: #00BFA6;
        }

        .stage-label {
            font-size: 0.9rem;
            color: #71717A;
            transition: color 0.4s ease;
        }

        .stage-row.active .stage-label {
            color: #F4F4F5;
            font-weight: 600;
        }

        .stage-row.complete .stage-label {
            color: #00BFA6;
        }

        .stage-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #A259FF;
            animation: pulseDot 1.2s ease-in-out infinite;
            flex-shrink: 0;
        }

        @keyframes pulseDot {

            0%,
            100% {
                transform: scale(1);
                opacity: 1;
            }

            50% {
                transform: scale(1.6);
                opacity: 0.5;
            }
        }

        /* ── Orbital spinner ── */
        .orbital {
            position: relative;
            width: 72px;
            height: 72px;
            flex-shrink: 0;
        }

        .orbital-ring {
            position: absolute;
            inset: 0;
            border-radius: 50%;
            border: 2px solid transparent;
        }

        .orbital-ring:nth-child(1) {
            border-top-color: #A259FF;
            animation: spin 1.4s linear infinite;
        }

        .orbital-ring:nth-child(2) {
            inset: 8px;
            border-right-color: #00BFA6;
            animation: spin 2s linear infinite reverse;
        }

        .orbital-ring:nth-child(3) {
            inset: 16px;
            border-bottom-color: #FF6B6B;
            animation: spin 2.8s linear infinite;
        }

        .orbital-core {
            position: absolute;
            inset: 24px;
            border-radius: 50%;
            background: radial-gradient(circle, rgba(162, 89, 255, 0.5), transparent);
            animation: breathe 2s ease-in-out infinite;
        }

        @keyframes breathe {

            0%,
            100% {
                transform: scale(0.85);
                opacity: 0.6;
            }

            50% {
                transform: scale(1.1);
                opacity: 1;
            }
        }

        /* ── Results preview card ── */
        .results-preview {
            animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
        }

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

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

        .data-chip {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            background: rgba(162, 89, 255, 0.12);
            border: 1px solid rgba(162, 89, 255, 0.3);
            border-radius: 999px;
            padding: 4px 12px;
            font-size: 0.78rem;
            color: #D4B4FF;
            margin: 3px;
        }

        .data-chip.green {
            background: rgba(0, 191, 166, 0.12);
            border-color: rgba(0, 191, 166, 0.3);
            color: #5DF0DE;
        }

        .data-chip.orange {
            background: rgba(255, 107, 107, 0.12);
            border-color: rgba(255, 107, 107, 0.3);
            color: #FFB4B4;
        }

        .countdown-ring {
            animation: countdownShrink linear forwards;
        }

        @keyframes countdownShrink {
            from {
                stroke-dashoffset: 0;
            }

            to {
                stroke-dashoffset: 100;
            }
        }

        .fullscreen-mode {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            z-index: 1000;
            background: white;
            overflow: auto;
        }

        .tab-navigation {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 60px;
            background: #09090B;
            border-bottom: 1px solid #27272A;
            display: flex;
            align-items: center;
            padding: 0 20px;
            z-index: 1001;
        }

        .tab-button {
            padding: 8px 16px;
            margin-right: 8px;
            background: #3F3F46;
            color: #F4F4F5;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            transition: background-color 0.2s;
        }

        .tab-button:hover {
            background: #52525B;
        }

        .tab-button.active {
            background: #A259FF;
        }

        .fullscreen-content {
            margin-top: 60px;
            padding: 20px;
            height: calc(100vh - 80px);
            overflow: auto;
        }

        /* ── Muted slate accent ── */
        :root {
            --muted-slate: #8892b0;
        }

        /* ── History Rail ── */
        .history-rail-wrap {
            margin: 0 0 24px;
            position: sticky;
            top: 0;
            z-index: 10;
            background: rgba(15, 15, 26, 0.95);
            backdrop-filter: blur(12px);
            padding: 12px 0;
            border-bottom: 1px solid rgba(124, 106, 247, 0.1);
        }

        @media (max-width: 640px) {
            .history-rail-wrap {
                margin: 0 -16px 24px -16px;
                padding: 12px 16px;
            }
        }

        .history-rail-title {
            font-size: 0.72rem;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            color: var(--muted-slate);
            margin-bottom: 10px;
            padding-left: 2px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .history-rail-title::after {
            content: '';
            flex: 1;
            height: 1px;
            background: linear-gradient(to right, rgba(136, 146, 176, 0.2), transparent);
        }

        .history-rail {
            display: flex;
            gap: 10px;
            overflow-x: auto;
            scrollbar-width: none;
            -ms-overflow-style: none;
            padding-bottom: 6px;
        }

        .history-rail::-webkit-scrollbar {
            display: none;
        }

        .history-mini-card {
            flex-shrink: 0;
            width: 160px;
            height: 200px;
            border-radius: 16px;
            background: rgba(255, 255, 255, 0.04);
            backdrop-filter: blur(12px);
            border: 1px solid rgba(124, 106, 247, 0.15);
            overflow: hidden;
            cursor: pointer;
            transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
            position: relative;
            animation: cardSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
        }

        .history-mini-card:hover {
            border-color: rgba(124, 106, 247, 0.6);
            transform: translateY(-3px);
            box-shadow: 0 10px 28px rgba(124, 106, 247, 0.22);
        }

        @keyframes cardSlideIn {
            from {
                opacity: 0;
                transform: translateX(-16px);
            }

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

        .history-mini-card-img {
            width: 100%;
            height: 100px;
            object-fit: cover;
            display: block;
        }

        .history-mini-card-img-placeholder {
            width: 100%;
            height: 100px;
            background: linear-gradient(135deg, #1a1a2e, #0f0f1a);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 22px;
        }

        .history-mini-card-body {
            padding: 10px 10px 8px;
        }

        .history-mini-card-title {
            font-size: 11px;
            font-weight: 600;
            color: #e4e4f0;
            line-height: 1.35;
            margin-bottom: 6px;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .history-mini-card-trend {
            font-size: 10px;
            color: #9966ff;
            font-weight: 500;
            margin-bottom: 4px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .history-mini-card-time {
            font-size: 10px;
            color: var(--muted-slate);
            opacity: 0.7;
        }

        /* ── Summary Card Overlay ── */
        .summary-card-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.65);
            backdrop-filter: blur(6px);
            z-index: 500;
            display: flex;
            align-items: flex-end;
            justify-content: center;
            padding: 0 16px 24px;
            animation: fadeIn 0.25s ease;
        }

        .summary-card-overlay.hidden {
            display: none;
        }

        .summary-card {
            width: 100%;
            max-width: 480px;
            min-width: 320px;
            background: linear-gradient(160deg, rgba(124, 106, 247, 0.09) 0%, rgba(15, 15, 26, 0.97) 60%);
            border: 1px solid rgba(124, 106, 247, 0.22);
            border-radius: 20px;
            box-shadow: 0 8px 40px rgba(124, 106, 247, 0.18), 0 2px 8px rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(20px);
            overflow: hidden;
            animation: slideUpCard 0.38s cubic-bezier(0.16, 1, 0.3, 1);
            max-height: 90vh;
            overflow-y: auto;
            scrollbar-width: none;
        }

        @media (max-width: 480px) {
            .summary-card {
                margin: 0 8px;
                max-width: calc(100vw - 16px);
                border-radius: 16px;
            }

            .summary-card-hero {
                height: 180px;
            }

            .summary-card-hero-title {
                font-size: 16px;
                bottom: 12px;
                left: 12px;
                right: 36px;
            }

            .summary-card-body {
                padding: 12px;
            }
        }

        .summary-card::-webkit-scrollbar {
            display: none;
        }

        @keyframes slideUpCard {
            from {
                opacity: 0;
                transform: translateY(50px);
            }

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

        .summary-card-hero {
            position: relative;
            width: 100%;
            height: 220px;
            overflow: hidden;
            background: #0f0f1a;
        }

        .summary-card-hero img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

        .summary-card-hero-overlay {
            position: absolute;
            inset: 0;
            background: linear-gradient(to bottom, rgba(15, 15, 26, 0) 35%, rgba(15, 15, 26, 0.95) 100%);
        }

        .summary-card-hero-title {
            position: absolute;
            bottom: 14px;
            left: 16px;
            right: 44px;
            font-size: 17px;
            font-weight: 700;
            color: #fff;
            line-height: 1.25;
            text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
        }

        .summary-card-close {
            position: absolute;
            top: 12px;
            right: 12px;
            width: 30px;
            height: 30px;
            border-radius: 50%;
            background: rgba(15, 15, 26, 0.7);
            border: 1px solid rgba(255, 255, 255, 0.12);
            color: #ccc;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            z-index: 10;
            backdrop-filter: blur(4px);
            transition: background 0.2s;
        }

        .summary-card-close:hover {
            background: rgba(124, 106, 247, 0.5);
            color: #fff;
        }

        .share-btn {
            position: absolute;
            top: 12px;
            right: 52px;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background: rgba(15, 15, 26, 0.7);
            backdrop-filter: blur(8px);
            border: 1px solid rgba(124, 106, 247, 0.4);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.2s ease;
            z-index: 10;
        }

        .share-btn:hover,
        .share-btn:active {
            background: rgba(124, 106, 247, 0.3);
            border-color: rgba(124, 106, 247, 0.8);
            transform: scale(1.08);
        }

        .cta-row {
            display: flex;
            gap: 10px;
            margin-top: 16px;
        }

        .share-text-btn {
            flex: 1;
            padding: 12px;
            border-radius: 12px;
            border: 1px solid rgba(124, 106, 247, 0.4);
            background: transparent;
            color: #7c6af7;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s ease;
            text-decoration: none;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
        }

        .share-text-btn:hover {
            background: rgba(124, 106, 247, 0.1);
            border-color: rgba(124, 106, 247, 0.8);
        }

        .summary-card-body {
            padding: 16px 16px 20px;
        }

        .sc-section-label {
            font-size: 10.5px;
            text-transform: uppercase;
            letter-spacing: 0.09em;
            color: var(--muted-slate);
            margin-bottom: 8px;
        }

        /* Theme chips */
        .theme-chips-row {
            display: flex;
            gap: 6px;
            overflow-x: auto;
            scrollbar-width: none;
            padding-bottom: 4px;
            margin-bottom: 16px;
        }

        .theme-chips-row::-webkit-scrollbar {
            display: none;
        }

        .theme-chip {
            flex-shrink: 0;
            border-radius: 20px;
            padding: 4px 12px;
            font-size: 12px;
            font-weight: 500;
            border: 1px solid transparent;
            white-space: nowrap;
        }

        /* Trend bar chart */
        .trend-bars {
            margin-bottom: 16px;
        }

        .trend-bar-row {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 8px;
        }

        .trend-bar-label {
            font-size: 11px;
            color: #a1a1aa;
            width: 90px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            flex-shrink: 0;
        }

        .trend-bar-track {
            flex: 1;
            height: 5px;
            background: rgba(255, 255, 255, 0.06);
            border-radius: 3px;
            overflow: hidden;
        }

        .trend-bar-fill {
            height: 100%;
            border-radius: 3px;
            width: 0;
            transition: width 0.8s ease;
        }

        .trend-bar-score {
            font-size: 11px;
            color: #71717a;
            width: 22px;
            text-align: right;
            flex-shrink: 0;
        }

        /* Transcript excerpt */
        .transcript-excerpt {
            margin-bottom: 16px;
        }

        .transcript-excerpt-label {
            font-size: 12px;
            color: #7c6af7;
            font-weight: 600;
            margin-bottom: 5px;
        }

        .transcript-excerpt-text {
            font-size: 12.5px;
            color: #888;
            font-style: italic;
            line-height: 1.55;
            display: -webkit-box;
            -webkit-line-clamp: 3;
            line-clamp: 3;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        /* CTA */
        .summary-cta {
            display: block;
            width: 100%;
            padding: 13px;
            background: linear-gradient(135deg, #7c6af7, #5b4fd4);
            color: #fff;
            text-align: center;
            border-radius: 12px;
            font-weight: 600;
            font-size: 14px;
            text-decoration: none;
            transition: transform 0.2s, filter 0.2s;
            border: none;
            cursor: pointer;
            box-shadow: 0 4px 16px rgba(124, 106, 247, 0.3);
        }

        .summary-cta:hover {
            transform: scale(1.02);
            filter: brightness(1.1);
        }

        /* ── Substack Pre-footer ── */
        .substack-pre-footer {
            background: #09090B;
            border-top: 1px solid #1a1a2e;
            padding: 56px 24px 48px;
        }

        .substack-embed-wrap {
            max-width: 460px;
            margin: 0 auto;
            background: linear-gradient(135deg, rgba(124, 106, 247, 0.1), rgba(15, 15, 26, 0.7));
            border: 1px solid rgba(124, 106, 247, 0.28);
            border-radius: 20px;
            padding: 28px 24px;
            backdrop-filter: blur(16px);
            box-shadow: 0 4px 32px rgba(124, 106, 247, 0.12), 0 1px 4px rgba(0, 0, 0, 0.3);
            position: relative;
            overflow: hidden;
        }

        .substack-embed-wrap::before {
            content: '';
            position: absolute;
            top: -60px;
            right: -60px;
            width: 180px;
            height: 180px;
            background: radial-gradient(circle, rgba(124, 106, 247, 0.18), transparent 70%);
            pointer-events: none;
        }

        .substack-embed-icon {
            font-size: 28px;
            margin-bottom: 10px;
        }

        .substack-embed-title {
            font-size: 19px;
            font-weight: 700;
            color: #e8e8f0;
            margin-bottom: 6px;
            line-height: 1.2;
        }

        .substack-embed-sub {
            font-size: 13px;
            color: var(--muted-slate);
            margin-bottom: 20px;
            line-height: 1.55;
        }

        .substack-form {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
        }

        .substack-input {
            flex: 1;
            min-width: 180px;
            padding: 12px 16px;
            background: rgba(255, 255, 255, 0.06);
            border: 1px solid rgba(124, 106, 247, 0.3);
            border-radius: 10px;
            color: #e8e8f0;
            font-size: 14px;
            outline: none;
            transition: border-color 0.2s, background 0.2s;
            font-family: system-ui, sans-serif;
        }

        .substack-input::placeholder {
            color: #52525B;
        }

        .substack-input:focus {
            border-color: rgba(124, 106, 247, 0.65);
            background: rgba(255, 255, 255, 0.09);
        }

        .substack-btn {
            padding: 12px 20px;
            background: linear-gradient(135deg, #7c6af7, #5b4fd4);
            color: #fff;
            border: none;
            border-radius: 10px;
            font-weight: 600;
            font-size: 14px;
            cursor: pointer;
            transition: transform 0.2s, filter 0.2s;
            white-space: nowrap;
            box-shadow: 0 4px 14px rgba(124, 106, 247, 0.35);
            font-family: system-ui, sans-serif;
        }

        .substack-btn:hover {
            transform: scale(1.03);
            filter: brightness(1.1);
        }

        .substack-note {
            font-size: 11px;
            color: #3f3f50;
            margin-top: 12px;
            text-align: center;
        }