:root {
    --ink: #18211b;
    --forest: #286448;
    --forest-deep: #0e2b1d;
    --sage: #8eaa95;
    --cream: #f6f8f3;
    --paper: #ffffff;
    --gold: #d2a955;
    --danger: #a33a3a;
    --line: rgba(40, 100, 72, 0.12);
    --shadow: 0 16px 48px rgba(34, 72, 51, 0.08);
}

* {
    box-sizing: border-box;
}

[hidden] { display: none !important; }

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

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 0% 0%, #e9f2e9, transparent 38rem),
        radial-gradient(circle at 100% 40%, #faf3e4, transparent 40rem),
        var(--cream);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: inherit;
}

button,
input {
    font: inherit;
}

.site-header,
.site-footer,
.site-main,
.message-stack {
    width: min(1180px, calc(100% - 40px));
    margin-inline: auto;
}

.site-header {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 18px;
    padding: 12px 20px;
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: 24px;
    background: rgba(255, 255, 255, .88);
    box-shadow: 0 6px 30px rgba(34, 72, 51, .055);
}

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

.brand-mark,
.auth-icon {
    display: grid;
    place-items: center;
    color: var(--cream);
    background: var(--forest);
    border-radius: 12px;
}

.brand-mark {
    width: 46px;
    height: 46px;
    font-size: 30px;
}

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

.brand strong {
    font-size: 12px;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.brand small {
    margin-top: 1px;
    color: var(--forest);
    font-family: inherit;
    font-size: 21px;
    font-weight: 700;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 14px;
    font-weight: 650;
}

.site-nav a {
    text-decoration: none;
}

.site-nav form {
    margin: 0;
}

.nav-button,
.button {
    border: 0;
    border-radius: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 750;
    text-decoration: none;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.nav-button {
    min-height: 42px;
    padding: 0 18px;
    color: var(--paper);
    background: var(--forest);
}

.nav-button-ghost {
    color: var(--forest);
    background: transparent;
    border: 1px solid var(--line);
}

.chess-profile {
    position: relative;
    z-index: 20;
}

.chess-profile-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 50px;
    padding: 5px 12px 5px 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--paper);
    box-shadow: 0 6px 20px rgba(14, 43, 29, 0.07);
    cursor: pointer;
    list-style: none;
}

.chess-profile-trigger::-webkit-details-marker {
    display: none;
}

.chess-profile-trigger:hover,
.chess-profile[open] .chess-profile-trigger {
    border-color: var(--sage);
    background: #f0f4ec;
}

.site-header a:focus-visible,
.chess-profile-trigger:focus-visible,
.chess-profile-item:focus-visible {
    outline: 3px solid var(--forest);
    outline-offset: 3px;
}

.chess-profile-avatar {
    position: relative;
    display: grid;
    place-items: center;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    overflow: hidden;
    border: 2px solid var(--sage);
    border-radius: 50%;
    background: #e2ebdf;
    color: var(--forest);
    font-weight: 800;
}

.chess-profile-avatar img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chess-profile-copy {
    min-width: 0;
    max-width: 140px;
    line-height: 1.3;
}

.chess-profile-copy strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--forest-deep);
    font-size: 13px;
}

.chess-profile-copy small {
    display: block;
    color: #526b59;
    font-size: 11px;
}

.chess-profile svg {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chess-profile .chess-profile-chevron {
    width: 15px;
    height: 15px;
    color: var(--forest);
}

.chess-profile[open] .chess-profile-chevron {
    transform: rotate(180deg);
}

.chess-profile-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(300px, calc(100vw - 26px));
    max-height: calc(100dvh - 100px);
    overflow-y: auto;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--paper);
    box-shadow: 0 20px 50px rgba(14, 43, 29, 0.18);
}

.chess-profile-summary {
    display: grid;
    gap: 5px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: linear-gradient(135deg, #e6eee2, #f7f0dd);
    overflow-wrap: anywhere;
}

.chess-profile-label {
    color: #526b59;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.chess-profile-summary strong {
    color: var(--forest-deep);
    font-size: 15px;
}

.chess-profile-summary > span:last-child {
    color: #5d685f;
    font-size: 12px;
    font-weight: 500;
}

.chess-profile-links {
    padding-block: 6px;
}

.chess-profile-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 46px;
    padding: 11px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--forest);
    text-align: left;
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
}

.chess-profile-item:hover {
    background: #edf2e9;
}

.chess-profile-item small {
    display: block;
    margin-top: 3px;
    color: #5d685f;
    font-size: 11px;
    font-weight: 400;
}

.chess-profile-divider {
    height: 1px;
    margin: 0 4px 6px;
    border: 0;
    background: var(--line);
    opacity: 1;
}

.chess-profile-account-actions { padding-top: 0; }

.chess-profile-logout { margin: 0; border: 0; }

.chess-profile-logout button {
    color: var(--danger);
}

.chess-profile-logout button:hover {
    background: #f8e6e3;
}

.site-main {
    min-height: calc(100vh - 176px);
}

.message-stack {
    padding-top: 20px;
}

.message,
.inline-notice,
.form-errors {
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 14px;
}

.message,
.inline-notice {
    color: var(--forest-deep);
    background: #e2ebdf;
    border: 1px solid #c6d7c2;
}

.message-error,
.form-errors {
    color: #742525;
    background: #f8e6e3;
    border: 1px solid #efc9c3;
}

.form-errors ul {
    margin: 0;
    padding-left: 18px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.82fr);
    gap: clamp(42px, 7vw, 100px);
    align-items: center;
    padding: clamp(60px, 9vw, 112px) 0 70px;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--forest);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.17em;
    text-transform: uppercase;
}

.hero h1,
.auth-intro h1 {
    margin: 0;
    color: var(--forest-deep);
    font-family: inherit;
    font-size: clamp(40px, 5.5vw, 68px);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.12;
}

.hero h1 span {
    color: var(--forest);
}

.hero-text,
.auth-intro > p:not(.eyebrow) {
    max-width: 630px;
    margin: 26px 0 0;
    color: #526057;
    font-size: 18px;
    line-height: 1.72;
}

.hero-actions {
    margin-top: 34px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.button {
    min-height: 50px;
    padding: 0 23px;
}

.button-primary {
    color: var(--paper);
    background: linear-gradient(135deg, #347b58, #23563e);
    box-shadow: 0 5px 12px rgba(24, 63, 44, 0.14), inset 0 1px 0 rgba(255,255,255,.16);
}

.button-secondary {
    color: var(--forest);
    background: #edf5ee;
    border: 1px solid var(--line);
}

.button:hover:not(:disabled),
.nav-button:hover {
    transform: translateY(-2px);
}

.button:disabled {
    cursor: default;
    opacity: 0.72;
}

.button-block {
    width: 100%;
}

.welcome-text {
    width: 100%;
    color: var(--forest);
    font-weight: 700;
}

.board-preview {
    padding: clamp(14px, 2vw, 23px);
    background: var(--forest-deep);
    border-radius: 22px;
    box-shadow: var(--shadow);
    transform: rotate(1.2deg);
}

.board-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    aspect-ratio: 1;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.18);
}

.board-grid span {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    color: #171b18;
    background: #e9ddc0;
    font-family: Georgia, serif;
    font-size: clamp(22px, 3.1vw, 43px);
    line-height: 1;
}

.board-grid span:nth-child(16n + 2),
.board-grid span:nth-child(16n + 4),
.board-grid span:nth-child(16n + 6),
.board-grid span:nth-child(16n + 8),
.board-grid span:nth-child(16n + 9),
.board-grid span:nth-child(16n + 11),
.board-grid span:nth-child(16n + 13),
.board-grid span:nth-child(16n + 15) {
    background: var(--sage);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    padding-bottom: 90px;
}

.feature-card {
    min-height: 190px;
    padding: 27px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--line);
    border-radius: 22px;
}

.feature-number {
    color: var(--gold);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.12em;
}

.feature-card h2 {
    margin: 22px 0 9px;
    color: var(--forest-deep);
    font-family: inherit;
    font-size: 25px;
}

.feature-card p {
    margin: 0;
    color: #5d685f;
    line-height: 1.65;
}

.auth-layout {
    min-height: calc(100vh - 176px);
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(390px, 0.56fr);
    align-items: center;
    gap: clamp(50px, 10vw, 140px);
    padding: 60px 0 80px;
}

.auth-intro h1 {
    font-size: clamp(38px, 5vw, 60px);
}

.piece-line {
    margin-top: 34px;
    color: var(--forest);
    font-family: Georgia, serif;
    font-size: clamp(30px, 4vw, 48px);
    letter-spacing: 0.08em;
    opacity: 0.72;
}

.auth-card {
    padding: clamp(28px, 4vw, 46px);
    background: rgba(255, 253, 247, 0.9);
    border: 1px solid rgba(24, 63, 44, 0.12);
    border-radius: 22px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.auth-card-wide {
    width: min(100%, 620px);
}

.auth-card-heading {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 28px;
}

.auth-icon {
    width: 52px;
    height: 52px;
    font-size: 32px;
}

.auth-card-heading .eyebrow {
    margin-bottom: 3px;
}

.auth-card h2 {
    margin: 0;
    color: var(--forest-deep);
    font-family: inherit;
    font-size: 28px;
}

.inline-notice,
.form-errors {
    margin-bottom: 18px;
}

.auth-form {
    display: grid;
    gap: 17px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-field {
    display: grid;
    gap: 7px;
}

.form-field label {
    color: var(--forest-deep);
    font-size: 13px;
    font-weight: 750;
}

.form-field label span {
    color: #7d887f;
    font-weight: 500;
}

.form-field input {
    width: 100%;
    height: 50px;
    padding: 0 14px;
    color: var(--ink);
    background: #fffefb;
    border: 1px solid #cfd8ce;
    border-radius: 13px;
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.form-field input:focus {
    border-color: var(--forest);
    box-shadow: 0 0 0 3px rgba(24, 63, 44, 0.1);
}

.field-error {
    color: var(--danger);
    font-size: 12px;
    line-height: 1.4;
}

.checkbox-row {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #536057;
    font-size: 13px;
}

.checkbox-row input {
    accent-color: var(--forest);
}

.auth-switch {
    margin: 23px 0 8px;
    color: #68736b;
    font-size: 14px;
    text-align: center;
}

.auth-switch a,
.quiet-link {
    color: var(--forest);
    font-weight: 750;
}

.quiet-link {
    display: block;
    font-size: 13px;
    text-align: center;
}

.class-page { padding: 38px 0 70px; }
.class-page-narrow { max-width: 680px; margin-inline: auto; }
.class-back { display: inline-flex; align-items: center; gap: 10px; max-width: 100%; min-height: 44px; padding: 6px 16px 6px 6px; margin-bottom: 18px; border: 1px solid #d9e7d8; border-radius: 999px; background: #fffefb; box-shadow: 0 4px 14px rgba(14, 43, 29, .055); color: var(--forest-deep); font-size: 13px; font-weight: 750; line-height: 1.35; text-decoration: none; overflow-wrap: anywhere; transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease; }
.class-back::before { content: "←"; display: grid; place-items: center; flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%; background: #e7f2e5; color: var(--forest); font-size: 18px; font-weight: 500; line-height: 1; transition: transform 160ms ease, background 160ms ease; }
.class-back:hover { border-color: #b9d4ba; background: #f8fbf5; box-shadow: 0 7px 18px rgba(14, 43, 29, .09); }
.class-back:hover::before { transform: translateX(-2px); background: #d9ebd8; }
.class-back:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.class-heading { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 28px; padding: 30px; border: 1px solid #dce9dc; border-radius: 26px; background: radial-gradient(circle at 95% 0%, #f9efd5, transparent 45%), linear-gradient(120deg, #e7f1e8, #f4f8ee); }
.class-heading h1 { margin: 0; color: var(--forest-deep); font-family: inherit; font-size: clamp(28px, 3vw, 38px); font-weight: 800; line-height: 1.2; letter-spacing: -.035em; overflow-wrap: anywhere; }
.class-heading .eyebrow { font-size: 10px; letter-spacing: .12em; margin-bottom: 10px; }
.class-heading p:last-child:not(.eyebrow) { margin-bottom: 0; font-size: 14px; }
.class-heading p:not(.eyebrow), .class-card p, .class-description { color: #526057; line-height: 1.65; }
.class-description { white-space: normal; overflow-wrap: anywhere; margin: -8px 0 28px; }
.class-back-detail { margin-bottom: 20px; padding-right: 18px; background: #fff; font-size: 14px; box-shadow: 0 8px 22px rgba(14, 43, 29, .075); }
.class-back-detail::before { display: none; }
.class-back-detail-icon { display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; background: #e4f1e4; color: var(--forest); transition: transform 160ms ease, background 160ms ease; }
.class-back-detail-icon svg { width: 17px; height: 17px; fill: currentColor; }
.class-back-detail:hover .class-back-detail-icon { transform: translateX(-2px); background: #d9ebd8; }
.class-heading-detail { isolation: isolate; overflow: hidden; align-items: flex-start; min-height: 210px; padding: clamp(26px, 3vw, 36px); border-color: #d6e6d7; border-radius: 28px; background: radial-gradient(circle at 96% 8%, #f8ebce, transparent 39%), linear-gradient(120deg, #edf6ed, #fffef9 64%, #e8f2e7); box-shadow: 0 18px 42px rgba(14, 43, 29, .075); }
.class-heading-detail::before { content: ""; position: absolute; top: 0; left: 34px; width: 92px; height: 5px; border-radius: 0 0 8px 8px; background: linear-gradient(90deg, var(--forest), var(--gold)); }
.class-heading-detail::after { content: "♞"; position: absolute; right: 24px; bottom: -72px; z-index: 0; color: var(--forest); font: 220px/1 Georgia, serif; opacity: .055; pointer-events: none; }
.class-heading-detail-copy, .class-heading-detail > .class-actions, .class-heading-detail > .class-badge { position: relative; z-index: 1; }
.class-heading-detail-copy { max-width: 65ch; min-width: 0; }
.class-heading-detail .class-heading-detail-eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; color: #386f4d; font-size: 11px; font-weight: 850; letter-spacing: .13em; }
.class-heading-detail-eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(210, 169, 85, .18); }
.class-heading-detail h1 { font-size: clamp(34px, 4vw, 50px); line-height: 1.1; letter-spacing: -.045em; }
.class-heading-teacher { display: inline-flex; align-items: center; gap: 10px; max-width: 100%; margin-top: 22px; padding: 6px 15px 6px 6px; border: 1px solid #dce9da; border-radius: 999px; background: rgba(255, 255, 255, .88); box-shadow: 0 5px 16px rgba(14, 43, 29, .05); }
.class-heading-teacher-icon { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%; background: #e7f2e5; color: var(--forest); }
.class-heading-teacher-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.class-heading-teacher-label { min-width: 0; color: #627469; font-size: 12px; line-height: 1.25; }
.class-heading-teacher-label strong { margin-left: 5px; color: var(--forest-deep); font-size: 14px; font-weight: 800; overflow-wrap: anywhere; }
.class-heading-detail .class-heading-detail-description { max-width: 60ch; margin: 17px 0 0; color: #526b59; font-size: 14px; line-height: 1.6; }
.class-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.class-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr)); gap: 20px; margin-bottom: 32px; }
.class-card { min-width: 0; padding: 26px; border: 1px solid var(--line); border-radius: 24px; background: var(--paper); box-shadow: 0 8px 28px rgba(14, 43, 29, .045); overflow-wrap: anywhere; }
.class-card h2 { margin: 15px 0 10px; color: var(--forest-deep); font-size: 21px; }
.class-card p { font-size: 14px; }
.class-empty { background: linear-gradient(135deg, #f4f7ee, #fffdf7); }
.class-section-title { margin: 26px 0 16px; font-size: 18px; color: var(--forest-deep); }
.class-stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0; color: #526b59; font-size: 13px; font-weight: 650; }
.class-stats span { padding: 9px 12px; border-radius: 10px; background: #f2f6f1; }
.class-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.class-overview-card { position: relative; display: flex; flex-direction: column; gap: 20px; min-height: 255px; padding: 24px; background: linear-gradient(145deg, #fff, #fbfcf8); border-color: #dfe9dc; box-shadow: 0 12px 32px rgba(14, 43, 29, .065); overflow: hidden; }
.class-overview-card::before { content: ""; position: absolute; top: 0; left: 24px; width: 88px; height: 4px; border-radius: 0 0 8px 8px; background: linear-gradient(90deg, var(--forest), var(--gold)); }
.class-overview-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.class-overview-icon { display: grid; place-items: center; width: 46px; height: 46px; flex: 0 0 46px; border-radius: 14px; color: var(--forest); background: #eaf3e9; font: 31px/1 Georgia, serif; }
.class-overview-copy { flex: 1; min-width: 0; }
.class-overview-copy .class-overview-kicker { margin: 0 0 4px; color: #718477; font-size: 11px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.class-overview-card h3 { margin: 0 0 7px; color: var(--forest-deep); font-size: clamp(21px, 2vw, 25px); line-height: 1.2; letter-spacing: -.035em; }
.class-overview-copy .class-overview-teacher { margin: 0 0 8px; color: #526b59; font-size: 13px; line-height: 1.45; }
.class-overview-teacher strong { color: var(--forest-deep); font-weight: 750; }
.class-overview-copy > p:last-child { margin: 0; font-size: 13px; line-height: 1.5; }
.class-overview-footer { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; padding-top: 17px; border-top: 1px solid #e7eee5; }
.class-overview-stats { display: flex; flex-wrap: wrap; gap: 7px; color: #526b59; font-size: 12px; font-weight: 650; }
.class-overview-stats span { padding: 8px 10px; border-radius: 10px; background: #f0f5ef; white-space: nowrap; }
.class-overview-stats strong { color: var(--forest-deep); font-size: 14px; }
.class-overview-stats .has-pending { color: #725316; background: #fff3dc; }
.class-overview-action { min-height: 42px; padding: 0 15px; gap: 8px; font-size: 13px; white-space: nowrap; }
.class-overview-action-icon { display: grid; place-items: center; flex: 0 0 26px; width: 26px; height: 26px; border-radius: 8px; background: rgba(255,255,255,.18); }
.class-overview-action-icon svg { display: block; width: 17px; height: 17px; fill: currentColor; }
.class-badge { display: inline-flex; align-items: center; padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; background: #edf2e9; color: var(--forest); font-size: 12px; font-weight: 700; white-space: nowrap; }
.class-badge-pending { background: #fff3d9; border-color: #e8d6ac; color: #725316; }
.class-badge-active { background: #e2efdf; }
.class-badge-rejected { background: #f8e6e3; color: #863f38; }
.class-management { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 24px; align-items: start; }
.class-invite { display: grid; gap: 14px; background: linear-gradient(155deg, #f9f5e9, var(--paper)); border-color: #e7e1d1; }
.class-invite p, .class-invite h2 { margin: 0; }
.class-invite .class-badge { justify-self: start; }
.class-admissions-status-open { background: #e2efdf; border-color: #c9ddc8; }
.class-admissions-status-closed { background: #fff3dc; border-color: #e8d6ac; color: #725316; }
.class-admissions-form { margin: 0; }
.class-admissions-button { width: 100%; min-height: 46px; font-size: 14px; }
.class-admissions-button-close { border: 1px solid #e7d6b4; background: #fff3dd; color: #754f15; }
.class-admissions-button-close:hover { background: #ffeac5; box-shadow: 0 5px 12px rgba(117, 79, 21, .12); }
.class-admissions-button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.class-invite summary { cursor: pointer; color: var(--forest); font-size: 13px; font-weight: 700; }
.class-invite details p { margin: 12px 0; }
.class-code { padding: 18px 10px; border: 1px dashed var(--sage); border-radius: 12px; background: var(--paper); text-align: center; font: 800 24px/1.2 ui-monospace, monospace; letter-spacing: .08em; color: var(--forest); user-select: all; }
.class-text-button { padding: 0; border: 0; background: none; color: var(--forest); text-decoration: underline; cursor: pointer; font-size: 13px; }
.class-roster { display: grid; gap: 24px; min-width: 0; }
.class-search-form { display: flex; align-items: flex-end; gap: 12px; margin-block: 18px; }
.class-search-form .form-field { flex: 1; min-width: 0; }
#student-search { scroll-margin-top: 20px; }
.class-section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.class-section-heading h2 { margin: 0; }
.class-person { display: flex; justify-content: space-between; align-items: center; gap: 16px; border: 1px solid #e8eee6; border-radius: 14px; background: #f7faf5; padding: 15px; margin-top: 10px; }
.class-person > div { min-width: 0; }
.class-person strong { color: var(--forest-deep); font-size: 14px; }
.class-person small { display: block; color: #68736b; margin-top: 5px; font-size: 12px; }
.button-small { min-height: 38px; padding: 0 13px; font-size: 12px; }
.class-person .class-actions { flex-shrink: 0; }
.class-status-card { max-width: 700px; }
.class-copy-feedback { color: var(--forest); font-size: 12px; }
.class-copy-feedback:empty { display: none; }
.class-page textarea { width: 100%; resize: vertical; padding: 12px 14px; border: 1px solid #cfd8ce; border-radius: 9px; background: #fffefb; color: var(--ink); font: inherit; }
.class-page :is(a, button, summary, textarea):focus-visible { outline: 3px solid var(--forest); outline-offset: 3px; }
@media (max-width: 850px) {
    .class-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
    .class-overview-grid { grid-template-columns: 1fr; }
    .class-management { grid-template-columns: 1fr; }
    .class-invite { max-width: 100%; }
}
@media (max-width: 620px) {
    .class-page { padding-top: 26px; }
    .class-card { padding: 20px; }
    .class-overview-card { min-height: 0; gap: 17px; }
    .class-overview-card::before { left: 20px; }
    .class-overview-footer { align-items: stretch; flex-direction: column; }
    .class-overview-action { align-self: stretch; }
    .class-heading { padding: 22px; border-radius: 20px; }
    .class-person { align-items: flex-start; flex-direction: column; }
    .class-search-form { align-items: stretch; flex-direction: column; }
}

.site-footer {
    min-height: 88px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    color: #6b776e;
    border-top: 1px solid var(--line);
    font-size: 13px;
}

@media (max-width: 850px) {
    .hero,
    .auth-layout {
        grid-template-columns: 1fr;
    }

    .hero {
        padding-top: 58px;
    }

    .board-preview {
        width: min(100%, 580px);
        margin-inline: auto;
    }

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

    .auth-layout {
        gap: 42px;
    }

    .auth-intro {
        text-align: center;
    }

    .auth-intro > p:not(.eyebrow) {
        margin-inline: auto;
    }
}

@media (max-width: 620px) {
    .site-header,
    .site-footer,
    .site-main,
    .message-stack {
        width: min(100% - 26px, 1180px);
    }

    .site-header {
        min-height: 76px;
        padding: 10px 12px;
        margin-top: 10px;
        gap: 12px;
    }

    .site-nav {
        gap: 11px;
    }

    .site-nav > a:first-child,
    .chess-profile-copy {
        display: none;
    }

    .brand-mark {
        width: 40px;
        height: 40px;
        font-size: 26px;
    }

    .brand strong {
        display: none;
    }

    .brand small {
        font-size: 18px;
    }

    .hero h1,
    .auth-intro h1 {
        font-size: 40px;
    }

    .hero {
        gap: 44px;
    }

    .hero-text,
    .auth-intro > p:not(.eyebrow) {
        font-size: 16px;
    }

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

    .board-grid span {
        font-size: 25px;
    }

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

    .auth-card {
        padding: 25px 20px;
        border-radius: 16px;
    }

    .piece-line {
        font-size: 30px;
    }

    .site-footer {
        flex-direction: column;
        justify-content: center;
        text-align: center;
    }
}

/* Shared interaction details across home, account and classroom screens. */
.button:focus-visible, .nav-button:focus-visible, .quiet-link:focus-visible {
    outline: 3px solid var(--forest);
    outline-offset: 3px;
}
.button-secondary:hover { background: #e2eee2; border-color: #b7ceb9; }
.button-primary:hover { box-shadow: 0 8px 18px rgba(24,63,44,.2); }
.site-nav > a:not(.nav-button) { padding: 10px 12px; border-radius: 12px; }
.site-nav > a:not(.nav-button):hover { background: #edf5ee; }
.message { border-radius: 14px; padding: 15px 18px; box-shadow: 0 4px 14px rgba(34,72,51,.035); }
.message + .message { margin-top: 8px; }
.feature-number { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: #76602b; background: #faf0d9; }
.feature-card { box-shadow: 0 8px 28px rgba(14,43,29,.04); }
.class-section-heading h2 { font-size: 19px; letter-spacing: -.025em; }
.class-page textarea { border-radius: 13px; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
    .button:hover:not(:disabled), .nav-button:hover { transform: none; }
}

/* Assignments and exercise player */
.assignment-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.assignment-settings { position: sticky; top: 20px; display: grid; gap: 18px; }
.assignment-settings h2, .assignment-category h2, .assignment-topic h3 { margin: 0; color: var(--forest-deep); }
.assignment-target { margin: 0; padding: 0; border: 0; }
.assignment-target legend { margin-bottom: 8px; color: var(--forest-deep); font-size: 13px; font-weight: 750; }
.assignment-target ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.assignment-target label { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.assignment-target input { accent-color: var(--forest); }
.assignment-settings select { width: 100%; min-height: 48px; padding: 0 12px; border: 1px solid #cfd8ce; border-radius: 13px; background: #fff; }
.assignment-selection { margin: 0; padding: 12px; border-radius: 12px; background: #edf5ee; color: var(--forest); font-weight: 750; text-align: center; }
.assignment-catalogue { display: grid; gap: 20px; }
.assignment-category > p { margin-top: 4px; }
.assignment-topic { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.assignment-topic-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.assignment-topic-heading p { margin: 4px 0 0; }
.assignment-exercises { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 10px; margin-top: 14px; }
.assignment-exercise { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 12px; min-height: 112px; padding: 16px; border: 1px solid #dfe9dd; border-radius: 16px; background: #f9fbf7; cursor: pointer; }
.assignment-exercise:has(input:checked) { border-color: #72a383; background: #edf6ed; box-shadow: 0 0 0 2px rgba(40,100,72,.08); }
.assignment-exercise input { margin-top: 3px; accent-color: var(--forest); }
.assignment-exercise strong, .assignment-exercise small, .assignment-exercise em { display: block; }
.assignment-exercise strong { color: var(--forest-deep); font-size: 14px; }
.assignment-exercise small { margin-top: 6px; color: #627067; line-height: 1.45; }
.assignment-exercise em { margin-top: 7px; color: #86651e; font-size: 11px; font-style: normal; font-weight: 700; }
.assignment-exercise b { grid-column: 2; align-self: end; color: var(--forest); font-size: 11px; }
.assignment-list { display: grid; gap: 14px; }
.assignment-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.assignment-row h2 { margin-top: 12px; }
.assignment-row p { margin-bottom: 5px; }
.assignment-row small { color: #66736a; }
.assignment-total { display: grid; gap: 6px; flex: 0 0 auto; text-align: right; }
.assignment-total strong, .score-line strong { color: var(--forest); font-size: 22px; }
.assignment-total span, .score-line span { color: #627067; font-size: 12px; }
.score-line { display: flex; align-items: baseline; gap: 6px; margin: 12px 0 18px; }
.results-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 20px; background: #fff; }
.results-table { width: 100%; border-collapse: collapse; min-width: 780px; }
.results-table th, .results-table td { padding: 18px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.results-table th { background: #edf5ee; color: var(--forest-deep); font-size: 13px; text-transform: uppercase; letter-spacing: .045em; }
.results-table tbody > tr:not(.result-detail-row) > td { font-size: 14px; }
.results-table tbody > tr:not(.result-detail-row) > td:first-child strong { font-size: 16px; }
.results-table .class-badge { padding: 7px 12px; font-size: 13px; }
.results-table a { color: var(--forest-deep); text-decoration: none; }
.results-table small { display: block; margin-top: 4px; color: #65736a; font-size: 12.5px; line-height: 1.45; }
.result-chip { display: inline-flex; padding: 7px 10px; margin: 2px; border-radius: 10px; background: #f2f3ef; color: #6b756d; font-size: 12.5px; }
.result-chip.result-complete { background: #e1f0df; color: var(--forest); font-weight: 750; }
.result-score-value { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.result-score-value > strong { color: var(--forest-deep); font-size: 17px; }
.result-score-info-button { display: inline-grid; place-items: center; width: 26px; height: 26px; flex: 0 0 26px; padding: 0; border: 1px solid #b7d0bc; border-radius: 50%; background: #f2f8f1; color: var(--forest); cursor: pointer; font-size: 14px; font-weight: 800; line-height: 1; }
.result-score-info-button:hover { border-color: var(--forest); background: #e2f0e2; }
.result-score-info-button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.result-score-popover { position: fixed; inset: auto; width: min(290px, calc(100vw - 24px)); margin: 0; padding: 18px; border: 1px solid #d0e2ce; border-radius: 16px; background: #fffefb; color: var(--forest-deep); box-shadow: 0 18px 45px rgba(14, 43, 29, .2); font-size: 13px; }
.result-score-popover-title { display: block; margin-bottom: 12px; font-size: 15px; }
.result-score-popover > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid #edf1e9; }
.result-score-popover > div span { color: #526057; }
.result-score-popover > div strong { white-space: nowrap; }
.result-score-popover p { margin: 10px 0 0; color: #68766d; line-height: 1.45; }
.result-detail-row td { padding-top: 0; padding-bottom: 18px; background: #fbfcfa; }
.result-breakdown summary { padding: 10px 12px; border-radius: 10px; background: #eef5ed; color: var(--forest); cursor: pointer; font-size: 14px; font-weight: 750; }
.result-breakdown summary:hover { background: #e4f0e3; }
.result-breakdown summary:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.result-breakdown > div { display: flex; justify-content: space-between; gap: 18px; padding: 14px 6px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.5; }
.result-breakdown > div:first-of-type { margin-top: 10px; }
.result-breakdown-main { display: grid; gap: 4px; min-width: 0; }
.result-breakdown-main strong { color: var(--forest-deep); font-size: 14px; }
.result-breakdown-main small { color: #627067; font-size: 12.5px; line-height: 1.45; }
.result-breakdown-preview { display: inline-flex; align-items: center; justify-self: start; gap: 6px; margin-top: 3px; padding: 5px 9px; border: 1px solid #cfdfce; border-radius: 9px; background: #edf5ec; color: var(--forest); font-size: 12.5px; font-weight: 750; text-decoration: none; transition: background 160ms ease, border-color 160ms ease; }
.result-breakdown-preview:hover { border-color: #a9c9a9; background: #e2f0e0; }
.result-breakdown-preview:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.result-breakdown-preview svg { display: block; width: 15px; height: 15px; fill: currentColor; }
.result-breakdown-unavailable { color: #718078; font-size: 12.5px; }
.result-breakdown-score { color: #52685a; font-size: 13px; text-align: right; }
@media (max-width: 620px) {
    .result-breakdown-item { flex-direction: column; gap: 5px !important; }
    .result-breakdown-score { text-align: left; }
}
.exercise-player { width: min(1080px, 100%); min-height: calc(100vh - 176px); margin-inline: auto; padding: 42px 0 70px; display: grid; grid-template-columns: minmax(280px, .72fr) minmax(360px, 1fr); gap: clamp(30px, 6vw, 72px); align-items: center; }
.exercise-copy h1 { margin: 0; color: var(--forest-deep); font-size: clamp(34px, 4vw, 52px); letter-spacing: -.04em; }
.exercise-copy > p:not(.eyebrow) { color: #526057; font-size: 17px; line-height: 1.7; }
.exercise-score { display: flex; justify-content: space-between; gap: 18px; margin-top: 24px; padding: 16px; border-radius: 15px; background: #e8f2e8; color: var(--forest); }
.exercise-feedback { min-height: 30px; padding: 14px 16px; border-left: 4px solid var(--gold); background: #fff9e9; border-radius: 0 12px 12px 0; font-size: 14px !important; }
.exercise-board-wrap { padding: clamp(12px, 2vw, 20px); border-radius: 25px; background: var(--forest-deep); box-shadow: var(--shadow); }
.exercise-board { display: grid; grid-template-columns: repeat(8, 1fr); aspect-ratio: 1; overflow: hidden; border-radius: 8px; }
.exercise-square { position: relative; display: grid; place-items: center; aspect-ratio: 1; padding: 0; border: 0; cursor: pointer; }
.exercise-square.light { background: #ebdfc4; }
.exercise-square.dark { background: #8eaa95; }
.exercise-square.selected { box-shadow: inset 0 0 0 5px #f2c85c; }
.exercise-piece, .exercise-target { position: absolute; display: grid; place-items: center; line-height: 1; }
.exercise-piece { z-index: 2; color: #fffdf7; font-family: Georgia, serif; font-size: clamp(29px, 5vw, 55px); text-shadow: 0 2px 4px rgba(0,0,0,.42); }
.exercise-piece-black { color: #14241d; text-shadow: 0 1px 2px rgba(255,255,255,.45); }
.exercise-continue { margin-top: .75rem; }
.exercise-continue[hidden] { display: none; }
.exercise-square.can-move:has(.exercise-piece-black) { box-shadow: inset 0 0 0 4px #f2c85c; }
.exercise-target { z-index: 1; color: #f2c85c; font-size: clamp(18px, 3vw, 32px); text-shadow: 0 1px 2px rgba(0,0,0,.3); }
.exercise-target.capture { color: #222; font-family: Georgia, serif; font-size: clamp(25px, 4.5vw, 48px); }
.exercise-square:focus-visible { z-index: 3; outline: 4px solid #f2c85c; outline-offset: -4px; }
@media (max-width: 850px) {
    .assignment-layout, .exercise-player { grid-template-columns: 1fr; }
    .assignment-settings { position: static; }
    .exercise-player { padding-top: 28px; }
    .exercise-board-wrap { width: min(100%, 640px); margin-inline: auto; }
}
@media (max-width: 620px) {
    .assignment-row { align-items: flex-start; flex-direction: column; }
    .assignment-row .button, .assignment-row form, .assignment-row form .button { width: 100%; }
    .assignment-total { width: 100%; text-align: left; }
    .assignment-topic-heading { align-items: flex-start; flex-direction: column; }
    .exercise-player { padding-bottom: 40px; }
}

/* Assignment journey: soft cards, visible progress and a quieter chess accent. */
.assignment-page { max-width: 1120px; margin-inline: auto; }
.assignment-hero { overflow: hidden; background: radial-gradient(circle at 95% 10%, #f7e9c8, transparent 38%), linear-gradient(125deg, #e5f0e5, #f7f9f0); box-shadow: 0 12px 30px rgba(23, 61, 42, .045); }
.assignment-hero > div:first-child { position: relative; z-index: 1; }
.assignment-hero-piece { position: absolute; right: 28px; bottom: -43px; color: rgba(40, 100, 72, .13); font-family: Georgia, serif; font-size: 180px; line-height: 1; pointer-events: none; }
.assignment-hero-stat { position: relative; z-index: 1; display: grid; flex: 0 0 auto; min-width: 126px; gap: 3px; padding: 18px 20px; border: 1px solid rgba(40,100,72,.12); border-radius: 18px; background: rgba(255,255,255,.75); text-align: center; }
.assignment-hero-stat strong { color: var(--forest-deep); font-size: 22px; }
.assignment-hero-stat span { color: #6a766d; font-size: 12px; }
.assignment-section-heading { display: flex; justify-content: space-between; align-items: end; margin: 30px 0 16px; }
.assignment-section-heading .eyebrow { margin: 0 0 5px; }
.assignment-section-heading h2 { margin: 0; color: var(--forest-deep); font-size: clamp(20px, 2vw, 25px); letter-spacing: -.025em; }
.assignment-card { display: flex; flex-direction: column; align-items: flex-start; min-height: 235px; border-color: #dce8db; transition: transform .2s ease, box-shadow .2s ease; }
.assignment-card:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(14,43,29,.09); }
.assignment-card h3 { margin: 16px 0 3px; color: var(--forest-deep); font-size: 22px; letter-spacing: -.025em; }
.assignment-card p { margin: 4px 0 18px; }
.assignment-card > .button { margin-top: auto; }
.assignment-card-progress { width: 100%; margin: auto 0 18px; }
.assignment-card-progress > div { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; color: #607166; font-size: 12px; }
.assignment-card-progress strong { color: var(--forest-deep); }
.assignment-card-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; padding-top: 16px; border-top: 1px solid var(--line); color: #647168; font-size: 13px; }
.assignment-card-footer strong { color: var(--forest); font-size: 21px; }
progress { appearance: none; display: block; width: 100%; height: 9px; overflow: hidden; border: 0; border-radius: 999px; background: #e5eee4; }
progress::-webkit-progress-bar { background: #e5eee4; border-radius: 999px; }
progress::-webkit-progress-value { background: linear-gradient(90deg, #72a883, #286448); border-radius: 999px; }
progress::-moz-progress-bar { background: linear-gradient(90deg, #72a883, #286448); border-radius: 999px; }
.assignment-summary-strip { display: flex; align-items: center; gap: 22px; margin: -5px 0 24px; padding: 17px 22px; border: 1px solid #dce8db; border-radius: 18px; background: #fff; box-shadow: 0 5px 20px rgba(14,43,29,.035); }
.assignment-summary-strip > div { display: grid; gap: 3px; flex: 0 0 auto; }
.assignment-summary-strip strong { color: var(--forest-deep); font-size: 18px; }
.assignment-summary-strip span:not(.class-badge) { color: #657169; font-size: 12px; }
.assignment-summary-strip progress { flex: 1; }
.assignment-row { border-color: #dce8db; transition: border-color .2s ease, box-shadow .2s ease; }
.assignment-row:hover { border-color: #bad0bc; box-shadow: 0 11px 30px rgba(14,43,29,.065); }
.assignment-row-main { display: flex; align-items: flex-start; gap: 17px; min-width: 0; }
.assignment-row-main h3 { margin: 11px 0 4px; color: var(--forest-deep); font-size: 19px; letter-spacing: -.02em; }
.assignment-row-main p { margin: 4px 0 8px; }
.assignment-step { display: grid; place-items: center; flex: 0 0 46px; width: 46px; height: 46px; border-radius: 15px; background: #edf3e9; color: var(--forest); font-size: 15px; font-weight: 800; }
.results-table-wrap { box-shadow: 0 10px 30px rgba(14,43,29,.045); }
.results-table tbody tr:not(.result-detail-row):hover { background: #fbfdf9; }
.results-table th { background: #eaf3e9; }
.result-progress-label { display: block; margin-bottom: 8px; color: var(--forest-deep); font-size: 16px; font-weight: 750; }
.results-table progress { width: 135px; height: 10px; }
.assignment-settings { box-shadow: 0 14px 34px rgba(14,43,29,.065); }
.assignment-exercise { transition: border-color .2s ease, background-color .2s ease, transform .2s ease; }
.assignment-exercise:hover { transform: translateY(-2px); border-color: #a8c5a9; background: #f4f9f1; }

/* Clear move affordances with a small animation and opt-in browser audio. */
.exercise-player { gap: clamp(24px, 5vw, 58px); }
.exercise-copy .eyebrow { margin: 20px 0 10px; }
.exercise-copy h1 { font-family: Georgia, serif; font-weight: 700; }
.exercise-topic { display: inline-block; margin: 12px 0 2px !important; padding: 5px 11px; border-radius: 999px; background: #e8f1e6; color: var(--forest) !important; font-size: 12px !important; font-weight: 700; }
.exercise-instruction { margin: 12px 0 0; }
.exercise-score { align-items: center; border: 1px solid #d3e5d3; border-radius: 18px; }
.exercise-score strong { font-size: 21px; }
.exercise-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; color: #5d6b61; font-size: 13px; font-weight: 700; }
.exercise-sound-toggle { min-height: 38px; padding: 6px 12px; border: 1px solid #cfdecd; border-radius: 999px; background: #fff; color: var(--forest); cursor: pointer; font-size: 12px; font-weight: 750; }
.exercise-sound-toggle:hover { background: #edf5ea; }
.exercise-sound-toggle:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.exercise-feedback { margin-top: 18px; border-left-color: var(--gold); }
.exercise-feedback a { color: var(--forest); font-weight: 800; text-underline-offset: 3px; }
.exercise-completed .exercise-feedback { border-left-color: #6aa77b; background: #eaf7ea; }
.exercise-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; color: #68766d; font-size: 12px; }
.exercise-legend-dot { width: 13px; height: 13px; border-radius: 50%; background: #fff7cc; box-shadow: 0 0 0 2px #569568; }
.exercise-legend-star { margin-left: 12px; color: #c7962d; font-size: 18px; }
.exercise-board-wrap { border: 5px solid #27513a; background: var(--forest-deep); box-shadow: 0 24px 55px rgba(10,42,25,.18); }
.exercise-board { border: 2px solid rgba(255,255,255,.32); border-radius: 11px; }
.exercise-square { touch-action: manipulation; transition: filter .15s ease; }
.exercise-square.can-move:hover { filter: brightness(1.13); }
.exercise-square.can-move:active { filter: brightness(1.22); }
.exercise-square.can-move:has(.exercise-target) { box-shadow: inset 0 0 0 4px #f3d56f; }
.exercise-square.selected { box-shadow: inset 0 0 0 5px #f2c85c; }
.exercise-square.piece-square { cursor: pointer; }
.exercise-square.can-select { box-shadow: inset 0 0 0 3px rgba(245, 211, 105, .85); }
.exercise-square:not(.can-move):not(.piece-square) { cursor: default; }
.exercise-square:disabled { cursor: default; }
.exercise-move-hint { position: absolute; z-index: 1; width: 26%; aspect-ratio: 1; border-radius: 50%; background: rgba(255,249,210,.82); box-shadow: 0 0 0 3px rgba(31,99,59,.4), 0 2px 7px rgba(0,0,0,.12); pointer-events: none; }
.exercise-square.dark .exercise-move-hint { background: rgba(255,249,210,.88); }
.exercise-piece-flight { position: fixed; z-index: 1000; display: grid; place-items: center; margin: 0; pointer-events: none; }
.exercise-feedback-action { padding: 0; border: 0; background: none; color: var(--forest); cursor: pointer; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.exercise-complete-dialog { width: min(440px, calc(100% - 32px)); max-height: calc(100vh - 48px); padding: 32px; border: 1px solid #cddfcb; border-radius: 28px; background: radial-gradient(circle at 95% 0%, #fff4d9, transparent 48%), #fffefb; color: var(--forest-deep); box-shadow: 0 28px 90px rgba(8, 34, 22, .26); text-align: center; }
.exercise-complete-dialog::backdrop { background: rgba(7, 31, 20, .64); backdrop-filter: blur(4px); }
.exercise-complete-dialog .eyebrow { margin: 12px 0 6px; }
.exercise-complete-dialog h2 { margin: 0 0 12px; font-family: Georgia, serif; font-size: clamp(28px, 5vw, 34px); letter-spacing: -.035em; }
.exercise-complete-dialog p:not(.eyebrow) { color: #59675e; font-size: 14px; line-height: 1.55; }
.exercise-complete-dialog p strong { color: var(--forest); font-size: 20px; }
.exercise-complete-icon { display: grid; place-items: center; width: 68px; height: 68px; margin: 0 auto; border-radius: 22px; background: #e7f2e5; color: var(--forest); font-family: Georgia, serif; font-size: 42px; }
.exercise-dialog-close { position: absolute; top: 14px; right: 16px; display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; background: #edf3ea; color: var(--forest-deep); cursor: pointer; font-size: 24px; line-height: 1; }
.exercise-dialog-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }
.exercise-dialog-actions form { margin: 0; }
.exercise-dialog-actions .button { min-height: 46px; }
.exercise-dialog-actions .exercise-next-button { gap: 10px; padding-right: 11px; padding-left: 20px; }
.exercise-next-icon { display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px; border-radius: 9px; background: rgba(255,255,255,.18); }
.exercise-next-icon svg { display: block; width: 17px; height: 17px; fill: currentColor; }
.exercise-complete-dialog .exercise-dialog-end { margin: 18px 0 0; font-size: 12px !important; }
.exercise-promotion-dialog { width: min(420px, calc(100% - 32px)); padding: 28px; border: 1px solid #cddfcb; border-radius: 25px; background: #fffefb; color: var(--forest-deep); box-shadow: 0 28px 90px rgba(8, 34, 22, .26); text-align: center; }
.exercise-promotion-dialog::backdrop { background: rgba(7, 31, 20, .64); backdrop-filter: blur(4px); }
.exercise-promotion-dialog h2 { margin: 8px 0 23px; font-family: Georgia, serif; font-size: 26px; }
.exercise-promotion-choices { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.exercise-promotion-choices button { display: grid; place-items: center; min-height: 94px; padding: 8px 4px; border: 1px solid #d5e4d3; border-radius: 15px; background: #eff6ed; color: var(--forest); cursor: pointer; font-family: Georgia, serif; font-size: 43px; line-height: 1; }
.exercise-promotion-choices button:hover { border-color: #6da47a; background: #e3f1e1; }
.exercise-promotion-choices span { font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 12px; font-weight: 750; }
.exercise-promotion-cancel { margin-top: 20px; padding: 7px 15px; border: 0; border-radius: 999px; background: transparent; color: #69766b; cursor: pointer; font-size: 13px; font-weight: 700; }
.exercise-promotion-cancel:hover { background: #edf3ea; }
@media (max-width: 850px) {
    .exercise-player { align-items: start; }
    .exercise-copy { max-width: 640px; margin-inline: auto; }
}
@media (max-width: 620px) {
    .assignment-hero-piece { right: 0; font-size: 140px; }
    .assignment-hero-stat { min-width: 0; }
    .assignment-card-footer { flex-wrap: wrap; }
    .assignment-card-footer .button { width: 100%; }
    .assignment-summary-strip { flex-wrap: wrap; gap: 12px; }
    .assignment-summary-strip progress { order: 3; flex-basis: 100%; }
    .assignment-summary-strip .class-badge { margin-left: auto; }
    .exercise-board-wrap { padding: 8px; border-width: 3px; }
    .exercise-piece { font-size: clamp(27px, 8vw, 48px); }
    .exercise-target.capture { font-size: clamp(24px, 7vw, 44px); }
    .exercise-complete-dialog { padding: 28px 19px; }
    .exercise-dialog-actions, .exercise-dialog-actions form, .exercise-dialog-actions .button { width: 100%; }
    .exercise-promotion-dialog { padding: 24px 14px; }
    .exercise-promotion-choices { gap: 5px; }
    .exercise-promotion-choices button { min-height: 83px; font-size: 37px; }
}

/* Teacher-only exercise library and stateless preview. */
.library-page { max-width: 1180px; margin-inline: auto; }
.library-hero { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 32px; overflow: hidden; padding: clamp(26px, 4vw, 42px); border: 1px solid #d9e8d7; border-radius: 28px; background: radial-gradient(circle at 92% 10%, #faefd5, transparent 42%), linear-gradient(120deg, #e9f3e8, #f9fbf4); box-shadow: 0 14px 35px rgba(14,43,29,.055); }
.library-hero::after { content: "♞"; position: absolute; right: 15%; bottom: -83px; color: rgba(40,100,72,.075); font-family: Georgia, serif; font-size: 230px; line-height: 1; pointer-events: none; }
.library-hero-copy, .library-hero-stats { position: relative; z-index: 1; }
.library-hero-copy { max-width: 640px; }
.library-hero h1 { margin: 0; color: var(--forest-deep); font-size: clamp(31px, 4vw, 46px); font-weight: 800; letter-spacing: -.04em; line-height: 1.12; }
.library-hero-copy > p:not(.eyebrow) { margin: 15px 0 17px; color: #526057; font-size: 16px; line-height: 1.6; }
.library-hero-note { display: inline-flex; padding: 8px 12px; border: 1px solid #d6e5d2; border-radius: 999px; background: rgba(255,255,255,.72); color: var(--forest); font-size: 12px; font-weight: 750; }
.library-hero-stats { display: grid; grid-template-columns: repeat(3, minmax(82px, 1fr)); gap: 9px; flex: 0 0 auto; }
.library-hero-stats > div { display: grid; place-items: center; gap: 2px; min-height: 92px; padding: 12px; border: 1px solid #d9e6d7; border-radius: 17px; background: rgba(255,255,255,.82); }
.library-hero-stats strong { color: var(--forest-deep); font-size: 25px; line-height: 1; }
.library-hero-stats span { color: #637268; font-size: 12px; }
.library-category-nav { display: flex; gap: 10px; overflow-x: auto; margin: 24px 0 36px; padding: 2px 2px 10px; scrollbar-width: thin; }
.library-category-nav a { flex: 0 0 auto; padding: 10px 15px; border: 1px solid #d6e4d4; border-radius: 999px; background: #fff; color: var(--forest); font-size: 13px; font-weight: 750; text-decoration: none; transition: border-color 160ms ease, background 160ms ease; }
.library-category-nav a:hover { border-color: #9ebda1; background: #edf5eb; }
.library-category-nav a:focus-visible, .library-topic-link:focus-visible, .library-try-button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.library-section { margin: 0 0 42px; scroll-margin-top: 20px; }
.library-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.library-section-heading .eyebrow { margin-bottom: 6px; }
.library-section-heading h2 { margin: 0; color: var(--forest-deep); font-size: clamp(23px, 3vw, 30px); letter-spacing: -.035em; }
.library-section-heading p:last-child { margin: 7px 0 0; color: #647168; font-size: 14px; }
.library-section-heading > span { flex: 0 0 auto; padding: 7px 11px; border-radius: 999px; background: #e8f2e6; color: var(--forest); font-size: 12px; font-weight: 750; }
.library-topic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.library-topic { min-width: 0; border: 1px solid #dce8db; border-radius: 19px; background: #fff; box-shadow: 0 8px 24px rgba(14,43,29,.045); scroll-margin-top: 20px; transition: border-color 160ms ease, box-shadow 160ms ease; }
.library-topic:hover { border-color: #adcbaa; box-shadow: 0 12px 30px rgba(14,43,29,.08); }
.library-topic-link { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto 22px; align-items: center; gap: 13px; min-height: 94px; padding: 17px; border-radius: inherit; color: var(--forest-deep); text-decoration: none; }
.library-topic-link::after { content: "→"; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #ecf4e9; color: var(--forest); font-size: 16px; line-height: 1; transition: transform 160ms ease, background 160ms ease; }
.library-topic-link:hover::after { transform: translateX(2px); background: #dcebdc; }
.library-topic-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: linear-gradient(145deg, #e2f0df, #f2f7e9); color: var(--forest); font-size: 17px; font-weight: 800; }
.library-topic-copy { display: grid; gap: 4px; min-width: 0; }
.library-topic-copy strong { font-size: 17px; line-height: 1.25; }
.library-topic-copy small { color: #68766d; font-size: 12px; line-height: 1.4; }
.library-topic-count { color: #5f7466; font-size: 12px; font-weight: 750; white-space: nowrap; }
.library-topic-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: clamp(26px, 4vw, 40px); border: 1px solid #d9e8d7; border-radius: 27px; background: radial-gradient(circle at 95% 0%, #fbefd4, transparent 38%), linear-gradient(120deg, #e8f2e7, #f8faf2); box-shadow: 0 12px 30px rgba(14,43,29,.05); }
.library-topic-hero .eyebrow { margin-bottom: 9px; }
.library-topic-hero h1 { margin: 0; color: var(--forest-deep); font-size: clamp(32px, 4vw, 46px); letter-spacing: -.04em; }
.library-topic-hero p:last-child { margin: 10px 0 0; color: #526057; font-size: 16px; }
.library-topic-hero-count { display: grid; place-items: center; gap: 4px; flex: 0 0 auto; min-width: 112px; padding: 17px 20px; border: 1px solid #d9e6d7; border-radius: 18px; background: rgba(255,255,255,.82); color: #5f7466; font-size: 13px; }
.library-topic-hero-count strong { color: var(--forest-deep); font-size: 27px; line-height: 1; }
.library-topic-intro { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 34px 0 16px; }
.library-topic-intro .eyebrow { margin-bottom: 5px; }
.library-topic-intro h2 { margin: 0; color: var(--forest-deep); font-size: 23px; }
.library-topic-intro > p { margin: 0; color: #627067; font-size: 13px; }
.library-exercise-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.library-exercise { display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: start; gap: 13px; min-width: 0; padding: 20px; border: 1px solid #dce8db; border-radius: 19px; background: #fff; box-shadow: 0 8px 24px rgba(14,43,29,.045); }
.library-stage-number { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: #e9f3e7; color: var(--forest); font-size: 14px; font-weight: 800; }
.library-exercise-copy { min-width: 0; }
.library-exercise-copy h3 { margin: 0; color: var(--forest-deep); font-size: 17px; }
.library-exercise-copy p { margin: 7px 0 9px; color: #607067; font-size: 14px; line-height: 1.5; }
.library-exercise-copy > span { color: #8a691f; font-size: 12px; font-weight: 750; }
.library-try-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; grid-column: 2; justify-self: start; min-height: 46px; margin-top: 5px; padding: 5px 17px 5px 6px; border: 1px solid #255b40; border-radius: 14px; background: linear-gradient(135deg, #347b58, #23563e); box-shadow: 0 5px 12px rgba(24,63,44,.16); color: #fff; font-size: 14px; font-weight: 800; text-decoration: none; white-space: nowrap; transition: background 160ms ease, box-shadow 160ms ease; }
.library-try-button:hover { background: linear-gradient(135deg, #3d8b64, #286448); box-shadow: 0 8px 18px rgba(24,63,44,.22); }
.library-try-icon { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.18); }
.library-try-icon svg { display: block; width: 18px; height: 18px; fill: currentColor; }
.library-preview-note { margin-top: 16px; padding: 12px 14px; border: 1px solid #ead9b4; border-radius: 13px; background: #fff8e9; color: #725515; font-size: 13px; line-height: 1.45; }
.exercise-preview .exercise-dialog-end { margin: 17px 0 0; }
@media (max-width: 940px) {
    .library-hero { align-items: stretch; flex-direction: column; }
    .library-hero-stats { align-self: start; }
    .library-topic-grid { grid-template-columns: 1fr; }
    .library-exercise-list { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
    .library-hero { padding: 24px 20px; }
    .library-hero-stats { width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .library-hero-stats > div { min-height: 72px; padding: 8px 4px; }
    .library-hero-stats strong { font-size: 21px; }
    .library-section-heading { align-items: start; flex-direction: column; gap: 9px; }
    .library-topic-link { grid-template-columns: 38px minmax(0, 1fr) 22px; gap: 10px; padding: 14px; }
    .library-topic-mark { width: 38px; height: 38px; }
    .library-topic-count { grid-column: 2; font-size: 11px; }
    .library-topic-link::after { grid-column: 3; grid-row: 1 / 3; }
    .library-topic-hero { align-items: start; flex-direction: column; }
    .library-topic-hero-count { min-width: 0; grid-auto-flow: column; gap: 7px; padding: 10px 14px; }
    .library-topic-hero-count strong { font-size: 21px; }
    .library-topic-intro { align-items: start; flex-direction: column; gap: 7px; }
    .library-exercise { padding: 17px; }
}
