/* ===========================
   BASE RESET & VARIABLES
   =========================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --cream: #FDFBF7;
    --navy: #1C2539;
    --navy-hover: #2C3A5A;
    --orange: #D97736;
    --orange-dark: #B85D19;
    --orange-pale: #FFF8F4;
    --orange-light: #F3EFEA;
    --orange-shadow: rgba(217, 119, 54, 0.15);
    --orange-shadow-btn: rgba(217, 119, 54, 0.6);
    --text-muted: #4A5568;
    --text-subtle: #718096;
    --border: #E2E8F0;
    --card-bg: #ffffff;
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --radius-full: 9999px;
}

html { font-size: 16px; }

body {
    font-family: var(--font-sans);
    color: var(--navy);
    background: var(--cream);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

::selection {
    background: var(--orange);
    color: white;
}

/* ===========================
   LAYOUT CONTAINERS
   =========================== */
.nav-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 32px;
}

.container-wide {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-hero {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 24px;
    text-align: center;
}

.container-upload {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 24px;
}

.site-main {
    flex: 1;
}

/* ===========================
   NAVIGATION
   =========================== */
.site-nav {
    padding: 28px 0;
    position: relative;
    z-index: 10;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
}

.nav-logo__icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--orange);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.nav-logo__icon--sm {
    width: 24px;
    height: 24px;
}

.nav-logo__text {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: -0.3px;
}

.nav-logo__text--sm {
    font-size: 1.25rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    flex: 1;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s;
}

.nav-link:hover { color: var(--orange); }

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

/* ===========================
   BUTTONS
   =========================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s, color 0.15s;
    white-space: nowrap;
    line-height: 1;
}

.btn:active { transform: translateY(1px); }

.btn--ghost {
    background: transparent;
    color: var(--navy);
}

.btn--ghost:hover {
    background: var(--orange-light);
    color: var(--orange);
}

.btn--dark {
    background: var(--navy);
    color: white;
}

.btn--dark:hover { background: var(--navy-hover); }

.btn--pill { border-radius: var(--radius-full); padding: 10px 24px; }

.btn--orange {
    background: var(--orange);
    color: white;
    box-shadow: 0 8px 20px -8px var(--orange-shadow-btn);
}

.btn--orange:hover:not(:disabled) {
    background: var(--orange-dark);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -8px var(--orange-shadow-btn);
}

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

.btn--outline-orange {
    background: transparent;
    color: var(--orange);
    border: 1.5px solid var(--orange);
}

.btn--outline-orange:hover {
    background: var(--orange-pale);
    color: var(--orange-dark);
}

.btn--navy {
    background: var(--navy);
    color: white;
    text-decoration: none;
}

.btn--navy:hover {
    background: #2a3a5c;
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

.btn--full {
    width: 100%;
    padding: 16px 24px;
    font-size: 1rem;
    border-radius: var(--radius-md);
    margin-top: 16px;
}

.btn--sm { padding: 8px 18px; font-size: 0.85rem; }

/* ===========================
   FLASH MESSAGES
   =========================== */
.flash-messages { margin: 16px 0; }

.flash {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 8px;
    border: 1px solid transparent;
}

.flash--error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.flash--success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #16a34a;
}

.flash--info {
    background: var(--orange-light);
    border-color: #e8d5c0;
    color: var(--orange-dark);
}

/* ===========================
   HERO
   =========================== */
.hero {
    padding: 56px 0 48px;
}

.hero--dark {
    background: var(--navy);
    padding: 88px 0 80px;
}

.hero__eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--orange);
    margin-bottom: 20px;
    padding: 6px 14px;
    border: 1px solid rgba(217, 119, 54, 0.35);
    border-radius: var(--radius-full);
    background: rgba(217, 119, 54, 0.1);
}

.hero__brand {
    font-family: var(--font-serif);
    font-size: clamp(3.5rem, 9vw, 6.5rem);
    font-weight: 700;
    color: white;
    line-height: 1.0;
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.hero__sub {
    font-size: clamp(1.15rem, 2.5vw, 1.5rem);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 28px;
    line-height: 1.4;
}

.hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    background: var(--orange-light);
    color: var(--orange-dark);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 32px;
}

.hero__badge svg { flex-shrink: 0; }

.hero__title {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 6vw, 4.25rem);
    font-weight: 700;
    color: var(--navy);
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -0.5px;
}

.hero__title em {
    color: var(--orange);
    font-style: italic;
}

.hero__description {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.65);
    max-width: 660px;
    margin: 0 auto 40px;
    line-height: 1.8;
}

.btn--cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 40px;
    background: #2563EB;
    color: white;
    font-size: 1.05rem;
    font-weight: 700;
    font-family: var(--font-sans);
    border-radius: var(--radius-md);
    text-decoration: none;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 28px rgba(37, 99, 235, 0.45);
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    letter-spacing: 0.2px;
}

.btn--cta:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.55);
    color: white;
    text-decoration: none;
}

/* ===========================
   NAV — MINIMAL OVERRIDE
   =========================== */
.site-nav--minimal {
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}

.nav-container--minimal {
    justify-content: space-between;
}

.nav-buildathon-badge {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-subtle);
    background: var(--orange-light);
    padding: 5px 12px;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

/* ===========================
   HERO SPLIT LAYOUT
   =========================== */
.hero-split {
    padding: 64px 0 72px;
}

.hero-split__inner {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 32px;
    display: grid;
    grid-template-columns: 1fr 480px;
    gap: 64px;
    align-items: center;
}

.hero-split__left {
    max-width: 520px;
}

.hero-split__right {
    width: 100%;
}

.hero__brand--dark {
    color: var(--navy);
    margin-bottom: 14px;
}

.hero__sub--dark {
    color: var(--navy);
    opacity: 0.75;
    margin-bottom: 20px;
}

.hero__desc--dark {
    font-size: 0.975rem;
    color: var(--text-muted);
    line-height: 1.8;
}

.upload-card__title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 20px;
}

.upload-card--hero {
    padding: 32px;
}

/* ===========================
   FOOTER — MINIMAL OVERRIDE
   =========================== */
.site-footer--minimal {
    padding: 20px 0;
    border-top: 1px solid var(--border);
    background: transparent;
}

.site-footer--minimal .footer-copy {
    font-size: 0.825rem;
    color: var(--text-subtle);
}

/* ===========================
   UPLOAD CARD
   =========================== */
.upload-section { padding: 0 0 80px; }

.upload-card {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 48px;
    box-shadow: 0 20px 60px -15px var(--orange-shadow);
    border: 1px solid var(--orange-light);
}

.file-drop-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 48px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: transparent;
    margin-bottom: 16px;
}

.file-drop-area:hover,
.file-drop-area--active {
    border-color: var(--orange);
    background: var(--orange-pale);
}

.file-drop-area__icon-wrap {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--orange-pale);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    color: var(--orange);
}

.file-drop-area__title {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--navy);
    margin-bottom: 6px;
}

.file-drop-area__hint {
    font-size: 0.9rem;
    color: var(--text-subtle);
    margin-bottom: 32px;
}

.file-input { display: none; }

/* ===========================
   FILE SELECTED STATE
   =========================== */
.file-selected {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--orange-pale);
    border: 1.5px solid #f0d0b8;
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 20px;
}

.file-selected__icon { font-size: 1.25rem; flex-shrink: 0; }

.file-selected__name {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--navy);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-selected__remove {
    background: none;
    border: none;
    font-size: 1.3rem;
    line-height: 1;
    color: var(--text-subtle);
    cursor: pointer;
    flex-shrink: 0;
    padding: 0 2px;
}

.file-selected__remove:hover { color: #dc2626; }

/* ===========================
   HOW IT WORKS
   =========================== */
.how-section {
    padding: 80px 0 96px;
    max-width: 1100px;
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
}

.how-section__header {
    text-align: center;
    margin-bottom: 56px;
}

.how-section__title {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 12px;
}

.how-section__sub {
    font-size: 1rem;
    color: var(--text-subtle);
    margin-bottom: 20px;
    line-height: 1.6;
}

.how-section__rule {
    width: 64px;
    height: 4px;
    background: var(--orange);
    border-radius: var(--radius-full);
    margin: 0 auto;
    opacity: 0.5;
}

.how-section__cta-line {
    text-align: center;
    margin-top: 56px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--navy);
    letter-spacing: 0.1px;
}

.how-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 48px;
    position: relative;
}

.how-steps--four {
    grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
    gap: 0;
    align-items: start;
}

.how-step__arrow {
    font-size: 1.5rem;
    color: var(--border);
    padding: 0 12px;
    padding-top: 48px;
    flex-shrink: 0;
    line-height: 1;
}

.how-step {
    text-align: center;
    position: relative;
    z-index: 1;
    padding: 0 12px;
}

.how-step__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--orange);
    color: white;
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.how-step__icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--card-bg);
    box-shadow: 0 8px 30px rgba(28, 37, 57, 0.06);
    border: 1px solid var(--orange-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--text-muted);
}

.how-step__icon--active {
    border-color: var(--orange-pale);
    box-shadow: 0 8px 30px rgba(217, 119, 54, 0.12);
    color: var(--orange);
    position: relative;
    overflow: hidden;
}

.how-step__label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 10px;
}

.how-step__number {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--navy);
    margin-bottom: 10px;
}

.how-step__desc {
    font-size: 0.85rem;
    color: var(--text-subtle);
    line-height: 1.7;
}

/* ===========================
   FOOTER
   =========================== */
.site-footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    padding: 40px 0;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-copy {
    font-size: 0.875rem;
    color: var(--text-subtle);
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-link {
    font-size: 0.875rem;
    color: var(--text-subtle);
    text-decoration: none;
    transition: color 0.15s;
}

.footer-link:hover { color: var(--orange); }

/* ===========================
   RESULT PAGE
   =========================== */
.result-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 48px 24px 80px;
}

.result-hero {
    margin-bottom: 32px;
}

.result-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 24px;
    transition: color 0.15s;
}

.result-back:hover { color: var(--orange); }

.result-filename {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 12px;
    word-break: break-word;
}

.result-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.result-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.result-stat__label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-subtle);
    font-weight: 600;
}

.result-stat__value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--navy);
}

.result-stat-divider {
    color: var(--border);
    font-size: 1.25rem;
    align-self: center;
}

.result-notice {
    background: var(--orange-light);
    border: 1px solid #e8d5c0;
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    font-size: 0.875rem;
    color: var(--orange-dark);
    margin-bottom: 28px;
}

.result-notice strong { font-weight: 600; }

.extracted-text-container {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: auto;
    max-height: 600px;
    margin-bottom: 36px;
    box-shadow: 0 4px 16px rgba(28, 37, 57, 0.04);
}

.extracted-text {
    padding: 28px;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.82rem;
    line-height: 1.75;
    color: var(--navy);
    white-space: pre-wrap;
    word-break: break-word;
}

.result-footer-actions {
    display: flex;
    justify-content: center;
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 900px) {
    .hero-split__inner {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .hero-split__left {
        max-width: none;
        text-align: center;
    }

    .hero__eyebrow { display: inline-block; }

    .hero-split__right {
        max-width: 520px;
        margin: 0 auto;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-actions { display: none; }
    .nav-container { justify-content: space-between; }

    .nav-buildathon-badge { display: none; }

    .how-steps {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .how-steps--four {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .how-step__arrow { display: none; }

    .how-steps::before { display: none; }

    .upload-card { padding: 28px 20px; }
    .upload-card--hero { padding: 24px; }

    .footer-inner { flex-direction: column; text-align: center; }

    .hero { padding: 40px 0 36px; }
    .hero--dark { padding: 56px 0 52px; }
    .hero__brand { font-size: clamp(3rem, 12vw, 4.5rem); }
    .hero-split { padding: 40px 0 48px; }
    .hero-split__inner { padding: 0 20px; }
}

@media (max-width: 480px) {
    .result-stats { gap: 10px; }
    .result-page { padding: 32px 20px 60px; }
}

/* ===========================
   PROCESSING PAGE
   =========================== */
.processing-page {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 48px 24px 80px;
    min-height: 60vh;
}

.processing-card {
    background: var(--card-bg);
    border: 1px solid var(--orange-light);
    border-radius: var(--radius-xl);
    padding: 48px;
    max-width: 580px;
    width: 100%;
    box-shadow: 0 20px 60px -15px var(--orange-shadow);
}

.processing-card__header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 40px;
}

.processing-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--orange-pale);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--orange);
    flex-shrink: 0;
}

.processing-card__title {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 4px;
}

.processing-card__file {
    font-size: 0.875rem;
    color: var(--text-subtle);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.step-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 36px;
}

.step {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--orange-light);
    align-items: flex-start;
}

.step:last-child { border-bottom: none; }

.step__indicator { flex-shrink: 0; padding-top: 2px; }

.step__icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background 0.3s, border-color 0.3s;
}

.step__check { display: none; }
.step__spinner { display: none; }
.step__dot { display: none; }

/* Waiting state */
.step__icon--waiting {
    background: var(--orange-light);
    border: 2px solid var(--border);
}
.step__icon--waiting .step__dot {
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
}

/* Active (running) state */
.step__icon--active {
    background: var(--orange-pale);
    border: 2px solid var(--orange);
}
.step__icon--active .step__spinner {
    display: block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--orange-light);
    border-top-color: var(--orange);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Complete state */
.step__icon--complete {
    background: var(--orange);
    border: 2px solid var(--orange);
}
.step__icon--complete .step__check { display: block; color: white; }

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

.step__label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 2px;
}

.step__desc {
    font-size: 0.82rem;
    color: var(--text-subtle);
    line-height: 1.5;
}

.processing-card__note {
    font-size: 0.8rem;
    color: var(--text-subtle);
    text-align: center;
}

.processing-error {
    margin-top: 24px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    color: #dc2626;
    font-size: 0.875rem;
    text-align: center;
}

/* ===========================
   QC BANNER
   =========================== */
.qc-banner {
    border-radius: var(--radius-md);
    padding: 14px 20px;
    margin-bottom: 24px;
    font-size: 0.9rem;
    font-weight: 500;
}

.qc-banner summary {
    cursor: pointer;
    list-style: none;
    font-weight: 600;
    outline: none;
}

.qc-banner summary::-webkit-details-marker { display: none; }

.qc-body {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(0,0,0,0.08);
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.7;
}

.qc-banner--pass {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.qc-banner--warn {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.qc-banner--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.qc-banner--neutral {
    background: var(--orange-light);
    border: 1px solid #e8d5c0;
    color: var(--navy);
}

.qc-banner--pending {
    background: var(--orange-light);
    border: 1px solid #e8d5c0;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 10px;
}

.qc-banner--failed {
    background: #f8fafc;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.875rem;
}

.qc-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--border);
    border-top-color: var(--orange);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

/* ===========================
   RESULTS PAGE
   =========================== */
.results-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

.results-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.results-header__left { flex: 1; min-width: 0; }

.results-header__actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.results-header__actions .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.results-filename {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--navy);
    word-break: break-word;
    margin-top: 8px;
}

/* ===========================
   TRAINING CONTENT
   =========================== */
.training-content { margin-top: 8px; }

.module-section {
    margin-bottom: 48px;
}

.module-heading-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-top: 32px;
    margin-bottom: 16px;
    border-top: 3px solid var(--orange);
}

.module-section:first-child .module-heading-bar {
    padding-top: 8px;
    border-top: none;
}

.module-heading {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--navy);
    margin: 0;
    line-height: 1.3;
}

.module-body {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    box-shadow: 0 2px 12px rgba(28, 37, 57, 0.04);
}

.module-body h3 {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--orange-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 24px 0 10px;
}

.module-body h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--navy);
    margin: 16px 0 6px;
}

.module-body p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.75;
    margin-bottom: 10px;
}

.module-body ul, .module-body ol {
    padding-left: 20px;
    margin-bottom: 12px;
}

.module-body li {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 4px;
}

.module-body strong { color: var(--navy); }

.module-body ul.checklist {
    list-style: none;
    padding-left: 4px;
}

.module-body ul.checklist li {
    padding-left: 0;
}

/* ===========================
   SHOW ANSWER
   =========================== */
.show-answer-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--orange-light);
    color: var(--orange-dark);
    border: 1.5px solid var(--orange);
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    margin: 10px 0 6px;
}

.show-answer-btn:hover, .show-answer-btn--open {
    background: var(--orange);
    color: white;
}

.answer-reveal {
    display: none;
    background: var(--orange-pale);
    border: 1px solid #f0d0b8;
    border-radius: var(--radius-md);
    padding: 16px;
    margin: 8px 0 16px;
    font-size: 0.875rem;
}

.answer-reveal--open { display: block; }

.answer-reveal p { margin-bottom: 8px; color: var(--navy); }
.answer-reveal strong { color: var(--orange-dark); }

/* ===========================
   TRAINING SUMMARY
   =========================== */
.training-summary {
    background: var(--navy);
    border-radius: var(--radius-lg);
    padding: 32px 36px;
    margin-top: 32px;
    color: rgba(255,255,255,0.85);
}

.training-summary h2 {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    color: white;
    margin-bottom: 16px;
}

.training-summary h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 20px 0 6px;
}

.training-summary p, .training-summary li {
    font-size: 0.9rem;
    line-height: 1.7;
    color: rgba(255,255,255,0.8);
}

.training-summary ul, .training-summary ol {
    padding-left: 20px;
}

.training-summary strong { color: white; }

/* ===========================
   RESPONSIVE — RESULTS
   =========================== */
@media (max-width: 600px) {
    .results-header { flex-direction: column; }
    .results-header__actions { width: 100%; }
    .processing-card { padding: 28px 20px; }
    .module-heading { font-size: 1.1rem; }
    .module-body { padding: 18px 20px; }
    .training-summary { padding: 24px 20px; }
}

/* ===========================
   UPLOAD INLINE ERROR
   =========================== */
.upload-error {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    color: #dc2626;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.upload-error svg { flex-shrink: 0; }

/* ===========================
   BUTTON LOADING STATE
   =========================== */
.btn--loading {
    opacity: 0.85;
    cursor: not-allowed;
    gap: 10px;
}

.btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin 0.7s linear infinite;
    flex-shrink: 0;
}

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