/* ============================================================
   mycar-ai.com – Glassmorphism Design System
   ============================================================ */

/* --- Design Tokens --- */
:root {
    --bg-deep: #070b1a;
    --bg-mesh-1: #6d28d9;
    --bg-mesh-2: #2563eb;
    --bg-mesh-3: #0ea5e9;

    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-bg-hover: rgba(255, 255, 255, 0.09);
    --glass-border: rgba(255, 255, 255, 0.10);
    --glass-border-focus: rgba(139, 92, 246, 0.5);
    --glass-blur: 18px;

    --accent: #8b5cf6;
    --accent-light: #a78bfa;
    --accent-dark: #6d28d9;
    --accent-glow: rgba(139, 92, 246, 0.35);

    --accent-warm: #f59e0b;
    --accent-warm-light: #fcd34d;
    --accent-warm-dark: #d97706;
    --accent-warm-glow: rgba(245, 158, 11, 0.35);

    --severity-critical: #ef4444;
    --severity-critical-bg: rgba(239, 68, 68, 0.12);
    --severity-critical-border: rgba(239, 68, 68, 0.3);
    --severity-warning: #f59e0b;
    --severity-warning-bg: rgba(245, 158, 11, 0.12);
    --severity-warning-border: rgba(245, 158, 11, 0.3);
    --severity-minor: #4ade80;
    --severity-minor-bg: rgba(74, 222, 128, 0.12);
    --severity-minor-border: rgba(74, 222, 128, 0.3);

    --bottom-nav-height: 64px;

    --text-1: #f1f5f9;
    --text-2: #94a3b8;
    --text-3: #64748b;

    --danger: #f87171;
    --danger-bg: rgba(248, 113, 113, 0.12);
    --danger-border: rgba(248, 113, 113, 0.25);

    --info-bg: rgba(139, 92, 246, 0.15);
    --info-border: rgba(139, 92, 246, 0.3);

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 100px;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* --- Reset --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-deep);
    color: var(--text-1);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Animated Background Mesh --- */
.bg-mesh {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.45;
    will-change: transform;
}

.orb-1 {
    width: 55vw;
    height: 55vw;
    max-width: 600px;
    max-height: 600px;
    background: radial-gradient(circle, var(--bg-mesh-1), transparent 70%);
    top: -15%;
    left: -10%;
    animation: drift1 22s ease-in-out infinite alternate;
}

.orb-2 {
    width: 45vw;
    height: 45vw;
    max-width: 500px;
    max-height: 500px;
    background: radial-gradient(circle, var(--bg-mesh-2), transparent 70%);
    bottom: -10%;
    right: -8%;
    animation: drift2 26s ease-in-out infinite alternate;
}

.orb-3 {
    width: 35vw;
    height: 35vw;
    max-width: 400px;
    max-height: 400px;
    background: radial-gradient(circle, var(--bg-mesh-3), transparent 70%);
    top: 40%;
    left: 50%;
    opacity: 0.25;
    animation: drift3 30s ease-in-out infinite alternate;
}

@keyframes drift1 {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(80px, 60px) scale(1.15); }
}
@keyframes drift2 {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-70px, -50px) scale(1.1); }
}
@keyframes drift3 {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-40px, 30px) scale(1.2); }
}

/* --- Glass Utility --- */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* --- Top Bar --- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-radius: 0;
    border-top: none;
    border-left: none;
    border-right: none;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-icon {
    width: 26px;
    height: 26px;
    color: var(--accent-light);
}

.topbar-title {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    white-space: nowrap;
    margin-right: 0.5rem;
}

.accent {
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-2);
    cursor: pointer;
    transition: all 0.25s var(--ease-out);
}

.btn-icon:hover, .btn-icon:focus-visible {
    background: var(--glass-bg-hover);
    color: var(--text-1);
    border-color: var(--glass-border-focus);
    box-shadow: 0 0 16px var(--accent-glow);
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

/* --- Main Content --- */
.main-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 16px;
    padding-bottom: calc(24px + var(--safe-bottom));
}

@media (max-width: 768px) {
    .main-content {
        padding-bottom: calc(var(--bottom-nav-height) + 24px + var(--safe-bottom));
    }
}

/* --- Hero --- */
.hero {
    text-align: center;
    padding: 20px 8px 28px;
    animation: fadeIn 0.8s var(--ease-out);
}

#hero-section {
    display: none;
}

/* --- Legal Pages --- */
.legal-page {
    max-width: 980px;
}

.legal-card {
    padding: 30px 26px;
}

.legal-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
}

.legal-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-2);
    text-decoration: none;
    font-weight: 600;
}

.legal-back:hover {
    color: var(--accent-light);
}

.legal-title {
    font-size: clamp(1.8rem, 4vw, 2.2rem);
    line-height: 1.15;
    margin: 0;
}

.legal-sub {
    color: var(--text-2);
    font-size: 0.95rem;
}

.legal-body h2 {
    margin-top: 18px;
    margin-bottom: 10px;
    font-size: 1.05rem;
    color: var(--text-1);
}

.legal-body p {
    color: var(--text-2);
    margin: 10px 0;
}

.legal-body ul {
    margin: 10px 0 10px 18px;
    color: var(--text-2);
}

.legal-body li {
    margin: 8px 0;
}

.legal-body a {
    color: var(--accent-light);
}

.hero-title {
    font-size: clamp(1.6rem, 5vw, 2.2rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.5px;
    margin-bottom: 10px;
}

.hero-sub {
    color: var(--text-2);
    font-size: clamp(0.9rem, 2.5vw, 1.05rem);
    font-weight: 400;
    max-width: 440px;
    margin: 0 auto;
}

/* --- Cards --- */
.card {
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    margin-bottom: 20px;
    transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}

.form-card {
    animation: slideUp 0.6s var(--ease-out) 0.15s both;
    padding: 32px;
}

.form-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}

.form-card-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--info-bg);
    border: 1px solid var(--info-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-light);
    flex-shrink: 0;
}

.form-card-icon-wrap svg {
    width: 24px;
    height: 24px;
}

.form-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-1);
    margin-bottom: 2px;
}

.form-card-subtitle {
    font-size: 0.9rem;
    color: var(--text-2);
}

.form-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .form-card {
        padding: 24px 20px;
    }
}

.result-card {
    animation: slideUp 0.5s var(--ease-out) both;
}

.skeleton-card {
    animation: slideUp 0.4s var(--ease-out) both;
}

/* --- Input Group --- */
.input-group {
    margin-bottom: 18px;
}

.input-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: stretch;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 15px;
    width: 20px;
    height: 20px;
    color: var(--text-3);
    pointer-events: none;
    transition: color 0.25s;
}

.input-wrap input,
.input-wrap textarea {
    width: 100%;
    padding: 14px 14px 14px 46px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.25);
    color: var(--text-1);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s var(--ease-out);
    outline: none;
    min-height: 50px;
    resize: vertical;
}

.input-wrap input::placeholder {
    color: var(--text-3);
}

.input-wrap input:focus,
.input-wrap textarea:focus {
    border-color: var(--glass-border-focus);
    background: rgba(0, 0, 0, 0.35);
    box-shadow: 0 0 20px var(--accent-glow);
}

.input-wrap:focus-within .input-icon {
    color: var(--accent-light);
}

/* --- Primary Button --- */
.btn-primary {
    position: relative;
    width: 100%;
    padding: 16px 24px;
    min-height: 54px;
    border: none;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: white;
    font-size: 1.05rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s var(--ease-out);
    margin-top: 6px;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        transparent 30%,
        rgba(255, 255, 255, 0.12) 50%,
        transparent 70%
    );
    transform: translateX(-100%);
    transition: transform 0.6s var(--ease-out);
}

.btn-primary:hover::before {
    transform: translateX(100%);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 30px var(--accent-glow);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.btn-primary:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity 0.25s, transform 0.25s;
}

.btn-icon-svg {
    width: 20px;
    height: 20px;
}

.btn-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s;
    pointer-events: none;
}

/* Loading state */
.btn-primary.loading .btn-content {
    opacity: 0;
    transform: scale(0.9);
}
.btn-primary.loading .btn-loader {
    opacity: 1;
}
.btn-primary.loading {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    animation: pulseGlow 2s ease-in-out infinite;
}

.diagnostic-actions-row {
    display: flex;
    align-items: stretch;
    gap: 12px;
    margin-top: 6px;
}

.diagnostic-actions-row .btn-primary,
.diagnostic-actions-row .btn-secondary {
    margin-top: 0;
}

.diagnostic-actions-row .btn-primary {
    flex: 1 1 0;
}

.diagnostic-actions-row .btn-secondary {
    flex: 1 1 0;
    min-width: 0;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-1);
    font-size: 0.96rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s var(--ease-out);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--glass-border-focus);
    box-shadow: 0 0 16px var(--accent-glow);
}

.btn-secondary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

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

.loader-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
    animation: dotBounce 1.4s ease-in-out infinite;
}

.loader-dots span:nth-child(2) { animation-delay: 0.16s; }
.loader-dots span:nth-child(3) { animation-delay: 0.32s; }

@keyframes dotBounce {
    0%, 80%, 100% { transform: scale(0.4); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 4px 20px var(--accent-glow); }
    50% { box-shadow: 0 4px 40px rgba(139, 92, 246, 0.55); }
}

/* --- Error Toast --- */
.error-toast {
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    color: var(--danger);
    font-size: 0.9rem;
    animation: shakeIn 0.4s var(--ease-spring);
}

/* --- Result Section --- */
.result-card {
    position: relative;
    padding: 20px 22px 32px;
    overflow: hidden;
}

.result-hero-shell {
    position: relative;
    z-index: 2;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--glass-border);
}

.result-top-controls {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.result-control-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex: 0 0 auto;
    flex-wrap: wrap;
}

.result-unlock-btn {
    min-height: 35px;
    padding: 8px 14px;
    border-radius: var(--radius-pill);
}

.lang-dropdown-wrap {
    position: relative;
    z-index: 4;
    flex: 0 0 auto;
}

.pdf-report-open-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid rgba(167, 139, 250, 0.28);
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(37, 99, 235, 0.12));
    color: var(--text-1);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), border-color 0.2s var(--ease-out), background 0.2s var(--ease-out);
}

.pdf-report-open-btn:hover,
.pdf-report-open-btn:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(109, 40, 217, 0.22);
    border-color: rgba(167, 139, 250, 0.54);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.24), rgba(37, 99, 235, 0.18));
}

.pdf-report-open-btn svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: var(--accent-light);
}

.action-locked {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.action-locked:hover,
.action-locked:focus-visible {
    transform: none;
    box-shadow: none;
}

.lang-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-pill);
    color: var(--text-1);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background 0.2s, border-color 0.2s;
    letter-spacing: 0.5px;
}

.lang-dropdown-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: var(--glass-border-focus);
}

.lang-icon {
    width: 14px;
    height: 14px;
    color: var(--accent-light);
    flex-shrink: 0;
}

.lang-chevron {
    width: 12px;
    height: 12px;
    color: var(--text-2);
    flex-shrink: 0;
    transition: transform 0.2s var(--ease-out);
}

.lang-dropdown-btn[aria-expanded="true"] .lang-chevron {
    transform: rotate(180deg);
}

.lang-dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 140px;
    background: rgba(15, 20, 40, 0.96);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    overflow: hidden;
    z-index: 100;
    animation: fadeIn 0.15s var(--ease-out);
}

.lang-option {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    color: var(--text-2);
    font-size: 0.85rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.lang-option:hover {
    background: rgba(255,255,255,0.07);
    color: var(--text-1);
}

.lang-option-active {
    color: var(--accent-light);
    font-weight: 600;
}

/* --- Result Header Block --- */
.result-header-block {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(180px, 0.75fr);
    align-items: end;
    gap: 16px;
    min-height: 160px;
}

.result-car-heading {
    font-size: clamp(2rem, 5vw, 2.4rem);
    font-weight: 900;
    line-height: 0.98;
    letter-spacing: -0.06em;
    margin: 0;
    max-width: 12ch;
    color: var(--text-1);
    text-wrap: balance;
}

.result-heading-column {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 14px;
    min-width: 0;
}

.badge-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
    justify-content: flex-start;
}

.result-media-column {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    min-height: 160px;
    overflow: visible;
}

.result-refine-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 5;
    min-height: 42px;
    padding: 10px 14px;
    border-radius: var(--radius-pill);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(0, 0, 0, 0.28);
}

.result-refine-btn .btn-icon-svg {
    width: 18px;
    height: 18px;
}

.result-refine-btn .btn-text {
    font-size: 0.92rem;
    font-weight: 700;
}

.result-refine-btn.hidden {
    display: none;
}

.diagnostic-version-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
    flex: 1 1 auto;
}

.diagnostic-version-title {
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-2);
}

.diagnostic-version-list {
    display: flex;
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: wrap;
}

.result-hero-img {
    position: relative;
    z-index: 2;
    width: min(100%, 260px);
    max-height: 170px;
    object-fit: contain;
    object-position: center bottom;
    transition: opacity 0.4s var(--ease-out), transform 0.35s var(--ease-out);
    pointer-events: none;
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.22));
}

.result-hero-img.no-image {
    opacity: 0;
    transform: scale(0.96);
}

.result-hero-fade {
    display: none;
}

.diagnostic-version-chip {
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-2);
    padding: 7px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
}

.diagnostic-version-chip:hover,
.diagnostic-version-chip:focus-visible {
    color: var(--text-1);
    border-color: var(--glass-border-focus);
    background: rgba(255, 255, 255, 0.12);
}

.diagnostic-version-chip.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.9), rgba(109, 40, 217, 0.9));
    border-color: rgba(167, 139, 250, 0.7);
}

#roadmap-content.markdown-body {
    position: relative;
    z-index: 2;
}

#roadmap-content.roadmap-preview-fade::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 72px;
    background: linear-gradient(180deg, rgba(7, 11, 26, 0), rgba(7, 11, 26, 0.92));
    pointer-events: none;
}

/* ============================================================
   Paywall Modal — High-conversion design
   ============================================================ */

.paywall-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.paywall-modal-overlay.hidden { display: none; }

.paywall-modal-overlay.active .paywall-modal-backdrop { opacity: 1; }

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

.paywall-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 6, 18, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.4s var(--ease-out);
}

/* Mobile: full screen */
.paywall-modal {
    position: relative;
    z-index: 1;
    width: 100%;
    background: #0d1224;
    border: none;
    border-radius: 0;
    overflow: hidden;
    transform: translateY(40px) scale(0.99);
    opacity: 0;
    transition: transform 0.45s var(--ease-spring), opacity 0.35s var(--ease-out);
    box-shadow: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
}

/* Desktop: 90vw × 90vh centered */
@media (min-width: 560px) {
    .paywall-modal-overlay {
        align-items: center;
        justify-content: center;
        padding: 5vh 5vw;
    }
    .paywall-modal {
        width: 90vw;
        max-width: 900px;
        height: 90vh;
        border-radius: 20px;
        border: 1px solid rgba(139, 92, 246, 0.3);
        box-shadow: 0 24px 80px rgba(139, 92, 246, 0.3), 0 0 0 1px rgba(139, 92, 246, 0.08);
        transform: translateY(24px) scale(0.97);
        flex-direction: row;
    }
}

.paywall-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 10;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.paywall-close-btn:hover { background: rgba(255,255,255,0.13); color: var(--text-1); }

/* Hero */
.pw-hero {
    position: relative;
    height: 190px;
    background: linear-gradient(160deg, #0f0a2e 0%, #130d36 40%, #0d1628 100%);
    overflow: hidden;
    flex-shrink: 0;
}

.pw-hero-glow {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 340px;
    height: 200px;
    background: radial-gradient(ellipse, rgba(139,92,246,0.35) 0%, transparent 65%);
    pointer-events: none;
}

.pw-hero-svg {
    position: relative;
    width: 100%;
    height: 100%;
    display: block;
}

.pw-hero-badge {
    position: absolute;
    top: 14px;
    left: 16px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: rgba(74, 222, 128, 0.12);
    border: 1px solid rgba(74, 222, 128, 0.3);
    border-radius: var(--radius-pill);
    color: #4ade80;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

/* Desktop: hero becomes left column */
@media (min-width: 560px) {
    .pw-hero {
        width: 42%;
        height: auto;
        flex-shrink: 0;
        border-radius: 20px 0 0 20px;
        background: linear-gradient(200deg, #0f0a2e 0%, #140d38 50%, #0a1020 100%);
    }
    .pw-hero-svg {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
    .pw-hero-glow {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 100%;
        height: 100%;
    }
    .pw-hero-badge {
        top: 20px;
        left: 20px;
    }
}

/* Body */
.pw-body {
    padding: 22px 22px calc(22px + var(--safe-bottom));
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

@media (min-width: 560px) {
    .pw-body {
        flex: 1;
        padding: 36px 36px 32px;
        overflow-y: auto;
    }
}

.pw-tag {
    display: inline-flex;
    align-self: flex-start;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    background: linear-gradient(90deg, rgba(245,158,11,0.18), rgba(139,92,246,0.18));
    border: 1px solid rgba(245,158,11,0.35);
    color: var(--accent-warm);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.pw-title {
    font-size: clamp(1.35rem, 4vw, 1.75rem);
    font-weight: 800;
    line-height: 1.15;
    color: #fff;
    margin: 0 0 10px;
    letter-spacing: -0.02em;
}

.pw-sub {
    font-size: 0.9rem;
    color: var(--text-2);
    line-height: 1.6;
    margin: 0 0 20px;
}

/* Feature list */
.pw-features {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.pw-feature {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    transition: border-color 0.2s, background 0.2s;
}

.pw-feature:hover {
    background: rgba(139, 92, 246, 0.06);
    border-color: rgba(139, 92, 246, 0.2);
}

.pw-feature-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pw-feature-icon svg { width: 16px; height: 16px; }

.pw-icon-amber {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: var(--accent-warm);
}

.pw-icon-purple {
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.25);
    color: var(--accent-light);
}

.pw-feature > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.pw-feature strong {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-1);
    line-height: 1.2;
}

.pw-feature span {
    font-size: 0.78rem;
    color: var(--text-3);
    line-height: 1.3;
}

/* Preview bullets inside modal */
.paywall-preview-bullets {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 12px;
}

.paywall-preview-bullet {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.88rem;
    color: var(--text-2);
    line-height: 1.5;
}

.paywall-preview-bullet-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
    font-size: 0.72rem;
}

.paywall-preview-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-light);
    margin-bottom: 6px;
    display: block;
    opacity: 0.8;
}

/* CTA button */
.pw-cta-btn {
    width: 100%;
    padding: 16px 24px;
    border-radius: 14px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #f59e0b 100%);
    background-size: 200% 100%;
    border: none;
    color: #1a0e00;
    font-size: 1rem;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    letter-spacing: -0.01em;
    transition: background-position 0.4s, transform 0.2s var(--ease-spring), box-shadow 0.2s;
    box-shadow: 0 4px 24px rgba(245, 158, 11, 0.4), 0 1px 0 rgba(255,255,255,0.15) inset;
    margin-bottom: 14px;
    position: relative;
    overflow: hidden;
}

.pw-cta-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, transparent 60%);
    pointer-events: none;
}

.pw-cta-btn:hover {
    background-position: 100% 0;
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(245, 158, 11, 0.5), 0 1px 0 rgba(255,255,255,0.15) inset;
}

.pw-cta-btn:active {
    transform: translateY(0) scale(0.99);
    box-shadow: 0 2px 12px rgba(245, 158, 11, 0.35);
}

.pw-cta-btn.loading {
    opacity: 0.75;
    pointer-events: none;
}

/* Trust row */
.pw-trust {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.pw-trust-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--text-3);
    font-weight: 500;
}

.pw-trust-item svg { color: #4ade80; flex-shrink: 0; }

.pw-trust-sep { color: var(--text-3); opacity: 0.4; font-size: 0.75rem; }

/* Secondary link */
.pw-secondary-btn {
    width: 100%;
    background: none;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    color: var(--text-3);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 10px 16px;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
    text-align: center;
}

.pw-secondary-btn:hover {
    border-color: rgba(139, 92, 246, 0.35);
    color: var(--accent-light);
    background: rgba(139, 92, 246, 0.06);
}

/* Meta note */
.pw-meta {
    margin-top: 10px;
    color: var(--text-3);
    font-size: 0.78rem;
    text-align: center;
    line-height: 1.5;
}

/* Spotlight: dim content behind paywall */
#result-section.has-paywall #roadmap-content {
    opacity: 0.32;
    filter: blur(0.6px);
    transition: opacity 0.4s var(--ease-out), filter 0.4s var(--ease-out);
    pointer-events: none;
    user-select: none;
}

#result-section.has-paywall .result-header {
    opacity: 0.5;
    transition: opacity 0.4s var(--ease-out);
}

.premium-lock-sentinel {
    height: 0;
    margin: 0;
    padding: 0;
    visibility: hidden;
}

/* Keep old class references working */
.premium-lock-copy { color: var(--text-2); font-size: 0.9rem; }
.premium-lock-meta { color: var(--text-3); font-size: 0.78rem; margin-top: 10px; text-align: center; }

.badge {
    padding: 5px 14px;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-info {
    background: var(--info-bg);
    color: var(--accent-light);
    border: 1px solid var(--info-border);
}

.badge-preview {
    background: rgba(250, 204, 21, 0.12);
    color: #facc15;
    border: 1px solid rgba(250, 204, 21, 0.28);
}

.badge-error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}

/* --- Markdown Body --- */
.markdown-body {
    line-height: 1.85;
    color: #d1d5db;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-size: 1.02rem;
}

.markdown-body > *:first-child {
    margin-top: 0;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
    color: var(--text-1);
    line-height: 1.35;
    letter-spacing: -0.3px;
}

.markdown-body h1 {
    font-size: 1.55em;
    margin-top: 1.8em;
    margin-bottom: 0.7em;
}

.markdown-body h2 {
    font-size: 1.3em;
    margin-top: 2em;
    margin-bottom: 0.8em;
    padding-bottom: 0.4em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.markdown-body h3 {
    font-size: 1.12em;
    margin-top: 1.6em;
    margin-bottom: 0.6em;
    color: var(--accent-light);
}

.markdown-body p {
    margin-bottom: 1.1em;
    color: #c8ced8;
}

/* --- Lists: better spacing and markers --- */
.markdown-body ol {
    list-style: none;
    counter-reset: md-ol;
    padding-left: 0;
    margin-bottom: 1.2em;
}

.markdown-body ol > li {
    counter-increment: md-ol;
    position: relative;
    padding-left: 2.4em;
    margin-bottom: 1.1em;
}

.markdown-body ol > li::before {
    content: counter(md-ol) ".";
    position: absolute;
    left: 0;
    top: 0;
    font-weight: 700;
    font-size: 1.05em;
    color: var(--accent-light);
    min-width: 2em;
}

.markdown-body ul {
    list-style: none !important;
    padding-left: 0;
    margin-bottom: 1.2em;
}

.markdown-body ul > li {
    position: relative;
    padding-left: 0;
    margin-bottom: 0.7em;
}

.markdown-body ul > li::before,
.markdown-body ul > li::marker {
    content: none;
    display: none;
}

/* Nested lists */
.markdown-body li > ul,
.markdown-body li > ol {
    margin-top: 0.6em;
    margin-bottom: 0.4em;
}

.markdown-body li > ul > li::before {
    content: none;
}

.markdown-body li > ol {
    counter-reset: md-ol-nested;
}

.markdown-body li > ol > li {
    counter-increment: md-ol-nested;
    padding-left: 2em;
}

.markdown-body li > ol > li::before {
    content: counter(md-ol-nested, lower-alpha) ")";
    font-size: 0.95em;
    color: var(--text-2);
}

.markdown-body strong {
    color: var(--text-1);
    font-weight: 600;
}

.markdown-body em {
    color: #b8c0cc;
    font-style: italic;
}

/* Blockquotes */
.markdown-body blockquote {
    margin: 1.2em 0;
    padding: 14px 20px;
    border-left: 3px solid var(--accent);
    background: rgba(139, 92, 246, 0.06);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: #b0b8c8;
}

.markdown-body blockquote p:last-child {
    margin-bottom: 0;
}

/* Horizontal rules */
.markdown-body hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-border), transparent);
    margin: 2em 0;
}

/* Inline code */
.markdown-body code {
    background: rgba(139, 92, 246, 0.12);
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 0.88em;
    color: var(--accent-light);
    font-family: 'Fira Code', 'Consolas', monospace;
}

/* Code blocks */
.markdown-body pre {
    background: rgba(0, 0, 0, 0.35);
    padding: 18px 22px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin-bottom: 1.2em;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.markdown-body pre code {
    background: none;
    padding: 0;
    font-size: 0.9em;
    color: #d1d5db;
}

/* Tables in markdown */
.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.2em;
    font-size: 0.95em;
}

.markdown-body th,
.markdown-body td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.markdown-body th {
    color: var(--text-1);
    font-weight: 600;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.markdown-body tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* --- Collapsible Steps (details/summary) --- */
details {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.3s var(--ease-out);
}

details[open] {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

summary {
    padding: 14px 18px;
    font-weight: 600;
    color: var(--text-1);
    cursor: pointer;
    user-select: none;
    outline: none;
    font-size: 1rem;
    transition: background 0.2s var(--ease-out);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

summary::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--accent-light);
    border-bottom: 2px solid var(--accent-light);
    transform: rotate(-45deg);
    transition: transform 0.25s var(--ease-out);
    flex-shrink: 0;
}

details[open] > summary::before {
    transform: rotate(45deg);
}

summary::-webkit-details-marker { display: none; }
summary::marker { display: none; content: ''; }

summary:hover {
    background: rgba(255, 255, 255, 0.04);
}

/* --- Details inner content --- */
.details-content {
    padding: 10px 22px 18px 22px;
    color: var(--text-2);
    line-height: 1.8;
    font-size: 0.97rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.05);
    word-break: break-word;
}

.details-content p {
    margin-bottom: 0.8em;
    color: #b8c2d0;
}

.details-content p:last-child {
    margin-bottom: 0;
}

.details-content strong {
    color: var(--text-1);
    font-weight: 600;
}

.details-content em {
    color: #a0aab8;
    font-style: italic;
}

.details-content ul, .details-content ol {
    margin: 0.8em 0;
    padding-left: 0;
}

.details-content ul li, .details-content ol li {
    margin-bottom: 0.6em;
    line-height: 1.7;
}

.details-content ul li:last-child, .details-content ol li:last-child {
    margin-bottom: 0;
}

.details-content ul {
    list-style: none;
}

.details-content ul li {
    position: relative;
    padding-left: 1.5em;
}

.details-content ul li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: bold;
    opacity: 0.7;
}

.details-content code {
    background: rgba(139, 92, 246, 0.12);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.88em;
    color: var(--accent-light);
}

/* Fallback for any direct children of details that aren't wrapped */
details > p, details > div:not(.details-content), details > ul, details > ol {
    padding: 4px 22px 14px 22px;
    color: var(--text-2);
}

/* --- Skeleton Loader --- */
.skeleton-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.skel {
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0.04) 25%,
        rgba(255,255,255,0.1) 50%,
        rgba(255,255,255,0.04) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: 6px;
}

.skel-title {
    height: 22px;
    width: 180px;
}

.skel-badges {
    display: flex;
    gap: 8px;
}

.skel-badge {
    height: 28px;
    width: 80px;
    border-radius: var(--radius-pill);
}

.skel-line {
    height: 14px;
    margin-bottom: 12px;
}

.w-full { width: 100%; }
.w-90 { width: 90%; }
.w-80 { width: 80%; }
.w-70 { width: 70%; }
.w-60 { width: 60%; }
.w-50 { width: 50%; }

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --- History Drawer --- */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    opacity: 0;
    transition: opacity 0.35s var(--ease-out);
    pointer-events: none;
}

.drawer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    height: 100dvh;
    z-index: 201;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--glass-border);
    border-radius: 0;
    background: rgba(10, 14, 30, 0.92);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    transform: translateX(100%);
    transition: transform 0.4s var(--ease-out);
    overflow: hidden;
}

.drawer.open {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.drawer-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-1);
}

.drawer-icon {
    width: 20px;
    height: 20px;
    color: var(--accent-light);
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    -webkit-overflow-scrolling: touch;
}

.drawer-body::-webkit-scrollbar {
    width: 4px;
}

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

.drawer-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.drawer-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-3);
    flex: 1;
}

.empty-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.drawer-empty p {
    font-size: 0.9rem;
    line-height: 1.6;
}

/* --- History Item Card --- */
.history-item {
    padding: 12px;
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.25s var(--ease-out);
    display: flex;
    align-items: center;
    gap: 12px;
}

.history-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
}

.history-content-wrap {
    flex: 1;
    min-width: 0;
}


.history-item:hover {
    background: var(--glass-bg-hover);
    border-color: var(--glass-border-focus);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.history-item:active {
    transform: scale(0.98);
}

.history-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.history-car {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-1);
}

.history-code {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--danger);
    background: var(--danger-bg);
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    white-space: nowrap;
}

.history-code.history-desc {
    font-weight: 400;
    color: var(--text-3);
    background: rgba(255, 255, 255, 0.05);
    font-style: italic;
    font-size: 0.75rem;
}

.history-date {
    font-size: 0.75rem;
    color: var(--text-3);
}

/* --- Utility --- */
.hidden {
    display: none !important;
}

/* --- Animations --- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes shakeIn {
    0% { transform: translateX(-8px); opacity: 0; }
    25% { transform: translateX(6px); }
    50% { transform: translateX(-4px); }
    75% { transform: translateX(2px); }
    100% { transform: translateX(0); opacity: 1; }
}

/* --- Responsive: Desktop --- */
@media (min-width: 768px) {
    .main-content {
        padding: 40px 32px;
    }

    .hero {
        padding: 36px 8px 44px;
    }

    .card {
        padding: 34px 32px;
    }

    .result-card {
        padding: 28px 40px 40px;
    }

    .result-header-block {
        grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
        min-height: 180px;
    }

    .markdown-body {
        font-size: 1.06rem;
        line-height: 1.9;
    }

    .markdown-body ol > li {
        padding-left: 2.8em;
        margin-bottom: 1.3em;
    }

    .markdown-body ul > li {
        padding-left: 1.8em;
        margin-bottom: 0.8em;
    }

    .result-title {
        font-size: 1.5rem;
    }

    .card:hover {
        border-color: rgba(139, 92, 246, 0.35);
        box-shadow:
            0 0 0 1px rgba(139, 92, 246, 0.12),
            0 16px 48px rgba(0, 0, 0, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.06);
    }

    .topbar {
        padding: 14px 32px;
    }
}

/* --- Responsive: Small Mobile --- */
@media (max-width: 380px) {
    .hero-title {
        font-size: 1.4rem;
    }

    .card {
        padding: 22px 18px;
    }

    .result-header-block {
        grid-template-columns: 1fr;
        gap: 18px;
        min-height: 0;
    }

    .result-hero-img {
        width: min(100%, 220px);
        max-height: 170px;
    }
}


/* --- Top Nav --- */
.top-nav-items {
    display: flex;
    gap: 8px;
    margin-left: auto;
    position: relative;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-2);
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    height: 42px;
    position: relative;
}

.nav-item:hover {
    background: var(--glass-bg-hover);
    border-color: var(--glass-border-focus);
}

.nav-item-content {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 2;
}

.nav-item-content svg {
    width: 20px;
    height: 20px;
}

.nav-item-label {
    font-size: 0.85rem;
    font-weight: 600;
}

@media (max-width: 600px) {
    .nav-item-label {
        display: none;
    }
    .nav-item {
        padding: 8px 10px;
        width: 42px;
        justify-content: center;
    }
    .topbar-title {
        display: none;
    }
    .topbar-icon {
        display: none;
    }
    .topbar-brand {
        gap: 6px;
    }
}


.nav-item.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.nav-item.active svg {
    filter: none;
}

.nav-drive-strip {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    --nav-drive-start: -18px;
    --nav-drive-end: 0px;
    --nav-drive-y: 17px;
}

.nav-drive-strip-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.nav-drive-car-track {
    transform: translate(var(--nav-drive-start), var(--nav-drive-y));
    will-change: transform;
}

.nav-drive-car-flip {
    transform-origin: 7px 4px;
}

.nav-drive-car-shape {
    image-rendering: pixelated;
}




/* --- Pages --- */
.page {
    animation: fadeIn 0.4s var(--ease-out);
}

/* --- Cars Grid --- */
.cars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.car-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: center;
    transition: all 0.3s var(--ease-out);
}

.car-card:hover {
    transform: translateY(-4px);
    border-color: var(--glass-border-focus);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.car-avatar {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
  
}

.car-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-1);
}

/* --- Detail View --- */
.detail-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.car-info-compact {
    display: flex;
    align-items: center;
    gap: 12px;
}

.car-avatar-small {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.detail-title {
    font-size: 1.3rem;
    font-weight: 700;
}

/* --- Tabs --- */
.tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-2);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    box-shadow: 0 4px 12px var(--accent-glow);
}

/* --- Diagnostic List in Detail --- */
.car-diagnostic-list-title {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin: 0 0 8px 0;
}

.car-diagnostic-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.diag-item {
    padding: 16px;
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: all 0.2s;
}

.diag-item:hover {
    background: var(--glass-bg-hover);
    border-color: var(--glass-border-focus);
}

.diag-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.diag-code {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--danger);
}

.diag-date {
    font-size: 0.8rem;
    color: var(--text-3);
}

.diag-desc {
    font-size: 0.85rem;
    color: var(--text-2);
}

/* --- Chat Interface --- */
.chat-container {
    height: 50vh;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.chat-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    line-height: 1.5;
}

.chat-msg.user {
    align-self: flex-end;
    background: var(--accent);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-msg.assistant {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-1);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--glass-border);
}

.chat-msg.assistant.markdown-body > *:last-child {
    margin-bottom: 0;
}

.chat-msg.assistant.markdown-body {
    font-size: 0.92rem;
}

.chat-msg.assistant.markdown-body ul,
.chat-msg.assistant.markdown-body ol {
    list-style: none;
    padding-left: 0;
}

.chat-msg.assistant.markdown-body ul li::before,
.chat-msg.assistant.markdown-body ul li::marker {
    content: none;
    display: none;
}

.chat-msg-body {
    word-break: break-word;
}

.chat-msg-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.chat-msg-time {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.chat-msg-delete {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
    color: rgba(255, 255, 255, 0.5);
    padding: 3px 5px;
    display: flex;
    align-items: center;
    border-radius: 5px;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.chat-msg-delete:hover {
    color: #f87171;
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.35);
}

.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.chat-suggestion-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid rgba(99, 179, 237, 0.4);
    background: rgba(99, 179, 237, 0.08);
    color: #63b3ed;
    font-size: 0.76rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
}

.chat-suggestion-pill:hover {
    background: rgba(99, 179, 237, 0.2);
    border-color: rgba(99, 179, 237, 0.7);
    color: #bee3f8;
}

.chat-input-area {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 12px;
    border-radius: var(--radius-md);
}

.chat-input-area textarea {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-1);
    font-family: inherit;
    font-size: 0.95rem;
    resize: none;
    min-height: 42px;
    max-height: 120px;
    padding: 10px 0;
    outline: none;
}

.btn-icon-accent {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon-accent:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-icon-accent svg {
    width: 20px;
    height: 20px;
}

/* ============================================================
   Animated AI Chat Button
   ============================================================ */

@keyframes carBlink {
    0%, 100% { opacity: 1; filter: drop-shadow(0 0 4px var(--accent-glow)); }
    50% { opacity: 0.55; filter: drop-shadow(0 0 10px var(--accent-light)); }
}

.ai-chat-btn-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.ai-chat-btn {
    position: relative;
}

.ai-chat-btn.active {
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--accent);
}

.ai-chat-car-tooltip {
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(18, 8, 38, 0.92);
    backdrop-filter: blur(48px) saturate(2);
    -webkit-backdrop-filter: blur(48px) saturate(2);
    color: #fff;
    border-radius: 14px;
    padding: 11px 16px;
    white-space: nowrap;
    max-width: calc(100vw - 32px);
    cursor: pointer;
    border: 1px solid rgba(139, 92, 246, 0.5);
    box-shadow:
        0 8px 40px rgba(0, 0, 0, 0.6),
        0 1px 0 rgba(255, 255, 255, 0.08) inset,
        0 0 28px rgba(139, 92, 246, 0.3);
    animation: tooltipFloat 3s ease-in-out infinite;
    z-index: 200;
    pointer-events: auto;
}

@media (max-width: 480px) {
    .ai-chat-car-tooltip {
        white-space: normal;
        right: 0;
        left: auto;
        transform: none;
        max-width: min(260px, calc(100vw - 32px));
        width: max-content;
    }
}

.ai-chat-car-tooltip::before {
    content: "";
    position: absolute;
    top: -7px;
    right: 22px;
    width: 12px;
    height: 12px;
    background: rgba(18, 8, 38, 0.92);
    border-top: 1px solid rgba(139, 92, 246, 0.5);
    border-left: 1px solid rgba(139, 92, 246, 0.5);
    transform: rotate(45deg);
    border-radius: 3px 0 0 0;
}

.ai-chat-car-tooltip.hidden {
    display: none;
}

.ai-chat-car-tooltip-text {
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.015em;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.92);
    transition: opacity 0.3s ease;
}

.ai-chat-car-tooltip-text.tooltip-text-fade-out {
    opacity: 0;
}

.ai-chat-car-tooltip-text.tooltip-text-fade-in {
    animation: tooltipTextIn 0.4s ease forwards;
}

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

.ai-chat-car-tooltip-arrow {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--accent-light);
    opacity: 1;
}

@keyframes tooltipFloat {
    0%, 100% {
        transform: translateY(0);
        box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6), 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 0 28px rgba(139, 92, 246, 0.3);
    }
    50% {
        transform: translateY(4px);
        box-shadow: 0 14px 48px rgba(0, 0, 0, 0.65), 0 1px 0 rgba(255, 255, 255, 0.1) inset, 0 0 38px rgba(139, 92, 246, 0.45);
    }
}

.car-logo-animated {
    width: 22px;
    height: 22px;
    animation: carBlink 2s ease-in-out infinite;
    color: var(--accent-light);
}

/* ============================================================
   Global AI Chat Panel
   ============================================================ */

.chat-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    opacity: 0;
    transition: opacity 0.35s var(--ease-out);
}

.chat-panel-overlay.active {
    opacity: 1;
}

.global-chat-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 50vw;
    min-width: 380px;
    height: 100dvh;
    z-index: 201;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--glass-border);
    border-radius: 0;
    transform: translateX(100%);
    transition: transform 0.4s var(--ease-out);
    background: rgba(10, 14, 30, 0.92);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
}

.global-chat-panel.open {
    transform: translateX(0);
}

.chat-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.chat-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-1);
}

.chat-panel-icon {
    width: 20px;
    height: 20px;
    color: var(--accent-light);
}

.chat-panel-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

.chat-panel-welcome {
    margin: auto;
    text-align: center;
    color: var(--text-3);
    font-size: 0.9rem;
    line-height: 1.6;
    padding: 24px 16px;
}

.chat-panel-input-area {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid var(--glass-border);
    flex-shrink: 0;
    border-radius: 0;
}

.chat-panel-input-area textarea {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-1);
    font-family: inherit;
    font-size: 0.95rem;
    resize: none;
    min-height: 42px;
    max-height: 120px;
    padding: 10px 0;
    outline: none;
}

.chat-typing {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 12px 14px;
}

.chat-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-3);
    animation: typingDot 1.2s ease-in-out infinite;
}

.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-5px); opacity: 1; }
}

@media (max-width: 768px) {
    .global-chat-panel,
    .drawer {
        width: 100%;
        height: 100dvh;
        border-left: none;
        border-radius: 0;
    }

    .profile-modal-header {
        padding: 14px 16px;
    }

    .profile-modal-title {
        font-size: 20px;
    }

    .profile-modal-eyebrow {
        font-size: 10px;
    }

    .profile-modal-body {
        padding: 16px;
        gap: 16px;
    }

    .profile-hero {
        flex-direction: row;
        align-items: center;
        padding: 16px;
        gap: 16px;
    }

    .profile-avatar {
        width: 72px;
        height: 72px;
        border-radius: 18px;
        flex-shrink: 0;
    }

    .profile-status-row {
        margin-bottom: 6px;
    }

    .profile-status-badge {
        font-size: 11px;
        padding: 4px 10px;
    }

    .profile-status-note {
        font-size: 12px;
    }

    .profile-name {
        font-size: clamp(18px, 5vw, 24px);
        margin-bottom: 4px;
    }

    .profile-email {
        font-size: 13px;
        margin-bottom: 12px;
    }

    .profile-hero-actions {
        flex-direction: column;
        gap: 8px;
    }

    .profile-action-btn,
    .profile-signout-link {
        width: 100%;
        min-width: 0;
        text-align: center;
        justify-content: center;
    }

    .profile-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .profile-stat-card {
        padding: 14px;
        gap: 6px;
    }

    .profile-stat-value {
        font-size: clamp(22px, 6vw, 28px);
    }

    .profile-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .profile-panel {
        padding: 14px;
        gap: 12px;
    }

    .profile-section-header h3,
    .profile-panel-header h3 {
        font-size: 15px;
    }

    .profile-info-row {
        padding: 10px 12px;
        gap: 8px;
    }

    .profile-info-row span,
    .profile-info-row strong {
        font-size: 13px;
    }

    .profile-info-row strong {
        text-align: right;
    }

    .profile-feature-item {
        padding: 10px 12px;
        gap: 4px;
    }

    .profile-feature-item strong {
        font-size: 13px;
    }

    .profile-feature-item span {
        font-size: 12px;
    }
}

#car-model.normalizing {
    opacity: 0.6;
    background-image: linear-gradient(90deg, transparent 25%, rgba(139,92,246,0.15) 50%, transparent 75%);
    background-size: 200% 100%;
    animation: shimmer 1s infinite linear;
}

#car-model.normalized {
    border-color: rgba(52, 211, 153, 0.6);
    box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.2);
    transition: border-color 0.3s, box-shadow 0.3s;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.car-avatar-preview {
    display: block;
    width: 128px;
    height: 128px;
    object-fit: cover;
    border-radius: 12px;
    margin-top: 10px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    transition: opacity 0.4s ease;
}

.car-avatar-preview.loading {
    opacity: 0.4;
    animation: shimmer 1s infinite linear;
    background-image: linear-gradient(90deg, transparent 25%, rgba(139,92,246,0.2) 50%, transparent 75%);
    background-size: 200% 100%;
}

.car-avatar-preview.hidden {
    display: none;
}

.car-profile-avatar-wrap {
    display: flex;
    justify-content: center;
    margin: 16px 0 8px;
}

.car-profile-avatar-container {
    position: relative;
    width: 180px;
    height: 180px;
}

.car-profile-avatar {
    width: 180px;
    height: 180px;
    object-fit: contain;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    display: block;
}

.car-avatar-change-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid rgba(255,255,255,0.15);
    transition: background 0.2s;
}

.car-avatar-change-btn:hover {
    background: var(--accent-light);
}

.car-avatar-change-btn svg {
    width: 16px;
    height: 16px;
    stroke: #fff;
}

.topbar-auth {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 12px;
}

.btn-signin {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-1);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    white-space: nowrap;
}

.btn-signin:hover {
    background: var(--glass-bg-hover);
    border-color: var(--glass-border-focus);
    box-shadow: 0 0 16px var(--accent-glow);
}

.user-menu {
    position: relative;
}

.user-avatar-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    background: var(--glass-bg);
    padding: 2px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.25s var(--ease-out);
    box-shadow: 0 0 0 0 var(--accent-glow), 0 2px 8px rgba(0,0,0,0.3);
}

.user-avatar-btn:hover {
    border-color: var(--accent-light);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.22), 0 4px 16px rgba(139, 92, 246, 0.35);
    transform: scale(1.06);
}

.user-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.user-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(7, 11, 26, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1999;
}

.user-menu-overlay.active {
    display: block;
}

.user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 260px;
    background: rgba(10, 14, 30, 0.98);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    backdrop-filter: blur(var(--glass-blur));
    z-index: 2000;
    overflow: hidden;
    isolation: isolate;
}

.user-dropdown-info {
    padding: 16px 18px;
    border-bottom: 1px solid var(--glass-border);
}

.user-dropdown-avatar-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-dropdown-avatar-img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
    flex-shrink: 0;
    background: var(--glass-bg);
}

.user-dropdown-name-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.user-dropdown-name-block span:first-child {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown-name-block span:last-child {
    font-size: 0.78rem;
    color: var(--text-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown-item {
    display: block;
    padding: 10px 16px;
    font-size: 0.85rem;
    color: var(--text-2);
    text-decoration: none;
    transition: background 0.15s;
}

.user-dropdown-item:hover {
    background: var(--glass-bg-hover);
    color: var(--text-1);
}

.user-dropdown-item + .user-dropdown-item {
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.user-dropdown-logout {
    color: #ef4444;
}

.user-dropdown-logout:hover {
    color: #f87171;
}

.user-dropdown-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: calc(100% - 32px);
    margin: 12px 16px 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.user-dropdown-close-btn:hover {
    background: var(--glass-bg-hover);
    color: var(--text-1);
}

@media (max-width: 600px) {
    .user-dropdown {
        position: fixed;
        left: 16px;
        right: 16px;
        top: 50%;
        transform: translateY(-50%);
        min-width: 0;
        width: auto;
        border-radius: 20px;
        animation: slideUp 0.25s var(--ease-out) both;
    }

    .user-dropdown-info {
        padding: 20px 20px 16px;
    }

    .user-dropdown-avatar-img {
        width: 52px;
        height: 52px;
    }

    .user-dropdown-name-block span:first-child {
        font-size: 1rem;
    }

    .user-dropdown-name-block span:last-child {
        font-size: 0.82rem;
    }

    .user-dropdown-item {
        padding: 14px 20px;
        font-size: 1rem;
    }

    .user-dropdown-close-btn {
        display: flex;
    }
}

/* ============================================================
   Login Required Modal
   ============================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(7, 11, 26, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
}

.modal-overlay.hidden {
    display: none;
}

.modal-card {
    width: 100%;
    max-width: 420px;
    border-radius: 20px;
    padding: 36px 32px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    border: 1px solid var(--glass-border);
}

.modal-overlay.active .modal-card {
    transform: translateY(0);
}

.modal-icon-wrap {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-dark), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 32px var(--accent-glow);
}

.modal-shield-icon {
    width: 30px;
    height: 30px;
    color: #fff;
}

.modal-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-1);
    margin: 0;
}

.modal-subtitle {
    font-size: 0.95rem;
    color: var(--text-2);
    margin: 0;
    line-height: 1.5;
}

.modal-coupon-banner {
    width: 100%;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(109, 40, 217, 0.25), rgba(37, 99, 235, 0.2));
    border: 1px solid rgba(139, 92, 246, 0.35);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.modal-coupon-label {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--accent-light);
}

.modal-coupon-text {
    font-size: 0.88rem;
    color: var(--text-2);
}

.modal-coupon-text strong {
    color: var(--text-1);
}

.modal-coupon-code {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #fff;
    background: rgba(139, 92, 246, 0.3);
    border: 1px dashed var(--accent-light);
    border-radius: 8px;
    padding: 6px 18px;
}

.modal-btn-signin {
    width: 100%;
    justify-content: center;
    padding: 13px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 12px;
    gap: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.modal-btn-signin:hover {
    background: rgba(255, 255, 255, 0.13);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.25);
}

.refine-modal {
    max-width: 560px;
    align-items: stretch;
    text-align: left;
}

.refine-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.refine-input-group {
    margin-bottom: 0;
}

.refine-input-wrap textarea {
    min-height: 140px;
}

.refine-voice-status {
    min-height: 22px;
    color: var(--text-2);
    font-size: 0.9rem;
}

.refine-keyboard-btn {
    width: 100%;
}

.pdf-report-modal-overlay {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
    background: rgba(6, 9, 20, 0.94);
}

.pdf-report-modal {
    width: 100%;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at top right, rgba(109, 40, 217, 0.18), transparent 30%),
        linear-gradient(180deg, rgba(7, 11, 26, 0.99), rgba(9, 12, 24, 0.99));
    color: var(--text-1);
}

.pdf-report-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 28px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(7, 11, 26, 0.74);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}

.pdf-report-modal-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pdf-report-modal-eyebrow {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-light);
}

.pdf-report-modal-title {
    font-size: 1.35rem;
    font-weight: 700;
}

.pdf-report-modal-subtitle {
    color: var(--text-2);
    font-size: 0.92rem;
}

.pdf-report-modal-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.pdf-report-download-btn {
    min-height: 46px;
    padding-inline: 18px;
}

.pdf-report-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-1);
    cursor: pointer;
    transition: background 0.2s var(--ease-out), border-color 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}

.pdf-report-modal-close:hover,
.pdf-report-modal-close:focus-visible {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--glass-border-focus);
    transform: translateY(-1px);
}

.pdf-report-modal-body {
    flex: 1 1 auto;
    overflow: auto;
    padding: 24px 24px 48px;
}

.pdf-report-page-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.pdf-report-page-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    color: var(--text-2);
    font-size: 0.84rem;
    font-weight: 600;
}

.pdf-report-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.pdf-report-page {
    width: 210mm;
    min-width: 210mm;
    max-width: 210mm;
    height: 297mm;
    display: flex;
    flex-direction: column;
    padding: 14mm 14mm 12mm;
    border-radius: 18px;
    background: #ffffff;
    color: #111827;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.pdf-report-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 8mm;
    border-bottom: 1px solid rgba(17, 24, 39, 0.12);
}

.pdf-report-page-brand {
    display: flex;
    flex-direction: column;
    gap: 2mm;
}

.pdf-report-page-brand-label {
    display: flex;
    align-items: center;
    gap: 2mm;
    font-size: 3.2mm;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #7c3aed;
}

.pdf-report-brand-icon {
    width: 5mm;
    height: 5mm;
    flex-shrink: 0;
    color: #7c3aed;
}

.pdf-report-page-title {
    font-size: 8mm;
    line-height: 1.04;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: #111827;
}

.pdf-report-page-code {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    padding: 2.6mm 4.2mm;
    border-radius: 999px;
    background: rgba(124, 58, 237, 0.08);
    border: 1px solid rgba(124, 58, 237, 0.18);
    font-size: 3.5mm;
    font-weight: 700;
    color: #6d28d9;
}

.pdf-report-page-summary {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(50mm, 0.8fr);
    gap: 8mm;
    padding: 8mm 0 7mm;
    border-bottom: 1px solid rgba(17, 24, 39, 0.08);
}

.pdf-report-summary-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4mm;
}

.pdf-report-summary-meta--3col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pdf-report-summary-card--wide {
    grid-column: 1 / -1;
}

.pdf-report-version-inline {
    display: inline-block;
    padding: 0.8mm 2.5mm;
    border-radius: 999px;
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.22);
    font-size: 3.1mm;
    font-weight: 700;
    color: #6d28d9;
    vertical-align: middle;
    line-height: 1.3;
}

.pdf-report-summary-card {
    padding: 4mm;
    border-radius: 5mm;
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.28);
}

.pdf-report-summary-label {
    display: block;
    margin-bottom: 1.2mm;
    font-size: 2.9mm;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #475569;
}

.pdf-report-summary-value {
    display: block;
    font-size: 4mm;
    line-height: 1.45;
    color: #111827;
    word-break: break-word;
}

.pdf-report-summary-image-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48mm;
    padding: 5mm;
    border-radius: 7mm;
    background: linear-gradient(180deg, rgba(124, 58, 237, 0.08), rgba(59, 130, 246, 0.04));
    border: 1px solid rgba(124, 58, 237, 0.12);
}

.pdf-report-summary-image {
    width: 100%;
    max-width: 58mm;
    max-height: 38mm;
    object-fit: contain;
}

.pdf-report-summary-image-hidden {
    display: none;
}

.pdf-report-page-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    padding-top: 7mm;
}

.pdf-report-page-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 5mm;
    border-top: 1px solid rgba(17, 24, 39, 0.08);
    font-size: 3mm;
    color: #475569;
}

.pdf-report-block,
.pdf-report-section-title,
.pdf-report-section-block {
    break-inside: avoid;
    page-break-inside: avoid;
}

.pdf-report-block {
    margin-bottom: 4.2mm;
}

.pdf-report-block:last-child,
.pdf-report-section-block:last-child {
    margin-bottom: 0;
}

.pdf-report-section-title {
    margin: 0 0 3.5mm;
    padding: 4mm 4.5mm;
    border-radius: 4.5mm;
    background: linear-gradient(135deg, #111827, #1f2937);
    color: #ffffff;
}

.pdf-report-section-title h2 {
    margin: 0;
    font-size: 4.8mm;
    font-weight: 800;
    line-height: 1.25;
}

.pdf-report-section-block {
    margin-bottom: 3.6mm;
    padding: 0;
    border-left: none;
}

.pdf-report-page .markdown-body {
    color: #0f172a;
    font-size: 3.6mm;
    line-height: 1.65;
}

.pdf-report-page .markdown-body h1,
.pdf-report-page .markdown-body h2,
.pdf-report-page .markdown-body h3 {
    color: #111827;
}

.pdf-report-page .markdown-body h1 {
    font-size: 6.2mm;
    margin-top: 0;
}

.pdf-report-page .markdown-body h2 {
    font-size: 4.9mm;
    border-bottom-color: rgba(17, 24, 39, 0.1);
}

.pdf-report-page .markdown-body h3 {
    font-size: 4.2mm;
    color: #1e293b;
}

.pdf-report-page .markdown-body p,
.pdf-report-page .markdown-body li,
.pdf-report-page .markdown-body td,
.pdf-report-page .markdown-body th,
.pdf-report-page .markdown-body blockquote {
    color: #0f172a;
}

.pdf-report-page .markdown-body strong,
.pdf-report-page .markdown-body b {
    color: #020617;
    font-weight: 700;
}

.pdf-report-page .markdown-body em {
    color: #334155;
}

.pdf-report-page .markdown-body blockquote {
    background: rgba(124, 58, 237, 0.05);
    border-left-color: #7c3aed;
}

.pdf-report-page .markdown-body code {
    background: rgba(124, 58, 237, 0.08);
    color: #6d28d9;
}

.pdf-report-page .markdown-body pre {
    background: #0f172a;
    color: #e2e8f0;
    border-color: rgba(15, 23, 42, 0.08);
}

.pdf-report-page .markdown-body th,
.pdf-report-page .markdown-body td {
    border-bottom-color: rgba(148, 163, 184, 0.25);
}

.pdf-report-empty {
    padding: 12mm 10mm;
    border-radius: 7mm;
    background: #f8fafc;
    border: 1px dashed rgba(148, 163, 184, 0.5);
    text-align: center;
    color: #64748b;
}

.modal-dismiss {
    background: none;
    border: none;
    color: var(--text-3);
    font-size: 0.83rem;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.15s;
}

.modal-dismiss:hover {
    color: var(--text-2);
}

/* ─── COINS BADGE ─────────────────────────────────────────── */

.coins-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px 6px 10px;
    background: linear-gradient(135deg, #fcd34d 0%, #f59e0b 50%, #d97706 100%);
    color: #1a1a2e;
    border: 1px solid rgba(255, 210, 80, 0.45);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s var(--ease-spring), box-shadow 0.2s;
    box-shadow: 0 2px 12px rgba(245, 158, 11, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.coins-badge:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.coins-badge-label {
    font-size: 10px;
    font-weight: 600;
    opacity: 0.65;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ─── COINS MODAL ─────────────────────────────────────────── */

.coins-modal {
    max-width: 480px;
    width: 100%;
    position: relative;
    padding: 32px;
}

.profile-modal-overlay {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
}

.profile-modal {
    width: 100%;
    height: 100dvh;
    background: linear-gradient(180deg, rgba(7, 11, 26, 0.98), rgba(10, 14, 30, 0.98));
    display: flex;
    flex-direction: column;
    color: var(--text-1);
}

.profile-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 28px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(7, 11, 26, 0.72);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}

.profile-modal-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-modal-eyebrow {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-light);
}

.profile-modal-title {
    font-size: 28px;
    line-height: 1.1;
}

.profile-modal-close {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-1);
    cursor: pointer;
    transition: background 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}

.profile-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--glass-border-focus);
}

.profile-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.profile-hero {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 24px;
    border-radius: var(--radius-lg);
}

.profile-avatar {
    width: 112px;
    height: 112px;
    border-radius: 28px;
    object-fit: cover;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.profile-hero-content {
    flex: 1;
    min-width: 0;
}

.profile-status-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.profile-status-badge {
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    background: rgba(74, 222, 128, 0.12);
    border: 1px solid rgba(74, 222, 128, 0.3);
    color: #4ade80;
    font-size: 12px;
    font-weight: 700;
}

.profile-status-note {
    color: var(--text-2);
    font-size: 14px;
}

.profile-name {
    font-size: clamp(28px, 5vw, 40px);
    line-height: 1.05;
    margin-bottom: 8px;
}

.profile-email {
    color: var(--text-2);
    font-size: 16px;
    margin-bottom: 18px;
    word-break: break-word;
}

.profile-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.profile-action-btn {
    width: auto;
    min-width: 160px;
    margin-top: 0;
}

.profile-signout-link {
    padding: 13px 18px;
    border-radius: 12px;
}

.profile-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.profile-section-header h3,
.profile-panel-header h3 {
    font-size: 18px;
    margin-bottom: 4px;
}

.profile-section-header p,
.profile-panel-header p {
    color: var(--text-2);
    font-size: 14px;
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.profile-stat-card {
    padding: 20px;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-stat-label {
    color: var(--text-2);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.profile-stat-value {
    font-size: clamp(24px, 4vw, 34px);
    line-height: 1;
}

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

.profile-panel {
    padding: 20px;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.profile-info-list,
.profile-feature-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-info-row,
.profile-feature-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.profile-info-row span,
.profile-feature-item span {
    color: var(--text-2);
    font-size: 14px;
}

.profile-info-row strong,
.profile-feature-item strong {
    color: var(--text-1);
    font-size: 14px;
    text-align: right;
}

.profile-feature-item {
    flex-direction: column;
    justify-content: flex-start;
}

.coins-expiry-value {
    color: var(--text-1);
}

.coins-expiry-warning {
    color: #f59e0b;
}

.coins-expiry-urgent {
    color: #ef4444;
    font-weight: 700;
}

.modal-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-3);
    cursor: pointer;
    padding: 4px;
    transition: color 0.15s;
}

.modal-close-btn:hover {
    color: var(--text-1);
}

.coins-modal-header {
    text-align: center;
    margin-bottom: 28px;
}

.coins-modal-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

.coins-modal-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-1);
    margin-bottom: 6px;
}

.coins-modal-sub {
    font-size: 13px;
    color: var(--text-2);
}

.coins-packages {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.coin-pkg-card {
    background: var(--glass-bg);
    border: 1.5px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
    position: relative;
}

.coin-pkg-card:hover {
    border-color: var(--accent);
    background: var(--info-bg);
    transform: translateY(-2px);
}

.coin-pkg-card.selected {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.coin-pkg-card.popular-pkg::before {
    content: "BEST VALUE";
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: #f59e0b;
    color: #1a1a2e;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}

.pkg-coins {
    font-size: 20px;
    font-weight: 800;
    color: #f59e0b;
    margin-bottom: 4px;
}

.pkg-label {
    font-size: 11px;
    color: var(--text-2);
    margin-bottom: 10px;
}

.pkg-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-1);
}

.pkg-price-original {
    font-size: 12px;
    color: var(--text-3);
    text-decoration: line-through;
    margin-bottom: 2px;
}

.pkg-price-discounted {
    font-size: 18px;
    font-weight: 700;
    color: #4ade80;
}

.pkg-buy-btn {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 8px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #1a1a2e;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s;
}

.pkg-buy-btn:hover {
    opacity: 0.9;
}

.pkg-value-label {
    font-size: 10px;
    color: var(--text-3);
    margin-top: 4px;
    line-height: 1.3;
}

.coins-coupon-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.coins-coupon-input {
    flex: 1;
    padding: 10px 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-1);
    font-size: 13px;
    outline: none;
    text-transform: uppercase;
    transition: border-color 0.15s;
}

.coins-coupon-input:focus {
    border-color: var(--accent);
}

.coins-coupon-apply {
    padding: 10px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-1);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.coins-coupon-apply:hover {
    background: var(--glass-bg-hover);
}

.coins-coupon-msg {
    font-size: 13px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.coins-coupon-msg.success {
    background: rgba(74, 222, 128, 0.12);
    border: 1px solid rgba(74, 222, 128, 0.3);
    color: #4ade80;
}

.coins-coupon-msg.error {
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    color: var(--danger);
}

.coins-checkout-error {
    font-size: 13px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    color: var(--danger);
    margin-top: 8px;
}

/* ─── PAYMENT TOAST ─────────────────────────────────────────── */

.payment-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(74, 222, 128, 0.15);
    border: 1px solid rgba(74, 222, 128, 0.4);
    color: #4ade80;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

.payment-toast-icon {
    font-size: 18px;
}

.payment-toast-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    margin-left: 8px;
    opacity: 0.7;
}

.payment-toast-close:hover {
    opacity: 1;
}

/* dropdown buy coins item */
.user-dropdown-item {
    display: block;
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    padding: 10px 16px;
    color: var(--text-2);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.1s, color 0.1s;
    text-decoration: none;
    font-family: inherit;
}

.user-dropdown-item:hover {
    background: var(--glass-bg-hover);
    color: var(--text-1);
}

.chat-throttle-note {
    text-align: center;
    font-size: 12px;
    color: var(--text-3, #888);
    padding: 6px 12px;
    opacity: 0.8;
    animation: fadeIn 0.2s ease;
}

/* --- Car Profile Section --- */
.car-profile-section {
    margin: 0 16px 16px;
    animation: slideUp 0.4s var(--ease-out) both;
}

.car-profile-story {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-2);
    padding: 14px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    font-style: italic;
}

.car-profile-specs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.car-profile-spec-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
}

.car-profile-spec-icon {
    display: flex;
    align-items: center;
    width: 16px;
    height: 16px;
    color: var(--accent-light);
    flex-shrink: 0;
}

.car-profile-spec-icon svg {
    width: 16px;
    height: 16px;
}

.car-profile-spec-key {
    font-size: 11px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.car-profile-spec-val {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-1);
}

.car-profile-price {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: var(--radius-md);
    flex-wrap: wrap;
}

.car-profile-price-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--accent-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.car-profile-price-label svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.car-profile-price-range {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-1);
}

.car-profile-price-note {
    font-size: 11px;
    color: var(--text-3);
    margin-left: auto;
}

.car-profile-skeleton {
    margin: 0 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.car-profile-specs-skel {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.skel-spec {
    height: 62px;
    border-radius: var(--radius-sm);
}

/* --- Toggle Switch --- */
.profile-toggle-row {
    align-items: flex-start;
    gap: 12px;
}

.profile-toggle-label-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.profile-toggle-label-wrap small {
    font-size: 11px;
    color: var(--text-3);
    line-height: 1.4;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;
    margin-top: 2px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.12);
    border-radius: 24px;
    transition: background 0.25s;
    border: 1px solid rgba(255,255,255,0.1);
}

.toggle-slider::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--text-2);
    border-radius: 50%;
    transition: transform 0.25s var(--ease-out), background 0.25s;
}

.toggle-switch input:checked + .toggle-slider {
    background: rgba(139, 92, 246, 0.4);
    border-color: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px) translateY(-50%);
    background: var(--accent-light);
}

/* --- Diag Tile Keyframes --- */
@keyframes diag-tile-enter {
    0% {
        opacity: 0;
        transform: translateY(-22px) scale(0.96);
        filter: blur(4px);
    }
    60% {
        filter: blur(0px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0px);
    }
}

@keyframes diag-tile-exit {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
        max-height: 200px;
        padding-top: 14px;
        padding-bottom: 14px;
        margin-bottom: 0;
    }
    30% {
        transform: translateY(4px) scale(0.99);
        opacity: 0.6;
    }
    100% {
        opacity: 0;
        transform: translateY(10px) scale(0.97);
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        margin-bottom: -8px;
    }
}

@keyframes diag-section-reveal {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes diag-title-shimmer {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@keyframes diag-tile-shimmer-sweep {
    from { transform: translateX(-100%) skewX(-10deg); }
    to   { transform: translateX(250%) skewX(-10deg); }
}

.diag-tile-entering {
    animation: diag-tile-enter 3.2s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: calc(var(--tile-index, 0) * 300ms);
}

.diag-tile-exiting {
    animation: diag-tile-exit 2.5s cubic-bezier(0.4, 0, 0.8, 1) forwards;
    overflow: hidden;
    pointer-events: none;
}

/* --- Last Diagnostics Section --- */
.last-diagnostics-section {
    padding: 0 0 16px 0;
    width: 100%;
}

.last-diagnostics-section:not(.hidden) {
    animation: diag-section-reveal 2.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.last-diagnostics-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding: 0 2px;
}

.last-diagnostics-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: linear-gradient(
        90deg,
        var(--text-3) 20%,
        rgba(167, 139, 250, 0.85) 50%,
        var(--text-3) 80%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: diag-title-shimmer 4s linear infinite;
}

.last-diagnostics-tiles {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

@media (min-width: 640px) {
    .last-diagnostics-tiles {
        grid-template-columns: repeat(2, 1fr);
    }
}

.diag-tile {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    cursor: pointer;
    transition:
        background 0.28s var(--ease-out),
        border-color 0.28s var(--ease-out),
        transform 0.28s var(--ease-spring),
        box-shadow 0.28s var(--ease-out);
    position: relative;
    overflow: hidden;
}

/* shimmer overlay (hover sweep) */
.diag-tile::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(139,92,246,0.07) 0%, transparent 65%);
    opacity: 0;
    transition: opacity 0.3s var(--ease-out);
    pointer-events: none;
}

/* shine sweep on hover */
.diag-tile::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 40%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.055),
        transparent
    );
    transform: translateX(-100%) skewX(-10deg);
    pointer-events: none;
}

.diag-tile:hover {
    background: var(--glass-bg-hover);
    border-color: rgba(139, 92, 246, 0.32);
    transform: translateY(-2px);
    box-shadow:
        0 8px 28px rgba(0, 0, 0, 0.28),
        0 0 0 1px rgba(139, 92, 246, 0.12);
}

.diag-tile:hover::before {
    opacity: 1;
}

.diag-tile:hover::after {
    animation: diag-tile-shimmer-sweep 2.5s ease-out forwards;
}

.diag-tile:active {
    transform: translateY(0) scale(0.99);
    transition-duration: 0.1s;
}

.diag-tile-avatar-wrap {
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.diag-tile-avatar {
    width: 120px;
    object-fit: contain;
    display: block;
    opacity: 0;
    transition: opacity 0.5s var(--ease-out);
}

.diag-tile-avatar.loaded {
    opacity: 1;
}

.diag-tile-avatar-placeholder {
    width: 120px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(139, 92, 246, 0.08);
    border-radius: var(--radius-sm);
    position: relative;
    overflow: hidden;
}

.diag-tile-avatar-placeholder::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 25%,
        rgba(139, 92, 246, 0.08) 50%,
        transparent 75%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite linear;
}

.diag-tile-avatar-placeholder svg {
    width: 32px;
    height: 32px;
    stroke: var(--accent);
    opacity: 0.5;
    position: relative;
    z-index: 1;
}

.diag-tile-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.diag-tile-top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.diag-tile-car {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s;
}

.diag-tile:hover .diag-tile-car {
    color: #fff;
}

.diag-tile-code {
    font-size: 11px;
    font-weight: 700;
    color: var(--danger);
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    border-radius: 6px;
    padding: 2px 7px;
    letter-spacing: 0.05em;
    flex-shrink: 0;
    transition: box-shadow 0.2s;
}

.diag-tile:hover .diag-tile-code {
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.25);
}

.diag-tile-problem {
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.diag-tile-arrow {
    flex-shrink: 0;
    color: var(--text-3);
    display: flex;
    align-items: center;
    transition: color 0.25s, transform 0.3s var(--ease-spring), opacity 0.2s;
    opacity: 0.6;
}

.diag-tile:hover .diag-tile-arrow {
    color: var(--accent-light);
    transform: translateX(4px);
    opacity: 1;
}

@media (max-width: 600px) {
    .diagnostic-actions-row {
        flex-direction: column;
    }

    .diagnostic-actions-row .btn-secondary {
        min-width: 0;
        width: 100%;
    }

    .result-top-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 12px;
    }

    .diagnostic-version-wrap,
    .diagnostic-version-list {
        align-items: flex-start;
        justify-content: flex-start;
    }

    .result-control-actions {
        justify-content: flex-start;
    }

    .result-unlock-btn,
    .pdf-report-open-btn {
        width: 100%;
        justify-content: center;
    }

    .lang-dropdown-wrap {
        align-self: flex-start;
    }

    .premium-lock-features {
        grid-template-columns: 1fr;
    }

    .result-car-heading {
        max-width: 100%;
    }

    .result-header-block {
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 18px;
        min-height: 0;
        padding-bottom: 0;
    }

    .result-media-column {
        min-height: 180px;
        order: -1;
    }

    .result-hero-img {
        width: min(100%, 220px);
        max-height: 180px;
    }

    .pdf-report-modal-header {
        flex-direction: column;
        align-items: stretch;
        padding: 18px 16px;
    }

    .pdf-report-modal-actions {
        width: 100%;
    }

    .pdf-report-download-btn {
        flex: 1 1 auto;
        width: 100%;
    }

    .pdf-report-modal-body {
        padding: 16px 10px 28px;
    }

    .pdf-report-page {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        height: auto;
        min-height: 297mm;
        padding: 10mm;
        border-radius: 14px;
    }

    .pdf-report-page-summary {
        grid-template-columns: 1fr;
    }

    .pdf-report-summary-meta {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Mobile Bottom Navigation Bar
   ============================================================ */

.bottom-nav {
    display: none;
}

/* --- Footer --- */
.site-footer {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 16px 24px;
}

.site-footer-inner {
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    padding: 18px 24px;
    overflow: hidden;
}

.site-footer-body {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 16px 24px;
    flex-wrap: wrap;
    min-height: 64px;
}

.site-footer-brand-col {
    flex-shrink: 0;
    display: flex;
    align-items: stretch;
}

.site-footer-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.site-footer-brand-icon {
    height: 100%;
    width: auto;
    min-height: 52px;
    max-height: 80px;
    flex-shrink: 0;
    display: block;
}

.site-footer-brand-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
}

@keyframes footer-shimmer {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

.site-footer-title {
    font-weight: 900;
    letter-spacing: -0.02em;
    font-size: 1.25rem;
    line-height: 1;
    background: linear-gradient(90deg, #6d28d9, #a78bfa, #f0abfc, #38bdf8, #a78bfa, #8b5cf6);
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: footer-shimmer 3.5s linear infinite;
}

.site-footer-sub {
    display: block;
    color: var(--text-3);
    font-size: 0.75rem;
    line-height: 1.35;
}

.site-footer-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
}

.site-footer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 4px 14px;
}

.site-footer-links a {
    color: var(--text-3);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.72rem;
    padding: 0;
    border: none;
    border-radius: 0;
    background: none;
    transition: color 0.2s var(--ease-out);
}

.site-footer-links a:hover {
    color: var(--accent-light);
    box-shadow: none;
}

.site-footer-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    color: var(--text-3);
    font-size: 0.65rem;
    line-height: 1.35;
    opacity: 0.7;
}

.site-footer-note {
    color: var(--text-3);
    font-size: 0.65rem;
}

@media (max-width: 768px) {
    .site-footer {
        padding-bottom: calc(var(--bottom-nav-height) + 20px + var(--safe-bottom));
    }

    .site-footer-inner {
        padding: 16px 16px;
    }

    .site-footer-right {
        align-items: flex-start;
    }

    .site-footer-links {
        justify-content: flex-start;
    }

    .site-footer-meta {
        align-items: flex-start;
    }

    .site-footer-body {
        gap: 10px 12px;
    }
}

@media (max-width: 768px) {
    .bottom-nav {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: calc(var(--bottom-nav-height) + var(--safe-bottom));
        padding-bottom: var(--safe-bottom);
        z-index: 150;
        border-top: 1px solid var(--glass-border);
        border-radius: 0;
        background: rgba(7, 11, 26, 0.94);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    .top-nav-items {
        display: none;
    }
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 4px;
    background: none;
    border: none;
    color: var(--text-3);
    font-size: 0.68rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    position: relative;
    transition: color 0.2s var(--ease-out);
    letter-spacing: 0.02em;
}

.bottom-nav-item svg {
    width: 22px;
    height: 22px;
    transition: transform 0.2s var(--ease-spring);
}

.bottom-nav-item:active svg {
    transform: scale(0.88);
}

.bottom-nav-item.active {
    color: var(--accent-light);
}

.bottom-nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--accent-light);
    border-radius: 2px 2px 0 0;
    box-shadow: 0 0 8px var(--accent-glow);
}

/* ============================================================
   Diagnosis Step Progress Indicator
   ============================================================ */

.diag-progress-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 24px;
    padding: 16px 0 8px;
}

.diag-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    opacity: 0.35;
    transition: opacity 0.4s var(--ease-out);
}

.diag-step.active {
    opacity: 1;
}

.diag-step.done {
    opacity: 0.6;
}

.diag-step-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s var(--ease-out);
}

.diag-step.active .diag-step-icon {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 0 16px var(--accent-glow);
    animation: stepPulse 1.8s ease-in-out infinite;
}

.diag-step.done .diag-step-icon {
    background: rgba(74, 222, 128, 0.12);
    border-color: rgba(74, 222, 128, 0.35);
}

.diag-step-icon svg {
    width: 18px;
    height: 18px;
    color: var(--accent-light);
}

.diag-step.done .diag-step-icon svg {
    color: #4ade80;
}

.diag-step-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-3);
    text-align: center;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.diag-step.active .diag-step-label {
    color: var(--accent-light);
}

.diag-step.done .diag-step-label {
    color: #4ade80;
}

.diag-step-connector {
    flex: 1 1 auto;
    height: 1px;
    min-width: 20px;
    max-width: 60px;
    background: linear-gradient(90deg, var(--glass-border), var(--glass-border));
    margin: 0 8px;
    margin-bottom: 24px;
}

@keyframes stepPulse {
    0%, 100% { box-shadow: 0 0 10px var(--accent-glow); }
    50% { box-shadow: 0 0 24px rgba(139, 92, 246, 0.5); }
}

.skel-hero-img {
    height: 160px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0.04) 25%,
        rgba(255,255,255,0.1) 50%,
        rgba(255,255,255,0.04) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
}

.skel-badges-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.skel-badge-lg {
    height: 28px;
    width: 100px;
    border-radius: var(--radius-pill);
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0.04) 25%,
        rgba(255,255,255,0.1) 50%,
        rgba(255,255,255,0.04) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
}

.skel-section-block {
    height: 60px;
    width: 100%;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0.04) 25%,
        rgba(255,255,255,0.1) 50%,
        rgba(255,255,255,0.04) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
}

/* ============================================================
   Severity Badges
   ============================================================ */

.badge-severity-critical {
    background: var(--severity-critical-bg);
    color: var(--severity-critical);
    border: 1px solid var(--severity-critical-border);
}

.badge-severity-warning {
    background: var(--severity-warning-bg);
    color: var(--severity-warning);
    border: 1px solid var(--severity-warning-border);
}

.badge-severity-minor {
    background: var(--severity-minor-bg);
    color: var(--severity-minor);
    border: 1px solid var(--severity-minor-border);
}

/* ============================================================
   Coins Badge: Low Balance Warning
   ============================================================ */

.coins-badge.low-balance {
    animation: lowBalancePulse 2s ease-in-out infinite;
}

@keyframes lowBalancePulse {
    0%, 100% { box-shadow: 0 2px 12px rgba(245, 158, 11, 0.45), inset 0 1px 0 rgba(255,255,255,0.3); }
    50% { box-shadow: 0 2px 20px rgba(245, 158, 11, 0.75), 0 0 0 3px rgba(245, 158, 11, 0.2), inset 0 1px 0 rgba(255,255,255,0.3); }
}

.coins-badge-diagnoses {
    font-size: 10px;
    font-weight: 600;
    opacity: 0.75;
    letter-spacing: 0.02em;
}

/* ============================================================
   Save to Garage Banner
   ============================================================ */

.save-to-garage-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
    border-radius: var(--radius-md);
    background: rgba(74, 222, 128, 0.08);
    border: 1px solid rgba(74, 222, 128, 0.25);
    color: #4ade80;
    font-size: 0.9rem;
    animation: slideUp 0.4s var(--ease-out) both;
}

.save-to-garage-banner svg {
    flex-shrink: 0;
    color: #4ade80;
}

.save-to-garage-link {
    margin-left: auto;
    background: none;
    border: none;
    color: #4ade80;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    padding: 0;
    font-family: inherit;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.save-to-garage-link:hover {
    opacity: 0.8;
}

/* ============================================================
   Car Detail: Diagnose Button
   ============================================================ */

.car-detail-actions {
    padding: 0 16px 16px;
}

.car-detail-diagnose-btn {
    width: 100%;
}

/* ============================================================
   History Drawer: Search
   ============================================================ */

.drawer-search-wrap {
    position: relative;
    padding: 10px 16px;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.drawer-search-icon {
    position: absolute;
    left: 28px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-3);
    pointer-events: none;
}

.drawer-search-input {
    width: 100%;
    padding: 9px 12px 9px 36px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-1);
    font-size: 0.88rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.drawer-search-input::placeholder {
    color: var(--text-3);
}

.drawer-search-input:focus {
    border-color: var(--glass-border-focus);
    box-shadow: 0 0 12px var(--accent-glow);
}

/* ============================================================
   Empty States (Illustrated)
   ============================================================ */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    gap: 12px;
}

.empty-state-illustration {
    width: 200px;
    height: 140px;
    margin-bottom: 8px;
}

.empty-state-illustration-sm {
    width: 120px;
    height: 80px;
    margin-bottom: 4px;
}

.empty-state-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-1);
    margin: 0;
}

.empty-state-title-sm {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-2);
}

.empty-state-sub {
    font-size: 0.85rem;
    color: var(--text-3);
    line-height: 1.5;
    max-width: 260px;
    margin: 0;
}

.empty-state-cta {
    width: auto;
    min-width: 180px;
    margin-top: 8px;
}

/* ============================================================
   Onboarding Tour
   ============================================================ */

.onboarding-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(7, 11, 26, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 24px;
    padding-bottom: calc(24px + var(--safe-bottom));
}

@media (min-width: 480px) {
    .onboarding-overlay {
        align-items: center;
    }
}

.onboarding-card {
    width: 100%;
    max-width: 380px;
    border-radius: var(--radius-lg);
    padding: 28px 24px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
    animation: slideUp 0.4s var(--ease-out) both;
}

.onboarding-step-dots {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
}

.onboarding-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--glass-border);
    transition: background 0.3s, transform 0.3s;
}

.onboarding-dot.active {
    background: var(--accent-light);
    transform: scale(1.25);
}

.onboarding-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.onboarding-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-1);
    margin: 0;
}

.onboarding-body {
    font-size: 0.92rem;
    color: var(--text-2);
    line-height: 1.6;
    margin: 0;
    max-width: 300px;
}

.onboarding-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-top: 4px;
}

.onboarding-next-btn {
    width: 100%;
}

.onboarding-skip-btn {
    background: none;
    border: none;
    color: var(--text-3);
    font-size: 0.82rem;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.2s;
    font-family: inherit;
}

.onboarding-skip-btn:hover {
    color: var(--text-2);
}

/* ============================================================
   Coins Counter Animation
   ============================================================ */

@keyframes coinFlip {
    0% { transform: scale(1); }
    30% { transform: scale(1.15) rotate(-5deg); }
    60% { transform: scale(0.95) rotate(3deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.coins-badge.coin-updated {
    animation: coinFlip 0.5s var(--ease-spring);
}

/* ============================================================
   Roadmap Step Cards
   ============================================================ */

.roadmap-step-card {
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.18);
    margin-bottom: 14px;
    overflow: hidden;
    transition: border-color 0.2s var(--ease-out);
}

.roadmap-step-card:hover {
    border-color: rgba(139, 92, 246, 0.3);
}

.roadmap-step-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 18px 12px;
    background: rgba(139, 92, 246, 0.06);
    border-bottom: 1px solid var(--glass-border);
}

.roadmap-step-num {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-light);
}

.roadmap-step-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-1);
    margin: 0;
    line-height: 1.3;
}

.roadmap-step-body {
    padding: 14px 18px;
    font-size: 0.95rem;
}

.roadmap-step-body > *:last-child {
    margin-bottom: 0;
}

/* ============================================================
   Contextual Chat Suggestions (in welcome panel)
   ============================================================ */

.chat-diag-suggestions {
    padding: 12px 16px 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chat-diag-suggestions-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 2px;
}

@media print {
    @page {
        size: A4;
        margin: 0;
    }

    body {
        background: #ffffff;
    }

    body > *:not(.pdf-report-modal-overlay) {
        display: none !important;
    }

    .pdf-report-modal-overlay {
        position: static;
        display: block !important;
        opacity: 1 !important;
        padding: 0;
        background: #ffffff;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .pdf-report-modal {
        height: auto;
        background: #ffffff;
    }

    .pdf-report-modal-header,
    .pdf-report-page-meta {
        display: none !important;
    }

    .pdf-report-modal-body {
        overflow: visible;
        padding: 0;
    }

    .pdf-report-preview {
        gap: 0;
    }

    .pdf-report-page {
        width: 210mm;
        min-width: 210mm;
        max-width: 210mm;
        height: 297mm;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
        break-after: page;
        page-break-after: always;
    }

    .pdf-report-page:last-child {
        break-after: auto;
        page-break-after: auto;
    }
}

/* =============================================
   Dropdown Language Section (inside user-dropdown)
   ============================================= */
.dropdown-lang-section {
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    margin-bottom: 4px;
}

.dropdown-lang-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 14px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-1, rgba(255,255,255,0.8));
    font-size: 0.875rem;
    transition: background 0.15s;
    text-align: left;
}

.dropdown-lang-trigger:hover {
    background: rgba(255, 255, 255, 0.05);
}

.dropdown-lang-globe {
    opacity: 0.5;
    flex-shrink: 0;
}

.dropdown-lang-current-flag {
    font-size: 1rem;
    line-height: 1;
}

.dropdown-lang-current-name {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-1, rgba(255,255,255,0.8));
}

.dropdown-lang-chevron {
    opacity: 0.4;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.dropdown-lang-trigger.open .dropdown-lang-chevron {
    transform: rotate(180deg);
}

.dropdown-lang-list {
    overflow: hidden;
    background: rgba(0, 0, 0, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dropdown-lang-opt {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-2, rgba(255,255,255,0.6));
    font-size: 0.84rem;
    transition: background 0.12s, color 0.12s;
    text-align: left;
}

.dropdown-lang-opt:hover {
    background: rgba(139, 92, 246, 0.1);
    color: var(--text-1, rgba(255,255,255,0.9));
}

.dropdown-lang-opt.active {
    color: var(--accent, #a78bfa);
    font-weight: 600;
}

.dlo-flag {
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
}

.dlo-name {
    flex: 1;
}

.dlo-check {
    opacity: 0.7;
    color: var(--accent, #a78bfa);
    flex-shrink: 0;
}

/* =============================================
   UI Language Switcher
   ============================================= */
.lang-ui-switcher-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.ui-lang-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-2);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.ui-lang-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.18);
}

.ui-lang-flag {
    font-size: 1rem;
    line-height: 1;
}

.ui-lang-code {
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    color: var(--text-1);
}

.ui-lang-chevron {
    width: 12px;
    height: 12px;
    opacity: 0.6;
    transition: transform 0.2s;
}

.ui-lang-btn[aria-expanded="true"] .ui-lang-chevron {
    transform: rotate(180deg);
}

.ui-lang-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 1000;
    min-width: 150px;
    background: var(--glass-bg, rgba(15, 20, 45, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.ui-lang-menu.hidden {
    display: none;
}

.ui-lang-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-2);
    font-size: 0.82rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, color 0.15s;
    width: 100%;
}

.ui-lang-option:hover {
    background: rgba(139, 92, 246, 0.15);
    color: var(--text-1);
}

.ui-lang-option.active {
    background: rgba(139, 92, 246, 0.2);
    color: var(--accent, #a78bfa);
    font-weight: 600;
}

/* =============================================
   RTL Support (Arabic)
   ============================================= */
[dir="rtl"] .topbar {
    flex-direction: row-reverse;
}

[dir="rtl"] .topbar-auth {
    flex-direction: row-reverse;
}

[dir="rtl"] .top-nav-items {
    flex-direction: row-reverse;
}

[dir="rtl"] .form-grid {
    direction: rtl;
}

[dir="rtl"] .input-icon {
    left: auto;
    right: 12px;
}

[dir="rtl"] .input-wrap input,
[dir="rtl"] .input-wrap textarea {
    padding-left: 14px;
    padding-right: 42px;
    text-align: right;
}

[dir="rtl"] .drawer {
    left: 0;
    right: auto;
    transform: translateX(-100%);
}

[dir="rtl"] .drawer.open {
    transform: translateX(0);
}

[dir="rtl"] .global-chat-panel {
    left: 0;
    right: auto;
}

[dir="rtl"] .user-dropdown {
    left: 0;
    right: auto;
}

[dir="rtl"] .ui-lang-menu {
    right: auto;
    left: 0;
}

[dir="rtl"] .lang-dropdown-wrap .lang-dropdown-menu {
    right: auto;
    left: 0;
}

[dir="rtl"] .modal-card,
[dir="rtl"] .paywall-modal,
[dir="rtl"] .profile-modal {
    text-align: right;
    direction: rtl;
}

[dir="rtl"] .pw-features {
    direction: rtl;
}

[dir="rtl"] .pw-feature {
    flex-direction: row-reverse;
}

[dir="rtl"] .profile-info-row {
    flex-direction: row-reverse;
}

[dir="rtl"] .profile-hero-actions {
    flex-direction: row-reverse;
}

[dir="rtl"] .coins-coupon-row {
    flex-direction: row-reverse;
}

[dir="rtl"] .result-top-controls {
    flex-direction: row-reverse;
}

[dir="rtl"] .result-header-block {
    flex-direction: row-reverse;
}

[dir="rtl"] .badge-group {
    flex-direction: row-reverse;
}

[dir="rtl"] .site-footer-links {
    flex-direction: row-reverse;
    justify-content: flex-end;
}

[dir="rtl"] .site-footer-meta {
    align-items: flex-end;
}

[dir="rtl"] .site-footer-brand {
    flex-direction: row-reverse;
}

[dir="rtl"] .site-footer-sub {
    padding-left: 0;
    padding-right: 30px;
}

[dir="rtl"] .site-footer-right {
    align-items: flex-start;
}

[dir="rtl"] .bottom-nav {
    flex-direction: row-reverse;
}

[dir="rtl"] .chat-panel-input-area {
    flex-direction: row-reverse;
}

@media (max-width: 640px) {
    .ui-lang-code {
        display: none;
    }
    .ui-lang-btn {
        padding: 5px 6px;
    }
}
