.grade-shell {
    max-width: 1760px;
    margin: 0 auto;
    padding: 18px 18px 36px;
}

.grade-hero {
    position: relative;
    min-height: 238px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 420px 1fr;
    align-items: center;
    gap: 34px;
    padding: 18px 60px;
    border-radius: 14px;
    color: #fff;
    direction: ltr;
    background:
        linear-gradient(90deg, rgba(4, 37, 43, .18), rgba(5, 50, 56, .82) 62%, rgba(5, 38, 47, .98)),
        url("/images/home-hero-board.jpg") center / cover no-repeat;
    box-shadow: 0 12px 32px rgba(16, 34, 61, .14);
}

.grade-hero img {
    align-self: end;
    justify-self: start;
    width: 285px;
    max-height: 220px;
    object-fit: contain;
    object-position: bottom left;
    filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .18));
}

.grade-hero > div {
    direction: rtl;
    justify-self: end;
    text-align: right;
}

.grade-hero h1 {
    position: relative;
    z-index: 2;
    margin: 0;
    font-size: 42px;
    line-height: 1.35;
    font-weight: 950;
}

.grade-hero p {
    position: relative;
    z-index: 2;
    margin: 18px 0 0;
    font-size: 26px;
    font-weight: 950;
    color: #b8f28d;
}

.grade-hero a {
    display: none;
}

.chalk {
    position: absolute;
    color: rgba(255, 255, 255, .58);
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
    pointer-events: none;
}

.c1 { right: 64px; top: 38px; font-size: 28px; }
.c2 { left: 248px; top: 34px; font-size: 40px; }
.c3 { left: 92px; top: 92px; font-size: 28px; }
.c4 { left: 290px; bottom: 56px; font-size: 24px; }

.grade-board {
    display: grid;
    grid-template-columns: minmax(560px, 1.05fr) minmax(720px, 1.25fr);
    gap: 42px;
    margin-top: 22px;
}

.grade-picker,
.topic-results {
    border: 1px solid #d6e1ee;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(16, 34, 61, .07);
}

.grade-picker {
    padding: 24px 22px 26px;
}

.topic-results {
    position: relative;
    padding: 24px 24px 20px;
    border-color: #0b63e5;
    box-shadow: 0 12px 30px rgba(11, 99, 229, .10);
    scroll-margin-top: 18px;
    transition: opacity .18s ease, transform .18s ease;
}

.topic-results.is-loading {
    opacity: .54;
    transform: translateY(4px);
    pointer-events: none;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 24px;
    text-align: center;
}

.section-title h2 {
    margin: 0;
    color: #0b3d91;
    font-size: 29px;
    line-height: 1.2;
    font-weight: 950;
}

.grade-picker .section-title h2 {
    color: #10223d;
}

.section-title p {
    margin: 8px 0 0;
    color: #56657a;
    font-size: 16px;
    line-height: 1.75;
}

.title-icon {
    width: 50px;
    height: 50px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: linear-gradient(145deg, #edf6ff, #d8eaff);
}

.cap-icon::before {
    content: "";
    width: 34px;
    height: 24px;
    background: linear-gradient(135deg, #0d73f6, #064bb5);
    clip-path: polygon(50% 0, 100% 28%, 50% 56%, 0 28%);
    box-shadow: 0 12px 0 -3px #0a5cca;
}

.book-stack::before {
    content: "";
    width: 30px;
    height: 36px;
    border-radius: 7px;
    background:
        linear-gradient(#fff, #fff) 8px 11px / 22px 4px no-repeat,
        linear-gradient(#fff, #fff) 8px 22px / 22px 4px no-repeat,
        linear-gradient(135deg, #0d73f6, #064bb5);
    box-shadow: -9px 9px 0 #9fc9ff;
}

.grade-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.grade-option {
    min-height: 114px;
    display: grid;
    grid-template-columns: 40px 1fr 44px;
    grid-template-rows: 1fr;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border: 1px solid #d9e1ea;
    border-radius: 10px;
    background: linear-gradient(180deg, #fff, #fcfdff);
    color: #172742;
    box-shadow: 0 8px 18px rgba(16, 34, 61, .06);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.grade-option:hover,
.grade-option.active {
    border-color: #0b63e5;
    box-shadow: 0 12px 28px rgba(11, 99, 229, .12);
    transform: translateY(-1px);
}

.grade-option.active {
    color: #0b63e5;
    outline: 2px solid rgba(11, 99, 229, .08);
}

.grade-check {
    width: 31px;
    height: 31px;
    grid-column: 1;
    grid-row: 1;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #edf3fb;
}

.grade-option.active .grade-check {
    background: #0b63e5;
}

.grade-check::before {
    content: "";
    width: 12px;
    height: 8px;
    border-right: 3px solid #8aa2bd;
    border-bottom: 3px solid #8aa2bd;
    transform: rotate(45deg) translate(-1px, -1px);
}

.grade-option.active .grade-check::before {
    border-color: #fff;
}

.grade-book {
    grid-column: 3;
    grid-row: 1;
    width: 44px;
    height: 44px;
    color: #0b63e5;
    position: relative;
    display: grid;
    place-items: center;
}

.grade-book::before {
    content: "";
    position: absolute;
}

.grade-book::after {
    content: "";
    position: absolute;
}

.grade-book.math {
    border: 3px solid currentColor;
    border-radius: 9px;
}

.grade-book.math::before {
    inset: 8px;
    background:
        linear-gradient(currentColor, currentColor) 0 0 / 7px 7px no-repeat,
        linear-gradient(currentColor, currentColor) 50% 0 / 7px 7px no-repeat,
        linear-gradient(currentColor, currentColor) 100% 0 / 7px 7px no-repeat,
        linear-gradient(currentColor, currentColor) 0 50% / 7px 7px no-repeat,
        linear-gradient(currentColor, currentColor) 50% 50% / 7px 7px no-repeat,
        linear-gradient(currentColor, currentColor) 100% 50% / 7px 7px no-repeat,
        linear-gradient(currentColor, currentColor) 0 100% / 7px 7px no-repeat,
        linear-gradient(currentColor, currentColor) 50% 100% / 7px 7px no-repeat,
        linear-gradient(currentColor, currentColor) 100% 100% / 7px 7px no-repeat;
}

.grade-book.experimental {
    color: #159947;
}

.grade-book.experimental::before {
    right: 12px;
    left: 12px;
    top: 5px;
    height: 16px;
    border: 4px solid currentColor;
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
}

.grade-book.experimental::after {
    right: 6px;
    left: 6px;
    bottom: 4px;
    height: 24px;
    border: 4px solid currentColor;
    border-top: 0;
    border-radius: 0 0 16px 16px;
    background: linear-gradient(180deg, transparent 45%, rgba(21, 153, 71, .18) 45%);
}

.grade-book.humanities {
    color: #f97316;
}

.grade-book.humanities::before,
.grade-book.humanities::after {
    top: 8px;
    width: 17px;
    height: 28px;
    border: 4px solid currentColor;
    background: rgba(249, 115, 22, .08);
}

.grade-book.humanities::before {
    right: 5px;
    border-left: 0;
    border-radius: 2px 14px 14px 2px;
}

.grade-book.humanities::after {
    left: 5px;
    border-right: 0;
    border-radius: 14px 2px 2px 14px;
}

.grade-book.konkur {
    box-shadow: 0 0 0 7px rgba(13, 101, 255, .08);
}

.grade-book.math.konkur {
    color: #0b63e5;
}

.grade-book.experimental.konkur {
    color: #0f9951;
}

.grade-book.humanities.konkur {
    color: #f97316;
}

.grade-option strong {
    font-size: 20px;
    line-height: 1.25;
    font-weight: 950;
}

.grade-option small {
    display: none;
}

.topic-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.topic-card {
    min-height: 180px;
    display: grid;
    grid-template-columns: 96px 1fr;
    grid-template-rows: 1fr auto;
    align-items: center;
    gap: 16px 14px;
    padding: 14px;
    border: 1px solid #dbe5f0;
    border-radius: 10px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .94), rgba(248, 251, 255, .96)),
        radial-gradient(circle at 24% 8%, rgba(11, 99, 229, .13), transparent 34%);
    box-shadow: 0 10px 22px rgba(16, 34, 61, .05);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.topic-card:hover {
    transform: translateY(-2px);
    border-color: #0b63e5;
    box-shadow: 0 16px 30px rgba(11, 99, 229, .13);
}

.topic-symbol {
    width: 92px;
    height: 92px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(13, 101, 255, .18);
    background: #eef6ff;
}

.topic-symbol::before,
.topic-symbol::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    background: currentColor;
    opacity: .13;
}

.topic-symbol::before {
    width: 72px;
    height: 72px;
    top: -26px;
    right: -18px;
}

.topic-symbol::after {
    width: 54px;
    height: 54px;
    left: -18px;
    bottom: -18px;
}

.topic-symbol b {
    direction: ltr;
    color: currentColor;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 22px;
    font-weight: 900;
    line-height: 1.25;
    text-align: center;
    position: relative;
    z-index: 1;
}

.topic-symbol.blue { color: #0d65ff; background: #eef6ff; }
.topic-symbol.teal { color: #008b87; background: #ecfffb; }
.topic-symbol.violet { color: #7c3aed; background: #f4efff; }
.topic-symbol.orange { color: #f18400; background: #fff4df; }
.topic-symbol.purple { color: #9a42d8; background: #f7edff; }
.topic-symbol.red { color: #ef3152; background: #fff0f4; }
.topic-symbol.green { color: #149b55; background: #eefbf4; }

.topic-copy {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.topic-card strong {
    color: #101f38;
    font-size: 19px;
    line-height: 1.3;
    font-weight: 950;
    text-align: right;
}

.topic-copy small {
    color: #66758a;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.7;
}

.topic-formula {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #27364d;
    font-family: Georgia, "Times New Roman", "BRoya", serif;
    font-size: 22px;
    line-height: 1.4;
    text-align: center;
}

.topic-meta {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: center;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid #dfe7f0;
    color: #1b2b45;
    font-size: 12px;
    font-weight: 850;
}

.topic-meta span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 34px;
    border: 1px solid #e2e9f1;
    border-radius: 8px;
    background: #fff;
}

.topic-meta i {
    width: 18px;
    height: 18px;
    display: inline-block;
    position: relative;
    flex: 0 0 auto;
}

.video-stat i {
    border-radius: 50%;
    background: #1877f2;
}

.video-stat i::before {
    content: "";
    position: absolute;
    right: 7px;
    top: 5px;
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-right: 6px solid #fff;
}

.quiz-stat i {
    border: 2px solid #ff7a1a;
    border-radius: 5px;
}

.quiz-stat i::before {
    content: "";
    position: absolute;
    width: 8px;
    height: 4px;
    right: 3px;
    top: 4px;
    border-bottom: 2px solid #ff7a1a;
    border-left: 2px solid #ff7a1a;
    transform: rotate(-45deg);
}

.pdf-stat i {
    border-radius: 4px;
    background: #ff2f3e;
}

.pdf-stat i::before {
    content: "PDF";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 6px;
    font-weight: 950;
}

.topic-meta b {
    color: #0b63e5;
}

.topic-meta .video-stat b { color: #0d65ff; }
.topic-meta .quiz-stat b { color: #f26d16; }
.topic-meta .pdf-stat b { color: #ef2f3f; }

.selection-note {
    display: none;
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-top: 24px;
    border: 1px solid #cfe3fb;
    border-radius: 12px;
    background: linear-gradient(180deg, #eef7ff, #e6f2ff);
    color: #56657a;
    font-size: 18px;
    font-weight: 800;
}

.selection-note strong {
    color: #0b63e5;
    font-size: 22px;
    font-weight: 950;
}

.note-check {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #2f86ff;
}

.note-check::before {
    content: "";
    width: 13px;
    height: 8px;
    border-right: 3px solid #fff;
    border-bottom: 3px solid #fff;
    transform: rotate(45deg) translate(-1px, -1px);
}

.empty-topics {
    grid-column: 1 / -1;
    min-height: 150px;
    display: grid;
    place-items: center;
    border: 1px dashed #b8c8dc;
    border-radius: 14px;
    color: #64748b;
    font-size: 20px;
    font-weight: 900;
}

.topic-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-top: 34px;
}

.action-card {
    min-height: 168px;
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 150px 1fr 245px;
    grid-template-rows: auto auto auto;
    align-items: center;
    padding: 24px 34px;
    border: 1px solid #87c5ae;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(16, 34, 61, .06);
}

.action-card.green {
    border-color: #93b4ff;
}

.action-card strong {
    color: #0c7434;
    font-size: 30px;
    line-height: 1.25;
    font-weight: 950;
}

.action-card.green strong {
    color: #0b4cc2;
}

.action-card small {
    color: #56657a;
    font-size: 17px;
    font-weight: 800;
}

.action-card em {
    grid-column: 3;
    grid-row: 1 / span 3;
    width: 220px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0;
    border: 2px solid #0c8b3f;
    border-radius: 8px;
    color: #0c7434;
    font-size: 16px;
    font-style: normal;
    font-weight: 950;
}

.action-card.green em {
    border-color: #0b63e5;
    color: #0b4cc2;
}

.grid-mark,
.open-book-mark {
    grid-row: 1 / span 3;
    width: 92px;
    height: 92px;
    justify-self: center;
    border-radius: 50%;
    background: #fff4d9;
    position: relative;
}

.grid-mark::before {
    content: "";
    position: absolute;
    inset: 28px;
    background:
        linear-gradient(#f0a000, #f0a000) 0 0 / 27px 27px no-repeat,
        linear-gradient(#f0a000, #f0a000) 37px 0 / 27px 27px no-repeat,
        linear-gradient(#f0a000, #f0a000) 0 37px / 27px 27px no-repeat,
        linear-gradient(#f0a000, #f0a000) 37px 37px / 27px 27px no-repeat;
    border-radius: 8px;
}

.open-book-mark {
    background: #dff5e5;
}

.open-book-mark::before {
    content: "";
    position: absolute;
    right: 23px;
    top: 29px;
    width: 29px;
    height: 45px;
    border: 5px solid #0c8b3f;
    border-left: 0;
    border-radius: 0 18px 18px 0;
}

.open-book-mark::after {
    content: "";
    position: absolute;
    left: 23px;
    top: 29px;
    width: 29px;
    height: 45px;
    border: 5px solid #0c8b3f;
    border-right: 0;
    border-radius: 18px 0 0 18px;
}

@media (max-width: 1180px) {
    .grade-board,
    .topic-actions {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 760px) {
    .grade-shell {
        padding: 14px;
    }

    .grade-hero {
        grid-template-columns: 1fr;
        min-height: 320px;
        padding: 28px 22px;
        text-align: center;
    }

    .grade-hero img {
        display: none;
    }

    .grade-hero h1 {
        font-size: 34px;
    }

    .grade-hero p {
        font-size: 19px;
    }

    .grade-hero a {
        height: 50px;
        min-width: 170px;
        font-size: 19px;
    }

    .chalk {
        opacity: .55;
    }

    .c1 { right: 22px; top: 24px; font-size: 20px; }
    .c2 { left: 22px; top: 30px; font-size: 32px; }
    .c3 { left: 24px; bottom: 42px; top: auto; font-size: 22px; }
    .c4 { display: none; }

    .grade-board {
        gap: 14px;
        margin-top: 14px;
    }

    .grade-picker,
    .topic-results {
        padding: 16px;
        border-radius: 16px;
        scroll-margin-top: 158px;
    }

    .section-title {
        gap: 12px;
        margin-bottom: 16px;
    }

    .section-title h2 {
        font-size: 24px;
    }

    .section-title p {
        font-size: 15px;
        line-height: 1.6;
    }

    .title-icon {
        width: 54px;
        height: 54px;
        border-radius: 15px;
    }

    .grade-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .grade-option {
        min-height: 82px;
        grid-template-columns: 30px 1fr;
        padding: 11px;
        gap: 2px 8px;
    }

    .grade-check {
        width: 28px;
        height: 28px;
    }

    .grade-check::before {
        width: 11px;
        height: 7px;
        border-width: 2px;
    }

    .grade-book {
        display: none;
    }

    .grade-option strong {
        font-size: 17px;
    }

    .grade-option small {
        font-size: 13px;
    }

    .topic-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .topic-card {
        min-height: 156px;
        grid-template-columns: 74px 1fr;
        gap: 10px;
        padding: 12px;
    }

    .topic-symbol {
        width: 70px;
        height: 70px;
        border-radius: 14px;
    }

    .topic-symbol b {
        font-size: 17px;
    }

    .topic-card strong {
        font-size: 16px;
    }

    .topic-copy small {
        font-size: 12px;
        line-height: 1.5;
    }

    .topic-meta {
        gap: 6px;
        font-size: 11px;
    }

    .topic-meta span {
        min-height: 32px;
        gap: 3px;
        padding: 0 3px;
    }

    .selection-note {
        min-height: 54px;
        flex-wrap: wrap;
        padding: 10px;
        text-align: center;
        font-size: 15px;
    }

    .selection-note strong {
        font-size: 18px;
    }

    .topic-actions {
        gap: 12px;
        margin-top: 14px;
    }

    .action-card {
        min-height: 130px;
        grid-template-columns: 82px 1fr;
        padding: 16px;
    }

    .grid-mark,
    .open-book-mark {
        width: 70px;
        height: 70px;
    }

    .grid-mark::before {
        inset: 18px;
        background:
            linear-gradient(#f0a000, #f0a000) 0 0 / 18px 18px no-repeat,
            linear-gradient(#f0a000, #f0a000) 25px 0 / 18px 18px no-repeat,
            linear-gradient(#f0a000, #f0a000) 0 25px / 18px 18px no-repeat,
            linear-gradient(#f0a000, #f0a000) 25px 25px / 18px 18px no-repeat;
    }

    .open-book-mark::before,
    .open-book-mark::after {
        top: 19px;
        width: 20px;
        height: 34px;
        border-width: 4px;
    }

    .open-book-mark::before { right: 15px; }
    .open-book-mark::after { left: 15px; }

    .action-card strong {
        font-size: 22px;
    }

    .action-card small {
        font-size: 14px;
    }

    .action-card em {
        width: 100%;
        height: 38px;
        font-size: 14px;
    }
}

@media (max-width: 430px) {
    .grade-options,
    .topic-grid {
        grid-template-columns: 1fr 1fr;
    }

    .topic-card {
        min-height: 130px;
    }

    .topic-card strong {
        font-size: 16px;
    }

    .topic-meta {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 4px;
    }

    .topic-meta i {
        width: 15px;
        height: 15px;
    }

    .topic-meta span {
        font-size: 10px;
    }
}

.subtopic-shell {
    max-width: 1760px;
    margin: 0 auto;
    padding: 20px 26px 42px;
}

.crumbs {
    height: 36px;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
    color: #15243a;
    font-size: 18px;
    font-weight: 850;
}

.crumbs a {
    color: #15243a;
}

.crumbs strong {
    color: #0b63e5;
}

.subtopic-hero {
    position: relative;
    min-height: 202px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 230px 1fr 230px;
    align-items: center;
    border-radius: 12px;
    color: #fff;
    background:
        linear-gradient(90deg, rgba(4, 42, 49, .96), rgba(6, 80, 75, .82), rgba(4, 42, 49, .96)),
        url("/images/home-hero-board.jpg") center / cover no-repeat;
    box-shadow: 0 14px 32px rgba(11, 53, 86, .18);
}

.subtopic-hero-copy {
    position: relative;
    z-index: 2;
    text-align: center;
}

.subtopic-hero h1 {
    margin: 0;
    font-size: 58px;
    line-height: 1.1;
    font-weight: 950;
    text-shadow: 0 3px 12px rgba(0, 0, 0, .28);
}

.subtopic-hero-copy span {
    min-width: 190px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 24px;
    border-radius: 999px;
    background: linear-gradient(180deg, #3ac9bb, #159887);
    color: #fff;
    font-size: 24px;
    font-weight: 950;
}

.progress-chip {
    position: relative;
    z-index: 2;
    justify-self: center;
    display: grid;
    justify-items: center;
    gap: 8px;
    color: #e8fff9;
    font-weight: 900;
}

.progress-chip .ring {
    width: 118px;
    height: 118px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background:
        radial-gradient(circle, #0b4c56 0 52%, transparent 54%),
        conic-gradient(#7af07a 0 45%, rgba(255,255,255,.32) 45% 100%);
    font-size: 27px;
    font-weight: 950;
}

.progress-chip small {
    font-size: 15px;
}

.progress-chip em {
    font-style: normal;
    font-size: 15px;
}

.hero-equation {
    position: absolute;
    color: rgba(255, 255, 255, .52);
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
    pointer-events: none;
}

.e1 { right: 395px; top: 48px; font-size: 36px; }
.e2 { right: 430px; bottom: 42px; font-size: 31px; }
.e3 { left: 460px; top: 42px; font-size: 34px; }
.e4 { left: 430px; bottom: 54px; font-size: 32px; }

.subtopic-layout {
    display: grid;
    grid-template-columns: 330px minmax(0, 1fr);
    gap: 34px;
    margin-top: 38px;
    align-items: start;
}

.progress-panel {
    position: sticky;
    top: 18px;
    padding: 26px 22px;
    border: 1px solid #dde6f0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(16, 34, 61, .08);
}

.progress-panel h2 {
    margin: 0 0 20px;
    color: #172742;
    font-size: 22px;
    font-weight: 950;
}

.big-ring {
    width: 160px;
    height: 160px;
    display: grid;
    place-items: center;
    margin: 0 auto 16px;
    border-radius: 50%;
    background:
        radial-gradient(circle, #fff 0 58%, transparent 59%),
        conic-gradient(#48bd68 0 45%, #e9eef3 45% 100%);
}

.big-ring span {
    color: #172742;
    font-size: 38px;
    font-weight: 950;
}

.progress-panel p {
    margin: 0 0 22px;
    color: #58677c;
    text-align: center;
    font-size: 16px;
}

.progress-stat {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-top: 1px solid #e1e8f0;
    color: #56657a;
    font-size: 15px;
    font-weight: 800;
}

.progress-stat b {
    white-space: nowrap;
    font-size: 17px;
}

.progress-stat.green b { color: #0e9f52; }
.progress-stat.red b { color: #e02d2d; }
.progress-stat.orange b { color: #f27a12; }

.progress-panel > a {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 22px;
    border: 1px solid #098a53;
    border-radius: 8px;
    color: #087648;
    font-size: 16px;
    font-weight: 900;
}

.subtopic-main {
    min-width: 0;
}

.back-link {
    width: max-content;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
    border: 1px solid #0b63e5;
    border-radius: 8px;
    color: #0b63e5;
    background: #fff;
    font-size: 17px;
    font-weight: 900;
}

.subtopic-heading {
    margin: 10px 0 22px;
    text-align: center;
}

.subtopic-heading h2 {
    margin: 0;
    color: #13233a;
    font-size: 42px;
    line-height: 1.2;
    font-weight: 950;
}

.subtopic-heading p {
    margin: 12px 0 0;
    color: #6b788a;
    font-size: 18px;
    font-weight: 800;
}

.subtopic-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px 24px;
}

.subtopic-card {
    min-height: 206px;
    display: grid;
    grid-template-columns: 1fr 118px;
    gap: 18px;
    align-items: center;
    padding: 20px 22px;
    border: 1px solid #dce5ef;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(16, 34, 61, .08);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.subtopic-card:hover {
    transform: translateY(-2px);
    border-color: #0b63e5;
    box-shadow: 0 16px 32px rgba(11, 99, 229, .14);
}

.subtopic-copy {
    min-width: 0;
}

.subtopic-card h3 {
    margin: 0;
    color: #14233a;
    font-size: 22px;
    line-height: 1.35;
    font-weight: 950;
}

.subtopic-card p {
    margin: 12px 0 20px;
    color: #5b687a;
    font-size: 16px;
    line-height: 1.7;
    font-weight: 750;
}

.subtopic-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
    color: #172742;
    font-size: 14px;
    font-weight: 850;
}

.subtopic-meta span:nth-child(1) { color: #0c9a4d; }
.subtopic-meta span:nth-child(2) { color: #ef2f2f; }
.subtopic-meta span:nth-child(3) { color: #f27a12; }

.subtopic-card a {
    min-width: 168px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    border: 1px solid #f2a014;
    border-radius: 7px;
    color: #1e293b;
    background: #fff8e6;
    font-size: 15px;
    font-weight: 900;
}

.formula-bubble {
    width: 104px;
    height: 104px;
    display: grid;
    place-items: center;
    justify-self: center;
    border: 1px solid #74b9ff;
    border-radius: 50%;
    background: #e9f5ff;
    color: #0755b8;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 21px;
    font-style: italic;
    text-align: center;
    line-height: 1.35;
}

.subtopic-card.green .formula-bubble { border-color: #5ac98b; background: #e7f8ef; color: #087648; }
.subtopic-card.violet .formula-bubble { border-color: #b494e8; background: #f1eafb; color: #5b31ad; }
.subtopic-card.orange .formula-bubble { border-color: #ffb66b; background: #fff0df; color: #ba5a08; }
.subtopic-card.red .formula-bubble { border-color: #ff8e96; background: #ffe8eb; color: #b51e2a; }
.subtopic-card.mint .formula-bubble { border-color: #74d3c8; background: #e5fbf8; color: #08766d; }
.subtopic-card.cream .formula-bubble { border-color: #e9c48d; background: #fff4e5; color: #7c4a12; }

@media (max-width: 1320px) {
    .subtopic-layout {
        grid-template-columns: 1fr;
    }

    .progress-panel {
        position: static;
        order: 2;
    }

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

@media (max-width: 760px) {
    .subtopic-shell {
        padding: 14px;
    }

    .crumbs {
        overflow-x: auto;
        white-space: nowrap;
        font-size: 15px;
    }

    .subtopic-hero {
        min-height: 180px;
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .progress-chip {
        display: none;
    }

    .subtopic-hero h1 {
        font-size: 40px;
    }

    .subtopic-hero-copy span {
        height: 44px;
        min-width: 150px;
        font-size: 19px;
    }

    .hero-equation {
        font-size: 20px;
    }

    .e1 { right: 22px; top: 18px; }
    .e2 { right: 30px; bottom: 18px; }
    .e3 { left: 24px; top: 24px; }
    .e4 { display: none; }

    .subtopic-layout {
        gap: 18px;
        margin-top: 20px;
    }

    .back-link {
        width: 100%;
        height: 46px;
        font-size: 15px;
    }

    .subtopic-heading h2 {
        font-size: 31px;
    }

    .subtopic-heading p {
        font-size: 15px;
    }

    .subtopic-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .subtopic-card {
        min-height: 178px;
        grid-template-columns: 1fr 84px;
        gap: 12px;
        padding: 16px;
    }

    .subtopic-card h3 {
        font-size: 20px;
    }

    .subtopic-card p {
        margin: 8px 0 12px;
        font-size: 14px;
    }

    .formula-bubble {
        width: 78px;
        height: 78px;
        font-size: 16px;
    }

    .progress-panel {
        padding: 18px;
    }
}

.lesson-shell {
    width: min(1800px, calc(100% - 52px));
    margin: 22px auto 64px;
}

.lesson-hero {
    min-height: 290px;
    border-radius: 10px;
    background:
        radial-gradient(circle at 78% 22%, rgba(45, 175, 157, .22), transparent 26%),
        linear-gradient(90deg, rgba(3, 47, 52, .97), rgba(2, 82, 73, .94)),
        url("/frontend/images/chalkboard-main.jpg");
    background-size: cover;
    box-shadow: 0 16px 34px rgba(11, 40, 54, .16), inset 0 0 0 1px rgba(255,255,255,.2);
    color: #fff;
    display: grid;
    grid-template-columns: 230px 280px 1fr 260px;
    gap: 34px;
    align-items: center;
    padding: 28px 56px;
    overflow: hidden;
}

.lesson-progress {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 12px solid rgba(255,255,255,.22);
    border-top-color: #8fe35f;
    border-left-color: #8fe35f;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.lesson-progress span {
    font-size: 36px;
    font-weight: 900;
}

.lesson-progress strong,
.lesson-progress small {
    position: absolute;
    right: 50%;
    transform: translateX(50%);
    width: 220px;
    text-align: center;
}

.lesson-progress strong {
    bottom: -46px;
    font-size: 18px;
}

.lesson-progress small {
    bottom: -76px;
    color: rgba(255,255,255,.75);
}

.lesson-formula-board {
    border-inline-start: 1px solid rgba(255,255,255,.35);
    padding-inline-start: 34px;
    display: grid;
    gap: 16px;
}

.lesson-formula-board strong {
    justify-self: start;
    border: 1px solid rgba(255,255,255,.82);
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 17px;
}

.lesson-formula-board span {
    min-width: 210px;
    border: 1px solid rgba(255,255,255,.8);
    border-radius: 8px;
    padding: 14px 18px;
    font-family: Georgia, serif;
    font-size: 28px;
    direction: ltr;
    text-align: center;
}

.lesson-copy {
    display: grid;
    gap: 16px;
    justify-items: start;
}

.lesson-copy h1 {
    margin: 0;
    font-size: 48px;
    line-height: 1.25;
    font-weight: 950;
}

.lesson-copy p {
    max-width: 440px;
    margin: 0;
    color: rgba(255,255,255,.86);
    line-height: 2;
}

.lesson-tags {
    display: flex;
    gap: 8px;
}

.lesson-tags span {
    border-radius: 8px;
    padding: 9px 18px;
    background: #0fafa0;
    font-weight: 900;
}

.lesson-tags span + span {
    background: #2276e5;
}

.lesson-copy > a {
    display: inline-flex;
    align-items: center;
    min-height: 54px;
    border-radius: 8px;
    padding: 0 28px;
    background: linear-gradient(180deg, #ffbd29, #ff9600);
    color: #fff;
    font-size: 20px;
    font-weight: 950;
    box-shadow: 0 14px 24px rgba(255, 153, 0, .24);
}

.lesson-graph {
    min-height: 210px;
    position: relative;
    opacity: .88;
}

.lesson-graph span {
    direction: ltr;
    font: 28px Georgia, serif;
    color: rgba(255,255,255,.55);
}

.lesson-graph i {
    position: absolute;
    inset: 48px 0 0 14px;
    border-bottom: 2px solid rgba(255,255,255,.38);
    border-left: 2px solid rgba(255,255,255,.38);
}

.lesson-graph i::before {
    content: "";
    position: absolute;
    width: 150px;
    height: 96px;
    right: 22px;
    bottom: -1px;
    border: 3px solid rgba(255,255,255,.45);
    border-color: transparent transparent rgba(255,255,255,.45) rgba(255,255,255,.45);
    border-radius: 0 0 80px 80px;
    transform: rotate(180deg);
}

.lesson-layout {
    display: grid;
    grid-template-columns: 330px 1fr;
    gap: 26px;
    align-items: start;
    margin-top: 24px;
}

.lesson-index,
.formula-panel,
.content-panel {
    border: 1px solid #d8e0ea;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 14px 28px rgba(15, 36, 56, .08);
}

.lesson-index {
    position: sticky;
    top: 92px;
    padding: 22px;
}

.lesson-index h2 {
    margin: 0 0 22px;
    color: #13253a;
    font-size: 20px;
}

.lesson-index a {
    min-height: 66px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 16px;
    color: #17263b;
    font-weight: 850;
}

.lesson-index a.active {
    border: 1px solid #0d65ff;
    color: #0d65ff;
    background: #f8fbff;
}

.lesson-index a span:not(.index-icon) {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: #f5f7fa;
    border: 1px solid #d9e0e8;
    color: #5e6d7c;
}

.book-icon,
.title-icon {
    width: 34px;
    height: 28px;
    border: 3px solid #1468e8;
    border-top: 0;
    border-radius: 3px 3px 8px 8px;
    display: inline-block;
    position: relative;
}

.book-icon::before,
.title-icon::before {
    content: "";
    position: absolute;
    inset: -6px 50% 0 auto;
    border-inline-start: 3px solid #1468e8;
}

.return-link {
    margin-top: 28px;
    border: 1px solid #0d65ff;
    color: #0d65ff !important;
    justify-content: center;
}

.lesson-main {
    display: grid;
    gap: 24px;
}

.formula-panel {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 32px;
    padding: 26px;
}

.lesson-section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    color: #0f3f91;
}

.lesson-section-title h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 950;
}

.lesson-section-title a {
    color: #0d65ff;
    font-size: 13px;
    font-weight: 800;
}

.formula-panel > .lesson-section-title {
    grid-column: 1 / -1;
}

.lesson-note {
    border: 1px solid #c9def7;
    background: linear-gradient(180deg, #f7fbff, #f2f8ff);
    border-radius: 8px;
    padding: 22px;
    text-align: center;
}

.lesson-note strong {
    color: #0d65ff;
    font-size: 18px;
}

.lesson-note p {
    margin: 18px 0 0;
    color: #263647;
    line-height: 2;
}

.formula-list {
    display: grid;
    gap: 18px;
}

.formula-list article {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 22px;
    align-items: center;
}

.formula-list code {
    direction: ltr;
    border: 1px solid #9fd0b8;
    background: #f6fffa;
    border-radius: 7px;
    padding: 14px 22px;
    text-align: center;
    color: #111827;
    font: 24px Georgia, serif;
}

.formula-list p {
    margin: 0;
    color: #1e2b39;
    line-height: 2;
}

.content-columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.content-panel {
    padding: 18px;
    min-height: 420px;
}

.video-row,
.file-row,
.quiz-row {
    border: 1px solid #dbe2ea;
    border-radius: 8px;
    padding: 12px;
    display: grid;
    grid-template-columns: 1fr 150px;
    gap: 14px;
    align-items: center;
    margin-top: 12px;
}

.file-row,
.quiz-row {
    grid-template-columns: 78px 1fr;
}

.video-row strong,
.file-row strong,
.quiz-row strong {
    color: #17263b;
    display: block;
    margin-bottom: 8px;
    line-height: 1.7;
}

.video-row span,
.file-row small,
.quiz-row small {
    color: #64748b;
}

.video-row em,
.file-row a,
.quiz-row a {
    margin-top: 12px;
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    border-radius: 7px;
    padding: 0 13px;
    border: 1px solid #29aa63;
    color: #169451;
    font-style: normal;
    font-weight: 800;
    font-size: 13px;
}

.video-row em.outline,
.file-row a {
    border-color: #0d65ff;
    color: #0d65ff;
}

.thumb {
    height: 86px;
    border-radius: 7px;
    background:
        linear-gradient(90deg, rgba(10, 38, 48, .2), rgba(10, 38, 48, .1)),
        url("/frontend/images/video-teacher-root-relations.jpg");
    background-size: cover;
    background-position: center;
    display: grid;
    place-items: center;
}

.thumb span {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,.9);
    color: #0d2a39;
    font-size: 22px;
}

.pdf-icon,
.quiz-icon {
    width: 62px;
    height: 72px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 950;
}

.pdf-icon {
    background: linear-gradient(180deg, #ff4650, #f5222d);
}

.quiz-icon {
    background: #fff8ed;
    color: #f18813;
    border: 2px solid #f5a94c;
    font-size: 30px;
}

.quizzes-panel .quiz-row {
    border-color: #ffd8b0;
    background: #fffdf9;
}

@media (max-width: 1180px) {
    .lesson-hero {
        grid-template-columns: 1fr 1fr;
    }

    .lesson-layout,
    .content-columns {
        grid-template-columns: 1fr;
    }

    .lesson-index {
        position: static;
        order: 2;
    }
}

@media (max-width: 760px) {
    .lesson-shell {
        width: min(100% - 24px, 720px);
        margin-top: 12px;
    }

    .lesson-hero {
        min-height: auto;
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 24px 18px 34px;
    }

    .lesson-progress {
        width: 118px;
        height: 118px;
        border-width: 9px;
        margin: 0 auto 42px;
    }

    .lesson-progress span {
        font-size: 28px;
    }

    .lesson-formula-board {
        border-inline-start: 0;
        padding-inline-start: 0;
    }

    .lesson-copy {
        justify-items: center;
        text-align: center;
    }

    .lesson-copy h1 {
        font-size: 32px;
    }

    .lesson-graph {
        display: none;
    }

    .formula-panel,
    .formula-list article,
    .video-row {
        grid-template-columns: 1fr;
    }

    .content-panel {
        min-height: auto;
    }

    .lesson-index {
        padding: 14px;
    }

    .lesson-index a {
        min-height: 54px;
    }
}
