:root {
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --secondary: #06b6d4;
    --bg-color: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.7);
    --text-main: #1e293b;
    --text-muted: #64748b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #f3e8ff 0%, #e0f2fe 100%);
    min-height: 100vh;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
}

.navbar {
    padding: 1.5rem 4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hero-subtitle {
    max-width: 680px;
    margin: 1rem auto 0;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.6;
}

.logo {
    font-size: 1.7rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--primary);
}

.login-btn {
    background: rgba(139, 92, 246, 0.1);
    color: var(--primary) !important;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
}

.login-btn:hover {
    background: rgba(139, 92, 246, 0.2);
}

.container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    margin-bottom: 5rem;
}

.hero {
    text-align: center;
    margin-bottom: 1rem;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.6;
}

.upload-card,
.processing-card,
.result-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 24px;
    padding: 2.5rem 2rem;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.upload-card.dragover {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.95);
    transform: scale(1.02);
    box-shadow: 0 20px 40px rgba(139, 92, 246, 0.15);
}

.upload-card input[type="file"] {
    display: none;
}

.upload-icon {
    font-size: 3.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

.upload-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.upload-card p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.browse-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(139, 92, 246, 0.3);
    transition: all 0.3s ease;
}

.browse-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(139, 92, 246, 0.4);
}

.supported-formats {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.supported-formats span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.5);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.hidden {
    display: none !important;
}

.ai-sparkle {
    font-size: 3.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
    animation: pulse 1.5s infinite;
}

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

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

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

/* Loading Phase Tips */
.tips-container {
    margin: 0 auto 1.5rem;
    max-width: 700px;
    padding: 2rem 2.5rem;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 24px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
}

.tips-intro {
    font-size: 0.9rem;
    color: var(--primary);
    margin-bottom: 0;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 800;
}

.tip-spacer {
    height: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px dashed #cbd5e1;
}

#study-tip {
    font-size: 1.25rem;
    color: #1e293b;
    margin: 0;
    line-height: 1.6;
    font-weight: 500;
    transition: opacity 0.5s ease;
    min-height: 4.5rem;
}

.progress-bar-container {
    width: 100%;
    height: 14px;
    background: #e2e8f0;
    border-radius: 10px;
    margin: 2rem 0;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.result-card {
    padding: 2.5rem;
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.success-icon {
    color: #10b981;
}

.summary-box {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 2rem;
    text-align: left;
    height: 350px;
    overflow-y: auto;
    font-size: 1rem;
    line-height: 1.7;
    color: #334155;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.02);
    margin-bottom: 2rem;
}

.summary-box h4 {
    color: var(--primary);
    margin-bottom: 1rem;
    margin-top: 2.5rem;
    font-size: 1.25rem;
}

.summary-box h4:first-child {
    margin-top: 0;
}

.summary-box ul {
    margin-left: 1.5rem;
    margin-bottom: 2rem;
}

.summary-box p {
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

.summary-box li {
    margin-bottom: 1rem;
    padding-left: 0.5rem;
}

/* Colored Text Classes for AI Generation */
.yellow-highlight {
    display: inline-block !important;
    background-color: #fef08a !important;
    color: #854d0e !important;
    padding: 0.1em 0.3em !important;
    border-radius: 4px !important;
    font-weight: 700 !important;
}

.green-highlight {
    display: inline-block !important;
    background-color: #bbf7d0 !important;
    color: #166534 !important;
    padding: 0.1em 0.3em !important;
    border-radius: 4px !important;
    font-weight: 700 !important;
}

.pink-highlight {
    display: inline-block !important;
    background-color: #fbcfe8 !important;
    color: #831843 !important;
    padding: 0.1em 0.3em !important;
    border-radius: 4px !important;
    font-weight: 700 !important;
}

.red-highlight {
    display: inline-block !important;
    background-color: #fecaca !important;
    color: #991b1b !important;
    padding: 0.1em 0.3em !important;
    border-radius: 4px !important;
    font-weight: 700 !important;
}

.highlight-text {
    color: var(--primary);
    font-weight: 700;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.action-buttons button {
    border: none;
    padding: 0.8rem 1.8rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.copy-btn {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1 !important;
}

.copy-btn:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
}

.download-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.3);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.4);
}

.preview-paywall {
    margin-top: -1rem;
    padding: 1.5rem;
    text-align: center;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), #f5f3ff);
    border: 2px solid #8b5cf6;
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(109, 40, 217, 0.16);
}

.preview-paywall > i {
    color: #7c3aed;
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.preview-paywall p {
    color: #64748b;
    max-width: 580px;
    margin: 0.5rem auto 1rem;
}

.footer-links {
    margin-top: 0.75rem;
}

.footer-links a {
    color: inherit;
    font-weight: 700;
}

.terms-content {
    max-width: 680px;
    max-height: 85vh;
    overflow-y: auto;
}

.terms-body {
    text-align: left;
    color: #334155;
    line-height: 1.6;
}

.terms-body h3 {
    color: #0f172a;
    margin: 1.1rem 0 0.25rem;
}

.reset-btn {
    background: white;
    color: var(--text-main);
    border: 1px solid #e2e8f0 !important;
}

.reset-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1 !important;
    transform: translateY(-2px);
}

/* Quiz Styles */
.quiz-list {
    margin-left: 0 !important;
    list-style-type: none !important;
}

.quiz-list>li {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e2e8f0;
    page-break-inside: avoid;
    break-inside: avoid;
}

.quiz-list>li>p:first-child {
    font-size: 1.1rem;
    color: #1e293b;
    margin-bottom: 1rem;
}

.quiz-list ul {
    margin-left: 1rem !important;
    margin-bottom: 1.5rem !important;
    list-style-type: disc !important;
    color: #475569;
}

.show-answer-btn {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #cbd5e1;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 1rem;
}

.show-answer-btn:hover {
    background: #e2e8f0;
    color: #475569;
}

.show-answer-btn.active {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.hidden-answer {
    margin-top: 1rem;
    padding: 1rem;
    background: #ecfdf5;
    border-left: 4px solid #10b981;
    border-radius: 0 8px 8px 0;
}

/* Detail Slider Setting Styles */
.settings-container {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(241, 245, 249, 0.7);
    border: 1px dashed rgba(100, 116, 139, 0.4);
    border-radius: 12px;
    text-align: left;
}

.settings-container label {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1.5rem;
    text-align: center;
}

.slider-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    font-size: 0.95rem;
    color: #475569;
    font-weight: 700;
}

.custom-slider {
    flex-grow: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 10px;
    background: linear-gradient(90deg, #e2e8f0 0%, #cbd5e1 100%);
    border-radius: 5px;
    outline: none;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: background 0.3s;
}

.custom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.5);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    background: var(--secondary);
}

/* Footer Disclaimer */
.site-footer {
    text-align: center;
    padding: 1.5rem;
    margin-top: auto;
    font-size: 0.85rem;
    color: #64748b;
    background: transparent;
}

.site-footer i {
    color: #f59e0b;
}

/* Success Graph Section */
.success-graph-section {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto 0.5rem;
    padding: 0;
    text-align: center;
}

.journey-steps {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 26px minmax(0, 1fr) 26px minmax(0, 1fr);
    gap: 0.6rem;
    align-items: center;
}

.journey-card {
    min-width: 0;
    height: 263px;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(139, 92, 246, 0.12);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(53, 40, 92, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.journey-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 32px rgba(53, 40, 92, 0.14);
}

.journey-card-passed {
    border-color: rgba(22, 163, 74, 0.28);
}

.journey-visual {
    position: relative;
    height: 172px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.journey-visual-notes {
    background: radial-gradient(circle at 50% 85%, #fff 0%, #f2ecff 75%, #ece6ff 100%);
}

.journey-visual-guide {
    background: linear-gradient(160deg, #edf8ff 0%, #f0f2ff 100%);
}

.journey-visual-passed {
    background: radial-gradient(circle at 50% 85%, #fff 0%, #effbf4 75%, #e7f8ef 100%);
}

.journey-visual img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    padding: 0.25rem;
}

.journey-visual-notes img {
    transform: scale(1.46);
}

.guide-document {
    position: absolute;
    top: 10px;
    left: 50%;
    width: 212px;
    min-height: 260px;
    padding: 12px 15px 16px;
    transform: translateX(-50%);
    border: 1px solid #e1e6ee;
    border-radius: 3px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(54, 75, 110, 0.15);
    color: #243047;
    text-align: left;
}

.guide-document-meta {
    display: flex;
    justify-content: space-between;
    gap: 5px;
    padding-bottom: 5px;
    border-bottom: 1px solid #e6eaf0;
    color: #64748b;
    font-size: 6px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.guide-document h4 {
    margin: 9px 0 3px;
    color: #182437;
    font-size: 13px;
    line-height: 1.1;
    letter-spacing: -0.025em;
}

.guide-document-intro {
    color: #506078;
    font-size: 8px;
    line-height: 1.4;
}

.guide-document-block {
    margin-top: 9px;
}

.guide-document h5 {
    margin-bottom: 4px;
    color: #6d40ac;
    font-size: 7px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.guide-document-block p,
.guide-document li,
.guide-document-check {
    font-size: 7.7px;
    line-height: 1.45;
}

.guide-document mark {
    padding: 0 1px;
    background: #fff0a8;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
    color: inherit;
    font-weight: 700;
}

.guide-document ol {
    margin: 0 0 0 13px;
    padding: 0;
}

.guide-document li {
    padding-left: 1px;
}

.guide-document-check {
    margin-top: 9px;
    padding: 5px 6px;
    border-left: 2px solid #42bea3;
    background: #effbf7;
}

.guide-document-check strong {
    display: block;
    color: #167a68;
    font-size: 6.5px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.journey-visual-passed img {
    object-position: center top;
    transform: scale(1.12) translateY(7px);
}

.journey-number {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #7656ba;
    font-size: 0.7rem;
    font-weight: 800;
    box-shadow: 0 2px 10px rgba(53, 40, 92, 0.09);
}

.journey-passed-badge {
    position: absolute;
    top: 12px;
    right: 10px;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.55rem;
    border-radius: 999px;
    background: #dcfce7;
    border: 1px solid #86efac;
    color: #166534;
    font-size: 0.78rem;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.12);
}

.journey-copy {
    padding: 0.75rem 0.75rem 0.85rem;
}

.journey-copy h3 {
    margin-bottom: 0.35rem;
    font-size: 1.05rem;
    line-height: 1.18;
    font-weight: 800;
    color: #1e293b;
}

.journey-copy p {
    margin: 0;
    color: #64748b;
    font-size: 0.79rem;
    line-height: 1.35;
    white-space: nowrap;
}

.journey-arrow {
    color: #8b5cf6;
    font-size: 1.1rem;
    display: grid;
    place-items: center;
}

/* Preserve a compact, legible sequence on smaller screens. */
@media (max-width: 768px) {
    .journey-steps {
        max-width: 540px;
        margin: 0 auto;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .journey-card {
        display: grid;
        grid-template-columns: 132px minmax(0, 1fr);
        align-items: center;
        height: 142px;
        width: 100%;
        text-align: left;
    }

    .journey-visual {
        height: 142px;
    }

    .journey-visual-notes img {
        transform: scale(1.28);
    }

    .guide-document {
        width: 115px;
        min-height: 160px;
        padding: 7px 8px;
    }

    .guide-document-meta {
        font-size: 3.5px;
        padding-bottom: 3px;
    }

    .guide-document h4 {
        margin: 5px 0 2px;
        font-size: 7px;
    }

    .guide-document-intro,
    .guide-document-block p,
    .guide-document li,
    .guide-document-check {
        font-size: 4.5px;
    }

    .guide-document-block {
        margin-top: 5px;
    }

    .guide-document h5 {
        margin-bottom: 2px;
        font-size: 4px;
    }

    .guide-document ol {
        margin-left: 8px;
    }

    .journey-copy {
        padding: 0.75rem 1rem;
    }

    .journey-arrow {
        transform: rotate(90deg);
        height: 14px;
    }
}

/* PDF Printing Utilities */
.pdf-page-break-before {
    page-break-before: always !important;
    break-before: page !important;
}

.pdf-page-break-after {
    page-break-after: always !important;
    break-after: page !important;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    display: none !important;
}

.modal-content {
    background: white;
    padding: 3rem 2.5rem;
    border-radius: 24px;
    width: 90%;
    max-width: 450px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pricing-content {
    max-width: 760px;
}

.auth-content {
    max-width: 500px;
    padding: 0.75rem;
    overflow: visible;
    isolation: isolate;
}

#close-signup {
    top: -0.75rem;
    right: -0.75rem;
    z-index: 10000;
    border: 2px solid #ffffff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.2);
}

#clerk-auth-container {
    display: flex;
    width: 100%;
    justify-content: center;
}

#clerk-auth-container .cl-rootBox {
    width: 100%;
}

#clerk-auth-container .cl-formButtonPrimary[data-password-invalid="true"],
#clerk-auth-container .cl-formButtonPrimary:disabled {
    opacity: 0.45 !important;
    cursor: not-allowed !important;
    pointer-events: none;
    filter: saturate(0.45);
    transform: none !important;
}

#clerk-auth-container .cl-formField:has(.cl-formFieldInput[type="password"]:placeholder-shown)
    .cl-formFieldSuccessText {
    display: none !important;
}

.password-policy-message {
    margin: 0.4rem 0 0;
    color: #64748b;
    font-size: 0.78rem;
    line-height: 1.4;
}

.password-policy-message.is-error {
    color: #b91c1c;
    font-weight: 600;
}

.password-policy-message.is-valid {
    color: #15803d;
}

#clerk-auth-container .cl-socialButtonsBlockButton {
    color: #0f172a !important;
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
}

#clerk-auth-container .cl-socialButtonsBlockButtonText {
    color: #0f172a !important;
    opacity: 1 !important;
}

.dashboard-content {
    max-width: 920px;
    max-height: 88vh;
    overflow-y: auto;
    text-align: left;
}

.dashboard-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-right: 3rem;
    margin-bottom: 1.5rem;
}

.dashboard-eyebrow {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.dashboard-header h2 {
    color: #0f172a;
    font-size: 2rem;
    line-height: 1.2;
}

.dashboard-header p {
    margin-top: 0.35rem;
    color: var(--text-muted);
}

.subscription-badge {
    flex-shrink: 0;
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    background: #ede9fe;
    color: #6d28d9;
    font-size: 0.8rem;
    font-weight: 800;
}

.subscription-badge.pro {
    background: #dcfce7;
    color: #047857;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.85rem;
}

.dashboard-stat {
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
}

.dashboard-stat span {
    display: block;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.dashboard-stat strong {
    display: block;
    margin-top: 0.3rem;
    color: #0f172a;
    font-size: 1.3rem;
}

.dashboard-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0 1.5rem;
}

.dashboard-actions button {
    width: auto;
    margin: 0;
}

.dashboard-signout-btn {
    padding: 0.7rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: white;
    color: #475569;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.dashboard-columns {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 1rem;
}

.dashboard-section {
    min-width: 0;
    padding: 1.1rem;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
}

.dashboard-section-heading {
    margin-bottom: 0.85rem;
}

.dashboard-section-heading h3 {
    color: #0f172a;
    font-size: 1rem;
}

.dashboard-section-heading p,
.dashboard-empty {
    margin-top: 0.2rem;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.dashboard-list {
    display: flex;
    max-height: 280px;
    flex-direction: column;
    gap: 0.6rem;
    overflow-y: auto;
}

.dashboard-list-item {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.8rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    color: #0f172a;
    text-align: left;
}

button.dashboard-list-item {
    font: inherit;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s;
}

button.dashboard-list-item:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}

.dashboard-item-copy {
    min-width: 0;
}

.dashboard-item-copy strong,
.dashboard-item-copy span {
    display: block;
}

.dashboard-item-copy strong {
    overflow: hidden;
    font-size: 0.88rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-item-copy span {
    margin-top: 0.25rem;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.dashboard-list-item i {
    flex-shrink: 0;
    color: var(--primary);
}

.analytics-section {
    margin-top: 1rem;
}

.analytics-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.75rem;
}

.analytics-breakdowns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.9rem;
    margin-top: 1rem;
}

.analytics-breakdowns > div {
    min-width: 0;
    padding: 0.9rem;
    border-radius: 12px;
    background: #f8fafc;
}

.analytics-breakdowns h4 {
    margin-bottom: 0.55rem;
    color: #0f172a;
    font-size: 0.82rem;
}

.analytics-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    color: #64748b;
    font-size: 0.76rem;
}

.analytics-list-row {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.analytics-list-row span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.analytics-retention {
    margin-top: 0.85rem;
    color: #64748b;
    font-size: 0.72rem;
}

.refund-section {
    margin-top: 1rem;
}

.refund-status-card {
    padding: 0.9rem;
    border-radius: 12px;
    background: #f8fafc;
}

.refund-status-card strong,
.refund-status-card p {
    display: block;
}

.refund-status-card strong {
    margin-top: 0.6rem;
    color: #0f172a;
}

.refund-status-card p,
.refund-form-footer p {
    margin-top: 0.3rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.refund-status {
    display: inline-block;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.72rem;
    font-weight: 800;
}

.refund-status-approved {
    background: #dcfce7;
    color: #047857;
}

.refund-status-cancellation_pending {
    background: #dbeafe;
    color: #1d4ed8;
}

.refund-status-refund_failed,
.refund-status-rejected {
    background: #fee2e2;
    color: #b91c1c;
}

.refund-form label {
    color: #334155;
    font-size: 0.85rem;
    font-weight: 700;
}

.refund-form label span {
    color: var(--text-muted);
    font-weight: 500;
}

.refund-form textarea {
    width: 100%;
    margin-top: 0.45rem;
    padding: 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    color: #0f172a;
    font: inherit;
    resize: vertical;
}

.refund-form textarea:focus {
    border-color: var(--primary);
    outline: 2px solid rgba(124, 58, 237, 0.14);
}

.refund-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.75rem;
}

.refund-form-footer .auth-btn {
    width: auto;
    flex-shrink: 0;
}

.pricing-plans {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.pricing-plan {
    position: relative;
    display: flex;
    min-height: 155px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 1.25rem 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    background: #fff;
    color: #0f172a;
    cursor: pointer;
    transition: 0.2s ease;
}

.pricing-plan:hover,
.pricing-plan.selected {
    border-color: var(--primary);
    background: #faf8ff;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(124, 58, 237, 0.12);
}

.savings-badge {
    position: absolute;
    top: -11px;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    background: #10b981;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
}

.plan-name {
    font-size: 0.9rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.plan-price {
    color: var(--primary);
    font-size: 2rem;
    font-weight: 800;
}

.plan-period,
.plan-comparison {
    color: #64748b;
    font-size: 0.78rem;
}

.plan-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.55rem 1rem;
    margin: 0 0 1.25rem;
    padding: 1rem;
    border-radius: 14px;
    background: #f8fafc;
    color: #334155;
    text-align: left;
    list-style: none;
    font-size: 0.88rem;
}

.plan-features i {
    margin-right: 0.35rem;
    color: #10b981;
}

.refund-guarantee {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: -0.25rem 0 1.15rem;
    padding: 0.85rem 1rem;
    border: 1px solid #a7f3d0;
    border-radius: 14px;
    background: #ecfdf5;
    color: #065f46;
    text-align: left;
}

.refund-guarantee > i {
    flex-shrink: 0;
    color: #10b981;
    font-size: 1.4rem;
}

.refund-guarantee strong,
.refund-guarantee span {
    display: block;
}

.refund-guarantee strong {
    margin-bottom: 0.15rem;
    font-size: 0.88rem;
}

.refund-guarantee span {
    color: #047857;
    font-size: 0.78rem;
    line-height: 1.4;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem 1rem;
}

.privacy-content {
    max-width: 760px;
}

.terms-body ul {
    margin: 0.65rem 0 1rem 1.25rem;
}

.terms-body li {
    margin-bottom: 0.45rem;
}

.terms-body a {
    color: var(--primary-hover);
    font-weight: 700;
}

.cookie-banner {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
    z-index: 10001;
    display: flex;
    max-width: 980px;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    margin: 0 auto;
    padding: 1rem 1.15rem;
    border: 1px solid #ddd6fe;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
    backdrop-filter: blur(16px);
}

.cookie-banner.hidden,
.privacy-signal-note.hidden {
    display: none !important;
}

.cookie-copy {
    max-width: 610px;
}

.cookie-copy strong {
    color: #0f172a;
    font-size: 1rem;
}

.cookie-copy p {
    margin-top: 0.3rem;
    color: #475569;
    font-size: 0.8rem;
    line-height: 1.45;
}

.privacy-signal-note {
    display: block;
    margin-top: 0.45rem;
    color: #047857;
    font-size: 0.75rem;
    font-weight: 700;
}

.cookie-actions {
    display: grid;
    flex: 0 0 310px;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.cookie-btn,
.cookie-link {
    min-height: 42px;
    border-radius: 10px;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
}

.cookie-btn {
    border: 2px solid var(--primary);
}

.cookie-reject,
.cookie-accept {
    background: var(--primary);
    color: #fff;
}

.cookie-accept:disabled {
    border-color: #94a3b8;
    background: #94a3b8;
    cursor: not-allowed;
}

.cookie-link {
    grid-column: 1 / -1;
    border: 0;
    background: transparent;
    color: #475569;
    text-decoration: underline;
}

@media (max-width: 650px) {
    .pricing-plans,
    .plan-features {
        grid-template-columns: 1fr;
    }
}

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

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

.close-modal {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: #f1f5f9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #64748b;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-modal:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: rotate(90deg);
}

.modal-header h2 {
    font-size: 1.8rem;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.modal-header p {
    color: #64748b;
    font-size: 0.95rem;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.signup-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.auth-status {
    min-height: 220px;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: #64748b;
    text-align: center;
}

.auth-status strong {
    color: #0f172a;
    font-size: 1.05rem;
}

.auth-status-error i {
    color: #ef4444;
    font-size: 1.6rem;
}

.auth-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid #e2e8f0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: auth-spin 0.8s linear infinite;
}

@keyframes auth-spin {
    to {
        transform: rotate(360deg);
    }
}

.input-group {
    text-align: left;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-group input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
    box-sizing: border-box;
}

.input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.auth-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(139, 92, 246, 0.2);
    width: 100%;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px rgba(139, 92, 246, 0.3);
}

.billing-link {
    width: 100%;
    margin-top: 0.8rem;
    padding: 0.8rem;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #fff;
    color: #475569;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}

.billing-link:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.modal-footer {
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: #94a3b8;
}

/* Password field with eye-toggle */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    padding-right: 3rem !important;
}

.eye-toggle {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    font-size: 1rem;
    padding: 0;
    line-height: 1;
    transition: color 0.2s ease;
}

.eye-toggle:hover {
    color: var(--primary);
}

/* -------------------------------------------
   Mobile Responsive Adjustments
------------------------------------------- */
@media (max-width: 768px) {
    /* Navbar */
    .navbar {
        padding: 0.75rem 0.75rem 0.5rem;
        flex-direction: row;
        gap: 0.5rem;
        align-items: center;
    }
    .logo {
        min-width: 0;
        font-size: 1rem;
        gap: 0.25rem;
        white-space: nowrap;
    }
    .nav-links {
        width: auto;
        margin-left: auto;
        justify-content: flex-end;
        gap: 0.65rem;
        flex-wrap: nowrap;
    }
    .nav-links a {
        font-size: 0.78rem;
        white-space: nowrap;
    }
    .login-btn {
        padding: 0.45rem 0.7rem;
    }

    /* Container & Typography */
    .container {
        padding: 0.65rem 0.75rem 2.5rem;
        margin-top: 0;
        margin-bottom: 1rem;
    }
    .hero {
        margin-bottom: 0.75rem;
    }
    .hero h1 {
        font-size: clamp(1.65rem, 7.5vw, 2rem);
        line-height: 1.08;
        letter-spacing: -0.03em;
    }
    #main-desc {
        font-size: 0.95rem;
        padding: 0 1rem;
    }

    /* Cards */
    .upload-card, 
    .processing-card, 
    .result-card,
    .tips-container {
        padding: 1.25rem 0.9rem;
        border-radius: 18px;
    }

    /* Keep the illustrated steps compact so the upload remains easy to find. */
    .success-graph-section {
        margin-bottom: 0.85rem;
    }
    .journey-steps {
        gap: 0.35rem;
    }
    .journey-card {
        grid-template-columns: 106px minmax(0, 1fr);
        height: 116px;
        border-radius: 17px;
    }
    .journey-visual {
        height: 116px;
    }
    .journey-visual-notes img {
        transform: scale(1.22);
    }
    .guide-document {
        width: 92px;
        top: 8px;
        padding: 6px;
    }
    .guide-document h4 {
        font-size: 6px;
    }
    .guide-document-intro,
    .guide-document-block p,
    .guide-document li,
    .guide-document-check {
        font-size: 3.8px;
    }
    .journey-number {
        top: 6px;
        left: 6px;
        width: 23px;
        height: 23px;
        font-size: 0.62rem;
    }
    .journey-passed-badge {
        top: 6px;
        right: 5px;
        padding: 0.25rem 0.36rem;
        gap: 0.18rem;
        font-size: 0.61rem;
    }
    .journey-copy {
        padding: 0.5rem 0.75rem;
    }
    .journey-copy h3 {
        font-size: 0.98rem;
    }
    .journey-copy p {
        font-size: 0.75rem;
    }

    /* File Upload Area */
    .supported-formats {
        flex-wrap: wrap;
        gap: 0.75rem;
        margin-top: 1.25rem;
    }
    .supported-formats span {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }

    /* Slider Settings */
    .slider-wrapper {
        flex-direction: row;
        gap: 0.5rem;
    }
    .slider-wrapper span {
        font-size: 0.8rem;
    }
    .custom-slider {
        width: 100%;
    }

    /* Action Buttons */
    .action-buttons {
        flex-direction: column;
        gap: 1rem;
    }
    .action-buttons button {
        width: 100%;
        margin-left: 0;
    }

    /* Summary & Quiz Output */
    .summary-box {
        padding: 1.5rem 1rem;
    }
    .show-answer-btn {
        width: 100%;
        justify-content: center;
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    .hidden-answer {
        border-radius: 8px;
        border-left: none;
        border-top: 4px solid #10b981;
    }

    /* Modal */
    .modal-content {
        width: 95%;
        padding: 2rem 1.5rem;
    }

    .dashboard-content {
        padding: 1.5rem 1rem;
    }

    .dashboard-header,
    .dashboard-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-header {
        padding-right: 2.5rem;
    }

    .dashboard-header h2 {
        font-size: 1.6rem;
    }

    .subscription-badge {
        align-self: flex-start;
    }

    .dashboard-stats,
    .dashboard-columns {
        grid-template-columns: 1fr;
    }

    .dashboard-actions button {
        width: 100%;
    }

    .refund-form-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .refund-form-footer .auth-btn {
        width: 100%;
    }
}

@media (max-width: 650px) {
    /* Pricing is a compact selector on phones, not three full-size cards. */
    .modal {
        align-items: flex-start;
        overflow-y: auto;
        padding: 0.75rem 0;
    }

    .pricing-content {
        width: calc(100% - 1rem);
        max-height: none;
        margin: auto;
        padding: 1.25rem 0.85rem 1rem;
        border-radius: 20px;
    }

    .analytics-stats,
    .analytics-breakdowns {
        grid-template-columns: 1fr 1fr;
    }

    .cookie-banner {
        align-items: stretch;
        flex-direction: column;
        gap: 0.8rem;
        padding: 0.9rem;
    }

    .cookie-actions {
        flex-basis: auto;
        width: 100%;
    }

    .pricing-content .close-modal {
        top: 0.7rem;
        right: 0.7rem;
        width: 32px;
        height: 32px;
    }

    .pricing-content .modal-header > i {
        margin-bottom: 0.35rem !important;
        font-size: 1.55rem !important;
    }

    .pricing-content .modal-header h2 {
        max-width: 310px;
        margin: 0 auto 1rem !important;
        padding: 0 0.5rem;
        font-size: 1.35rem !important;
        line-height: 1.15 !important;
        letter-spacing: -0.025em;
    }

    .pricing-plans {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.4rem;
        margin-bottom: 0.85rem;
    }

    .pricing-plan {
        min-height: 104px;
        gap: 0.12rem;
        padding: 1rem 0.25rem 0.7rem;
        border-width: 1.5px;
        border-radius: 13px;
    }

    .pricing-plan:hover,
    .pricing-plan.selected {
        transform: none;
        box-shadow: 0 6px 18px rgba(124, 58, 237, 0.1);
    }

    .savings-badge {
        top: -8px;
        max-width: calc(100% - 0.4rem);
        overflow: hidden;
        padding: 0.18rem 0.35rem;
        font-size: 0.58rem;
        line-height: 1.1;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .pricing-plan[data-plan="yearly"] .savings-badge {
        max-width: none;
        padding-inline: 0.25rem;
        font-size: 0.5rem;
    }

    .plan-name {
        font-size: 0.67rem;
        letter-spacing: 0.025em;
    }

    .plan-price {
        font-size: 1.5rem;
        line-height: 1.05;
    }

    .plan-period {
        font-size: 0.66rem;
    }

    .plan-features {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.45rem 0.65rem;
        margin-bottom: 0.85rem;
        padding: 0.75rem;
        font-size: 0.72rem;
        line-height: 1.3;
    }

    .pricing-content #upgrade-btn {
        min-height: 48px;
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }

    .pricing-content #upgrade-btn + .billing-link + p,
    .pricing-content #upgrade-btn ~ p {
        margin-top: 0.7rem !important;
        font-size: 0.68rem !important;
        line-height: 1.35;
    }
}