:root {
    color-scheme: light;
    --ink: #142033;
    --muted: #647087;
    --paper: #f6f4ed;
    --surface: #ffffff;
    --line: #dfe3e8;
    --navy: #153a5b;
    --navy-deep: #0d263d;
    --teal: #0f766e;
    --teal-light: #d8f1ec;
    --amber: #d88921;
    --amber-light: #fff0d2;
    --red: #a33b43;
    --red-light: #fbe9e9;
    --shadow: 0 24px 70px rgba(24, 41, 65, .12);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--paper);
}

body {
    min-height: 100vh;
    margin: 0;
    display: grid;
    grid-template-rows: auto 1fr auto;
    color: var(--ink);
    background:
        radial-gradient(circle at 12% 14%, rgba(15, 118, 110, .08), transparent 28rem),
        var(--paper);
}

button,
input,
select {
    font: inherit;
}

a {
    color: inherit;
}

.skip-link {
    position: fixed;
    z-index: 100;
    top: .75rem;
    left: .75rem;
    padding: .75rem 1rem;
    color: white;
    background: var(--navy-deep);
    border-radius: .5rem;
    transform: translateY(-150%);
}

.skip-link:focus {
    transform: translateY(0);
}

.site-header {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
    min-height: 84px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

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

.brand-mark {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: white;
    background: var(--navy);
    font-family: Georgia, serif;
    font-size: 1.8rem;
    box-shadow: 0 8px 20px rgba(21, 58, 91, .2);
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: .98rem;
    letter-spacing: .01em;
}

.brand small {
    margin-top: .15rem;
    color: var(--muted);
    font-size: .74rem;
}

.account-area {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.account-summary {
    text-align: right;
}

.account-summary strong,
.account-summary small {
    display: block;
}

.account-summary small {
    margin-top: .15rem;
    color: var(--muted);
}

.site-main {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 2.5rem 0 5rem;
}

.site-footer {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1.5rem 0 2rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: var(--muted);
    border-top: 1px solid rgba(20, 32, 51, .1);
    font-size: .82rem;
}

.site-footer nav {
    display: flex;
    gap: 1rem;
}

.site-footer a,
.privacy-note a,
.legal-shell a {
    color: var(--navy);
    text-underline-offset: .2em;
}

.legal-shell {
    width: min(820px, 100%);
    margin: 1rem auto;
    padding: clamp(1.5rem, 5vw, 3rem);
    border: 1px solid rgba(20, 32, 51, .08);
    border-radius: 24px;
    background: white;
    box-shadow: var(--shadow);
}

.legal-shell h1 {
    margin-top: .35rem;
    font-family: Georgia, serif;
    font-size: clamp(2.3rem, 6vw, 4rem);
    font-weight: 500;
}

.legal-shell section {
    margin-top: 2.2rem;
    padding-top: 1.6rem;
    border-top: 1px solid rgba(20, 32, 51, .09);
}

.legal-shell h2,
.legal-shell h3 {
    color: var(--navy-deep);
}

.legal-shell p,
.legal-shell li,
.legal-shell address,
.legal-shell dd {
    line-height: 1.75;
}

.legal-shell address {
    color: inherit;
    font-style: normal;
}

.legal-shell code {
    padding: .12rem .35rem;
    border-radius: .3rem;
    background: var(--paper);
}

.pre-line {
    white-space: pre-line;
}

.legal-details {
    display: grid;
    gap: .75rem;
}

.legal-details div {
    display: grid;
    grid-template-columns: 7rem 1fr;
}

.legal-details dt {
    color: var(--muted);
}

.legal-details dd {
    margin: 0;
}

.legal-version {
    margin-top: 2rem;
    color: var(--muted);
    font-size: .85rem;
}

.legal-back {
    margin-top: 2rem;
}

.auth-page {
    background:
        linear-gradient(115deg, rgba(246, 244, 237, .92), rgba(246, 244, 237, .98)),
        repeating-linear-gradient(90deg, transparent 0 59px, rgba(21, 58, 91, .045) 60px),
        repeating-linear-gradient(0deg, transparent 0 59px, rgba(21, 58, 91, .045) 60px),
        var(--paper);
}

.auth-shell {
    min-height: min(680px, calc(100vh - 220px));
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr);
    gap: clamp(2rem, 7vw, 7rem);
    align-items: center;
}

.auth-intro {
    position: relative;
}

.auth-intro::before {
    content: "";
    position: absolute;
    width: 9rem;
    height: .35rem;
    top: -2rem;
    left: 0;
    border-radius: 1rem;
    background: linear-gradient(90deg, var(--teal) 0 62%, var(--amber) 62% 100%);
}

.eyebrow {
    margin: 0 0 .8rem;
    color: var(--teal);
    font-weight: 750;
    font-size: .78rem;
    letter-spacing: .12em;
    text-transform: uppercase;
}

h1,
h2,
p {
    text-wrap: pretty;
}

.auth-intro h1,
.dashboard-hero h1 {
    margin: 0;
    color: var(--navy-deep);
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 500;
    font-size: clamp(2.8rem, 6vw, 5.4rem);
    line-height: .98;
    letter-spacing: -.045em;
}

.auth-lead {
    max-width: 41rem;
    margin: 1.8rem 0 0;
    color: var(--muted);
    font-size: clamp(1rem, 2vw, 1.18rem);
    line-height: 1.75;
}

.formula-strip {
    margin-top: 2.2rem;
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
}

.formula-strip span {
    padding: .65rem .85rem;
    border: 1px solid rgba(21, 58, 91, .12);
    border-radius: 999px;
    color: var(--navy);
    background: rgba(255, 255, 255, .55);
    font-family: Georgia, serif;
}

.auth-card {
    padding: clamp(1.5rem, 4vw, 2.6rem);
    border: 1px solid rgba(21, 58, 91, .1);
    border-radius: 26px;
    background: rgba(255, 255, 255, .94);
    box-shadow: var(--shadow);
}

.card-heading {
    margin-bottom: 1.6rem;
}

.card-heading h1,
.card-heading h2 {
    margin: 0;
    color: var(--navy-deep);
    font-family: Georgia, serif;
    font-size: clamp(1.8rem, 4vw, 2.35rem);
    font-weight: 500;
    letter-spacing: -.025em;
}

.card-heading p:last-child {
    margin: .65rem 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.form-stack {
    display: grid;
    gap: 1.2rem;
}

.field {
    display: grid;
    gap: .45rem;
}

.field label {
    color: var(--ink);
    font-size: .9rem;
    font-weight: 700;
}

.field small {
    color: var(--muted);
    line-height: 1.45;
}

.field input,
.field textarea {
    width: 100%;
    min-height: 50px;
    padding: .8rem .9rem;
    border: 1px solid #c9d0d9;
    border-radius: 11px;
    color: var(--ink);
    background: #fbfcfd;
    outline: 0;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.field textarea {
    resize: vertical;
    line-height: 1.55;
}

.field select {
    width: 100%;
    min-height: 50px;
    padding: .8rem 2.4rem .8rem .9rem;
    border: 1px solid #c9d0d9;
    border-radius: 11px;
    color: var(--ink);
    background: #fbfcfd;
    outline: 0;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--teal);
    background: white;
    box-shadow: 0 0 0 4px rgba(15, 118, 110, .12);
}

.input-suffix {
    position: relative;
}

.input-suffix input {
    padding-right: 8.2rem;
}

.input-suffix span {
    position: absolute;
    top: 50%;
    right: .85rem;
    color: var(--muted);
    transform: translateY(-50%);
    pointer-events: none;
}

.button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .75rem 1rem;
    border: 0;
    border-radius: 11px;
    font-weight: 750;
    cursor: pointer;
    text-decoration: none;
}

.button:focus-visible {
    outline: 3px solid rgba(15, 118, 110, .25);
    outline-offset: 2px;
}

.button-primary {
    color: white;
    background: var(--navy);
    box-shadow: 0 10px 24px rgba(21, 58, 91, .18);
}

.button-primary:hover {
    background: var(--navy-deep);
}

.button-full {
    width: 100%;
    margin-top: .25rem;
}

.button-quiet {
    min-height: 40px;
    border: 1px solid rgba(21, 58, 91, .15);
    color: var(--navy);
    background: rgba(255, 255, 255, .55);
}

.notice {
    margin: 0 0 1.25rem;
    padding: .9rem 1rem;
    border-radius: 10px;
    line-height: 1.5;
}

.notice ul {
    margin: 0;
    padding-left: 1.15rem;
}

.notice-error {
    border: 1px solid rgba(163, 59, 67, .25);
    color: #7e2830;
    background: var(--red-light);
}

.notice-success {
    border: 1px solid rgba(15, 118, 110, .2);
    color: #0b5a54;
    background: var(--teal-light);
}

.privacy-note {
    margin: 1.25rem 0 0;
    color: var(--muted);
    font-size: .78rem;
    line-height: 1.55;
}

.narrow-shell {
    width: min(620px, 100%);
    margin: 2rem auto 0;
}

.password-card {
    padding: clamp(1.5rem, 5vw, 3rem);
}

.dashboard-hero {
    min-height: 350px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 3rem;
    padding: clamp(2rem, 5vw, 4rem);
    border-radius: 28px;
    color: white;
    background:
        radial-gradient(circle at 85% 15%, rgba(255, 255, 255, .14), transparent 14rem),
        linear-gradient(125deg, var(--navy-deep), var(--navy));
    box-shadow: var(--shadow);
}

.dashboard-hero .eyebrow {
    color: #75ddd1;
}

.dashboard-hero h1 {
    color: white;
    font-size: clamp(2.5rem, 5vw, 4.7rem);
}

.dashboard-hero > div > p:last-child {
    max-width: 45rem;
    margin: 1.4rem 0 0;
    color: rgba(255, 255, 255, .74);
    font-size: 1.05rem;
    line-height: 1.7;
}

.progress-orbit {
    width: 170px;
    aspect-ratio: 1;
    display: grid;
    place-content: center;
    text-align: center;
    border: 8px solid rgba(255, 255, 255, .14);
    border-top-color: #75ddd1;
    border-right-color: #75ddd1;
    border-radius: 50%;
}

.progress-orbit span {
    font-family: Georgia, serif;
    font-size: 2.5rem;
}

.progress-orbit span small {
    font-size: 1rem;
}

.progress-orbit p {
    margin: .2rem 0 0;
    color: rgba(255, 255, 255, .7);
    font-size: .8rem;
}

.subject-grid {
    margin-top: 1.4rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.4rem;
}

.subject-card {
    position: relative;
    min-height: 290px;
    overflow: hidden;
    padding: 2rem;
    border: 1px solid rgba(20, 32, 51, .08);
    border-radius: 22px;
    background: white;
}

.subject-card h2,
.info-panel h2 {
    margin: 0;
    color: var(--navy-deep);
    font-family: Georgia, serif;
    font-size: 2rem;
    font-weight: 500;
}

.subject-card > p:not(.eyebrow) {
    max-width: 30rem;
    color: var(--muted);
    line-height: 1.65;
}

.subject-symbol {
    position: absolute;
    right: -1rem;
    bottom: -2.5rem;
    color: rgba(21, 58, 91, .07);
    font-family: Georgia, serif;
    font-size: 9rem;
    line-height: 1;
}

.subject-math {
    background: linear-gradient(145deg, white 45%, var(--teal-light));
}

.subject-physics {
    background: linear-gradient(145deg, white 45%, var(--amber-light));
}

.subject-physics .eyebrow {
    color: #9b5b0e;
}

.status-chip {
    position: absolute;
    left: 2rem;
    bottom: 2rem;
    padding: .5rem .75rem;
    border: 1px solid rgba(21, 58, 91, .1);
    border-radius: 999px;
    color: var(--navy);
    background: rgba(255, 255, 255, .75);
    font-size: .78rem;
    font-weight: 750;
}

.info-panel {
    margin-top: 1.4rem;
    padding: 2rem;
    display: grid;
    grid-template-columns: .7fr 1.3fr;
    gap: 2rem;
    align-items: start;
    border: 1px solid rgba(20, 32, 51, .08);
    border-radius: 22px;
    background: rgba(255, 255, 255, .72);
}

.account-details {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.account-details div {
    padding-left: 1rem;
    border-left: 2px solid var(--teal-light);
}

.account-details dt {
    color: var(--muted);
    font-size: .78rem;
}

.account-details dd {
    margin: .35rem 0 0;
    overflow-wrap: anywhere;
    font-weight: 700;
}

.subject-section,
.empty-panel {
    margin-top: 1.4rem;
    padding: clamp(1.5rem, 4vw, 2.4rem);
    border: 1px solid rgba(20, 32, 51, .08);
    border-radius: 22px;
    background: rgba(255, 255, 255, .82);
}

.section-heading {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 2rem;
}

.section-heading h2,
.empty-panel h2 {
    max-width: 47rem;
    margin: 0;
    color: var(--navy-deep);
    font-family: Georgia, serif;
    font-size: clamp(1.7rem, 3vw, 2.35rem);
    font-weight: 500;
    line-height: 1.2;
}

.section-progress,
.difficulty {
    flex: none;
    padding: .55rem .8rem;
    border: 1px solid rgba(15, 118, 110, .14);
    border-radius: 999px;
    color: var(--teal);
    background: var(--teal-light);
    font-size: .78rem;
    font-weight: 750;
}

.topic-block {
    margin-top: 2rem;
    padding-top: 1.6rem;
    border-top: 1px solid rgba(20, 32, 51, .09);
}

.topic-heading {
    margin-bottom: 1rem;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.topic-heading h3 {
    margin: 0;
    color: var(--navy-deep);
    font-size: 1.05rem;
}

.topic-heading span {
    color: var(--muted);
    font-size: .78rem;
}

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

.task-card {
    min-height: 205px;
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    border: 1px solid rgba(21, 58, 91, .1);
    border-radius: 17px;
    color: var(--ink);
    background: white;
    text-decoration: none;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.task-card:hover {
    border-color: rgba(15, 118, 110, .35);
    box-shadow: 0 14px 34px rgba(24, 41, 65, .1);
    transform: translateY(-2px);
}

.task-card:focus-visible {
    outline: 3px solid rgba(15, 118, 110, .25);
    outline-offset: 3px;
}

.task-card.is-solved {
    border-color: rgba(15, 118, 110, .25);
    background: linear-gradient(145deg, white 55%, rgba(216, 241, 236, .7));
}

.task-state {
    padding: .38rem .6rem;
    border-radius: 999px;
    color: var(--navy);
    background: var(--paper);
    font-size: .72rem;
    font-weight: 750;
}

.task-card.is-solved .task-state {
    color: #0b5a54;
    background: var(--teal-light);
}

.task-card h4 {
    margin: 1rem 0 .45rem;
    color: var(--navy-deep);
    font-family: Georgia, serif;
    font-size: 1.55rem;
    font-weight: 500;
}

.task-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.task-meta {
    margin-top: auto;
    padding-top: 1.2rem;
    color: var(--muted);
    font-size: .75rem;
}

.empty-panel p:last-child {
    max-width: 45rem;
    color: var(--muted);
    line-height: 1.65;
}

.breadcrumbs {
    margin-bottom: 1.1rem;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    color: var(--muted);
    font-size: .8rem;
}

.breadcrumbs a,
.back-link {
    color: var(--navy);
    text-underline-offset: .2em;
}

.task-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1.4rem;
    align-items: start;
}

.exercise-card,
.attempt-panel {
    border: 1px solid rgba(20, 32, 51, .08);
    border-radius: 22px;
    background: white;
    box-shadow: 0 18px 50px rgba(24, 41, 65, .08);
}

.exercise-card {
    padding: clamp(1.5rem, 5vw, 3rem);
}

.exercise-heading {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 2rem;
}

.exercise-heading h1 {
    margin: 0;
    color: var(--navy-deep);
    font-family: Georgia, serif;
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -.035em;
}

.task-prompt {
    margin: 2.2rem 0;
    padding: clamp(1.4rem, 4vw, 2.2rem);
    border-left: 5px solid var(--teal);
    border-radius: 0 16px 16px 0;
    color: var(--navy-deep);
    background: var(--paper);
    font-family: Georgia, serif;
    font-size: clamp(1.35rem, 3vw, 1.9rem);
    line-height: 1.45;
}

.answer-result {
    margin-bottom: 1.5rem;
    padding: 1.2rem 1.3rem;
    border-radius: 14px;
}

.answer-result.is-correct {
    border: 1px solid rgba(15, 118, 110, .22);
    color: #0b5a54;
    background: var(--teal-light);
}

.answer-result.is-incorrect {
    border: 1px solid rgba(216, 137, 33, .28);
    color: #805010;
    background: var(--amber-light);
}

.answer-result p {
    margin: .35rem 0 0;
    line-height: 1.55;
}

.answer-result .result-label {
    margin-top: 0;
    font-weight: 800;
}

.solution-note {
    padding-top: .8rem;
    border-top: 1px solid currentColor;
}

.answer-form {
    display: grid;
    gap: 1.3rem;
}

.answer-form .button {
    justify-self: start;
    min-width: 180px;
}

.answer-input-row {
    display: flex;
    align-items: center;
    gap: .8rem;
}

.answer-input-row input {
    max-width: 320px;
}

.unit-label {
    color: var(--navy-deep);
    font-weight: 750;
}

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

.choice-fieldset legend {
    margin-bottom: .7rem;
    font-weight: 750;
}

.choice-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}

.choice-option {
    min-height: 60px;
    padding: .8rem;
    display: flex;
    align-items: center;
    gap: .8rem;
    border: 1px solid #c9d0d9;
    border-radius: 12px;
    cursor: pointer;
    background: #fbfcfd;
}

.choice-option:has(input:checked) {
    border-color: var(--teal);
    background: var(--teal-light);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, .1);
}

.choice-option:focus-within {
    outline: 3px solid rgba(15, 118, 110, .2);
    outline-offset: 2px;
}

.choice-option input {
    width: 1rem;
    height: 1rem;
    flex: none;
    accent-color: var(--teal);
}

.choice-key {
    width: 1.8rem;
    height: 1.8rem;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--navy);
    background: white;
    font-size: .75rem;
    font-weight: 800;
}

.attempt-panel {
    position: sticky;
    top: 1rem;
    padding: 1.5rem;
}

.attempt-panel h2 {
    margin: 0;
    color: var(--navy-deep);
    font-family: Georgia, serif;
    font-size: 1.8rem;
    font-weight: 500;
}

.attempt-empty {
    color: var(--muted);
    line-height: 1.55;
}

.attempt-list {
    margin: 1.2rem 0 0;
    padding: 0;
    display: grid;
    gap: .8rem;
    list-style: none;
}

.attempt-list li {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.attempt-list strong,
.attempt-list small {
    display: block;
}

.attempt-list strong {
    overflow-wrap: anywhere;
}

.attempt-list small {
    margin-top: .15rem;
    color: var(--muted);
    font-size: .72rem;
}

.attempt-icon {
    width: 2rem;
    height: 2rem;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-weight: 800;
}

.attempt-icon.is-correct {
    color: #0b5a54;
    background: var(--teal-light);
}

.attempt-icon.is-incorrect {
    color: #805010;
    background: var(--amber-light);
}

.back-link {
    margin-top: 1.5rem;
    display: inline-block;
    font-size: .82rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.teacher-hero {
    min-height: 280px;
    padding: clamp(2rem, 5vw, 4rem);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 3rem;
    border-radius: 28px;
    color: white;
    background:
        radial-gradient(circle at 87% 18%, rgba(117, 221, 209, .2), transparent 13rem),
        linear-gradient(125deg, #102b42, var(--navy));
    box-shadow: var(--shadow);
}

.teacher-hero .eyebrow {
    color: #75ddd1;
}

.teacher-hero h1,
.student-detail-hero h1 {
    margin: 0;
    font-family: Georgia, serif;
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 500;
    line-height: 1;
    letter-spacing: -.04em;
}

.teacher-hero p:last-child {
    max-width: 44rem;
    margin: 1.2rem 0 0;
    color: rgba(255, 255, 255, .74);
    font-size: 1.05rem;
    line-height: 1.7;
}

.teacher-hero > div > p:not(.eyebrow) {
    max-width: 44rem;
    margin: 1.2rem 0 0;
    color: rgba(255, 255, 255, .74);
    font-size: 1.05rem;
    line-height: 1.7;
}

.teacher-hero-actions {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: .7rem;
}

.teacher-hero-actions .button-quiet {
    border-color: rgba(255, 255, 255, .35);
    color: var(--navy-deep);
    background: white;
}

.teacher-lock {
    width: 116px;
    height: 116px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 28px;
    color: var(--navy-deep);
    background: #75ddd1;
    font-family: Georgia, serif;
    font-size: 3.4rem;
    box-shadow: 0 18px 45px rgba(0, 0, 0, .18);
}

.metric-grid {
    margin-top: 1.4rem;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.metric-card {
    min-height: 140px;
    padding: 1.35rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid rgba(20, 32, 51, .08);
    border-radius: 18px;
    background: white;
}

.metric-card span {
    color: var(--muted);
    font-size: .82rem;
    font-weight: 700;
}

.metric-card strong {
    color: var(--navy-deep);
    font-family: Georgia, serif;
    font-size: 2.7rem;
    font-weight: 500;
}

.teacher-panel {
    margin-top: 1.4rem;
    padding: clamp(1.25rem, 3vw, 2rem);
    border: 1px solid rgba(20, 32, 51, .08);
    border-radius: 22px;
    background: rgba(255, 255, 255, .86);
}

.teacher-panel-heading {
    margin-bottom: 1.4rem;
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 2rem;
}

.teacher-panel-heading h2 {
    margin: 0;
    color: var(--navy-deep);
    font-family: Georgia, serif;
    font-size: clamp(1.8rem, 3vw, 2.35rem);
    font-weight: 500;
}

.teacher-filter {
    display: flex;
    align-items: end;
    justify-content: flex-end;
    gap: .65rem;
}

.compact-field {
    min-width: 190px;
    gap: .3rem;
}

.compact-field input,
.compact-field select {
    min-height: 42px;
    padding-top: .55rem;
    padding-bottom: .55rem;
}

.teacher-filter .button {
    min-height: 42px;
}

.table-scroll {
    max-width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}

.data-table th,
.data-table td {
    padding: .9rem .75rem;
    border-bottom: 1px solid rgba(20, 32, 51, .08);
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    color: var(--muted);
    font-size: .72rem;
    letter-spacing: .06em;
    text-transform: uppercase;
}

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

.data-table strong,
.data-table td > small {
    display: block;
}

.data-table td > small {
    margin-top: .15rem;
    color: var(--muted);
    font-size: .72rem;
}

.teacher-week-symbol {
    font-size: 2.1rem;
    letter-spacing: -.04em;
}

.week-table {
    min-width: 1120px;
}

.week-table .week-row-unavailable {
    background: rgba(255, 240, 210, .45);
}

.week-number,
.week-calendar-number,
.week-date-range {
    white-space: nowrap;
}

.week-number {
    color: var(--navy-deep);
    font-weight: 800;
}

.week-notes {
    min-width: 230px;
}

.week-notes strong,
.week-notes small {
    display: block;
}

.week-notes small {
    margin-top: .2rem;
    color: var(--muted);
}

.planning-hint {
    margin: -.25rem 0 1.25rem;
    padding: .85rem 1rem;
    border-left: 4px solid var(--teal);
    border-radius: 0 10px 10px 0;
    color: var(--muted);
    background: var(--teal-light);
    font-size: .82rem;
    line-height: 1.55;
}

.week-topics {
    min-width: 220px;
}

.week-topic-empty {
    color: var(--muted);
    font-size: .78rem;
}

.week-topic-list {
    margin: 0;
    padding-left: 1.25rem;
}

.week-topic-list li + li {
    margin-top: .55rem;
}

.week-topic-list strong,
.week-topic-list small {
    display: block;
}

.week-topic-list small {
    margin-top: .1rem;
    color: var(--muted);
    font-size: .7rem;
}

.week-edit-panel {
    width: min(900px, 100%);
    margin-right: auto;
    margin-left: auto;
}

.week-edit-panel h1 {
    margin: 0;
    color: var(--navy-deep);
    font-family: Georgia, serif;
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 500;
    letter-spacing: -.035em;
}

.availability-choice {
    margin: 0;
    padding: 1.1rem;
    display: flex;
    flex-wrap: wrap;
    gap: .8rem;
    border: 1px solid var(--line);
    border-radius: 14px;
}

.availability-choice legend {
    padding: 0 .35rem;
    font-weight: 750;
}

.availability-choice label {
    min-width: 180px;
    padding: .85rem 1rem;
    display: flex;
    align-items: center;
    gap: .65rem;
    border: 1px solid var(--line);
    border-radius: 11px;
    cursor: pointer;
    background: white;
}

.availability-choice label:has(input:checked) {
    border-color: var(--teal);
    background: var(--teal-light);
}

.availability-choice input,
.topic-option input {
    width: 1rem;
    height: 1rem;
    flex: none;
    accent-color: var(--teal);
}

.topic-picker {
    margin-top: .4rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
}

.topic-picker h2 {
    margin: 0;
    color: var(--navy-deep);
    font-family: Georgia, serif;
    font-size: 2rem;
    font-weight: 500;
}

.topic-picker > div > p:last-child {
    color: var(--muted);
    line-height: 1.55;
}

.topic-picker-group {
    margin: 1.3rem 0 0;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 14px;
}

.topic-picker-group legend {
    padding: 0 .4rem;
    color: var(--navy-deep);
    font-weight: 800;
}

.topic-option-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .7rem;
}

.topic-option {
    min-height: 74px;
    padding: .8rem;
    display: flex;
    align-items: start;
    gap: .7rem;
    border: 1px solid rgba(20, 32, 51, .08);
    border-radius: 11px;
    cursor: pointer;
    background: white;
}

.topic-option:has(input:checked) {
    border-color: var(--teal);
    background: var(--teal-light);
}

.topic-option strong,
.topic-option small {
    display: block;
}

.topic-option small {
    margin-top: .2rem;
    color: var(--muted);
    line-height: 1.4;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .7rem;
}

.table-progress {
    min-width: 118px;
}

.table-progress > span {
    height: .4rem;
    display: block;
    overflow: hidden;
    border-radius: 999px;
    background: var(--line);
}

.table-progress i {
    height: 100%;
    display: block;
    border-radius: inherit;
    background: var(--teal);
}

.table-progress small {
    margin-top: .3rem;
    display: block;
    color: var(--muted);
    font-size: .72rem;
}

.row-link {
    color: var(--navy);
    font-size: .78rem;
    font-weight: 750;
    text-underline-offset: .2em;
}

.table-empty {
    padding: 1.5rem !important;
    color: var(--muted);
    text-align: center !important;
    line-height: 1.55;
}

.teacher-pagination {
    margin-top: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    color: var(--muted);
    font-size: .78rem;
}

.teacher-pagination a {
    color: var(--navy);
    font-weight: 750;
}

.teacher-two-column {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
    gap: 1.4rem;
}

.catalog-list {
    display: grid;
    gap: .8rem;
}

.catalog-item {
    padding: 1.1rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1.5rem;
    border: 1px solid rgba(20, 32, 51, .08);
    border-radius: 14px;
    background: white;
}

.catalog-item h3 {
    margin: .55rem 0 .25rem;
    color: var(--navy-deep);
    font-family: Georgia, serif;
    font-size: 1.25rem;
    font-weight: 500;
}

.catalog-item p {
    margin: 0;
    color: var(--muted);
    font-size: .78rem;
    line-height: 1.5;
}

.catalog-status {
    display: inline-flex;
    padding: .35rem .55rem;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 800;
}

.catalog-status.is-active {
    color: #0b5a54;
    background: var(--teal-light);
}

.catalog-status.is-inactive {
    color: #805010;
    background: var(--amber-light);
}

.catalog-item dl {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(3, auto);
    gap: 1rem;
}

.catalog-item dl div {
    min-width: 3rem;
    padding-left: .7rem;
    border-left: 1px solid var(--line);
}

.catalog-item dt {
    color: var(--muted);
    font-size: .65rem;
}

.catalog-item dd {
    margin: .2rem 0 0;
    font-weight: 750;
}

.teacher-activity-list {
    margin: 0;
    padding: 0;
    display: grid;
    gap: .95rem;
    list-style: none;
}

.teacher-activity-list li {
    display: flex;
    align-items: start;
    gap: .8rem;
}

.teacher-activity-list strong,
.teacher-activity-list small {
    display: block;
}

.teacher-activity-list p {
    margin: .2rem 0;
    color: var(--muted);
    font-size: .78rem;
    line-height: 1.45;
}

.teacher-activity-list small {
    color: var(--muted);
    font-size: .7rem;
}

.student-detail-hero {
    min-height: 250px;
    padding: clamp(2rem, 5vw, 3.5rem);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 2rem;
    border: 1px solid rgba(20, 32, 51, .08);
    border-radius: 24px;
    background: linear-gradient(145deg, white 50%, var(--teal-light));
    box-shadow: 0 18px 50px rgba(24, 41, 65, .08);
}

.student-detail-hero h1 {
    color: var(--navy-deep);
}

.student-detail-hero > div > p:last-child {
    margin: 1rem 0 0;
    color: var(--muted);
}

.light-orbit {
    color: var(--navy-deep);
    border-color: rgba(21, 58, 91, .1);
    border-top-color: var(--teal);
    border-right-color: var(--teal);
}

.light-orbit p {
    color: var(--muted);
}

.student-task-list {
    display: grid;
    gap: .7rem;
}

.student-task-list article {
    padding: 1rem;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .9rem;
    border: 1px solid rgba(20, 32, 51, .08);
    border-radius: 13px;
    background: white;
}

.student-task-list h3 {
    margin: 0;
    color: var(--navy-deep);
    font-size: .95rem;
}

.student-task-list p,
.student-task-list article > span:last-child {
    margin: .2rem 0 0;
    color: var(--muted);
    font-size: .75rem;
}

@media (max-width: 820px) {
    .auth-shell {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .auth-intro {
        padding-top: 2rem;
    }

    .dashboard-hero {
        grid-template-columns: 1fr;
    }

    .progress-orbit {
        display: none;
    }

    .subject-grid,
    .info-panel {
        grid-template-columns: 1fr;
    }

    .account-details {
        grid-template-columns: 1fr;
    }

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

    .attempt-panel {
        position: static;
    }

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

    .teacher-panel-heading,
    .teacher-filter {
        align-items: stretch;
        flex-direction: column;
    }

    .teacher-filter {
        width: 100%;
    }

    .teacher-two-column {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 620px) {
    .site-header {
        min-height: 76px;
    }

    .account-summary {
        display: none;
    }

    .site-main {
        padding-top: 1.4rem;
    }

    .site-footer {
        flex-direction: column;
    }

    .auth-intro h1 {
        font-size: clamp(2.5rem, 14vw, 3.8rem);
    }

    .input-suffix input {
        padding-right: .9rem;
    }

    .input-suffix span {
        position: static;
        display: block;
        margin-top: .35rem;
        transform: none;
        font-size: .78rem;
    }

    .section-heading,
    .exercise-heading {
        display: grid;
    }

    .task-grid,
    .choice-list {
        grid-template-columns: 1fr;
    }

    .task-card {
        min-height: 185px;
    }

    .teacher-hero,
    .student-detail-hero {
        grid-template-columns: 1fr;
    }

    .teacher-lock,
    .student-detail-hero .progress-orbit {
        display: none;
    }

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

    .metric-card {
        min-height: 115px;
    }

    .catalog-item {
        grid-template-columns: 1fr;
    }

    .catalog-item dl {
        justify-content: start;
    }

    .student-task-list article {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .student-task-list article > span:last-child {
        grid-column: 2;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
