/* =========================================
   CODEBHAVYA - MATHEMATICS COURSE STYLES
   Loaded only by pages inside the Mathematics course.
   ========================================= */

/* =========================================
   CODEBHAVYA MATHEMATICS — FINAL COURSE STYLE
   Scoped so C, DSA and other courses are unchanged.
   ========================================= */

body.math-page,
body.math-practice-page {
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.07), transparent 34%),
        #F4F7FB;
}

.math-page .subject-hero,
.math-page .math-topic-hero,
.math-practice-page .practice-header {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #0B1628 0%, #102748 68%, #173A67 100%);
    border: 1px solid #27466D;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 26px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
}

.math-page .subject-hero::after,
.math-page .math-topic-hero::after,
.math-practice-page .practice-header::after {
    content: "";
    position: absolute;
    width: 190px;
    height: 190px;
    right: -65px;
    top: -85px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.12);
    pointer-events: none;
}

.math-page .subject-label,
.math-practice-page .subject-label {
    position: relative;
    z-index: 1;
    color: #F5D76E;
}

.math-page .subject-hero .page-title,
.math-page .math-topic-hero .page-title,
.math-practice-page .practice-header h1 {
    position: relative;
    z-index: 1;
    color: #FFFFFF;
    margin: 4px 0 10px;
}

.math-page .subject-hero .page-description,
.math-page .math-topic-hero .page-description,
.math-practice-page .practice-header > p {
    position: relative;
    z-index: 1;
    color: #CBD5E1;
    max-width: 760px;
    margin: 0;
}

.math-page .content-card {
    border: 1px solid #D8E3EF;
    border-radius: 14px;
    box-shadow: 0 7px 20px rgba(15, 23, 42, 0.06);
}

.math-page .topic-card {
    border-color: #D8E3EF;
    border-top: 4px solid #2563EB;
}

.math-page .topic-card:hover {
    border-color: #8CC8F0;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.10);
}

.math-page .topic-icon {
    background: linear-gradient(135deg, #EAF4FC, #F8FAFC);
    border: 1px solid #D5E7F5;
}

.math-page .primary-button,
.math-practice-page .primary-button {
    border-radius: 9px;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.18);
}

.topic-status {
    align-self: flex-start;
    margin-top: auto;
    padding: 8px 13px;
    border-radius: 999px;
    background: #F1F5F9;
    border: 1px solid #D8E3EF;
    color: #64748B;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
}

.sidebar-practice-title {
    margin-top: 22px;
    color: #9A7416;
}

.coming-soon-link {
    opacity: 0.62;
    pointer-events: none;
}

.coming-soon-link::after {
    content: "Soon";
    float: right;
    padding: 1px 6px;
    border-radius: 999px;
    background: #F1F5F9;
    color: #64748B;
    font-size: 10px;
    font-weight: 700;
}

.math-practice-spotlight {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    background: linear-gradient(135deg, #FFFFFF, #F3F8FD);
    border-left: 5px solid #D4AF37 !important;
}

.math-practice-copy {
    max-width: 680px;
}

.math-practice-copy h2 {
    margin: 4px 0 8px;
}

.math-practice-copy p {
    margin: 0;
    color: #64748B;
}

.math-practice-button,
.math-hero-practice-button {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.math-hero-practice-button {
    display: inline-block;
    margin-top: 20px;
}

.math-practice-page .main-content {
    width: min(100%, 1080px);
    max-width: 1080px;
    min-height: calc(100vh - 65px);
    padding: 38px;
}

.math-practice-page .practice-header {
    background: linear-gradient(135deg, #0B1628 0%, #102748 68%, #173A67 100%);
    border-color: #27466D;
    border-radius: 16px;
    padding: 30px;
}

.math-practice-page .progress-container {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.16);
    height: 11px;
    margin-top: 22px;
}

.math-practice-page .progress-bar {
    background: linear-gradient(90deg, #2563EB, #60A5FA, #D4AF37);
}

.math-practice-page #quiz,
.math-practice-page .result {
    border: 1px solid #D8E3EF;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

.math-practice-page .question-number {
    color: #1D4ED8;
    letter-spacing: 0.4px;
}

.math-practice-page .option {
    border-color: #D8E3EF;
    border-radius: 10px;
}

.math-practice-page .option:hover {
    border-color: #60A5FA;
    background: #F0F7FF;
    transform: translateY(-1px);
}

.math-practice-page .quiz-button {
    min-height: 44px;
    border-radius: 9px;
    padding: 11px 22px;
}

.math-practice-page .check-button {
    background: #2563EB;
}

.math-practice-page .next-button {
    background: #15803D;
}

.math-practice-page .restart-button {
    background: #475569;
}

.math-practice-page .score {
    color: #1D4ED8;
}

@media (max-width: 800px) {
    .math-practice-spotlight {
        align-items: flex-start;
        flex-direction: column;
    }

    .math-practice-page .main-content {
        padding: 24px 18px;
    }
}


/* =========================================
   MATHEMATICAL THINKING PAGE
   ========================================= */

.math-page .math-outcome-grid,
.math-page .math-problem-grid,
.math-page .math-pattern-grid,
.math-page .math-mistake-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.math-page .math-outcome-item,
.math-page .math-problem-grid article,
.math-page .math-pattern-grid article,
.math-page .math-mistake-grid article {
    padding: 18px;
    border: 1px solid #D8E3EF;
    border-radius: 12px;
    background: #F8FAFC;
}

.math-page .math-outcome-item {
    display: flex;
    align-items: flex-start;
    gap: 13px;
}

.math-page .math-outcome-item > span {
    flex: 0 0 auto;
    color: #B78A16;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.8px;
}

.math-page .math-outcome-item strong {
    color: #334155;
    line-height: 1.55;
}

.math-page .math-thinking-formula {
    letter-spacing: 0.25px;
}

.math-page .math-problem-grid article > span,
.math-page .math-algorithm-box > span {
    display: inline-block;
    margin-bottom: 6px;
    color: #1D4ED8;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
}

.math-page .math-problem-grid h3,
.math-page .math-pattern-grid h3 {
    margin: 0 0 6px;
}

.math-page .math-problem-grid p,
.math-page .math-pattern-grid p,
.math-page .math-mistake-grid p {
    margin: 0;
    color: #64748B;
}

.math-page .math-step-list,
.math-page .math-algorithm-box ol {
    margin: 15px 0;
    padding-left: 24px;
}

.math-page .math-step-list li,
.math-page .math-algorithm-box li {
    margin: 7px 0;
}

.math-page .math-pattern-type {
    display: inline-block;
    margin-bottom: 8px;
    color: #9A7416;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.8px;
}

.math-page .math-pattern-grid strong {
    display: block;
    margin-top: 10px;
    color: #166534;
}

.math-page .math-pattern-lab {
    border-left: 5px solid #2563EB;
}

.math-page .math-pattern-lab label {
    display: block;
    margin: 20px 0 7px;
    color: #334155;
    font-weight: 700;
}

.math-page .math-lab-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
}

.math-page .math-lab-controls input {
    width: 100%;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid #CBD5E1;
    border-radius: 9px;
    color: #0F172A;
    font: inherit;
}

.math-page .math-lab-controls input:focus {
    outline: none;
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.math-page .math-example-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 13px;
}

.math-page .math-example-chips button {
    padding: 7px 11px;
    border: 1px solid #C7D8EA;
    border-radius: 999px;
    background: #F8FAFC;
    color: #334155;
    cursor: pointer;
    font-weight: 700;
}

.math-page .math-example-chips button:hover {
    border-color: #60A5FA;
    color: #1D4ED8;
}

.math-page .math-lab-result {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid #BFDBFE;
    border-left: 5px solid #2563EB;
    border-radius: 10px;
    background: #EFF6FF;
    color: #1E3A5F;
    font-weight: 700;
}

.math-page .math-lab-result.is-error {
    border-color: #FED7AA;
    border-left-color: #EA580C;
    background: #FFF7ED;
    color: #9A3412;
}

.math-page .math-algorithm-box {
    margin-top: 18px;
    padding: 20px;
    border: 1px solid #CAD9E8;
    border-radius: 12px;
    background: #0F172A;
    color: #E2E8F0;
}

.math-page .math-algorithm-box > span {
    color: #F5D76E;
}

.math-page .math-algorithm-box p,
.math-page .math-algorithm-box ol {
    margin-bottom: 18px;
}

.math-page .math-check-list,
.math-page .math-summary-list {
    padding-left: 22px;
}

.math-page .math-check-list li,
.math-page .math-summary-list li {
    margin: 9px 0;
}

.math-page .math-mistake-grid article {
    border-left: 4px solid #F59E0B;
}

.math-page .math-mistake-grid strong {
    display: block;
    margin-bottom: 5px;
    color: #0F172A;
}

.math-page .solution[hidden] {
    display: none !important;
}

.math-page .solution:not([hidden]) {
    display: block;
}

.math-page .math-topic-navigation {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin: 30px 0;
}

.math-page .math-topic-navigation a {
    padding: 11px 16px;
    border: 1px solid #D8E3EF;
    border-radius: 9px;
    background: #FFFFFF;
    color: #1D4ED8;
    font-weight: 700;
    text-decoration: none;
}

.math-page .math-topic-navigation a:hover {
    border-color: #60A5FA;
    background: #EFF6FF;
}

.math-page .math-topic-navigation a:first-child {
    border-color: #CBD5E1;
    background: #E2E8F0;
    color: #334155;
}

.math-page .math-topic-navigation a:first-child:hover {
    border-color: #94A3B8;
    background: #CBD5E1;
    color: #1E293B;
}

@media (max-width: 700px) {
    .math-page .math-outcome-grid,
    .math-page .math-problem-grid,
    .math-page .math-pattern-grid,
    .math-page .math-mistake-grid {
        grid-template-columns: 1fr;
    }

    .math-page .math-lab-controls {
        grid-template-columns: 1fr;
    }

    .math-page .math-topic-navigation {
        align-items: stretch;
        flex-direction: column;
    }
}

/* =========================================
   BASE CONVERSIONS TOPIC
   ========================================= */

.base-conversions-topic-page .math-table-wrap {
    overflow-x: auto;
    border: 1px solid #D8E3EF;
    border-radius: 11px;
    background: #FFFFFF;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
}

.base-conversions-topic-page .base-conversion-table {
    width: 100%;
    min-width: 720px;
    margin: 0;
    border-collapse: collapse;
    background: #FFFFFF;
}

.base-conversions-topic-page .base-conversion-table th,
.base-conversions-topic-page .base-conversion-table td {
    padding: 13px 15px;
    border: 1px solid #D8E3EF;
    text-align: left;
    vertical-align: top;
}

.base-conversions-topic-page .base-conversion-table th {
    background: #1D477B;
    color: #FFFFFF;
    font-weight: 800;
    white-space: nowrap;
}

.base-conversions-topic-page .base-conversion-table td {
    color: #253A55;
    line-height: 1.5;
}

.base-conversions-topic-page .base-conversion-table td:nth-child(-n+4) {
    white-space: nowrap;
}

.base-conversions-topic-page .base-conversion-table tbody tr:nth-child(even) {
    background: #F7FAFD;
}

.base-conversions-topic-page .base-conversion-table tbody tr:hover {
    background: #EFF6FF;
}

.base-conversions-topic-page .base-grouping-grid,
.base-conversions-topic-page .base-mistake-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
    margin: 19px 0;
}

.base-conversions-topic-page .base-grouping-grid article,
.base-conversions-topic-page .base-mistake-grid article {
    padding: 18px;
    border: 1px solid #BFDBFE;
    border-left: 5px solid #2563EB;
    border-radius: 11px;
    background: #EFF6FF;
}

.base-conversions-topic-page .base-grouping-grid article:nth-child(even),
.base-conversions-topic-page .base-mistake-grid article:nth-child(even) {
    border-color: #DDD6FE;
    border-left-color: #8B5CF6;
    background: #F7F5FF;
}

.base-conversions-topic-page .base-grouping-grid strong,
.base-conversions-topic-page .base-mistake-grid strong {
    display: block;
    margin-bottom: 8px;
    color: #153B6F;
    font-size: 17px;
}

.base-conversions-topic-page .base-grouping-grid p,
.base-conversions-topic-page .base-mistake-grid p {
    margin: 7px 0;
}

.base-conversions-topic-page .base-grouping-grid span {
    display: inline-block;
    margin-top: 6px;
    color: #047857;
    font-weight: 800;
}

.base-conversions-topic-page .base-conversion-lab {
    padding: 26px;
    background: linear-gradient(135deg, #FFFFFF 0%, #F7FAFF 100%);
}

.base-conversions-topic-page .base-converter-grid {
    display: grid;
    grid-template-columns: minmax(220px, 2fr) minmax(150px, 1fr) minmax(150px, 1fr) auto;
    gap: 12px;
    align-items: end;
    margin-top: 19px;
}

.math-page.base-conversions-topic-page .base-converter-grid label {
    display: grid;
    gap: 7px;
    margin: 0;
    color: #253A55;
    font-weight: 800;
}

.math-page.base-conversions-topic-page .base-converter-grid input,
.math-page.base-conversions-topic-page .base-converter-grid select {
    width: 100%;
    min-width: 0;
    height: 48px;
    box-sizing: border-box;
    margin: 0;
    padding: 0 13px;
    border: 1px solid #C7D8EA;
    border-radius: 9px;
    background: #FFFFFF;
    color: #0F172A;
    font: inherit;
}

.base-conversions-topic-page .base-converter-grid input:focus,
.base-conversions-topic-page .base-converter-grid select:focus {
    outline: none;
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.base-conversions-topic-page .base-converter-grid .primary-button {
    min-height: 48px;
    margin: 0;
    white-space: nowrap;
}

.base-conversions-topic-page .base-converter-result {
    font-weight: 400;
}

.base-conversions-topic-page .base-converter-summary {
    display: grid;
    gap: 7px;
    padding: 14px 16px;
    border: 1px solid #A7F3D0;
    border-radius: 9px;
    background: #ECFDF5;
}

.base-conversions-topic-page .base-converter-summary span {
    color: #047857;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.7px;
    text-transform: uppercase;
}

.base-conversions-topic-page .base-converter-summary strong {
    overflow-wrap: anywhere;
    color: #065F46;
    font-size: 18px;
}

.base-conversions-topic-page .base-converter-result h3 {
    margin: 18px 0 8px;
    color: #153B6F;
    font-size: 16px;
}

.base-conversions-topic-page .base-converter-steps {
    margin: 0;
    padding-left: 25px;
}

.base-conversions-topic-page .base-converter-steps li {
    margin: 6px 0;
    color: #334155;
    font-weight: 500;
}

@media (max-width: 1050px) {
    .base-conversions-topic-page .base-converter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .base-conversions-topic-page .base-converter-grid .primary-button {
        width: 100%;
    }
}

@media (max-width: 700px) {
    .base-conversions-topic-page .base-grouping-grid,
    .base-conversions-topic-page .base-mistake-grid,
    .base-conversions-topic-page .base-converter-grid {
        grid-template-columns: 1fr;
    }

    .base-conversions-topic-page .base-conversion-lab {
        padding: 20px 15px;
    }
}


@media (max-width: 600px) {
    .math-page .subject-hero,
    .math-page .math-topic-hero,
    .math-practice-page .practice-header {
        padding: 24px 20px;
        border-radius: 13px;
    }

    .math-page .subject-hero .page-title,
    .math-page .math-topic-hero .page-title,
    .math-practice-page .practice-header h1 {
        font-size: 30px;
    }
}


/* =========================================
   CODEBHAVYA MATHEMATICS PAGE
   ========================================= */


/* -----------------------------------------
   SUBJECT HERO
----------------------------------------- */

.subject-hero {
    margin-bottom: 30px;
}

.subject-label,
.section-label {
    display: inline-block;

    color: #D4AF37;

    font-size: 12px;
    font-weight: 700;

    letter-spacing: 1.5px;

    margin-bottom: 8px;
}

.subject-hero .page-title {
    margin-bottom: 12px;
}

.subject-hero .page-description {
    max-width: 750px;

    margin-bottom: 0;
}


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

.content-section {
    margin: 35px 0;
}

.section-heading {
    margin-bottom: 22px;
}

.section-heading h2 {
    margin: 4px 0 8px;
}

.section-heading p {
    margin: 0;

    color: #64748B;

    line-height: 1.7;
}


/* -----------------------------------------
   TOPIC GRID
----------------------------------------- */

.topic-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 22px;

    margin-top: 22px;
}


/* -----------------------------------------
   TOPIC CARD
----------------------------------------- */

.topic-card {
    background: #FFFFFF;

    border: 1px solid #E2E8F0;

    border-radius: 14px;

    padding: 26px;

    display: flex;

    flex-direction: column;

    min-height: 255px;

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

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}


.topic-card:hover {
    transform: translateY(-4px);

    border-color: #B8D8F0;

    box-shadow:
        0 10px 25px rgba(15, 23, 42, 0.10);
}


/* -----------------------------------------
   TOPIC ICON
----------------------------------------- */

.topic-icon {
    width: 48px;
    height: 48px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background: #F1F7FC;

    font-size: 25px;

    margin-bottom: 16px;
}


/* -----------------------------------------
   TOPIC TITLE
----------------------------------------- */

.topic-card h3 {
    color: #0F172A;

    font-size: 19px;

    margin: 0 0 10px;
}


/* -----------------------------------------
   TOPIC DESCRIPTION
----------------------------------------- */

.topic-card p {
    color: #64748B;

    font-size: 14px;

    line-height: 1.65;

    margin: 0 0 20px;
}


/* -----------------------------------------
   TOPIC BUTTON
----------------------------------------- */

.topic-card .primary-button {
    align-self: flex-start;

    margin-top: auto;

    text-decoration: none;
}


/* -----------------------------------------
   LEARNING METHOD
----------------------------------------- */

.learning-method {
    margin-top: 35px;
}


.learning-method h2 {
    margin-top: 4px;

    margin-bottom: 22px;
}


.learning-steps {
    display: grid;

    grid-template-columns:
        repeat(5, minmax(0, 1fr));

    gap: 12px;
}


.learning-step {
    background: #F8FAFC;

    border: 1px solid #E2E8F0;

    border-radius: 10px;

    padding: 16px 12px;

    min-height: 100px;
}


.learning-step > span {
    display: block;

    color: #D4AF37;

    font-size: 12px;

    font-weight: 700;

    letter-spacing: 1px;

    margin-bottom: 9px;
}


.learning-step strong {
    color: #334155;

    font-size: 13px;

    line-height: 1.5;
}


/* -----------------------------------------
   SIDEBAR PART B
----------------------------------------- */

.sidebar-part-b {
    margin-top: 22px;
}


/* -----------------------------------------
   TABLET
----------------------------------------- */

@media (max-width: 900px) {

    .topic-grid {
        grid-template-columns: 1fr;
    }

    .learning-steps {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}


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

@media (max-width: 600px) {

    .subject-hero {
        margin-bottom: 24px;
    }

    .topic-grid {
        grid-template-columns: 1fr;

        gap: 16px;
    }

    .topic-card {
        padding: 22px;

        min-height: 230px;
    }

    .learning-steps {
        grid-template-columns: 1fr;
    }

    .learning-step {
        min-height: auto;
    }

}



/* =========================================
   MATHEMATICS PRACTICE COMPONENTS
   ========================================= */


        .practice-header {
            background: white;
            padding: 25px;
            border-radius: 12px;
            margin-bottom: 25px;
            border: 1px solid #e2e8f0;
        }

        .progress-container {
            width: 100%;
            height: 10px;
            background: #e2e8f0;
            border-radius: 10px;
            overflow: hidden;
            margin-top: 15px;
        }

        .progress-bar {
            height: 100%;
            width: 5%;
            background: #2563eb;
            transition: width 0.3s;
        }

        .question-number {
            color: #64748b;
            font-weight: bold;
            margin-bottom: 10px;
        }

        .difficulty {
            display: inline-block;
            padding: 5px 12px;
            border-radius: 20px;
            font-size: 13px;
            font-weight: bold;
            margin-bottom: 15px;
        }

        .easy {
            background: #dcfce7;
            color: #166534;
        }

        .medium {
            background: #fef3c7;
            color: #92400e;
        }

        .hard {
            background: #fee2e2;
            color: #991b1b;
        }

        .question-text {
            font-size: 21px;
            font-weight: bold;
            margin: 20px 0;
        }

        .options {
            display: grid;
            gap: 12px;
            margin-top: 20px;
        }

        .option {
            background: white;
            border: 2px solid #e2e8f0;
            padding: 15px;
            border-radius: 8px;
            cursor: pointer;
            transition: 0.2s;
        }

        .option:hover {
            border-color: #2563eb;
            background: #eff6ff;
        }

        .option.selected {
            border-color: #2563eb;
            background: #dbeafe;
        }

        .option.correct {
            border-color: #16a34a;
            background: #dcfce7;
        }

        .option.wrong {
            border-color: #dc2626;
            background: #fee2e2;
        }

        .feedback {
            display: none;
            padding: 18px;
            margin-top: 20px;
            border-radius: 8px;
        }

        .feedback.correct-feedback {
            background: #dcfce7;
            color: #166534;
        }

        .feedback.wrong-feedback {
            background: #fee2e2;
            color: #991b1b;
        }

        .solution-box {
            display: none;
            background: #eff6ff;
            padding: 20px;
            margin-top: 15px;
            border-left: 5px solid #2563eb;
            border-radius: 6px;
        }

        .quiz-buttons {
            display: flex;
            gap: 10px;
            margin-top: 25px;
            flex-wrap: wrap;
        }

        .quiz-button {
            border: none;
            padding: 11px 20px;
            border-radius: 7px;
            cursor: pointer;
            font-weight: bold;
        }

        .check-button {
            background: #2563eb;
            color: white;
        }

        .next-button {
            background: #16a34a;
            color: white;
            display: none;
        }

        .restart-button {
            background: #7c3aed;
            color: white;
        }

        .result {
            display: none;
            text-align: center;
            background: white;
            padding: 40px;
            border-radius: 12px;
            border: 1px solid #e2e8f0;
        }

        .score {
            font-size: 48px;
            font-weight: bold;
            color: #2563eb;
            margin: 15px 0;
        }

        @media (max-width: 600px) {

            .question-text {
                font-size: 18px;
            }

        }




/* =========================================
   MATHEMATICS COURSE TRACKS AND PROGRESS
   ========================================= */

.math-page .math-course-progress {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
    background: linear-gradient(135deg, #FFFFFF, #F3F8FD);
    border-left: 5px solid #D4AF37;
}

.math-page .math-course-progress h2 {
    margin-bottom: 6px;
}

.math-page .math-course-progress p {
    margin: 0;
    color: #64748B;
}

.math-page .math-progress-summary {
    min-width: 220px;
}

.math-page .math-progress-text {
    display: block;
    margin-bottom: 8px;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
    text-align: right;
}

.math-page .math-progress-track {
    width: 100%;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #E2E8F0;
}

.math-page .math-progress-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2563EB, #60A5FA, #D4AF37);
    transition: width 0.35s ease;
}

.math-page .math-track-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.math-page .math-track-count {
    flex-shrink: 0;
    padding: 7px 11px;
    border: 1px solid #D8E3EF;
    border-radius: 999px;
    background: #FFFFFF;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
}

.math-page .topic-card {
    position: relative;
}

.math-page .topic-card.visited-topic::after {
    content: "Visited";
    position: absolute;
    top: 14px;
    right: 14px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #DCFCE7;
    color: #166534;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.35px;
}

.math-page .topic-card.available-topic {
    border-top-color: #D4AF37;
}

.math-page .topic-card .topic-status.available-status {
    background: #ECFDF5;
    border-color: #BBF7D0;
    color: #166534;
}

.math-page .sidebar .sidebar-title {
    margin-top: 18px;
}

.math-page .sidebar .sidebar-title:first-child {
    margin-top: 0;
}

.math-page .sidebar .sidebar-course-home {
    margin-bottom: 14px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
}

.math-page .sidebar .active {
    font-weight: 700;
}

@media (max-width: 800px) {
    .math-page .math-course-progress {
        grid-template-columns: 1fr;
    }

    .math-page .math-progress-summary {
        min-width: 0;
    }

    .math-page .math-progress-text {
        text-align: left;
    }

    .math-page .math-track-heading {
        flex-direction: column;
    }
}


/* =========================================
   MATHEMATICS HOME - THREE-PART COURSE MAP
   ========================================= */

.math-index-page .math-course-map-section {
    margin-top: 32px;
}

.math-index-page .math-course-map {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-top: 22px;
}

.math-index-page .math-course-map-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 24px;
    border: 1px solid #D8E3EF;
    border-top: 5px solid #2563EB;
    border-radius: 14px;
    background: #FFFFFF;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.07);
}

.math-index-page .math-course-map-card.part-one {
    border-top-color: #7C3AED;
}

.math-index-page .math-course-map-card.part-two {
    border-top-color: #2563EB;
}

.math-index-page .math-course-map-card.part-three {
    border-top-color: #D4AF37;
}

.math-index-page .math-course-map-number {
    margin-bottom: 8px;
    color: #64748B;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.2px;
}

.math-index-page .math-course-map-card h3 {
    margin: 0 0 10px;
    color: #0F172A;
    font-size: 19px;
}

.math-index-page .math-course-map-card p {
    margin: 0 0 14px;
    color: #64748B;
    font-size: 14px;
    line-height: 1.6;
}

.math-index-page .math-course-map-card ul {
    margin: 0 0 18px;
    padding-left: 19px;
    color: #334155;
    font-size: 13px;
    line-height: 1.55;
}

.math-index-page .math-course-map-card li {
    margin: 5px 0;
}

.math-index-page .math-course-map-card li a {
    color: #1D4ED8;
    font-weight: 700;
    text-decoration: none;
}

.math-index-page .math-course-map-card li a:hover {
    text-decoration: underline;
}

.math-index-page .math-course-map-card > span {
    align-self: flex-start;
    margin-top: auto;
    padding: 6px 10px;
    border-radius: 999px;
    background: #F1F5F9;
    color: #475569;
    font-size: 11px;
    font-weight: 800;
}


/* Three topic cards per row, matching the C course layout. */

.math-index-page .topic-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
}

.math-index-page .topic-card {
    min-height: 430px;
    padding: 23px;
}

.math-index-page .topic-card > p {
    margin-bottom: 13px;
}

.math-index-page .topic-title-link {
    color: inherit;
    text-decoration: none;
}

.math-index-page .topic-title-link:hover {
    color: #1D4ED8;
    text-decoration: underline;
}

.math-index-page .topic-subtopics-title {
    margin-bottom: 6px;
    color: #9A7416;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.85px;
    text-transform: uppercase;
}

.math-index-page .topic-subtopics {
    margin: 0 0 20px;
    padding-left: 18px;
    color: #475569;
    font-size: 13px;
    line-height: 1.5;
}

.math-index-page .topic-subtopics li {
    margin: 5px 0;
}

@media (max-width: 1180px) {
    .math-index-page .topic-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1000px) {
    .math-index-page .math-course-map {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .math-index-page .topic-grid {
        grid-template-columns: 1fr;
    }

    .math-index-page .topic-card {
        min-height: auto;
    }
}


/* =========================================
   MATHEMATICS TOPIC PAGES — CONTENT CLARITY
   Reusable across Number System and future
   Mathematics lesson pages only.
   ========================================= */

/* C-course heading language: strong CodeBhavya navy and weight. */
.math-topic-page .content-card > h2 {
    margin: 0 0 20px;
    padding-bottom: 13px;
    border-bottom: 2px solid #E5EEF8;
    color: #153B6F !important;
    font-weight: 800;
    line-height: 1.35;
}

.math-topic-page .content-card > h3 {
    color: #153B6F;
    font-weight: 800;
}

/* Comfortable alignment and spacing for learning lists. */
.math-topic-page .content-card ul,
.math-topic-page .content-card ol {
    margin-top: 14px;
    margin-bottom: 8px;
    padding-left: 29px;
}

.math-topic-page .content-card li {
    margin: 8px 0;
    padding-left: 5px;
    line-height: 1.65;
}

.math-topic-page .math-spaced-list li {
    margin: 10px 0;
}

/* Light concept boxes with clear visual separation. */
.math-topic-page .formula-box,
.math-topic-page .math-labelled-example {
    border: 1px solid #BFDBFE;
    border-left: 5px solid #2563EB;
    border-radius: 11px;
    background: #EFF6FF;
    color: #1E3A5F;
    box-shadow: 0 5px 14px rgba(15, 23, 42, 0.04);
}

.math-topic-page .math-concept-box {
    padding: 19px 22px;
    font-weight: 700;
}

.math-topic-page .math-tone-blue {
    border-color: #BFDBFE;
    border-left-color: #2563EB;
    background: #EFF6FF;
}

.math-topic-page .math-tone-green {
    border-color: #A7F3D0;
    border-left-color: #10B981;
    background: #ECFDF5;
}

.math-topic-page .math-tone-purple {
    border-color: #DDD6FE;
    border-left-color: #8B5CF6;
    background: #F5F3FF;
}

.math-topic-page .math-tone-orange {
    border-color: #FED7AA;
    border-left-color: #F97316;
    background: #FFF7ED;
}

.math-topic-page .math-tone-rose {
    border-color: #FECDD3;
    border-left-color: #F43F5E;
    background: #FFF1F2;
}

/* Divisibility rules: one memorable colour for each rule. */
.math-topic-page .math-rule-card {
    padding: 18px 22px;
    text-align: left;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.65;
}

.math-topic-page .math-rule-title {
    display: block;
    margin-bottom: 5px;
    color: #153B6F;
    font-size: 18px;
    font-weight: 800;
}

.math-topic-page .math-rule-card.math-tone-green .math-rule-title {
    color: #047857;
}

.math-topic-page .math-rule-card.math-tone-purple .math-rule-title {
    color: #6D28D9;
}

.math-topic-page .math-rule-card.math-tone-orange .math-rule-title {
    color: #C2410C;
}

.math-topic-page .math-rule-card.math-tone-rose .math-rule-title {
    color: #BE123C;
}

/* Highlighted labels such as “Factors of 12”. */
.math-topic-page .math-labelled-example {
    padding: 20px 24px;
}

.math-topic-page .math-box-label,
.math-topic-page .math-box-value {
    display: block;
}

.math-topic-page .math-box-label {
    margin-bottom: 9px;
    color: #1D4ED8;
    font-size: 17px;
    font-weight: 800;
}

.math-topic-page .math-labelled-example.math-tone-purple .math-box-label {
    color: #6D28D9;
}

.math-topic-page .math-box-value {
    color: #334155;
    font-size: 17px;
    font-weight: 700;
}

/* Solved examples: separate statement, method and final answer. */
.math-topic-page .math-solved-problem {
    overflow: hidden;
    padding: 22px;
    border: 1px solid #D8E3EF;
    border-left: 5px solid #2563EB;
    background: #FFFFFF;
    box-shadow: 0 7px 18px rgba(15, 23, 42, 0.05);
}

.math-topic-page .math-solved-problem > h3 {
    display: inline-block;
    margin: 0 0 14px;
    padding: 6px 11px;
    border-radius: 999px;
    background: #DBEAFE;
    color: #1D4ED8;
    font-size: 14px;
    font-weight: 800;
}

.math-topic-page .math-problem-statement {
    margin: 0 0 14px;
    padding: 15px 17px;
    border-left: 4px solid #F59E0B;
    border-radius: 8px;
    background: #FFFBEB;
    color: #78350F;
    font-weight: 700;
}

.math-topic-page .math-problem-statement::before {
    content: "Problem statement";
    display: block;
    margin-bottom: 5px;
    color: #B45309;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.math-topic-page .math-solution-steps {
    margin: 0 0 14px;
    padding: 15px 17px;
    border-left: 4px solid #3B82F6;
    border-radius: 8px;
    background: #EFF6FF;
    color: #334155;
}

.math-topic-page .math-solution-label {
    display: block;
    margin-bottom: 6px;
    color: #1D4ED8;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.7px;
    text-transform: uppercase;
}

.math-topic-page .math-solution-steps p {
    margin: 4px 0;
}

.math-topic-page .math-solved-problem .answer {
    margin: 0;
    padding: 13px 16px;
    border-left: 4px solid #16A34A;
    border-radius: 8px;
    background: #ECFDF5;
    color: #15803D;
    font-weight: 800;
}

/* Practice first, full test afterwards. */
.math-topic-page .math-practice-intro {
    margin: 0 0 18px;
    padding: 13px 16px;
    border-left: 4px solid #D4AF37;
    border-radius: 8px;
    background: #FFFBEB;
    color: #713F12;
}

.math-topic-page .practice-question {
    margin: 14px 0;
    padding: 20px;
    border: 1px solid #D8E3EF;
    border-left: 5px solid #60A5FA;
    border-radius: 10px;
    background: #F8FBFF;
}

.math-topic-page .practice-question:nth-of-type(even) {
    border-left-color: #8B5CF6;
    background: #FAF8FF;
}

.math-topic-page .practice-question > strong {
    color: #153B6F;
    font-size: 16px;
}

.math-topic-page .solution-button {
    min-height: 38px;
    border-radius: 8px;
    font-weight: 700;
}

.math-topic-page .practice-question .solution {
    margin-top: 13px;
    padding: 16px;
    border: 1px solid #BBF7D0;
    border-left: 4px solid #16A34A;
    border-radius: 8px;
    background: #F0FDF4;
    color: #166534;
    line-height: 1.7;
}

.math-topic-page .practice-question .solution[hidden] {
    display: none !important;
}

.math-topic-page .practice-question .solution:not([hidden]) {
    display: block;
}

.math-topic-page .math-practice-spotlight {
    margin-top: 30px;
    padding: 30px;
    border-top: 1px solid #D8E3EF;
}

.math-topic-page .math-practice-copy h2 {
    color: #153B6F;
    font-weight: 800;
}

@media (max-width: 700px) {
    .math-topic-page .content-card > h2 {
        font-size: 23px;
    }

    .math-topic-page .content-card ul,
    .math-topic-page .content-card ol {
        padding-left: 24px;
    }

    .math-topic-page .math-rule-card,
    .math-topic-page .math-labelled-example,
    .math-topic-page .math-solved-problem,
    .math-topic-page .practice-question {
        padding: 17px;
    }

    .math-topic-page .math-practice-spotlight {
        padding: 24px 20px;
    }
}


/* =========================================
   LOGIC AND TRUTH TABLES
   ========================================= */

.logic-topic-page .logic-example-grid,
.logic-topic-page .logic-operator-grid,
.logic-topic-page .logic-law-grid,
.logic-topic-page .logic-classification-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 18px 0;
}

.logic-topic-page .logic-example-card,
.logic-topic-page .logic-operator-card,
.logic-topic-page .logic-law-card,
.logic-topic-page .logic-classification-grid article {
    min-width: 0;
    padding: 19px;
    border: 1px solid #D8E3EF;
    border-left: 5px solid #60A5FA;
    border-radius: 11px;
    background: #F8FAFC;
}

.logic-topic-page .logic-example-card > span,
.logic-topic-page .logic-operator-card > span,
.logic-topic-page .logic-law-card > span,
.logic-topic-page .logic-classification-grid article > span {
    display: block;
    margin-bottom: 7px;
    color: #1D4ED8;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.8px;
}

.logic-topic-page .logic-example-card h3,
.logic-topic-page .logic-operator-card h3,
.logic-topic-page .logic-classification-grid h3 {
    margin: 0 0 7px;
    color: #153B6F;
}

.logic-topic-page .logic-example-card p,
.logic-topic-page .logic-operator-card p,
.logic-topic-page .logic-law-card p,
.logic-topic-page .logic-classification-grid p {
    margin: 0;
    color: #475569;
    line-height: 1.6;
}

.logic-topic-page .logic-true-card {
    border-color: #A7F3D0;
    border-left-color: #10B981;
    background: #ECFDF5;
}

.logic-topic-page .logic-true-card > span {
    color: #047857;
}

.logic-topic-page .logic-false-card {
    border-color: #FECDD3;
    border-left-color: #F43F5E;
    background: #FFF1F2;
}

.logic-topic-page .logic-false-card > span {
    color: #BE123C;
}

.logic-topic-page .logic-neutral-card {
    border-color: #E2E8F0;
    border-left-color: #94A3B8;
    background: #F8FAFC;
}

.logic-topic-page .logic-neutral-card > span {
    color: #64748B;
}

.logic-topic-page .logic-operator-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.logic-topic-page .logic-two-column-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.logic-topic-page .logic-and-card {
    border-left-color: #2563EB;
    background: #EFF6FF;
}

.logic-topic-page .logic-or-card {
    border-left-color: #10B981;
    background: #ECFDF5;
}

.logic-topic-page .logic-or-card > span {
    color: #047857;
}

.logic-topic-page .logic-xor-card {
    border-left-color: #8B5CF6;
    background: #F5F3FF;
}

.logic-topic-page .logic-xor-card > span {
    color: #6D28D9;
}

.logic-topic-page .logic-implies-card {
    border-left-color: #F59E0B;
    background: #FFFBEB;
}

.logic-topic-page .logic-implies-card > span {
    color: #B45309;
}

.logic-topic-page .logic-equivalent-card {
    border-left-color: #06B6D4;
    background: #ECFEFF;
}

.logic-topic-page .logic-equivalent-card > span {
    color: #0E7490;
}

.math-table-wrap {
    width: 100%;
    margin: 20px 0;
    overflow-x: auto;
    border-radius: 11px;
}

.logic-topic-page .logic-truth-table {
    min-width: 520px;
    margin: 0;
    text-align: center;
}

.logic-topic-page .logic-truth-table th {
    background: #153B6F;
    color: #FFFFFF;
    text-align: center;
}

.logic-topic-page .logic-truth-table td {
    text-align: center;
    font-weight: 700;
}

.logic-topic-page .logic-truth-table tbody tr:nth-child(even) {
    background: #F8FAFC;
}

.logic-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 900;
}

.logic-value.is-true {
    background: #DCFCE7;
    color: #15803D;
}

.logic-value.is-false {
    background: #FFE4E6;
    color: #BE123C;
}

.logic-topic-page .content-card .logic-numbered-steps {
    counter-reset: logic-step;
    list-style: none;
    padding-left: 0;
}

.logic-topic-page .content-card .logic-numbered-steps li {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 12px 0;
    padding: 15px 18px;
    border: 1px solid #D8E3EF;
    border-radius: 10px;
    background: #F8FAFC;
}

.logic-topic-page .content-card .logic-numbered-steps li::before {
    counter-increment: logic-step;
    content: counter(logic-step);
    display: flex;
    flex: 0 0 32px;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #2563EB;
    color: #FFFFFF;
    font-weight: 800;
}

.logic-topic-page .content-card .logic-numbered-steps li > span {
    min-width: 0;
    line-height: 1.55;
}

.logic-topic-page .logic-row-count-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.logic-topic-page .logic-row-count-grid div {
    padding: 16px 12px;
    border: 1px solid #BFDBFE;
    border-radius: 10px;
    background: #EFF6FF;
    text-align: center;
}

.logic-topic-page .logic-row-count-grid strong,
.logic-topic-page .logic-row-count-grid span {
    display: block;
}

.logic-topic-page .logic-row-count-grid strong {
    margin-bottom: 5px;
    color: #153B6F;
}

.logic-topic-page .logic-row-count-grid span {
    color: #1D4ED8;
    font-weight: 800;
}

.logic-topic-page .logic-law-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.logic-topic-page .logic-law-card strong {
    display: block;
    margin-bottom: 8px;
    color: #153B6F;
    font-size: 18px;
}

.logic-topic-page .logic-law-card.math-tone-purple > span {
    color: #6D28D9;
}

.logic-topic-page .logic-law-card.math-tone-green > span {
    color: #047857;
}

.logic-topic-page .logic-classification-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.logic-topic-page .logic-classification-grid article:nth-child(1) {
    border-left-color: #10B981;
    background: #ECFDF5;
}

.logic-topic-page .logic-classification-grid article:nth-child(2) {
    border-left-color: #F43F5E;
    background: #FFF1F2;
}

.logic-topic-page .logic-classification-grid article:nth-child(3) {
    border-left-color: #F59E0B;
    background: #FFFBEB;
}

.logic-topic-page .logic-truth-lab {
    border-left: 5px solid #8B5CF6;
}

.logic-topic-page .logic-lab-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: end;
    margin-top: 20px;
}

.logic-topic-page .logic-lab-controls label {
    display: block;
    margin-bottom: 7px;
    color: #334155;
    font-weight: 800;
}

.logic-topic-page .logic-lab-controls select {
    width: 100%;
    min-height: 44px;
    padding: 10px 13px;
    border: 1px solid #CBD5E1;
    border-radius: 9px;
    background: #FFFFFF;
    color: #0F172A;
    font: inherit;
}

.logic-topic-page .logic-lab-controls select:focus {
    outline: none;
    border-color: #8B5CF6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.13);
}

.logic-topic-page .logic-expression-meaning {
    margin-top: 16px;
    padding: 14px 16px;
    border: 1px solid #DDD6FE;
    border-left: 4px solid #8B5CF6;
    border-radius: 9px;
    background: #F5F3FF;
    color: #5B21B6;
    font-weight: 700;
}

.logic-topic-page .logic-generated-table {
    min-width: 420px;
}

.logic-topic-page .logic-code-table {
    min-width: 720px;
    margin: 0;
}

.math-topic-page .math-topic-navigation .math-nav-disabled {
    padding: 11px 16px;
    border: 1px solid #E2E8F0;
    border-radius: 9px;
    background: #F8FAFC;
    color: #94A3B8;
    font-weight: 700;
}

@media (max-width: 900px) {
    .logic-topic-page .logic-operator-grid,
    .logic-topic-page .logic-law-grid,
    .logic-topic-page .logic-classification-grid {
        grid-template-columns: 1fr;
    }

    .logic-topic-page .logic-two-column-grid {
        grid-template-columns: 1fr;
    }

    .logic-topic-page .logic-row-count-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .logic-topic-page .logic-example-grid,
    .logic-topic-page .logic-lab-controls {
        grid-template-columns: 1fr;
    }

    .logic-topic-page .logic-row-count-grid {
        grid-template-columns: 1fr;
    }

    .logic-topic-page .logic-lab-controls .primary-button {
        width: 100%;
        text-align: center;
    }

    .math-topic-page .math-topic-navigation .math-nav-disabled {
        text-align: center;
    }
}


/* =========================================
   SETS AND VENN DIAGRAMS
========================================= */

.sets-topic-page .sets-notation-grid,
.sets-topic-page .sets-method-grid,
.sets-topic-page .sets-type-grid,
.sets-topic-page .sets-operation-grid,
.sets-topic-page .sets-region-grid,
.sets-topic-page .sets-programming-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.sets-topic-page .sets-notation-card,
.sets-topic-page .sets-method-grid article,
.sets-topic-page .sets-type-grid article,
.sets-topic-page .sets-operation-card,
.sets-topic-page .sets-region-grid article,
.sets-topic-page .sets-programming-grid article {
    padding: 18px;
    border: 1px solid #D8E2F0;
    border-top: 4px solid #2B67E8;
    border-radius: 12px;
    background: #F8FBFF;
}

.sets-topic-page .sets-notation-card strong,
.sets-topic-page .sets-method-grid strong,
.sets-topic-page .sets-operation-card strong,
.sets-topic-page .sets-region-grid strong,
.sets-topic-page .sets-programming-grid strong {
    display: block;
    margin-bottom: 8px;
    color: #0B3E82;
    font-size: 1.05rem;
}

.sets-topic-page .sets-type-grid article:nth-child(2n),
.sets-topic-page .sets-region-grid article:nth-child(2n) {
    border-top-color: #8B5CF6;
    background: #FAF7FF;
}

.sets-topic-page .sets-type-grid article:nth-child(3n),
.sets-topic-page .sets-region-grid article:nth-child(3n) {
    border-top-color: #12A35A;
    background: #F2FCF6;
}

.sets-topic-page .sets-region-grid article span {
    display: block;
    margin-bottom: 8px;
    color: #64748B;
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.sets-topic-page .sets-law-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.sets-topic-page .sets-law-list > * {
    padding: 16px 18px;
    border: 1px solid #F4D38B;
    border-left: 5px solid #E2AA1F;
    border-radius: 10px;
    background: #FFF9E9;
}

.sets-topic-page .sets-law-list > * strong {
    display: block;
    margin-bottom: 5px;
    color: #8A5200;
}

.sets-topic-page .sets-venn-lab {
    border-left: 5px solid #8B5CF6;
    background: linear-gradient(145deg, #FFFFFF 0%, #F7F5FF 100%);
}

.sets-topic-page .sets-lab-inputs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    max-width: 980px;
    margin: 18px 0 14px;
}

.sets-topic-page .sets-lab-inputs label {
    color: #334155;
    font-weight: 800;
}

.sets-topic-page .sets-lab-inputs input,
.sets-topic-page .sets-lab-inputs select {
    display: block;
    width: 100%;
    min-height: 42px;
    margin-top: 7px;
    padding: 10px 13px;
    border: 1px solid #CBD5E1;
    border-radius: 9px;
    background: #FFFFFF;
    color: #0F172A;
    font: inherit;
}

.sets-topic-page .sets-lab-inputs input:focus,
.sets-topic-page .sets-lab-inputs select:focus {
    outline: none;
    border-color: #8B5CF6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.14);
}

.sets-topic-page .sets-venn-svg {
    display: block;
    width: min(100%, 560px);
    height: auto;
    margin: 18px auto 14px;
    border-radius: 16px;
    background: #F8FAFC;
}

.sets-topic-page .sets-universe {
    fill: #EEF4FC;
    stroke: #475569;
    stroke-width: 3;
}

.sets-topic-page .sets-circle-base {
    fill: rgba(255, 255, 255, 0.62);
    stroke: #0B3E82;
    stroke-width: 4;
}

.sets-topic-page .sets-fill-a {
    fill: rgba(43, 103, 232, 0.56);
}

.sets-topic-page .sets-fill-b {
    fill: rgba(139, 92, 246, 0.54);
}

.sets-topic-page .sets-fill-overlap {
    fill: rgba(226, 170, 31, 0.86);
}

.sets-topic-page .sets-fill-complement {
    fill: rgba(18, 163, 90, 0.36);
}

.sets-topic-page .sets-venn-label {
    fill: #0F172A;
    font-size: 24px;
    font-weight: 900;
}

.sets-topic-page .sets-u-label {
    fill: #475569;
    font-size: 18px;
}

.sets-topic-page .sets-visualizer-result {
    width: min(100%, 720px);
    min-height: 50px;
    margin: 0 auto;
    padding: 13px 16px;
    border: 1px solid #BBD0F4;
    border-left: 5px solid #2B67E8;
    border-radius: 10px;
    background: #EFF6FF;
    color: #0B3E82;
    font-size: 1.05rem;
    font-weight: 800;
}

.math-page [hidden],
.math-practice-page [hidden] {
    display: none !important;
}


/* =========================================
   MATHEMATICS TEST MODE
========================================= */

.math-practice-page .math-test-shell {
    padding: 28px;
}

.math-practice-page .math-test-instructions {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    margin-bottom: 24px;
    padding: 18px 20px;
    border: 1px solid #BFDBFE;
    border-left: 5px solid #2563EB;
    border-radius: 11px;
    background: #EFF6FF;
}

.math-practice-page .math-test-instructions h2 {
    margin: 0 0 7px;
    color: #153B6F;
}

.math-practice-page .math-test-instructions p {
    margin: 0;
    color: #475569;
    line-height: 1.6;
}

.math-practice-page .math-test-count {
    flex: 0 0 auto;
    padding: 9px 13px;
    border-radius: 999px;
    background: #FFFFFF;
    color: #1D4ED8;
    font-weight: 800;
    white-space: nowrap;
}

.math-practice-page .math-test-question {
    margin: 18px 0;
    padding: 22px;
    border: 1px solid #D8E3EF;
    border-left: 5px solid #60A5FA;
    border-radius: 12px;
    background: #F8FBFF;
}

.math-practice-page .math-test-question:nth-child(even) {
    border-left-color: #8B5CF6;
    background: #FAF8FF;
}

.math-practice-page .math-test-question.is-unanswered {
    border-color: #F59E0B;
    border-left-color: #EA580C;
    background: #FFF7ED;
}

.math-practice-page .math-test-question-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.math-practice-page .math-test-question-number {
    color: #153B6F;
    font-weight: 900;
}

.math-practice-page .math-test-difficulty {
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.math-practice-page .math-test-difficulty.easy {
    background: #DCFCE7;
    color: #166534;
}

.math-practice-page .math-test-difficulty.medium {
    background: #FEF3C7;
    color: #92400E;
}

.math-practice-page .math-test-difficulty.hard {
    background: #FFE4E6;
    color: #BE123C;
}

.math-practice-page .math-test-question-text {
    margin: 0 0 16px;
    color: #0F172A;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.6;
}

.math-practice-page .math-test-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.math-practice-page .math-test-option {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    min-width: 0;
    padding: 13px 14px;
    border: 1px solid #CBD5E1;
    border-radius: 9px;
    background: #FFFFFF;
    color: #334155;
    cursor: pointer;
    line-height: 1.5;
}

.math-practice-page .math-test-option:hover {
    border-color: #60A5FA;
    background: #EFF6FF;
}

.math-practice-page .math-test-option.is-selected {
    border-color: #2563EB;
    background: #DBEAFE;
    color: #153B6F;
    font-weight: 700;
}

.math-practice-page .math-test-option input {
    flex: 0 0 auto;
    margin-top: 4px;
    accent-color: #2563EB;
}

.math-practice-page .math-test-submit-panel {
    position: sticky;
    bottom: 12px;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-top: 26px;
    padding: 17px 20px;
    border: 1px solid #CBD5E1;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(8px);
}

.math-practice-page .math-test-notice {
    margin: 0;
    color: #B45309;
    font-weight: 700;
}

.math-practice-page .math-test-submit-button {
    flex: 0 0 auto;
}

.math-practice-page .math-test-result {
    display: none;
    padding: 30px;
    border: 1px solid #D8E3EF;
    border-radius: 14px;
    background: #FFFFFF;
}

.math-practice-page .math-test-result-summary {
    padding: 24px;
    border: 1px solid #BBF7D0;
    border-left: 6px solid #16A34A;
    border-radius: 12px;
    background: #F0FDF4;
    text-align: center;
}

.math-practice-page .math-test-result-summary h2 {
    margin-top: 0;
    color: #166534;
}

.math-practice-page .math-test-score {
    margin: 10px 0;
    color: #153B6F;
    font-size: 38px;
    font-weight: 900;
}

.math-practice-page .math-answer-review {
    margin-top: 28px;
}

.math-practice-page .math-answer-review > h2 {
    color: #153B6F;
}

.math-practice-page .math-review-card {
    margin: 16px 0;
    padding: 20px;
    border: 1px solid #D8E3EF;
    border-left: 5px solid #16A34A;
    border-radius: 11px;
    background: #F8FAFC;
}

.math-practice-page .math-review-card.is-wrong {
    border-left-color: #DC2626;
    background: #FFF7F7;
}

.math-practice-page .math-review-card h3 {
    margin: 0 0 9px;
    color: #153B6F;
}

.math-practice-page .math-review-question {
    color: #0F172A;
    font-weight: 700;
    line-height: 1.55;
}

.math-practice-page .math-review-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 16px 0;
}

.math-practice-page .math-review-option {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid #CBD5E1;
    border-radius: 9px;
    background: #FFFFFF;
    color: #334155;
}

.math-practice-page .math-review-option-letter {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 50%;
    background: #E2E8F0;
    color: #334155;
    font-size: 13px;
    font-weight: 900;
}

.math-practice-page .math-review-option-text {
    min-width: 0;
    line-height: 1.45;
}

.math-practice-page .math-review-option-status {
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.math-practice-page .math-review-option.is-correct-answer {
    border-color: #86EFAC;
    background: #F0FDF4;
    color: #166534;
}

.math-practice-page .math-review-option.is-correct-answer .math-review-option-letter {
    background: #16A34A;
    color: #FFFFFF;
}

.math-practice-page .math-review-option.is-selected-wrong {
    border-color: #FCA5A5;
    background: #FFF1F2;
    color: #B91C1C;
}

.math-practice-page .math-review-option.is-selected-wrong .math-review-option-letter {
    background: #DC2626;
    color: #FFFFFF;
}

.math-practice-page .math-review-option.is-selected-correct {
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.16);
}

.math-practice-page .math-review-explanation {
    margin-top: 13px;
    padding: 13px 15px;
    border-radius: 8px;
    background: #EFF6FF;
    color: #1E3A5F;
    line-height: 1.65;
}

.math-practice-page .math-test-result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

@media (max-width: 700px) {
    .math-practice-page .math-test-shell,
    .math-practice-page .math-test-result {
        padding: 20px 15px;
    }

    .math-practice-page .math-test-instructions,
    .math-practice-page .math-test-submit-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .math-practice-page .math-test-options {
        grid-template-columns: 1fr;
    }

    .math-practice-page .math-review-options {
        grid-template-columns: 1fr;
    }

    .math-practice-page .math-test-submit-button {
        width: 100%;
    }

    .math-practice-page .math-review-option {
        grid-template-columns: 34px minmax(0, 1fr);
    }

    .math-practice-page .math-review-option-status {
        grid-column: 2;
        white-space: normal;
    }
}

.sets-topic-page .sets-visualizer-result.is-error {
    border-color: #F8B4B4;
    border-left-color: #DC2626;
    background: #FFF1F2;
    color: #B91C1C;
}

@media (max-width: 900px) {
    .sets-topic-page .sets-notation-grid,
    .sets-topic-page .sets-method-grid,
    .sets-topic-page .sets-type-grid,
    .sets-topic-page .sets-operation-grid,
    .sets-topic-page .sets-region-grid,
    .sets-topic-page .sets-programming-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .sets-topic-page .sets-notation-grid,
    .sets-topic-page .sets-method-grid,
    .sets-topic-page .sets-type-grid,
    .sets-topic-page .sets-operation-grid,
    .sets-topic-page .sets-region-grid,
    .sets-topic-page .sets-programming-grid,
    .sets-topic-page .sets-law-list,
    .sets-topic-page .sets-lab-inputs {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   NUMBER SYSTEM PRACTICE WORKSPACE
   ========================================= */

.math-practice-page .math-test-content.has-calculation-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 20px;
    align-items: start;
}

.math-practice-page .math-calculation-tools {
    position: sticky;
    top: 88px;
    overflow: hidden;
    border: 1px solid #BBD0F4;
    border-radius: 13px;
    background: #FFFFFF;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.10);
}

.math-practice-page .math-calculation-tools-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 17px;
    background: linear-gradient(135deg, #153B6F, #2563EB);
    color: #FFFFFF;
    cursor: pointer;
    list-style: none;
}

.math-practice-page .math-calculation-tools-summary::-webkit-details-marker {
    display: none;
}

.math-practice-page .math-calculation-tools-title {
    font-weight: 900;
}

.math-practice-page .math-calculation-tools-toggle {
    color: #DBEAFE;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
}

.math-practice-page .math-calculation-tools-body {
    padding: 16px;
}

.math-practice-page .math-calculation-tools-note {
    margin: 0 0 14px;
    padding: 10px 12px;
    border-left: 4px solid #D4AF37;
    border-radius: 7px;
    background: #FFFBEB;
    color: #713F12;
    font-size: 12px;
    line-height: 1.55;
}

.math-practice-page .math-workspace-label {
    display: block;
    margin-bottom: 7px;
    color: #153B6F;
    font-size: 13px;
    font-weight: 900;
}

.math-practice-page .math-rough-workspace {
    width: 100%;
    min-height: 135px;
    box-sizing: border-box;
    padding: 12px;
    border: 1px solid #CBD5E1;
    border-radius: 9px;
    background: #F8FAFC;
    color: #0F172A;
    font: 14px/1.55 "Courier New", monospace;
    resize: vertical;
}

.math-practice-page .math-rough-workspace:focus {
    border-color: #2563EB;
    outline: 3px solid rgba(37, 99, 235, 0.14);
    background: #FFFFFF;
}

.math-practice-page .math-workspace-clear {
    width: 100%;
    margin-top: 8px;
    padding: 9px 12px;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    background: #F1F5F9;
    color: #475569;
    cursor: pointer;
    font-weight: 800;
}

.math-practice-page .math-workspace-clear:hover {
    border-color: #94A3B8;
    background: #E2E8F0;
}

.math-practice-page .math-calculator {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #E2E8F0;
}

.math-practice-page .math-calculator h3 {
    margin: 0 0 10px;
    color: #153B6F;
    font-size: 15px;
}

.math-practice-page .math-calculator-display {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
    padding: 12px 13px;
    border: 1px solid #94A3B8;
    border-radius: 9px;
    background: #0F172A;
    color: #F8FAFC;
    font: 700 24px/1.2 "Courier New", monospace;
    text-align: right;
}

.math-practice-page .math-calculator-keypad {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
}

.math-practice-page .math-calculator-key {
    min-height: 43px;
    padding: 8px 5px;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    background: #F8FAFC;
    color: #0F172A;
    cursor: pointer;
    font-size: 15px;
    font-weight: 900;
}

.math-practice-page .math-calculator-key:hover {
    border-color: #60A5FA;
    background: #EFF6FF;
}

.math-practice-page .math-calculator-key.is-action {
    background: #F1F5F9;
    color: #475569;
}

.math-practice-page .math-calculator-key.is-operator {
    border-color: #BFDBFE;
    background: #DBEAFE;
    color: #1D4ED8;
}

.math-practice-page .math-calculator-key.is-equals {
    grid-column: 1 / -1;
    border-color: #1D4ED8;
    background: #2563EB;
    color: #FFFFFF;
}

.math-practice-page .math-calculator-key.is-equals:hover {
    background: #1D4ED8;
}

@media (max-width: 1050px) {
    .math-practice-page .math-test-content.has-calculation-tools {
        grid-template-columns: 1fr;
    }

    .math-practice-page .math-calculation-tools {
        position: static;
        order: -1;
    }
}
