/* ===== App pages shared ===== */
.site-app .nav { position: sticky; }
.inline-form { display: inline; }
.sticky-cta {
    position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
    z-index: 60; display: none;
    background: var(--orange); color: #fff;
    padding: 14px 28px; border-radius: 999px;
    font-family: var(--font-display); font-weight: 600; font-size: 0.95rem;
    text-decoration: none; box-shadow: 0 16px 40px rgba(255,107,53,0.5);
}
@media (max-width: 720px) {
    .sticky-cta { display: block; }
}

/* ===== Page shell ===== */
.page { padding: 72px 0 96px; background: linear-gradient(180deg, var(--paper), var(--bg)); min-height: 70vh; }
.page.narrow-zone { max-width: 760px; }
.container.narrow { max-width: 760px; }
.page-head { max-width: 720px; margin: 0 auto 44px; text-align: center; }
.page-head h1 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); color: var(--navy); margin: 14px 0 10px; line-height: 1.15; }
.page-head p { color: var(--muted); font-size: 1.03rem; }
.page-head a { color: var(--orange); text-decoration: none; }
.page-head a:hover { text-decoration: underline; }

.eyebrow {
    display: inline-block; color: var(--orange); font-weight: 700;
    text-transform: uppercase; letter-spacing: 2px; font-size: 0.78rem;
    background: rgba(255,107,53,0.10); padding: 7px 16px; border-radius: 999px;
}
.notice { background: #fff; padding: 18px 22px; border-radius: 16px; border: 1px solid var(--line); box-shadow: var(--shadow-sm); margin-bottom: 22px; }
.notice p { color: var(--muted); }
.notice-error { border-color: #F5C2C7; background: #FFF2F3; }
.notice-updated { border-color: var(--amber); background: var(--pastel-yellow); }
.muted { color: var(--muted); }
.btn-sm { padding: 9px 18px; font-size: 0.85rem; }
.btn-block { width: 100%; text-align: center; }
.btn-white { background: #fff; color: var(--navy); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.btn-white:hover { box-shadow: var(--shadow); }
.fine-print { color: var(--muted); font-size: 0.83rem; text-align: center; margin-top: 30px; }
.fine-print a { color: var(--orange); }

/* ===== Landing: level selector ===== */
.level-section { background: var(--bg); padding: 60px 0; }
.level-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.level-chip {
    display: flex; align-items: center; gap: 14px;
    background: #fff; border: 1.5px solid var(--line); border-radius: 999px;
    padding: 14px 20px; text-decoration: none; color: var(--navy);
    box-shadow: var(--shadow-sm); transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.level-chip:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--orange); }
.level-code {
    width: 42px; height: 42px; border-radius: 50%; flex: none;
    display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; color: #fff;
    background: linear-gradient(135deg, var(--orange), var(--amber));
}
.level-name { font-family: var(--font-display); font-weight: 600; font-size: 1rem; flex: 1; }
.level-go { color: var(--orange); font-weight: 700; }

/* ===== Quiz setup ===== */
.quiz-setup-form { max-width: 880px; margin: 0 auto; }
.setup-label { font-size: 1.15rem; color: var(--navy); margin: 40px 0 16px; }
.mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.mode-card { position: relative; padding: 22px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.mode-card input { position: absolute; opacity: 0; }
.mode-card:has(input:checked) { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255,107,53,0.15), var(--shadow-sm); }
.mode-icon { font-size: 1.7rem; }
.mode-name { font-family: var(--font-display); font-weight: 700; color: var(--navy); }
.mode-desc { font-size: 0.87rem; color: var(--muted); }
.select-wrap select, .text-input {
    width: 100%; padding: 15px 20px; border-radius: 16px;
    border: 1.5px solid var(--line); font-family: var(--font-body); font-size: 0.98rem;
    background: #fff; color: var(--ink);
}
.select-wrap select:focus, .text-input:focus { outline: none; border-color: var(--orange); }
.setup-actions { margin-top: 34px; display: flex; gap: 14px; }

/* ===== Locked (paid-only) cards ===== */
.locked { position: relative; overflow: hidden; cursor: default; }
.locked .locked-body { filter: blur(5px); pointer-events: none; user-select: none; opacity: 0.85; }
.lock-overlay {
    position: absolute; inset: 0; z-index: 2;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
    text-align: center; padding: 16px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: inherit;
}
.lock-icon { font-size: 1.4rem; line-height: 1; }
.lock-label { font-weight: 600; color: var(--navy); font-size: 0.9rem; }
.lock-overlay .btn { white-space: nowrap; }

/* ===== Practice paper page ===== */
.paper-page { max-width: 820px; margin: 0 auto; }
.paper-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 6px 0 22px; }
.btn-soft { color: var(--navy); background: var(--pastel-blue); border: 1px solid transparent; }
.btn-soft:hover { background: #DCE7FF; }
.paper-allowance { background: var(--pastel-yellow); border-color: var(--amber); }
.paper-allowance p { color: var(--ink); }
.paper-steps { margin-bottom: 24px; padding: 26px 30px; }
.paper-steps-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: paper-step; }
.paper-steps-list li { display: flex; gap: 14px; align-items: flex-start; color: var(--ink); font-size: 0.95rem; line-height: 1.55; }
.paper-steps-list li strong { color: var(--navy); }
.paper-steps-list li::before {
    counter-increment: paper-step; content: counter(paper-step);
    flex: 0 0 26px; height: 26px; border-radius: 50%;
    background: var(--pastel-blue); color: var(--navy);
    font-weight: 700; font-size: 0.82rem; font-family: var(--font-display);
    display: inline-flex; align-items: center; justify-content: center; margin-top: 2px;
}
.paper-submit { margin-bottom: 24px; padding: 28px 30px; }
.paper-submit h2 { margin: 0 0 6px; }
.paper-result { display: flex; align-items: center; gap: 16px; margin: 14px 0 4px; }
.paper-mark { font-family: var(--font-display); font-size: 2.6rem; font-weight: 800; color: var(--navy); line-height: 1; }
.paper-mark small { font-size: 1rem; font-weight: 600; color: var(--muted); }
.paper-feedback { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; margin-top: 16px; }
.paper-feedback h3 { font-size: 0.95rem; margin: 0 0 6px; }
.paper-feedback p { margin: 0; color: var(--ink); line-height: 1.6; white-space: pre-line; }
.upload-form { display: grid; gap: 14px; margin-top: 18px; }
.upload-drop {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    padding: 42px 20px; border: 2px dashed var(--line); border-radius: 18px;
    background: var(--paper); cursor: pointer; color: var(--muted); text-align: center;
    transition: border-color 0.15s, background 0.15s;
}
.upload-drop:hover { border-color: var(--orange); background: #fff; }
.upload-plus { font-size: 1.8rem; color: var(--orange); line-height: 1; }
.upload-preview { display: flex; flex-wrap: wrap; gap: 8px; }
.upload-file { background: var(--pastel-blue); color: var(--navy); font-size: 0.82rem; font-weight: 600; padding: 6px 12px; border-radius: 999px; }
.paper-history { margin: 8px 0 30px; }
.paper-history h3 { margin: 0 0 12px; font-size: 1rem; }
.paper-history .plan-list { margin: 0; padding: 0 0 0 18px; display: grid; gap: 8px; }
.paper-history .plan-list li { color: var(--ink); font-size: 0.92rem; }

/* ===== Quiz take ===== */
.quiz-page { padding: 40px 0 90px; background: var(--paper); min-height: 80vh; }
.quiz-topbar { display: flex; align-items: center; gap: 18px; margin-bottom: 26px; }
.quiz-progress { flex: 1; }
.quiz-count { font-size: 0.9rem; font-weight: 600; color: var(--muted); display: block; margin-bottom: 8px; }
.quiz-bar { height: 8px; background: #E8ECF4; border-radius: 999px; overflow: hidden; }
.quiz-bar-fill { height: 100%; background: linear-gradient(90deg, var(--orange), var(--amber)); border-radius: 999px; }
.quiz-mode { background: var(--navy); color: #fff; padding: 8px 16px; border-radius: 999px; font-size: 0.82rem; font-weight: 600; }
.deck-note { font-weight: 400; color: rgba(255,255,255,0.75); font-size: 0.76rem; }
.readiness-info { display: inline-block; vertical-align: middle; margin-left: 8px; }
.readiness-info summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 0.72rem; font-weight: 700; line-height: 1; }
.readiness-info summary::-webkit-details-marker { display: none; }
.readiness-info[open] summary { margin-bottom: 8px; }
.readiness-info p { font-weight: 400; font-size: 0.84rem; color: var(--muted); line-height: 1.5; }
.readiness-caption { font-size: 0.8rem; margin-top: 10px; }
.cert-btn { margin-top: 14px; width: 100%; text-align: center; }
.quiz-timer { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; color: var(--orange); }
.question-card { padding: 36px; max-width: 780px; margin: 0 auto; }
.question-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.meta-chip { background: var(--pastel-blue); color: var(--navy); padding: 5px 12px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; }
.question-text { font-size: 1.15rem; font-weight: 600; color: var(--navy); margin-bottom: 26px; line-height: 1.5; }
.question-text p:first-child { margin-top: 0; }
.question-text p:last-child { margin-bottom: 0; }
.question-text ul, .question-text ol { margin: 10px 0 0 22px; }
.question-text table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 0.95rem; }
.question-text th, .question-text td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.question-image { margin: 0 0 22px; }
.question-image img { max-width: 100%; border-radius: 12px; border: 1px solid var(--line); background: #fff; padding: 8px; display: block; }
.options { display: flex; flex-direction: column; gap: 12px; }
.option {
    display: flex; align-items: center; gap: 14px;
    border: 1.5px solid var(--line); border-radius: 18px; padding: 16px 18px;
    cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.option:hover { border-color: var(--orange); background: var(--pastel-peach); }
.option:has(input:checked) { border-color: var(--orange); background: var(--pastel-peach); }
.option input { display: none; }
.option-letter {
    width: 34px; height: 34px; border-radius: 50%; flex: none;
    display: grid; place-items: center; font-family: var(--font-display); font-weight: 700;
    background: var(--pastel-blue); color: var(--navy);
}
.option:has(input:checked) .option-letter { background: var(--orange); color: #fff; }
.option-correct { border-color: #2FA36B; background: var(--pastel-mint); }
.option-correct .option-letter { background: #2FA36B; color: #fff; }
.option-wrong { border-color: #E4572E; background: #FFF0EC; }
.option-wrong .option-letter { background: #E4572E; color: #fff; }
.option-tag { margin-left: auto; font-size: 0.78rem; font-weight: 600; color: #2FA36B; }
.option-text p { margin: 0; }

.option-spinner {
    width: 16px; height: 16px; margin-left: auto; flex: none;
    border: 2.5px solid rgba(255, 107, 53, 0.25); border-top-color: var(--orange);
    border-radius: 50%; display: none;
    animation: option-spin 0.7s linear infinite;
}
.option.loading .option-spinner { display: block; }

.btn.loading { position: relative; color: transparent; }
.btn.loading::after {
    content: ""; position: absolute; top: 50%; left: 50%;
    width: 18px; height: 18px; margin: -9px 0 0 -9px;
    border: 2.5px solid rgba(22, 33, 62, 0.25); border-top-color: var(--navy);
    border-radius: 50%; animation: option-spin 0.7s linear infinite;
}
.btn-primary.loading::after { border-color: rgba(255, 255, 255, 0.35); border-top-color: #fff; }
@keyframes option-spin { to { transform: rotate(360deg); } }

.question-report { max-width: 780px; margin: 10px auto 0; text-align: center; }
.report-toggle {
    background: none; border: none; color: var(--muted);
    text-decoration: underline; font-size: 0.82rem; cursor: pointer; padding: 6px;
}
.report-toggle:hover { color: var(--orange); }
.report-form {
    margin-top: 10px; text-align: left; background: #fff;
    border: 1px solid var(--line); border-radius: 14px; padding: 16px;
    display: grid; gap: 10px;
}
.report-form select, .report-form textarea {
    width: 100%; border: 1px solid var(--line); border-radius: 10px;
    padding: 9px 12px; font-family: inherit; font-size: 0.9rem; background: #fff;
    color: var(--ink);
}
.report-form textarea { resize: vertical; }
.report-form .btn { justify-self: end; }

.toast { margin-top: 16px; padding: 12px 16px; border-radius: 12px; font-size: 0.9rem; font-weight: 600; }
.toast-success { background: var(--pastel-mint); border: 1px solid #CFEEDB; color: #1E7A4C; }
.toast-error { background: #FFF0EC; border: 1px solid #F6C9BC; color: #B03A1A; }
.feedback { max-width: 780px; margin: 18px auto 0; padding: 18px 22px; border-radius: 16px; font-size: 0.95rem; }
.feedback-good { background: var(--pastel-mint); border: 1px solid #CFEEDB; color: #1E7A4C; }
.feedback-bad { background: var(--pastel-yellow); border: 1px solid #F3DFA0; color: #7A5A00; }
.feedback .explanation { margin-top: 10px; color: #3A4560; line-height: 1.6; }
.setup-hint { font-weight: 400; font-size: 0.85rem; }
.quiz-nav .btn { flex: none; }
.quiz-nav .btn-block { flex: 1; }
.quiz-nav { max-width: 780px; margin: 24px auto 0; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.quiz-hint { color: var(--muted); font-size: 0.88rem; }
.quiz-hint.show { color: var(--orange); font-weight: 600; }

/* ===== Quiz result ===== */
.report-head { text-align: center; margin-bottom: 36px; }
.report-head h1 { font-size: 2.2rem; color: var(--navy); margin: 12px 0 6px; }
.report-sub { color: var(--muted); }
.score-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; max-width: 640px; margin: 0 auto 30px; }
.score-card { text-align: center; padding: 30px; }
.score-ring {
    --pct: 0;
    width: 150px; height: 150px; margin: 0 auto 12px;
    border-radius: 50%;
    background: conic-gradient(var(--orange) calc(var(--pct) * 1%), #EDF0F6 0);
    display: grid; place-items: center;
}
.score-ring::before { content: ""; position: absolute; width: 124px; height: 124px; border-radius: 50%; background: #fff; }
.score-ring { position: relative; }
.score-inner { position: relative; z-index: 1; }
.score-big { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; color: var(--navy); display: block; }
.score-small { color: var(--muted); font-size: 0.85rem; }
.score-label { color: var(--muted); font-size: 0.9rem; }
.readiness-trend { margin-top: 6px; }
.readiness-trend .spark { width: 100%; height: 54px; display: block; }
.readiness-trend .spark polyline { fill: none; stroke: var(--orange); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.trend-caption { font-size: 0.78rem; margin-top: 2px; }

/* ===== Syllabus coverage & pace ===== */
.cover-table { padding: 6px 22px; }
.cover-row {
    display: grid; grid-template-columns: minmax(200px, 1.2fr) 2fr 130px;
    align-items: center; gap: 18px; padding: 12px 0; border-bottom: 1px solid var(--line);
    font-size: 0.9rem;
}
.cover-row:last-child { border-bottom: none; }
.cover-head { color: var(--muted); font-weight: 600; font-size: 0.8rem; padding-bottom: 8px; }
.cover-name { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--navy); }
.cover-mid { display: flex; align-items: center; gap: 14px; }
.cover-mid .bar { flex: 1; max-width: 260px; }
.cover-mid .muted { white-space: nowrap; font-size: 0.8rem; }
.cover-pace { text-align: right; color: var(--navy); font-weight: 600; }

@media (max-width: 720px) {
    .cover-row {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 14px 0;
    }
    .cover-head { display: none; }
    .cover-mid { flex-wrap: wrap; }
    .cover-mid .bar { max-width: none; }
    .cover-pace { text-align: left; }
}
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.report-card { padding: 28px; }
.report-card h2 { font-size: 1.15rem; color: var(--navy); margin-bottom: 20px; }
.error-bars { display: flex; flex-direction: column; gap: 16px; margin-bottom: 18px; }
.error-row { display: flex; align-items: center; gap: 12px; font-size: 0.9rem; }
.error-row .bar { flex: 1; }
.error-row b { min-width: 28px; text-align: right; color: var(--navy); }
.bar-fill.gold { background: linear-gradient(90deg, var(--amber), #FF9F1C); }
.report-note { color: var(--muted); font-size: 0.88rem; }
.topic-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.topic-table th, .topic-table td { text-align: left; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.topic-table th { color: var(--muted); font-weight: 600; }
.report-actions { display: flex; gap: 14px; justify-content: center; margin-top: 36px; flex-wrap: wrap; }

/* ===== Study library ===== */
.subjects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.subject-card { padding: 26px; display: flex; flex-direction: column; gap: 8px; }
.subject-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.subject-code {
    width: 44px; height: 44px; border-radius: 14px;
    display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; color: #fff;
    background: linear-gradient(135deg, var(--navy), #3A4E79);
}
.subject-card h2 { font-size: 1.2rem; color: var(--navy); }
.subject-card p { color: var(--muted); font-size: 0.92rem; }
.subject-actions { margin-top: 8px; }
.topic-list { margin-top: 10px; }
.topic-list summary { cursor: pointer; font-size: 0.9rem; font-weight: 600; color: var(--orange); }
.topic-list ul { list-style: none; margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.topic-list li a { color: var(--navy); text-decoration: none; font-size: 0.92rem; }
.topic-list li a:hover { color: var(--orange); }
.lock-chip { margin-left: 6px; background: var(--pastel-peach); color: var(--orange); }
.topic-locked { color: var(--muted); font-size: 0.92rem; }
.lock-note { margin: 0 0 4px; font-size: 0.85rem; }
.subject-locked, .module-locked { opacity: 0.92; }

/* ===== Course-style library ===== */
.course-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.course-card { padding: 26px; display: flex; flex-direction: column; gap: 10px; text-decoration: none; transition: transform 0.15s, box-shadow 0.15s; }
.course-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.course-top { display: flex; justify-content: space-between; align-items: center; }
.course-code {
    width: 46px; height: 46px; border-radius: 14px;
    display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; color: #fff;
    background: linear-gradient(135deg, var(--orange), var(--amber));
}
.course-card h2 { font-size: 1.2rem; color: var(--navy); }
.course-bar { height: 8px; }
.course-meta { color: var(--muted); font-size: 0.88rem; }
.course-actions { margin-top: 6px; display: flex; gap: 10px; flex-wrap: wrap; }
.course-resume { font-weight: 700; color: var(--orange); font-size: 0.9rem; margin-top: auto; }
.course-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.course-add { align-items: center; justify-content: center; text-align: center; border: 1.5px dashed var(--line); color: var(--muted); font-weight: 600; }
.course-add-plus { font-size: 1.8rem; color: var(--orange); line-height: 1; }
.course-add:hover { border-color: var(--orange); }

.course-hero {
    display: grid; grid-template-columns: 1fr auto auto; gap: 26px; align-items: center;
    padding: 30px; margin-bottom: 26px;
    background: linear-gradient(135deg, var(--navy), #2E4170); color: #fff; border-radius: 20px;
}
.course-hero h2 { color: #fff; font-size: 1.35rem; margin-bottom: 6px; }
.course-hero p { color: #C6CFE3; margin: 0; line-height: 1.5; }
.course-hero-progress { min-width: 180px; }
.course-hero-progress .bar { background: #2A3550; }
.course-pct { font-family: var(--font-display); font-weight: 700; color: var(--amber); font-size: 1.3rem; margin-top: 8px; display: block; }
.course-hero-actions { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }

.module-list { display: flex; flex-direction: column; gap: 20px; }
.module-card { padding: 26px; }
.module-head { display: flex; justify-content: space-between; align-items: center; gap: 26px; margin-bottom: 6px; flex-wrap: wrap; }
.module-title { display: flex; gap: 16px; align-items: center; }
.module-title h2 { font-size: 1.15rem; color: var(--navy); }
.module-title p { margin: 2px 0 0; }
.module-progress { min-width: 180px; }
.module-meta { display: block; text-align: right; font-size: 0.85rem; color: var(--muted); margin-top: 6px; }
.module-actions { margin-top: 12px; }
.module-done { font-weight: 700; color: #1B7F4D; }

.lesson-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 30px; }
.lesson-nav a { text-decoration: none; padding: 20px 24px; display: flex; flex-direction: column; gap: 6px; transition: transform 0.15s, box-shadow 0.15s; }
.lesson-nav a:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.lesson-nav b { color: var(--navy); font-size: 0.98rem; line-height: 1.4; }
.lesson-nav-next { text-align: right; }
.lesson-nav .muted { font-size: 0.82rem; }

@media (max-width: 960px) {
    .course-grid, .course-strip { grid-template-columns: repeat(2, 1fr); }
    .course-hero { grid-template-columns: 1fr; }
}
.topic-card { padding: 30px; margin-bottom: 22px; }
.topic-card h2 { font-size: 1.2rem; color: var(--navy); margin-bottom: 12px; }
.topic-notes { color: #3A4560; line-height: 1.7; }

/* ===== Lesson content ===== */
.lesson-toc { padding: 24px 30px; margin-bottom: 22px; }
.lesson-toc h2 { font-size: 1.1rem; color: var(--navy); margin-bottom: 12px; }
.lesson-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.lesson-list a { color: var(--orange); text-decoration: none; font-weight: 600; }
.lesson-list a:hover { text-decoration: underline; }
.lesson-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 14px; border-radius: 12px; color: var(--navy); font-weight: 600; }
.lesson-row:hover { background: var(--pastel-blue); text-decoration: none !important; }
.lesson-state { font-weight: 600; font-size: 0.85rem; white-space: nowrap; }
.lesson-done-chip { color: #1B7F4D; }
.lesson-next-chip { background: var(--orange); color: #fff; padding: 4px 12px; border-radius: 999px; font-size: 0.78rem; }
.lesson-continue { margin-top: 18px; text-align: center; }
.lesson-study { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 22px; }
.lesson-content .lesson-body { color: #2A3550; }
.lesson-content form { margin: 24px 0 4px; }
.lesson-done { color: #1B7F4D; font-weight: 600; margin-top: 18px; }
.lesson-body h2, .lesson-body h3, .lesson-body h4 { color: var(--navy); margin: 26px 0 10px; }
.lesson-body h2:first-child { margin-top: 6px; }
.lesson-body p { line-height: 1.75; margin: 12px 0; }
.lesson-body ul, .lesson-body ol { margin: 12px 0 12px 22px; line-height: 1.75; }
.lesson-body li { margin: 6px 0; }
.lesson-body strong { color: var(--navy); }
.lesson-body blockquote {
    margin: 18px 0; padding: 16px 22px; background: var(--pastel-peach);
    border-left: 4px solid var(--orange); border-radius: 0 14px 14px 0;
    color: var(--navy); font-weight: 600;
}
.lesson-body table {
    width: 100%; border-collapse: collapse; margin: 18px 0;
    font-size: 0.92rem; background: #fff; border: 1px solid var(--line);
    border-radius: 14px; overflow: hidden;
}
.lesson-body th, .lesson-body td {
    text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.lesson-body th { background: var(--navy); color: #fff; font-weight: 600; }
.lesson-body tr:last-child td { border-bottom: none; }
.lesson-body img { max-width: 100%; border-radius: 16px; margin: 16px 0; }
.lesson-video {
    position: relative; padding-top: 56.25%; margin: 18px 0;
    border-radius: 16px; overflow: hidden; background: var(--navy);
}
.lesson-video iframe {
    position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}
.lesson-body code { background: var(--pastel-blue); padding: 2px 7px; border-radius: 7px; font-size: 0.88em; }
.lesson-body pre { background: var(--navy); color: #fff; padding: 18px 22px; border-radius: 14px; overflow-x: auto; margin: 16px 0; }
.lesson-body pre code { background: none; color: inherit; padding: 0; }
.katex-display { overflow-x: auto; overflow-y: hidden; padding: 2px 0; }
.question-text .katex, .option-text .katex, .explanation .katex, .lesson-body .katex { font-size: 1em; }

/* ===== Exemption ===== */
.wizard-form { padding: 30px; margin-top: 26px; }
.wizard-form h2 { font-size: 1.15rem; color: var(--navy); margin-bottom: 16px; }
.result-card { padding: 30px; margin-bottom: 26px; }
.result-card h2 { font-size: 1.3rem; color: var(--navy); margin-bottom: 8px; }
.result-head { font-size: 1.02rem; color: var(--navy); margin: 18px 0 10px; }
.result-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.result-list li { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; font-size: 0.95rem; color: var(--navy); }
.result-exempt li { background: var(--pastel-mint); border-color: #CFEEDB; }

/* ===== Dashboard ===== */
.dash-head { margin-bottom: 30px; }
.dash-top { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 36px; }
.dash-card { padding: 30px; }
.dash-card h2 { font-size: 1.1rem; color: var(--navy); margin-bottom: 18px; }

.flash-strip {
    display: flex; align-items: center; gap: 26px; padding: 24px 30px;
    background: linear-gradient(135deg, var(--navy), #2E4170);
    color: #fff; text-decoration: none; margin-bottom: 22px;
    border-radius: 20px; transition: transform 0.15s, box-shadow 0.15s;
}
.flash-strip:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.flash-deck { position: relative; width: 74px; height: 92px; flex-shrink: 0; }
.deck-card {
    position: absolute; inset: 0; border-radius: 12px;
    background: var(--pastel-mint); border: 1.5px solid #CFEEDB;
}
.deck-card:nth-child(1) { transform: translate(10px, 8px); background: var(--orange); border-color: #E85D2B; }
.deck-card:nth-child(2) { transform: translate(5px, 4px); background: #fff; }
.deck-card:nth-child(3) { background: var(--pastel-blue); border-color: #C9D6F2; }
.flash-strip-body { flex: 1; min-width: 0; }
.flash-strip-body .eyebrow { color: var(--amber); }
.flash-strip-body h2 { font-size: 1.35rem; margin: 4px 0 6px; color: #fff; }
.flash-strip-body p { color: #C6CFE3; margin: 0; line-height: 1.5; }
.flash-strip .btn { flex-shrink: 0; }
.score-ring.big { width: 180px; height: 180px; }
.score-ring.big::before { width: 150px; height: 150px; }
.dash-section { margin-bottom: 40px; }
.dash-bar { margin: 10px 0 6px; }
.subject-score { font-weight: 600; color: var(--orange); }
.weak-list { display: flex; flex-direction: column; gap: 12px; }
.weak-item { display: flex; justify-content: space-between; align-items: center; padding: 16px 22px; }
.weak-name { font-weight: 600; color: var(--navy); }
.weak-score { font-family: var(--font-display); font-weight: 700; color: var(--orange); }
.attempt-table-wrap { padding: 10px 20px; overflow-x: auto; }
.attempt-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.attempt-table th, .attempt-table td { text-align: left; padding: 13px 8px; border-bottom: 1px solid var(--line); }
.attempt-table th { color: var(--muted); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.5px; }
.attempt-table a { color: var(--orange); text-decoration: none; font-weight: 600; }
.view-all { font-size: 0.85rem; font-weight: 600; color: var(--orange); text-decoration: none; margin-left: 8px; }
.view-all:hover { text-decoration: underline; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 24px; }
.page-link { padding: 10px 20px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; color: var(--navy); text-decoration: none; font-weight: 600; font-size: 0.9rem; transition: border-color 0.15s, box-shadow 0.15s; }
.page-link:hover { border-color: var(--orange); box-shadow: var(--shadow-sm); }
.page-link.is-disabled { opacity: 0.45; pointer-events: none; }
.page-count { color: var(--muted); font-size: 0.88rem; }

/* ===== Pricing ===== */
.tier-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.tier-card { padding: 30px; display: flex; flex-direction: column; gap: 8px; }
.tier-featured { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255,107,53,0.15), var(--shadow); transform: scale(1.03); }
.tier-name { font-family: var(--font-display); font-weight: 700; color: var(--navy); }
.tier-price { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--navy); }
.tier-per { color: var(--muted); font-size: 0.85rem; }
.tier-features { list-style: none; margin: 12px 0 18px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.tier-features li { font-size: 0.9rem; color: #3A4560; }
.tier-card form { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.tier-select { width: 100%; font-size: 0.9rem; padding: 10px 12px; border: 1px solid var(--line, #E3E7F0); border-radius: 8px; background: #fff; color: var(--navy); }
.tier-select-label { font-weight: 600; font-size: 0.82rem; color: var(--muted); }

/* ===== Locked modal ===== */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(9, 22, 44, 0.55); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { position: relative; max-width: 460px; width: 100%; padding: 34px; text-align: center; border-radius: 16px; }
.modal h2 { color: var(--navy); margin: 4px 0 8px; }
.modal p { color: #3A4560; font-size: 0.95rem; line-height: 1.6; }
.modal .btn { margin-top: 14px; }
.modal-alt { margin-top: 14px; font-size: 0.88rem; }
.modal-alt a { color: var(--muted); text-decoration: none; font-weight: 600; }
.modal-alt a:hover { color: var(--orange); }
.modal-close { position: absolute; top: 14px; right: 18px; font-size: 1.6rem; line-height: 1; color: var(--muted); text-decoration: none; }
.modal-close:hover { color: var(--orange); }

/* ===== Cohorts ===== */

/* ===== Auth ===== */
.auth-page { background: var(--paper); display: flex; align-items: flex-start; }
.auth-card-wrap { max-width: 460px; }
.auth-card { padding: 36px; }
.auth-card h1 { font-size: 1.6rem; color: var(--navy); margin-bottom: 6px; }
.auth-form { display: flex; flex-direction: column; gap: 8px; margin-top: 22px; }
.auth-form label { font-weight: 600; font-size: 0.88rem; color: var(--navy); margin-top: 8px; }
.auth-form .select-wrap { margin-bottom: 6px; }
.auth-form .btn { margin-top: 18px; }
.auth-switch { text-align: center; margin-top: 20px; font-size: 0.9rem; color: var(--muted); }
.auth-switch a { color: var(--orange); text-decoration: none; font-weight: 600; }

/* ===== Flashcards ===== */
.flash-wrap { display: flex; flex-direction: column; align-items: stretch; gap: 14px; margin-top: 22px; }
.flash-reveal {
    padding: 16px; border-radius: 16px; border: 1.5px dashed var(--orange);
    background: var(--pastel-peach); color: var(--orange); font-weight: 700;
    font-size: 1rem; cursor: pointer; transition: transform 0.15s;
}
.flash-reveal:hover { transform: translateY(-2px); }
.flash-back {
    display: none; padding: 22px; border-radius: 16px;
    background: var(--pastel-mint); border: 1.5px solid #CFEEDB;
}
.flash-back p { color: var(--navy); font-size: 1.05rem; line-height: 1.6; }
.flash-answer p:first-child { margin-top: 0; }
.flash-answer p:last-child { margin-bottom: 0; }
.flash-back.show { display: block; }
.flash-actions, .flash-rate { display: none; flex-wrap: wrap; gap: 12px; }
.flash-actions.show, .flash-rate.show { display: flex; }
.flash-rate .btn { flex: 1; min-width: 90px; }
.flash-front { padding: 10px 0 4px; }
.flash-done { text-align: center; padding: 56px 30px; }
.flash-done h1 { font-family: var(--font-display); font-size: clamp(1.8rem, 3.2vw, 2.4rem); color: var(--navy); margin-bottom: 14px; }
.flash-done p { color: var(--muted); max-width: 520px; margin: 0 auto 26px; line-height: 1.6; }
.flash-done-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ===== Profile ===== */
.avatar {
    width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--orange), var(--amber));
    color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 1rem;
    text-decoration: none; box-shadow: var(--shadow-sm);
}
.avatar-lg { width: 64px; height: 64px; font-size: 1.6rem; }
.profile-head { display: flex; align-items: center; gap: 20px; }
.profile-head h1 { margin: 0 0 4px; }
.profile-form { margin-top: 6px; }
.profile-courses { list-style: none; display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.profile-courses a { color: var(--navy); font-weight: 600; text-decoration: none; }
.profile-courses a:hover { color: var(--orange); }
.dash-card h2 + h2 { margin-top: 22px; }
.plan-row { display: flex; flex-direction: column; gap: 8px; }
.plan-chip { background: var(--orange); color: #fff; padding: 4px 12px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; }
.plan-subhead { font-size: 0.9rem; color: var(--navy); margin: 16px 0 8px; }
.plan-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.plan-list li { font-size: 0.9rem; color: #3A4560; }
.plan-list li::before { content: "✓ "; color: var(--orange); }
.plan-upgrade { margin-top: 16px; font-size: 0.9rem; }
.profile-page .dash-card + .dash-card { margin-top: 24px; }

/* ===== Blog ===== */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.blog-card { overflow: hidden; text-decoration: none; transition: transform 0.15s, box-shadow 0.15s; }
.blog-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.blog-card:hover .blog-title { color: var(--orange); }
.blog-cover { aspect-ratio: 16 / 9; overflow: hidden; background: var(--line); }
.blog-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blog-cover-fallback { display: grid; place-items: center; background: linear-gradient(135deg, var(--navy), #2A3550); }
.blog-cover-letter { font-family: var(--font-display); font-weight: 700; font-size: 3rem; color: var(--orange); }
.blog-body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 10px; }
.blog-meta { display: flex; align-items: center; gap: 12px; }
.blog-meta-text { color: var(--muted); font-size: 0.84rem; }
.blog-title { font-size: 1.18rem; line-height: 1.35; color: var(--navy); transition: color 0.15s; }
.blog-excerpt { color: var(--muted); font-size: 0.93rem; line-height: 1.6; margin: 0; }
.blog-read { color: var(--orange); font-weight: 600; font-size: 0.9rem; margin-top: auto; padding-top: 4px; }

.article { padding: clamp(28px, 5vw, 56px); max-width: 760px; margin: 0 auto; }
.article-head { text-align: center; margin-bottom: 30px; }
.article-back { display: inline-block; color: var(--muted); font-size: 0.88rem; text-decoration: none; margin-bottom: 18px; }
.article-back:hover { color: var(--orange); }
.article-head h1 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); color: var(--navy); line-height: 1.2; margin: 12px 0 14px; }
.article-meta { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.article-cover { border-radius: 16px; overflow: hidden; margin-bottom: 28px; }
.article-cover img { width: 100%; display: block; }

.keep-reading { max-width: 900px; margin: 44px auto 0; }
.keep-reading-title { font-size: 1.3rem; color: var(--navy); margin-bottom: 18px; }

/* ===== About ===== */
.about-story { max-width: 760px; margin: 0 auto 22px; padding: clamp(28px, 5vw, 48px); }
.about-story-body h2 { font-size: 1.45rem; color: var(--navy); margin-bottom: 14px; }
.about-story-body p { color: var(--ink); line-height: 1.8; margin: 12px 0; }
.about-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; max-width: 1000px; margin: 34px auto; }
.about-card { padding: 28px; display: flex; flex-direction: column; gap: 10px; }
.about-num { font-family: var(--font-display); font-weight: 700; font-size: 0.9rem; letter-spacing: 0.06em; color: var(--orange); }
.about-card h3 { font-size: 1.08rem; color: var(--navy); }
.about-card p { color: var(--muted); font-size: 0.93rem; line-height: 1.65; margin: 0; }
.about-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.about-list li { color: var(--ink); line-height: 1.7; padding-left: 22px; position: relative; }
.about-list li::before { content: ""; position: absolute; left: 0; top: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--orange); }
.about-cta { max-width: 760px; margin: 34px auto 0; padding: clamp(28px, 5vw, 44px); text-align: center; background: linear-gradient(135deg, var(--navy), #2A3550); border-color: var(--navy); }
.about-cta h2 { color: #fff; font-size: 1.5rem; margin: 0 0 10px; }
.about-cta p { color: #C7CFE3; margin: 0 auto 22px; max-width: 460px; }
.about-cta-actions { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }

/* ===== Contact ===== */
.contact-form-wrap { max-width: 640px; margin: 0 auto; padding: 32px; }
.contact-form { display: flex; flex-direction: column; gap: 18px; }
.contact-field { display: flex; flex-direction: column; gap: 7px; }
.contact-field label { font-size: 0.88rem; font-weight: 600; color: var(--navy); }
.contact-field input, .contact-field textarea { width: 100%; padding: 14px 18px; border-radius: 14px; border: 1.5px solid var(--line); font-family: var(--font-body); font-size: 0.96rem; background: #fff; color: var(--ink); }
.contact-field input:focus, .contact-field textarea:focus { outline: none; border-color: var(--orange); }
.contact-field textarea { resize: vertical; min-height: 140px; }
.contact-field .errorlist { list-style: none; margin: 0; padding: 0; color: #C0392B; font-size: 0.84rem; }
.contact-form .btn { align-self: flex-start; }

/* ===== Responsive ===== */
@media (max-width: 960px) {
    .blog-grid { grid-template-columns: repeat(2, 1fr); }
    .about-grid { grid-template-columns: repeat(2, 1fr); }
    .mode-grid, .report-grid, .subjects-grid, .dash-top, .score-grid { grid-template-columns: 1fr 1fr; }
    .tier-grid { grid-template-columns: repeat(2, 1fr); }
    .tier-featured { transform: none; }
    .course-grid, .course-strip { grid-template-columns: repeat(2, 1fr); }
    .course-hero { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .blog-grid { grid-template-columns: 1fr; }
    .about-grid { grid-template-columns: 1fr; }
    .level-grid { grid-template-columns: 1fr; }
    .course-grid, .course-strip { grid-template-columns: 1fr; }
    .lesson-nav { grid-template-columns: 1fr; }
    .module-head { flex-direction: column; align-items: flex-start; }
    .flash-strip { flex-wrap: wrap; }
    .flash-strip .btn { width: 100%; text-align: center; }
    .mode-grid, .report-grid, .subjects-grid, .dash-top, .score-grid { grid-template-columns: 1fr; }
    .tier-grid { grid-template-columns: 1fr; }
    .level-chip { padding: 12px 16px; }
    .level-name { font-size: 0.92rem; }
    .quiz-nav { flex-direction: column; align-items: stretch; }
    .quiz-nav .btn { text-align: center; }
    .page { padding: 48px 0 110px; }
}
