﻿:root {
            --ambient-shadow: 0 12px 32px -4px rgba(25, 28, 29, 0.06);
            --glass-bg: rgba(255, 255, 255, 0.85);
            --glass-blur: blur(12px);
        }

        body {
            font-family: 'Be Vietnam Pro', sans-serif;
            background-color: #f8f9fa;
            color: #191c1d;
        }

        .material-symbols-outlined {
            font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
        }

        .chinese-grid {
            background-color: #ffffff;
            background-image:
                linear-gradient(to right, rgba(16, 185, 129, 0.1) 1px, transparent 1px),
                linear-gradient(to bottom, rgba(16, 185, 129, 0.1) 1px, transparent 1px);
            background-size: 40px 40px;
            background-position: 20px 20px;
        }

        .hanzi-practice-wrap {
            position: relative;
            isolation: isolate;
            background:
                linear-gradient(180deg, rgba(252, 255, 252, 0.98), rgba(247, 251, 248, 0.98));
        }

        .hanzi-practice-surface {
            position: absolute;
            inset: 0;
            z-index: 0;
            padding: 18px 28px 18px;
        }

        .hanzi-practice-grid {
            width: 100%;
            height: 100%;
            border-radius: 28px 28px 12px 12px;
            background:
                linear-gradient(180deg, rgba(251, 255, 252, 0.96), rgba(246, 250, 247, 0.98));
            background-image:
                linear-gradient(to bottom, rgba(104, 196, 152, 0.12) 1px, transparent 1px),
                linear-gradient(to bottom, transparent calc(50% - 0.5px), rgba(104, 196, 152, 0.08) 50%, transparent calc(50% + 0.5px));
            background-size: 52px 52px, 52px 52px;
            background-position: 1px 1px, 1px 1px;
            box-shadow:
                inset 0 0 0 1px rgba(104, 196, 152, 0.05),
                inset 0 1px 0 rgba(255, 255, 255, 0.7);
            filter: saturate(0.72);
        }

        .hanzi-practice-input {
            z-index: 1;
            font-family: "KaiTi", "Kaiti SC", "STKaiti", "Noto Serif SC", "Songti SC", "STSong", "Microsoft YaHei", serif;
            font-weight: 500;
            letter-spacing: 0;
            word-break: break-all;
            caret-color: #68c498;
            text-rendering: geometricPrecision;
            -webkit-font-smoothing: antialiased;
        }

        @media (max-width: 640px) {
            .hanzi-practice-surface {
                padding: 16px 18px 16px;
            }

            .hanzi-practice-grid {
                border-radius: 24px 24px 12px 12px;
                background-size: 44px 44px, 44px 44px;
                background-position: 1px 1px, 1px 1px;
            }

            .hanzi-practice-input {
                min-height: 320px !important;
                padding-top: 68px;
                font-size: 24px;
                line-height: 44px;
            }
        }

        /* Overlays & Modals base */
        .overlay-base {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(25, 28, 30, 0.4);
            z-index: 1000;
            backdrop-filter: blur(8px);
            align-items: center;
            justify-content: center;
        }

        .overlay-base.active {
            display: flex;
        }

        .feature-notice-card {
            width: min(100%, 420px);
            padding: 32px 30px 28px;
            border-radius: 32px;
            background: rgba(255, 255, 255, 0.94);
            border: 1px solid rgba(16, 185, 129, 0.12);
            box-shadow: 0 32px 80px rgba(25, 28, 29, 0.12);
            backdrop-filter: blur(20px);
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
            gap: 18px;
        }

        .feature-notice-icon {
            width: 72px;
            height: 72px;
            border-radius: 24px;
            background: linear-gradient(180deg, rgba(16, 185, 129, 0.18), rgba(16, 185, 129, 0.06));
            color: #10b981;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.12);
        }

        .feature-notice-icon .material-symbols-outlined {
            font-size: 34px;
        }

        .feature-notice-copy {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .feature-notice-eyebrow {
            font-size: 10px;
            font-weight: 900;
            text-transform: uppercase;
            letter-spacing: 0.24em;
            color: rgba(67, 70, 84, 0.46);
        }

        .feature-notice-title {
            font-family: 'Manrope', sans-serif;
            font-size: 30px;
            line-height: 1.05;
            font-weight: 900;
            letter-spacing: -0.03em;
            color: #191c1d;
        }

        .feature-notice-text {
            font-size: 14px;
            line-height: 1.7;
            font-weight: 600;
            color: rgba(67, 70, 84, 0.72);
            max-width: 300px;
        }

        .feature-notice-button {
            min-width: 132px;
            height: 48px;
            padding: 0 22px;
            border: none;
            border-radius: 16px;
            background: #10b981;
            color: white;
            font-size: 11px;
            font-weight: 900;
            text-transform: uppercase;
            letter-spacing: 0.18em;
            cursor: pointer;
            box-shadow: 0 14px 26px rgba(16, 185, 129, 0.24);
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }

        .feature-notice-button:hover {
            transform: translateY(-1px);
            box-shadow: 0 18px 30px rgba(16, 185, 129, 0.28);
        }

        .history-ai-banner {
            position: relative;
            isolation: isolate;
        }

        .history-ai-banner::before {
            content: "";
            position: absolute;
            inset: 0;
            background:
                radial-gradient(circle at 20% 30%, rgba(255,255,255,0.14), transparent 22%),
                radial-gradient(circle at 82% 24%, rgba(255,255,255,0.08), transparent 20%),
                linear-gradient(90deg, rgba(5, 150, 105, 0.28), transparent 44%, rgba(2, 132, 199, 0.14) 72%, rgba(255,255,255,0.04));
            opacity: 0.9;
            z-index: 1;
        }

        .history-ai-banner-art {
            position: absolute;
            inset: -6% -2%;
            z-index: 0;
            transform: scale(1);
            transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), filter 0.6s ease;
            filter: saturate(1.02);
        }

        .history-ai-banner:hover .history-ai-banner-art {
            transform: scale(1.04);
            filter: saturate(1.08);
        }

        .history-ai-banner-grid,
        .history-ai-banner-code,
        .history-ai-banner-book {
            position: absolute;
            inset: 0;
        }

        .history-ai-banner-grid {
            background-image:
                linear-gradient(to right, rgba(255,255,255,0.06) 1px, transparent 1px),
                linear-gradient(to bottom, rgba(255,255,255,0.04) 1px, transparent 1px);
            background-size: 34px 34px;
            mask-image: linear-gradient(90deg, transparent, rgba(0,0,0,0.8) 18%, rgba(0,0,0,0.8) 82%, transparent);
        }

        .history-ai-banner-code {
            background:
                repeating-linear-gradient(180deg,
                    rgba(255,255,255,0.14) 0 2px,
                    transparent 2px 16px);
            opacity: 0.2;
            transform: perspective(900px) rotateY(-18deg) rotateX(10deg) scale(1.06);
            transform-origin: left center;
            left: 48%;
            right: -10%;
            top: 8%;
            bottom: 8%;
            filter: blur(0.3px);
        }

        .history-ai-banner-book {
            left: 42%;
            right: -8%;
            top: 6%;
            bottom: 6%;
            background:
                radial-gradient(circle at 45% 48%, rgba(255,255,255,0.22), transparent 14%),
                linear-gradient(90deg, transparent 0 18%, rgba(255,255,255,0.08) 18% 19%, transparent 19% 50%, rgba(255,255,255,0.08) 50% 51%, transparent 51% 100%);
            clip-path: polygon(0 8%, 48% 0, 100% 8%, 100% 92%, 52% 100%, 0 92%);
            opacity: 0.22;
            transform: perspective(900px) rotateY(-18deg) rotateX(8deg);
        }

        .history-ai-banner-copy {
            position: relative;
            z-index: 2;
        }

        .flashcard-overlay-panel {
            width: min(100%, 820px);
            min-height: min(80vh, 600px);
            border-radius: 28px;
            background:
                linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 249, 0.98));
            box-shadow: 0 40px 120px rgba(0, 0, 0, 0.2);
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .flashcard-overlay-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            padding: 16px 20px;
            border-bottom: 1px solid rgba(16, 24, 40, 0.06);
            background: rgba(255, 255, 255, 0.88);
            backdrop-filter: blur(14px);
        }

        .flashcard-overlay-body {
            flex: 1;
            padding: 14px 16px 16px;
            overflow: hidden;
        }

        .flashcard-shell {
            height: 100%;
            display: grid;
            grid-template-columns: 128px minmax(0, 1fr);
            gap: 12px;
            align-items: stretch;
        }

        .flashcard-shell-compact {
            grid-template-columns: minmax(0, 1fr);
        }

        .flashcard-sidebar {
            border-radius: 18px;
            padding: 12px 10px;
            background:
                linear-gradient(180deg, rgba(241, 250, 246, 0.92), rgba(248, 251, 249, 0.96));
            border: 1px solid rgba(16, 185, 129, 0.08);
            display: flex;
            flex-direction: column;
            justify-content: center;
            gap: 10px;
        }

        .flashcard-sidebar-block {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .flashcard-sidebar-label {
            font-size: 10px;
            font-weight: 900;
            letter-spacing: 0.24em;
            text-transform: uppercase;
            color: rgba(67, 70, 84, 0.42);
        }

        .flashcard-progress-meta {
            display: grid;
            gap: 6px;
            margin-top: 8px;
            font-size: 9px;
            font-weight: 800;
            letter-spacing: 0.1em;
            text-transform: uppercase;
            color: rgba(67, 70, 84, 0.42);
        }

        .flashcard-progress-meta strong {
            color: #059669;
            font-size: 12px;
            margin-right: 4px;
        }

        .flashcard-progress-track {
            width: 100%;
            height: 10px;
            border-radius: 999px;
            overflow: hidden;
            background: rgba(16, 185, 129, 0.1);
        }

        .flashcard-progress-fill {
            height: 100%;
            border-radius: inherit;
            background: linear-gradient(90deg, #10b981, #34d399);
            transition: width 0.35s ease;
        }

        .flashcard-stat-row {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 12px;
        }

        .flashcard-stat {
            padding: 10px;
            border-radius: 14px;
            background: rgba(255, 255, 255, 0.72);
            border: 1px solid rgba(16, 24, 40, 0.04);
        }

        .flashcard-stat strong {
            display: block;
            font-family: 'Manrope', sans-serif;
            font-size: 17px;
            line-height: 1;
            font-weight: 900;
            letter-spacing: -0.04em;
            color: #191c1d;
        }

        .flashcard-stat span {
            display: block;
            margin-top: 6px;
            font-size: 10px;
            font-weight: 900;
            letter-spacing: 0.18em;
            text-transform: uppercase;
            color: rgba(67, 70, 84, 0.45);
        }

        .flashcard-stage {
            min-width: 0;
            min-height: 0;
            display: grid;
            grid-template-rows: minmax(420px, 1fr) auto;
            gap: 10px;
        }

        .flashcard-stage-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            min-height: 0;
            display: none;
        }

        .flashcard-stage-badges {
            display: flex;
            flex-wrap: wrap;
            justify-content: flex-end;
            gap: 8px;
        }

        .flashcard-kicker {
            font-size: 10px;
            font-weight: 900;
            letter-spacing: 0.26em;
            text-transform: uppercase;
            color: rgba(67, 70, 84, 0.42);
        }

        .flashcard-stage-title {
            font-family: 'Manrope', sans-serif;
            font-size: clamp(18px, 2.4vw, 26px);
            line-height: 0.95;
            font-weight: 900;
            letter-spacing: -0.05em;
            color: #191c1d;
            min-height: 24px;
        }

        .flashcard-state-pill {
            padding: 6px 10px;
            border-radius: 999px;
            background: rgba(16, 185, 129, 0.08);
            color: #059669;
            font-size: 10px;
            font-weight: 900;
            letter-spacing: 0.18em;
            text-transform: uppercase;
            white-space: nowrap;
        }

        .flashcard-card {
            position: relative;
            min-height: 380px;
            height: 100%;
            padding: 10px;
            border-radius: 22px;
            background:
                radial-gradient(circle at top right, rgba(16, 185, 129, 0.08), transparent 28%),
                linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 250, 247, 0.98));
            border: 1px solid rgba(16, 185, 129, 0.1);
            box-shadow:
                0 24px 60px rgba(16, 24, 40, 0.08),
                inset 0 1px 0 rgba(255, 255, 255, 0.8);
            cursor: pointer;
            overflow: hidden;
            perspective: 1600px;
        }

        .flashcard-card::before {
            content: "";
            position: absolute;
            inset: 6px;
            border-radius: 16px;
            border: 1px solid rgba(16, 185, 129, 0.08);
            pointer-events: none;
        }

        .flashcard-card-inner {
            position: relative;
            z-index: 1;
            height: 100%;
            min-height: 100%;
            text-align: center;
            transform-style: preserve-3d;
            transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
        }

        .flashcard-card-inner.flipped {
            transform: rotateY(180deg);
        }

        .flashcard-face {
            position: absolute;
            inset: 0;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            gap: 10px;
            padding: 0 12px;
            backface-visibility: hidden;
            -webkit-backface-visibility: hidden;
            overflow: hidden;
        }

        .flashcard-face.back {
            transform: rotateY(180deg);
        }

        .flashcard-face-label {
            font-size: 11px;
            font-weight: 900;
            letter-spacing: 0.28em;
            text-transform: uppercase;
        }

        .flashcard-face-label.error {
            color: rgba(220, 38, 38, 0.7);
        }

        .flashcard-face-label.success {
            color: rgba(5, 150, 105, 0.82);
        }

        .flashcard-word {
            font-family: "KaiTi", "Kaiti SC", "STKaiti", "Noto Serif SC", serif;
            font-size: clamp(34px, 6vw, 62px);
            line-height: 1.05;
            font-weight: 700;
            letter-spacing: -0.03em;
            color: #191c1d;
            word-break: break-word;
        }

        .flashcard-word.error {
            color: rgba(185, 28, 28, 0.9);
        }

        .flashcard-word.success {
            color: #047857;
        }

        .flashcard-support {
            max-width: 360px;
            margin: 0 auto;
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .flashcard-pinyin {
            font-size: 13px;
            font-weight: 700;
            letter-spacing: 0.08em;
            color: #059669;
        }

        .flashcard-meaning {
            font-size: 13px;
            line-height: 1.5;
            font-weight: 600;
            color: rgba(67, 70, 84, 0.82);
        }

        .flashcard-actions-inline {
            display: flex;
            justify-content: center;
            gap: 8px;
            flex-wrap: wrap;
            margin-top: 4px;
        }

        .flashcard-footer {
            display: grid;
            gap: 10px;
        }

        .flashcard-progress-inline {
            display: grid;
            gap: 8px;
        }

        .flashcard-icon-button {
            min-width: 56px;
            height: 40px;
            padding: 0 10px;
            border-radius: 12px;
            border: 1px solid rgba(16, 185, 129, 0.12);
            background: rgba(255, 255, 255, 0.92);
            color: #059669;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
        }

        .flashcard-icon-button:hover {
            transform: translateY(-1px);
            background: #ecfdf5;
        }

        .flashcard-icon-button.wide {
            min-width: 118px;
            font-size: 9px;
            font-weight: 900;
            letter-spacing: 0.16em;
            text-transform: uppercase;
        }

        .flashcard-nav {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 8px;
        }

        .flashcard-nav button {
            height: 42px;
            border-radius: 12px;
            font-size: 9px;
            font-weight: 900;
            letter-spacing: 0.18em;
            text-transform: uppercase;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
        }

        .flashcard-complete {
            height: 100%;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            text-align: center;
            gap: 18px;
            padding: 24px;
        }

        .flashcard-complete .badge {
            padding: 10px 18px;
            border-radius: 999px;
            background: rgba(16, 185, 129, 0.08);
            color: #059669;
            font-size: 10px;
            font-weight: 900;
            letter-spacing: 0.22em;
            text-transform: uppercase;
        }

        @media (max-width: 900px) {
            .flashcard-overlay-panel {
                min-height: min(86vh, 680px);
                border-radius: 24px;
            }

            .flashcard-overlay-header {
                padding: 14px 14px 12px;
            }

            .flashcard-overlay-body {
                padding: 12px 12px 14px;
            }

            .flashcard-shell {
                grid-template-columns: 1fr;
            }

            .flashcard-sidebar {
                padding: 14px;
            }

            .flashcard-stage-head {
                flex-direction: column;
                align-items: flex-start;
            }

            .flashcard-stage-badges {
                justify-content: flex-start;
            }

            .flashcard-card {
                min-height: 360px;
                padding: 10px;
            }

            .flashcard-stage-title {
                font-size: 20px;
            }
        }

        .scan-shell {
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 32px;
        }

        .scan-glow {
            position: absolute;
            width: 260px;
            height: 260px;
            border-radius: 9999px;
            background:
                radial-gradient(circle, rgba(16, 185, 129, 0.18) 0%, rgba(16, 185, 129, 0.08) 35%, rgba(255, 255, 255, 0) 72%);
            filter: blur(12px);
            opacity: 0.95;
        }

        .scan-card {
            position: relative;
            width: min(100%, 440px);
            padding: 36px 32px 28px;
            border-radius: 32px;
            border: 1px solid rgba(16, 185, 129, 0.12);
            background: rgba(255, 255, 255, 0.88);
            backdrop-filter: blur(20px);
            box-shadow:
                0 24px 80px rgba(25, 28, 29, 0.08),
                inset 0 1px 0 rgba(255, 255, 255, 0.8);
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 22px;
        }

        .scan-loader {
            width: 92px;
            height: 92px;
            padding: 0;
            border-radius: 28px;
            background: linear-gradient(180deg, rgba(16, 185, 129, 0.18), rgba(16, 185, 129, 0.05));
            box-shadow:
                0 12px 30px rgba(16, 185, 129, 0.18),
                inset 0 0 0 1px rgba(16, 185, 129, 0.08);
        }

        .scan-loader-core {
            width: 100%;
            height: 100%;
            border-radius: 22px;
            background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(241, 250, 246, 0.96));
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            overflow: hidden;
            color: #10b981;
            box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.08);
        }

        .scan-grid {
            position: absolute;
            inset: 10px;
            border-radius: 16px;
            background-image:
                linear-gradient(to right, rgba(16, 185, 129, 0.08) 1px, transparent 1px),
                linear-gradient(to bottom, rgba(16, 185, 129, 0.08) 1px, transparent 1px);
            background-size: 14px 14px;
            opacity: 0.9;
        }

        .scan-line {
            position: absolute;
            left: 10px;
            right: 10px;
            height: 14px;
            border-radius: 9999px;
            background:
                linear-gradient(90deg, rgba(16, 185, 129, 0), rgba(16, 185, 129, 0.18), rgba(16, 185, 129, 0.85), rgba(16, 185, 129, 0.18), rgba(16, 185, 129, 0));
            filter: blur(0.2px);
            box-shadow:
                0 0 12px rgba(16, 185, 129, 0.22),
                0 0 24px rgba(16, 185, 129, 0.12);
            animation: scanSweep 1.9s cubic-bezier(0.4, 0, 0.2, 1) infinite;
        }

        .scan-corners {
            position: absolute;
            inset: 10px;
            pointer-events: none;
        }

        .scan-corners span {
            position: absolute;
            width: 14px;
            height: 14px;
            border-color: rgba(16, 185, 129, 0.82);
            border-style: solid;
            opacity: 0.95;
        }

        .scan-corners span:nth-child(1) {
            top: 0;
            left: 0;
            border-width: 2px 0 0 2px;
            border-top-left-radius: 10px;
        }

        .scan-corners span:nth-child(2) {
            top: 0;
            right: 0;
            border-width: 2px 2px 0 0;
            border-top-right-radius: 10px;
        }

        .scan-corners span:nth-child(3) {
            right: 0;
            bottom: 0;
            border-width: 0 2px 2px 0;
            border-bottom-right-radius: 10px;
        }

        .scan-corners span:nth-child(4) {
            left: 0;
            bottom: 0;
            border-width: 0 0 2px 2px;
            border-bottom-left-radius: 10px;
        }

        .scan-loader-core .material-symbols-outlined {
            position: relative;
            z-index: 2;
            font-size: 34px;
            font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
            animation: scanPulse 2s ease-in-out infinite;
        }

        .scan-copy {
            display: flex;
            flex-direction: column;
            gap: 8px;
            align-items: center;
        }

        .scan-title {
            font-family: 'Manrope', sans-serif;
            font-size: 32px;
            line-height: 1.05;
            font-weight: 900;
            letter-spacing: -0.03em;
            color: #10b981;
        }

        .scan-subtitle {
            max-width: 320px;
            font-size: 13px;
            line-height: 1.6;
            font-weight: 700;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: rgba(67, 70, 84, 0.65);
        }

        .scan-steps {
            width: 100%;
            display: grid;
            gap: 10px;
            margin-top: 4px;
        }

        .scan-step {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 14px;
            border-radius: 16px;
            background: rgba(243, 244, 245, 0.78);
            color: rgba(67, 70, 84, 0.62);
            font-size: 13px;
            font-weight: 700;
            transition: all 0.25s ease;
        }

        .scan-step.active {
            background: rgba(16, 185, 129, 0.08);
            color: #0f9f73;
            box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.1);
        }

        .scan-step-dot {
            width: 10px;
            height: 10px;
            border-radius: 9999px;
            background: currentColor;
            opacity: 0.22;
            flex-shrink: 0;
        }

        .scan-step.active .scan-step-dot {
            opacity: 1;
            box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.12);
            animation: scanDotPulse 1.6s ease-in-out infinite;
        }

        @keyframes scanSweep {
            0% {
                top: 12px;
                opacity: 0;
            }
            12% {
                opacity: 1;
            }
            50% {
                opacity: 1;
            }
            88% {
                opacity: 1;
            }
            100% {
                top: calc(100% - 26px);
                opacity: 0;
            }
        }

        @keyframes scanPulse {
            0%, 100% { transform: scale(0.92); opacity: 0.75; }
            50% { transform: scale(1); opacity: 1; }
        }

        @keyframes scanDotPulse {
            0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.12); }
            50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.12); }
        }

        @media (max-width: 640px) {
            .scan-shell {
                width: 100%;
                padding: 20px;
            }

            .scan-card {
                width: 100%;
                padding: 28px 22px 20px;
                border-radius: 26px;
                gap: 18px;
            }

            .scan-loader {
                width: 78px;
                height: 78px;
                border-radius: 24px;
            }

            .scan-loader-core {
                border-radius: 18px;
            }

            .scan-title {
                font-size: 24px;
            }

            .scan-subtitle {
                max-width: 260px;
                font-size: 11px;
            }
        }

        /* ═══ TAB PANEL SYSTEM ═══ */
        .tab-panel {
            display: none;
            animation: tabFadeIn 0.25s ease forwards;
        }
        .tab-panel.active {
            display: flex;
            flex-direction: column;
        }
        @keyframes tabFadeIn {
            from { opacity: 0; transform: translateY(8px); }
            to   { opacity: 1; transform: translateY(0); }
        }

        /* Desktop nav active tab */
        .main-tab.active {
            background: var(--primary, #10b981);
            color: #fff !important;
            box-shadow: 0 4px 14px rgba(16, 185, 129,0.25);
        }

        /* Mobile bottom bar */
        .mobile-bottom-bar {
            display: none;
            position: fixed;
            bottom: 0; left: 0; right: 0;
            z-index: 200;
            background: rgba(255,255,255,0.85);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border-top: 1px solid #e7e8e9;
            padding: 8px 0 max(8px, env(safe-area-inset-bottom));
        }
        @media (max-width: 1023px) {
            .mobile-bottom-bar { display: flex; }
            body { padding-bottom: 72px; }
        }
        .mobile-tab-btn {
            flex: 1; display: flex; flex-direction: column; align-items: center;
            gap: 3px; padding: 6px 4px; border: none; background: transparent;
            color: #737686; font-size: 9px; font-weight: 700; text-transform: uppercase;
            letter-spacing: 0.05em; cursor: pointer; transition: color 0.2s;
            font-family: 'Inter', sans-serif;
        }
        .mobile-tab-btn .material-symbols-outlined { font-size: 22px; transition: all 0.2s; }
        .mobile-tab-btn.active { color: #10b981; }
        .mobile-tab-btn.active .material-symbols-outlined {
            font-variation-settings: 'FILL' 1, 'wght' 600, 'GRAD' 0, 'opsz' 24;
        }

        @keyframes slideDown {
            from {
                opacity: 0;
                transform: translateY(-20px) scale(0.96);
            }

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

        @keyframes slideInLeft {
            from {
                transform: translateX(-100%);
            }

            to {
                transform: translateX(0);
            }
        }

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

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

        /* ═══ CHAT WIDGET STYLES ═══ */
        .chat-toggle {
            position: fixed;
            bottom: 24px;
            right: 24px;
            width: 64px;
            height: 64px;
            border-radius: 50%;
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
            color: white;
            border: none;
            font-size: 28px;
            cursor: pointer;
            box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
            transition: all 0.3s ease;
            z-index: 999;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .chat-toggle:hover {
            transform: scale(1.1);
            box-shadow: 0 12px 32px rgba(16, 185, 129, 0.4);
        }

        .chat-toggle .badge-dot {
            position: absolute;
            top: 8px;
            right: 8px;
            width: 12px;
            height: 12px;
            background: #ef4444;
            border-radius: 50%;
            border: 2px solid white;
            animation: pulse 2s infinite;
        }

        .chat-widget {
            position: fixed;
            bottom: 100px;
            right: 24px;
            width: 420px;
            max-width: calc(100vw - 48px);
            height: 600px;
            max-height: calc(100vh - 140px);
            background: white;
            border-radius: 24px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
            display: none;
            flex-direction: column;
            z-index: 998;
            overflow: hidden;
            animation: slideInUp 0.3s ease;
        }

        .chat-widget.active {
            display: flex;
        }

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

        .chat-header {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
            color: white;
            padding: 20px;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .chat-header h3 {
            font-size: 16px;
            font-weight: 700;
            margin: 0;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .chat-header .model-tag {
            font-size: 10px;
            font-weight: 600;
            background: rgba(255, 255, 255, 0.2);
            padding: 4px 8px;
            border-radius: 8px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .chat-close {
            background: rgba(255, 255, 255, 0.2);
            border: none;
            color: white;
            width: 32px;
            height: 32px;
            border-radius: 50%;
            cursor: pointer;
            font-size: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background 0.2s;
        }

        .chat-close:hover {
            background: rgba(255, 255, 255, 0.3);
        }

        .chat-messages {
            flex: 1;
            overflow-y: auto;
            padding: 20px;
            display: flex;
            flex-direction: column;
            gap: 16px;
            background: #f8f9fa;
        }

        .chat-welcome {
            text-align: center;
            padding: 40px 20px;
            color: #737686;
        }

        .chat-welcome .welcome-icon {
            font-size: 48px;
            margin-bottom: 16px;
        }

        .chat-message {
            display: flex;
            gap: 12px;
            animation: messageSlideIn 0.3s ease;
        }

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

        .chat-message.user {
            flex-direction: row-reverse;
        }

        .chat-message .avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            flex-shrink: 0;
        }

        .chat-message.bot .avatar {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
            color: white;
        }

        .chat-message.user .avatar {
            background: #e1e3e4;
            color: #191c1d;
        }

        .chat-message .bubble {
            max-width: 75%;
            padding: 12px 16px;
            border-radius: 16px;
            line-height: 1.5;
            font-size: 14px;
        }

        .chat-message.bot .bubble {
            background: white;
            color: #191c1d;
            border: 1px solid #e1e3e4;
        }

        .chat-message.user .bubble {
            background: #10b981;
            color: white;
        }

        .quick-prompts {
            padding: 12px 20px;
            display: none;
            flex-wrap: wrap;
            gap: 8px;
            background: white;
            border-top: 1px solid #e1e3e4;
        }

        .quick-prompts.show {
            display: flex;
        }

        .quick-prompt-btn {
            padding: 8px 14px;
            background: #f3f4f5;
            border: 1px solid #e1e3e4;
            border-radius: 12px;
            font-size: 12px;
            font-weight: 600;
            color: #191c1d;
            cursor: pointer;
            transition: all 0.2s;
        }

        .quick-prompt-btn:hover {
            background: #10b981;
            color: white;
            border-color: #10b981;
        }

        .chat-input-area {
            padding: 16px 20px;
            background: white;
            border-top: 1px solid #e1e3e4;
            display: flex;
            gap: 12px;
            align-items: center;
        }

        .chat-input-area input {
            flex: 1;
            padding: 12px 16px;
            border: 1px solid #e1e3e4;
            border-radius: 12px;
            font-size: 14px;
            outline: none;
            transition: border-color 0.2s;
        }

        .chat-input-area input:focus {
            border-color: #10b981;
        }

        .chat-send-btn {
            width: 44px;
            height: 44px;
            border-radius: 12px;
            background: #10b981;
            color: white;
            border: none;
            font-size: 20px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
        }

        .chat-send-btn:hover {
            background: #059669;
            transform: scale(1.05);
        }

        .chat-send-btn:disabled {
            background: #e1e3e4;
            color: #737686;
            cursor: not-allowed;
            transform: none;
        }

        @media (max-width: 768px) {
            .chat-widget {
                bottom: 100px;
                right: 12px;
                left: 12px;
                width: auto;
                max-width: none;
            }

            .chat-toggle {
                bottom: 88px;
                right: 12px;
                width: 56px;
                height: 56px;
                font-size: 24px;
            }
        }

.prompt-level-tab.active {
            background: white;
            color: var(--primary);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
        }
        .nb-filter-btn.active {
            background: #10b981 !important;
            color: white !important;
            box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
        }
        .no-scrollbar::-webkit-scrollbar { display: none; }
        .nb-card-inner {
            transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
            transform-style: preserve-3d;
            position: relative;
            width: 100%;
            height: 100%;
        }
        .nb-card-inner.flipped {
            transform: rotateY(180deg);
        }
        .nb-card-front, .nb-card-back {
            backface-visibility: hidden;
            -webkit-backface-visibility: hidden;
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
        }
        .nb-card-back {
            transform: rotateY(180deg);
        }
        .no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
        .nb-snap-container {
            scroll-behavior: smooth;
        }
        .nb-card-content::-webkit-scrollbar {
            width: 4px;
        }
        .nb-card-content::-webkit-scrollbar-track {
            background: transparent;
        }
.nb-card-content::-webkit-scrollbar-thumb {
            background: var(--surface-container-high);
            border-radius: 10px;
        }

        .result-compare-shell {
            position: relative;
            perspective: 1800px;
        }

        .result-compare-frame {
            min-height: min(72vh, 860px);
            border-radius: 2rem;
            overflow: hidden;
            background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,249,250,0.98));
        }

        .result-compare-inner {
            position: relative;
            width: 100%;
            min-height: min(72vh, 860px);
            transform-style: preserve-3d;
            transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
        }

        .result-compare-inner.flipped {
            transform: rotateY(180deg);
        }

        .result-compare-face {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            backface-visibility: hidden;
            -webkit-backface-visibility: hidden;
            display: flex;
            flex-direction: column;
        }

        .result-compare-back {
            transform: rotateY(180deg);
        }

        .result-compare-body {
            flex: 1;
            min-height: 0;
            overflow-y: auto;
            scroll-behavior: smooth;
        }

        .result-compare-body::-webkit-scrollbar {
            width: 6px;
        }

        .result-compare-body::-webkit-scrollbar-track {
            background: transparent;
        }

        .result-compare-body::-webkit-scrollbar-thumb {
            background: rgba(115, 118, 134, 0.28);
            border-radius: 9999px;
        }

        .result-compare-toggle.active {
            background: rgba(16, 185, 129, 0.1);
            color: #10b981;
            box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.1);
        }

        @media (max-width: 1023px) {
            .result-compare-frame,
            .result-compare-inner {
                min-height: auto;
            }

            .result-compare-face {
                position: relative;
                transform: none;
            }

            .result-compare-back {
                display: none;
            }

            .result-compare-inner.flipped .result-compare-front {
                display: none;
            }

            .result-compare-inner.flipped .result-compare-back {
                display: flex;
            }

            .result-compare-body {
                max-height: none;
            }
        }
