.maths-grid,
.maths-grid--three,
.maths-support-grid,
.maths-path-grid,
.maths-visual-grid {
    display: grid;
    gap: 1rem;
}

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

.maths-grid--three,
.maths-support-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.maths-path-grid,
.maths-visual-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.maths-card,
.maths-path-card,
.maths-visual-card {
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 0;
    padding: 1.15rem 1.2rem;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.maths-card h3,
.maths-path-card h3,
.maths-visual-card h3 {
    margin-top: 0;
}

.maths-support-card {
    border-top: 4px solid #2563eb;
}

.maths-support-card--support {
    border-top-color: #0f766e;
}

.maths-support-card--core {
    border-top-color: #2563eb;
}

.maths-support-card--stretch {
    border-top-color: #c2410c;
}

.maths-equation-box,
.maths-example-box {
    background: linear-gradient(145deg, rgba(224, 242, 254, 0.85), rgba(248, 250, 252, 0.98));
    border: 1px solid rgba(14, 116, 144, 0.16);
    border-radius: 0;
    padding: 1rem 1.1rem;
}

.maths-equation-box p:last-child,
.maths-example-box p:last-child,
.maths-card p:last-child,
.maths-path-card p:last-child,
.maths-visual-card p:last-child {
    margin-bottom: 0;
}

.maths-table,
.maths-table table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.maths-table th,
.maths-table td,
.maths-table table th,
.maths-table table td {
    border: 1px solid rgba(15, 23, 42, 0.14);
    padding: 0.78rem;
    text-align: left;
    vertical-align: top;
}

.maths-table th,
.maths-table table th {
    background: rgba(14, 116, 144, 0.08);
    color: #123b2f;
}

.maths-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.85rem;
}

.maths-chip-row span {
    background: rgba(14, 116, 144, 0.09);
    border-radius: 999px;
    color: #164e63;
    font-size: 0.92rem;
    padding: 0.35rem 0.75rem;
}

.maths-lines,
.maths-sketch-box {
    min-height: 108px;
    border: 1px dashed rgba(15, 23, 42, 0.18);
    border-radius: 0;
    background:
        repeating-linear-gradient(
            to bottom,
            rgba(255, 255, 255, 0.99) 0,
            rgba(255, 255, 255, 0.99) 1.8rem,
            rgba(15, 23, 42, 0.08) 1.8rem,
            rgba(15, 23, 42, 0.08) calc(1.8rem + 1px)
        );
}

.maths-sketch-box {
    min-height: 150px;
    background:
        linear-gradient(rgba(15, 23, 42, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, 0.08) 1px, transparent 1px),
        #fff;
    background-size: 28px 28px;
}

.maths-step-list,
.maths-sequence-list {
    margin: 0;
    padding-left: 1.2rem;
}

.maths-step-list li,
.maths-sequence-list li {
    margin-bottom: 0.55rem;
}

.maths-centre {
    text-align: center;
}

@media (max-width: 900px) {
    .maths-grid,
    .maths-grid--three,
    .maths-support-grid,
    .maths-path-grid,
    .maths-visual-grid {
        grid-template-columns: 1fr;
    }
}

@media print {
    .maths-card,
    .maths-path-card,
    .maths-visual-card,
    .maths-equation-box,
    .maths-example-box {
        box-shadow: none !important;
        break-inside: avoid-page;
        background: white !important;
    }

    .maths-table,
    .maths-table table,
    .maths-support-grid,
    .maths-path-grid,
    .maths-visual-grid {
        break-inside: avoid-page;
    }
}
