:root {
    --bg: #f5f6fa;
    --bg-deep: #eceef4;
    --surface: #ffffff;
    --surface-2: #f8f8fb;
    --surface-3: #eef0f5;
    --ink: #1d2029;
    --muted: #707684;
    --soft: #3e4450;
    --line: #e1e3ea;
    --line-strong: #cdd1db;
    --violet: #7c6cff;
    --violet-bright: #9589ff;
    --mint: #49d6bd;
    --amber: #ffbd57;
    --coral: #ff7d75;
    --blue: #5aa9ff;
    --danger: #ff7777;
    --shadow: 0 24px 70px rgba(42, 48, 68, 0.13);
    --soft-shadow: 0 14px 36px rgba(42, 48, 68, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background:
        radial-gradient(circle at 74% 8%, rgba(124, 108, 255, 0.08), transparent 24rem),
        radial-gradient(circle at 10% 48%, rgba(73, 214, 189, 0.07), transparent 26rem),
        var(--bg);
    font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    content: "";
    opacity: 0.3;
    background-image: radial-gradient(rgba(62, 68, 80, 0.18) 0.6px, transparent 0.6px);
    background-size: 24px 24px;
    mask-image: linear-gradient(to bottom, black, transparent 75%);
}

body::-webkit-scrollbar {
    width: 12px;
}

body::-webkit-scrollbar-track {
    background: #f0f1f5;
}

body::-webkit-scrollbar-thumb {
    border: 3px solid #f0f1f5;
    border-radius: 999px;
    background: #b7bcc8;
}

body.drawer-open {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea {
    color: inherit;
    font: inherit;
}

button {
    border: 0;
}

svg {
    display: block;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: stretch;
    min-height: 76px;
    padding: 0 max(28px, calc((100vw - 1420px) / 2));
    border-bottom: 1px solid rgba(59, 65, 78, 0.76);
    background: rgba(12, 14, 19, 0.9);
    backdrop-filter: blur(20px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    margin-right: 40px;
    white-space: nowrap;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(149, 137, 255, 0.48);
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(145deg, #7766f2, #4135a3);
    box-shadow: 0 10px 28px rgba(124, 108, 255, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.brand-mark svg {
    width: 25px;
    height: 25px;
    fill: currentColor;
}

.brand-mark path {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 1.8;
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: -0.055em;
}

.brand-name span {
    color: var(--violet-bright);
}

.main-nav {
    display: flex;
    align-items: stretch;
    gap: 4px;
}

.main-nav a {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 0 15px;
    color: #979da9;
    font-size: 0.92rem;
    font-weight: 760;
    transition: color 160ms ease, background 160ms ease;
}

.main-nav a::after {
    position: absolute;
    right: 14px;
    bottom: -1px;
    left: 14px;
    height: 2px;
    border-radius: 999px;
    content: "";
    background: transparent;
}

.main-nav a:hover,
.main-nav a.is-active {
    color: #f5f6fb;
    background: rgba(255, 255, 255, 0.025);
}

.main-nav a.is-active::after {
    background: var(--violet-bright);
}

.main-nav svg,
.header-actions svg,
.course-action svg,
.tool-card > svg,
.icon-button svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.resource-chip {
    display: grid;
    grid-template-columns: 24px auto;
    grid-template-rows: 20px 13px;
    column-gap: 6px;
    align-items: center;
    min-width: 92px;
    height: 50px;
    padding: 6px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    background: rgba(23, 26, 34, 0.9);
    transition: border-color 160ms ease, transform 160ms ease;
}

.resource-chip:hover {
    border-color: #5a6170;
    transform: translateY(-1px);
}

.resource-chip > span,
.resource-chip > svg {
    grid-row: 1 / 3;
    color: var(--amber);
    font-size: 1.25rem;
}

.resource-chip strong {
    align-self: end;
    font-size: 0.98rem;
    line-height: 1;
}

.resource-chip small {
    align-self: start;
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 700;
}

.key-chip > svg {
    color: var(--mint);
}

.header-avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-left: 2px;
    border: 2px solid #383e4b;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(145deg, #806fff, #493dac);
    box-shadow: inset 0 0 0 3px #151820;
    font-weight: 900;
    cursor: pointer;
}

.menu-wrap {
    position: relative;
}

.hamburger,
.icon-button {
    display: grid;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 13px;
    color: #c9cdd5;
    background: transparent;
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease;
}

.hamburger {
    gap: 4px;
    width: 44px;
    height: 44px;
    padding: 9px;
}

.hamburger:hover,
.icon-button:hover {
    border-color: var(--line-strong);
    background: var(--surface-2);
}

.hamburger span {
    display: block;
    width: 19px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    display: none;
    width: 224px;
    padding: 9px;
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    background: #171a22;
    box-shadow: var(--shadow);
}

.menu-wrap.is-open .dropdown-menu {
    display: block;
    animation: pop-in 150ms ease-out;
}

.menu-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 7px;
    padding: 8px 8px 13px;
    border-bottom: 1px solid var(--line);
}

.menu-user > span {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #fff;
    background: var(--violet);
    font-weight: 900;
}

.menu-user div {
    min-width: 0;
}

.menu-user b,
.menu-user small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.menu-user b {
    font-size: 0.86rem;
}

.menu-user small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.7rem;
}

.dropdown-menu a,
.dropdown-menu button {
    display: block;
    width: 100%;
    padding: 10px 11px;
    border-radius: 10px;
    color: #c9cdd5;
    background: transparent;
    font-size: 0.86rem;
    font-weight: 720;
    text-align: left;
    cursor: pointer;
}

.dropdown-menu a:hover,
.dropdown-menu button:hover {
    color: #fff;
    background: #222630;
}

.dropdown-menu .danger {
    color: var(--danger);
}

@keyframes pop-in {
    from { opacity: 0; transform: translateY(-5px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.lobby-shell {
    width: min(1340px, calc(100% - 44px));
    margin: 0 auto;
    padding: 32px 0 80px;
}

.lobby-welcome {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 24px;
}

.eyebrow,
.card-kicker {
    margin: 0;
    color: var(--violet-bright);
    font-size: 0.7rem;
    font-weight: 850;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.lobby-welcome h1 {
    max-width: 760px;
    margin: 8px 0 0;
    font-size: clamp(1.65rem, 3vw, 2.5rem);
    line-height: 1.1;
    letter-spacing: -0.045em;
}

.daily-goal {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 282px;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(20, 23, 30, 0.82);
}

.goal-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    color: var(--mint);
    background: rgba(73, 214, 189, 0.1);
}

.goal-icon svg {
    width: 22px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.daily-goal > span:nth-child(2) {
    min-width: 0;
}

.daily-goal small,
.daily-goal strong {
    display: block;
}

.daily-goal small {
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
}

.daily-goal strong {
    font-size: 0.82rem;
}

.daily-goal b {
    margin-left: auto;
    color: var(--mint);
    font-size: 0.8rem;
}

.lobby-layout {
    display: grid;
    grid-template-columns: 316px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.student-rail {
    display: grid;
    gap: 16px;
}

.profile-card,
.rail-card,
.course-card,
.module-picker,
.tool-card,
.placeholder-panel,
.settings-panel {
    border: 1px solid var(--line);
    background: linear-gradient(145deg, rgba(24, 27, 35, 0.98), rgba(17, 19, 26, 0.98));
    box-shadow: var(--soft-shadow);
}

.profile-card,
.rail-card {
    border-radius: 22px;
}

.profile-card {
    position: relative;
    overflow: hidden;
    min-height: 350px;
    padding: 17px;
}

.profile-card::before {
    position: absolute;
    top: 38px;
    left: 50%;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    content: "";
    background: radial-gradient(circle, rgba(124, 108, 255, 0.24), rgba(124, 108, 255, 0.04) 53%, transparent 70%);
    transform: translateX(-50%);
}

.profile-topline {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 9px;
    border: 1px solid rgba(73, 214, 189, 0.16);
    border-radius: 999px;
    color: #aeb6c3;
    background: rgba(73, 214, 189, 0.055);
    font-size: 0.68rem;
    font-weight: 720;
}

.status-pill i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--mint);
    box-shadow: 0 0 10px rgba(73, 214, 189, 0.76);
}

.icon-button {
    width: 37px;
    height: 37px;
}

.character-button {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 198px;
    height: 190px;
    margin: 4px auto -2px;
    padding: 0;
    background: transparent;
    cursor: pointer;
}

.character-orbit {
    position: absolute;
    top: 26px;
    left: 17px;
    width: 166px;
    height: 130px;
    border: 1px solid rgba(124, 108, 255, 0.24);
    border-radius: 50%;
    transform: rotate(-13deg);
}

.character-orbit::before,
.character-orbit::after {
    position: absolute;
    border-radius: 50%;
    content: "";
}

.character-orbit::before {
    top: 5px;
    right: 23px;
    width: 8px;
    height: 8px;
    background: var(--amber);
    box-shadow: 0 0 14px rgba(255, 189, 87, 0.65);
}

.character-orbit::after {
    bottom: 5px;
    left: 19px;
    width: 6px;
    height: 6px;
    background: var(--mint);
}

.character-avatar {
    position: relative;
    z-index: 1;
    width: 180px;
    filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.3));
    transition: transform 220ms ease;
}

.character-button:hover .character-avatar {
    transform: translateY(-4px) rotate(-1deg);
}

.level-badge {
    position: absolute;
    right: 10px;
    bottom: 16px;
    z-index: 3;
    padding: 7px 10px;
    border: 2px solid #171a22;
    border-radius: 999px;
    color: #17130a;
    background: var(--amber);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.32);
    font-size: 0.68rem;
    font-weight: 950;
}

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

.profile-copy h2 {
    overflow: hidden;
    margin: 0;
    font-size: 1.15rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-copy p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 650;
}

.text-button {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 15px;
    padding: 11px;
    border-radius: 12px;
    color: #d8dbe3;
    background: #232630;
    font-size: 0.75rem;
    font-weight: 780;
    cursor: pointer;
}

.text-button:hover {
    background: #2a2e3a;
}

.text-button span {
    color: var(--violet-bright);
    font-size: 1rem;
}

.rail-card {
    padding: 19px;
}

.rail-card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.rail-card-heading strong {
    display: block;
    margin-top: 6px;
    font-size: 0.85rem;
}

.rail-card-heading strong b {
    font-size: 1.65rem;
    letter-spacing: -0.04em;
}

.streak-flame {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 15px;
    background: rgba(255, 125, 117, 0.09);
}

.streak-flame svg {
    width: 27px;
    fill: var(--coral);
}

.streak-flame path:last-child {
    fill: var(--amber);
}

.streak-card > p {
    margin: 10px 0 15px;
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.5;
}

.week-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.week-day {
    display: grid;
    place-items: center;
    gap: 6px;
}

.week-day i {
    display: grid;
    place-items: center;
    width: 29px;
    height: 29px;
    border: 1px solid #323744;
    border-radius: 50%;
    color: #414754;
    background: #171a21;
}

.week-day svg {
    width: 14px;
    fill: currentColor;
}

.week-day small {
    color: #6f7581;
    font-size: 0.61rem;
    font-style: normal;
    font-weight: 750;
}

.week-day.is-done i {
    border-color: rgba(255, 125, 117, 0.38);
    color: var(--coral);
    background: rgba(255, 125, 117, 0.09);
}

.week-day.is-done small {
    color: #c3c7cf;
}

.xp-gem {
    display: grid;
    place-items: center;
    width: 43px;
    height: 43px;
    border: 1px solid rgba(149, 137, 255, 0.22);
    border-radius: 14px;
    color: var(--violet-bright);
    background: rgba(124, 108, 255, 0.09);
    font-size: 1.4rem;
    text-shadow: 0 0 18px rgba(149, 137, 255, 0.7);
}

.xp-progress {
    height: 9px;
    margin: 17px 0 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #292d37;
}

.xp-progress span {
    display: block;
    min-width: 4px;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--violet), #b36fff);
    box-shadow: 0 0 15px rgba(124, 108, 255, 0.5);
}

.xp-meta {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 700;
}

.learning-stage {
    min-width: 0;
}

.course-card {
    position: relative;
    min-height: 606px;
    overflow: hidden;
    padding: 29px;
    border-color: #353b48;
    border-radius: 26px;
}

.course-card::before {
    position: absolute;
    top: -210px;
    left: 45%;
    width: 590px;
    height: 590px;
    border-radius: 50%;
    content: "";
    background: radial-gradient(circle, color-mix(in srgb, var(--module-accent) 18%, transparent), transparent 68%);
    transform: translateX(-50%);
    transition: background 240ms ease;
}

.course-card::after {
    position: absolute;
    top: 104px;
    right: -75px;
    width: 250px;
    height: 250px;
    border: 1px solid color-mix(in srgb, var(--module-accent) 22%, transparent);
    border-radius: 50%;
    content: "";
}

.course-card-head {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 20px;
}

.course-card-head h2 {
    margin: 8px 0 5px;
    font-size: clamp(1.7rem, 3vw, 2.55rem);
    letter-spacing: -0.05em;
}

.course-level {
    color: var(--module-accent);
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.course-progress-label {
    min-width: 82px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(11, 13, 18, 0.52);
    text-align: center;
}

.course-progress-label span,
.course-progress-label small {
    display: block;
}

.course-progress-label span {
    color: var(--module-accent);
    font-size: 1.15rem;
    font-weight: 900;
}

.course-progress-label small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.62rem;
}

.course-showcase {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(330px, 0.95fr) minmax(310px, 1fr);
    gap: 22px;
    align-items: center;
    min-height: 395px;
}

.probability-machine {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 330px;
    color: var(--module-accent);
}

.machine-glow {
    position: absolute;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--module-accent) 23%, transparent), transparent 70%);
    filter: blur(4px);
}

.probability-machine > svg {
    position: relative;
    z-index: 1;
    width: min(100%, 380px);
    filter: drop-shadow(0 26px 26px rgba(0, 0, 0, 0.32));
}

.machine-balls circle:nth-child(1) { animation: ball-drift 3.4s ease-in-out infinite; }
.machine-balls circle:nth-child(2) { animation: ball-drift 3.8s ease-in-out -0.8s infinite; }
.machine-balls circle:nth-child(3) { animation: ball-drift 4.2s ease-in-out -1.5s infinite; }
.machine-balls circle:nth-child(4) { animation: ball-drift 3.5s ease-in-out -2.2s infinite; }
.machine-balls circle:nth-child(5) { animation: ball-drift 4s ease-in-out -0.3s infinite; }

@keyframes ball-drift {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-7px); }
}

.machine-symbol {
    position: absolute;
    z-index: 3;
    top: 47%;
    left: 50%;
    display: grid;
    place-items: center;
    min-width: 57px;
    height: 57px;
    padding: 0 9px;
    border: 3px solid #171a22;
    border-radius: 18px;
    color: #0d0f14;
    background: var(--module-accent);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.38);
    font-size: 1.15rem;
    font-weight: 950;
    transform: translate(-50%, -50%) rotate(-5deg);
}

.course-overview {
    padding: 21px;
    border: 1px solid rgba(59, 65, 78, 0.72);
    border-radius: 20px;
    background: rgba(10, 12, 17, 0.52);
    backdrop-filter: blur(8px);
}

.course-overview > p {
    margin: 0 0 17px;
    color: #b7bcc7;
    font-size: 0.84rem;
    line-height: 1.62;
}

.course-progress-track {
    height: 6px;
    margin-bottom: 18px;
    overflow: hidden;
    border-radius: 999px;
    background: #2a2e38;
}

.course-progress-track span {
    display: block;
    min-width: 3px;
    height: 100%;
    border-radius: inherit;
    background: var(--module-accent);
    box-shadow: 0 0 14px color-mix(in srgb, var(--module-accent) 46%, transparent);
    transition: width 300ms ease;
}

.lesson-steps {
    display: grid;
    gap: 9px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.lesson-steps li {
    display: grid;
    grid-template-columns: 30px 1fr 8px;
    align-items: center;
    gap: 10px;
    min-height: 45px;
    padding: 7px 10px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: #747b88;
}

.lesson-steps li > span {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 1px solid #343947;
    border-radius: 10px;
    background: #20232c;
    font-size: 0.67rem;
    font-weight: 850;
}

.lesson-steps li b {
    font-size: 0.76rem;
}

.lesson-steps li i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #343842;
}

.lesson-steps li.is-current {
    border-color: color-mix(in srgb, var(--module-accent) 36%, transparent);
    color: #f0f1f5;
    background: color-mix(in srgb, var(--module-accent) 8%, transparent);
}

.lesson-steps li.is-current > span {
    border-color: var(--module-accent);
    color: #0f1116;
    background: var(--module-accent);
}

.lesson-steps li.is-current i {
    background: var(--module-accent);
    box-shadow: 0 0 11px var(--module-accent);
}

.lesson-steps li.is-complete {
    color: #bfc4cc;
}

.lesson-steps li.is-complete > span {
    color: var(--mint);
}

.course-action {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    min-height: 55px;
    border: 1px solid color-mix(in srgb, var(--module-accent) 72%, white 8%);
    border-radius: 16px;
    color: #0d0f14;
    background: var(--module-accent);
    box-shadow: 0 14px 32px color-mix(in srgb, var(--module-accent) 22%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.24);
    font-size: 0.9rem;
    font-weight: 900;
    transition: transform 160ms ease, filter 160ms ease;
}

.course-action:hover {
    filter: brightness(1.07);
    transform: translateY(-2px);
}

.course-action svg {
    width: 18px;
}

.course-action.is-disabled {
    border-color: #373b45;
    color: #777d87;
    background: #282b33;
    box-shadow: none;
    cursor: not-allowed;
}

.course-action.is-disabled:hover {
    filter: none;
    transform: none;
}

.module-picker {
    margin-top: 16px;
    padding: 19px;
    border-radius: 22px;
}

.module-picker-head,
.section-title-row,
.drawer-section-title {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
}

.module-picker-head h2,
.section-title-row h2 {
    margin: 6px 0 0;
    font-size: 1.15rem;
    letter-spacing: -0.025em;
}

.module-picker-head > span,
.section-title-row > span {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 680;
}

.module-tabs {
    display: flex;
    gap: 10px;
    margin-top: 17px;
    padding: 2px 2px 12px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
    scroll-padding-inline: 2px;
    scrollbar-color: #aaa0e8 #eceef4;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
}

.module-tabs::-webkit-scrollbar {
    height: 8px;
}

.module-tabs::-webkit-scrollbar-track {
    border-radius: 999px;
    background: #eceef4;
}

.module-tabs::-webkit-scrollbar-thumb {
    border: 2px solid #eceef4;
    border-radius: 999px;
    background: linear-gradient(90deg, #b7afea, #8173df);
}

.module-tabs::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, #9f95e3, #6e5fd7);
}

.module-tabs:focus-visible {
    outline: 3px solid rgba(102, 82, 232, 0.2);
    outline-offset: 5px;
}

.module-tab {
    position: relative;
    display: grid;
    justify-items: center;
    min-width: 152px;
    min-height: 126px;
    padding: 12px 8px;
    flex: 0 0 152px;
    scroll-snap-align: start;
    border: 1px solid #343946;
    border-radius: 15px;
    color: #adb2bc;
    background: #151820;
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.module-tab:hover {
    border-color: #555c6c;
    transform: translateY(-2px);
}

.module-tab.is-active {
    border-color: var(--tab-accent, var(--violet));
    color: #fff;
    background: #1d202a;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tab-accent, var(--violet)) 20%, transparent);
}

.module-glyph {
    display: grid;
    place-items: center;
    min-width: 46px;
    height: 46px;
    padding: 0 7px;
    border: 1px solid color-mix(in srgb, var(--tab-accent) 32%, transparent);
    border-radius: 14px;
    color: var(--tab-accent);
    background: color-mix(in srgb, var(--tab-accent) 9%, transparent);
    font-size: 1rem;
    font-weight: 920;
}

.module-info {
    display: block;
    min-width: 0;
    margin-top: 9px;
    text-align: center;
}

.module-info b,
.module-info small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.module-info b {
    font-size: 0.7rem;
}

.module-tab[data-module-id="conditional-probability"] .module-info b {
    min-height: 2.5em;
    line-height: 1.25;
    white-space: normal;
}

.module-tab[data-module-id="continuous-random-variable-probability"] .module-info b {
    min-height: 3.75em;
    line-height: 1.25;
    white-space: normal;
}

.module-tab[data-module-id="continuous-random-variable-probability"] {
    min-width: 208px;
    flex-basis: 208px;
}

.module-info small {
    margin-top: 5px;
    color: #717783;
    font-size: 0.57rem;
    font-weight: 650;
}

.module-tab.is-locked {
    opacity: 0.58;
}

.lock-icon,
.check-icon {
    position: absolute;
    top: 9px;
    right: 9px;
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.check-icon {
    color: var(--mint);
}

.tool-section {
    margin-top: 34px;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 17px;
}

.tool-card {
    display: grid;
    grid-template-columns: 55px 1fr auto;
    align-items: center;
    gap: 14px;
    min-height: 124px;
    padding: 18px;
    border-radius: 20px;
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 160ms ease, transform 160ms ease;
}

.tool-card:hover {
    border-color: #505766;
    transform: translateY(-3px);
}

.tool-icon {
    display: grid;
    place-items: center;
    width: 55px;
    height: 55px;
    border: 1px solid rgba(149, 137, 255, 0.3);
    border-radius: 17px;
    color: var(--violet-bright);
    background: rgba(124, 108, 255, 0.1);
    font-size: 1.5rem;
    font-weight: 950;
}

.dice-icon {
    border-color: rgba(255, 189, 87, 0.3);
    color: var(--amber);
    background: rgba(255, 189, 87, 0.09);
}

.formula-icon {
    border-color: rgba(73, 214, 189, 0.3);
    color: var(--mint);
    background: rgba(73, 214, 189, 0.09);
}

.tool-card > span:nth-child(2) {
    min-width: 0;
}

.tool-card small,
.tool-card b,
.tool-card em {
    display: block;
}

.tool-card small {
    margin-bottom: 5px;
    color: var(--violet-bright);
    font-size: 0.61rem;
    font-weight: 820;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.tool-card b {
    font-size: 0.84rem;
}

.tool-card em {
    margin-top: 5px;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.68rem;
    font-style: normal;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tool-card > i {
    padding: 6px 8px;
    border-radius: 8px;
    color: #141009;
    background: var(--amber);
    font-size: 0.6rem;
    font-style: normal;
    font-weight: 900;
}

.tool-card > svg {
    color: #6f7581;
}

.profile-overlay {
    position: fixed;
    inset: 0;
    z-index: 80;
    visibility: hidden;
    opacity: 0;
    background: rgba(3, 4, 7, 0.72);
    backdrop-filter: blur(4px);
    transition: opacity 200ms ease, visibility 200ms ease;
}

.profile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    width: min(420px, calc(100% - 20px));
    overflow-y: auto;
    padding: 27px;
    border-left: 1px solid var(--line-strong);
    background: #11141b;
    box-shadow: -30px 0 70px rgba(0, 0, 0, 0.42);
    transform: translateX(105%);
    transition: transform 240ms cubic-bezier(.2,.8,.2,1);
}

.profile-overlay.is-visible {
    visibility: visible;
    opacity: 1;
}

.profile-drawer.is-open {
    transform: translateX(0);
}

.drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.drawer-head h2 {
    margin: 6px 0 0;
    font-size: 1.5rem;
}

.drawer-head .icon-button {
    border-color: var(--line);
    font-size: 1.45rem;
}

.drawer-identity {
    position: relative;
    display: grid;
    grid-template-columns: 66px 1fr;
    align-items: center;
    gap: 14px;
    margin: 25px 0 20px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(124, 108, 255, 0.13), rgba(73, 214, 189, 0.035));
}

.drawer-avatar {
    display: grid;
    grid-row: 1 / 3;
    place-items: center;
    width: 66px;
    height: 66px;
    border: 3px solid #282d38;
    border-radius: 20px;
    color: #fff;
    background: linear-gradient(145deg, #8878ff, #4b3eb0);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.24);
    font-size: 1.6rem;
    font-weight: 950;
}

.drawer-identity h3,
.drawer-identity p {
    overflow: hidden;
    margin: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drawer-identity h3 {
    padding-right: 54px;
    font-size: 0.95rem;
}

.drawer-identity p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.69rem;
}

.drawer-level {
    position: absolute;
    top: 18px;
    right: 16px;
    padding: 6px 8px;
    border-radius: 8px;
    color: #181208;
    background: var(--amber);
    font-size: 0.62rem;
    font-weight: 920;
}

.drawer-xp {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
}

.drawer-xp > span {
    display: block;
    margin-bottom: 10px;
    font-size: 0.78rem;
}

.drawer-xp small {
    color: var(--muted);
}

.drawer-xp > div {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #2a2e38;
}

.drawer-xp i {
    display: block;
    min-width: 4px;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--violet), #b36fff);
}

.profile-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
    margin: 18px 0 26px;
}

.profile-stat-grid div {
    padding: 14px 8px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    text-align: center;
}

.profile-stat-grid span,
.profile-stat-grid small {
    display: block;
}

.profile-stat-grid span {
    font-size: 1.15rem;
    font-weight: 900;
}

.profile-stat-grid small {
    margin-top: 5px;
    color: var(--muted);
    font-size: 0.61rem;
}

.drawer-section-title h3 {
    margin: 0;
    font-size: 0.92rem;
}

.drawer-section-title span {
    color: var(--muted);
    font-size: 0.68rem;
}

.badge-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
    margin-top: 13px;
}

.badge-item {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 14px 7px;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: #555b67;
    background: #151820;
}

.badge-item i {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 2px solid currentColor;
    border-radius: 50%;
    font-style: normal;
    font-weight: 900;
}

.badge-item small {
    font-size: 0.61rem;
    font-weight: 720;
}

.badge-item.is-earned {
    border-color: rgba(255, 189, 87, 0.2);
    color: var(--amber);
    background: rgba(255, 189, 87, 0.05);
}

.drawer-settings {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 25px;
    padding: 15px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: #d9dce3;
    background: #1b1e27;
    font-size: 0.78rem;
    font-weight: 780;
}

.drawer-settings:hover {
    border-color: #525968;
}

.drawer-settings span {
    color: var(--violet-bright);
}

.app-notice,
.toast-page {
    border: 1px solid rgba(73, 214, 189, 0.22);
    border-radius: 13px;
    color: #dffbf6;
    background: #18302d;
    box-shadow: var(--soft-shadow);
    font-size: 0.76rem;
    font-weight: 720;
}

.app-notice {
    position: fixed;
    right: 25px;
    bottom: 25px;
    z-index: 110;
    visibility: hidden;
    max-width: 340px;
    padding: 13px 15px;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
}

.app-notice.is-visible {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.toast-page {
    margin-bottom: 18px;
    padding: 13px 15px;
}

/* Shared secondary pages */
.dashboard-shell {
    width: min(1080px, calc(100% - 40px));
    margin: 0 auto;
    padding: 36px 0 70px;
}

.compact-page {
    display: grid;
    min-height: calc(100vh - 76px);
    place-items: center;
}

.placeholder-panel,
.settings-panel {
    width: min(780px, 100%);
    padding: 34px;
    border-radius: 24px;
}

.placeholder-panel h1,
.settings-panel h1 {
    margin: 10px 0 13px;
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: -0.05em;
    line-height: 1.05;
}

.placeholder-panel > p,
.settings-panel > p,
.muted {
    color: var(--muted);
    line-height: 1.65;
}

.primary-button,
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 22px;
    border: 0;
    border-radius: 13px;
    font-weight: 850;
    cursor: pointer;
}

.primary-button {
    color: #fff;
    background: linear-gradient(135deg, var(--violet), #5a49cc);
    box-shadow: 0 13px 28px rgba(86, 72, 203, 0.28);
}

.primary-button:hover {
    filter: brightness(1.08);
}

.secondary-button {
    color: var(--violet-bright);
    background: rgba(124, 108, 255, 0.11);
}

.form-stack {
    display: grid;
    gap: 16px;
}

.form-stack.narrow {
    max-width: 540px;
}

.form-stack label {
    display: grid;
    gap: 8px;
    color: #d4d7de;
    font-size: 0.82rem;
    font-weight: 760;
}

.form-stack input,
.form-stack textarea {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 13px;
    outline: none;
    color: var(--ink);
    background: #101219;
}

.form-stack input {
    height: 49px;
    padding: 0 13px;
}

.form-stack textarea {
    resize: vertical;
    padding: 13px;
}

.form-stack input:focus,
.form-stack textarea:focus {
    border-color: var(--violet);
    box-shadow: 0 0 0 4px rgba(124, 108, 255, 0.11);
}

.form-stack input:disabled {
    color: #767c87;
    background: #191c23;
}

.form-stack small {
    color: var(--danger);
    font-weight: 700;
}

.primary-button.full {
    width: 100%;
}

.alert {
    margin-bottom: 18px;
    padding: 13px 14px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 700;
}

.alert-error {
    color: #ffdada;
    background: rgba(255, 87, 87, 0.14);
}

.alert-warning {
    color: #ffe4b9;
    background: rgba(255, 189, 87, 0.12);
}

.alert-success {
    color: #d5fff7;
    background: rgba(73, 214, 189, 0.11);
}

/* Authentication */
.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(420px, 0.78fr);
    min-height: 100vh;
}

.auth-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: 48px;
    background:
        radial-gradient(circle at 30% 35%, rgba(124, 108, 255, 0.25), transparent 25%),
        radial-gradient(circle at 76% 64%, rgba(73, 214, 189, 0.14), transparent 22%),
        linear-gradient(145deg, #141720, #0d0f15);
}

.auth-visual::after {
    position: absolute;
    right: -160px;
    bottom: -140px;
    width: 440px;
    height: 440px;
    border: 1px solid rgba(149, 137, 255, 0.18);
    border-radius: 50%;
    content: "";
}

.auth-brand {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 11px;
    width: max-content;
    font-weight: 850;
}

.auth-visual h1 {
    position: relative;
    z-index: 1;
    max-width: 680px;
    margin: auto 0 14px;
    font-size: clamp(2.8rem, 6vw, 5.4rem);
    line-height: 0.98;
    letter-spacing: -0.07em;
}

.auth-visual > p {
    position: relative;
    z-index: 1;
    max-width: 540px;
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.auth-panel {
    display: grid;
    padding: 34px;
    place-items: center;
    background: #0e1016;
}

.auth-card {
    width: min(460px, 100%);
    padding: 32px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: #171a22;
    box-shadow: var(--shadow);
}

.auth-card h2 {
    margin: 8px 0;
    font-size: 2rem;
    letter-spacing: -0.04em;
}

.muted {
    margin: 0 0 21px;
}

.auth-switch {
    margin: 20px 0 0;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 650;
    text-align: center;
}

.auth-switch a {
    color: var(--violet-bright);
    font-weight: 850;
}

.auth-orbit {
    position: absolute;
    top: 18%;
    right: 12%;
    width: 270px;
    height: 270px;
    border: 1px solid rgba(149, 137, 255, 0.14);
    border-radius: 50%;
}

.orbit-node {
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--violet);
}

.node-a { top: 18px; left: 44px; }
.node-b { top: 96px; right: 18px; background: var(--amber); }
.node-c { bottom: 24px; left: 78px; background: var(--mint); }

.orbit-line {
    position: absolute;
    top: 50%;
    left: 18%;
    width: 180px;
    height: 2px;
    background: rgba(149, 137, 255, 0.24);
    transform: rotate(-18deg);
}

@media (max-width: 1120px) {
    .topbar {
        padding-inline: 22px;
    }

    .brand {
        margin-right: 22px;
    }

    .lobby-layout {
        grid-template-columns: 280px minmax(0, 1fr);
    }

    .course-showcase {
        grid-template-columns: minmax(270px, 0.85fr) minmax(280px, 1fr);
    }

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

    .tool-card:first-child {
        grid-column: 1 / -1;
    }
}

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

    .student-rail {
        grid-template-columns: 1.1fr 1fr 1fr;
    }

    .profile-card {
        grid-row: span 2;
        min-height: 330px;
    }

    .course-card {
        min-height: auto;
    }

    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-visual {
        min-height: 360px;
        padding: 32px;
    }
}

@media (max-width: 760px) {
    .topbar {
        min-height: 68px;
        padding-inline: 14px;
    }

    .brand {
        margin-right: auto;
    }

    .brand-name {
        font-size: 1.28rem;
    }

    .brand-mark {
        width: 35px;
        height: 35px;
    }

    .main-nav {
        display: none;
    }

    .resource-chip {
        grid-template-columns: 19px auto;
        min-width: 57px;
        height: 42px;
        padding: 5px 9px;
    }

    .resource-chip small,
    .header-avatar {
        display: none;
    }

    .resource-chip > span,
    .resource-chip > svg {
        width: 17px;
        grid-row: 1 / 3;
        font-size: 1rem;
    }

    .resource-chip strong {
        grid-row: 1 / 3;
        align-self: center;
    }

    .lobby-shell {
        width: min(100% - 24px, 1340px);
        padding-top: 23px;
    }

    .lobby-welcome {
        align-items: start;
        flex-direction: column;
        gap: 16px;
    }

    .daily-goal {
        width: 100%;
    }

    .student-rail {
        grid-template-columns: 1fr;
    }

    .profile-card {
        min-height: 342px;
    }

    .course-card {
        padding: 20px;
        border-radius: 22px;
    }

    .course-showcase {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .probability-machine {
        min-height: 270px;
    }

    .probability-machine > svg {
        width: min(100%, 335px);
    }

    .course-overview {
        padding: 17px;
    }

    .module-tabs {
        display: flex;
        overflow-x: auto;
        padding-bottom: 7px;
        scroll-snap-type: x mandatory;
    }

    .module-tab {
        flex: 0 0 132px;
        scroll-snap-align: start;
    }

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

    .tool-card:first-child {
        grid-column: auto;
    }

    .section-title-row,
    .module-picker-head {
        align-items: start;
        flex-direction: column;
        gap: 7px;
    }

    .dashboard-shell {
        width: min(100% - 24px, 1080px);
    }

    .placeholder-panel,
    .settings-panel,
    .auth-card {
        padding: 23px;
    }

    .auth-panel,
    .auth-visual {
        padding: 22px;
    }
}

@media (max-width: 480px) {
    .header-actions {
        gap: 6px;
    }

    .key-chip {
        display: none;
    }

    .course-card-head {
        align-items: start;
        flex-direction: column;
    }

    .course-progress-label {
        display: flex;
        align-items: center;
        gap: 5px;
        min-width: auto;
        padding: 7px 9px;
    }

    .course-progress-label small {
        margin: 0;
    }

    .tool-card {
        grid-template-columns: 47px 1fr auto;
        min-height: 110px;
        padding: 14px;
    }

    .tool-icon {
        width: 47px;
        height: 47px;
    }

    .profile-drawer {
        width: 100%;
        padding: 20px;
    }

    .app-notice {
        right: 12px;
        bottom: 12px;
        left: 12px;
        max-width: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/*
 * Chế độ tập trung khi học:
 * top bar không được render và vùng bài học chiếm lại toàn bộ viewport.
 * `!important` giúp quy tắc chung này thay thế các offset 68–76px
 * đang được khai báo riêng trong từng học phần.
 */
body.lesson-focus-mode .topbar {
    display: none !important;
}

@media (min-width: 761px) {
    body.lesson-focus-mode:not(.vdc-two-screen-page) > main {
        height: 100vh !important;
        height: 100dvh !important;
        min-height: 100vh !important;
        min-height: 100dvh !important;
        margin-top: 0 !important;
    }
}

@media (max-width: 760px) {
    body.lesson-focus-mode > main {
        min-height: 100vh !important;
        min-height: 100dvh !important;
        margin-top: 0 !important;
    }
}

@media (max-width: 900px) {
    body.lesson-focus-mode #arrangementsLevelOne > .arrangement-activity {
        min-height: calc(100dvh - 32px) !important;
    }
}

@media (max-width: 780px) {
    body.lesson-focus-mode .arrangement-two-experience {
        min-height: calc(100dvh - 16px) !important;
    }
}

@media (max-width: 800px) {
    body.lesson-focus-mode .arrangement-three-experience {
        min-height: calc(100dvh - 20px) !important;
    }
}

@media (max-width: 940px) {
    body.lesson-focus-mode .arrangement-four-experience {
        min-height: calc(100dvh - 16px) !important;
    }
}

@media (max-width: 760px) {
    body.lesson-focus-mode .euler-candy-experience {
        min-height: calc(100dvh - 20px) !important;
    }
}

/* ProbLab light theme */
.topbar {
    border-bottom-color: rgba(212, 215, 225, 0.92);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 6px 24px rgba(38, 43, 60, 0.04);
}

.main-nav a {
    color: #777d89;
}

.main-nav a:hover,
.main-nav a.is-active {
    color: var(--ink);
    background: rgba(124, 108, 255, 0.055);
}

.resource-chip {
    border-color: var(--line);
    background: #fff;
    box-shadow: 0 5px 15px rgba(42, 48, 68, 0.05);
}

.resource-chip:hover {
    border-color: #b8bdc9;
}

.header-avatar {
    border-color: #d8dbe4;
    box-shadow: inset 0 0 0 3px #fff, 0 6px 16px rgba(77, 63, 178, 0.18);
}

.hamburger,
.icon-button {
    color: #555b67;
}

.hamburger:hover,
.icon-button:hover {
    border-color: var(--line);
    background: #f4f5f8;
}

.dropdown-menu {
    border-color: var(--line);
    background: #fff;
}

.menu-user {
    border-bottom-color: var(--line);
}

.dropdown-menu a,
.dropdown-menu button {
    color: #555b68;
}

.dropdown-menu a:hover,
.dropdown-menu button:hover {
    color: var(--ink);
    background: #f4f5f8;
}

.daily-goal {
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 22px rgba(42, 48, 68, 0.05);
}

.profile-card,
.rail-card,
.course-card,
.module-picker,
.tool-card,
.placeholder-panel,
.settings-panel {
    border-color: var(--line);
    background: #fff;
    box-shadow: var(--soft-shadow);
}

.profile-card {
    background: linear-gradient(155deg, #fff 0%, #fbfaff 64%, #f8f7ff 100%);
}

.profile-card::before {
    background: radial-gradient(circle, rgba(124, 108, 255, 0.2), rgba(124, 108, 255, 0.045) 54%, transparent 70%);
}

.status-pill {
    border-color: rgba(23, 157, 135, 0.18);
    color: #52655f;
    background: rgba(73, 214, 189, 0.1);
}

.character-orbit {
    border-color: rgba(124, 108, 255, 0.3);
}

.text-button {
    color: #5347bd;
    background: #f0efff;
}

.text-button:hover {
    background: #e8e6ff;
}

.streak-card > p,
.course-overview > p {
    color: #686f7d;
}

.week-day i {
    border-color: #e1e3e9;
    color: #c0c4cd;
    background: #f7f8fa;
}

.week-day small {
    color: #8b919d;
}

.week-day.is-done i {
    border-color: rgba(230, 93, 82, 0.25);
    color: #e65d52;
    background: rgba(255, 125, 117, 0.1);
}

.week-day.is-done small {
    color: #555c68;
}

.streak-flame {
    background: rgba(255, 125, 117, 0.11);
}

.xp-gem {
    border-color: rgba(124, 108, 255, 0.22);
    background: rgba(124, 108, 255, 0.09);
}

.xp-progress,
.course-progress-track,
.drawer-xp > div {
    background: #e8eaf0;
}

.course-card {
    border-color: #d9dce5;
    background: linear-gradient(145deg, #fff 0%, #fcfcff 52%, #f8f7ff 100%);
}

.course-card::after {
    border-color: color-mix(in srgb, var(--module-accent) 18%, transparent);
}

.course-progress-label {
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 6px 18px rgba(43, 49, 69, 0.05);
}

.course-overview {
    border-color: #dfe2e9;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 12px 30px rgba(46, 51, 70, 0.07);
}

.lesson-steps li {
    color: #9a9faa;
}

.lesson-steps li > span {
    border-color: #dfe2e8;
    background: #f4f5f8;
}

.lesson-steps li i {
    background: #d4d7df;
}

.lesson-steps li.is-current {
    color: #282c36;
    background: color-mix(in srgb, var(--module-accent) 7%, white);
}

.lesson-steps li.is-complete {
    color: #4f5662;
}

.course-action.is-disabled {
    border-color: #d6d9e0;
    color: #9297a1;
    background: #eceef2;
}

.module-picker {
    background: rgba(255, 255, 255, 0.92);
}

.module-tab {
    border-color: #e0e3e9;
    color: #606774;
    background: #f9fafc;
}

.module-tab:hover {
    border-color: #bfc4cf;
    background: #fff;
}

.module-tab.is-active {
    border-color: var(--tab-accent, var(--violet));
    color: #242832;
    background: color-mix(in srgb, var(--tab-accent, var(--violet)) 5%, white);
    box-shadow: 0 8px 20px color-mix(in srgb, var(--tab-accent, var(--violet)) 10%, transparent), inset 0 0 0 1px color-mix(in srgb, var(--tab-accent, var(--violet)) 12%, transparent);
}

.module-info small {
    color: #9096a2;
}

.tool-card {
    color: var(--ink);
    background: #fff;
}

.tool-card:hover {
    border-color: #c2c7d1;
    box-shadow: 0 18px 36px rgba(42, 48, 68, 0.11);
}

.tool-card em {
    color: #767d8a;
}

.tool-card > svg {
    color: #9197a3;
}

.profile-drawer {
    border-left-color: var(--line);
    background: #fff;
    box-shadow: -30px 0 70px rgba(43, 48, 65, 0.17);
}

.drawer-identity {
    border-color: var(--line);
    background: linear-gradient(135deg, rgba(124, 108, 255, 0.1), rgba(73, 214, 189, 0.045));
}

.drawer-avatar {
    border-color: #e5e6ed;
}

.drawer-xp,
.profile-stat-grid div {
    border-color: var(--line);
    background: #f9fafc;
}

.badge-item {
    border-color: var(--line);
    color: #b3b7c0;
    background: #f8f9fb;
}

.badge-item.is-earned {
    border-color: rgba(218, 145, 34, 0.23);
    color: #c98720;
    background: rgba(255, 189, 87, 0.1);
}

.drawer-settings {
    border-color: var(--line);
    color: #434956;
    background: #f5f6f9;
}

.drawer-settings:hover {
    border-color: #bdc2cc;
    background: #fff;
}

.app-notice,
.toast-page {
    border-color: rgba(30, 154, 133, 0.2);
    color: #165d52;
    background: #e7f8f4;
}

.placeholder-panel,
.settings-panel {
    background: #fff;
}

.form-stack label {
    color: #424854;
}

.form-stack input,
.form-stack textarea {
    border-color: var(--line-strong);
    color: var(--ink);
    background: #fff;
}

.form-stack input:disabled {
    color: #8a909b;
    background: #f0f2f5;
}

.auth-visual {
    color: var(--ink);
    background:
        radial-gradient(circle at 30% 35%, rgba(124, 108, 255, 0.18), transparent 26%),
        radial-gradient(circle at 76% 64%, rgba(73, 214, 189, 0.16), transparent 23%),
        linear-gradient(145deg, #fff, #f2f1ff);
}

.auth-visual::after {
    border-color: rgba(124, 108, 255, 0.2);
}

.auth-visual > p {
    color: #666d7a;
}

.auth-panel {
    background: #f5f6fa;
}

.auth-card {
    border-color: var(--line);
    background: #fff;
}

.alert-error {
    color: #a93e3e;
    background: #fff0f0;
}

.alert-warning {
    color: #855c17;
    background: #fff7e8;
}

.alert-success {
    color: #17685a;
    background: #eaf9f5;
}

/* Homepage subject catalogue */
.subject-stack {
    display: grid;
    min-width: 0;
    gap: clamp(46px, 6vw, 76px);
}

.subject-section {
    position: relative;
    min-width: 0;
    scroll-margin-top: 96px;
}

.additional-subject {
    padding-top: 34px;
}

.additional-subject::before {
    position: absolute;
    top: 0;
    right: 2px;
    left: 2px;
    height: 1px;
    content: "";
    background: linear-gradient(90deg, transparent, rgba(124, 108, 255, 0.3) 20%, rgba(73, 214, 189, 0.24) 80%, transparent);
}

.subject-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 22px;
    margin: 0 3px 15px;
    padding-inline: 4px;
}

.subject-heading h2 {
    margin: 6px 0 0;
    font-size: clamp(1.45rem, 2.4vw, 2rem);
    letter-spacing: -0.045em;
}

.subject-heading > span {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 7px 12px;
    border: 1px solid color-mix(in srgb, var(--violet) 20%, #d9dce5);
    border-radius: 999px;
    color: #686f7d;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 7px 18px rgba(44, 48, 67, 0.045);
    font-size: 0.68rem;
    font-weight: 780;
    white-space: nowrap;
}

.subject-course-visual {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 330px;
    isolation: isolate;
    color: var(--module-accent);
}

.subject-visual-glow {
    position: absolute;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, currentColor 23%, transparent), transparent 70%);
    filter: blur(7px);
}

.subject-visual-orbit {
    position: absolute;
    border: 2px solid color-mix(in srgb, currentColor 42%, transparent);
    border-radius: 50%;
}

.subject-visual-orbit--outer {
    width: 270px;
    height: 174px;
    transform: rotate(-18deg);
    animation: subject-orbit 9s ease-in-out infinite alternate;
}

.subject-visual-orbit--inner {
    width: 214px;
    height: 132px;
    border-style: dashed;
    opacity: 0.62;
    transform: rotate(25deg);
    animation: subject-orbit-reverse 8s ease-in-out infinite alternate;
}

.subject-visual-axis {
    position: absolute;
    width: 246px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, currentColor 62%, transparent), transparent);
}

.subject-visual-axis--one {
    transform: rotate(35deg);
}

.subject-visual-axis--two {
    transform: rotate(-35deg);
}

.subject-visual-core {
    position: relative;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 112px;
    height: 112px;
    border: 7px solid rgba(255, 255, 255, 0.9);
    border-radius: 31px;
    color: #fff;
    background:
        linear-gradient(
            145deg,
            color-mix(in srgb, var(--module-accent) 85%, white),
            color-mix(in srgb, var(--module-accent) 88%, #29245f)
        );
    box-shadow:
        0 25px 42px color-mix(in srgb, var(--module-accent) 23%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.38);
    transform: rotate(-6deg);
}

.subject-visual-core::before {
    position: absolute;
    inset: 9px;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 20px;
    content: "";
}

.subject-visual-core b {
    position: relative;
    z-index: 1;
    max-width: 88px;
    font-size: clamp(1.45rem, 3vw, 2.15rem);
    font-weight: 950;
    letter-spacing: -0.05em;
    line-height: 1;
    text-align: center;
}

.subject-visual-dot {
    position: absolute;
    z-index: 2;
    width: 17px;
    height: 17px;
    border: 4px solid rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 8px 18px color-mix(in srgb, currentColor 28%, transparent);
}

.subject-visual-dot--one {
    margin: -128px 0 0 -190px;
    animation: subject-dot-float 3.8s ease-in-out infinite;
}

.subject-visual-dot--two {
    width: 14px;
    height: 14px;
    margin: 74px 0 0 206px;
    color: #49cdb8;
    animation: subject-dot-float 4.2s ease-in-out -1.3s infinite;
}

.subject-visual-dot--three {
    width: 13px;
    height: 13px;
    margin: 146px 0 0 -112px;
    color: #f3a647;
    animation: subject-dot-float 3.5s ease-in-out -2.1s infinite;
}

.subject-visual-shadow {
    position: absolute;
    bottom: 62px;
    width: 180px;
    height: 24px;
    border-radius: 50%;
    background: rgba(31, 36, 52, 0.14);
    filter: blur(8px);
}

@keyframes subject-orbit {
    from { transform: rotate(-18deg) scale(0.98); }
    to { transform: rotate(-10deg) scale(1.03); }
}

@keyframes subject-orbit-reverse {
    from { transform: rotate(25deg) scale(1); }
    to { transform: rotate(16deg) scale(0.96); }
}

@keyframes subject-dot-float {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -9px; }
}

.subject-course-action {
    font-family: inherit;
    cursor: pointer;
}

.subject-course-action i {
    font-size: 1.08rem;
    font-style: normal;
    line-height: 1;
}

.subject-module-tab {
    min-height: 136px;
}

.subject-module-tab .module-info b {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5em;
    overflow: visible;
    line-height: 1.25;
    text-overflow: clip;
    white-space: normal;
}

@media (max-width: 760px) {
    .subject-stack {
        gap: 44px;
    }

    .additional-subject {
        padding-top: 28px;
    }

    .subject-heading {
        align-items: start;
        margin-bottom: 12px;
    }

    .subject-heading h2 {
        font-size: 1.45rem;
    }

    .subject-course-visual {
        min-height: 270px;
    }

    .subject-visual-orbit--outer {
        width: 236px;
        height: 150px;
    }

    .subject-visual-orbit--inner {
        width: 190px;
        height: 116px;
    }

    .subject-visual-axis {
        width: 216px;
    }

    .subject-visual-shadow {
        bottom: 40px;
    }
}

@media (max-width: 480px) {
    .subject-heading {
        flex-direction: column;
        gap: 8px;
    }

    .subject-heading > span {
        min-height: 28px;
        padding: 5px 10px;
    }

    .contact-info-trigger {
        bottom: 18px;
        left: 18px;
        width: 48px;
        height: 48px;
    }

    .contact-info-dialog {
        bottom: 78px;
        left: 18px;
        width: calc(100vw - 36px);
        border-radius: 20px;
    }

    .contact-info-dialog-head,
    .contact-info-list {
        padding-right: 18px;
        padding-left: 18px;
    }

    .contact-info-note {
        margin-right: 18px;
        margin-left: 18px;
    }
}

/* Global classroom information shortcut */
.contact-info-trigger {
    position: fixed;
    z-index: 1200;
    right: auto;
    bottom: 24px;
    left: 24px;
    display: grid;
    width: 52px;
    height: 52px;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(108, 86, 225, 0.24);
    border-radius: 50%;
    background: linear-gradient(145deg, #7459ee, #4c36c9);
    color: #ffffff;
    box-shadow: 0 14px 30px rgba(76, 54, 201, 0.28), 0 4px 10px rgba(26, 31, 49, 0.12);
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.contact-info-trigger:hover,
.contact-info-trigger:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 18px 34px rgba(76, 54, 201, 0.34), 0 5px 12px rgba(26, 31, 49, 0.14);
}

.contact-info-trigger:focus-visible,
.contact-info-close:focus-visible,
.contact-info-dialog a:focus-visible {
    outline: 3px solid rgba(73, 205, 184, 0.58);
    outline-offset: 3px;
}

.contact-info-trigger svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.9;
}

.contact-info-trigger .contact-info-icon-dot {
    fill: currentColor;
    stroke: none;
}

.contact-info-dialog {
    position: fixed;
    z-index: 1201;
    bottom: 90px;
    left: 24px;
    width: min(420px, calc(100vw - 48px));
    max-height: min(620px, calc(100vh - 132px));
    margin: 0;
    padding: 0;
    overflow: auto;
    border: 1px solid rgba(112, 95, 225, 0.2);
    border-radius: 24px;
    background: #ffffff;
    color: #1f2434;
    box-shadow: 0 24px 70px rgba(31, 36, 52, 0.22), 0 6px 22px rgba(76, 54, 201, 0.12);
}

.contact-info-dialog::backdrop {
    background: rgba(31, 36, 52, 0.26);
    backdrop-filter: blur(2px);
}

.contact-info-dialog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 24px 18px;
    background: linear-gradient(135deg, rgba(117, 89, 238, 0.1), rgba(73, 205, 184, 0.08));
}

.contact-info-eyebrow {
    display: block;
    margin-bottom: 6px;
    color: #6752d9;
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.16em;
}

.contact-info-dialog h2 {
    margin: 0;
    font-size: clamp(1.25rem, 3vw, 1.55rem);
    line-height: 1.2;
}

.contact-info-close {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(31, 36, 52, 0.12);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    color: #626b80;
    font-size: 1.55rem;
    line-height: 1;
    cursor: pointer;
}

.contact-info-list {
    display: grid;
    gap: 14px;
    padding: 20px 24px 4px;
}

.contact-info-list p {
    display: grid;
    gap: 4px;
    margin: 0;
    color: #596983;
    font-size: 0.96rem;
    line-height: 1.55;
}

.contact-info-list strong {
    color: #1f2434;
    font-size: 0.88rem;
}

.contact-info-dialog a {
    color: #5944d4;
    font-weight: 750;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.contact-info-dialog a:hover {
    text-decoration: underline;
}

.contact-info-note {
    margin: 18px 24px 24px;
    padding: 13px 15px;
    border-radius: 14px;
    background: #f2fbf9;
    color: #087867;
    font-size: 0.91rem;
    font-weight: 750;
    line-height: 1.5;
}

@media (max-width: 480px) {
    .contact-info-trigger {
        bottom: 18px;
        left: 18px;
        width: 48px;
        height: 48px;
    }

    .contact-info-dialog {
        bottom: 78px;
        left: 18px;
        width: calc(100vw - 36px);
        border-radius: 20px;
    }

    .contact-info-dialog-head,
    .contact-info-list {
        padding-right: 18px;
        padding-left: 18px;
    }

    .contact-info-note {
        margin-right: 18px;
        margin-left: 18px;
    }
}
