/* ========================================

   RESET

======================================== */



* {

    margin: 0;

    padding: 0;

    box-sizing: border-box;

}





/* ========================================

   BASE

======================================== */





/* ========================================

   HEADER

======================================== */



/* =========================================

   HEADER

   ========================================= */



header {

    height: 58px;



    display: flex;

    align-items: center;

    justify-content: space-between;



    padding: 0 6%;



    background: #f0f1f7;

    border-bottom: 1px solid #e1e2e8;

}



.logo {

    color: #252525;

    text-decoration: none;



    font-size: 1.05rem;

    font-weight: 700;

}



.header-right {

    display: flex;

    align-items: center;

    gap: 18px;

}



.chapter-info {

    font-size: 0.78rem;

    color: #666b78;

}



.theme-button {

    width: 30px;

    height: 30px;



    display: flex;

    align-items: center;

    justify-content: center;



    padding: 0;



    background: #ffffff;

    border: 1px solid #d9dbe2;

    border-radius: 7px;



    cursor: pointer;



    font-size: 0.85rem;

}





/* ========================================

   BUTTONS

======================================== */



button {

    font-size: 1rem;



    padding: 12px 20px;



    border-radius: 8px;



    cursor: pointer;

}

















/* =========================================

   MATHLUCID — LESSON DESIGN SYSTEM V1

   ========================================= */



:root {

    --page-bg: #f7f7f3;

    --text: #303030;

    --heading: #30358c;

    --muted: #666666;



    --accent: #4f46e5;



    --idea-bg: #eef0ff;

    --idea-border: #d9ddff;

    --idea-accent: #4f46e5;



    --example-bg: #f0faf3;

    --example-border: #d8efdf;

    --example-accent: #18804a;



    --why-bg: #fff7ed;

    --why-border: #f5dfc3;

    --why-accent: #c96a16;



    --border: #e3e3df;

    --white: #ffffff;

}





/* =========================================

   PAGE

   ========================================= */



body {

    background: var(--page-bg);

    color: var(--text);

    font-family: Georgia, "Times New Roman", serif;

}



.lesson-page {

    min-height: calc(100vh - 70px);

    padding: 0 0 60px;

}



.lesson-content>.key-idea,

.lesson-content>.example-box,

.lesson-content>.transition-box,

.lesson-content>.takeaway,

.lesson-content>.explore-box {

    width: 100%;

    max-width: 750px;

    margin-left: auto;

    margin-right: auto;

}



.lesson-content {

    width: 90%;

    max-width: 900px;

    margin: 0 auto;

    padding-top: 38px;

}





/* =========================================

   LESSON PROGRESS / BREADCRUMB

   ========================================= */



.lesson-progress {

    display: flex;

    justify-content: space-between;

    align-items: center;



    margin-bottom: 42px;



    font-size: 0.82rem;

    color: var(--muted);

}



.chapter-back {

    color: #555;

    text-decoration: none;



    transition: color 0.2s ease;

}



.chapter-back:hover {

    color: var(--heading);

}





/* =========================================

   LESSON INTRODUCTION

   ========================================= */



.lesson-introduction {

    text-align: center;

    margin-bottom: 42px;

}



.chapter-label {

    margin-bottom: 10px;



    font-size: 0.7rem;

    font-weight: 700;

    letter-spacing: 0.15em;



    color: var(--accent);

}



.lesson-introduction h1 {

    margin: 0;



    font-size: clamp(2rem, 4vw, 3rem);

    line-height: 1.15;

    font-weight: 700;



    color: var(--heading);

}



/* =========================================

   SIMPLE VISUAL EXAMPLES

   ========================================= */



.visual-example {

    margin: 22px 0;



    font-size: 2rem;

    letter-spacing: 0.15em;

}



.quantity-examples {

    margin: 28px auto 0;

}



.quantity-examples p {

    margin-bottom: 14px !important;

}



/* =========================================

   NORMAL CONTENT

   ========================================= */



.lesson-section,

.lesson-connection,

.main-idea {

    max-width: 820px;

    margin: 0 auto 30px;



    text-align: center;

}



.lesson-section p,

.lesson-connection p,

.main-idea p {

    margin-bottom: 16px;



    font-size: 1rem;

    line-height: 1.7;



    color: var(--text);

}



.lesson-section strong,

.lesson-connection strong {

    color: #222;

}





/* =========================================

   QUESTIONS

   ========================================= */



.lesson-question {

    max-width: 760px;

    margin: 24px auto;



    padding: 18px 24px;



    background: var(--idea-bg);

    border-radius: 12px;



    font-size: clamp(1.25rem, 3vw, 1.65rem);

    line-height: 1.4;

    font-weight: 600;



    color: var(--accent);

}





/* =========================================

   KEY IDEA

   ========================================= */



.key-idea {

    max-width: 820px;

    margin: 0 auto 38px;



    padding: 28px 32px;



    text-align: center;



    background: var(--idea-bg);



    border: 1px solid var(--idea-border);

    border-left: 4px solid var(--idea-accent);



    border-radius: 14px;

}





.key-idea-label {

    margin-bottom: 12px;



    font-size: 0.7rem;

    font-weight: 700;

    letter-spacing: 0.14em;



    color: var(--idea-accent);

}



.key-idea h2 {

    margin-bottom: 16px;



    font-size: clamp(1.3rem, 3vw, 1.8rem);

    line-height: 1.4;



    color: #242424;

}



.key-idea p {

    margin: 0;



    font-size: 0.98rem;

    line-height: 1.65;



    color: #4d4d4d;

}





/* =========================================

   EXAMPLE

   ========================================= */



.example-box {

    max-width: 820px;

    margin: 0 auto 38px;



    padding: 25px 32px;



    text-align: center;



    background: var(--example-bg);



    border: 1px solid var(--example-border);

    border-left: 4px solid var(--example-accent);



    border-radius: 14px;

}



.example-label {

    margin-bottom: 14px;



    font-size: 0.7rem;

    font-weight: 700;

    letter-spacing: 0.14em;



    color: var(--example-accent);

}



.example-box p {

    margin-bottom: 14px;



    font-size: 0.98rem;

    line-height: 1.65;



    color: #4d4d4d;

}





/* =========================================

   MATHEMATICAL EXPRESSIONS

   ========================================= */



.number-answer {

    margin: 20px auto;



    font-size: clamp(1.55rem, 4vw, 2.0rem);

    line-height: 1.45;

    font-weight: 600;



    color: #222;

}



.math-highlight {

    color: var(--accent);

}





/* =========================================

   EXPLORE / DETAILS

   ========================================= */



.explore-box {

    max-width: 820px;

    margin: 0 auto 38px;



    background: #ffffff;



    border: 1px solid var(--border);

    border-left: 4px solid var(--why-accent);



    border-radius: 14px;



    overflow: hidden;

}



.explore-box summary {

    cursor: pointer;



    padding: 17px 22px;



    font-size: 0.95rem;

    font-weight: 600;



    color: #444;



    list-style: none;

}



.explore-box summary::-webkit-details-marker {

    display: none;

}



.explore-box summary::after {

    content: "+";



    float: right;



    font-size: 1.1rem;

    font-weight: 400;



    color: var(--why-accent);

}



.explore-box[open] summary::after {

    content: "−";

}



.explore-box summary:hover {

    background: var(--why-bg);

}



.explore-content {

    padding: 0 24px 22px;



    border-top: 1px solid #eeeeee;

}



.explore-content p {

    margin-top: 18px;



    font-size: 0.98rem;

    line-height: 1.7;



    color: #555;

}





/* =========================================

   TAKEAWAY

   ========================================= */



.takeaway {

    max-width: 820px;

    margin: 0 auto 38px;



    padding: 24px 30px;



    text-align: center;



    background: var(--why-bg);



    border: 1px solid var(--why-border);

    border-left: 4px solid var(--why-accent);



    border-radius: 14px;

}



.takeaway-label {

    margin-bottom: 12px;



    font-size: 0.7rem;

    font-weight: 700;

    letter-spacing: 0.14em;



    color: var(--why-accent);

}



.takeaway p {

    margin: 0;



    font-size: 1rem;

    line-height: 1.65;



    color: #444;

}





/* =========================================

   CONNECTION

   ========================================= */



.connection-label {

    margin-bottom: 12px !important;



    font-size: 0.7rem !important;

    font-weight: 700;



    letter-spacing: 0.14em;



    color: var(--why-accent) !important;

}





/* =========================================

   NAVIGATION

   ========================================= */



.lesson-navigation {

    display: flex;

    justify-content: space-between;

    align-items: center;



    max-width: 820px;



    margin: 55px auto 0;

}



.nav-button {

    display: inline-flex;

    align-items: center;



    padding: 9px 15px;



    font-size: 0.88rem;

    text-decoration: none;



    color: #444;



    background: #ffffff;



    border: 1px solid #dcdcdc;

    border-radius: 8px;



    transition:

        background-color 0.2s ease,

        color 0.2s ease,

        border-color 0.2s ease;

}



.nav-button:hover {

    background: #f1f1ed;

    border-color: #cfcfcf;

    color: var(--heading);

}





/* =========================================

   FOOTER

   ========================================= */



.minimal-footer {

    padding: 22px 20px;



    text-align: center;



    font-size: 0.74rem;



    color: #777;



    background: #ffffff;



    border-top: 1px solid #e5e5e5;

}

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

.footer-links a {
    color: var(--muted);
    text-decoration: none;
    font-size: .8rem
}

.footer-links a:hover {
    color: var(--heading)
}




/* =========================================

   DARK MODE

   ========================================= */



body.dark {

    --page-bg: #121417;

    --text: #d4d6da;

    --heading: #b8bcff;

    --muted: #9297a2;



    --idea-bg: #1c2040;

    --idea-border: #30365f;

    --idea-accent: #9da3ff;



    --example-bg: #17231b;

    --example-border: #294633;

    --example-accent: #72d39b;



    --why-bg: #2a2118;

    --why-border: #4c3825;

    --why-accent: #f0a15b;



    --border: #30343b;

}



body.dark header {

    background: #181b20;

    border-color: #2a2e35;

}



body.dark .logo {

    color: #f0f1f3;

}



body.dark .chapter-info {

    color: #a7acb5;

}



body.dark .chapter-back {

    color: #b4b8c0;

}



body.dark .chapter-back:hover {

    color: var(--heading);

}



body.dark .lesson-section strong,

body.dark .lesson-connection strong {

    color: #eeeeee;

}



body.dark .key-idea h2 {

    color: #eeeeee;

}



body.dark .key-idea p,

body.dark .example-box p {

    color: #c5c8ce;

}



body.dark .number-answer {

    color: #eeeeee;

}



body.dark .explore-box {

    background: #181b20;

    border-color: #30343b;

}



body.dark .explore-box summary {

    color: #d5d7dc;

}



body.dark .explore-box summary:hover {

    background: #2a2118;

}



body.dark .explore-content {

    border-color: #30343b;

}



body.dark .explore-content p,

body.dark .takeaway p {

    color: #c5c8ce;

}



body.dark .nav-button {

    color: #d2d5da;

    background: #181b20;

    border-color: #353940;

}



body.dark .nav-button:hover {

    background: #23272d;

    color: #b8bcff;

}



body.dark .minimal-footer {

    background: #181b20;

    border-color: #2a2e35;

    color: #8f949d;

}



body.dark .visual-example {

    filter: brightness(0.95);

}







/* =========================================

   MOBILE

   ========================================= */



@media (max-width: 768px) {



    .lesson-content {

        width: 92%;

        padding-top: 25px;

    }



    .lesson-progress {

        margin-bottom: 32px;

    }



    .lesson-introduction {

        margin-bottom: 34px;

    }



    .lesson-section,

    .lesson-connection,

    .main-idea {

        margin-bottom: 34px;

    }



    .key-idea,

    .example-box,

    .takeaway {

        padding: 22px 20px;

        margin-bottom: 34px;

    }



    .explore-content {

        padding-left: 20px;

        padding-right: 20px;

    }



    .lesson-question {

        padding: 17px 18px;

    }



    .lesson-navigation {

        margin-top: 45px;

    }

}



/* =========================================

   NATURAL NUMBERS

   ========================================= */



.math-display {

    margin: 28px 0;

    font-size: 1.55rem;

    font-weight: 500;

}



.counting-examples {

    margin: 24px 0;

}



.counting-examples p {

    margin-bottom: 10px !important;

}





/* Transition toward the next concept */



.transition-box {

    margin: 38px auto;

    padding: 28px 30px;

    width: 100%;

    max-width: 750px;

    background: #fff7ed;



    border: 1px solid #f2dfc8;

    border-left: 3px solid #e67e22;



    border-radius: 10px;



    text-align: center;

}



.transition-label {

    margin-bottom: 14px !important;



    font-family: Arial, sans-serif;

    font-size: 0.72rem;

    font-weight: 700;

    letter-spacing: 0.18em;



    color: #d96d00;

}



.transition-box h2 {

    margin-top: 12px;



    font-size: 1.3rem;

}





/* Dark mode */



body.dark .transition-box {

    background: #2a2119;

    border-color: #4c3825;

}



body.dark .transition-label {

    color: #f0a15b;

}



body.dark .transition-box h2 {

    color: #f0f1f3;

}



/* =========================================

   ZERO PAGE

   ========================================= */



.question-mark {

    margin-top: 24px;

    font-size: 2.4rem;

}



.zero-answer {

    margin-bottom: 18px;

    color: #34358f;

    font-size: 2.2rem;

}



body.dark .zero-answer {

    color: #aeb3ff;

}



/* =========================================

   NUMBER LINE

   ========================================= */



.number-line {

    position: relative;



    width: 100%;

    max-width: 650px;



    margin: 38px auto;

    margin-bottom: 58px;



    display: flex;

    justify-content: space-between;

    align-items: center;



    padding: 20px 10px;

}



.number-line-track {

    position: absolute;



    left: 10px;

    right: 10px;

    top: 50%;



    height: 2px;



    background: #b8bac2;

}



.number-line-point {

    position: relative;

    z-index: 1;



    width: 42px;

    height: 42px;



    display: flex;

    align-items: center;

    justify-content: center;



    background: #f7f7f3;



    border: 2px solid #8d9099;

    border-radius: 50%;

}



.number-line-point span {

    position: absolute;

    top: 48px;



    white-space: nowrap;



    font-size: 1rem;

}



.number-line-point.active {

    background: #4b4ee8;

    border-color: #4b4ee8;

}



.number-line-point.active span {

    font-weight: 700;

    color: #34358f;

}



.subheading {

    margin: 20px 0;

    font-size: 1.4rem;

}



.transition-equation {

    margin-top: 22px;



    font-size: 1.6rem;

    font-weight: 600;

    color: #4b4ee8;

}





/* Dark mode */



body.dark .number-line-track {

    background: #5b606a;

}



body.dark .number-line-point {

    background: #15171b;

    border-color: #686d77;

}



body.dark .number-line-point.active {

    background: #5559e8;

    border-color: #5559e8;

}



body.dark .number-line-point.active span {

    color: #aeb3ff;

}



body.dark .transition-equation {

    color: #aeb3ff;

}



/* =========================================

   REAL NUMBERS

   ========================================= */



.number-group {

    margin-top: 34px;

    text-align: center;

}



.number-group h2 {

    margin-bottom: 12px;

}



.number-group p {

    margin-bottom: 14px;

}



.group-examples {

    margin-top: 16px;

}





/* =========================================

   NUMBER SYSTEM HIERARCHY

   ========================================= */



.number-system-map {

    margin-top: 48px;

    text-align: center;

}



.map-label {

    margin-bottom: 16px;



    font-size: 0.78rem;

    font-weight: 600;

    letter-spacing: 0.22em;



    color: #666;

}



.hierarchy-diagram {

    width: 100%;

    max-width: 750px;



    margin: 0 auto;



    padding: 28px 24px 30px;



    border: 1px solid #6b7fd7;

    border-radius: 14px;



    background: #fafaff;

}



.real-number-title {

    margin-bottom: 28px;



    color: #30439a;



    font-size: 1.45rem;

}



.hierarchy-columns {

    display: grid;



    grid-template-columns: 1.35fr 0.9fr;



    gap: 28px;



    align-items: start;

}





/* Rational → Integer → Whole */



.rational-column {

    display: flex;

    flex-direction: column;

    align-items: center;

}



.hierarchy-box {

    width: 100%;



    padding: 17px 16px;



    border-radius: 9px;



    background: #ffffff;



    text-align: center;

}



.hierarchy-box h3 {

    margin-bottom: 9px;



    font-size: 1.12rem;

}



.hierarchy-box p {

    margin: 0;



    font-size: 0.92rem;

}





.rational-box {

    border: 1px solid #e85b5b;

}



.rational-box h3 {

    color: #d73737;

}





.integer-box {

    width: 72%;



    border: 1px solid #8a5bd1;

}



.integer-box h3 {

    color: #7040ad;

}





.whole-box {

    width: 55%;



    border: 1px solid #38558f;

}



.whole-box h3 {

    color: #29447d;

}





.irrational-box {

    min-height: 112px;



    border: 1px solid #35a968;



    display: flex;

    flex-direction: column;

    justify-content: center;

}



.irrational-box h3 {

    color: #15944f;

}





/* Connecting lines */



.hierarchy-line {

    width: 1px;

    height: 21px;



    background: #999;

}





/* Explanation */



.map-explanation {

    margin-top: 14px;



    font-size: 0.9rem;

    color: #555;

}





/* =========================================

   MOBILE

   ========================================= */



@media (max-width: 768px) {



    .number-group {

        margin-top: 30px;

    }



    .number-system-map {

        margin-top: 40px;

    }



    .hierarchy-diagram {
        
        padding: 24px 14px 26px;

    }



    .hierarchy-columns {

        grid-template-columns: 1fr;

        gap: 22px;

    }



    .integer-box {

        width: 78%;

    }



    .whole-box {

        width: 62%;

    }



    .irrational-box {

        min-height: 100px;

    }



}



/* =========================

   PATTERN RULE

========================= */



.pattern-rule {

    display: flex;

    justify-content: center;

    align-items: center;

    gap: 35px;



    margin: 25px auto 10px;



    font-size: 1.15rem;

    font-weight: 600;

}



.pattern-rule span {

    white-space: nowrap;

}



@media (max-width: 768px) {



    .pattern-rule {

        flex-direction: column;

        gap: 12px;

    }



    .journey-complete {

        padding: 30px 22px;

    }



}



.journey-complete {

    width: 100%;

    max-width: 750px;

    margin: 45px auto 20px;

    padding: 22px 30px;



    text-align: center;



    background: #f0f9f2;

    border: 1px solid #b9dfc0;

    border-left: 3px solid #299447;

    border-radius: 10px;

}



.journey-complete p {

    margin: 0;



    font-size: 1.05rem;

    line-height: 1.6;

    font-weight: 600;



    color: #26783b;

}



body.dark .journey-complete {

    background: #17241b;

    border-color: #285c35;

    border-left-color: #4caf68;

}



body.dark .journey-complete p {

    color: #8bcf9a;

}





/* =========================================================

   NUMBER SYSTEMS LANDING PAGE

   ========================================================= */



.number-systems-home {

    width: 84%;

    max-width: 900px;

    margin: 0 auto;

    padding: 35px 0 70px;

}





/* ---------------------------------------------------------

   Top navigation

   --------------------------------------------------------- */



.chapter-home-top {

    margin-bottom: 55px;

}



.chapter-back {

    color: #666;

    text-decoration: none;

    font-size: 0.85rem;

}



.chapter-back:hover {

    color: #444;

}





/* ---------------------------------------------------------

   Introduction

   --------------------------------------------------------- */



.chapter-home-intro {

    text-align: center;

    max-width: 760px;

    margin: 0 auto 45px;

}



.chapter-home-intro .chapter-label {

    margin-bottom: 12px;

}



.chapter-home-intro h1 {

    font-size: clamp(1.8rem, 3.5vw, 2.5rem);

    line-height: 1.2;

    color: #30358f;

    margin-bottom: 18px;

}



.chapter-description {

    font-size: 1.05rem;

    color: #555;

    line-height: 1.7;

}





/* ---------------------------------------------------------

   Action cards

   --------------------------------------------------------- */



.chapter-actions {

    display: grid;

    grid-template-columns: repeat(3, 1fr);

    gap: 15px;

    margin-bottom: 65px;

}



.chapter-action {

    position: relative;



    display: flex;

    flex-direction: column;



    padding: 24px 22px;



    min-height: 145px;



    background: #fff;



    border: 1px solid #ddd;

    border-radius: 10px;



    color: #222;

    text-decoration: none;



    transition:

        transform 0.15s ease,

        border-color 0.15s ease,

        box-shadow 0.15s ease;

}



.chapter-action:hover {

    transform: translateY(-2px);

    border-color: #bbb;



    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.06);

}



.primary-action {

    background: #222;

    border-color: #222;

    color: #fff;

}



.primary-action:hover {

    border-color: #222;

}



.action-title {

    font-size: 1.15rem;

    font-weight: 600;

    margin-bottom: 8px;

}



.action-description {

    font-size: 0.9rem;

    line-height: 1.5;

    color: #777;

}



.primary-action .action-description {

    color: #ddd;

}



.action-arrow {

    margin-top: auto;

    padding-top: 18px;



    font-size: 1rem;

}





/* ---------------------------------------------------------

   Learning path

   --------------------------------------------------------- */



.learning-path {

    margin-bottom: 45px;

}



.learning-path-heading {

    display: flex;

    justify-content: space-between;

    align-items: end;



    margin-bottom: 18px;

}



.section-label {

    margin-bottom: 7px;



    font-size: 0.72rem;

    letter-spacing: 0.18em;

    color: #777;

}



.learning-path-heading h2 {

    font-size: 1.45rem;

}









/* ---------------------------------------------------------

   Lesson list

   --------------------------------------------------------- */



.lesson-list {

    border-top: 1px solid var(--border);

}



.lesson-list-item {

    display: grid;

    grid-template-columns: 45px 1fr 30px;

    align-items: center;



    padding: 15px 8px;



    border-bottom: 1px solid var(--border);



    color: var(--text);

    text-decoration: none;



    transition: background 0.15s ease;

}



.lesson-list-item:hover {

    background: #fafafa;

}



.lesson-number {

    font-size: 0.75rem;

    color: #888;

}



.lesson-title {

    font-size: 0.95rem;

    color: var(--text);

}



.lesson-arrow {

    text-align: right;

    color: #888;

}





/* ---------------------------------------------------------

   Completion

   --------------------------------------------------------- */

















/* ---------------------------------------------------------

   Dark mode

   --------------------------------------------------------- */

body.dark .hierarchy-diagram {

    background: var(--page-bg);

}


body.dark .number-systems-home {

    color: #eee;

}



body.dark .chapter-back {

    color: #aaa;

}



body.dark .chapter-back:hover {

    color: #ddd;

}



body.dark .chapter-home-intro h1 {

    color: #aeb3ff;

}



body.dark .chapter-description {

    color: #aaa;

}



body.dark .chapter-action {

    background: #181b1f;

    border-color: #30343a;

    color: #eee;

}



body.dark .chapter-action:hover {

    border-color: #4a4f58;

    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.25);

}



body.dark .primary-action {

    background: #f1f1f1;

    border-color: #f1f1f1;

    color: #222;

}



body.dark .primary-action .action-description {

    color: #555;

}



body.dark .section-label {

    color: #999;

}



body.dark .lesson-list {

    border-color: #30343a;

}





body.dark .lesson-list-item {

    border-color: #30343a;

    color: #eee;

}



body.dark .lesson-list-item:hover {

    background: #181b1f;

}



body.dark .lesson-number,

body.dark .lesson-arrow {

    color: #888;

}





















/* ---------------------------------------------------------

   Mobile

   --------------------------------------------------------- */



@media (max-width: 768px) {



    .number-systems-home {

        width: 90%;

        padding: 25px 0 50px;

    }



    .chapter-home-top {

        margin-bottom: 40px;

    }



    .chapter-home-intro {

        margin-bottom: 35px;

    }



    .chapter-home-intro h1 {

        font-size: 2rem;

    }



    .chapter-description {

        font-size: 0.95rem;

    }



    .chapter-actions {

        grid-template-columns: 1fr;

        gap: 10px;

        margin-bottom: 50px;

    }



    .chapter-action {

        min-height: 120px;

    }



    .learning-path-heading {

        align-items: start;

        gap: 15px;

    }







    .lesson-list-item {

        grid-template-columns: 35px 1fr 25px;

        padding: 14px 4px;

    }



    .lesson-title {

        font-size: 0.9rem;

        line-height: 1.4;

    }



}

/* =========================================================
   DARK MODE — COMPLETION BOXES
   ========================================================= */

body.dark .journey-complete {
    background: #17241b;
    border-color: #285c35;
    border-left-color: #4caf68;
}

body.dark .journey-complete p {
    color: #8bcf9a;
}








/* =========================================================
   QUICK REVISION PAGE
========================================================= */

.revision-page {
    min-height: calc(100vh - 70px);
    padding-bottom: 70px;
}

.revision-content {
    width: 84%;
    max-width: 750px;
    margin: 0 auto;
    padding-top: 40px;
}


/* ---------------------------------------------------------
   Introduction
--------------------------------------------------------- */

.revision-introduction {
    text-align: center;
    margin-bottom: 50px;
}

.revision-introduction .chapter-label {
    margin-bottom: 12px;
}

.revision-introduction h1 {
    margin-bottom: 15px;

    font-size: clamp(2rem, 4vw, 2.7rem);
    line-height: 1.2;

    color: var(--heading);
}

.revision-introduction>p:last-child {
    max-width: 600px;
    margin: 0 auto;

    color: var(--muted);
    line-height: 1.7;
}


/* ---------------------------------------------------------
   Revision sections
--------------------------------------------------------- */

.revision-section {
    margin-bottom: 28px;
    padding: 28px 30px;

    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.revision-heading {
    display: flex;
    align-items: center;
    gap: 13px;

    margin-bottom: 18px;
}

.revision-number {
    flex-shrink: 0;

    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;

    color: var(--muted);
}

.revision-heading h2 {
    margin: 0;

    font-size: 1.3rem;
    line-height: 1.35;

    color: var(--text);
}

.revision-section p {
    margin-bottom: 14px;

    line-height: 1.7;
    color: var(--text);
}

.revision-note {
    color: var(--muted) !important;
    font-size: 0.9rem;
}


/* ---------------------------------------------------------
   Mathematics
--------------------------------------------------------- */

.revision-math {
    width: fit-content;
    max-width: 100%;

    margin: 18px auto;
    padding: 10px 18px;

    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.4;

    color: var(--text);

    background: var(--page-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.revision-math.math-highlight {
    color: var(--idea-accent);
}


/* ---------------------------------------------------------
   Key idea
--------------------------------------------------------- */

.revision-key {
    margin-top: 20px;
    padding: 15px 18px;

    background: var(--idea-bg);
    border-left: 3px solid var(--idea-accent);
    border-radius: 6px;

    line-height: 1.6;
    color: var(--text);
}


/* ---------------------------------------------------------
   Real number hierarchy
--------------------------------------------------------- */

.real-number-hierarchy {
    margin: 30px auto 10px;
    text-align: center;
}

.hierarchy-box {
    display: inline-block;

    padding: 11px 24px;

    border: 1px solid var(--idea-border);
    background: var(--idea-bg);

    border-radius: 8px;

    font-weight: 600;
    color: var(--text);
}

.hierarchy-line {
    width: 1px;
    height: 25px;

    margin: 0 auto;

    background: var(--border);
}

.hierarchy-branches {
    display: flex;
    justify-content: center;
    gap: 35px;

    position: relative;
}

.hierarchy-branches::before {
    content: "";

    position: absolute;

    top: 0;
    left: 25%;
    right: 25%;

    height: 1px;

    background: var(--border);
}

.hierarchy-branches .hierarchy-box {
    margin-top: 18px;

    background: var(--page-bg);
}


/* ---------------------------------------------------------
   Decimal examples
--------------------------------------------------------- */

.revision-examples {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;

    margin-top: 22px;
}

.revision-examples>div {
    padding: 18px;

    text-align: center;

    background: var(--page-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.revision-examples span {
    display: block;

    margin-bottom: 8px;

    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;

    color: var(--muted);
}

.revision-examples strong {
    display: block;

    font-size: 1.15rem;
    color: var(--text);
}


/* ---------------------------------------------------------
   Terminating / recurring rule
--------------------------------------------------------- */

.revision-rule {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;

    margin: 14px 0;
    padding: 15px 18px;

    background: var(--page-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.revision-rule strong {
    color: var(--text);
}

.revision-rule span {
    color: var(--muted);
    white-space: nowrap;
}


/* ---------------------------------------------------------
   Number system flow
--------------------------------------------------------- */

.number-system-flow {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;

    margin: 25px 0;
}

.number-system-flow span {
    padding: 8px 12px;

    background: var(--page-bg);
    border: 1px solid var(--border);
    border-radius: 6px;

    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.number-system-flow .flow-arrow {
    padding: 0 2px;
    border: none;
    background: transparent;
    font-weight: 400;
    color: var(--muted);
}


/* ---------------------------------------------------------
   Final practice prompt
--------------------------------------------------------- */

.revision-check {
    margin: 55px auto 35px;
    padding: 32px;

    text-align: center;

    background: var(--why-bg);
    border: 1px solid var(--why-border);
    border-radius: 10px;
}

.revision-check-label {
    margin-bottom: 10px;

    font-size: 0.72rem;
    letter-spacing: 0.18em;
    font-weight: 700;

    color: var(--why-accent);
}

.revision-check h2 {
    margin-bottom: 20px;

    color: var(--text);
}

.revision-practice-button {
    display: inline-block;

    padding: 11px 22px;

    border-radius: 7px;

    background: var(--text);
    color: var(--page-bg);

    text-decoration: none;
    font-weight: 600;
}

.revision-practice-button:hover {
    opacity: 0.85;
}


/* ---------------------------------------------------------
   Dark mode
--------------------------------------------------------- */

/* ================================
   QUICK REVISION — DARK MODE
   ================================ */

body.dark .revision-section {
    background: #181b20;
    border-color: var(--border);
}

body.dark .revision-section p {
    color: var(--text);
}

body.dark .revision-section .revision-note {
    color: var(--muted) !important;
}

body.dark .revision-math {
    background: #121417;
    border-color: var(--border);
    color: var(--text);
}

body.dark .revision-examples>div {
    background: #121417;
    border-color: var(--border);
}

body.dark .revision-examples strong {
    color: var(--text);
}

body.dark .revision-rule {
    background: #121417;
    border-color: var(--border);
}

body.dark .hierarchy-box {
    background: var(--idea-bg);
    border-color: var(--idea-border);
    color: var(--text);
}

body.dark .hierarchy-branches .hierarchy-box {
    background: #121417;
}

body.dark .number-system-flow span {
    background: #121417;
    border-color: var(--border);
    color: var(--text);
}

body.dark .revision-check {
    background: var(--why-bg);
    border-color: var(--why-border);
}

body.dark .revision-practice-button {
    background: #e8e8e8;
    color: #17191c;
}

/* ---------------------------------------------------------
   Mobile
--------------------------------------------------------- */

@media (max-width: 768px) {

    .revision-content {
        width: 90%;
        padding-top: 25px;
    }

    .revision-introduction {
        margin-bottom: 35px;
    }

    .revision-section {
        padding: 23px 20px;
        margin-bottom: 18px;
    }

    .revision-heading h2 {
        font-size: 1.15rem;
    }

    .revision-math {
        font-size: 1.2rem;
    }

    .revision-examples {
        grid-template-columns: 1fr;
    }

    .revision-rule {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .revision-rule span {
        white-space: normal;
    }

    .hierarchy-branches {
        gap: 12px;
    }

    .hierarchy-branches::before {
        left: 20%;
        right: 20%;
    }

    .hierarchy-box {
        padding: 9px 15px;
    }

    .revision-check {
        padding: 28px 20px;
    }

}


/* =========================================
   PRACTICE PAGE
   ========================================= */

.practice-page {
    min-height: calc(100vh - 70px);
    padding-bottom: 70px;
}

.practice-content {
    width: 84%;
    max-width: 750px;
    margin: 0 auto;
    padding-top: 40px;
}


/* -----------------------------------------
   INTRODUCTION
   ----------------------------------------- */

.practice-introduction {
    text-align: center;
    margin-bottom: 38px;
}

.practice-introduction .chapter-label {
    margin-bottom: 12px;
}

.practice-introduction h1 {
    margin-bottom: 15px;
    font-size: clamp(2rem, 4vw, 2.7rem);
    line-height: 1.2;
    color: var(--heading);
}

.practice-introduction > p:last-child {
    max-width: 600px;
    margin: 0 auto;
    color: var(--muted);
    line-height: 1.7;
}


/* -----------------------------------------
   PROGRESS
   ----------------------------------------- */

.practice-progress {
    margin-bottom: 45px;
}

.practice-progress > span {
    display: block;
    margin-bottom: 9px;
    text-align: right;
    font-size: 0.78rem;
    color: var(--muted);
}

.progress-track {
    width: 100%;
    height: 5px;
    overflow: hidden;
    background: var(--border);
    border-radius: 10px;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: var(--idea-accent);
    border-radius: 10px;
    transition: width 0.25s ease;
}


/* -----------------------------------------
   PRACTICE SECTION
   ----------------------------------------- */

.practice-section {
    margin-bottom: 55px;
}

.practice-section-heading {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 22px;
}

.practice-section-heading > span {
    flex-shrink: 0;
    padding-top: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.practice-section-heading h2 {
    margin: 0 0 5px;
    font-size: 1.35rem;
    line-height: 1.3;
    color: var(--text);
}

.practice-section-heading p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--muted);
}


/* -----------------------------------------
   QUESTION CARD
   ----------------------------------------- */

.question-card {
    margin-bottom: 18px;
    padding: 25px 27px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.question-number {
    margin-bottom: 12px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.question-card h3 {
    margin: 0 0 21px;
    font-size: 1.05rem;
    line-height: 1.65;
    font-weight: 600;
    color: var(--text);
}


/* -----------------------------------------
   OPTIONS
   ----------------------------------------- */

.options {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.options label {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: 7px;
    cursor: pointer;
    color: var(--text);
    background: var(--page-bg);
    transition:
        border-color 0.15s ease,
        background 0.15s ease;
}

.options label:hover {
    border-color: var(--idea-accent);
}

.options input {
    flex-shrink: 0;
    margin: 0;
    accent-color: var(--idea-accent);
}

.options label:has(input:checked) {
    border-color: var(--idea-accent);
    background: var(--idea-bg);
}

.options label span {
    line-height: 1.5;
}


/* -----------------------------------------
   CHECK ANSWER BUTTON
   ----------------------------------------- */

.check-answer {
    display: block;
    margin-top: 19px;
    padding: 10px 18px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--text);
    color: var(--page-bg);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.check-answer:hover {
    opacity: 0.82;
}

.check-answer:disabled {
    opacity: 0.55;
    cursor: default;
}


/* -----------------------------------------
   ANSWER FEEDBACK
   ----------------------------------------- */

.answer-feedback {
    display: none;
    margin-top: 17px;
    padding: 15px 17px;
    border-radius: 7px;
    line-height: 1.65;
    font-size: 0.9rem;
}

.answer-feedback.correct {
    display: block;
    background: var(--example-bg);
    border: 1px solid var(--example-border);
    border-left: 3px solid var(--example-accent);
    color: var(--text);
}

.answer-feedback.incorrect {
    display: block;
    background: var(--why-bg);
    border: 1px solid var(--why-border);
    border-left: 3px solid var(--why-accent);
    color: var(--text);
}

.answer-feedback strong {
    display: block;
    margin-bottom: 5px;
}


/* -----------------------------------------
   QUESTION STATES
   ----------------------------------------- */

.question-card.is-correct {
    border-color: var(--example-border);
}

.question-card.is-incorrect {
    border-color: var(--why-border);
}


/* -----------------------------------------
   RESULT
   ----------------------------------------- */

.practice-result {
    margin: 65px auto 40px;
    padding: 34px 30px;
    text-align: center;
    background: var(--why-bg);
    border: 1px solid var(--why-border);
    border-radius: 10px;
}

.practice-result-label {
    margin-bottom: 10px;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    font-weight: 700;
    color: var(--why-accent);
}

.practice-result h2 {
    margin-bottom: 20px;
    color: var(--text);
}

.practice-score {
    margin-bottom: 10px;
    font-size: 2.3rem;
    line-height: 1.2;
    font-weight: 700;
    color: var(--heading);
}

#score-message {
    margin: 0 auto;
    max-width: 500px;
    line-height: 1.6;
    color: var(--muted);
}


/* -----------------------------------------
   RESULT ACTIONS
   ----------------------------------------- */

.result-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 23px;
}

.result-actions a,
.result-actions button {
    display: inline-block;
    padding: 10px 17px;
    border-radius: 7px;
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.result-actions a {
    background: var(--text);
    color: var(--page-bg);
}

.result-actions button {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
}

.result-actions a:hover,
.result-actions button:hover {
    opacity: 0.82;
}


/* -----------------------------------------
   DARK MODE
   ----------------------------------------- */

body.dark .question-card {
    background: #181b20;
}

body.dark .options label {
    background: #121417;
}

body.dark .options label:has(input:checked) {
    background: var(--idea-bg);
}

body.dark .check-answer {
    background: #e8e8e8;
    color: #17191c;
}

body.dark .practice-result {
    background: var(--why-bg);
}


/* -----------------------------------------
   MOBILE
   ----------------------------------------- */

@media (max-width: 768px) {

    .practice-content {
        width: 90%;
        padding-top: 25px;
    }

    .practice-introduction {
        margin-bottom: 32px;
    }

    .practice-progress {
        margin-bottom: 35px;
    }

    .practice-section {
        margin-bottom: 42px;
    }

    .practice-section-heading {
        gap: 11px;
        margin-bottom: 17px;
    }

    .practice-section-heading h2 {
        font-size: 1.2rem;
    }

    .practice-section-heading p {
        font-size: 0.86rem;
    }

    .question-card {
        padding: 22px 19px;
        margin-bottom: 15px;
    }

    .question-card h3 {
        font-size: 1rem;
        line-height: 1.6;
    }

    .options label {
        padding: 10px 11px;
    }

    .check-answer {
        width: 100%;
        margin-top: 17px;
    }

    .practice-result {
        padding: 29px 20px;
        margin-top: 50px;
    }

    .result-actions {
        flex-direction: column;
    }

    .result-actions a,
    .result-actions button {
        width: 100%;
        text-align: center;
    }
}

/* -----------------------------------------
   ANSWERED OPTION STATES
   ----------------------------------------- */

.question-card.is-correct .options label.correct-option {
    border-color: var(--example-accent);
    background: var(--example-bg);
}

.question-card.is-incorrect .options label.selected-wrong {
    border-color: var(--why-accent);
    background: var(--why-bg);
}

.question-card.is-incorrect .options label.correct-option {
    border-color: var(--example-accent);
    background: var(--example-bg);
}


/* Keep answered options visually calm */

.question-card.answered .options label {
    cursor: default;
}

.question-card.answered .options label:hover {
    border-color: var(--border);
}

.question-card.answered .options label.correct-option:hover {
    border-color: var(--example-accent);
}

.question-card.answered .options label.selected-wrong:hover {
    border-color: var(--why-accent);
}


/* -----------------------------------------
   DARK MODE — ANSWER STATES
   ----------------------------------------- */

body.dark .question-card.is-correct .options label.correct-option {
    background: var(--example-bg);
}

body.dark .question-card.is-incorrect .options label.selected-wrong {
    background: var(--why-bg);
}

body.dark .question-card.is-incorrect .options label.correct-option {
    background: var(--example-bg);
}