* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: #0b1020;
    color: #ffffff;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font: inherit;
}

/* =========================
   TOPBAR
========================= */

.topbar {
    height: 72px;
    padding: 0 28px;

    display: flex;
    align-items: center;
    gap: 20px;

    background: rgba(12, 18, 36, 0.96);
    border-bottom: 1px solid rgba(255,255,255,0.08);

    position: sticky;
    top: 0;
    z-index: 100;
}

.back-btn {
    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;
    background: rgba(255,255,255,0.06);

    font-size: 22px;
}

.brand {
    font-size: 21px;
    font-weight: 800;
}

.header-title {
    margin-left: auto;
    color: #9aa6bd;
    font-size: 14px;
}

/* =========================
   PAGE
========================= */

.analysis-page {
    width: min(1100px, 92%);
    margin: 0 auto;
    padding: 34px 0 70px;
}

.analysis-header {
    margin-bottom: 24px;
}

.small-label,
.week-range-card span,
.card-heading span,
.weekly-message-card span,
.ai-analysis-card span {
    color: #7f8ca6;
    font-size: 12px;
    letter-spacing: 1.4px;
}

.analysis-header h1 {
    margin-top: 7px;
    font-size: 36px;
}

.analysis-header p {
    margin-top: 8px;
    color: #9ba6ba;
}

/* =========================
   WEEK RANGE
========================= */

.week-range-card {
    padding: 22px;

    background: #10172a;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 20px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 16px;
    margin-bottom: 22px;
}

.week-range-card h2 {
    margin-top: 6px;
    font-size: 22px;
}

.week-score {
    font-size: 30px;
    font-weight: 800;
}

/* =========================
   STATS
========================= */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);

    gap: 14px;
    margin-bottom: 22px;
}

.stat-card {
    padding: 20px;

    background: #10172a;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 18px;

    display: flex;
    align-items: center;
    gap: 14px;
}

.stat-icon {
    width: 46px;
    height: 46px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 14px;
    background: rgba(255,255,255,0.06);

    font-size: 22px;
}

.stat-card small {
    color: #8d99af;
    font-size: 12px;
}

.stat-card h2 {
    margin-top: 5px;
    font-size: 24px;
}

/* =========================
   ANALYSIS CARDS
========================= */

.analysis-card,
.weekly-message-card,
.ai-analysis-card {
    padding: 22px;

    background: #10172a;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 20px;

    margin-bottom: 18px;
}

.card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 16px;
}

.card-heading h2 {
    margin-top: 5px;
    font-size: 22px;
}

.card-heading strong {
    font-size: 22px;
}

.card-description {
    margin-top: 13px;
    color: #9ba6ba;
    line-height: 1.6;
}

/* =========================
   PROGRESS
========================= */

.progress-bar {
    height: 11px;

    margin-top: 18px;

    border-radius: 999px;
    background: rgba(255,255,255,0.07);

    overflow: hidden;
}

.progress-fill {
    width: 0%;
    height: 100%;

    border-radius: inherit;

    background: linear-gradient(
        90deg,
        #7c3aed,
        #22d3ee
    );

    transition: width 0.35s ease;
}

/* =========================
   WEEKLY MESSAGE
========================= */

.weekly-message-card h2 {
    margin-top: 7px;
    font-size: 24px;
}

.weekly-message-card p {
    margin-top: 10px;

    color: #a1acc0;
    line-height: 1.65;
}

/* =========================
   AI CARD
========================= */

.ai-analysis-card {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    border-color: rgba(124,58,237,0.35);

    background:
        linear-gradient(
            135deg,
            rgba(124,58,237,0.12),
            rgba(34,211,238,0.06)
        ),
        #10172a;
}

.ai-analysis-card h2 {
    margin-top: 6px;
    font-size: 23px;
}

.ai-analysis-card p {
    margin-top: 8px;

    max-width: 680px;

    color: #9ba6ba;
    line-height: 1.6;
}

#aiAnalysisBtn {
    border: none;

    padding: 13px 18px;

    border-radius: 13px;

    background: #ffffff;
    color: #0b1020;

    font-weight: 800;

    cursor: pointer;

    white-space: nowrap;
}

/* =========================
   MOBILE
========================= */

@media (max-width: 850px) {

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

}

@media (max-width: 600px) {

    .topbar {
        padding: 0 16px;
    }

    .analysis-page {
        width: 94%;
        padding-top: 22px;
    }

    .analysis-header h1 {
        font-size: 29px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .week-range-card,
    .ai-analysis-card {
        align-items: flex-start;
        flex-direction: column;
    }

    #aiAnalysisBtn {
        width: 100%;
    }

    .card-heading {
        align-items: flex-start;
    }

}
.hidden {
    display: none !important;
}

.ai-result-card {
    padding: 22px;

    background:
        linear-gradient(
            135deg,
            rgba(124,58,237,.12),
            rgba(34,211,238,.06)
        ),
        #10172a;

    border: 1px solid rgba(124,58,237,.35);

    border-radius: 20px;

    margin-bottom: 18px;
}

.ai-result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;

    gap: 16px;

    margin-bottom: 18px;
}

.ai-result-header span {
    color: #9a8cff;

    font-size: 12px;
    letter-spacing: 1.4px;
}

.ai-result-header h2 {
    margin-top: 6px;
    font-size: 22px;
}

.close-ai-result {
    width: 36px;
    height: 36px;

    border: none;
    border-radius: 10px;

    background: rgba(255,255,255,.06);
    color: white;

    cursor: pointer;
}

.ai-result-content {
    color: #c4ccda;
    line-height: 1.7;
}

.ai-result-content h3 {
    margin-top: 18px;
    margin-bottom: 6px;

    color: white;
}

.ai-result-content p {
    margin-bottom: 10px;
}