/* ============================================
   Half Halt AI — Web App Styles
   "Midnight Paddock" Dark Theme
   ============================================ */

/* Duplicate variables here as safety net */
:root {
    --bg-deep: #060a14;
    --bg-primary: #0a0e1a;
    --bg-surface: #0f1424;
    --bg-card: #131830;
    --bg-card-hover: #181e3a;
    --bg-elevated: #1a2040;
    --border-subtle: rgba(56, 120, 255, 0.08);
    --border-default: rgba(56, 120, 255, 0.12);
    --border-accent: rgba(0, 180, 255, 0.25);
    --border-glow: rgba(0, 180, 255, 0.4);
    --text-primary: #e8ecf4;
    --text-secondary: #8892a8;
    --text-muted: #5a6478;
    --text-bright: #ffffff;
    --accent: #00b4ff;
    --accent-dim: #0088cc;
    --accent-glow: rgba(0, 180, 255, 0.15);
    --accent-glow-strong: rgba(0, 180, 255, 0.3);
    --green: #2dd4a0;
    --green-dim: #1a9a72;
    --green-bg: rgba(45, 212, 160, 0.08);
    --green-border: rgba(45, 212, 160, 0.2);
    --danger: #ff4466;
    --warning: #ffaa33;
    --success: #2dd4a0;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --glow-blue: 0 0 30px rgba(0, 180, 255, 0.12), 0 0 60px rgba(0, 180, 255, 0.06);
    --glow-blue-strong: 0 0 20px rgba(0, 180, 255, 0.2), 0 0 40px rgba(0, 180, 255, 0.1);
}

/* ---- AUTH SCREENS ---- */
.auth-container {
    max-width: 420px;
    margin: 0 auto;
    padding: 60px 24px;
    text-align: center;
}

.auth-logo {
    width: 88px;
    height: 88px;
    border-radius: 18px;
    margin-bottom: 24px;
    box-shadow: 0 0 40px rgba(0, 180, 255, 0.25);
}

.auth-container h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.8rem;
    margin-bottom: 8px;
    color: var(--text-bright);
}

.auth-subtitle {
    color: var(--text-secondary);
    margin-bottom: 28px;
    font-size: 0.95rem;
}

.auth-form {
    text-align: left;
}

.auth-switch {
    margin-top: 22px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-switch a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.auth-switch a:hover {
    color: var(--text-bright);
}

.auth-forgot {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.auth-forgot:hover {
    color: var(--accent);
}

/* ---- FORMS ---- */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

.form-group input {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: 'Outfit', sans-serif;
    transition: all 0.2s;
    background: var(--bg-surface);
    color: var(--text-primary);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 180, 255, 0.1), 0 0 16px rgba(0, 180, 255, 0.06);
    background: var(--bg-card);
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

.form-error {
    color: var(--danger);
    font-size: 0.85rem;
    margin-bottom: 12px;
    min-height: 0;
}

.form-success {
    color: var(--green);
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.btn-full {
    width: 100%;
    text-align: center;
    cursor: pointer;
    border: none;
    font-family: 'Outfit', sans-serif;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ---- APP CONTENT ---- */
.app-content {
    padding: 36px 24px 60px;
    max-width: 800px;
    margin: 0 auto;
}

.app-content h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.8rem;
    margin-bottom: 4px;
    color: var(--text-bright);
}

.screen-subtitle {
    color: var(--text-secondary);
    margin-bottom: 28px;
    font-size: 0.95rem;
}

/* ---- DASHBOARD ---- */
.dash-hero {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
}

.dash-hero-logo {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    box-shadow: 0 0 24px rgba(0, 180, 255, 0.2);
    flex-shrink: 0;
}

.dash-hero-text h1 {
    font-size: 1.5rem;
    margin-bottom: 2px;
}

.dash-hero-sub {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

/* Stats row */
.dash-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.dash-stat {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 20px 16px;
    text-align: center;
    transition: border-color 0.3s;
}

.dash-stat:hover {
    border-color: var(--border-accent);
}

.dash-stat-value {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 4px;
}

.dash-stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
}

/* Upload CTA */
.dash-upload-cta {
    display: block;
    text-decoration: none;
    color: inherit;
    margin-bottom: 20px;
}

.dash-upload-cta-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px 24px;
    background: linear-gradient(135deg, rgba(0, 180, 255, 0.08), var(--bg-card));
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-lg);
    transition: all 0.3s;
}

.dash-upload-cta:hover .dash-upload-cta-inner {
    box-shadow: var(--glow-blue-strong);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.dash-upload-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent), #0066ff);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    box-shadow: 0 0 20px rgba(0, 180, 255, 0.25);
}

.dash-upload-cta strong {
    display: block;
    font-size: 1.05rem;
    color: var(--text-bright);
    margin-bottom: 2px;
}

.dash-upload-cta p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

.dash-upload-arrow {
    margin-left: auto;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 0.2s;
}

.dash-upload-cta:hover .dash-upload-arrow {
    transform: translateX(3px);
    color: var(--accent);
}

/* Quick links */
.dash-quick-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 32px;
}

.dash-quick-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.25s;
}

.dash-quick-link:hover {
    border-color: var(--border-accent);
    color: var(--accent);
    background: var(--accent-glow);
}

.dash-quick-link svg {
    flex-shrink: 0;
}

/* Recent section */
.recent-section h2 {
    font-size: 1.15rem;
    margin-bottom: 14px;
    text-align: left;
    color: var(--text-primary);
    font-weight: 600;
}

.dash-view-all {
    display: block;
    text-align: center;
    margin-top: 14px;
    font-size: 0.88rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.dash-view-all:hover {
    color: var(--text-bright);
}

/* Keep credit badge for backward compat */
.credit-badge {
    background: var(--green-bg);
    color: var(--green);
    padding: 8px 22px;
    border-radius: 24px;
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid var(--green-border);
}

/* ---- UPLOAD FORM ---- */
.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 16px;
    transition: border-color 0.3s;
}

.form-card:hover {
    border-color: var(--border-default);
}

.form-card h3 {
    font-size: 1rem;
    margin-bottom: 14px;
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Option groups */
.option-group {
    display: flex;
    gap: 10px;
}

.option-item {
    flex: 1;
    padding: 14px 16px;
    border: 1.5px solid var(--border-default);
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: center;
    transition: all 0.25s;
    background: var(--bg-surface);
}

.option-item input { display: none; }

.option-item:hover {
    border-color: var(--border-accent);
}

.option-item.selected {
    border-color: var(--accent);
    background: var(--accent-glow);
    box-shadow: 0 0 16px rgba(0, 180, 255, 0.08);
}

.option-label {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text-primary);
}

.option-item.selected .option-label {
    color: var(--accent);
}

.option-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-card {
    display: flex;
    gap: 14px;
    padding: 18px;
    border: 1.5px solid var(--border-default);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.25s;
    align-items: flex-start;
    background: var(--bg-surface);
}

.option-card input { display: none; }

.option-card:hover {
    border-color: var(--border-accent);
}

.option-card.selected {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.option-card strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.option-card.selected strong {
    color: var(--accent);
}

.option-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

/* ---- FILE PICKERS ---- */
.file-picker {
    display: block;
    padding: 14px 20px;
    border: 2px dashed var(--border-default);
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: center;
    color: var(--accent);
    font-weight: 500;
    transition: all 0.25s;
    background: var(--bg-surface);
}

.file-picker:hover {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.file-picker-large {
    padding: 44px 20px;
}

.file-picker-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.file-picker-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}

.file-selected {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: var(--accent-glow);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-accent);
}

.file-icon {
    font-size: 1.2rem;
}

.file-meta {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.file-remove {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0 4px;
    transition: color 0.2s;
}

.file-remove:hover {
    color: var(--danger);
}

/* ---- PROGRESS BAR ---- */
.progress-bar {
    height: 6px;
    background: var(--bg-surface);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #0066ff);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s;
    box-shadow: 0 0 12px rgba(0, 180, 255, 0.3);
}

.upload-status {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
}

.upload-note {
    text-align: center;
    margin-top: 14px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ---- HISTORY ---- */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: inherit;
    transition: all 0.25s;
    cursor: pointer;
    flex-wrap: wrap;
    gap: 8px;
}

.history-item:hover {
    border-color: var(--border-accent);
    box-shadow: var(--glow-blue);
    transform: translateX(4px);
}

.history-info h4 {
    font-size: 0.95rem;
    margin-bottom: 4px;
    color: var(--text-primary);
    font-weight: 600;
}

.history-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.history-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-chip {
    padding: 4px 14px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
    letter-spacing: 0.02em;
}

.status-complete {
    background: rgba(45, 212, 160, 0.12);
    color: var(--green);
    border: 1px solid rgba(45, 212, 160, 0.2);
}

.status-processing, .status-analysing {
    background: rgba(255, 170, 51, 0.1);
    color: var(--warning);
    border: 1px solid rgba(255, 170, 51, 0.2);
}

.status-failed, .status-rejected {
    background: rgba(255, 68, 102, 0.1);
    color: var(--danger);
    border: 1px solid rgba(255, 68, 102, 0.2);
}

.status-pending {
    background: rgba(136, 146, 168, 0.1);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

.history-percentage {
    font-weight: 700;
    color: var(--accent);
    font-size: 1.1rem;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

/* ---- REPORT ---- */
.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--text-bright);
}

.report-header {
    margin-bottom: 28px;
}

.report-header h1 {
    font-size: 1.5rem;
}

.report-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.report-score-big {
    text-align: center;
    padding: 32px;
    background: linear-gradient(135deg, rgba(0, 180, 255, 0.06), var(--bg-card));
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-accent);
    margin-bottom: 28px;
    box-shadow: var(--glow-blue);
}

.report-percentage {
    font-size: 3.2rem;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 0 0 32px rgba(0, 180, 255, 0.3);
}

.report-marks {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 6px;
}

.report-section {
    margin-bottom: 28px;
}

.report-section h2 {
    font-size: 1.15rem;
    margin-bottom: 14px;
    text-align: left;
    color: var(--text-primary);
    font-weight: 600;
}

.report-summary {
    padding: 24px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    line-height: 1.8;
    color: var(--text-secondary);
    font-size: 0.95rem;
    border: 1px solid var(--border-subtle);
}

/* Score table */
.score-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.score-table th {
    text-align: left;
    padding: 12px 14px;
    background: var(--bg-surface);
    border-bottom: 2px solid var(--border-default);
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.score-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: top;
    color: var(--text-secondary);
}

.score-table tr:hover {
    background: var(--bg-card);
}

/* Override inline style on subtotal rows */
.score-table tr[style*="font-weight:600"] {
    background: var(--bg-surface) !important;
}

.score-table tr[style*="font-weight:600"] td {
    color: var(--text-primary);
}

.score-mark {
    font-weight: 700;
    font-size: 1rem;
}

.mark-high { color: var(--green); }
.mark-mid { color: var(--warning); }
.mark-low { color: var(--danger); }

.score-comment {
    font-size: 0.8rem;
    color: var(--text-muted);
    max-width: 400px;
    line-height: 1.5;
}

/* Priorities & Strengths */
.report-list {
    list-style: none;
    padding: 0;
}

.report-list li {
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
    transition: border-color 0.2s;
}

.report-list li:hover {
    border-color: var(--border-default);
}

.priority-list li {
    border-left: 3px solid var(--accent);
}

/* ---- CREDITS ---- */
.credits-balance-card {
    text-align: center;
    padding: 36px;
    background: linear-gradient(135deg, rgba(0, 180, 255, 0.06), var(--bg-card));
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-accent);
    margin-bottom: 36px;
    box-shadow: var(--glow-blue);
}

.credits-label {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
}

.credits-amount {
    font-size: 3.2rem;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 0 0 28px rgba(0, 180, 255, 0.25);
}

.credits-tier {
    margin-top: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.credits-tier strong {
    color: var(--text-primary);
}

/* Subscription heading overrides (inline styled) */
.app-content h2 {
    font-size: 1.3rem;
    color: var(--text-primary);
    font-weight: 600;
}

.app-content .screen-subtitle {
    color: var(--text-muted);
}

/* Top-up cards */
.topup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
}

.topup-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    text-align: center;
    position: relative;
    transition: all 0.3s;
}

.topup-card:hover {
    border-color: var(--border-accent);
}

.topup-card.highlighted {
    border: 2px solid var(--accent);
    box-shadow: var(--glow-blue);
    background: linear-gradient(180deg, rgba(0, 180, 255, 0.04), var(--bg-card));
}

.topup-credits {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
}

.topup-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.topup-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 2px;
}

.topup-per {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* ---- NAV APP LINKS ---- */
.nav-app-link {
    display: none !important;
}

body.logged-in .nav-app-link {
    display: inline !important;
}

/* Hamburger: hidden by default on desktop even when logged in */
body.logged-in .nav-toggle {
    display: none !important;
}

/* ---- SPINNER ---- */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-default);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

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

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .auth-container {
        padding: 40px 16px;
    }

    .auth-container h1 {
        font-size: 1.5rem;
    }

    .auth-logo {
        width: 68px;
        height: 68px;
    }

    .dash-hero {
        gap: 14px;
    }

    .dash-hero-logo {
        width: 48px;
        height: 48px;
        border-radius: 12px;
    }

    .dash-hero-text h1 {
        font-size: 1.2rem;
    }

    .dash-stats {
        gap: 8px;
    }

    .dash-stat {
        padding: 14px 8px;
    }

    .dash-stat-value {
        font-size: 1.3rem;
    }

    .dash-stat-label {
        font-size: 0.65rem;
    }

    .dash-upload-cta-inner {
        padding: 18px 16px;
        gap: 12px;
    }

    .dash-upload-icon {
        width: 44px;
        height: 44px;
        border-radius: 12px;
    }

    .dash-quick-links {
        gap: 8px;
    }

    .dash-quick-link {
        padding: 12px 8px;
        font-size: 0.8rem;
        gap: 6px;
    }

    .dash-quick-link svg {
        width: 16px;
        height: 16px;
    }

    .option-group {
        flex-direction: column;
        gap: 8px;
    }

    .option-item {
        padding: 12px 14px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-card {
        padding: 18px 16px;
    }

    .score-table {
        font-size: 0.78rem;
    }

    .score-table th, .score-table td {
        padding: 8px 6px;
    }

    .score-comment {
        display: none;
    }

    .app-content {
        padding: 20px 16px 40px;
    }

    .app-content h1 {
        font-size: 1.5rem;
    }

    .report-percentage {
        font-size: 2.2rem;
    }

    .report-score-big {
        padding: 24px 16px;
    }

    .credits-amount {
        font-size: 2.2rem;
    }

    .credits-balance-card {
        padding: 24px 16px;
    }

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

    .topup-card {
        padding: 18px 12px;
    }

    .pricing-grid {
        max-width: 100% !important;
        grid-template-columns: 1fr;
    }

    .history-item {
        padding: 14px 16px;
    }

    .report-rosette img {
        width: 110px;
    }

    .analysis-progress h2 {
        font-size: 1.2rem;
    }

    .analysis-horse-animation img {
        width: 90px;
        height: 90px;
    }

    .profile-field {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    /* Nav hamburger for app — only visible on mobile when logged in */
    body.logged-in .nav-toggle {
        display: block !important;
    }

    /* Hide inline nav links on mobile — use hamburger menu instead */
    body.logged-in #nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-surface, #0f1424);
        border-bottom: 1px solid var(--border-subtle, rgba(56, 120, 255, 0.08));
        flex-direction: column;
        padding: 12px 16px;
        gap: 8px;
        z-index: 200;
    }

    body.logged-in #nav-links.open {
        display: flex;
    }

    body.logged-in #nav-links .nav-app-link {
        display: block !important;
    }

    #nav-links a {
        font-size: 0.95rem;
        padding: 8px 0;
    }
}

@media (max-width: 480px) {
    .topup-grid {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    .option-label {
        font-size: 0.85rem;
    }

    .password-requirements {
        gap: 4px;
    }

    .pw-req {
        font-size: 0.65rem;
        padding: 2px 6px;
    }
}

/* ---- PASSWORD REQUIREMENTS ---- */
.password-requirements {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.pw-req {
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--bg-surface, #f0f0f0);
    color: var(--text-muted, #888);
    border: 1px solid var(--border-subtle, #e8e8e8);
    transition: all 0.2s;
}

.pw-req.met {
    background: var(--green-bg, rgba(45, 212, 160, 0.08));
    color: var(--green, #2dd4a0);
    border-color: var(--green-border, rgba(45, 212, 160, 0.2));
}

/* ---- ANALYSIS PROGRESS ---- */
.analysis-progress {
    text-align: center;
    padding: 60px 20px;
}

.analysis-horse-animation {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
}

.analysis-horse-animation img {
    width: 120px;
    height: 120px;
    border-radius: 24px;
    box-shadow: 0 0 40px rgba(0, 180, 255, 0.2);
    animation: analysisPulse 2s ease-in-out infinite;
}

@keyframes analysisPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 180, 255, 0.15); transform: scale(1); }
    50% { box-shadow: 0 0 50px rgba(0, 180, 255, 0.35); transform: scale(1.03); }
}

.analysis-progress h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.4rem;
    color: var(--text-bright, #fff);
    margin-bottom: 8px;
}

.analysis-progress p {
    color: var(--text-secondary, #888);
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.analysis-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 320px;
    margin: 28px auto 0;
    text-align: left;
}

.analysis-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 8px;
    background: var(--bg-card, #131830);
    border: 1px solid var(--border-subtle, rgba(56, 120, 255, 0.08));
    font-size: 0.88rem;
    color: var(--text-muted, #888);
    transition: all 0.3s;
}

.analysis-step.active {
    color: var(--accent, #00b4ff);
    border-color: var(--border-accent, rgba(0, 180, 255, 0.25));
    background: var(--accent-glow, rgba(0, 180, 255, 0.08));
}

.analysis-step.done {
    color: var(--green, #2dd4a0);
    border-color: var(--green-border, rgba(45, 212, 160, 0.2));
}

.analysis-step-icon {
    width: 24px;
    text-align: center;
    font-size: 0.9rem;
}

/* ---- ROSETTE ON REPORT ---- */
.report-rosette {
    text-align: center;
    margin-bottom: 24px;
}

.report-rosette img {
    width: 140px;
    height: auto;
    border-radius: 16px;
    background: #fff;
    padding: 8px;
    box-shadow: 0 4px 24px rgba(0, 180, 255, 0.15);
    animation: rosetteAppear 0.6s ease both;
}

@keyframes rosetteAppear {
    from { opacity: 0; transform: scale(0.7) rotate(-10deg); }
    to { opacity: 1; transform: scale(1) rotate(0); }
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 10px 24px;
    background: linear-gradient(135deg, var(--accent, #00b4ff), #0066ff);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 4px 16px rgba(0, 180, 255, 0.2);
}

.share-btn:hover {
    box-shadow: 0 6px 24px rgba(0, 180, 255, 0.3);
    transform: translateY(-1px);
}

/* ---- VIDEO PLAYBACK IN REPORT ---- */
.report-video-section {
    margin-bottom: 24px;
}

.report-video-section video {
    width: 100%;
    max-height: 400px;
    border-radius: 12px;
    background: #000;
    border: 1px solid var(--border-subtle, rgba(56, 120, 255, 0.08));
}

.report-video-missing {
    padding: 20px;
    text-align: center;
    color: var(--text-muted, #888);
    font-size: 0.85rem;
    background: var(--bg-card, #131830);
    border-radius: 12px;
    border: 1px dashed var(--border-default, rgba(56, 120, 255, 0.12));
}

/* ---- PROFILE ---- */
.profile-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-subtle, rgba(56, 120, 255, 0.08));
}

.profile-field:last-child {
    border-bottom: none;
}

.profile-label {
    font-size: 0.88rem;
    color: var(--text-muted, #888);
    font-weight: 500;
}

.profile-value {
    font-size: 0.95rem;
    color: var(--text-primary, #e8ecf4);
    font-weight: 500;
}

@media (max-width: 480px) {
    .topup-grid {
        grid-template-columns: 1fr;
        max-width: 280px;
        margin: 0 auto;
    }
}
