* {
    box-sizing: border-box;
}

:root {
    color-scheme: light;
    --bg: #f7f5fa;
    --surface: #ffffff;
    --surface-subtle: #faf8fc;
    --surface-strong: #f0ebf5;
    --text: #24182e;
    --text-soft: #574661;
    --muted: #81718a;
    --line: #e3dce8;
    --line-strong: #cec2d6;
    --primary: #7a3db8;
    --primary-hover: #65309c;
    --primary-soft: #eee3f8;
    --primary-ink: #4f247b;
    --blue: #526fc4;
    --blue-soft: #e7ebfa;
    --amber: #ac7216;
    --amber-soft: #f8edcf;
    --coral: #bd5479;
    --coral-soft: #f7e2ea;
    --red: #b94262;
    --red-soft: #f7e1e7;
    --success: #247d5b;
    --success-soft: #e2f2eb;
    --nav-bg: #2b173b;
    --nav-text: #eee4f4;
    --nav-muted: #bda9c9;
    --shadow-sm: 0 1px 2px rgba(48, 27, 61, 0.07);
    --shadow-md: 0 12px 30px rgba(48, 27, 61, 0.1);
    --sidebar-width: 248px;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #120d18;
    --surface: #1c1424;
    --surface-subtle: #22182c;
    --surface-strong: #2d2039;
    --text: #f7f1fa;
    --text-soft: #d3c4da;
    --muted: #a791b1;
    --line: #3d2d48;
    --line-strong: #51405d;
    --primary: #b778e7;
    --primary-hover: #c992ef;
    --primary-soft: #3b2450;
    --primary-ink: #e2bdf7;
    --blue: #91a7ec;
    --blue-soft: #293553;
    --amber: #e5b85f;
    --amber-soft: #47391f;
    --coral: #ed8caf;
    --coral-soft: #4b2a3b;
    --red: #ef879f;
    --red-soft: #4b2935;
    --success: #70d2a7;
    --success-soft: #213e33;
    --nav-bg: #241130;
    --nav-text: #f1e7f6;
    --nav-muted: #ad97b9;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.18);
    --shadow-md: 0 14px 34px rgba(0, 0, 0, 0.24);
}

html {
    min-width: 320px;
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
    letter-spacing: 0;
}

body.no-motion *,
body.no-motion *::before,
body.no-motion *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
}

button,
input,
select {
    font: inherit;
    letter-spacing: 0;
}

button,
a,
input,
select {
    -webkit-tap-highlight-color: transparent;
}

button {
    color: inherit;
}

a {
    color: inherit;
}

svg {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    stroke-width: 2;
}

[hidden] {
    display: none !important;
}

:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--blue) 42%, transparent);
    outline-offset: 3px;
}

.app-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    display: flex;
    width: var(--sidebar-width);
    min-height: 100vh;
    flex-direction: column;
    padding: 24px 18px 18px;
    overflow-y: auto;
    background: var(--nav-bg);
    color: var(--nav-text);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
}

.brand {
    min-height: 50px;
    padding: 2px 8px 22px;
}

.brand-copy,
.profile-link > span:not(.avatar) {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.brand-logo {
    display: block;
    width: min(176px, 100%);
    height: auto;
}

.brand-copy small,
.profile-link small,
.sidebar-metric small {
    color: var(--nav-muted);
    font-size: 11px;
}

.primary-nav {
    display: grid;
    gap: 6px;
}

.nav-link {
    position: relative;
    display: flex;
    min-height: 46px;
    align-items: center;
    gap: 13px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--nav-text);
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
    transition: background-color 160ms ease, color 160ms ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
}

.nav-link.is-active {
    background: #efe2f7;
    color: #51256f;
}

.nav-link.is-active::before {
    position: absolute;
    left: -18px;
    width: 4px;
    height: 24px;
    border-radius: 0 4px 4px 0;
    background: #c38ce8;
    content: "";
}

.nav-link-mobile-only {
    display: none;
}

.sidebar-footer {
    display: grid;
    gap: 12px;
    margin-top: auto;
    padding-top: 26px;
}

.sidebar-metric,
.profile-link {
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 8px;
}

.sidebar-metric {
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-metric > span:last-child {
    display: flex;
    flex-direction: column;
}

.sidebar-metric strong,
.profile-link strong {
    color: #ffffff;
    font-size: 13px;
}

.profile-link {
    min-height: 58px;
    padding: 8px;
    text-decoration: none;
    transition: background-color 160ms ease;
}

.profile-link:hover,
.profile-link.is-active {
    background: rgba(255, 255, 255, 0.08);
}

.profile-link > svg {
    width: 17px;
    margin-left: auto;
    color: var(--nav-muted);
}

.avatar {
    display: inline-flex;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #eadcf2;
    color: #542972;
    font-size: 12px;
    font-weight: 800;
}

.app-main {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
}

.course-switcher {
    position: fixed;
    top: 18px;
    right: 24px;
    z-index: 45;
}

.notification-center {
    position: fixed;
    top: 18px;
    right: 88px;
    z-index: 46;
}

.install-launcher {
    position: fixed;
    top: 18px;
    right: 24px;
    z-index: 44;
}

.install-launcher-student {
    right: 152px;
}

.notification-trigger {
    position: relative;
}

.notification-trigger,
.install-launcher {
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    color: var(--text-soft);
    cursor: pointer;
    text-decoration: none;
}

.notification-trigger:hover,
.notification-trigger:focus-visible,
.notification-center.is-open .notification-trigger,
.install-launcher:hover,
.install-launcher:focus-visible,
.install-launcher.is-active {
    border-color: var(--primary);
    color: var(--primary);
}

.notification-trigger > svg,
.install-launcher > svg {
    width: 19px;
    height: 19px;
}

.notification-badge {
    position: absolute;
    top: -6px;
    right: -7px;
    display: inline-grid;
    min-width: 20px;
    height: 20px;
    place-items: center;
    padding: 0 5px;
    border: 2px solid var(--bg);
    border-radius: 10px;
    background: var(--red);
    color: #ffffff;
    font-size: 9px;
    font-weight: 850;
}

.notification-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(370px, calc(100vw - 28px));
    max-height: min(590px, calc(100vh - 84px));
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-md);
}

.notification-heading {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.notification-heading > div {
    display: grid;
    gap: 2px;
}

.notification-heading small {
    color: var(--muted);
    font-size: 9px;
    font-weight: 750;
    text-transform: uppercase;
}

.notification-heading strong {
    font-size: 15px;
}

.notification-heading > span {
    display: inline-grid;
    min-width: 26px;
    height: 26px;
    place-items: center;
    padding: 0 7px;
    border-radius: 13px;
    background: var(--primary-soft);
    color: var(--primary-ink);
    font-size: 10px;
    font-weight: 850;
}

.notification-empty {
    display: grid;
    justify-items: center;
    gap: 7px;
    padding: 34px 22px;
    color: var(--muted);
    text-align: center;
}

.notification-empty > svg {
    width: 25px;
    height: 25px;
    color: var(--primary);
}

.notification-empty strong {
    color: var(--text);
    font-size: 13px;
}

.notification-empty p {
    max-width: 260px;
    margin: 0;
    font-size: 11px;
    line-height: 1.5;
}

.notification-list {
    display: grid;
}

.notification-item {
    display: grid;
    gap: 9px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}

.notification-item:last-child {
    border-bottom: 0;
}

.notification-item-friend_request_accepted {
    box-shadow: inset 3px 0 0 var(--success);
}

.notification-item-friend_request_rejected {
    box-shadow: inset 3px 0 0 var(--muted);
}

.notification-sender {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
    color: inherit;
    text-decoration: none;
}

.notification-sender .avatar {
    width: 34px;
    height: 34px;
}

.notification-sender > span:last-child {
    display: grid;
    min-width: 0;
}

.notification-sender strong,
.notification-sender small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-sender strong {
    font-size: 12px;
}

.notification-sender small {
    color: var(--muted);
    font-size: 9px;
}

.notification-item > p {
    margin: 0;
    color: var(--text-soft);
    font-size: 11px;
    line-height: 1.5;
}

.notification-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.notification-actions-single {
    grid-template-columns: 1fr;
}

.notification-actions form,
.notification-actions .button {
    width: 100%;
}

.notification-actions .button {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 10px;
}

.notification-actions .button svg {
    width: 14px;
    height: 14px;
}

.course-switcher-trigger {
    display: inline-flex;
    width: 54px;
    height: 42px;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    color: var(--text-soft);
    cursor: pointer;
}

.course-switcher-trigger > svg {
    width: 14px;
    height: 14px;
    transition: transform 160ms ease;
}

.course-switcher.is-open .course-switcher-trigger > svg {
    transform: rotate(180deg);
}

.course-flag {
    position: relative;
    display: inline-block;
    width: 26px;
    height: 19px;
    flex: 0 0 auto;
    overflow: hidden;
    border: 1px solid rgba(32, 38, 50, 0.22);
    border-radius: 3px;
    background: #ffffff;
}

.course-flag-spanish {
    background: #f5c542;
}

.course-flag-spanish::before,
.course-flag-spanish::after {
    position: absolute;
    right: 0;
    left: 0;
    height: 4px;
    background: #c52b36;
    content: "";
}

.course-flag-spanish::before {
    top: 0;
}

.course-flag-spanish::after {
    bottom: 0;
}

.course-flag-polish::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 50%;
    background: #dc3550;
    content: "";
}

.course-flag-russian {
    background: linear-gradient(
        to bottom,
        #ffffff 0 33.333%,
        #0039a6 33.333% 66.666%,
        #d52b1e 66.666% 100%
    );
}

.course-flag-french {
    background: linear-gradient(
        to right,
        #0055a4 0 33.333%,
        #ffffff 33.333% 66.666%,
        #ef4135 66.666% 100%
    );
}

.course-flag-german {
    background: linear-gradient(
        to bottom,
        #181818 0 33.333%,
        #dd0000 33.333% 66.666%,
        #ffce00 66.666% 100%
    );
}

.course-flag-portuguese {
    background: linear-gradient(to right, #046a38 0 40%, #da291c 40% 100%);
}

.course-flag-portuguese::before {
    position: absolute;
    top: 4px;
    left: 7px;
    width: 7px;
    height: 7px;
    border: 1px solid #f7cf4a;
    border-radius: 50%;
    content: "";
}

.course-flag-italian {
    background: linear-gradient(
        to right,
        #009246 0 33.333%,
        #ffffff 33.333% 66.666%,
        #ce2b37 66.666% 100%
    );
}

.course-flag-turkish {
    background: #e30a17;
}

.course-flag-turkish::before {
    position: absolute;
    top: 3px;
    left: 5px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 3px 0 0 #e30a17;
    content: "";
}

.course-flag-turkish::after {
    position: absolute;
    top: 6px;
    left: 14px;
    width: 5px;
    height: 5px;
    background: #ffffff;
    clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 93%, 50% 71%, 21% 93%, 32% 57%, 2% 35%, 39% 35%);
    content: "";
}

.course-flag-lithuanian {
    background: #006a44 url("/images/flags/lt.svg") center / 100% 100% no-repeat;
}

.course-flag-norwegian {
    background: #ba0c2f url("/images/flags/no.svg") center / 100% 100% no-repeat;
}

.course-flag-swedish {
    background: #006aa7 url("/images/flags/se.svg") center / 100% 100% no-repeat;
}

.course-flag-irish {
    background: #ffffff url("/images/flags/ie.svg") center / 100% 100% no-repeat;
}

.course-flag-hungarian {
    background: #ffffff url("/images/flags/hu.svg") center / 100% 100% no-repeat;
}

.course-flag-czech {
    background: #ffffff url("/images/flags/cz.svg") center / 100% 100% no-repeat;
}

.course-flag-czech::before {
    content: none;
}

.course-flag-slovak {
    background: #ffffff url("/images/flags/sk.svg") center / 100% 100% no-repeat;
}

.course-flag-slovak::before {
    content: none;
}

.course-flag-danish {
    background: #c60c30 url("/images/flags/dk.svg") center / 100% 100% no-repeat;
}

.course-flag-english {
    background:
        linear-gradient(to bottom, transparent 41%, #c8102e 41% 59%, transparent 59%),
        linear-gradient(to right, transparent 42%, #c8102e 42% 58%, transparent 58%),
        linear-gradient(to bottom, transparent 29%, #ffffff 29% 71%, transparent 71%),
        linear-gradient(to right, transparent 33%, #ffffff 33% 67%, transparent 67%),
        linear-gradient(33deg, transparent 39%, #ffffff 39% 44%, #c8102e 44% 50%, #ffffff 50% 61%, transparent 61%),
        linear-gradient(-33deg, transparent 39%, #ffffff 39% 50%, #c8102e 50% 56%, #ffffff 56% 61%, transparent 61%),
        #012169;
}

.course-flag-english::before,
.course-flag-english::after {
    content: none;
}

.course-switcher-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(300px, calc(100vw - 28px));
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-md);
}

.course-switcher-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 2px 2px 10px;
}

.course-switcher-heading > div {
    display: grid;
    gap: 2px;
}

.course-switcher-heading small,
.course-add-options > small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 750;
    text-transform: uppercase;
}

.course-switcher-heading strong {
    font-size: 15px;
}

.course-add-trigger {
    width: 34px;
    height: 34px;
}

.course-switcher-list,
.course-add-options {
    display: grid;
    max-height: min(480px, calc(100dvh - 150px));
    gap: 4px;
    padding-right: 2px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.course-switcher-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px;
    align-items: center;
    gap: 3px;
}

.course-switch-form,
.course-delete-form {
    min-width: 0;
}

.course-switcher-option {
    display: grid;
    width: 100%;
    min-height: 48px;
    grid-template-columns: 27px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 9px;
    padding: 8px 9px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.course-switcher-option:hover:not(:disabled),
.course-switcher-option:focus-visible,
.course-switcher-option.is-active {
    background: var(--surface-subtle);
}

.course-switcher-option:disabled {
    color: var(--text);
    cursor: default;
    opacity: 1;
}

.course-switcher-option > span:nth-child(2) {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.course-switcher-option strong,
.course-switcher-option small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.course-switcher-option strong {
    font-size: 13px;
}

.course-switcher-option small {
    color: var(--muted);
    font-size: 10px;
}

.course-switcher-option > svg {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.course-delete-button {
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.course-delete-button:hover,
.course-delete-button:focus-visible {
    background: var(--red-soft);
    color: var(--red);
}

.course-delete-button > svg {
    width: 16px;
    height: 16px;
}

.course-add-options {
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.course-add-options > small {
    padding: 0 9px 4px;
}

.course-switcher-error {
    margin: 9px 4px 2px;
    color: var(--red);
    font-size: 11px;
    line-height: 1.4;
}

.has-course-switcher .page-content,
.has-install-launcher .page-content {
    padding-top: 78px;
}

.icon-button {
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-soft);
    cursor: pointer;
    text-decoration: none;
    transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.icon-button:hover {
    border-color: var(--line-strong);
    background: var(--surface-subtle);
    color: var(--primary);
}

.page-content {
    width: min(1240px, calc(100% - 64px));
    margin: 0 auto;
    padding: 42px 0 24px;
}

.page-heading {
    max-width: 760px;
    margin-bottom: 30px;
}

.page-heading-actions {
    display: flex;
    max-width: none;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.eyebrow,
.overline,
.level-kicker,
.prompt-label {
    margin: 0 0 7px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    overflow-wrap: anywhere;
}

h1,
h2,
h3 {
    color: var(--text);
    line-height: 1.18;
}

h1 {
    margin: 0;
    font-size: 38px;
    font-weight: 820;
}

h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 780;
}

h3 {
    margin: 0;
    font-size: 17px;
}

.page-lead {
    max-width: 680px;
    margin: 9px 0 0;
    color: var(--text-soft);
    font-size: 16px;
}

.button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 750;
    text-decoration: none;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.button-primary {
    background: var(--primary);
    color: #ffffff;
}

.button-primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

.button-secondary {
    border-color: var(--line-strong);
    background: var(--surface);
    color: var(--text);
}

.button-secondary:hover:not(:disabled),
.button-quiet:hover:not(:disabled) {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary-ink);
}

.button-quiet {
    border-color: transparent;
    background: transparent;
    color: var(--text-soft);
}

.button-light {
    background: #faf5fd;
    color: #51256f;
}

.button-light:hover:not(:disabled) {
    background: #ffffff;
}

.button-wide {
    width: 100%;
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--primary);
    font-size: 14px;
    font-weight: 750;
    text-decoration: none;
}

.text-link svg {
    width: 17px;
    transition: transform 160ms ease;
}

.text-link:hover svg {
    transform: translateX(3px);
}

.icon-tile {
    display: inline-flex;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.icon-tile-green {
    background: var(--primary-soft);
    color: var(--primary);
}

.icon-tile-purple {
    background: var(--primary-soft);
    color: var(--primary);
}

.icon-tile-blue {
    background: var(--blue-soft);
    color: var(--blue);
}

.icon-tile-amber {
    background: var(--amber-soft);
    color: var(--amber);
}

.status-badge,
.xp-pill,
.language-chip {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--surface-strong);
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
}

.dashboard-hero {
    display: grid;
    min-height: 300px;
    grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
    align-items: center;
    gap: 48px;
    padding: 42px 48px;
    border: 1px solid #64358a;
    border-radius: 8px;
    background: #4b2468;
    box-shadow: var(--shadow-md);
    color: #eee2f4;
}

.dashboard-hero h2 {
    max-width: 580px;
    color: #ffffff;
    font-size: 32px;
}

.dashboard-hero p:not(.overline) {
    max-width: 580px;
    margin: 14px 0 24px;
    color: #ddc9e7;
}

.overline-light {
    color: #d7a8ee;
}

.session-orbit {
    display: flex;
    min-height: 216px;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
}

.session-orbit-ring {
    display: flex;
    width: 128px;
    height: 128px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    border: 10px solid #c487e5;
    border-radius: 50%;
    background: #351849;
}

.session-orbit-ring strong {
    color: #ffffff;
    font-size: 36px;
    line-height: 1;
}

.session-orbit-ring span {
    margin-top: 5px;
    color: #d8c1e3;
    font-size: 12px;
}

.session-orbit-meta {
    display: grid;
    gap: 12px;
}

.session-orbit-meta span {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #eee2f4;
    font-size: 13px;
}

.session-orbit-meta svg {
    width: 17px;
    color: #d7a8ee;
}

.section-block {
    margin-top: 42px;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 17px;
}

.section-heading.compact {
    align-items: flex-start;
    margin-bottom: 22px;
}

.section-heading .eyebrow {
    margin-bottom: 5px;
}

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

.metric-card {
    display: grid;
    min-width: 0;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    padding: 20px;
    border: 1px solid var(--line);
    border-top: 3px solid transparent;
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.metric-card .metric-icon {
    display: inline-flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.metric-card > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.metric-card strong {
    color: var(--text);
    font-size: 25px;
    line-height: 1.1;
}

.metric-card span:not(.metric-icon) {
    margin-top: 4px;
    color: var(--text-soft);
    font-size: 13px;
}

.metric-card small {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 12px;
}

.metric-green {
    border-top-color: var(--primary);
}

.metric-green .metric-icon {
    background: var(--primary-soft);
    color: var(--primary);
}

.metric-blue {
    border-top-color: var(--blue);
}

.metric-blue .metric-icon {
    background: var(--blue-soft);
    color: var(--blue);
}

.metric-amber {
    border-top-color: var(--amber);
}

.metric-amber .metric-icon {
    background: var(--amber-soft);
    color: var(--amber);
}

.metric-coral {
    border-top-color: var(--coral);
}

.metric-coral .metric-icon {
    background: var(--coral-soft);
    color: var(--coral);
}

.dashboard-columns,
.progress-layout,
.profile-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
    gap: 18px;
    margin-top: 22px;
}

.surface-panel {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.weekly-chart {
    display: grid;
    min-height: 150px;
    grid-template-columns: repeat(7, minmax(32px, 1fr));
    align-items: end;
    gap: 10px;
}

.chart-day {
    display: grid;
    min-width: 0;
    gap: 8px;
    text-align: center;
}

.chart-column {
    position: relative;
    display: flex;
    height: 112px;
    align-items: flex-end;
    justify-content: center;
    border-bottom: 1px solid var(--line);
}

.chart-column::before {
    position: absolute;
    inset: 25% 0 auto;
    border-top: 1px dashed var(--line);
    content: "";
}

.chart-column span {
    position: relative;
    z-index: 1;
    width: min(24px, 70%);
    min-height: 4px;
    border-radius: 4px 4px 1px 1px;
    background: var(--primary);
    transition: height 300ms ease;
}

.chart-day.is-today .chart-column span {
    background: var(--blue);
}

.chart-day > span {
    color: var(--muted);
    font-size: 11px;
    text-transform: capitalize;
}

.goal-progress {
    display: grid;
    gap: 13px;
}

.goal-progress-copy,
.course-progress-copy {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
}

.goal-progress-copy span,
.course-progress-copy span {
    color: var(--text-soft);
    font-size: 13px;
}

.goal-progress-copy strong,
.course-progress-copy strong {
    color: var(--text);
    font-size: 18px;
}

.linear-progress,
.progress-track {
    position: relative;
    overflow: hidden;
    border-radius: 999px;
    background: var(--surface-strong);
}

.linear-progress {
    height: 9px;
}

.linear-progress > span,
.progress-track > span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--primary);
    transition: width 300ms ease;
}

.panel-note {
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.page-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 54px;
    padding: 20px 0 0;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
}

/* Vocabulary */
.library-overview {
    display: flex;
    align-items: center;
    gap: 12px 32px;
    margin: -6px 0 26px;
    padding: 15px 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.library-overview > div {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 11px;
}

.library-overview > div + div {
    padding-left: 32px;
    border-left: 1px solid var(--line);
}

.library-overview > div > span:last-child {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.library-overview strong {
    font-size: 14px;
}

.library-overview small {
    color: var(--muted);
    font-size: 12px;
}

.level-tabs {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 26px;
    padding: 5px;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-strong);
}

.level-tab {
    display: flex;
    min-width: 94px;
    min-height: 54px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--text-soft);
    cursor: pointer;
}

.level-tab strong {
    font-size: 15px;
}

.level-tab span {
    color: var(--muted);
    font-size: 11px;
}

.level-tab.is-active {
    border-color: var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    color: var(--primary);
}

.level-tab:disabled {
    cursor: not-allowed;
    opacity: 0.52;
}

.library-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    align-items: start;
    gap: 22px;
}

.level-panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
}

.level-panel-heading p {
    max-width: 620px;
    margin: 7px 0 0;
    color: var(--text-soft);
}

.check-all {
    display: flex;
    min-height: 40px;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-soft);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.check-all input,
.category-card input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

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

.category-groups {
    display: grid;
    gap: 30px;
}

.category-group {
    min-width: 0;
}

.category-group-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--line);
}

.category-group-heading h3 {
    font-size: 15px;
}

.category-group-heading span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.category-card {
    position: relative;
    min-height: 150px;
    padding: 18px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    background: var(--surface);
    transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.category-selection {
    display: grid;
    min-height: 112px;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 14px;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-1px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-sm);
}

.category-card:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.category-selection > input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.category-check {
    position: absolute;
    top: 13px;
    right: 13px;
    display: inline-flex;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: var(--surface);
    color: transparent;
}

.category-check svg {
    width: 15px;
}

.category-card input:checked + .category-check {
    border-color: var(--primary);
    background: var(--primary);
    color: #ffffff;
}

.category-icon {
    display: inline-flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary);
}

.category-blue {
    border-left-color: var(--blue);
}

.category-blue .category-icon {
    background: var(--blue-soft);
    color: var(--blue);
}

.category-amber {
    border-left-color: var(--amber);
}

.category-amber .category-icon {
    background: var(--amber-soft);
    color: var(--amber);
}

.category-coral {
    border-left-color: var(--coral);
}

.category-coral .category-icon {
    background: var(--coral-soft);
    color: var(--coral);
}

.category-green {
    border-left-color: var(--success);
}

.category-green .category-icon {
    background: var(--success-soft);
    color: var(--success);
}

.custom-category-card {
    cursor: default;
}

.category-view-link,
.custom-category-edit,
.custom-word-remove {
    display: inline-grid;
    width: 32px;
    height: 32px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.category-card-actions {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 2;
    display: inline-flex;
    gap: 3px;
}

.category-view-link,
.custom-category-edit {
    color: var(--muted);
    text-decoration: none;
}

.category-view-link:hover,
.category-view-link:focus-visible,
.custom-category-edit:hover,
.custom-category-edit:focus-visible {
    background: var(--surface-strong);
    color: var(--primary);
}

.category-view-link svg,
.custom-category-edit svg,
.custom-word-remove svg {
    width: 16px;
    height: 16px;
}

.category-copy {
    display: flex;
    min-width: 0;
    padding: 0 24px 34px 0;
    flex-direction: column;
}

.category-copy strong {
    font-size: 16px;
}

.category-copy small {
    min-height: 38px;
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
}

.category-copy > span {
    margin-top: 9px;
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 750;
}

.vocabulary-section-heading {
    align-items: flex-end;
}

.vocabulary-section-summary {
    display: flex;
    min-height: 76px;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    background: var(--surface);
}

.vocabulary-section-summary > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.vocabulary-section-summary > div strong {
    color: var(--text);
    font-size: 16px;
}

.vocabulary-section-summary > div span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.vocabulary-section-custom-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    padding: 6px 9px;
    border-radius: 6px;
    background: var(--success-soft);
    color: var(--success);
    font-size: 11px;
    font-weight: 800;
}

.vocabulary-section-custom-label svg {
    width: 14px;
    height: 14px;
}

.vocabulary-section-content {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.vocabulary-section-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding: 20px;
    border-bottom: 1px solid var(--line);
}

.vocabulary-section-toolbar h2 {
    margin-top: 3px;
    font-size: 18px;
}

.vocabulary-section-search {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vocabulary-search-field {
    position: relative;
    display: block;
}

.vocabulary-search-field > svg {
    position: absolute;
    top: 50%;
    left: 12px;
    width: 17px;
    height: 17px;
    color: var(--muted);
    transform: translateY(-50%);
    pointer-events: none;
}

.vocabulary-search-field input {
    width: min(290px, 35vw);
    min-height: 42px;
    padding-left: 38px;
}

.vocabulary-word-table-wrap {
    overflow-x: auto;
}

.vocabulary-word-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.vocabulary-word-table th,
.vocabulary-word-table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
}

.vocabulary-word-table th {
    background: var(--surface-subtle);
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.vocabulary-word-table th:first-child,
.vocabulary-word-table td:first-child {
    width: 64px;
    color: var(--muted);
}

.vocabulary-word-table th:nth-child(2),
.vocabulary-word-table th:nth-child(3) {
    width: 27%;
}

.vocabulary-word-table tbody tr:last-child td {
    border-bottom: 0;
}

.vocabulary-word-table tbody tr:hover:not(.vocabulary-empty-row) {
    background: var(--surface-subtle);
}

.vocabulary-synonyms {
    color: var(--text-soft);
    font-size: 12px;
    line-height: 1.55;
}

.vocabulary-no-synonyms {
    color: var(--muted);
}

.vocabulary-empty-row td {
    padding: 44px 20px;
    text-align: center;
}

.vocabulary-empty-row td > * {
    display: block;
    margin: 0 auto;
}

.vocabulary-empty-row svg {
    width: 28px;
    height: 28px;
    margin-bottom: 10px;
    color: var(--muted);
}

.vocabulary-empty-row span {
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
}

.vocabulary-pagination {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-top: 1px solid var(--line);
}

.vocabulary-pagination > :last-child {
    justify-self: end;
}

.vocabulary-pagination > span:nth-child(2) {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.selection-panel {
    position: sticky;
    top: 22px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.custom-vocabulary-dialog {
    width: min(980px, calc(100% - 32px));
    max-width: none;
    max-height: calc(100dvh - 32px);
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-lg);
}

.custom-vocabulary-dialog::backdrop {
    background: rgba(18, 13, 24, 0.62);
}

.custom-vocabulary-dialog > form {
    display: grid;
    max-height: calc(100dvh - 34px);
    grid-template-rows: auto minmax(0, 1fr) auto;
}

.custom-vocabulary-dialog-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 22px;
    border-bottom: 1px solid var(--line);
}

.custom-vocabulary-dialog-heading h2 {
    font-size: 21px;
}

.custom-vocabulary-dialog-body {
    padding: 20px 22px 24px;
    overflow-y: auto;
}

.custom-section-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 12px;
}

.custom-section-fields label,
.custom-word-fields label {
    display: grid;
    min-width: 0;
    gap: 6px;
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 750;
}

.custom-words-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 24px 0 12px;
}

.custom-words-heading h3 {
    font-size: 16px;
}

.custom-words-heading span {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
}

.custom-word-rows {
    display: grid;
    gap: 10px;
}

.custom-word-row {
    position: relative;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 32px;
    align-items: start;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-subtle);
}

.custom-word-number {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    margin-top: 24px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
}

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

.custom-word-synonyms-field {
    grid-column: 1 / -1;
}

.custom-word-fields input[readonly] {
    background: var(--surface-strong);
    color: var(--text-soft);
}

.custom-word-source-field {
    position: relative;
}

.translation-suggestions {
    position: absolute;
    z-index: 5;
    top: calc(100% + 5px);
    right: 0;
    left: 0;
    display: grid;
    max-height: 210px;
    padding: 5px;
    overflow-y: auto;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-md);
}

.translation-suggestions button {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-soft);
    cursor: pointer;
    text-align: left;
}

.translation-suggestions button:hover,
.translation-suggestions button:focus-visible {
    background: var(--primary-soft);
    color: var(--primary-ink);
}

.translation-suggestions button span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.translation-suggestions button strong {
    color: var(--text);
    font-size: 12px;
    text-align: right;
}

.custom-word-remove {
    margin-top: 22px;
}

.custom-word-remove:hover,
.custom-word-remove:focus-visible {
    background: var(--red-soft);
    color: var(--red);
}

.custom-word-status {
    min-height: 18px;
    grid-column: 2;
    margin: -3px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.custom-section-error {
    min-height: 20px;
    margin: 12px 0 0;
    color: var(--red);
    font-size: 12px;
    font-weight: 700;
}

.custom-vocabulary-dialog-actions {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    padding: 14px 22px;
    border-top: 1px solid var(--line);
    background: var(--surface-subtle);
}

.selection-panel h2 {
    font-size: 19px;
}

.selection-count {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 21px 0 15px;
    padding-bottom: 17px;
    border-bottom: 1px solid var(--line);
}

.selection-count strong {
    color: var(--primary);
    font-size: 34px;
    line-height: 1;
}

.selection-count span {
    color: var(--muted);
    font-size: 12px;
}

.selected-category-list {
    display: flex;
    min-height: 36px;
    align-content: flex-start;
    gap: 6px;
    flex-wrap: wrap;
}

.selected-category-list span {
    display: inline-flex;
    align-items: center;
    padding: 5px 8px;
    border-radius: 999px;
    background: var(--surface-strong);
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 700;
}

.selected-category-list .selection-empty {
    padding: 0;
    background: transparent;
    color: var(--muted);
    font-weight: 500;
}

.save-status {
    min-height: 21px;
    margin: 12px 0 7px;
    color: var(--primary);
    font-size: 12px;
}

.selection-panel .button + .button {
    margin-top: 6px;
}

.selection-panel .button {
    width: 100%;
}

.empty-state {
    display: flex;
    min-height: 260px;
    align-items: center;
    justify-content: center;
    padding: 36px;
    border: 1px dashed var(--line-strong);
    border-radius: 8px;
    flex-direction: column;
    text-align: center;
}

.empty-state h3 {
    margin-top: 14px;
}

.empty-state p {
    max-width: 440px;
    margin: 7px 0 0;
    color: var(--muted);
}

/* Exercises */
.exercise-page {
    width: min(100%, 1040px);
    margin: 0 auto;
}

.session-start-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
    gap: 18px;
}

.session-preview,
.session-ready-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.session-preview {
    display: grid;
    min-height: 310px;
    grid-template-columns: auto minmax(0, 1fr);
    align-content: center;
    gap: 20px;
    padding: 34px;
}

.session-preview-icon {
    display: inline-flex;
    width: 66px;
    height: 66px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary);
}

.session-preview-icon svg {
    width: 32px;
    height: 32px;
}

.session-preview-copy h2 {
    font-size: 28px;
}

.session-preview-copy > p:last-child {
    margin: 9px 0 0;
    color: var(--text-soft);
}

.session-facts {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.session-facts span {
    display: flex;
    min-height: 56px;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-radius: 8px;
    background: var(--surface-subtle);
    color: var(--text-soft);
    font-size: 12px;
}

.session-facts svg {
    width: 17px;
    color: var(--primary);
}

.session-ready-panel {
    display: flex;
    min-height: 310px;
    justify-content: center;
    padding: 28px;
    flex-direction: column;
}

.session-ready-panel > div {
    display: flex;
    margin: 9px 0 24px;
    flex-direction: column;
}

.session-ready-panel strong {
    font-size: 16px;
}

.session-ready-panel span:not(.status-dot) {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--amber);
    box-shadow: 0 0 0 5px var(--amber-soft);
}

.status-dot.is-ready {
    background: var(--primary);
    box-shadow: 0 0 0 5px var(--primary-soft);
}

.learning-screen {
    max-width: 900px;
    margin: 0 auto;
}

.learning-header {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    align-items: center;
    gap: 15px;
}

.learning-progress-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.learning-progress-copy strong {
    font-size: 14px;
}

.learning-progress-copy span {
    color: var(--muted);
    font-size: 12px;
}

.xp-pill {
    background: var(--primary-soft);
    color: var(--primary-ink);
}

.xp-pill svg {
    width: 15px;
}

.progress-track {
    height: 8px;
    margin: 18px 0 28px;
}

.question-stage {
    min-height: 430px;
    padding: 40px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-md);
}

.question-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 50px;
}

.question-meta span {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--surface-strong);
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 750;
}

.question-stage > h1 {
    min-height: 54px;
    margin-top: 5px;
    font-size: 40px;
}

.question-stage > h1.question-answer-correct {
    color: var(--success);
}

.question-stage > h1.question-answer-wrong {
    color: var(--red);
}

.question-stage > h1.question-answer-hint {
    color: var(--muted);
}

.answer-form {
    margin-top: 43px;
}

.answer-form > label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 700;
}

.answer-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

input[type="text"],
input:not([type]),
select {
    min-width: 0;
    min-height: 48px;
    padding: 11px 13px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
}

input::placeholder {
    color: var(--muted);
}

input:focus,
select:focus {
    border-color: var(--primary);
    outline: 3px solid color-mix(in srgb, var(--primary) 15%, transparent);
}

.answer-row input {
    height: 52px;
    font-size: 17px;
}

.answer-row .button {
    min-width: 132px;
}

.cyrillic-keyboard {
    display: grid;
    justify-items: end;
    gap: 8px;
    margin-top: 10px;
}

.cyrillic-keyboard-toggle {
    width: 42px;
    height: 42px;
    color: var(--text-soft);
}

.cyrillic-keyboard.is-open .cyrillic-keyboard-toggle {
    border-color: var(--primary);
    color: var(--primary);
}

.cyrillic-keyboard-panel {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface-soft);
    box-shadow: var(--shadow-soft);
}

.cyrillic-keyboard-row {
    display: flex;
    gap: 4px;
}

.cyrillic-keyboard-row + .cyrillic-keyboard-row {
    margin-top: 5px;
}

.cyrillic-keyboard-row > button {
    min-width: 0;
    height: 38px;
    flex: 1 1 0;
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 2px 0 color-mix(in srgb, var(--line-strong) 70%, transparent);
    cursor: pointer;
}

.cyrillic-keyboard-row > button:active {
    transform: translateY(1px);
    box-shadow: none;
}

.cyrillic-keyboard-actions .cyrillic-space-key {
    flex-grow: 5;
    font-size: 12px;
}

.cyrillic-keyboard-actions .cyrillic-delete-key {
    flex-grow: 1;
}

.cyrillic-delete-key > svg {
    width: 17px;
    height: 17px;
}

.answer-feedback {
    display: none;
    min-height: 54px;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
}

.answer-feedback.is-visible {
    display: flex;
}

.answer-feedback.answer-good {
    border-color: color-mix(in srgb, var(--primary) 36%, var(--line));
    background: var(--primary-soft);
    color: var(--primary-ink);
}

.answer-feedback.answer-bad {
    border-color: color-mix(in srgb, var(--red) 36%, var(--line));
    background: var(--red-soft);
    color: var(--red);
}

.summary-screen {
    max-width: 860px;
    margin: 14px auto 0;
    text-align: center;
}

.summary-mark {
    display: inline-flex;
    width: 74px;
    height: 74px;
    align-items: center;
    justify-content: center;
    margin-bottom: 19px;
    border-radius: 50%;
    background: var(--amber-soft);
    color: var(--amber);
}

.summary-mark svg {
    width: 34px;
    height: 34px;
}

.summary-screen .page-lead {
    margin-right: auto;
    margin-left: auto;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 34px;
}

.summary-stat {
    display: flex;
    min-height: 144px;
    align-items: center;
    justify-content: center;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    flex-direction: column;
}

.summary-stat svg {
    margin-bottom: 9px;
}

.summary-stat strong {
    font-size: 26px;
}

.summary-stat span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.summary-correct svg,
.summary-xp svg {
    color: var(--primary);
}

.summary-wrong svg {
    color: var(--red);
}

.summary-accuracy svg {
    color: var(--blue);
}

.summary-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 25px;
}

/* Progress */
.progress-metrics {
    margin-bottom: 22px;
}

.progress-layout {
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.65fr);
}

.weekly-chart-large {
    min-height: 230px;
}

.weekly-chart-large .chart-column {
    height: 185px;
}

.consistency-panel {
    display: flex;
    justify-content: center;
    flex-direction: column;
}

.consistency-panel .eyebrow {
    margin-top: 20px;
}

.consistency-panel > p:last-of-type {
    margin: 9px 0 22px;
    color: var(--text-soft);
    font-size: 13px;
}

.consistency-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 5px;
}

.consistency-day {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 6px;
    flex-direction: column;
    color: var(--muted);
    font-size: 10px;
}

.consistency-day span:first-child {
    width: 25px;
    height: 25px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface-strong);
}

.consistency-day.is-active span:first-child {
    border-color: var(--primary);
    background: var(--primary);
    box-shadow: inset 0 0 0 5px var(--primary-soft);
}

.history-table {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.history-header,
.history-item {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) minmax(190px, 1.4fr) minmax(110px, 0.8fr) minmax(70px, 0.5fr);
    gap: 18px;
    align-items: center;
}

.history-header {
    padding: 11px 18px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-subtle);
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
    text-transform: uppercase;
}

.history-item {
    min-height: 64px;
    padding: 12px 18px;
    color: var(--text-soft);
    font-size: 13px;
}

.history-item + .history-item {
    border-top: 1px solid var(--line);
}

.history-item strong {
    color: var(--text);
}

.history-score {
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-score span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.history-score .history-correct {
    color: var(--primary);
}

.history-score .history-wrong {
    color: var(--red);
}

.history-empty {
    display: flex;
    min-height: 170px;
    align-items: center;
    justify-content: center;
    padding: 30px;
    color: var(--muted);
    text-align: center;
}

/* Profile */
.profile-hero {
    display: flex;
    min-height: 150px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.profile-identity,
.profile-xp {
    display: flex;
    align-items: center;
    gap: 17px;
}

.profile-avatar {
    display: inline-flex;
    width: 78px;
    height: 78px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary-ink);
    font-size: 23px;
    font-weight: 850;
}

.profile-avatar-editor {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
}

.profile-avatar-edit {
    position: absolute;
    right: -3px;
    bottom: -3px;
    display: inline-flex;
    width: 31px;
    height: 31px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 2px solid var(--surface);
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.profile-avatar-edit:hover {
    background: var(--primary-ink);
}

.profile-avatar-edit svg {
    width: 15px;
    height: 15px;
}

.profile-identity h2 {
    margin-top: 8px;
    font-size: 25px;
}

.profile-public-id {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 7px;
    margin-top: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.profile-public-id code {
    color: var(--text-soft);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 12px;
    letter-spacing: 0;
}

.profile-public-id .icon-button {
    width: 28px;
    height: 28px;
}

.profile-public-id .icon-button svg {
    width: 14px;
    height: 14px;
}

.profile-identity p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.profile-identity .profile-joined-date {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
}

.profile-joined-date svg {
    width: 14px;
    height: 14px;
}

.status-active {
    color: var(--primary-ink);
}

.status-active > span,
.status-inactive > span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.status-active > span {
    background: var(--primary);
}

.status-inactive {
    color: var(--muted);
}

.status-inactive > span {
    background: currentColor;
}

.profile-xp {
    min-width: 200px;
    padding-left: 28px;
    border-left: 1px solid var(--line);
}

.profile-xp > span:last-child {
    display: flex;
    flex-direction: column;
}

.profile-xp strong {
    font-size: 24px;
}

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

.profile-hero-side {
    display: flex;
    align-items: center;
    gap: 20px;
}

.profile-hero-side > .button {
    white-space: nowrap;
}

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

.profile-layout .surface-panel > p {
    color: var(--text-soft);
}

.profile-layout .linear-progress {
    margin: 12px 0 20px;
}

.language-chip {
    min-width: 40px;
    justify-content: center;
    background: var(--blue-soft);
    color: var(--blue);
}

/* Settings */
.settings-layout {
    display: grid;
    grid-template-columns: 210px minmax(0, 760px);
    align-items: start;
    gap: 24px;
}

.settings-nav {
    position: sticky;
    top: 22px;
    display: grid;
    gap: 5px;
}

.settings-nav a {
    display: flex;
    min-height: 42px;
    align-items: center;
    gap: 9px;
    padding: 9px 11px;
    border-radius: 8px;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.settings-nav a:hover {
    background: var(--surface-strong);
    color: var(--primary);
}

.settings-nav svg {
    width: 17px;
}

.settings-sections {
    display: grid;
    gap: 16px;
}

.settings-section {
    scroll-margin-top: 18px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.settings-section-heading {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 20px;
    border-bottom: 1px solid var(--line);
}

.settings-section-heading h2 {
    font-size: 18px;
}

.settings-section-heading p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.setting-row,
.select-setting {
    display: flex;
    min-height: 78px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 20px;
}

.setting-row + .setting-row,
.select-setting {
    border-top: 1px solid var(--line);
}

.setting-row > span:first-child,
.select-setting > span:first-child {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.setting-row strong,
.select-setting strong {
    font-size: 14px;
}

.setting-row small,
.select-setting small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.switch-control {
    position: relative;
    display: inline-flex;
    width: 46px;
    height: 26px;
    flex: 0 0 auto;
}

.switch-control input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.switch-control > span {
    position: absolute;
    inset: 0;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--surface-strong);
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease;
}

.switch-control > span::after {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--surface);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    content: "";
    transition: transform 160ms ease;
}

.switch-control input:checked + span {
    border-color: var(--primary);
    background: var(--primary);
}

.switch-control input:checked + span::after {
    transform: translateX(20px);
}

.switch-control input:focus-visible + span {
    outline: 3px solid color-mix(in srgb, var(--blue) 42%, transparent);
    outline-offset: 3px;
}

.select-setting select {
    width: 150px;
}

.class-session-form {
    display: grid;
}

.class-session-form .select-setting {
    border-top: 1px solid var(--line);
}

.settings-form-actions {
    display: flex;
    justify-content: flex-end;
    padding: 0 20px 18px;
}

.settings-meta {
    display: flex;
    justify-content: space-between;
    padding: 8px 2px;
    color: var(--muted);
    font-size: 12px;
}

.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 80;
    max-width: min(360px, calc(100% - 32px));
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-md);
    color: var(--text);
    font-size: 13px;
    font-weight: 650;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 160ms ease, transform 160ms ease;
}

.confirm-dialog {
    width: min(440px, calc(100% - 28px));
    max-width: none;
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-lg);
}

.confirm-dialog::backdrop {
    background: rgba(18, 13, 24, 0.58);
}

.confirm-dialog form {
    display: grid;
}

.confirm-dialog-heading {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 22px;
}

.confirm-dialog-heading h2 {
    margin: 0;
    font-size: 19px;
}

.confirm-dialog-heading p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.confirm-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 22px;
    border-top: 1px solid var(--line);
    background: var(--surface-subtle);
}

.toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 1120px) {
    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-hero {
        grid-template-columns: minmax(0, 1fr) 290px;
        gap: 30px;
        padding: 36px;
    }

    .session-orbit {
        flex-direction: column;
    }

    .session-orbit-meta {
        grid-template-columns: repeat(2, auto);
    }

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

@media (max-width: 900px) {
    .sidebar {
        inset: auto 0 0;
        width: auto;
        min-height: 72px;
        padding: 7px max(8px, env(safe-area-inset-right)) max(7px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
        overflow: visible;
        border-top: 1px solid var(--line);
        background: var(--surface);
        color: var(--text-soft);
    }

    .brand,
    .sidebar-footer {
        display: none;
    }

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

    .nav-link-mobile-only {
        display: flex;
    }

    .nav-link {
        min-width: 0;
        min-height: 56px;
        justify-content: center;
        gap: 3px;
        padding: 5px 2px;
        border-radius: 6px;
        color: var(--muted);
        flex-direction: column;
        font-size: 10px;
    }

    .nav-link svg {
        width: 21px;
        height: 21px;
    }

    .nav-link:hover,
    .nav-link.is-active {
        background: var(--primary-soft);
        color: var(--primary-ink);
    }

    .nav-link.is-active::before {
        display: none;
    }

    .app-main {
        margin-left: 0;
        padding-bottom: 76px;
    }

    .page-content {
        width: min(100% - 40px, 900px);
        padding-top: 32px;
    }

    .has-course-switcher .page-content,
    .has-install-launcher .page-content {
        padding-top: 76px;
    }

    .course-switcher {
        top: 12px;
        right: max(12px, env(safe-area-inset-right));
    }

    .notification-center {
        top: 12px;
        right: max(76px, calc(env(safe-area-inset-right) + 64px));
    }

    .install-launcher {
        top: 12px;
        right: max(12px, env(safe-area-inset-right));
    }

    .install-launcher-student {
        right: max(140px, calc(env(safe-area-inset-right) + 128px));
    }

    .notification-menu {
        position: fixed;
        top: 62px;
        right: max(12px, env(safe-area-inset-right));
        width: min(370px, calc(100vw - 24px));
        max-height: calc(100dvh - 150px);
    }

    .dashboard-hero,
    .dashboard-columns,
    .progress-layout,
    .profile-layout,
    .session-start-layout {
        grid-template-columns: 1fr;
    }

    .dashboard-hero {
        min-height: 0;
    }

    .session-orbit {
        min-height: 0;
        flex-direction: row;
    }

    .library-layout {
        grid-template-columns: 1fr;
    }

    .selection-panel {
        position: static;
        order: -1;
    }

    .selection-panel .selected-category-list {
        min-height: 0;
    }

    .settings-layout {
        grid-template-columns: 1fr;
    }

    .settings-nav {
        position: static;
        display: flex;
        overflow-x: auto;
    }

    .settings-nav a {
        white-space: nowrap;
    }
}

@media (max-width: 700px) {
    .page-heading-actions,
    .level-panel-heading,
    .profile-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .page-heading-actions {
        display: flex;
    }

    .page-heading-actions > .button {
        width: 100%;
    }

    .vocabulary-section-summary {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .vocabulary-section-custom-label {
        width: fit-content;
        margin-left: 56px;
    }

    .vocabulary-section-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .vocabulary-section-search {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .vocabulary-search-field {
        flex: 1 1 100%;
    }

    .vocabulary-search-field input {
        width: 100%;
    }

    .vocabulary-section-search .button {
        flex: 1 1 0;
    }

    .vocabulary-word-table,
    .vocabulary-word-table tbody,
    .vocabulary-word-table tr,
    .vocabulary-word-table td {
        display: block;
        width: 100%;
    }

    .vocabulary-word-table thead {
        display: none;
    }

    .vocabulary-word-table tbody {
        display: grid;
        gap: 10px;
        padding: 12px;
    }

    .vocabulary-word-table tr {
        overflow: hidden;
        border: 1px solid var(--line);
        border-radius: 7px;
    }

    .vocabulary-word-table td,
    .vocabulary-word-table td:first-child {
        display: grid;
        width: auto;
        grid-template-columns: minmax(92px, 36%) minmax(0, 1fr);
        gap: 10px;
        padding: 10px 12px;
        border-bottom: 1px solid var(--line);
    }

    .vocabulary-word-table td::before {
        color: var(--muted);
        content: attr(data-label);
        font-size: 10px;
        font-weight: 800;
        text-transform: uppercase;
    }

    .vocabulary-word-table tr td:last-child {
        border-bottom: 0;
    }

    .vocabulary-empty-row td {
        display: block;
        padding: 34px 16px;
    }

    .vocabulary-empty-row td::before {
        display: none;
    }

    .vocabulary-pagination {
        grid-template-columns: 1fr 1fr;
    }

    .vocabulary-pagination > span:nth-child(2) {
        grid-column: 1 / -1;
        grid-row: 1;
        justify-self: center;
    }

    .vocabulary-pagination .button {
        min-width: 0;
        padding-inline: 10px;
    }

    .custom-vocabulary-dialog {
        width: calc(100% - 20px);
        max-height: calc(100dvh - 20px);
    }

    .custom-vocabulary-dialog > form {
        max-height: calc(100dvh - 22px);
    }

    .custom-vocabulary-dialog-heading,
    .custom-vocabulary-dialog-body,
    .custom-vocabulary-dialog-actions {
        padding-right: 15px;
        padding-left: 15px;
    }

    .custom-section-fields,
    .custom-word-fields {
        grid-template-columns: 1fr;
    }

    .custom-word-synonyms-field {
        grid-column: auto;
    }

    .custom-words-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .custom-words-heading .button {
        width: 100%;
    }

    .custom-word-row {
        grid-template-columns: 24px minmax(0, 1fr) 30px;
        gap: 7px;
        padding: 11px;
    }

    .custom-word-number {
        width: 24px;
        height: 24px;
    }

    .custom-vocabulary-dialog-actions {
        grid-template-columns: 1fr 1fr;
    }

    .custom-vocabulary-dialog-actions > span {
        display: none;
    }

    .custom-vocabulary-dialog-actions .button {
        width: 100%;
    }

    .custom-vocabulary-dialog-actions .button-danger {
        grid-column: 1 / -1;
    }

    h1 {
        font-size: 32px;
    }

    .dashboard-hero h2 {
        font-size: 27px;
    }

    .dashboard-hero {
        padding: 28px;
    }

    .session-orbit-ring {
        width: 112px;
        height: 112px;
    }

    .session-orbit-meta {
        grid-template-columns: 1fr;
    }

    .library-overview {
        align-items: stretch;
        flex-direction: column;
    }

    .library-overview > div + div {
        padding-top: 12px;
        padding-left: 0;
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .level-tabs {
        grid-template-columns: repeat(6, 100px);
    }

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

    .question-stage {
        min-height: 390px;
        padding: 28px;
    }

    .question-meta {
        margin-bottom: 38px;
    }

    .question-stage > h1 {
        font-size: 34px;
    }

    .answer-row {
        grid-template-columns: 1fr;
    }

    .answer-row .button {
        width: 100%;
    }

    .history-header {
        display: none;
    }

    .history-item {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px 14px;
    }

    .profile-xp {
        padding-top: 18px;
        padding-left: 0;
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .profile-hero {
        display: flex;
    }
}

@media (max-width: 520px) {
    .page-content {
        width: calc(100% - 28px);
        padding-top: 25px;
    }

    .page-heading {
        margin-bottom: 24px;
    }

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

    .dashboard-hero {
        padding: 24px;
    }

    .session-orbit {
        align-items: flex-start;
        flex-direction: column;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .weekly-chart {
        gap: 5px;
    }

    .chart-column span {
        width: 18px;
    }

    .category-card {
        min-height: 144px;
        padding: 16px;
    }

    .session-preview {
        grid-template-columns: 1fr;
        padding: 24px;
    }

    .session-facts {
        grid-template-columns: 1fr;
    }

    .learning-header {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .xp-pill {
        display: none;
    }

    .question-stage {
        min-height: 370px;
        padding: 22px;
    }

    .question-meta {
        margin-bottom: 31px;
    }

    .question-stage > h1 {
        font-size: 30px;
    }

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

    .summary-stat {
        min-height: 124px;
    }

    .summary-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .profile-identity {
        align-items: flex-start;
    }

    .profile-avatar {
        width: 62px;
        height: 62px;
        font-size: 18px;
    }

    .profile-picture-settings,
    .profile-picture-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .profile-picture-actions .button {
        width: 100%;
    }

    .setting-row,
    .select-setting {
        gap: 14px;
        padding: 15px;
    }

    .select-setting {
        align-items: stretch;
        flex-direction: column;
    }

    .select-setting select {
        width: 100%;
    }

    .toast {
        right: 14px;
        bottom: 88px;
    }
}

/* Accounts and data attribution */
.avatar-image,
.profile-avatar-image {
    object-fit: cover;
}

.profile-link > span:not(.avatar),
.profile-link strong,
.profile-link small {
    min-width: 0;
}

.profile-link strong,
.profile-link small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-layout {
    display: grid;
    min-height: min(640px, calc(100vh - 170px));
    place-items: center;
}

.auth-panel {
    width: min(100%, 510px);
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-md);
}

.auth-heading {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 24px;
}

.auth-heading h1 {
    margin-top: 3px;
    font-size: 27px;
}

.auth-heading p:last-child {
    margin: 6px 0 0;
    color: var(--text-soft);
    font-size: 13px;
}

.auth-form,
.profile-form {
    display: grid;
    gap: 16px;
}

.account-type-fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.account-type-fieldset legend {
    margin-bottom: 7px;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 700;
}

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

.account-type-option {
    position: relative;
    display: block;
    cursor: pointer;
}

.auth-form .account-type-option > input {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 0;
    padding: 0;
    border: 0;
    opacity: 0;
}

.account-type-card {
    display: grid;
    min-height: 112px;
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    padding: 13px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.account-type-card .icon-tile {
    width: 40px;
    height: 40px;
}

.account-type-card > span:last-child {
    display: grid;
    gap: 4px;
}

.account-type-card strong {
    color: var(--text);
    font-size: 13px;
}

.account-type-card small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.45;
}

.account-type-option > input:checked + .account-type-card {
    border-color: var(--primary);
    background: var(--primary-soft);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 14%, transparent);
}

.account-type-option > input:focus-visible + .account-type-card {
    outline: 3px solid color-mix(in srgb, var(--primary) 28%, transparent);
    outline-offset: 2px;
}

.auth-form label,
.profile-form label {
    display: grid;
    gap: 6px;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 700;
}

.auth-form label small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
}

.auth-form input,
.auth-form select,
.profile-form input,
.profile-form select {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 11px 13px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
}

.account-language-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.profile-form input:disabled {
    background: var(--surface-subtle);
    color: var(--muted);
}

.profile-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.profile-badges .status-badge svg {
    width: 14px;
    height: 14px;
}

.form-message {
    margin-bottom: 18px;
    padding: 11px 13px;
    border: 1px solid;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 650;
}

.form-message-error {
    border-color: color-mix(in srgb, var(--red) 34%, var(--line));
    background: var(--red-soft);
    color: var(--red);
}

.form-message-success {
    border-color: color-mix(in srgb, var(--primary) 30%, var(--line));
    background: var(--primary-soft);
    color: var(--primary-ink);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 21px 0;
    color: var(--muted);
    font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
    height: 1px;
    flex: 1;
    background: var(--line);
    content: "";
}

.google-button {
    position: relative;
}

.google-mark {
    display: inline-flex;
    width: 22px;
    height: 22px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: #ffffff;
    color: #3c4043;
    font-size: 12px;
    font-weight: 800;
}

.auth-note,
.auth-switch {
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.auth-note {
    margin: 10px 0 0;
}

.auth-switch {
    margin: 22px 0 0;
}

.auth-switch a {
    color: var(--primary);
    font-weight: 750;
}

.profile-account {
    margin-top: 24px;
}

.profile-account > .form-message {
    margin: 16px 20px 0;
}

.profile-picture-settings {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}

.profile-picture-settings > div:first-child {
    display: grid;
    gap: 4px;
}

.profile-picture-settings strong {
    font-size: 13px;
}

.profile-picture-settings small {
    color: var(--muted);
    font-size: 11px;
}

.profile-picture-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.profile-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 20px;
}

.profile-form-actions {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 4px;
}

.profile-role-field {
    grid-column: 1 / -1;
}

.account-provider {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.account-provider svg {
    width: 17px;
    color: var(--primary);
}

.logout-form {
    display: flex;
    justify-content: flex-end;
    padding: 15px 20px;
    border-top: 1px solid var(--line);
}

.profile-danger {
    margin-top: 24px;
    border-color: color-mix(in srgb, var(--red) 28%, var(--line));
}

.icon-tile-danger {
    background: var(--red-soft);
    color: var(--red);
}

.delete-account-form {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 20px 20px;
    border-top: 1px solid var(--line);
}

.delete-account-verification {
    display: grid;
    width: min(100%, 420px);
    gap: 12px;
}

.delete-password {
    display: grid;
    gap: 6px;
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 700;
}

.delete-password input {
    width: 100%;
}

.delete-confirmation {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    color: var(--text-soft);
    font-size: 12px;
    line-height: 1.5;
}

.delete-confirmation input {
    width: 17px;
    height: 17px;
    margin-top: 1px;
    accent-color: var(--red);
}

.button-danger {
    border-color: var(--red);
    background: var(--red);
    color: #ffffff;
}

.button-danger:hover {
    border-color: color-mix(in srgb, var(--red) 82%, #000000);
    background: color-mix(in srgb, var(--red) 82%, #000000);
}

.account-deleted-panel {
    display: grid;
    justify-items: start;
    gap: 12px;
}

.account-deleted-panel h1,
.account-deleted-panel p {
    margin: 0;
}

.account-deleted-panel .button {
    margin-top: 8px;
}

.progress-save-state {
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
    font-size: 13px;
    font-weight: 700;
}

.progress-save-state .is-saving {
    color: var(--muted);
}

.progress-save-state .is-saved {
    color: var(--green);
}

.progress-save-state .is-error {
    color: var(--red);
}

.source-list {
    display: grid;
    width: min(100%, 820px);
    gap: 16px;
}

.source-list .text-link {
    display: inline-flex;
    margin: 18px 20px 20px;
}

.data-note {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 16px 18px;
    border-left: 3px solid var(--primary);
    background: var(--primary-soft);
    color: var(--primary-ink);
}

.data-note p {
    margin: 0;
    font-size: 13px;
}

.page-footer a:hover {
    color: var(--primary);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    clip-path: inset(50%);
}

.managed-plan-note {
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.managed-plan-note svg {
    width: 17px;
}

.class-management-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 350px);
    align-items: start;
    gap: 22px;
}

.class-roster {
    min-width: 0;
}

.class-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.class-card {
    display: grid;
    min-width: 0;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.class-card-heading {
    display: flex;
    align-items: center;
    gap: 9px;
}

.class-language {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.class-card-copy h3,
.class-card-copy p {
    margin: 0;
}

.class-card-copy h3 {
    overflow-wrap: anywhere;
    font-size: 19px;
}

.class-card-copy p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.class-card-stats {
    display: grid;
    grid-template-columns: minmax(52px, 0.75fr) minmax(72px, 1fr) minmax(84px, 1.2fr);
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--line);
}

.class-card-stats > span {
    display: grid;
    gap: 3px;
    min-width: 0;
    padding: 10px;
    background: var(--surface-subtle);
}

.class-card-stats small {
    color: var(--muted);
    font-size: 9px;
}

.class-card-stats strong {
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.class-card > .button {
    justify-self: start;
}

.add-class-panel {
    position: sticky;
    top: 22px;
}

.add-class-form {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.add-class-form label {
    display: grid;
    gap: 6px;
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 750;
}

.add-class-form input,
.add-class-form select {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.back-link:hover {
    color: var(--primary);
}

.back-link svg {
    width: 16px;
}

.class-page-heading .page-lead {
    display: flex;
    align-items: center;
    gap: 7px;
}

.language-chip-inline {
    display: inline-grid;
    width: 30px;
    height: 24px;
    font-size: 10px;
}

.class-heading-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
}

.class-danger-zone {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.button-danger-text {
    color: var(--red);
}

.button-danger-text:hover {
    border-color: color-mix(in srgb, var(--red) 35%, var(--line));
    background: var(--red-soft);
    color: var(--red);
}

.library-class-empty {
    min-height: 340px;
}

.student-management-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(310px, 370px);
    align-items: start;
    gap: 22px;
}

.student-management-single {
    grid-template-columns: minmax(0, 1fr);
}

.create-student-form {
    flex: 0 0 auto;
}

.generated-credentials {
    display: grid;
    grid-template-columns: auto minmax(220px, 0.75fr) minmax(420px, 1.25fr);
    align-items: center;
    gap: 18px;
    margin-bottom: 24px;
    padding: 20px;
    border: 1px solid color-mix(in srgb, var(--primary) 32%, var(--line));
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.generated-credentials-heading p:last-child {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.credential-values {
    display: grid;
    gap: 8px;
}

.credential-values > div {
    display: grid;
    min-width: 0;
    grid-template-columns: 52px minmax(0, 1fr) 40px;
    align-items: center;
    gap: 9px;
}

.credential-values span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
}

.credential-values code {
    overflow: hidden;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-subtle);
    color: var(--text);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.credential-values code:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--blue) 42%, transparent);
    outline-offset: 2px;
}

.student-roster {
    min-width: 0;
}

.student-list {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.student-row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(190px, 1fr) minmax(230px, 1.1fr);
    gap: 16px 24px;
    padding: 18px;
}

.student-row + .student-row {
    border-top: 1px solid var(--line);
}

.student-identity,
.matrix-student {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 11px;
}

.student-identity > span:last-child,
.matrix-student > span:last-child {
    display: grid;
    min-width: 0;
}

.student-identity strong,
.student-identity small,
.matrix-student strong,
.matrix-student small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.student-identity strong,
.matrix-student strong {
    color: var(--text);
    font-size: 14px;
}

.student-name-edit-button {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    margin-left: auto;
    border-color: transparent;
    background: transparent;
}

.student-name-edit-button svg {
    width: 15px;
    height: 15px;
}

.student-identity small,
.matrix-student small {
    color: var(--muted);
    font-size: 11px;
}

.student-mini-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.student-mini-stats > span {
    display: grid;
    align-content: center;
    min-width: 0;
}

.student-mini-stats strong {
    overflow: hidden;
    color: var(--text);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.student-mini-stats small {
    color: var(--muted);
    font-size: 10px;
}

.student-plan-form {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(130px, 190px) 1fr;
    align-items: end;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.student-plan-summary {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--line);
}

.student-plan-summary > span {
    display: grid;
    gap: 3px;
    padding: 11px 13px;
    background: var(--surface-subtle);
}

.student-plan-summary small {
    color: var(--muted);
    font-size: 10px;
}

.student-plan-summary strong {
    color: var(--text);
    font-size: 13px;
}

.student-plan-form label,
.add-student-form label {
    display: grid;
    gap: 6px;
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 750;
}

.student-plan-form select,
.add-student-form input,
.add-student-form select {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
}

.student-row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.student-row-actions .button {
    min-height: 40px;
}

.student-security-actions {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.student-security-actions form:first-child {
    margin-right: auto;
}

.student-credentials-button {
    min-height: 40px;
}

.student-name-dialog {
    width: min(440px, calc(100% - 28px));
    max-width: none;
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-lg);
}

.student-name-dialog::backdrop {
    background: rgba(18, 13, 24, 0.62);
}

.student-name-dialog form {
    display: grid;
}

.student-name-dialog-heading {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 22px;
}

.student-name-dialog-heading .eyebrow {
    margin-bottom: 3px;
}

.student-name-dialog-heading h2 {
    margin: 0;
    font-size: 19px;
}

.student-name-dialog-body {
    display: grid;
    gap: 7px;
    padding: 0 22px 22px;
}

.student-name-dialog-body label {
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 750;
}

.student-name-dialog-body input {
    width: 100%;
}

.student-name-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 22px;
    border-top: 1px solid var(--line);
    background: var(--surface-subtle);
}

.icon-button-danger {
    color: var(--red);
}

.icon-button-danger:hover {
    border-color: color-mix(in srgb, var(--red) 35%, var(--line));
    background: var(--red-soft);
    color: var(--red);
}

.student-empty-state {
    min-height: 300px;
}

.add-student-panel {
    position: sticky;
    top: 22px;
}

.add-student-form {
    display: grid;
    gap: 14px;
    padding: 20px;
}

.add-student-form label small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 500;
}

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

.educator-metrics,
.educator-progress-metrics {
    margin-bottom: 22px;
}

.educator-progress-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.educator-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(290px, 0.7fr);
    align-items: start;
    gap: 18px;
}

.compact-empty {
    display: grid;
    min-height: 180px;
    place-items: center;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.educator-activity-list {
    max-height: clamp(150px, calc(100dvh - 570px), 480px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    margin: 8px -24px -24px;
}

.educator-activity-list:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--blue) 42%, transparent);
    outline-offset: -3px;
}

.educator-activity-row {
    display: grid;
    grid-template-columns: auto minmax(150px, 1fr) minmax(60px, auto) minmax(60px, auto);
    align-items: center;
    gap: 12px;
    min-height: 68px;
    padding: 11px 24px;
    border-top: 1px solid var(--line);
}

.educator-activity-row > span:not(.avatar) {
    display: grid;
    min-width: 0;
}

.educator-activity-row strong {
    color: var(--text);
    font-size: 13px;
}

.educator-activity-row small {
    color: var(--muted);
    font-size: 10px;
}

.educator-activity-name strong,
.educator-activity-name small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.matrix-student-details {
    display: flex;
    align-items: center;
    gap: 8px;
}

.student-accuracy {
    --accuracy: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: hsl(calc(var(--accuracy) * 1.2) 68% 34%);
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.student-accuracy > span {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: hsl(calc(var(--accuracy) * 1.2) 68% 42%);
}

.student-accuracy.is-empty {
    color: var(--muted);
}

.student-accuracy.is-empty > span {
    background: var(--line-strong);
}

.educator-actions {
    display: grid;
}

.educator-actions h2 {
    margin-bottom: 14px;
}

.educator-actions > a {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 11px;
    padding: 14px 0;
    border-top: 1px solid var(--line);
    color: var(--text-soft);
    text-decoration: none;
}

.educator-actions > a > span {
    display: grid;
}

.educator-actions > a strong {
    color: var(--text);
    font-size: 13px;
}

.educator-actions > a small {
    color: var(--muted);
    font-size: 10px;
}

.educator-actions > a > svg:first-child {
    color: var(--primary);
}

.educator-actions > a > svg:last-child {
    width: 16px;
    color: var(--muted);
}

.segmented-control {
    display: inline-grid;
    grid-auto-flow: column;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-strong);
}

.segmented-control a {
    min-width: 70px;
    padding: 7px 10px;
    border-radius: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    text-align: center;
    text-decoration: none;
}

.segmented-control a.is-active {
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    color: var(--text);
}

.student-activity-scroll {
    overflow: auto;
    max-width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.student-activity-matrix {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
}

.student-activity-matrix th,
.student-activity-matrix td {
    height: 58px;
    padding: 8px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    text-align: center;
}

.student-activity-matrix thead th {
    height: 46px;
    background: var(--surface-subtle);
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
    white-space: nowrap;
}

.student-activity-matrix tr:last-child > * {
    border-bottom: 0;
}

.student-activity-matrix tr > *:last-child {
    border-right: 0;
}

.student-activity-matrix th:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    width: 210px;
    min-width: 210px;
    max-width: 210px;
    background: var(--surface);
    text-align: left;
}

.student-activity-matrix thead th:first-child {
    z-index: 3;
    background: var(--surface-subtle);
}

.student-activity-matrix thead th:not(:first-child) {
    width: 62px;
    min-width: 62px;
}

.student-activity-matrix .is-today {
    box-shadow: inset 0 2px 0 var(--blue);
}

.session-cell span {
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 6px;
    background: var(--surface-subtle);
    color: var(--muted);
    font-weight: 800;
}

.session-cell-1 span {
    background: var(--blue-soft);
    color: var(--blue);
}

.session-cell-2 span {
    background: var(--primary-soft);
    color: var(--primary-ink);
}

.session-cell-3 span {
    background: var(--amber-soft);
    color: var(--amber);
}

.session-cell-4 span {
    background: var(--coral-soft);
    color: var(--coral);
}

.session-total {
    min-width: 66px;
    background: var(--surface-subtle);
    color: var(--text);
}

.student-library-target {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    margin: -8px 0 22px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.student-library-target > div {
    display: grid;
}

.student-library-target small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 750;
    text-transform: uppercase;
}

.student-library-target strong {
    font-size: 15px;
}

.student-library-target > div > span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

.student-library-target select {
    width: 100%;
}

.class-library-selector {
    min-width: 220px;
}

.report-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: -6px 0 22px;
    padding: 14px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.report-filter-bar > div {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
}

.report-filter-bar > div > span:last-child {
    display: grid;
    min-width: 0;
}

.report-filter-bar small,
.ranking-control-group > span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 750;
    text-transform: uppercase;
}

.report-filter-bar strong {
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-filter-bar form {
    width: min(300px, 42vw);
}

.report-filter-bar select {
    width: 100%;
}

.ranking-controls {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.ranking-control-group {
    display: grid;
    gap: 7px;
}

.ranking-sort-control a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.ranking-sort-control svg {
    width: 15px;
    height: 15px;
}

.ranking-section {
    margin-top: 0;
}

.ranking-count {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.ranking-table-scroll {
    max-width: 100%;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.ranking-table {
    width: 100%;
    min-width: 680px;
    border-collapse: separate;
    border-spacing: 0;
}

.ranking-table th,
.ranking-table td {
    height: 68px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.ranking-table thead th {
    height: 46px;
    background: var(--surface-subtle);
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
    white-space: nowrap;
}

.ranking-table tr:last-child > * {
    border-bottom: 0;
}

.ranking-table th:first-child,
.ranking-table td:first-child {
    width: 66px;
    text-align: center;
}

.ranking-table th:nth-child(2) {
    width: 42%;
}

.ranking-table thead .is-sorted,
.ranking-table .ranking-value.is-sorted {
    background: var(--primary-soft);
    color: var(--primary-ink);
}

.ranking-table tr.is-current-user > * {
    box-shadow: inset 0 1px 0 var(--success), inset 0 -1px 0 var(--success);
}

.ranking-position {
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    background: var(--surface-strong);
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 850;
}

.ranking-position-1 {
    background: var(--amber-soft);
    color: var(--amber);
}

.ranking-position-2 {
    background: var(--blue-soft);
    color: var(--blue);
}

.ranking-position-3 {
    background: var(--coral-soft);
    color: var(--coral);
}

.ranking-user {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 11px;
    color: inherit;
    text-decoration: none;
}

.ranking-user:hover strong {
    color: var(--primary);
}

.ranking-user > span:last-child {
    display: grid;
    min-width: 0;
}

.ranking-user strong {
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-user small,
.ranking-value small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 650;
}

.ranking-value {
    min-width: 118px;
}

.ranking-value strong,
.ranking-value small {
    display: block;
}

.ranking-value strong {
    font-size: 15px;
}

.friends-section {
    margin-top: 0;
}

.friend-list {
    border-top: 1px solid var(--line);
}

.friend-row,
.friend-search-result {
    display: flex;
    min-height: 72px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 4px;
    border-bottom: 1px solid var(--line);
}

.friend-identity {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
}

.friend-identity > span:last-child {
    display: grid;
    min-width: 0;
}

.friend-identity strong {
    overflow: hidden;
    color: var(--text);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.friend-identity:hover strong {
    color: var(--primary);
}

.friend-identity small {
    color: var(--muted);
    font-size: 11px;
}

.friend-row-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.friend-row-actions form {
    display: flex;
}

.friend-remove-button {
    color: var(--red);
}

.friend-search-dialog {
    width: min(680px, calc(100vw - 30px));
    max-height: min(760px, calc(100vh - 30px));
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-md);
    color: var(--text);
}

.friend-search-dialog::backdrop {
    background: rgba(27, 16, 35, 0.56);
}

.friend-search-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 22px;
    border-bottom: 1px solid var(--line);
}

.friend-search-heading h2 {
    margin-top: 2px;
    font-size: 19px;
}

.friend-search-form {
    display: grid;
    gap: 7px;
    padding: 20px 22px 16px;
}

.friend-search-form > label {
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 750;
}

.friend-search-form > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px;
}

.friend-search-form input {
    width: 100%;
}

.friend-search-results {
    max-height: 430px;
    padding: 0 22px 20px;
    overflow: auto;
}

.friend-search-empty {
    display: flex;
    min-height: 120px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.friend-state {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--success);
    font-size: 11px;
    font-weight: 750;
}

.friend-state svg {
    width: 15px;
    height: 15px;
}

.friend-state-pending {
    color: var(--amber);
}

.public-profile-heading .back-link {
    margin-bottom: 14px;
}

.public-profile-hero {
    margin-bottom: 22px;
}

.public-profile-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 30px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.public-profile-stats > div {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 11px;
    padding: 18px;
}

.public-profile-stats > div + div {
    border-left: 1px solid var(--line);
}

.public-profile-stats svg {
    color: var(--primary);
}

.public-profile-stats span {
    display: grid;
}

.public-profile-stats strong {
    font-size: 18px;
}

.public-profile-stats small {
    color: var(--muted);
    font-size: 10px;
}

.profile-courses {
    margin-top: 24px;
    padding: 24px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.public-profile-courses {
    margin-top: 0;
}

.profile-courses-heading {
    margin-bottom: 18px;
}

.profile-courses-heading h2 {
    margin: 3px 0 0;
    font-size: 22px;
}

.profile-course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 12px;
}

.profile-course-card {
    display: grid;
    min-height: 154px;
    grid-template-rows: auto 1fr auto;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--primary-soft) 42%, var(--surface)) 0%,
        var(--surface) 55%,
        color-mix(in srgb, var(--blue-soft) 24%, var(--surface)) 100%
    );
    box-shadow: var(--shadow-sm);
}

.profile-course-card.is-active {
    border-color: color-mix(in srgb, var(--primary) 58%, var(--line));
    box-shadow: 0 8px 24px color-mix(in srgb, var(--primary) 10%, transparent);
}

.profile-course-card-heading {
    display: grid;
    min-width: 0;
    grid-template-columns: 32px minmax(0, 1fr) 26px;
    align-items: center;
    gap: 10px;
}

.profile-course-card-heading .course-flag {
    width: 30px;
    height: 22px;
}

.profile-course-card-heading > span:nth-child(2) {
    display: grid;
    min-width: 0;
    gap: 1px;
}

.profile-course-card-heading strong,
.profile-course-card-heading small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-course-card-heading strong {
    font-size: 14px;
}

.profile-course-card-heading small,
.profile-course-meta,
.profile-courses-note {
    color: var(--muted);
    font-size: 11px;
}

.profile-course-active {
    display: inline-grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
}

.profile-course-active svg {
    width: 14px;
    height: 14px;
}

.profile-course-score {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.profile-course-score strong {
    font-size: 28px;
    line-height: 1;
}

.profile-course-score span {
    color: var(--primary);
    font-size: 11px;
    font-weight: 850;
}

.profile-course-meta {
    display: flex;
    align-items: center;
    gap: 6px;
}

.profile-course-meta svg {
    width: 14px;
    height: 14px;
}

.profile-courses-note {
    margin: 16px 0 0;
    line-height: 1.55;
}

.managed-plan-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.managed-plan-summary > span {
    display: grid;
    gap: 3px;
    padding: 18px 20px;
}

.managed-plan-summary > span + span {
    border-left: 1px solid var(--line);
}

.managed-plan-summary small {
    color: var(--muted);
    font-size: 11px;
}

.managed-plan-summary strong {
    color: var(--text);
    font-size: 18px;
}

.managed-account-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 20px;
    padding: 20px;
}

.managed-account-details > div {
    display: grid;
    gap: 5px;
}

.managed-account-details > div > span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
}

.managed-account-details strong,
.managed-account-details code {
    color: var(--text);
    font-size: 14px;
}

.managed-account-details p {
    display: flex;
    grid-column: 1 / -1;
    align-items: flex-start;
    gap: 8px;
    margin: 4px 0 0;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
}

.managed-account-details p svg {
    width: 17px;
    color: var(--primary);
}

@media (max-width: 700px) {
    .auth-layout {
        min-height: auto;
        place-items: start stretch;
    }

    .profile-form {
        grid-template-columns: 1fr;
    }

    .profile-form-actions {
        grid-column: auto;
        align-items: stretch;
        flex-direction: column;
    }

    .delete-account-form {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 520px) {
    .auth-panel {
        padding: 22px;
    }

    .auth-heading {
        align-items: flex-start;
    }

    .account-type-options {
        grid-template-columns: 1fr;
    }

    .account-language-fields {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1120px) {
    .student-management-layout,
    .class-management-layout,
    .educator-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .add-student-panel {
        position: static;
    }

    .add-class-panel {
        position: static;
    }

    .generated-credentials {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .credential-values {
        grid-column: 1 / -1;
    }
}

@media (max-width: 900px) {
    .primary-nav {
        grid-template-columns: repeat(var(--nav-count, 6), minmax(0, 1fr));
    }

    .educator-progress-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .profile-hero-side {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .profile-hero-side .profile-xp {
        width: 100%;
    }

    .profile-hero-side > .button {
        width: 100%;
    }

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

    .public-profile-stats > div:nth-child(3) {
        border-left: 0;
    }

    .public-profile-stats > div:nth-child(n + 3) {
        border-top: 1px solid var(--line);
    }

    .report-filter-bar,
    .ranking-controls {
        align-items: stretch;
        flex-direction: column;
    }

    .report-filter-bar form {
        width: 100%;
    }

    .ranking-controls {
        gap: 16px;
    }

    .ranking-control-group .segmented-control {
        width: 100%;
    }

    .ranking-control-group .segmented-control a {
        min-width: 0;
    }

    .class-heading-actions {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .class-heading-actions .button,
    .class-heading-actions form,
    .class-heading-actions form .button {
        width: 100%;
    }

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

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

    .student-row-actions {
        grid-column: 1 / -1;
        justify-content: stretch;
    }

    .student-row-actions .button {
        flex: 1;
    }

    .student-library-target {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .student-library-target > label,
    .student-library-target > .button,
    .student-library-target > form {
        grid-column: 1 / -1;
    }

    .class-library-selector {
        min-width: 0;
    }

    .educator-progress-metrics {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .friend-row,
    .friend-search-result {
        align-items: stretch;
        flex-direction: column;
    }

    .friend-row-actions,
    .friend-search-result > form,
    .friend-search-result > form .button {
        width: 100%;
    }

    .friend-row-actions .icon-button {
        flex: 1;
    }

    .friend-search-form > div {
        grid-template-columns: 1fr;
    }

    .friend-search-form .button {
        width: 100%;
    }

    .public-profile-stats {
        grid-template-columns: 1fr;
    }

    .public-profile-stats > div + div,
    .public-profile-stats > div:nth-child(3) {
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .nav-link {
        font-size: 9px;
    }

    .nav-link > span {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .ranking-sort-control a {
        gap: 4px;
        padding-inline: 6px;
    }

    .ranking-table th,
    .ranking-table td {
        padding-inline: 12px;
    }

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

    .class-card-stats {
        grid-template-columns: 1fr;
    }

    .class-card > .button {
        width: 100%;
    }

    .student-row {
        padding: 16px 14px;
    }

    .student-mini-stats,
    .student-plan-form,
    .student-plan-summary,
    .add-student-fields,
    .managed-plan-summary,
    .managed-account-details {
        grid-template-columns: 1fr;
    }

    .generated-credentials {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .generated-credentials .icon-tile,
    .credential-values {
        grid-column: auto;
    }

    .credential-values > div {
        grid-template-columns: minmax(0, 1fr) 40px;
    }

    .credential-values > div > span {
        grid-column: 1 / -1;
    }

    .managed-account-details p {
        grid-column: auto;
    }

    .student-mini-stats {
        gap: 12px;
    }

    .student-row-actions {
        flex-wrap: wrap;
    }

    .student-security-actions {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .student-security-actions form:first-child {
        width: 100%;
        margin-right: 0;
    }

    .student-credentials-button {
        width: 100%;
    }

    .settings-form-actions {
        padding: 0 15px 15px;
    }

    .settings-form-actions .button {
        width: 100%;
    }

    .confirm-dialog-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .confirm-dialog-actions .button {
        width: 100%;
    }

    .managed-plan-summary > span + span {
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .segmented-control {
        width: 100%;
    }

    .segmented-control a {
        min-width: 0;
    }

    .student-activity-matrix th:first-child {
        width: 180px;
        min-width: 180px;
        max-width: 180px;
    }

    .educator-activity-list {
        max-height: 320px;
    }
}

.icon-tile-rose {
    background: var(--coral-soft);
    color: var(--coral);
}

.level-chip {
    display: inline-flex;
    min-width: 34px;
    min-height: 26px;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-subtle);
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 800;
}

.grammar-unavailable {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
    padding: 28px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.grammar-unavailable h2 {
    margin-bottom: 5px;
}

.grammar-unavailable p:last-child {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.grammar-overview {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(250px, 340px);
    align-items: center;
    gap: 36px;
    padding: 26px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.grammar-overview-main {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 18px;
}

.grammar-chapter-mark {
    display: inline-flex;
    width: 64px;
    height: 64px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border: 1px solid color-mix(in srgb, var(--blue) 30%, var(--line));
    border-radius: 8px;
    background: var(--blue-soft);
    color: var(--blue);
}

.grammar-chapter-mark svg {
    width: 30px;
    height: 30px;
}

.grammar-overview-main h2 {
    font-size: 28px;
}

.grammar-overview-main p:last-child {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.grammar-overview-progress {
    display: grid;
    gap: 7px;
}

.grammar-overview-progress > span {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
}

.grammar-overview-progress > span strong {
    color: var(--text);
    font-size: 22px;
}

.grammar-overview-progress .progress-track {
    margin: 0;
}

.grammar-overview-progress small {
    color: var(--muted);
    font-size: 11px;
}

.grammar-curriculum .section-heading p:last-child,
.grammar-mode-section .section-heading p:last-child {
    max-width: 680px;
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.grammar-tense-list {
    border-top: 1px solid var(--line);
}

.grammar-tense-row {
    display: grid;
    min-height: 86px;
    grid-template-columns: 48px minmax(0, 1fr) auto 24px;
    align-items: center;
    gap: 15px;
    padding: 13px 12px;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    transition: background-color 160ms ease;
}

.grammar-tense-row:hover {
    background: var(--surface-subtle);
}

.grammar-tense-index {
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
}

.grammar-tense-row.is-complete .grammar-tense-index {
    border-color: color-mix(in srgb, var(--success) 30%, var(--line));
    background: var(--success-soft);
    color: var(--success);
}

.grammar-tense-index svg {
    width: 18px;
}

.grammar-tense-copy {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.grammar-tense-title-line {
    display: flex;
    align-items: center;
    gap: 9px;
}

.grammar-tense-title-line strong {
    font-size: 16px;
}

.grammar-tense-copy > small {
    color: var(--muted);
    font-size: 12px;
}

.grammar-mode-dots {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.grammar-mode-dots > span {
    width: 10px;
    height: 10px;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: var(--surface);
}

.grammar-mode-dots > span.is-complete {
    border-color: var(--success);
    background: var(--success);
}

.grammar-tense-chevron {
    width: 18px;
    color: var(--muted);
}

.grammar-tense-heading {
    max-width: 840px;
}

.grammar-tense-heading .back-link {
    margin-bottom: 20px;
}

.grammar-tense-title {
    display: flex;
    align-items: center;
    gap: 14px;
}

.grammar-tense-title .level-chip {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    color: var(--primary-ink);
    font-size: 13px;
}

.grammar-reference-band {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 34px;
    padding: 24px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.grammar-token-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.grammar-token-list li,
.grammar-signal-list code {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    padding: 5px 10px;
    border-radius: 6px;
    background: var(--surface-strong);
    color: var(--text-soft);
    font-size: 11px;
}

.grammar-signal-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.grammar-signal-list code {
    border: 1px solid color-mix(in srgb, var(--blue) 22%, var(--line));
    background: var(--blue-soft);
    color: var(--blue);
}

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

.grammar-mode-card {
    display: flex;
    min-width: 0;
    min-height: 380px;
    padding: 20px;
    border: 1px solid var(--line);
    border-top: 3px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    flex-direction: column;
}

.grammar-mode-card.is-complete {
    border-top-color: var(--success);
}

.grammar-mode-card-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.grammar-mode-card-heading > div {
    display: grid;
    gap: 3px;
}

.grammar-mode-card-heading h3 {
    font-size: 16px;
}

.grammar-mode-card-heading span:not(.icon-tile) {
    color: var(--muted);
    font-size: 11px;
}

.grammar-complete-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--success) !important;
    font-weight: 750;
}

.grammar-complete-label svg {
    width: 14px;
    height: 14px;
}

.grammar-formula,
.grammar-example {
    display: grid;
    gap: 7px;
}

.grammar-formula {
    min-height: 94px;
    padding: 13px;
    border-left: 3px solid var(--blue);
    border-radius: 0 6px 6px 0;
    background: var(--blue-soft);
}

.grammar-formula small,
.grammar-example small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.grammar-formula code {
    color: var(--text);
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.grammar-example {
    min-height: 82px;
    padding: 17px 2px;
}

.grammar-example p {
    margin: 0;
    color: var(--text-soft);
    font-size: 13px;
}

.grammar-mode-card > .button {
    margin-top: auto;
}

.grammar-learning-screen {
    padding-top: 4px;
}

.grammar-question-stage > h1 {
    min-height: 76px;
    max-width: 780px;
    font-size: 30px;
}

.grammar-feedback {
    min-height: 24px;
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.grammar-builder-form {
    display: grid;
    gap: 15px;
    margin-top: 30px;
}

.grammar-builder-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.grammar-builder-heading > label,
.grammar-word-bank-wrap > span {
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 750;
}

.grammar-builder-tools {
    display: flex;
    gap: 6px;
}

.grammar-sentence-slot {
    position: relative;
}

.grammar-selected-words,
.grammar-word-bank {
    display: flex;
    min-height: 74px;
    align-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
}

.grammar-selected-words {
    background: var(--surface-subtle);
}

.grammar-selected-placeholder {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    color: var(--muted);
    font-size: 12px;
    pointer-events: none;
}

.grammar-selected-placeholder[hidden] {
    display: none;
}

.grammar-word-bank-wrap {
    display: grid;
    gap: 8px;
}

.grammar-word-bank {
    min-height: 68px;
    background: var(--surface);
}

.grammar-word-tile {
    min-height: 38px;
    padding: 7px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    font-weight: 750;
    cursor: pointer;
    box-shadow: 0 2px 0 color-mix(in srgb, var(--line-strong) 76%, transparent);
}

.grammar-word-tile:hover:not(:disabled),
.grammar-word-tile:focus-visible {
    border-color: var(--primary);
    color: var(--primary-ink);
}

.grammar-word-tile.is-selected {
    border-color: color-mix(in srgb, var(--primary) 55%, var(--line));
    background: var(--primary-soft);
}

.grammar-word-tile:disabled {
    cursor: default;
    opacity: 0.72;
}

.grammar-action-button {
    justify-self: end;
    min-width: 148px;
}

.profile-edit-layout {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.profile-edit-layout-compact {
    grid-template-columns: 1fr;
}

.profile-edit-avatar {
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    gap: 15px;
    padding: 32px 24px;
    border-right: 1px solid var(--line);
    background: var(--surface-subtle);
    text-align: center;
}

.profile-edit-avatar > small {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.profile-edit-avatar .profile-picture-actions {
    justify-content: center;
}

.profile-edit-details {
    min-width: 0;
}

.profile-edit-details .settings-section-heading {
    border-bottom: 1px solid var(--line);
}

.profile-edit-details > .form-message {
    margin: 18px 20px 0;
}

.profile-edit-details .profile-form label > small {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
}

.profile-edit-details .profile-form label > small svg {
    width: 14px;
    height: 14px;
}

@media (max-width: 760px) {
    .profile-edit-layout {
        grid-template-columns: 1fr;
    }

    .profile-edit-avatar {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
}

@media (max-width: 520px) {
    .grammar-builder-heading {
        align-items: flex-start;
    }

    .grammar-selected-words,
    .grammar-word-bank {
        min-height: 82px;
        padding: 10px;
    }

    .grammar-word-tile {
        min-height: 40px;
        padding-inline: 11px;
        font-size: 13px;
    }

    .grammar-action-button {
        width: 100%;
    }
}

.grammar-management-overview {
    display: flex;
    align-items: center;
    gap: 12px 32px;
    margin: -6px 0 24px;
    padding: 15px 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.grammar-management-overview > div {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 11px;
}

.grammar-management-overview > div + div {
    padding-left: 32px;
    border-left: 1px solid var(--line);
}

.grammar-management-overview > div > span:last-child {
    display: grid;
}

.grammar-management-overview strong {
    font-size: 14px;
}

.grammar-management-overview small {
    color: var(--muted);
    font-size: 11px;
}

.grammar-management-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    align-items: start;
    gap: 22px;
}

.grammar-management-content {
    min-width: 0;
}

.grammar-assignment-heading {
    align-items: flex-end;
}

.grammar-assignment-heading p:last-child {
    max-width: 680px;
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.grammar-assignment-list {
    border-top: 1px solid var(--line);
}

.grammar-assignment-row {
    display: grid;
    min-height: 112px;
    grid-template-columns: 48px minmax(180px, 1fr) minmax(360px, 1.35fr);
    align-items: center;
    gap: 15px;
    padding: 14px 10px;
    border-bottom: 1px solid var(--line);
}

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

.grammar-assignment-option {
    min-width: 0;
    cursor: pointer;
}

.grammar-assignment-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.grammar-assignment-option span {
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-subtle);
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 750;
    text-align: center;
    transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

.grammar-assignment-option span svg {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
}

.grammar-assignment-option input:focus-visible + span {
    outline: 3px solid color-mix(in srgb, var(--primary) 25%, transparent);
    outline-offset: 2px;
}

.grammar-assignment-option input:checked + span {
    border-color: color-mix(in srgb, var(--primary) 45%, var(--line));
    background: var(--primary-soft);
    color: var(--primary-ink);
}

.grammar-selection-description {
    margin: 16px 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}

.grammar-selection-panel .button {
    width: 100%;
}

.grammar-assignment-empty {
    margin-top: 10px;
}

.grammar-mode-card.is-unassigned {
    border-top-color: var(--line);
    background: var(--surface-subtle);
    box-shadow: none;
}

.grammar-mode-card.is-unassigned .grammar-formula,
.grammar-mode-card.is-unassigned .grammar-example {
    opacity: 0.56;
}

.grammar-unassigned-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--muted) !important;
    font-weight: 750;
}

.grammar-unassigned-label svg {
    width: 13px;
    height: 13px;
}

.grammar-mask-example {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    margin: 14px 18px 18px;
    padding: 14px;
    border: 1px dashed var(--line-strong);
    border-radius: 6px;
    background: var(--surface-subtle);
}

.grammar-mask-example > span {
    display: grid;
    gap: 4px;
}

.grammar-mask-example > span:first-child {
    color: var(--muted);
}

.grammar-mask-example > span:last-child strong {
    color: var(--primary-ink);
}

.grammar-mask-example span {
    font-size: 10px;
}

.grammar-mask-example strong {
    color: var(--text);
    font-size: 13px;
}

.grammar-mask-example > svg {
    width: 17px;
    color: var(--muted);
}

@media (max-width: 1120px) {
    .grammar-mode-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grammar-management-layout {
        grid-template-columns: 1fr;
    }

    .grammar-selection-panel {
        position: static;
    }
}

@media (max-width: 700px) {
    .grammar-unavailable,
    .grammar-overview,
    .grammar-reference-band {
        grid-template-columns: 1fr;
    }

    .grammar-unavailable {
        align-items: start;
    }

    .grammar-unavailable .button {
        width: 100%;
    }

    .grammar-mode-grid {
        grid-template-columns: 1fr;
    }

    .grammar-management-overview {
        align-items: stretch;
        flex-direction: column;
    }

    .grammar-management-overview > div + div {
        padding: 12px 0 0;
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .grammar-assignment-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .grammar-check-all {
        align-self: flex-start;
    }

    .grammar-assignment-row {
        grid-template-columns: 42px minmax(0, 1fr);
        gap: 11px;
        padding-inline: 4px;
    }

    .grammar-assignment-options {
        grid-column: 1 / -1;
    }

    .grammar-mode-card {
        min-height: 0;
    }

    .grammar-tense-row {
        grid-template-columns: 42px minmax(0, 1fr) 20px;
        gap: 11px;
        padding-inline: 4px;
    }

    .grammar-mode-dots {
        grid-column: 2;
    }

    .grammar-tense-chevron {
        grid-column: 3;
        grid-row: 1 / span 2;
    }

    .grammar-question-stage > h1 {
        font-size: 26px;
    }

    .grammar-mask-example {
        grid-template-columns: 1fr;
    }

    .grammar-mask-example > svg {
        transform: rotate(90deg);
    }
}

@media (max-width: 520px) {
    .grammar-overview-main {
        align-items: flex-start;
    }

    .grammar-chapter-mark {
        width: 50px;
        height: 50px;
    }

    .grammar-tense-copy > small {
        font-size: 11px;
    }

    .grammar-tense-title {
        align-items: flex-start;
    }

    .grammar-question-stage > h1 {
        min-height: 96px;
        font-size: 23px;
    }

    .primary-nav {
        gap: 0;
    }

    .nav-link {
        padding-inline: 0;
        font-size: 8px;
    }

    .nav-link > span {
        max-height: 17px;
        overflow: visible;
        line-height: 1.05;
        text-align: center;
        text-overflow: clip;
        white-space: normal;
    }
}

/* Consistent course flags */
.course-flag {
    width: 28px;
    height: 20px;
    background-position: center;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    box-shadow: 0 1px 2px rgba(18, 13, 24, 0.18);
}

.course-flag::before,
.course-flag::after {
    content: none !important;
}

.course-flag-english { background: #012169 url("/images/flags/gb.svg") center / 100% 100% no-repeat; }
.course-flag-spanish { background: #f1bf00 url("/images/flags/es.svg") center / 100% 100% no-repeat; }
.course-flag-polish { background: #ffffff url("/images/flags/pl.svg") center / 100% 100% no-repeat; }
.course-flag-russian { background: #ffffff url("/images/flags/ru.svg") center / 100% 100% no-repeat; }
.course-flag-french { background: #ffffff url("/images/flags/fr.svg") center / 100% 100% no-repeat; }
.course-flag-german { background: #ffce00 url("/images/flags/de.svg") center / 100% 100% no-repeat; }
.course-flag-portuguese { background: #da291c url("/images/flags/pt.svg") center / 100% 100% no-repeat; }
.course-flag-italian { background: #ffffff url("/images/flags/it.svg") center / 100% 100% no-repeat; }
.course-flag-turkish { background: #e30a17 url("/images/flags/tr.svg") center / 100% 100% no-repeat; }
.course-flag-lithuanian { background: #fdb913 url("/images/flags/lt.svg") center / 100% 100% no-repeat; }
.course-flag-norwegian { background: #ba0c2f url("/images/flags/no.svg") center / 100% 100% no-repeat; }
.course-flag-swedish { background: #006aa7 url("/images/flags/se.svg") center / 100% 100% no-repeat; }
.course-flag-irish { background: #ffffff url("/images/flags/ie.svg") center / 100% 100% no-repeat; }
.course-flag-hungarian { background: #ffffff url("/images/flags/hu.svg") center / 100% 100% no-repeat; }
.course-flag-czech { background: #ffffff url("/images/flags/cz.svg") center / 100% 100% no-repeat; }
.course-flag-slovak { background: #ffffff url("/images/flags/sk.svg") center / 100% 100% no-repeat; }
.course-flag-danish { background: #c8102e url("/images/flags/dk.svg") center / 100% 100% no-repeat; }

@media (hover: hover) and (pointer: fine) {
    .course-switcher.is-open::after,
    .notification-center.is-open::after {
        position: absolute;
        top: 100%;
        right: 0;
        height: 10px;
        content: "";
    }

    .course-switcher.is-open::after {
        width: min(300px, calc(100vw - 28px));
    }

    .notification-center.is-open::after {
        width: min(370px, calc(100vw - 28px));
    }
}

/* Profile security */
.profile-edit-message {
    margin-bottom: 16px;
}

.profile-edit-security-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 18px;
    margin-top: 18px;
}

.profile-security-section {
    scroll-margin-top: 20px;
}

.profile-security-form {
    grid-template-columns: 1fr;
}

.profile-security-form .profile-form-actions {
    grid-column: auto;
}

.profile-security-form .profile-form-actions > small {
    max-width: 330px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 550;
    line-height: 1.45;
}

.profile-security-note {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    padding: 12px 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-subtle);
    color: var(--text-soft);
    font-size: 12px;
}

.profile-security-note svg {
    width: 17px;
    color: var(--success);
}

.profile-security-status {
    display: flex;
    min-height: 120px;
    align-items: center;
    gap: 14px;
    padding: 22px 20px;
}

.profile-security-status > span:last-child {
    display: grid;
    gap: 4px;
}

.profile-security-status strong {
    font-size: 14px;
}

.profile-security-status small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.profile-security-status-success {
    background: color-mix(in srgb, var(--success-soft) 55%, transparent);
}

/* Public landing page */
.landing-page {
    min-height: 100vh;
    overflow: hidden;
    background: linear-gradient(
        180deg,
        var(--bg) 0%,
        color-mix(in srgb, var(--primary-soft) 14%, var(--bg)) 58%,
        var(--bg) 100%
    );
    color: var(--text);
}

.landing-hero {
    position: relative;
    height: calc(100svh - 78px);
    min-height: 540px;
    max-height: 780px;
    overflow: hidden;
    background: var(--nav-bg);
    color: #ffffff;
}

.landing-hero-image,
.landing-hero-shade {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.landing-hero-image {
    object-fit: cover;
    object-position: right center;
}

.landing-hero-shade {
    background: linear-gradient(
        90deg,
        rgba(23, 12, 31, 0.96) 0%,
        rgba(23, 12, 31, 0.88) 38%,
        rgba(23, 12, 31, 0.5) 67%,
        rgba(23, 12, 31, 0.2) 100%
    );
}

.landing-header,
.landing-hero-copy,
.landing-course-band,
.landing-paths,
.landing-app-band,
.landing-cta,
.landing-footer {
    width: min(calc(100% - 48px), 1240px);
    margin-inline: auto;
}

.landing-header {
    position: absolute;
    z-index: 2;
    top: 0;
    right: 0;
    left: 0;
    display: flex;
    min-height: 78px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.landing-brand {
    display: inline-flex;
    align-items: center;
    color: #ffffff;
    text-decoration: none;
}

.landing-brand-logo {
    display: block;
    width: auto;
    height: 40px;
}

.landing-header-actions,
.landing-language-form,
.landing-hero-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.landing-language-form {
    padding: 3px 7px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 8px;
    background: rgba(36, 17, 48, 0.82);
}

.landing-language-form select {
    min-height: 34px;
    padding: 5px 8px;
    border: 0;
    background: transparent;
    color: #ffffff;
    font-size: 12px;
}

.landing-language-form option {
    color: #1f1725;
}

.landing-language-submit {
    display: none;
}

.landing-header .button {
    min-height: 42px;
}

.landing-login {
    color: #ffffff;
}

.landing-page .button-primary,
.landing-primary-action {
    border-color: var(--primary);
    background: var(--primary);
    color: #ffffff;
}

.landing-page .button-primary:hover,
.landing-page .button-primary:focus-visible,
.landing-primary-action:hover,
.landing-primary-action:focus-visible {
    border-color: var(--primary-hover);
    background: var(--primary-hover);
}

.landing-hero-copy {
    position: relative;
    z-index: 1;
    display: flex;
    height: 100%;
    max-width: 1240px;
    justify-content: center;
    padding-top: 78px;
    flex-direction: column;
}

.landing-hero-copy > * {
    width: min(100%, 650px);
}

.landing-kicker {
    margin: 0 0 8px;
    color: var(--primary-ink);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.landing-hero h1 {
    margin: 0;
    font-size: 68px;
    line-height: 1;
}

.landing-hero-copy > p:not(.landing-kicker) {
    margin: 20px 0 0;
    color: rgba(255, 255, 255, 0.86);
    font-size: 18px;
    line-height: 1.65;
}

.landing-hero-actions {
    margin-top: 26px;
}

.landing-hero-actions .button {
    min-height: 50px;
    padding-inline: 18px;
}

.landing-secondary-action {
    border-color: rgba(255, 255, 255, 0.42);
    background: rgba(36, 17, 48, 0.72);
    color: #ffffff;
}

.landing-secondary-action:hover,
.landing-secondary-action:focus-visible {
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

.landing-hero-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    margin-top: 28px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: linear-gradient(
        90deg,
        rgba(183, 120, 231, 0.24),
        rgba(82, 111, 196, 0.15)
    );
}

.landing-hero-facts span {
    display: grid;
    gap: 1px;
    padding: 10px 13px;
    background: rgba(36, 17, 48, 0.8);
    color: rgba(255, 255, 255, 0.7);
    font-size: 10px;
}

.landing-hero-facts strong {
    color: #ffffff;
    font-size: 16px;
}

.landing-course-band {
    display: grid;
    grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
    align-items: center;
    gap: 36px;
    min-height: 190px;
    padding-block: 36px;
}

.landing-course-band h2,
.landing-section-heading h2,
.landing-cta h2 {
    margin-top: 5px;
    color: var(--text);
    font-size: 30px;
    line-height: 1.2;
}

.landing-flag-list {
    display: flex;
    justify-content: flex-end;
    gap: 11px;
    flex-wrap: wrap;
}

.landing-flag-list > span {
    display: inline-grid;
    width: 46px;
    height: 38px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 1px 2px rgba(30, 24, 34, 0.07);
}

.landing-flag-list .course-flag {
    width: 30px;
    height: 22px;
}

.landing-paths {
    padding-block: 70px 76px;
    border-top: 1px solid var(--line);
}

.landing-section-heading {
    max-width: 680px;
}

.landing-path-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px;
    margin-top: 42px;
}

.landing-path-list article {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 16px;
    padding-top: 24px;
    border-top: 3px solid var(--success);
}

.landing-path-list article:last-child {
    border-top-color: var(--blue);
}

.landing-path-list h3 {
    margin: 0;
    color: var(--text);
    font-size: 21px;
}

.landing-path-list p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.65;
}

.landing-path-list .text-link {
    grid-column: 2;
    justify-self: start;
}

.landing-app-band {
    padding-block: 52px 58px;
    border-top: 1px solid var(--line);
}

.landing-app-copy {
    display: flex;
    align-items: center;
    gap: 16px;
}

.landing-app-copy .icon-tile {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
}

.landing-app-copy h2 {
    margin: 5px 0 0;
    color: var(--text);
    font-size: 30px;
    line-height: 1.2;
}

.landing-platform-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 30px;
}

.landing-platform-item {
    --platform-accent: var(--primary);
    display: grid;
    min-width: 0;
    min-height: 86px;
    grid-template-columns: 42px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 11px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

a.landing-platform-item:hover,
a.landing-platform-item:focus-visible {
    border-color: var(--platform-accent);
    box-shadow: 0 10px 26px rgba(17, 10, 21, 0.16);
    outline: none;
    transform: translateY(-1px);
}

.landing-platform-item.is-device-hidden {
    display: none;
}

.landing-platform-item.is-recommended {
    border-color: color-mix(in srgb, var(--platform-accent) 58%, var(--line));
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--platform-accent) 12%, var(--surface)),
        var(--surface)
    );
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--platform-accent) 22%, transparent);
}

.landing-platform-item > span:nth-child(2) {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.landing-platform-item strong,
.landing-platform-item small {
    overflow-wrap: anywhere;
}

.landing-platform-item strong {
    font-size: 13px;
    line-height: 1.25;
}

.landing-platform-item small {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.35;
}

.landing-platform-item > svg {
    width: 17px;
    height: 17px;
    color: var(--platform-accent);
}

.landing-platform-icon {
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 8px;
    background: color-mix(in srgb, var(--platform-accent) 15%, var(--surface));
    color: var(--platform-accent);
}

.landing-platform-icon svg {
    width: 20px;
    height: 20px;
}

.landing-platform-item.is-pending {
    background: transparent;
    color: var(--muted);
}

.landing-platform-item.is-pending strong {
    color: var(--text);
}

.install-page-heading {
    max-width: 720px;
}

.install-page-panel {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.install-page-panel-heading {
    display: flex;
    align-items: center;
    gap: 14px;
}

.install-page-panel-heading h2 {
    margin-top: 3px;
    font-size: 20px;
}

.install-page-panel .landing-platform-grid {
    margin-top: 22px;
}

.landing-platform-android { --platform-accent: #49aa89; }
.landing-platform-windows { --platform-accent: #5b82d1; }
.landing-platform-appimage { --platform-accent: #af73d4; }
.landing-platform-debian { --platform-accent: #cc6875; }
.landing-platform-fedora { --platform-accent: #4f79b8; }
.landing-platform-arch { --platform-accent: #45a3c9; }
.landing-platform-macos { --platform-accent: #8d7c96; }
.landing-platform-ios { --platform-accent: #7c8999; }

.landing-cta {
    display: flex;
    min-height: 210px;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    padding: 38px 42px;
    border-radius: 8px;
    border: 1px solid var(--line-strong);
    background: linear-gradient(
        120deg,
        var(--nav-bg),
        color-mix(in srgb, var(--nav-bg) 82%, var(--blue))
    );
    color: #ffffff;
}

.landing-cta .eyebrow {
    color: var(--primary-ink);
}

.landing-cta h2 {
    color: #ffffff;
}

.landing-cta h2 {
    max-width: 720px;
}

.landing-footer {
    display: flex;
    min-height: 110px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    color: var(--muted);
    font-size: 12px;
}

.landing-footer > span:first-child {
    color: var(--text);
    font-size: 15px;
    font-weight: 850;
}

@media (max-width: 980px) {
    .profile-edit-security-grid,
    .landing-course-band,
    .landing-path-list {
        grid-template-columns: 1fr;
    }

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

    .landing-flag-list {
        justify-content: flex-start;
    }

    .landing-path-list {
        gap: 32px;
    }
}

@media (max-width: 700px) {
    .landing-header,
    .landing-hero-copy,
    .landing-course-band,
    .landing-paths,
    .landing-app-band,
    .landing-cta,
    .landing-footer {
        width: min(calc(100% - 28px), 1240px);
    }

    .landing-hero {
        height: calc(100svh - 68px);
        min-height: 470px;
        max-height: 680px;
    }

    .landing-hero-image {
        width: 100%;
        object-position: 72% center;
    }

    .landing-hero-shade {
        background: linear-gradient(
            90deg,
            rgba(23, 12, 31, 0.88),
            rgba(23, 12, 31, 0.62)
        );
    }

    .landing-header {
        min-height: 70px;
    }

    .landing-header-actions > a {
        display: none;
    }

    .landing-language-form select {
        max-width: 92px;
    }

    .landing-hero-copy {
        padding-top: 70px;
    }

    .landing-hero h1 {
        font-size: 48px;
    }

    .landing-hero-copy > p:not(.landing-kicker) {
        margin-top: 13px;
        font-size: 14px;
        line-height: 1.5;
    }

    .landing-hero-actions {
        margin-top: 19px;
    }

    .landing-hero-actions .button {
        min-height: 46px;
        padding-inline: 13px;
    }

    .landing-hero-facts {
        margin-top: 19px;
    }

    .landing-hero-facts span {
        padding: 8px;
    }

    .landing-course-band {
        gap: 24px;
        padding-block: 34px;
    }

    .landing-course-band h2,
    .landing-section-heading h2,
    .landing-cta h2 {
        font-size: 25px;
    }

    .landing-paths {
        padding-block: 52px;
    }

    .landing-path-list {
        margin-top: 30px;
    }

    .landing-app-band {
        padding-block: 40px;
    }

    .landing-cta {
        align-items: flex-start;
        padding: 30px 24px;
        flex-direction: column;
    }

    .landing-footer {
        min-height: 92px;
    }

    .profile-security-form .profile-form-actions {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 430px) {
    .landing-brand-logo {
        height: 32px;
    }

    .landing-hero-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .landing-hero-actions .button {
        width: 100%;
    }

    .landing-hero-facts span {
        font-size: 9px;
    }

    .landing-hero-facts strong {
        font-size: 14px;
    }

    .landing-flag-list {
        gap: 8px;
    }

    .landing-flag-list > span {
        width: 43px;
        height: 36px;
    }

    .landing-path-list article {
        grid-template-columns: 42px minmax(0, 1fr);
        gap: 12px;
    }

    .landing-path-list .text-link {
        grid-column: 1 / -1;
    }

    .landing-platform-grid {
        grid-template-columns: 1fr;
    }

    .landing-footer {
        align-items: flex-start;
        justify-content: center;
        padding-block: 24px;
        flex-direction: column;
    }
}
