:root {
    --bg: #f5ecdf;
    --panel: #fffaf4;
    --panel-soft: #fbf2e7;
    --line: #ead8c5;
    --line-strong: #d1ad8f;
    --ink: #2a2824;
    --muted: #74695f;
    --primary: #7b0d1e;/*b6663d*/
    --primary-deep: #7b0d1e;/*97502a*/
    --teal: #2d7c72;/*2d7c72*/
    --teal-soft: #e6f0eb;
    --success: #16815c;
    --danger: #b42318;
    --warning: #a65f00;
    --shadow: 0 20px 55px rgba(31, 55, 49, 0.1);
    --radius-lg: 8px;
    --radius-md: 6px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background:
        linear-gradient(180deg, #f8efe4 0%, #eadcc8 100%);
}

body.lingso-android-app {
    background: var(--panel);
}

.app-loading {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: grid;
    place-items: center;
    background: #f6eadb;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.app-loading.is-hidden {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.app-loading-card {
    display: grid;
    gap: 8px;
    min-width: 220px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel);
    box-shadow: var(--shadow);
    text-align: center;
}

.app-loading-card strong {
    color: var(--ink);
    font-size: 1.8rem;
    font-family: Georgia, "Times New Roman", serif;
}

.brand-so {
    color: var(--primary-deep);
}

.brand-word {
    font-weight: 800;
}

.app-loading-card strong,
.mock-sidebar strong,
.teacher-mini-header strong {
    font-weight: 800;
}

.app-loading-card > span {
    color: var(--muted);
    font-weight: 700;
}

.app-status-banner {
    position: fixed;
    right: 16px;
    bottom: 16px;
    left: 16px;
    z-index: 2500;
    max-width: 720px;
    margin: 0 auto;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fff8ec;
    color: var(--ink);
    box-shadow: var(--shadow);
    font-weight: 800;
    text-align: center;
    cursor: pointer;
}

.app-status-banner.is-hidden {
    display: none;
}

.app-status-banner.is-warning {
    border-color: #e7c17b;
    background: #fff3cf;
    color: #89520f;
}

.app-status-banner.is-error {
    border-color: #efb7aa;
    background: #fff0ee;
    color: #a33222;
}

.app-status-banner.is-success {
    border-color: #a8d8bd;
    background: #eefaf2;
    color: #146c4b;
}

body.lingso-android-app .app-status-banner {
    bottom: calc(92px + env(safe-area-inset-bottom));
}

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

button {
    border: 0;
    cursor: pointer;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

.app-shell {
    width: min(1320px, calc(100% - 28px));
    margin: 0 auto;
    padding: 28px 0 44px;
}

body.lingso-android-app .app-shell {
    width: 100%;
    min-height: 100vh;
    padding: 0 0 calc(84px + env(safe-area-inset-bottom));
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.quick-notes-widget {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1200;
    display: grid;
    gap: 10px;
    justify-items: end;
}

.quick-notes-toggle {
    position: relative;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border: 1px solid rgba(191, 107, 62, 0.28);
    border-radius: 999px;
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 16px 34px rgba(42, 40, 36, 0.2);
}

.quick-profile-link {
    background: var(--teal);
}

.quick-student-messages-link {
    background: #7a1022;
}

.quick-notes-toggle svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.quick-notes-panel {
    position: absolute;
    right: 0;
    bottom: 118px;
    display: grid;
    gap: 12px;
    width: min(360px, calc(100vw - 32px));
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel);
    box-shadow: 0 24px 60px rgba(42, 40, 36, 0.22);
}

.quick-notes-heading,
.quick-notes-drawing-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.quick-notes-heading-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.quick-notes-heading-actions .ghost-button {
    min-height: 34px;
    padding: 7px 10px;
}

.quick-notes-heading h3 {
    margin: 4px 0 0;
}

.quick-notes-panel textarea {
    min-height: 116px;
    resize: vertical;
}

.quick-notes-drawing-head span {
    color: var(--ink);
    font-weight: 800;
}

.quick-notes-drawing-head .ghost-button {
    min-height: 34px;
    padding: 7px 10px;
}

.quick-notes-canvas {
    width: 100%;
    height: 160px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #ffffff;
    cursor: crosshair;
    touch-action: none;
}

.quick-notes-toggle .unread-badge {
    position: absolute;
    top: -7px;
    right: -7px;
    margin: 0;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border: 2px solid var(--panel);
    font-size: 0.72rem;
}

.site-footer {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
    gap: 20px;
    align-items: center;
    padding: 28px 0 0;
}

.site-footer button {
    padding: 8px 12px;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--muted);
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.site-footer button:hover {
    color: var(--primary-deep);
    background: rgba(255, 250, 244, 0.65);
}

.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: max-content;
}

.footer-brand img {
    display: block;
    width: 92px;
    height: auto;
}

.footer-brand > span {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 0.72rem;
    text-align: center;
}

body.lingso-android-app .footer-brand {
    grid-column: 1 / -1;
    justify-self: center;
}

.site-footer nav,
.footer-legal {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
}

.site-footer nav {
    justify-content: center;
}

.footer-legal {
    justify-content: flex-end;
}

.site-footer .footer-legal a {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.site-footer a {
    color: var(--muted);
    font-weight: 800;
    text-decoration: none;
}

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

body.study-portal-active .site-footer .footer-marketing {
    display: none;
}

.footer-bug-report {
    display: none;
    justify-self: center;
}

body.study-portal-active .site-footer .footer-bug-report {
    display: inline-flex;
}

.bug-report-modal-panel {
    width: min(560px, calc(100vw - 28px));
}

.admin-bug-report-images {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.admin-bug-report-image {
    display: block;
    width: 140px;
    height: 100px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fffaf4;
}

.admin-bug-report-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.login-screen {
    min-height: calc(100vh - 56px);
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 430px);
    gap: 22px;
    align-items: start;
}

.login-copy {
    padding: 34px;
    align-self: center;
}

.login-copy h1 {
    max-width: 13ch;
    margin-bottom: 18px;
    font-size: clamp(2.2rem, 4.8vw, 4.8rem);
    line-height: 1;
}

.login-copy .eyebrow {
    margin: 0 0 14px;
    font-size: 1.8rem;
}

.login-copy p:last-child {
    max-width: 56ch;
    color: var(--muted);
    font-size: 1.08rem;
    line-height: 1.7;
}

.landing-nav,
.landing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.landing-nav {
    margin-bottom: 30px;
}

.landing-nav a {
    color: var(--primary-deep);
    font-weight: 800;
    text-decoration: none;
}

.landing-nav a:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.landing-actions {
    margin: 16px 0;
    max-width: 100%;
}

.landing-actions a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 0;
    max-width: 100%;
    line-height: 1.25;
    white-space: normal;
    text-align: center;
    text-decoration: none;
}

.landing-preview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    max-width: 620px;
    margin-top: 28px;
}

.landing-preview div,
.landing-section {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 250, 244, 0.82);
    box-shadow: var(--shadow);
}

.landing-preview div {
    padding: 16px;
}

.landing-preview span,
.landing-icon {
    display: block;
    color: var(--teal);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.landing-preview strong {
    display: block;
    margin-top: 8px;
    font-size: 1.45rem;
}

.landing-section {
    grid-column: 1 / -1;
    padding: 24px;
}

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

.landing-feature-grid article {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #fffaf4;
}

.landing-feature-grid h2,
.landing-split h2 {
    margin: 8px 0 10px;
}

.landing-feature-grid p,
.landing-split p,
.landing-checklist {
    color: var(--muted);
    line-height: 1.65;
}

.landing-split {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
    gap: 24px;
    align-items: start;
}

.landing-checklist {
    display: grid;
    gap: 10px;
    margin: 0;
    padding-left: 20px;
}

.login-screen {
    display: block;
    min-height: calc(100vh - 56px);
}

.landing-header {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto;
    gap: 24px;
    align-items: center;
    padding: 8px 0 14px;
}

.landing-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-self: start;
    color: var(--ink);
    text-decoration: none;
}

.landing-brand > img {
    display: block;
    width: 104px;
    height: auto;
}

.landing-brand small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.63rem;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
}

.landing-header .landing-nav {
    justify-content: flex-end;
    margin: 0;
}

.landing-header .landing-nav a {
    color: var(--ink);
    font-size: 0.92rem;
}

.landing-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
    gap: 42px;
    align-items: start;
    min-height: 0;
    padding: 16px 0 72px;
}

.landing-hero-copy {
    padding-left: 8%;
}

.landing-hero-copy h1,
.landing-section-copy h2,
.landing-audience-card h1,
.landing-cta h2 {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 500;
}

.landing-hero-copy h1 {
    max-width: 680px;
    margin: 10px 0 14px;
    font-size: 4.2rem;
    line-height: 1.05;
}

.landing-hero-copy .panel-kicker,
.landing-hero-copy > p:not(.panel-kicker) {
    margin: 0;
}

.landing-hero-copy em {
    color: var(--primary-deep);
    font-style: italic;
}

.landing-hero-copy > p:not(.panel-kicker),
.landing-section-copy p,
.landing-cta p {
    max-width: 560px;
    color: var(--muted);
    font-size: 1.08rem;
    line-height: 1.7;
}

.landing-hero-copy > p:not(.panel-kicker) {
    font-size: 1.22rem;
}

.landing-hero-copy .panel-kicker {
    margin-bottom: 10px;
}
 
.landing-device-stage {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 470px;
}

.landing-hero .auth-card {
    justify-self: end;
    width: min(100%, 460px);
    margin: 0;
}

@media (min-width: 701px) {
    .landing-hero-copy {
        align-self: end;
    }

    .landing-hero.is-registering .landing-hero-copy {
        align-self: start;
    }

    .landing-hero .landing-actions a {
        min-width: 190px;
        min-height: 50px;
        padding: 12px 20px;
    }
}

.landing-device-stage::before {
    content: "";
    position: absolute;
    width: min(560px, 90%);
    height: 410px;
    border-radius: 180px 8px 8px 180px;
    background: #bd6843;
    opacity: 0.95;
    transform: translate(24px, -10px);
}

.device {
    position: relative;
    z-index: 1;
}

.device.laptop {
    width: min(100%, 630px);
    padding: 16px 16px 22px;
    border-radius: 20px 20px 12px 12px;
    background: #202020;
    box-shadow: 0 24px 44px rgba(42, 40, 36, 0.22);
}

.device.laptop::after {
    content: "";
    position: absolute;
    left: -32px;
    right: -32px;
    bottom: -9px;
    height: 18px;
    border-radius: 0 0 22px 22px;
    background: linear-gradient(180deg, #d6d0c9, #8e8b88);
}

.device.phone {
    width: 172px;
    padding: 8px;
    border-radius: 22px;
    background: #171717;
    box-shadow: 0 18px 34px rgba(42, 40, 36, 0.2);
}

.device-screen {
    overflow: hidden;
    border-radius: 10px;
    background: var(--panel);
}

.device.phone .device-screen {
    border-radius: 16px;
}

.mock-app {
    display: grid;
    grid-template-columns: 132px 1fr;
    min-height: 350px;
    background: #fffaf4;
}

.mock-sidebar {
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 16px;
    border-right: 1px solid var(--line);
    background: #f8efe4;
}

.mock-sidebar strong {
    margin-bottom: 10px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.35rem;
    font-weight: 800;
}

.mock-sidebar > span {
    position: relative;
    padding: 7px 10px;
    border-radius: 6px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.mock-sidebar .active {
    background: #fffaf4;
    color: var(--primary-deep);
    box-shadow: inset 4px 0 0 var(--primary-deep);
}

.mock-dashboard {
    position: relative;
    padding: 30px;
}

.mock-dashboard h3 {
    margin-bottom: 28px;
    font-size: 1.65rem;
}

.mock-user {
    position: absolute;
    top: 18px;
    right: 22px;
    color: var(--ink);
    font-size: 0.78rem;
    font-weight: 800;
    text-align: right;
}

.mock-user small {
    color: var(--muted);
    font-weight: 700;
}

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

.mock-card-grid div {
    min-height: 86px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.mock-card-grid strong,
.mock-card-grid span {
    display: block;
}

.mock-card-grid span {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.86rem;
}

.mock-dashboard-start {
    padding: 15px 17px;
}

.mock-dashboard-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mock-dashboard-top .panel-kicker {
    margin: 0;
    font-size: 0.72rem;
}

.mock-dashboard-top > span {
    color: var(--muted);
    font-size: 0.64rem;
    font-weight: 800;
}

.mock-group-select,
.mock-today-summary,
.mock-start-card {
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fffdf9;
}

.mock-group-select {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    padding: 7px 9px;
    color: var(--ink);
    font-size: 0.67rem;
    font-weight: 800;
}

.mock-group-select b {
    color: var(--primary-deep);
}

.mock-today-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
    padding: 8px 10px;
}

.mock-today-summary div,
.mock-today-summary span {
    display: block;
}

.mock-today-summary strong {
    color: var(--success);
    font-size: 0.62rem;
    text-transform: uppercase;
}

.mock-today-summary span {
    margin-top: 2px;
    color: var(--ink);
    font-size: 0.71rem;
    font-weight: 800;
}

.mock-today-summary > b {
    font-size: 0.6rem;
    text-align: right;
}

.mock-start-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.mock-start-card {
    min-width: 0;
    padding: 8px;
}

.mock-card-title {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.64rem;
}

.mock-card-title strong {
    color: var(--muted);
}

.mock-row {
    position: relative;
    min-width: 0;
    margin-top: 5px;
    padding: 5px 5px 5px 14px;
    border: 1px solid var(--line);
    background: #fffaf4;
}

.mock-row::before {
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 5px;
    width: 4px;
    border-radius: 4px;
    content: "";
}

.mock-row-green::before {
    background: #14b86e;
}

.mock-row-orange::before {
    background: var(--primary);
}
.mock-row-blue::before {
    background: blue;
}


.mock-row b,
.mock-row span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mock-row b {
    color: var(--ink);
    font-size: 0.61rem;
}

.mock-row span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.55rem;
}

.landing-about {
    display: grid;
    grid-template-columns: minmax(420px, 0.95fr) minmax(0, 1.05fr);
    gap: 70px;
    align-items: center;
    padding: 72px 4%;
    border-top: 1px solid rgba(209, 173, 143, 0.35);
}

.calendar-laptop {
    max-width: 640px;
}

.mock-calendar {
    min-height: 300px;
    padding: 22px;
    background: #fffaf4;
}

.mock-calendar-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.mock-calendar-head strong {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.45rem;
}

.mock-calendar-head button {
    padding: 8px 12px;
    border-radius: 6px;
    background: var(--primary);
    color: #ffffff;
    font-weight: 900;
}

.mock-calendar-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: 54px repeat(4, 42px);
    gap: 6px;
}

.mock-calendar-grid > span {
    padding: 8px;
    border-bottom: 1px solid var(--line);
    font-weight: 900;
    text-align: center;
}

.mock-calendar-grid small {
    color: var(--muted);
    font-weight: 700;
}

.lesson {
    display: grid;
    align-items: center;
    padding: 8px;
    border-radius: 6px;
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 900;
}

.lesson.english {
    grid-column: 1;
    grid-row: 2;
    background: #f3d9b9;
}

.lesson.exam {
    grid-column: 5;
    grid-row: 2;
    background: #e7d7f4;
}

.lesson.speaking {
    grid-column: 4;
    grid-row: 4;
    background: #f5c6d6;
}

.lesson.homework {
    grid-column: 3;
    grid-row: 3;
    background: #d8ece4;
}

.landing-section-copy h2 {
    max-width: 640px;
    margin: 12px 0 18px;
    font-size: 3.4rem;
    line-height: 1.12;
}

.landing-section-copy .panel-kicker2 {
    margin: 0;
    color: var(--muted);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.4rem;
    font-weight: 500;
    line-height: 1.2;
}

.landing-section-heading {
    grid-column: 1 / -1;
    text-align: center;
}

.landing-section-heading h2 {
    margin: 10px 0 20px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2.6rem;
    font-weight: 500;
}

.landing-feature-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px;
    padding: 70px 0 34px;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.landing-feature-grid article {
    display: grid;
    justify-items: center;
    min-height: 210px;
    padding: 28px 22px;
    text-align: center;
}

.landing-feature-grid h3 {
    margin: 8px 0 4px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.45rem;
}

.landing-feature-icon {
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    font-weight: 900;
}

.landing-feature-icon svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.landing-chaos-panel {
    display: grid;
    grid-template-columns: minmax(0, 0.82fr) minmax(360px, 1.18fr);
    gap: 34px;
    align-items: center;
    margin: 58px 0 44px;
    padding: 42px 46px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        radial-gradient(circle at 68% 58%, rgba(191, 107, 62, 0.09), transparent 32%),
        radial-gradient(circle at 44% 54%, rgba(29, 125, 112, 0.08), transparent 28%),
        rgba(255, 250, 244, 0.94);
    box-shadow: 0 22px 46px rgba(42, 40, 36, 0.08);
}

.landing-chaos-copy h2 {
    margin: 10px 0 14px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2rem, 3.2vw, 3.45rem);
    font-weight: 500;
    line-height: 1.08;
}

.landing-chaos-copy h2 span {
    display: block;
    white-space: nowrap;
}

@media (max-width: 700px) {
    .contact-form-fields {
        grid-template-columns: 1fr;
    }

    .admin-contact-request-details {
        grid-template-columns: 1fr;
    }

    .contact-form .primary-button {
        width: 100%;
        justify-content: center;
    }

    .landing-chaos-copy h2 {
        font-size: 2rem;
    }
}

.landing-chaos-copy p:last-child {
    max-width: 58ch;
    color: var(--muted);
    font-size: 1.08rem;
    line-height: 1.7;
}

.landing-chaos-map {
    position: relative;
    min-height: 320px;
    overflow: visible;
}

.landing-chaos-map::before {
    content: "";
    position: absolute;
    top: 52%;
    left: 50%;
    width: 92%;
    height: 210px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: rgba(230, 217, 201, 0.45);
}

.chaos-connectors {
    position: absolute;
    z-index: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}

.chaos-connectors path {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chaos-thread {
    stroke: rgba(104, 100, 93, 0.34);
    stroke-width: 2.8;
}

.chaos-guide {
    stroke: rgba(104, 100, 93, 0.34);
    stroke-width: 2.8;
}

.organized-line {
    stroke: rgba(191, 107, 62, 0.42);
    stroke-width: 2.8;
}

.chaos-item,
.chaos-target,
.chaos-output {
    position: absolute;
    z-index: 1;
    display: grid;
    justify-items: center;
    gap: 8px;
    color: var(--ink);
    font-weight: 900;
    text-align: center;
}

.chaos-icon,
.chaos-target {
    display: grid;
    place-items: center;
    border-radius: 18px;
    box-shadow: 0 14px 28px rgba(42, 40, 36, 0.12);
}

.chaos-icon {
    width: 62px;
    height: 62px;
    background: #ffffff;
}

.chaos-icon svg {
    width: 32px;
    height: 32px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.2;
}

.note-icon {
    color: #d79a37;
}

.drive-icon {
    color: #2f8f62;
}

.chat-icon {
    color: #6067d8;
}

.grades-icon {
    color: #4d7fc7;
}

.mail-icon {
    color: #d55348;
}

.chaos-item span {
    width: max-content;
    max-width: 132px;
    font-size: 0.82rem;
    line-height: 1.15;
}

.chaos-target {
    left: 54%;
    top: 50%;
    width: 164px;
    height: 116px;
    transform: translate(-50%, -50%);
    border: 8px solid rgba(255, 250, 244, 0.95);
    background: var(--primary);
    color: #ffffff;
    outline: 1px solid rgba(191, 107, 62, 0.24);
    outline-offset: 6px;
    z-index: 2;
}

.chaos-target strong {
    padding-bottom: 6px;
    border-bottom: 2px solid rgba(255, 250, 244, 0.88);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.9rem;
}

.chaos-target span {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.chaos-item.notes {
    left: 22px;
    top: 74px;
}

.chaos-item.drive {
    left: 168px;
    top: 30px;
}

.chaos-item.messages {
    left: 38px;
    bottom: 30px;
}

.chaos-item.grades {
    left: 190px;
    bottom: 34px;
}

.chaos-item.mail {
    left: 126px;
    top: 130px;
}

.chaos-output {
    right: 12px;
    top: 50%;
    width: 154px;
    transform: translateY(-50%);
    gap: 10px;
}

.chaos-output span {
    padding: 12px 14px;
    border: 1px solid rgba(191, 107, 62, 0.28);
    border-radius: 8px;
    background: rgba(255, 250, 244, 0.94);
    color: var(--primary-deep);
    font-size: 0.9rem;
    font-weight: 900;
    text-align: left;
    box-shadow: 0 10px 22px rgba(42, 40, 36, 0.08);
}

.landing-audience-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    padding: 18px 0 70px;
}

.landing-audience-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 170px;
    gap: 28px;
    align-items: center;
    overflow: hidden;
    min-height: 430px;
    padding: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 250, 244, 0.9);
}

.landing-about .device.laptop {
    justify-self: center;
    box-shadow: 0 0 0 24px #efe2d2, 0 24px 44px rgba(42, 40, 36, 0.22);
}

.login-screen {
    display: flex;
    flex-direction: column;
}

.login-screen > * {
    width: 100%;
}

.landing-header { order: 0; }
.landing-hero { order: 1; }
.landing-feature-grid { order: 2; }
.landing-chaos-panel { order: 3; }
.landing-about { order: 4; }
.landing-audience-grid { order: 5; }
.landing-cta { order: 6; }

.landing-audience-card > div:first-child {
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    gap: 16px;
    align-items: flex-start;
    align-content: start;
    align-self: stretch;
    min-width: 0;
}

.student-card {
    grid-template-columns: minmax(0, 1fr) 170px;
}

#landing-teacher {
    grid-template-columns: minmax(0, 1fr) 230px;
}

#landing-teacher .landing-teacher-copy,
.landing-student-copy {
    display: grid;
    gap: 16px;
}

.landing-audience-card h1 {
    margin: 0;
    font-size: 2.55rem;
    line-height: 1.12;
}

.landing-audience-card .panel-kicker {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2rem;
    line-height: 1.1;
    letter-spacing: 0;
    font-weight: 500;
}

.landing-audience-card .landing-checklist {
    gap: 0;
    line-height: 1.25;
    grid-template-rows: repeat(4, 2.65rem);
}

.landing-audience-card .landing-checklist li::marker {
    color: var(--primary-deep);
    font-size: 1.28em;
}

.landing-audience-card .primary-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    justify-self: start;
    max-width: 100%;
    line-height: 1.25;
    white-space: normal;
    text-align: center;
    margin-top: 0;
    text-decoration: none;
}

@media (min-width: 701px) {
    .landing-audience-card .primary-button {
        align-self: end;
        min-height: 52px;
        padding: 8px 14px;
    }

    #landing-teacher .primary-button {
        width: min(270px, 100%);
    }
}

.contact-form {
    display: grid;
    gap: 12px;
}

.contact-form label {
    display: grid;
    gap: 6px;
    color: var(--ink);
    font-size: 0.88rem;
    font-weight: 800;
}

.contact-form label > span {
    color: var(--muted);
    font-weight: 600;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
    width: 100%;
    font: inherit;
}

.contact-form textarea {
    resize: vertical;
}

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

.contact-form .legal-consent-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
}

.contact-form .legal-consent-row input {
    width: auto;
    margin-top: 3px;
}

.contact-form .primary-button {
    justify-self: start;
}

.contact-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.mini-screen {
    align-self: center;
    justify-self: end;
    display: grid;
    gap: 12px;
    width: 230px;
    min-height: 190px;
    padding: 22px;
    border: 10px solid #222;
    border-bottom-width: 18px;
    border-radius: 16px;
    background: #fffaf4;
    box-shadow: 0 18px 28px rgba(42, 40, 36, 0.14);
}

.mini-screen > span {
    display: grid;
    gap: 7px;
    align-items: start;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-weight: 800;
}

.mini-screen > span b {
    width: 100%;
    max-width: 76px;
    height: 7px;
    justify-self: start;
    border-radius: 999px;
    background: var(--success);
}

.mini-screen > span:nth-child(3) b {
    background: #b6663d;
}

.mini-screen > span:nth-child(4) b {
    background: var(--danger);
}

.teacher-mini {
    display: flex;
    flex-direction: column;
    gap: 0;
    height: 360px;
    padding: 8px;
    box-sizing: border-box;
    overflow: hidden;
}

.teacher-mini-header {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    padding: 8px 9px 7px;
    border-bottom: 1px solid var(--line);
}

.teacher-mini-header strong {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.9rem;
    font-weight: 800;
}

.teacher-mini-header > span {
    color: var(--primary-deep);
    font-size: 0.5rem;
    font-weight: 900;
}

.teacher-mini-content {
    display: grid;
    flex: 1;
    align-content: start;
    gap: 6px;
    padding: 9px;
}

.teacher-mini-content > p {
    margin: 0;
    color: var(--success);
    font-size: 0.48rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.teacher-mini-content h3 {
    margin: 0 0 1px;
    font-size: 0.96rem;
}

.teacher-mini-calendar-content {
    gap: 7px;
    min-height: 0;
    grid-template-rows: auto auto minmax(0, 1fr);
}

.teacher-mini-calendar-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
}

.teacher-mini-calendar-heading span {
    color: var(--muted);
    font-size: 0.48rem;
    font-weight: 800;
}

.teacher-mini-calendar {
    display: grid;
    gap: 4px;
    min-height: 0;
    grid-template-rows: repeat(3, minmax(0, 1fr));
}

.teacher-mini-calendar-day {
    display: grid;
    gap: 3px;
    min-width: 0;
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr);
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #fffdf9;
}

.teacher-mini-calendar-day > strong {
    color: var(--muted);
    font-size: 0.46rem;
    font-weight: 900;
}

.teacher-mini-calendar-lesson {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 4px;
    align-items: center;
    padding: 4px;
    border: 1px solid currentColor;
    border-radius: 3px;
    font-size: 0.48rem;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.teacher-mini-calendar-lesson b {
    min-width: 0;
    font: inherit;
    overflow-wrap: anywhere;
}

.teacher-mini-calendar-lesson small {
    color: inherit;
    font-size: 0.4rem;
    font-weight: 900;
}

.teacher-mini-calendar-lesson.is-green {
    background: #d9ead9;
    color: #187a4e;
}

.teacher-mini-calendar-lesson.is-blue {
    background: #dfe2ff;
    color: #3c57d1;
}

.teacher-mini-calendar-lesson.is-burgundy {
    background: #f8dce2;
    color: var(--primary-deep);
}

.teacher-mini-card {
    display: grid;
    gap: 3px;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: #fffdf9;
}

.teacher-mini-card > span,
.teacher-mini-card small {
    color: var(--muted);
    font-size: 0.52rem;
}

.teacher-mini-card strong {
    font-size: 0.63rem;
}

.teacher-mini-nav {
    display: grid;
    flex: 0 0 auto;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    padding: 5px 3px 6px;
    border-top: 1px solid var(--line);
    background: #f8efe4;
}

.teacher-mini-nav span {
    padding: 4px 1px;
    color: var(--ink);
    font-size: 0.45rem;
    font-weight: 800;
    text-align: center;
}

.teacher-mini-nav .is-active {
    border-radius: 4px;
    background: #fffdf9;
    color: var(--primary-deep);
}

.mock-phone-app {
    display: flex;
    min-height: 300px;
    flex-direction: column;
    background: #fffaf4;
}

.mock-phone-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 10px 8px;
    border-bottom: 1px solid var(--line);
    background: #fffdf9;
}

.mock-phone-header strong {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.94rem;
}

.mock-phone-header > span {
    color: var(--primary-deep);
    font-size: 0.57rem;
    font-weight: 900;
}

.mock-phone-content {
    display: grid;
    flex: 1;
    align-content: start;
    gap: 7px;
    padding: 10px;
}

.mock-phone-kicker {
    margin: 0;
    color: var(--success);
    font-size: 0.49rem;
    font-weight: 900;
    letter-spacing: 0.06em;
}

.mock-phone-content h3 {
    margin: -2px 0 1px;
    font-size: 1rem;
}

.mock-phone-group-card,
.mock-phone-goal-card,
.mock-phone-task-card {
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fffdf9;
}

.mock-phone-group-card,
.mock-phone-goal-card {
    display: grid;
    gap: 3px;
    padding: 8px;
}

.mock-phone-group-card > span,
.mock-phone-goal-card > span {
    color: var(--muted);
    font-size: 0.56rem;
}

.mock-phone-group-card strong,
.mock-phone-goal-card b,
.mock-phone-task-card b {
    color: var(--ink);
    font-size: 0.66rem;
}

.mock-phone-group-card small,
.mock-phone-goal-card small {
    color: var(--muted);
    font-size: 0.53rem;
}

.mock-phone-goal-card i {
    display: block;
    height: 5px;
    overflow: hidden;
    border-radius: 99px;
    background: #e7dfc8;
}

.mock-phone-goal-card i em {
    display: block;
    width: 58%;
    height: 100%;
    border-radius: inherit;
    background: #d59a00;
}

.mock-phone-task-card {
    display: grid;
    gap: 3px;
    padding: 7px 8px;
}

.mock-phone-task-card span {
    color: var(--primary-deep);
    font-size: 0.57rem;
}

.mock-phone-nav {
    display: flex;
    gap: 1px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 5px 3px 6px;
    border-top: 1px solid var(--line);
    background: #f8efe4;
    scrollbar-width: none;
}

.mock-phone-nav::-webkit-scrollbar {
    display: none;
}

.mock-phone-nav span {
    display: grid;
    flex: 0 0 48px;
    place-items: center;
    gap: 1px;
    min-height: 42px;
    color: var(--ink);
    font-size: 0.46rem;
    font-weight: 800;
    text-align: center;
}

.mock-phone-nav span::before {
    content: attr(data-icon);
    font-size: 0.82rem;
    line-height: 1;
}

.mock-phone-nav .is-active {
    border-radius: 5px;
    background: #fffdf9;
    color: var(--primary-deep);
}

.landing-cta {
    display: grid;
    justify-items: center;
    gap: 12px;
    margin: 0;
    padding: 58px 24px;
    background: var(--primary);
    box-shadow: 0 0 0 100vmax var(--primary);
    clip-path: inset(0 -100vmax);
    color: #ffffff;
    text-align: center;
}

.landing-cta h2 {
    margin: 0;
    font-size: 3rem;
}

.landing-cta p {
    margin: 0;
    color: rgba(255, 255, 255, 0.86);
}

.landing-cta .secondary-button {
    margin-top: 10px;
    background: #fffaf4;
    color: var(--primary-deep);
    text-decoration: none;
}

.auth-card,
.topbar,
.mode-nav,
.sidebar-panel,
.dashboard-panel,
.mode-panel {
    padding: 22px;
}

.panel-heading,
.dashboard-header,
.builder-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.panel-heading h2,
.dashboard-header h2,
.builder-heading h3 {
    margin: 4px 0 0;
}

.eyebrow,
.panel-kicker,
.summary-label {
    color: var(--teal);
    font-size: 0.96rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}
.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--teal-soft);
    color: var(--teal);
    font-size: 0.88rem;
    font-weight: 800;
    white-space: nowrap;
}

.status-pill.neutral {
    background: #eef1f0;
    color: var(--muted);
}

.tab-row,
.mode-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tab-row {
    margin: 20px 0;
}

.tab-button,
.mode-button,
.primary-button,
.secondary-button,
.ghost-button,
.flashcard-action-button,
.remove-row-button,
.table-action {
    min-height: 42px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-weight: 750;
    transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.tab-button,
.mode-button,
.ghost-button {
    background: #eef3f1;
    color: var(--ink);
}

.tab-button.is-active,
.mode-button.is-active {
    background: var(--ink);
    color: #ffffff;
}

.primary-button {
    background: linear-gradient(135deg, var(--primary) 0%, #7B0D1E 100%);
    color: #ffffff;
}/*cc7d4d pomarańczowy*/

.secondary-button {
    background: linear-gradient(135deg, var(--teal) 0%, #1F3A5F 100%);
    color: #ffffff;
}/*42998d secondary button */

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.mode-button:hover,
.tab-button:hover,
.table-action:hover {
    transform: translateY(-1px);
}

.flashcard-action-button {
    min-width: 126px;
    border: 1px solid transparent;
    color: #ffffff;
}

.auth-form,
.set-form,
.stack-form,
.quiz-form {
    display: grid;
    gap: 14px;
}

.quiz-active-set-strip {
    display: grid;
    gap: 4px;
    margin-bottom: 14px;
    padding: 16px 18px;
    border: 1px solid rgba(191, 107, 62, 0.28);
    border-left: 6px solid var(--primary);
    border-radius: var(--radius-md);
    background: #fffaf4;
}

.quiz-active-set-strip span {
    color: var(--teal);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.quiz-active-set-strip strong {
    color: var(--ink);
    font-size: 1.32rem;
}

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

label {
    display: grid;
    gap: 7px;
    color: var(--ink);
    font-weight: 700;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="file"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    min-height: 44px;
    padding: 11px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-md);
    background: #ffffff;
    color: var(--ink);
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(182, 102, 61, 0.16);
}

select {
    appearance: auto;
}

.toggle {
    grid-template-columns: auto 1fr;
    align-items: center;
}

.toggle input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.feedback.is-success {
    color: var(--success);
}

.feedback.is-error {
    color: var(--danger);
}

.legal-consent-row {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.4;
}

.legal-consent-row input {
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    margin-top: 2px;
    accent-color: var(--primary);
}

.inline-legal-link {
    display: inline;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--primary-deep);
    font: inherit;
    font-weight: 800;
    text-decoration: underline;
}

.modal-action-feedback {
    margin: 0 0 12px;
}

.dashboard-shell {
    display: grid;
    gap: 16px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
}

.topbar h1 {
    margin-bottom: 0;
    font-size: clamp(2rem, 3vw, 3.2rem);
}

.account-summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    align-items: center;
    color: var(--muted);
}

.account-summary span {
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--panel-soft);
}

.workspace-layout {
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.sets-list {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.set-search {
    margin-top: 16px;
}

.set-class-creator {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.set-class-group {
    display: grid;
    gap: 8px;
}

.teacher-set-owner-group {
    display: grid;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--panel);
}

.teacher-set-owner-toggle {
    width: 100%;
    min-height: 48px;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    font-weight: 900;
    text-align: left;
}

.teacher-set-owner-toggle::before {
    content: "▸";
    color: var(--muted);
}

.teacher-set-owner-toggle.is-open::before {
    content: "▾";
}

.teacher-set-owner-toggle span {
    color: var(--accent);
    font-size: 0.82rem;
}

.teacher-set-owner-body {
    display: grid;
    gap: 10px;
}

.set-class-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.set-class-toggle {
    width: 100%;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--panel-soft);
    color: var(--ink);
    font-weight: 900;
    text-align: left;
}

.set-class-toggle span {
    color: var(--muted);
    font-size: 0.88rem;
}

.set-class-toggle::before {
    content: "▸";
    color: var(--muted);
}

.set-class-toggle.is-open::before {
    content: "▾";
}

.set-class-delete-button {
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid #f1b0a2;
    border-radius: var(--radius-md);
    background: #fff0ec;
    color: var(--danger);
    font-weight: 900;
}

.set-class-body {
    display: grid;
    gap: 8px;
    padding-left: 12px;
    border-left: 2px solid var(--line);
}

.set-class-empty {
    margin: 0;
    padding: 10px 12px;
    color: var(--muted);
    font-weight: 700;
}

.assignment-targets-field {
    display: grid;
    gap: 10px;
}

.assignment-target-list {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.assignment-target-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel-soft);
    font-weight: 800;
}

.teacher-student-class-list {
    display: grid;
    gap: 10px;
}

.set-class-create-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--panel-soft);
}

.set-class-create-panel label {
    margin: 0;
}

.set-class-create-panel .ghost-button {
    min-height: 42px;
}

@media (max-width: 520px) {
    .set-class-create-panel {
        grid-template-columns: 1fr;
    }
}

.teacher-student-class-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 1.3fr);
    gap: 12px;
    align-items: start;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--panel-soft);
}

.set-class-checkboxes {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.set-class-checkboxes.is-organization {
    display: grid;
    gap: 8px;
}

.group-member-set-owner-group {
    width: 100%;
    padding: 6px;
    gap: 6px;
}

.group-member-set-owner-group .teacher-set-owner-toggle {
    min-height: 38px;
    padding: 6px 8px;
}

.group-member-set-owner-group .teacher-set-owner-body {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    padding: 6px 0 0;
    border-top: 1px solid var(--line);
}

.inline-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel);
    font-weight: 800;
}

.student-remove-button {
    margin-top: 8px;
    min-height: 32px;
    padding: 6px 10px;
    border-radius: var(--radius-md);
    background: #fff0ec;
    color: var(--danger);
    font-weight: 900;
}

.set-list-item {
    display: grid;
    gap: 8px;
}

.sets-portal-panel {
    width: 100%;
}

.sets-hub-panel {
    padding: 16px;
}

.sets-portal-frame {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    min-height: 620px;
}

.sets-sidebar {
    position: sticky;
    top: 14px;
    align-self: start;
    max-height: calc(100vh - 28px);
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    border-right: 1px solid var(--line);
    background: rgba(255, 250, 244, 0.72);
    overflow-y: auto;
}

.sets-portal-main {
    min-width: 0;
    padding: 16px;
}

.set-portal-section {
    min-width: 0;
}

.set-detail-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.set-choose-button {
    width: 100%;
    min-height: 36px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    background: var(--primary);
    color: #ffffff;
    font-weight: 900;
}

.set-portal-nav-item {
    width: 100%;
    min-height: 40px;
    padding: 9px 11px;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--muted);
    text-align: left;
    font-weight: 800;
}

.set-portal-nav-item.is-active {
    background: var(--primary);
    color: #ffffff;
}

.set-portal-layout {
    display: grid;
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.set-browser-column,
.set-learning-column {
    min-width: 0;
}

.set-learning-column {
    display: grid;
    gap: 14px;
}

.set-learning-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.set-study-nav-item {
    min-height: 38px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    background: var(--panel-soft);
    color: var(--muted);
    font-weight: 800;
}

.set-study-nav-item.is-active {
    background: var(--primary);
    color: #ffffff;
}

.learn-content,
.learn-exercise-form,
.learn-card {
    display: grid;
    gap: 14px;
}

.learn-progress-panel {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--panel-soft);
}

.learn-progress-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.learn-progress-info span,
.learn-question-meta span {
    display: block;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 800;
}

.learn-progress-info strong {
    color: var(--primary-deep);
    font-size: 1rem;
}

.learn-progress-track {
    position: relative;
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
    padding-right: 46px;
    padding-block: 12px;
}

.learn-progress-track span {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    height: 14px;
    border-radius: 999px;
    background: #d9dee8;
    overflow: hidden;
}

.learn-progress-track span::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--segment-progress, 0%);
    border-radius: inherit;
    background: var(--success);
}

.learn-progress-track span.is-current {
    outline: 2px solid rgba(22, 129, 92, 0.2);
    outline-offset: 3px;
}

.learn-progress-track::before {
    content: attr(data-current);
    position: absolute;
    left: min(calc(100% - 80px), max(18px, var(--learn-current-left, 0%)));
    top: 50%;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--primary);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 900;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.learn-progress-track::after {
    content: attr(data-remaining);
    position: absolute;
    right: 0;
    top: 50%;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #e8edf6;
    color: var(--primary-deep);
    font-size: 0.9rem;
    font-weight: 900;
    transform: translateY(-50%);
}

.learn-progress-track.is-finished::before {
    background: var(--success);
}

.learn-progress-track.is-finished::after {
    background: #e9f8ef;
    color: var(--success);
}

.learn-card {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fffaf4;
}

.learn-card h3 {
    margin: 0;
    font-size: 1.45rem;
}

.learn-question-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.learn-question-meta strong {
    color: var(--primary-deep);
}

.learn-choice-list {
    display: grid;
    gap: 10px;
}

.learn-choice-button {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-md);
    background: #ffffff;
    color: var(--ink);
    text-align: left;
    font-weight: 900;
}

.learn-choice-button:hover {
    border-color: var(--primary);
    color: var(--primary-deep);
}

.learn-answer-preview {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #ffffff;
    color: var(--primary-deep);
    font-size: 1.3rem;
    font-weight: 900;
}

.set-card {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--panel-soft);
    color: var(--ink);
    text-align: left;
}

.set-delete-button {
    width: 100%;
    min-height: 36px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    background: #fff0ec;
    color: var(--danger);
    font-weight: 800;
}

.set-edit-button {
    width: 100%;
    min-height: 36px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    background: #fff7e8;
    color: #946200;
    font-weight: 800;
}

.set-card strong,
.set-card span {
    display: block;
}

.set-card span {
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.92rem;
}

.set-card.is-selected {
    border-color: var(--primary);
    box-shadow: inset 4px 0 0 var(--primary);
}

.workspace-main {
    display: grid;
    gap: 16px;
}

.large-empty {
    min-height: 230px;
    display: grid;
    place-items: center;
    text-align: center;
}

.empty-state,
.auth-gate {
    padding: 16px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-md);
    background: var(--panel-soft);
    color: var(--muted);
}

.dashboard-panel,
.mode-panel {
    display: grid;
    gap: 18px;
}

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

.wide-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.teacher-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.teacher-grid h3 {
    margin-bottom: 0;
}

.attendance-list {
    display: grid;
    gap: 8px;
}

.start-lessons-grid,
.attendance-lesson-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.attendance-date-control {
    display: none;
}

.start-lesson-card,
.attendance-lesson-button {
    min-height: 76px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fffaf4;
    color: var(--ink);
    text-align: left;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.start-lesson-card:hover,
.attendance-lesson-button:hover,
.attendance-lesson-button.is-active {
    border-color: var(--primary);
    box-shadow: inset 4px 0 0 var(--primary);
    transform: translateY(-1px);
}

.start-lesson-card span,
.attendance-lesson-button span,
.start-lesson-card small {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.attendance-lesson-button small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 800;
}

.start-lesson-card strong,
.attendance-lesson-button strong {
    display: block;
    margin-top: 4px;
    color: var(--ink);
}

.attendance-lesson-button.is-confirmed {
    border-color: var(--success);
    box-shadow: inset 4px 0 0 var(--success);
}

.attendance-confirmation-state {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fffaf4;
    color: var(--muted);
    font-weight: 900;
}

.attendance-list.is-confirmed .attendance-row {
    opacity: 0.72;
}

.attendance-list.is-confirmed .attendance-row input {
    cursor: not-allowed;
}

.material-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
}

.material-type-group {
    display: grid;
    gap: 8px;
    margin: 0 0 12px;
    list-style: none;
}

.material-category-list,
.material-type-group .set-class-body {
    list-style: none;
}

.material-search {
    margin: 10px 0 12px;
}

.material-type-group > strong {
    color: var(--primary-deep);
    font-size: 0.9rem;
}

.material-type-group > ul {
    display: grid;
    gap: 8px;
    margin: 0;
    padding-left: 0;
}

.material-type-badge {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px 8px;
    background: #fff8ef;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 900;
}

.material-type-select {
    width: auto;
    min-height: 32px;
    padding: 5px 28px 5px 10px;
    border-radius: var(--radius-md);
    font-size: 0.86rem;
    font-weight: 800;
}

.material-delete-button {
    min-height: 32px;
    padding: 6px 10px;
    border-radius: var(--radius-md);
    background: #fff0ec;
    color: var(--danger);
    font-weight: 900;
}

.student-assignment-list {
    display: grid;
    gap: 12px;
}

.student-material-row {
    display: grid;
    justify-content: stretch;
    gap: 3px;
}

.student-material-row small {
    color: var(--accent);
    font-weight: 900;
}

.student-assignment-categories {
    display: grid;
    gap: 10px;
}

.required-credentials-modal {
    z-index: 10000;
    padding: 20px;
}

.required-credentials-panel {
    width: min(100%, 460px);
}

.student-assignment-category {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--panel-soft);
    overflow: hidden;
}

.student-assignment-category summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 46px;
    padding: 10px 12px;
    cursor: pointer;
    color: var(--ink);
    font-weight: 900;
}

.student-assignment-category summary span {
    color: var(--muted);
}

.student-assignment-category summary .student-assignment-count-alert {
    display: inline-grid;
    min-width: 24px;
    min-height: 24px;
    place-items: center;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 0.82rem;
}

.student-assignment-category .student-assignment-list {
    padding: 0 12px 12px;
}

.student-assignment-category-reviewed {
    border-color: #9bd8bd;
    background: #edf8f1;
}

.student-assignment-category-reviewed summary,
.student-assignment-category-reviewed summary span {
    color: var(--success);
}

.student-assignment-category-pending {
    border-color: #e7c17b;
    background: #fff8df;
}

.student-assignment-category-pending summary,
.student-assignment-category-pending summary span {
    color: var(--warning);
}

.student-assignment-category-overdue {
    border-color: #efb0aa;
    background: #fff0ee;
}

.student-assignment-category-overdue summary,
.student-assignment-category-overdue summary span {
    color: var(--danger);
}

.student-reviewed-assignments {
    margin-top: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fffaf4;
}

.student-reviewed-assignments summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    color: var(--primary-deep);
    font-weight: 900;
}

.student-reviewed-assignments summary span {
    min-width: 28px;
    border-radius: 999px;
    background: #e7f2ed;
    color: var(--success);
    text-align: center;
}

.student-reviewed-assignments .student-assignment-list {
    padding: 0 14px 14px;
}

.student-assignment-card {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fffaf4;
}

.gap-quiz-sentence {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #ffffff;
    font-weight: 800;
}

.gap-quiz-sentence span {
    color: var(--primary-deep);
    letter-spacing: 0.08em;
}

.gap-questions-builder,
.choice-questions-builder,
.gap-quiz-question-list {
    display: grid;
    gap: 12px;
}

.gap-question-row,
.choice-question-row,
.gap-quiz-question {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fffaf4;
}

.gap-answer-review {
    display: grid;
    gap: 10px;
}

.gap-answer-review-item {
    display: grid;
    gap: 4px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #ffffff;
}

.gap-answer-review-item.is-correct {
    border-color: rgba(22, 129, 92, 0.45);
}

.gap-answer-review-item.is-wrong {
    border-color: rgba(180, 35, 24, 0.35);
}

.gap-answer-review-item p {
    margin: 0;
}

.choice-review-options {
    display: grid;
    gap: 4px;
    color: var(--muted);
}

.gap-answer-review-item small {
    color: var(--success);
    font-weight: 800;
}

.gap-answer-accept-button {
    justify-self: start;
    border: 0;
    border-radius: 8px;
    background: var(--success);
    color: #ffffff;
    font-weight: 800;
    padding: 8px 10px;
    cursor: pointer;
}

.gap-answer-accept-button:hover {
    background: #0f6f4e;
}

.student-assignment-submit-form,
.submission-grade-form {
    display: grid;
    gap: 8px;
}

.submission-grade-form {
    grid-template-columns: minmax(70px, 100px) minmax(120px, 1fr) auto;
}

.student-submit-button {
    background: var(--success);
    color: #ffffff;
}

.student-submit-button:hover {
    background: #0f6f4e;
}

.grade-submit-button {
    background: var(--warning);
    color: #ffffff;
}

.grade-submit-button:hover {
    background: #9b5a08;
}

.gradebook-grade-cell {
    vertical-align: middle;
}

.gradebook-grade-entry + .gradebook-grade-entry {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(191, 107, 62, 0.22);
}

.gradebook-grade-cell strong,
.gradebook-grade-cell small,
.gradebook-grade-cell .grade-delete-button {
    display: block;
    margin-inline: auto;
}

.gradebook-grade-cell small {
    margin-top: 5px;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.3;
}

.grade-delete-button {
    margin-top: 7px;
    min-height: 28px;
    padding: 5px 9px;
    border-radius: var(--radius-sm);
    background: #f6d5cc;
    color: #9b2f22;
    font-size: 0.78rem;
    font-weight: 900;
}

.writing-compare {
    display: grid;
    gap: 6px;
    margin-top: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fffaf4;
}

.writing-compare.corrected {
    border-color: var(--success);
    background: #f4fff4;
}

.pronunciation-recorder,
.audio-submission {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fffaf4;
}

.audio-submission {
    margin-top: 8px;
}

.audio-submission audio,
.recording-preview {
    width: 100%;
    max-width: 360px;
}

.locked-assignment-note {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #f6eadc;
    font-weight: 900;
}

.writing-compare h4 {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.writing-compare p {
    margin: 0;
    white-space: pre-wrap;
}

.correction-editor {
    grid-column: 1 / -1;
}

.correction-editor textarea {
    width: 100%;
}

.attendance-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fffaf4;
}

.attendance-student-name,
.attendance-backfill-option {
    cursor: pointer;
}

.attendance-row.is-optional-backfill {
    border-style: dashed;
    color: var(--muted);
}

.attendance-row.is-backfill-enabled {
    border-style: solid;
    color: var(--ink);
}

.attendance-backfill-option {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    font-size: 0.86rem;
    font-weight: 800;
}

.attendance-backfill-saved {
    color: var(--success);
    font-weight: 800;
}

@media (max-width: 720px) {
    .attendance-backfill-option,
    .attendance-backfill-saved {
        grid-column: 2 / -1;
    }
}

.teacher-report {
    display: grid;
    gap: 14px;
}

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

.student-group-card {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--panel-soft);
}

.student-weekly-goal {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fffaf4;
}

.student-weekly-goal.is-complete {
    border-color: rgba(22, 129, 92, 0.35);
    background: #e9f8ef;
}

.student-weekly-goal.is-pending {
    border-color: rgba(180, 35, 24, 0.25);
    background: #fff0ee;
}

.student-weekly-goal.is-halfway {
    border-color: rgba(202, 138, 4, 0.35);
    background: #fff8df;
}

.student-weekly-goal p,
.student-weekly-goal small {
    margin: 0;
    color: var(--muted);
    font-weight: 800;
}

.student-weekly-goal.is-complete p {
    color: var(--success);
}

.student-weekly-goal.is-pending p {
    color: var(--danger);
}

.student-weekly-goal.is-halfway p {
    color: #9a6a00;
}

.inline-link-button {
    display: inline;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 900;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.weekly-goal-set-link {
    color: var(--primary-deep);
}

.student-weekly-goal-bar {
    width: 100%;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.1);
}

.student-weekly-goal-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--success);
}

.student-weekly-goal.is-halfway .student-weekly-goal-bar span {
    background: #d79a00;
}

.student-weekly-goal.is-pending .student-weekly-goal-bar span {
    background: var(--danger);
}

.student-start-materials,
.student-start-next-assignments {
    display: grid;
    gap: 8px;
    margin: 0;
    padding-left: 18px;
}

.student-materials-toggle-wrap {
    display: grid;
    gap: 10px;
}

.school-created-students-card {
    grid-column: 1 / -1;
}

.school-created-students-card .preparation-heading {
    align-items: start;
}

.school-created-students-table {
    min-width: 680px;
}

.student-materials-list-wrap {
    width: 100%;
}

.student-materials-category-list {
    display: grid;
    width: 100%;
    gap: 10px;
    margin: 0;
    padding: 0;
}

.student-materials-category-list .material-type-group {
    width: 100%;
    margin: 0;
}

.student-start-materials.is-scrollable {
    max-height: 92px;
    overflow-y: auto;
    padding-right: 8px;
}

.student-start-next-assignments li {
    display: grid;
    gap: 3px;
}

.student-start-assignment-link {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-weight: 900;
    text-align: left;
    text-decoration: underline;
}

.student-start-next-assignments span {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
}

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

.student-lessons-tile {
    display: grid;
    gap: 8px;
    min-height: 150px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--panel-soft);
    color: var(--ink);
    text-align: left;
    box-shadow: var(--shadow-soft);
}

.student-lessons-tile:hover,
.student-lessons-tile:focus-visible {
    border-color: rgba(191, 107, 62, 0.48);
    background: #fffaf4;
}

.student-lessons-icon {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: var(--primary);
    color: #ffffff;
    font-weight: 900;
}

.student-lessons-tile strong {
    font-size: 1.1rem;
}

.student-lessons-tile small {
    color: var(--muted);
    font-weight: 800;
    line-height: 1.45;
}

.group-board-card {
    display: grid;
    gap: 14px;
    min-width: 0;
    max-width: 100%;
}

.group-board-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
}

.board-active-toggle {
    flex: 0 0 auto;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fffaf4;
}

.board-clear-button {
    flex: 0 0 auto;
    padding: 9px 12px;
}

.group-board-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fffaf4;
}

.group-board-format-button,
.group-board-color-swatch {
    width: 36px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffdf9;
    color: var(--accent-strong);
    font-weight: 900;
    cursor: pointer;
}

.group-board-format-button:hover,
.group-board-color-swatch:hover {
    border-color: var(--accent);
}

.group-board-format-button.is-active {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(191, 107, 62, 0.18);
}

.group-board-format-button[data-board-command].is-active {
    background: #fffdf9;
    color: var(--accent-strong);
}

.group-board-format-button[data-board-command="underline"] {
    text-decoration: underline;
}

.group-board-color-toggle {
    background: var(--active-board-color, var(--accent));
    color: #fff;
}

.group-board-color-toggle.is-active {
    background: var(--active-board-color, var(--accent));
    color: #fff;
}

.group-board-color-picker {
    position: relative;
}

.group-board-color-menu {
    position: absolute;
    z-index: 8;
    bottom: calc(100% + 8px);
    left: 0;
    display: flex;
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fffdf9;
    box-shadow: var(--shadow-soft);
}

.group-board-color-menu.is-hidden {
    display: none;
}

.group-board-color-swatch {
    background: var(--board-swatch);
}

.group-board-color-swatch.is-active {
    border-color: var(--accent-strong);
    box-shadow: 0 0 0 3px rgba(191, 107, 62, 0.18);
}

.group-board-surface {
    position: relative;
    min-width: 0;
    max-width: 100%;
}

.group-board-editor {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: min(55vh, 560px);
    min-height: 320px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-gutter: stable;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    font-size: 1rem;
    line-height: 1.55;
    background: #fffdf9;
    outline: none;
    caret-color: var(--board-caret-color, var(--accent-strong));
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.group-board-editor pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.group-board-cursors {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.group-board-remote-cursor {
    position: absolute;
    z-index: 2;
    width: 2px;
    background: var(--board-caret-color);
}
.group-board-remote-cursor-smooth {
    transition: left 120ms ease-out, top 120ms ease-out;
}

.group-board-remote-cursor-name {
    position: absolute;
    top: 0;
    left: 2px;
    min-width: 16px;
    overflow: hidden;
    padding: 0 2px;
    color: #fff;
    background: var(--board-caret-color);
    font-size: 9px;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.group-board-editor:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(191, 107, 62, 0.14);
}

.group-board-editor h3 {
    margin: 0 0 10px;
    color: var(--ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.35rem;
    line-height: 1.25;
}

.group-board-editor ul,
.group-board-editor ol {
    margin: 8px 0 8px 22px;
    padding-left: 18px;
}

.group-board-editor li {
    margin: 4px 0;
}

.group-board-editor:empty::before {
    content: attr(data-placeholder);
    color: var(--muted);
}

.group-board-editor.is-disabled {
    color: var(--muted);
    background: #f4eee6;
    cursor: not-allowed;
}

.group-board-toolbar button:disabled,
.group-board-toolbar input:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.group-board-footer {
    display: flex;
    justify-content: flex-end;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
}

.teacher-card {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--panel-soft);
}

.organization-group-overview-list .teacher-today-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
}

.organization-overview-weekday-list {
    display: grid;
    gap: 12px;
}

.organization-overview-weekday-group {
    margin: 0;
}

.organization-overview-weekday-group .organization-group-overview-list {
    margin-top: 8px;
}

.organization-overview-attendance-month {
    display: grid;
    gap: 5px;
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.organization-overview-attendance-month select {
    min-height: 38px;
}

.assignment-target-picker {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--border);
}

.assignment-target-picker legend {
    padding: 0 4px;
    font-weight: 700;
}

.assignment-target-picker > label,
.assignment-target-students label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.assignment-target-students {
    display: grid;
    gap: 7px;
    max-height: 180px;
    overflow-y: auto;
    padding: 8px;
    border-top: 1px solid var(--border);
}

.organization-group-overview-list .teacher-today-row > div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.organization-group-overview-list .organization-overview-open-button {
    align-self: center;
    white-space: nowrap;
    background: var(--primary);
    color: #ffffff;
}

.organization-overview-attendance-day + .organization-overview-attendance-day {
    margin-top: 12px;
}

.organization-overview-attendance-day > strong {
    display: block;
    margin-bottom: 4px;
}

.teacher-start-overview {
    display: grid;
    gap: 14px;
}

.teacher-today-hero {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) minmax(0, max-content) 34px;
    align-items: center;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #fffaf4;
}

.teacher-today-hero h3 {
    margin: 4px 0 0;
}

.teacher-today-date-heading {
    min-width: 0;
}

.teacher-today-date-nav {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--panel);
    color: var(--primary-deep);
    font-size: 1.25rem;
    font-weight: 900;
}

@media (max-width: 700px) {
    .teacher-today-hero {
        grid-template-columns: 34px minmax(0, 1fr) 34px;
    }

    .teacher-today-hero > strong {
        grid-column: 2;
    }
}

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

.teacher-today-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.teacher-today-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 3px 10px;
    align-items: center;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.72);
    color: var(--ink);
    text-align: left;
}

.teacher-today-row.is-active {
    border-color: rgba(128, 0, 32, 0.28);
    background: #fff8f0;
}

button.teacher-today-row[data-start-assignment-review] {
    cursor: pointer;
}

button.teacher-today-row[data-start-assignment-review]:hover {
    border-color: rgba(191, 107, 62, 0.48);
    background: #fff8f0;
}

.preparation-table tr.is-start-review-target td {
    background: #fff0d4;
    transition: background 0.45s ease;
}

.teacher-today-row strong,
.teacher-today-row small {
    min-width: 0;
}

.teacher-today-row small {
    grid-column: 2;
    color: var(--muted);
    line-height: 1.35;
}

.teacher-today-color {
    grid-row: span 2;
    width: 12px;
    height: 34px;
    border-radius: 999px;
    background: var(--group-color, var(--primary));
}

.teacher-active-group-card {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #fffaf4;
}

.teacher-start-students-card {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fffaf4;
}

.teacher-start-students-list {
    display: grid;
    gap: 10px;
}

.teacher-start-calendar-card {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #fffaf4;
}

.teacher-start-calendar-month {
    color: var(--ink);
    font-size: 1.28rem;
    font-weight: 900;
    text-transform: capitalize;
}

.teacher-start-calendar-toolbar {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    gap: 10px;
    align-items: center;
}

.teacher-start-calendar-toolbar .teacher-start-calendar-month {
    text-align: center;
}

.teacher-start-calendar-nav {
    display: grid;
    place-items: center;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fffaf4;
    color: var(--primary-deep);
    font-size: 1.35rem;
    font-weight: 900;
}

.teacher-start-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--line);
    gap: 1px;
}

.teacher-week-calendar-grid {
    display: grid;
    grid-template-columns: 56px repeat(7, minmax(0, 1fr));
    width: 100%;
    overflow: visible;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--line);
    gap: 1px;
}

.teacher-week-calendar-time,
.teacher-week-calendar-day,
.teacher-week-calendar-cell {
    min-height: 62px;
    padding: 8px;
    background: var(--panel);
    min-width: 0;
}

.teacher-week-calendar-time {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 900;
    box-sizing: border-box;
    min-height: 96px;
}

.teacher-week-calendar-day {
    display: grid;
    gap: 3px;
    min-height: 0;
    text-align: center;
}

.teacher-week-calendar-day strong {
    font-size: 0.86rem;
}

.teacher-week-calendar-day span {
    color: var(--muted);
    font-size: 0.74rem;
}

.teacher-week-calendar-day.is-today,
.teacher-week-calendar-cell.is-today {
    background: #fff7ef;
}

.teacher-week-calendar-cell {
    display: grid;
    align-content: start;
    gap: 5px;
    position: relative;
    box-sizing: border-box;
    height: 96px;
    padding: 0;
}

.teacher-week-calendar-empty {
    grid-column: 1 / -1;
    padding: 18px;
    background: var(--panel);
    color: var(--muted);
    text-align: center;
}

.teacher-mobile-calendar-list {
    display: none;
}

.teacher-start-calendar-weekday {
    padding: 10px 8px;
    background: #fffaf4;
    color: var(--muted);
    text-align: center;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.teacher-start-calendar-cell {
    display: grid;
    gap: 10px;
    align-content: start;
    min-height: 118px;
    padding: 8px;
    background: var(--panel);
}

.teacher-start-calendar-cell.is-empty {
    background: rgba(255, 250, 244, 0.6);
}

.teacher-start-calendar-cell.is-today {
    box-shadow: inset 0 0 0 2px rgba(191, 107, 62, 0.45);
}

.teacher-start-calendar-date {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fffaf4;
    color: var(--ink);
    font-weight: 900;
    font-size: 0.88rem;
}

.teacher-start-calendar-groups {
    display: grid;
    gap: 3px;
}

.teacher-week-calendar-cell .teacher-start-calendar-groups {
    position: absolute;
    top: var(--lesson-offset, 0px);
    right: 4px;
    left: 4px;
    z-index: 1;
}

.teacher-start-calendar-group {
    display: grid;
    gap: 3px;
    width: 100%;
    padding: 9px 10px;
    border: 1px solid var(--group-color, var(--line));
    border-radius: var(--radius-md);
    background: #fffaf4;
    background: color-mix(in srgb, var(--group-color, #fffaf4) 18%, #fffaf4);
    color: var(--ink);
    text-align: left;
    font-size: 0.86rem;
    box-sizing: border-box;
    min-height: 76px;
    min-height: max(var(--lesson-height, 0px), 76px);
    height: auto;
    overflow-wrap: anywhere;
}

.teacher-start-calendar-group.is-active {
    border-color: var(--group-color, var(--primary));
    background: #fffaf4;
    background: color-mix(in srgb, var(--group-color, #fffaf4) 30%, #fffaf4);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--group-color, var(--primary)) 45%, transparent);
}

.teacher-start-calendar-group strong {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.teacher-start-calendar-group span {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
}

.teacher-start-student-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #ffffff;
}

.teacher-start-student-button {
    display: grid;
    gap: 3px;
    min-height: 42px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    text-align: left;
}

.teacher-start-student-button span {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
}

.teacher-student-report-button {
    justify-self: end;
}

.teacher-student-report-modal-panel {
    max-width: 900px;
}

.organization-group-overview-modal-panel {
    width: min(1240px, calc(100vw - 36px));
    max-width: 1240px;
}

.teacher-report-range-modal-panel {
    max-width: 520px;
}

.student-report-body {
    display: grid;
    gap: 14px;
}

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

.student-report-summary-grid article,
.student-report-mini-grid span {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fffaf4;
}

.student-report-summary-grid span,
.student-report-mini-grid span {
    color: var(--muted);
    font-weight: 800;
}

.student-report-summary-grid strong,
.student-report-mini-grid strong {
    color: var(--ink);
}

.student-report-mini-card {
    min-height: 52px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fffaf4;
    color: var(--muted);
    font: inherit;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
}

.student-report-mini-card:hover,
.student-report-mini-card.is-open {
    border-color: var(--primary);
    background: #fff6ed;
    color: var(--primary);
}

.organization-overview-student-report-detail {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--panel-soft);
}

.organization-overview-student-report-detail h4 {
    margin: 0 0 8px;
}

.organization-overview-student-report-detail ul {
    margin: 0;
    padding-left: 20px;
    color: var(--muted);
}

.student-report-group {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--panel-soft);
}

.student-report-group h4 {
    margin: 8px 0 0;
}

.student-report-group ul {
    margin: 0;
    padding-left: 20px;
    color: var(--muted);
}

.message-panel {
    display: grid;
    gap: 12px;
}

.unread-badge {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    margin-left: 8px;
    border-radius: 999px;
    background: #b42318;
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1;
}

.admin-report-alert-badge {
    display: inline-grid;
    place-items: center;
    width: 19px;
    height: 19px;
    margin-left: auto;
    border-radius: 50%;
    background: #b42318;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 2px 5px rgba(180, 35, 24, 0.28);
}

.message-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 10px;
}

.message-toolbar label {
    flex: 1 1 220px;
}

.message-toolbar button,
.message-form button {
    min-height: 42px;
}

.messages-refresh-button {
    display: none;
}

.message-list {
    display: grid;
    gap: 8px;
    min-height: 140px;
    max-height: 320px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fffaf4;
}

.message-bubble {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    justify-self: start;
    max-width: min(680px, 88%);
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.message-bubble.is-own {
    justify-self: end;
    border-color: rgba(42, 127, 98, 0.35);
    background: #eef8f2;
}

.message-bubble div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
    color: var(--muted);
    font-size: 0.82rem;
}

.message-bubble p {
    margin: 6px 0 0;
    white-space: pre-wrap;
}

.message-pin-button {
    margin-top: 7px;
    padding: 4px 8px;
    border-radius: var(--radius-md);
    background: #fff0d4;
    color: var(--warning);
    font-size: 0.78rem;
    font-weight: 900;
}

.pinned-message {
    display: grid;
    gap: 3px;
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--warning);
    border-left: 5px solid var(--warning);
    border-radius: var(--radius-md);
    background: #fff8e8;
    color: var(--ink);
    text-align: left;
}

.pinned-message span {
    color: var(--warning);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.pinned-message p {
    margin: 2px 0 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 46px;
    align-items: end;
    gap: 8px;
}

.message-compose {
    position: relative;
    display: grid;
    gap: 6px;
}

.message-compose-actions {
    display: flex;
    align-items: center;
    gap: 7px;
}

.message-form .message-emoji-button,
.message-image-label {
    display: inline-grid;
    place-items: center;
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fffaf4;
    color: var(--ink);
    font-size: 1.15rem;
    cursor: pointer;
}

.message-image-label input {
    display: none;
}

.message-emoji-picker {
    position: absolute;
    z-index: 12;
    bottom: 44px;
    left: 0;
    display: grid;
    grid-template-columns: repeat(6, 38px);
    gap: 4px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(63, 44, 26, 0.18);
}

.message-emoji-picker.is-hidden {
    display: none;
}

.message-emoji-picker button {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    background: transparent;
    font-size: 1.2rem;
}

.message-image-button {
    display: block;
    max-width: min(360px, 100%);
    margin-top: 8px;
    padding: 0;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: #f4ece2;
}

.message-image-button img {
    display: block;
    width: 100%;
    max-height: 320px;
    object-fit: contain;
}

.message-form textarea {
    min-height: 72px;
    max-height: 180px;
    resize: vertical;
}

.message-send-button {
    width: 46px;
    min-width: 46px;
    height: 46px;
    padding: 0;
    border-radius: var(--radius-md);
    background: var(--primary);
    color: #ffffff;
    font-size: 1.2rem;
    line-height: 1;
}

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

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

.lesson-strip span {
    padding: 7px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: #fffaf4;
    color: var(--primary-deep);
    font-weight: 800;
    font-size: 0.9rem;
}

.lesson-calendar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.lesson-calendar-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.lesson-calendar-columns ul {
    max-height: 140px; /* Ok. 4-5 elementów na raz, potem pojawia się scroll */
    overflow-y: auto;
    overflow-x: auto;
    margin: 0;
    padding-right: 4px;
    padding-bottom: 4px;
    list-style: none;
}
.lesson-calendar-columns ul li {
    padding: 2px 0;
    font-size: 0.85rem;
}
.lesson-calendar-heading {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
/* Cienki, dyskretny pasek przewijania */
.lesson-calendar-columns ul::-webkit-scrollbar {
    width: 4px;  /* Szerokość dla paska pionowego */
    height: 4px; /* Wysokość dla paska poziomego */
}
.lesson-calendar-columns ul::-webkit-scrollbar-thumb {
    background: #ebd2c2;
    border-radius: 4px;
}
.lesson-calendar-heading h3 {
    margin: 0;
}

.lesson-calendar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.single-lesson-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.single-lesson-form input {
    min-height: 38px;
}

.single-lesson-add-button,
.single-lesson-delete-button {
    min-height: 38px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    color: #ffffff;
    font-weight: 900;
}

.single-lesson-add-button {
    background: #16815c;
}

.single-lesson-delete-button {
    background: #b42318;
}

.lesson-calendar-card {
    display: grid;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fffaf4;
    overflow: hidden;
}

.lesson-calendar-card.is-active {
    border-color: var(--primary);
    box-shadow: inset 4px 0 0 var(--primary);
}

.lesson-calendar-trigger {
    display: grid;
    gap: 4px;
    width: 100%;
    padding: 12px;
    background: transparent;
    color: var(--ink);
    text-align: left;
}

.lesson-calendar-trigger span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.lesson-calendar-trigger strong {
    font-size: 0.9rem;
    color: var(--muted);
}

.lesson-calendar-trigger small {
    color: var(--primary-deep);
    font-size: 1.08rem;
    font-weight: 800;
}

.lesson-edit-button {
    justify-self: start;
    margin: 0 12px 12px;
    min-height: 34px;
    padding: 7px 12px;
    border-radius: var(--radius-md);
    background: var(--teal-soft);
    color: var(--teal);
    font-weight: 900;
}

.lesson-calendar-details {
    display: none;
    padding: 0 12px 12px;
    border-top: 1px solid var(--line);
}

.lesson-calendar-card.is-active .lesson-calendar-details,
.teacher-lesson-card .lesson-calendar-details {
    display: grid;
    gap: 10px;
}

.lesson-calendar-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.lesson-calendar-columns h4 {
    margin: 0 0 6px;
    font-size: 0.9rem;
}

.meeting-link {
    width: fit-content;
    color: var(--teal);
    font-weight: 900;
}

.muted-inline {
    color: var(--muted);
}

.lesson-info-form {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(42, 40, 36, 0.34);
}

.modal-panel {
    width: min(720px, 100%);
    max-height: min(760px, calc(100vh - 36px));
    overflow-y: auto;
    padding: 18px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    background: var(--panel);
    box-shadow: 0 26px 70px rgba(42, 40, 36, 0.22);
}

.modal-heading {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.modal-heading h3 {
    margin: 0;
}

.modal-close-button {
    min-height: 34px;
    padding: 7px 10px;
    border-radius: var(--radius-md);
    background: #fff0ee;
    color: var(--danger);
    font-weight: 900;
}

.privacy-policy-panel {
    max-width: 720px;
}

.set-name-modal-panel {
    max-width: 460px;
}

.group-word-set-progress {
    width: 100%;
    overflow-x: auto;
    margin: 12px 0;
}

.compact-progress-table {
    min-width: 560px;
}

.compact-progress-table th,
.compact-progress-table td {
    padding: 8px 10px;
    font-size: 0.9rem;
}

@media (min-width: 640px) {
    .organization-overview-set-progress-list .compact-progress-table {
        min-width: 0;
        table-layout: fixed;
    }

    .organization-overview-set-progress-list .compact-progress-table th,
    .organization-overview-set-progress-list .compact-progress-table td {
        padding: 7px 5px;
        font-size: 0.8rem;
        overflow-wrap: anywhere;
    }

    .organization-overview-set-progress-list .compact-progress-table th:nth-child(1) { width: 17%; }
    .organization-overview-set-progress-list .compact-progress-table th:nth-child(2) { width: 10%; }
    .organization-overview-set-progress-list .compact-progress-table th:nth-child(3) { width: 10%; }
    .organization-overview-set-progress-list .compact-progress-table th:nth-child(4) { width: 11%; }
    .organization-overview-set-progress-list .compact-progress-table th:nth-child(5) { width: 12%; }
    .organization-overview-set-progress-list .compact-progress-table th:nth-child(6) { width: 12%; }
    .organization-overview-set-progress-list .compact-progress-table th:nth-child(7) { width: 10%; }
    .organization-overview-set-progress-list .compact-progress-table th:nth-child(8) { width: 8%; }
    .organization-overview-set-progress-list .compact-progress-table th:nth-child(9) { width: 10%; }
}

.privacy-policy-content {
    display: grid;
    gap: 10px;
    color: var(--muted);
    line-height: 1.6;
}

.privacy-policy-content p {
    margin: 0;
}

.privacy-policy-content h4 {
    margin: 10px 0 0;
    color: var(--ink);
}

.privacy-policy-content ul {
    margin: 0;
    padding-left: 20px;
}

.privacy-policy-content a {
    color: var(--primary-deep);
    font-weight: 800;
}

.privacy-page {
    min-height: 100vh;
    margin: 0;
    background: var(--bg);
}

.privacy-page-shell {
    width: min(960px, calc(100% - 32px));
    margin: 0 auto;
    padding: 40px 0;
}

.privacy-page-panel {
    max-width: none;
    max-height: none;
    overflow: visible;
}

.privacy-page-panel h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.4rem);
    line-height: 1;
}

.privacy-page-panel .modal-close-button {
    text-decoration: none;
}

.contact-page-panel {
    max-width: 720px;
}

.contact-page-intro {
    max-width: 62ch;
    margin: 24px 0;
    color: var(--muted);
    line-height: 1.6;
}

.lesson-bound-form {
    margin-top: 14px;
    border-color: var(--primary);
    box-shadow: inset 4px 0 0 var(--primary);
}

.teacher-card ul {
    margin: 10px 0 0;
    padding-left: 20px;
    color: var(--muted);
}

.metric-card {
    min-height: 132px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--panel-soft);
}

.metric-card strong {
    display: block;
    margin: 8px 0;
    font-size: 2rem;
}

.metric-card span,
.section-copy,
.next-step-title,
.typing-prompt {
    color: var(--muted);
    line-height: 1.55;
}

.next-step-title {
    margin-bottom: 0;
    color: var(--ink);
    font-weight: 800;
}

.split-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
    gap: 18px;
    align-items: start;
}

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

.word-set-language-pickers {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: end;
    gap: 8px;
    margin: 12px 0;
}

.word-set-language-picker {
    position: relative;
    min-width: 0;
}

.language-pair-arrow {
    padding-bottom: 10px;
    color: var(--accent);
    font-size: 1.3rem;
    font-weight: 900;
}

.language-picker-trigger {
    width: 100%;
    min-height: 44px;
    border: 2px solid var(--primary);
    border-radius: var(--radius-md);
    background: var(--primary);
    color: #ffffff;
    font: inherit;
    font-weight: 900;
    text-align: left;
}

.language-picker-trigger.is-target {
    border-color: #176b57;
    background: #176b57;
    color: #ffffff;
}

.language-picker-trigger:hover,
.language-picker-trigger[aria-expanded="true"] {
    box-shadow: 0 0 0 3px rgba(151, 13, 40, 0.2);
}

.language-picker-trigger.is-target:hover,
.language-picker-trigger.is-target[aria-expanded="true"] {
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.language-picker-trigger::after {
    content: "v";
    float: right;
    color: #ffffff;
}

.language-picker-menu {
    position: absolute;
    z-index: 40;
    top: calc(100% + 5px);
    right: 0;
    left: 0;
    max-height: 270px;
    overflow: auto;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--panel);
    box-shadow: 0 14px 28px rgba(42, 40, 36, 0.17);
}

.language-picker-search {
    display: grid;
    gap: 4px;
    font-size: 0.78rem;
}

.language-picker-search input {
    min-height: 34px;
    direction: ltr;
    text-align: left;
    unicode-bidi: plaintext;
}

.language-picker-options {
    display: grid;
    gap: 2px;
    margin-top: 8px;
}

.language-picker-options button {
    min-height: 34px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ink);
    text-align: left;
    font-weight: 800;
}

.language-picker-options button:hover,
.language-picker-options button.is-selected {
    background: #f3e3d5;
    color: var(--accent);
}

.word-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--panel-soft);
}

.word-row > .remove-row-button {
    margin-top: 27px;
}

.word-special-characters {
    display: none;
    margin-top: 4px;
}

.word-special-characters.is-visible {
    display: block;
}

.word-special-characters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    width: fit-content;
    max-width: 100%;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel);
    box-shadow: 0 10px 22px rgba(42, 40, 36, 0.14);
}

.word-special-characters-list button {
    min-width: 28px;
    min-height: 28px;
    padding: 3px;
    border: 0;
    border-radius: var(--radius-sm);
    background: #f3e3d5;
    color: var(--ink);
    font-weight: 800;
}

.word-special-characters-list .word-special-case-toggle {
    border: 1px solid var(--accent);
    background: var(--panel);
    color: var(--accent);
}

.remove-row-button,
.table-action.danger {
    background: #fff0ee;
    color: var(--danger);
}

.danger-button {
    background: #fff0ee;
    color: var(--danger);
}

.material-link {
    padding: 0;
    min-height: 0;
    border-radius: 0;
    background: transparent;
    color: var(--primary-deep);
    font-weight: 800;
    text-align: left;
    text-decoration: underline;
}

body.teacher-portal-active .topbar,
body.teacher-portal-active .mode-nav,
body.teacher-portal-active .workspace-layout > .sidebar-panel,
body.teacher-portal-active .dashboard-panel {
    display: none;
}

body.study-portal-active .topbar,
body.study-portal-active .mode-nav {
    display: none;
}

body.study-portal-active .workspace-layout {
    grid-template-columns: 1fr;
    margin-top: 0;
}

body.study-portal-active .workspace-main,
body.study-portal-active #study-content {
    width: 100%;
    min-width: 0;
}

body.teacher-portal-active .study-sidebar,
body.teacher-portal-active .study-topbar,
body.teacher-portal-active .dashboard-panel {
    display: none;
}

body.teacher-portal-active .study-portal-frame {
    grid-template-columns: 1fr;
}

body.teacher-portal-active .workspace-layout {
    grid-template-columns: 1fr;
    margin-top: 0;
}

body.teacher-portal-active .workspace-main,
body.teacher-portal-active #study-content,
body.teacher-portal-active #teacher-mode {
    width: 100%;
}

#student-sections-panel,
#teacher-mode {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #fffaf4;
}

#study-content,
.study-portal-frame,
.student-portal-frame,
.teacher-portal-frame,
.study-portal-main,
.student-portal-main,
.teacher-portal-main {
    margin-top: 0;
    padding-top: 0;
}

.study-portal-frame,
.student-portal-frame,
.teacher-portal-frame {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    min-height: calc(100vh - 56px);
}

#student-sections-panel .student-portal-frame {
    grid-template-columns: minmax(0, 1fr);
}

.study-sidebar,
.student-sidebar,
.teacher-sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    max-height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 12px 18px;
    border-right: 1px solid var(--line);
    background: #f3e7d8;
}

.teacher-brand {
    padding: 10px 12px 14px;
    color: var(--primary-deep);
    font-size: 1.35rem;
    font-weight: 900;
}

.teacher-brand img {
    display: block;
    width: 72px;
    height: auto;
    margin-inline: auto;
}

.sidebar-brand-row {
    display: grid;
    gap: 8px;
    padding-bottom: 8px;
}

.sidebar-brand-row .teacher-brand {
    padding-bottom: 4px;
}

.sidebar-logout-button {
    width: 100%;
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fffaf4;
    color: var(--primary-deep);
    font-weight: 800;
}

.study-nav-item,
.student-nav-item,
.teacher-nav-item {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    background: transparent;
    color: #34423e;
    text-align: left;
    font-weight: 750;
}

.study-nav-item.is-active,
.student-nav-item.is-active,
.teacher-nav-item.is-active {
    background: #fffaf4;
    color: var(--primary-deep);
}

.study-portal-main,
.student-portal-main,
.teacher-portal-main {
    display: grid;
    align-content: start;
    gap: 0;
    min-width: 0;
    background: #fffdf9;
}

.study-topbar,
.teacher-topbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    padding: 0 20px 16px;
    border-bottom: 1px solid var(--line);
    background: #f8efe4;
}

.student-portal-main > .feedback {
    margin: 18px 20px 0;
}

.student-section {
    display: grid;
    gap: 16px;
    margin: 18px 20px 0;
}

.student-section > h3 {
    margin: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.student-section-panel {
    display: grid;
    gap: 14px;
}

.study-topbar h2,
.teacher-topbar h2 {
    margin: 2px 0 0;
}

.study-active-set-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    color: var(--muted);
    font-weight: 800;
}

.study-active-set-summary span {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.study-active-set-summary strong {
    color: var(--ink);
    font-size: 1rem;
}

.study-active-set-summary em {
    font-style: normal;
}

.words-progress-panel {
    margin-top: 16px;
}

.study-sets-browser {
    margin-bottom: 16px;
}

.study-sets-browser .panel-heading {
    align-items: start;
}

.profile-form {
    max-width: 620px;
}

.delete-account-form {
    border-color: rgba(179, 47, 37, 0.35);
    background: #fff5f2;
}

.delete-account-form h3 {
    color: #b32f25;
}

.profile-avatar-preview {
    width: 120px;
    height: 120px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    overflow: hidden;
    background: #fffaf4;
    color: var(--muted);
    font-weight: 900;
}

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

.avatar-crop-modal-panel {
    width: min(440px, calc(100vw - 28px));
    display: grid;
    justify-items: center;
    gap: 16px;
}

.avatar-crop-modal-panel .modal-heading,
.avatar-crop-modal-panel > .section-copy {
    width: 100%;
}

.avatar-crop-stage {
    position: relative;
    width: min(280px, calc(100vw - 90px));
    aspect-ratio: 1;
    border-radius: 50%;
    background: #1e1f22;
    overflow: hidden;
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.avatar-crop-stage.is-dragging {
    cursor: grabbing;
}

.avatar-crop-stage img {
    position: absolute;
    max-width: none;
    pointer-events: none;
    user-select: none;
}

.avatar-crop-shade {
    position: absolute;
    inset: 0;
    border: 3px solid rgba(255, 255, 255, 0.82);
    border-radius: 50%;
    box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.24);
    pointer-events: none;
}

.avatar-crop-zoom-label {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 800;
}

.avatar-crop-zoom-label input {
    width: 100%;
}

.avatar-crop-actions {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.calendar-assignment-link {
    padding: 0;
    background: transparent;
    color: var(--teal);
    font-weight: 900;
    text-align: left;
    text-decoration: underline;
}

.student-assignment-card.is-highlighted {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(182, 102, 61, 0.18);
}

.student-grade-value,
.assignment-result-summary strong {
    font-weight: 900;
}

.grade-tone-low,
.grade-tone-mid,
.grade-tone-high {
    display: inline-block;
    padding: 4px 8px;
    border-radius: var(--radius-md);
}

.grade-tone-low {
    background: #fff0ee;
    color: #b42318;
}

.grade-tone-mid {
    background: #fff7dc;
    color: #8a5b00;
}

.grade-tone-high {
    background: #eaf7ef;
    color: #167343;
}

.student-grades-average-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.student-grades-average-card h3 {
    margin: 0;
}

.writing-compare.corrected p {
    font-weight: 400;
}

.teacher-correction-change {
    padding: 1px 3px;
    border-radius: 3px;
    background: #fff0bd;
    color: var(--ink);
    font-weight: 900;
}

.student-grade-list {
    display: none;
    gap: 10px;
}

.student-grade-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--line);
    border-left: 5px solid var(--primary);
    border-radius: var(--radius-md);
    background: #fffaf4;
}

.choice-option-field {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
}

.choice-option-field span {
    color: var(--primary-deep);
    font-weight: 900;
}

.choice-quiz-question-list {
    display: grid;
    gap: 12px;
    margin: 12px 0;
}

.choice-quiz-question {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fffaf4;
}

.choice-quiz-question legend {
    padding: 0 5px;
    color: var(--ink);
    font-weight: 900;
}

.choice-quiz-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #ffffff;
    cursor: pointer;
}

.choice-quiz-option input {
    width: auto;
    margin: 0;
}

.gap-answer-field {
    display: grid;
    gap: 6px;
    margin-top: 2px;
    color: var(--muted);
    font-weight: 800;
}

.gap-answer-field input {
    width: 100%;
    border: 2px solid var(--line-strong);
    background: #ffffff;
}

.message-bubble.is-pinned {
    border-color: var(--warning);
    box-shadow: inset 3px 0 0 var(--warning);
}

.message-bubble.is-highlighted {
    box-shadow: 0 0 0 4px rgba(166, 95, 0, 0.2);
}

.message-avatar {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border: 2px solid var(--line-strong);
    border-radius: 50%;
    background: var(--panel-soft) center / cover no-repeat;
    color: var(--primary-deep);
    font-weight: 900;
}

.message-avatar.has-image {
    color: transparent;
}

.message-bubble-content {
    flex: 1 1 auto;
    min-width: 0;
    display: block !important;
}

.message-bubble-content > div {
    display: flex;
}

.student-grade-row div {
    display: grid;
    gap: 3px;
}

.student-grade-row span
{
    color: var(--muted);
}
.student-grade-row p {
    color: var(--teal);
}

.student-grade-row p {
    grid-column: 1 / -1;
    margin: 0;
    font-weight: 800;
}

.student-grade-row .student-grade-value {
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 1.2rem;
}

@media (max-width: 700px) {
    .student-gradebook-wrap {
        display: none;
    }

    .student-grade-list {
        display: grid;
    }

    .student-grades-card,
    .student-grades-average-card {
        min-width: 0;
    }
}

.submission-grade-form input[name="grade"],
.submission-grade-form input[name="feedback"],
.correction-editor textarea {
    border-width: 2px;
    font-weight: 800;
}

.submission-grade-form input[name="grade"] {
    border-color: var(--warning);
    background: #fff8e8;
}

.admin-users-list {
    display: grid;
    gap: 12px;
}

.admin-contact-requests-list {
    display: grid;
    gap: 14px;
}

.admin-contact-request {
    display: grid;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--line);
    border-left: 5px solid var(--primary);
    background: var(--panel);
}

.admin-contact-request.is-handled {
    border-left-color: var(--success);
    opacity: 0.78;
}

.admin-contact-request-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.admin-contact-request-heading h3,
.admin-contact-request-heading p,
.admin-contact-request-message {
    margin: 0;
}

.admin-contact-request-heading p,
.admin-contact-request-details,
.admin-contact-request-message {
    color: var(--muted);
}

.admin-contact-status {
    flex: 0 0 auto;
    padding: 5px 9px;
    border-radius: 4px;
    background: #fff0dc;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 800;
}

.is-handled .admin-contact-status {
    background: #e6f5ec;
    color: var(--success);
}

.admin-contact-request-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
}

.admin-contact-request-details div {
    display: grid;
    gap: 3px;
}

.admin-contact-request-details dt {
    color: var(--ink);
    font-size: 0.8rem;
    font-weight: 800;
}

.admin-contact-request-details dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.admin-contact-request-message {
    padding: 12px;
    border: 1px solid var(--line);
    line-height: 1.5;
}

.admin-contact-request-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-users-table select {
    min-width: 130px;
}

.admin-teacher-picker {
    display: grid;
    gap: 8px;
}

.admin-teacher-checkbox-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 8px;
    max-height: 260px;
    overflow: auto;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fffaf4;
}

.admin-teacher-checkbox {
    display: flex;
    gap: 8px;
    align-items: center;
    min-height: 36px;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    font-weight: 800;
}

.admin-teacher-checkbox input {
    width: auto;
    min-height: 0;
}

.compact-toggle {
    justify-content: flex-start;
}

.password-form {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.teacher-top-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.teacher-top-group-picker {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: min(280px, 100%);
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fffaf4;
    color: var(--muted);
    font-weight: 800;
}

.teacher-top-group-picker span {
    font-size: 0.82rem;
    text-transform: uppercase;
}

.teacher-top-group-trigger {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    padding: 6px 8px;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-weight: 800;
    text-align: left;
}

.teacher-top-group-trigger::after {
    content: "▾";
    margin-left: 10px;
    color: var(--muted);
}

.teacher-group-picker-modal-panel {
    max-width: 760px;
}

.group-word-set-goal-modal-panel {
    max-width: 520px;
}

.modal-action-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.teacher-group-picker-list {
    display: grid;
    gap: 12px;
}

.teacher-group-picker-option {
    width: 100%;
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fffaf4;
    color: var(--ink);
    text-align: left;
}

.teacher-group-picker-option span {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.teacher-group-picker-option.is-selected {
    border-color: var(--teal);
    background: #fffaf4;
    background: var(--teal-soft);
}

.teacher-top-actions > span {
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fffaf4;
    color: var(--muted);
    font-weight: 800;
}

.teacher-grade-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--line);
    background: #fbf2e7;
}

#teacher-mode > .teacher-portal-frame > .teacher-portal-main > .panel-heading {
    display: none;
}

.teacher-portal-main > .teacher-grid,
.teacher-portal-main > .feedback,
.teacher-portal-main > .teacher-report {
    margin: 18px 20px 0;
}

.teacher-portal-main > .teacher-report {
    order: 1;
}

.teacher-portal-main > .teacher-grid {
    order: 2;
}

.teacher-portal-main > .feedback {
    order: 3;
}

.teacher-section-shell {
    display: grid;
    gap: 18px;
    margin: 18px 20px 0;
    order: 1;
}

.teacher-section {
    display: grid;
    gap: 16px;
}

.teacher-section > h3 {
    margin: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.teacher-section > .stack-form,
.teacher-section > .teacher-report,
.teacher-section > .teacher-section-content {
    margin: 0;
}

.teacher-section .teacher-report {
    display: block;
}

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

.teacher-group-tool-card {
    display: grid;
    gap: 10px;
    min-height: 170px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #fffaf4;
    color: var(--ink);
    text-align: left;
    box-shadow: 0 14px 30px rgba(42, 40, 36, 0.06);
}

.teacher-group-tool-card span {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    font-weight: 900;
}

.teacher-group-tool-card .teacher-assignment-tool-icon {
    width: 42px;
    height: 42px;
    background: rgba(191, 107, 62, 0.12);
    color: var(--primary);
}

.teacher-assignment-tool-icon svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.teacher-group-tool-card strong {
    font-size: 1.12rem;
}

.teacher-group-tool-card small {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

.teacher-group-tool-card:hover {
    border-color: rgba(191, 107, 62, 0.45);
    transform: translateY(-1px);
}

.teacher-group-tools-modal-panel,
.teacher-assignment-tools-modal-panel {
    display: grid;
    gap: 16px;
    width: min(860px, calc(100vw - 28px));
    max-height: min(82vh, 760px);
    overflow: auto;
}

.teacher-assignment-tools-modal-panel {
    width: min(1180px, calc(100vw - 48px));
    max-height: min(90vh, 980px);
}

.teacher-group-tool-panel,
.teacher-assignment-tool-panel {
    display: grid;
    gap: 14px;
}

.teacher-group-tool-panel > .stack-form,
.teacher-group-tool-panel > .teacher-section-content,
.teacher-assignment-tool-panel > .teacher-card,
.teacher-assignment-tool-panel > .teacher-section-content {
    margin: 0;
}

.assignment-template-group {
    display: grid;
    gap: 10px;
}

.assignment-template-group summary {
    cursor: pointer;
    font-weight: 900;
}

.assignment-template-group summary span {
    color: var(--primary);
}

.assignment-tool-list {
    display: grid;
    gap: 10px;
}

.assignment-tool-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fffaf4;
}

.assignment-tool-row > div:first-child {
    display: grid;
    gap: 4px;
}

.assignment-tool-row span,
.assignment-tool-count {
    color: var(--muted);
    font-size: 0.88rem;
}

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

.teacher-inline-form {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    align-items: end;
    background: #fffaf4;
}

.teacher-inline-form h3 {
    grid-column: 1 / -1;
}

#teacher-assignments-section {
    align-content: start;
}

.assignment-form-card {
    display: grid;
    gap: 10px;
}

.assignment-form-card .stack-form {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

#teacher-assignments-panel {
    display: grid;
    gap: 14px;
    min-width: 0;
}

#teacher-assignments-panel > .teacher-card {
    display: grid;
    gap: 12px;
    min-width: 0;
}

#teacher-assignments-panel .material-link {
    max-width: 100%;
    overflow-wrap: anywhere;
}

.preparation-block {
    display: grid;
    gap: 10px;
    padding: 14px 0;
    border-top: 1px solid var(--line);
}

.preparation-block:first-of-type {
    border-top: 0;
}

.assignment-category {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--panel-soft);
    overflow: hidden;
}

.assignment-category + .assignment-category {
    margin-top: 12px;
}

.assignment-category summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: var(--ink);
    font-weight: 900;
    cursor: pointer;
}

.assignment-category summary span {
    min-width: 30px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #ffffff;
    color: var(--primary-deep);
    text-align: center;
}

.assignment-category-graded summary {
    background: var(--teal-soft);
    color: var(--success);
}

.assignment-category-ungraded summary {
    background: #fff0d4;
    color: var(--warning);
}

.message-teacher-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 7px;
}

.message-teacher-actions .message-pin-button {
    margin-top: 0;
}

.message-delete-button {
    padding: 4px 8px;
    border: 1px solid rgba(123, 13, 30, 0.28);
    border-radius: var(--radius-md);
    background: #fff0f1;
    color: var(--primary-deep);
    font-weight: 800;
}

.assignment-category-content {
    padding: 0 14px 14px;
}

.preparation-review-form {
    display: grid;
    gap: 8px;
    min-width: 220px;
}

.preparation-review-form label,
.submission-grade-form label {
    display: grid;
    gap: 5px;
    font-weight: 800;
}

.preparation-review-form textarea,
.submission-grade-form textarea[name="feedback"] {
    width: 100%;
    border: 2px solid var(--line-strong);
}

.assignment-grade-comment {
    margin: 10px 0 0;
    padding: 10px 12px;
    border-left: 4px solid var(--warning);
    background: #fff8e8;
}

.preparation-heading {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted);
}

.preparation-heading strong {
    color: var(--text);
}

.assignment-heading-main {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    flex-wrap: wrap;
    gap: 6px 8px;
    min-width: 0;
}

.assignment-heading-main strong {
    overflow-wrap: anywhere;
}

.preparation-block .assignment-heading-main .assignment-deadline-button {
    width: auto;
    min-height: 32px;
    padding: 5px 10px;
    font-size: 0.85rem;
}

.assignment-delete-button {
    margin-left: auto;
    flex: 0 0 auto;
}

.preparation-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #ffffff;
}

.preparation-table {
    width: 100%;
    min-width: 920px;
    border-collapse: collapse;
    table-layout: fixed;
}

.preparation-table th,
.preparation-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.preparation-table th:nth-child(1) { width: 13%; }
.preparation-table th:nth-child(2) { width: 10%; }
.preparation-table th:nth-child(3) { width: 30%; }
.preparation-table th:nth-child(4) { width: 10%; }
.preparation-table th:nth-child(5) { width: 37%; }

.preparation-table th {
    background: #fffaf4;
}

.preparation-table td {
    overflow-wrap: anywhere;
    vertical-align: top;
}

.preparation-table .submission-grade-form {
    min-width: 300px;
    grid-template-columns: 1fr;
    align-items: stretch;
}

.preparation-table .submission-grade-form textarea {
    min-height: 92px;
    resize: vertical;
}

.preparation-table .submission-grade-form input,
.preparation-table .submission-grade-form textarea,
.preparation-table .submission-grade-form button {
    width: 100%;
}

.preparation-table .submission-grade-form .grade-submit-button {
    justify-self: stretch;
}

.quiz-review-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(110px, 140px);
    gap: 8px;
}

.quiz-review-fields input,
.quiz-review-fields textarea {
    width: 100%;
}

@media (max-width: 700px) {
    .quiz-review-fields {
        grid-template-columns: 1fr;
    }
}

.teacher-section-shell + .panel-heading,
.teacher-portal-main > .teacher-grid:empty {
    display: none;
}

#teacher-grades-section .teacher-board-header,
#teacher-grades-section .teacher-lower-grid {
    display: none;
}

.teacher-board {
    display: grid;
    gap: 14px;
}

.teacher-board-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: end;
}

.teacher-board-select {
    min-width: 260px;
}

.gradebook-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #ffffff;
}

.gradebook-table {
    width: 100%;
    min-width: 820px;
    border-collapse: collapse;
}

.student-gradebook-table {
    min-width: 580px;
}

.student-gradebook-table td:first-child,
.student-gradebook-table td:last-child {
    text-align: left;
}

.gradebook-table th,
.gradebook-table td {
    padding: 12px 10px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    text-align: center;
}

.gradebook-table th {
    background: #fffaf4;
    color: #182320;
    font-size: 0.82rem;
    text-transform: uppercase;
}

.gradebook-table th span,
.gradebook-table th small {
    display: block;
}

.gradebook-table th small {
    margin-top: 4px;
    color: var(--muted);
    text-transform: none;
}

.gradebook-table .student-name {
    min-width: 220px;
    text-align: left;
    color: #2f4772;
}

.prepared-cell {
    background: #e8f4df;
    color: #2c761f;
    font-weight: 900;
}

.missing-cell {
    background: #fff1df;
    color: #a14b1f;
    font-weight: 900;
}

.average-cell {
    background: #ffffff;
    color: #2f4772;
    font-weight: 900;
}

.empty-grade-cell {
    color: var(--muted);
}

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

.tool-divider {
    height: 1px;
    margin: 22px 0;
    background: var(--line);
}

.subpanel {
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

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

.words-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.words-table th,
.words-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

.words-table th {
    color: var(--muted);
    font-size: 0.9rem;
}

.word-edit-input {
    width: 100%;
    min-height: 34px;
    padding: 7px 9px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: #fffaf4;
}

.words-table tr.is-editing {
    background: rgba(255, 247, 232, 0.62);
}

.table-empty {
    text-align: center;
}

.table-action {
    margin: 3px;
    background: #e9efff;
    color: var(--primary-deep);
}

.word-status {
    display: inline-flex;
    padding: 6px 9px;
    border-radius: 999px;
    background: var(--teal-soft);
    color: var(--teal);
    font-weight: 800;
    font-size: 0.85rem;
}

.flashcard-heading-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

.flashcard-front-language {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: min(230px, 100%);
    white-space: nowrap;
}

.flashcard-front-language::after {
    position: absolute;
    right: 12px;
    color: var(--muted);
    content: "▾";
    pointer-events: none;
}

.flashcard-front-language select {
    flex: 1;
    min-width: 0;
    min-height: 34px;
    padding: 6px 24px 6px 8px;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-weight: 800;
    appearance: none;
}

#flashcards-mode > .panel-heading {
    flex-wrap: wrap;
}

.flashcard-surface {
    position: relative;
    width: 100%;
    min-height: 260px;
    display: grid;
    place-items: center;
    gap: 12px;
    padding: 24px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #fffaf4, #f2e1cf);
    color: var(--ink);
    text-align: center;
    touch-action: pan-y;
    user-select: none;
    transform-origin: center bottom;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
    will-change: transform;
    overflow: hidden;
    cursor: pointer;
}

.flashcard-surface:focus-visible {
    outline: 3px solid rgba(54, 95, 86, 0.28);
    outline-offset: 3px;
}

.flashcard-surface::after {
    position: absolute;
    top: 18px;
    right: 18px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.88);
    font-weight: 900;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 160ms ease, transform 160ms ease;
}

.flashcard-surface.is-dragging {
    cursor: grabbing;
    transition: box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
}

.flashcard-surface.is-review-hint {
    border-color: #d36a55;
    background: linear-gradient(180deg, #fff4ef, #f0d2c6);
    box-shadow: 0 16px 34px rgba(155, 66, 44, 0.18);
}

.flashcard-surface.is-review-hint::after {
    left: 18px;
    right: auto;
    color: #a43d29;
    content: "Do powtorki";
    opacity: 1;
    transform: translateY(0);
}

.flashcard-surface.is-mastered-hint {
    border-color: #69a977;
    background: linear-gradient(180deg, #f4fff4, #d6ead8);
    box-shadow: 0 16px 34px rgba(65, 125, 75, 0.18);
}

.flashcard-surface.is-mastered-hint::after {
    color: #2e7c43;
    content: "Opanowane";
    opacity: 1;
    transform: translateY(0);
}

.flashcard-surface.is-swipe-left {
    animation: flashcardSwipeLeft 240ms ease-in forwards;
}

.flashcard-surface.is-swipe-right {
    animation: flashcardSwipeRight 240ms ease-in forwards;
}

.flashcard-surface.is-flipping {
    animation: flashcardFlip 280ms ease-in-out;
}

.flashcard-surface strong {
    font-size: clamp(2.2rem, 4vw, 4rem);
}

.flashcard-speaker-button {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(54, 95, 86, 0.2);
    border-radius: 50%;
    background: rgba(255, 250, 244, 0.92);
    color: var(--primary);
    box-shadow: 0 10px 22px rgba(42, 40, 36, 0.12);
}

.flashcard-speaker-button svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.flashcard-speaker-button:hover {
    transform: translateY(-1px);
    background: #ffffff;
}

@keyframes flashcardFlip {
    0% {
        transform: perspective(900px) rotateY(0deg);
        box-shadow: var(--shadow);
    }
    49% {
        transform: perspective(900px) rotateY(88deg) scale(0.98);
        box-shadow: 0 10px 26px rgba(31, 55, 49, 0.08);
    }
    51% {
        transform: perspective(900px) rotateY(-88deg) scale(0.98);
        box-shadow: 0 10px 26px rgba(31, 55, 49, 0.08);
    }
    100% {
        transform: perspective(900px) rotateY(0deg);
        box-shadow: var(--shadow);
    }
}

@keyframes flashcardSwipeLeft {
    from {
        transform: translateX(var(--swipe-start, 0)) rotate(-6deg);
        opacity: 1;
    }
    to {
        transform: translateX(-120%) rotate(-14deg);
        opacity: 0;
    }
}

@keyframes flashcardSwipeRight {
    from {
        transform: translateX(var(--swipe-start, 0)) rotate(6deg);
        opacity: 1;
    }
    to {
        transform: translateX(120%) rotate(14deg);
        opacity: 0;
    }
}

.flashcard-actions,
.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.flashcard-actions {
    justify-content: center;
    margin-top: 16px;
}

#flashcard-progress {
    display: block;
    margin: 10px 0 0;
    text-align: center;
    font-weight: 800;
    color: var(--muted);
}

#prev-flashcard {
    background: linear-gradient(135deg, #b42318 0%, #d45a4f 100%);
}

#prev-flashcard,
#next-flashcard,
#flashcard-hard-button,
#flip-flashcard {
    min-width: 126px;
    color: #ffffff;
    border: 1px solid transparent;
}

#next-flashcard {
    background: linear-gradient(135deg, #16815c 0%, #37a274 100%);
}

#typing-mark-correct {
    background: #e6f0eb;
    color: var(--success);
    font-weight: 900;
}

.quiz-mark-correct {
    background: #e6f0eb;
    color: var(--success);
    font-weight: 900;
}

#flashcard-hard-button {
    background: linear-gradient(135deg, #a65f00 0%, #d28a25 100%);
}

#flip-flashcard {
    background: linear-gradient(135deg, #2563a6 0%, #4e91d9 100%);
}

#prev-flashcard:hover,
#next-flashcard:hover,
#flashcard-hard-button:hover,
#flip-flashcard:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
}

.typing-prompt {
    padding: 14px;
    border-radius: var(--radius-md);
    background: var(--teal-soft);
    color: var(--ink);
    font-weight: 800;
}

.quiz-render,
.quiz-wrapper,
.quiz-questions {
    display: grid;
    gap: 14px;
}

.quiz-title {
    display: grid;
    gap: 6px;
}

.quiz-title strong {
    font-size: 1.35rem;
}

.question-card {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--panel-soft);
}

.question-card h3 {
    margin-bottom: 12px;
    font-size: 1.12rem;
}

.option-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #ffffff;
}

.option-row input {
    accent-color: var(--primary);
}

.option-row.is-correct {
    border-color: rgba(22, 129, 92, 0.55);
    background: #eef8f2;
}

.option-row.is-muted {
    opacity: 0.72;
}

.quiz-step-card .primary-button {
    justify-self: start;
    margin-top: 8px;
}

.result-note {
    margin: 10px 0 0;
    font-weight: 800;
}

.result-note.success {
    color: var(--success);
}

.result-note.error {
    color: var(--danger);
}

.result-banner {
    padding: 14px;
    border-radius: var(--radius-md);
    background: var(--teal-soft);
    color: var(--teal);
    font-weight: 800;
}

.quiz-options-panel {
    max-width: 520px;
}

.quiz-type-switches {
    display: grid;
    gap: 10px;
}

.switch-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--panel-soft);
    font-weight: 900;
}

.switch-row input[type="checkbox"] {
    width: 44px;
    height: 24px;
    appearance: none;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #d9c9b6;
    position: relative;
    cursor: pointer;
}

.switch-row input[type="checkbox"]::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    transition: transform 0.16s ease;
}

.switch-row input[type="checkbox"]:checked {
    background: var(--primary);
}

.switch-row input[type="checkbox"]:checked::after {
    transform: translateX(20px);
}

.switch-row input[type="checkbox"]:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.weekday-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.weekday-picker legend {
    padding: 0 6px;
    color: var(--ink);
    font-weight: 900;
}

.weekday-picker .section-copy {
    flex: 1 0 100%;
    margin: 0;
}

.weekday-picker label {
    display: inline-flex;
    flex: 1 0 72px;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fffaf4;
    font-weight: 800;
}

.weekday-time-picker {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.weekday-time-picker legend {
    padding: 0 6px;
    color: var(--ink);
    font-weight: 900;
}

.weekday-time-picker .section-copy {
    margin: 0;
}

.weekday-time-list {
    display: grid;
    gap: 8px;
}

.weekday-time-row {
    display: grid;
    grid-template-columns: minmax(100px, 1fr) repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: end;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.weekday-time-row label {
    display: grid;
    gap: 4px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

@media (max-width: 520px) {
    .weekday-time-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .weekday-time-row strong {
        grid-column: 1 / -1;
    }
}

.teaching-languages-field {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.teaching-languages-field legend {
    padding: 0;
}

.teaching-languages-picker {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fffaf4;
}

.teaching-languages-picker summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 12px;
    color: var(--ink);
    font-weight: 900;
    cursor: pointer;
}

.teaching-languages-picker summary span {
    color: var(--muted);
    font-size: 0.85rem;
}

.teaching-languages-picker .weekday-picker {
    margin: 0 10px 10px;
}

.is-hidden {
    display: none !important;
}

body.lingso-android-app #dashboard-shell {
    min-height: 100vh;
    background: var(--panel);
}

body.lingso-android-app .topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    border-radius: 0;
    border-width: 0 0 1px;
    box-shadow: 0 10px 24px rgba(42, 40, 36, 0.08);
}

body.lingso-android-app .topbar h1 {
    font-size: 1.2rem;
}

body.lingso-android-app #account-summary span {
    display: none;
}

body.lingso-android-app .mode-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    border-radius: 0;
    border-width: 1px 0 0;
    background: #f8efe4;
    box-shadow: 0 -12px 30px rgba(42, 40, 36, 0.14);
}

body.lingso-android-app .mode-button {
    display: grid;
    place-items: center;
    min-height: 52px;
    padding: 8px 6px;
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 0.78rem;
}

body.lingso-android-app .mode-button::before,
body.lingso-android-app .student-nav-item::before,
body.lingso-android-app .teacher-nav-item::before,
body.lingso-android-app .study-nav-item::before,
body.lingso-android-app .set-portal-nav-item::before,
body.lingso-android-app .set-study-nav-item::before,
body.lingso-android-app .sidebar-logout-button::before {
    content: "•";
    display: block;
    margin-bottom: 3px;
    font-size: 1rem;
    line-height: 1;
}

/* Keep every mobile navigation symbol consistent with the student lesson tiles. */
body.lingso-android-app .mode-button::before,
body.lingso-android-app .student-nav-item::before,
body.lingso-android-app .teacher-nav-item::before,
body.lingso-android-app .study-nav-item::before,
body.lingso-android-app .set-portal-nav-item::before,
body.lingso-android-app .set-study-nav-item::before,
body.lingso-android-app .sidebar-logout-button::before {
    display: grid;
    place-items: center;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    margin: 0;
    border-radius: 999px;
    background: var(--primary-deep);
    color: #ffffff;
    line-height: 1;
}

body.lingso-android-app [data-app-nav="start"]::before,
body.lingso-android-app [data-mode-target="sets-list-mode"]::before {
    content: "⌂";
}

body.lingso-android-app [data-app-nav="words"]::before,
body.lingso-android-app [data-mode-target="sets-mode"]::before {
    content: "Aa";
    font-size: 0.86rem;
    font-weight: 900;
}

body.lingso-android-app .student-nav-item[data-app-nav="tasks"]::before,
body.lingso-android-app [data-student-section="student-assignments-section"]::before {
    content: "";
}

body.lingso-android-app .student-nav-item[data-app-nav="tasks"],
body.lingso-android-app [data-student-section="student-assignments-section"] {
    position: relative;
}

body.lingso-android-app .student-nav-item[data-app-nav="tasks"]::after,
body.lingso-android-app [data-student-section="student-assignments-section"]::after {
    content: "≋";
    position: absolute;
    top: 13px;
    left: 50%;
    display: grid;
    place-items: center;
    width: 15px;
    height: 17px;
    border-radius: 2px;
    background: #ffffff;
    color: var(--primary-deep);
    font-size: 1rem;
    font-weight: 900;
    line-height: 1;
    transform: translateX(-50%);
}

body.lingso-android-app [data-app-nav="lessons"]::before,
body.lingso-android-app [data-student-section="student-lessons-section"]::before,
body.lingso-android-app [data-app-nav="calendar"]::before,
body.lingso-android-app [data-mode-target="teacher-mode"]::before {
    content: "◷";
    font-size: 1.24rem;
}

body.lingso-android-app [data-app-nav="create-set"]::before {
    content: "+";
    font-size: 1.1rem;
    font-weight: 900;
}

body.lingso-android-app [data-app-nav="sets"]::before {
    content: "▤";
}

body.lingso-android-app [data-app-nav="groups"]::before {
    content: "♟";
    font-size: 1.12rem;
}

body.lingso-android-app [data-app-nav="materials"]::before,
body.lingso-android-app [data-student-section="student-materials-section"]::before {
    content: "";
}

body.lingso-android-app [data-app-nav="materials"],
body.lingso-android-app [data-student-section="student-materials-section"] {
    position: relative;
}

body.lingso-android-app [data-app-nav="materials"]::after,
body.lingso-android-app [data-student-section="student-materials-section"]::after {
    content: "";
    position: absolute;
    top: 15px;
    left: 50%;
    width: 16px;
    height: 14px;
    box-sizing: border-box;
    border: 2px solid #ffffff;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent 46%, #ffffff 46%, #ffffff 54%, transparent 54%);
    transform: translateX(-50%);
}

body.lingso-android-app [data-teacher-section="teacher-assignments-section"]::before,
body.lingso-android-app [data-app-secondary-nav="grades"]::before,
body.lingso-android-app [data-student-section="student-grades-section"]::before {
    content: "A+";
    font-size: 0.82rem;
    font-weight: 900;
}

body.lingso-android-app [data-app-nav="messages"]::before {
    content: "✉";
    font-size: 1.16rem;
}

body.lingso-android-app [data-app-nav="board"]::before {
    content: "▣";
}

body.lingso-android-app [data-app-nav="admin"]::before,
body.lingso-android-app [data-app-nav="school"]::before {
    content: "⚙";
}

body.lingso-android-app [data-app-nav="teacher"]::before {
    content: "▤";
}

body.lingso-android-app [data-app-nav="flashcards"]::before {
    content: "▯";
}

body.lingso-android-app [data-app-nav="learn"]::before {
    content: "▶";
}

body.lingso-android-app [data-app-nav="typing"]::before {
    content: "⌨";
}

body.lingso-android-app [data-app-nav="quiz"]::before {
    content: "?";
    font-weight: 900;
}

body.lingso-android-app [data-app-nav="stats"]::before {
    content: "▥";
}

body.lingso-android-app .sidebar-logout-button::before {
    content: "↪";
}

body.lingso-android-app .sidebar-logout-button {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

body.lingso-android-app .workspace-layout,
body.lingso-android-app .study-portal-frame,
body.lingso-android-app .student-portal-frame,
body.lingso-android-app .teacher-portal-frame,
body.lingso-android-app .sets-portal-frame {
    grid-template-columns: 1fr;
}

body.lingso-android-app .workspace-main,
body.lingso-android-app .study-portal-main,
body.lingso-android-app .student-portal-main,
body.lingso-android-app .teacher-portal-main,
body.lingso-android-app .sets-portal-main {
    min-height: calc(100vh - 72px);
}

body.lingso-android-app .study-sidebar,
body.lingso-android-app .student-sidebar,
body.lingso-android-app .teacher-sidebar,
body.lingso-android-app .sets-sidebar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1001;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(74px, 86px);
    gap: 4px;
    max-height: none;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    border-top: 1px solid var(--line);
    border-right: 0;
    background: #f8efe4;
    box-shadow: 0 -12px 30px rgba(42, 40, 36, 0.14);
}

body.lingso-android-app .teacher-brand,
body.lingso-android-app .study-brand,
body.lingso-android-app .sets-sidebar > :not(.set-portal-nav-item) {
    display: none;
}

body.lingso-android-app .study-nav-item,
body.lingso-android-app .student-nav-item,
body.lingso-android-app .teacher-nav-item,
body.lingso-android-app .set-portal-nav-item {
    min-height: 52px;
    padding: 8px 6px;
    text-align: center;
    font-size: 0.78rem;
}

body.lingso-android-app .student-nav-item[data-app-secondary-nav],
body.lingso-android-app .teacher-nav-item[data-app-secondary-nav] {
    display: grid;
}

body.lingso-android-app .student-sidebar,
body.lingso-android-app .teacher-sidebar {
    grid-template-columns: none;
}

body.lingso-android-app.teacher-portal-active .mode-nav,
body.lingso-android-app.study-portal-active .mode-nav {
    display: none;
}

body.lingso-android-app.teacher-portal-active .app-shell,
body.lingso-android-app.study-portal-active .app-shell {
    padding-bottom: calc(104px + env(safe-area-inset-bottom));
}

body.lingso-android-app .panel {
    border-radius: 0;
    box-shadow: none;
}

body.lingso-android-app .mode-panel,
body.lingso-android-app .student-section-panel,
body.lingso-android-app .teacher-section {
    border-radius: 0;
}

.notification-form {
    background: #f9f0e4;
    border-color: var(--line);
}

@media (max-width: 1050px) {
    .teacher-group-tools-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .workspace-layout,
    .split-grid {
        grid-template-columns: 1fr;
    }

    .landing-header,
    .landing-hero,
    .landing-about,
    .landing-audience-grid,
    .landing-audience-card {
        grid-template-columns: 1fr;
    }

    .landing-header {
        justify-items: start;
    }

    .landing-header .landing-nav {
        justify-content: flex-start;
    }

    .landing-hero .auth-card {
        justify-self: stretch;
        width: 100%;
        max-width: 620px;
    }

    .landing-hero-copy {
        padding-left: 0;
    }

    .landing-device-stage {
        min-height: 420px;
    }

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

    .landing-chaos-panel {
        grid-template-columns: 1fr;
        padding: 34px;
    }

    .landing-chaos-map {
        min-height: 280px;
    }

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

    .study-portal-frame,
    .student-portal-frame,
    .teacher-portal-frame,
    .sets-portal-frame {
        grid-template-columns: 1fr;
    }

    .study-sidebar,
    .student-sidebar,
    .teacher-sidebar,
    .sets-sidebar {
        position: static;
        max-height: none;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .teacher-brand {
        white-space: nowrap;
        padding: 6px 10px;
    }

    .teacher-brand img {
        width: 48px;
    }

    .study-nav-item,
    .student-nav-item,
    .teacher-nav-item,
    .set-portal-nav-item {
        width: auto;
        white-space: nowrap;
    }

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

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

@media (max-width: 700px) {
    .teacher-group-tools-grid {
        grid-template-columns: 1fr;
    }

    .teacher-start-calendar-card {
        overflow: visible;
    }

    .teacher-week-calendar-grid {
        display: none;
    }

    .teacher-mobile-calendar-list {
        display: grid;
        gap: 8px;
    }

    .teacher-mobile-calendar-day {
        display: grid;
        gap: 7px;
        padding: 9px;
        border: 1px solid var(--line);
        border-radius: var(--radius-md);
        background: var(--panel);
    }

    .teacher-mobile-calendar-day.is-today {
        border-color: color-mix(in srgb, var(--primary) 48%, var(--line));
        background: #fff7ef;
    }

    .teacher-mobile-calendar-day header {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 10px;
    }

    .teacher-mobile-calendar-day header strong {
        font-size: 0.88rem;
    }

    .teacher-mobile-calendar-day header span,
    .teacher-mobile-calendar-empty {
        color: var(--muted);
        font-size: 0.75rem;
        font-weight: 800;
    }

    .teacher-mobile-calendar-lessons {
        display: grid;
        justify-items: start;
        gap: 4px;
    }

    .teacher-mobile-calendar-group {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        column-gap: 8px;
        width: min(100%, 320px);
        max-width: 100%;
        padding: 8px 10px;
        border: 1px solid var(--group-color, var(--line));
        border-radius: 6px;
        background: color-mix(in srgb, var(--group-color, #fffaf4) 16%, #fffaf4);
        color: var(--ink);
        text-align: left;
    }

    .teacher-mobile-calendar-time {
        grid-row: 1 / span 2;
        align-self: center;
        color: var(--primary-deep);
        font-size: 0.72rem;
        font-weight: 900;
        white-space: nowrap;
    }

    .teacher-mobile-calendar-group strong,
    .teacher-mobile-calendar-group small {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .teacher-mobile-calendar-group strong {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
        font-size: 0.82rem;
    }

    .teacher-mobile-calendar-group small {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
        color: var(--muted);
        font-size: 0.72rem;
        font-weight: 800;
    }

    .teacher-week-calendar-time {
        padding: 4px 1px;
        justify-content: flex-start;
        font-size: 0.56rem;
    }

    .teacher-week-calendar-day {
        padding: 5px 1px;
    }

    .teacher-week-calendar-day strong {
        font-size: 0.62rem;
    }

    .teacher-week-calendar-day span {
        font-size: 0.5rem;
    }

    .teacher-week-calendar-cell .teacher-start-calendar-groups {
        margin-inline: 2px;
        gap: 2px;
    }

    .teacher-week-calendar-cell .teacher-start-calendar-group {
        gap: 2px;
        min-height: 56px;
        min-height: max(var(--lesson-height, 0px), 56px);
        padding: 5px 4px;
        border-radius: 5px;
        font-size: 0.58rem;
        line-height: 1.12;
    }

    .teacher-week-calendar-cell .teacher-start-calendar-group span {
        font-size: 0.52rem;
    }

    .teacher-start-calendar-grid {
        min-width: 720px;
    }

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

    .assignment-tool-actions {
        justify-content: flex-start;
    }

    .app-shell {
        width: min(100% - 18px, 1320px);
        padding-top: 12px;
        padding-bottom: calc(92px + env(safe-area-inset-bottom));
    }

    .study-sidebar,
    .student-sidebar,
    .teacher-sidebar,
    .sets-sidebar {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 1200;
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 78px;
        gap: 4px;
        width: 100vw;
        max-height: none;
        padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        border-right: 0;
        border-top: 1px solid var(--line);
        border-bottom: 0;
        background: #f3e7d8;
        box-shadow: 0 -12px 30px rgba(42, 40, 36, 0.14);
    }

    .study-nav-item,
    .student-nav-item,
    .teacher-nav-item,
    .set-portal-nav-item,
    .sidebar-logout-button {
        width: 78px;
        min-width: 0;
        min-height: 52px;
        padding: 7px 4px;
        white-space: normal;
        text-align: center;
        font-size: 0.72rem;
        line-height: 1.1;
    }

    .teacher-brand,
    .study-brand,
    .sets-sidebar > :not(.set-portal-nav-item) {
        display: none;
    }

    .topbar,
    .study-topbar,
    .teacher-topbar {
        justify-content: center;
        text-align: center;
    }

    .topbar > *,
    .study-topbar > *,
    .teacher-topbar > * {
        justify-content: center;
    }

    .auth-card,
    .topbar,
    .mode-nav,
    .sidebar-panel,
    .dashboard-panel,
    .mode-panel {
        padding: 16px;
    }

    .landing-header {
        gap: 16px;
        padding-bottom: 18px;
    }

    .landing-header .landing-nav {
        gap: 12px;
    }

    .landing-actions a,
    .landing-audience-card .primary-button {
        width: 100%;
    }

    .landing-hero {
        min-height: 0;
        gap: 24px;
        padding: 18px 0 42px;
    }

    .landing-hero-copy h1 {
        font-size: 2.6rem;
    }

    .landing-hero-copy > p:not(.panel-kicker) {
        font-size: 1.08rem;
    }

    .landing-section-copy h2,
    .landing-cta h2 {
        font-size: 2.1rem;
    }

    .landing-section-copy .panel-kicker2 {
        font-size: 1.15rem;
    }

    .landing-audience-card h1 {
        font-size: 2rem;
        min-height: 0;
    }

    .landing-audience-card .panel-kicker {
        font-size: 1.7rem;
    }

    .landing-audience-card .landing-checklist {
        grid-template-rows: none;
    }

    .landing-audience-card > div:first-child {
        grid-template-rows: none;
        row-gap: 0;
    }

    .landing-device-stage {
        min-height: 310px;
    }

    .landing-device-stage::before {
        width: 92%;
        height: 250px;
        transform: translate(8px, -4px);
    }

    .device.laptop {
        padding: 9px 9px 15px;
    }

    .device.laptop::after {
        left: -12px;
        right: -12px;
        height: 12px;
    }

    .mock-app {
        grid-template-columns: 86px 1fr;
        min-height: 260px;
    }

    .mock-sidebar {
        gap: 6px;
        padding: 10px;
    }

    .mock-sidebar strong {
        font-size: 1rem;
    }

    .mock-sidebar > span {
        padding: 6px;
        font-size: 0.66rem;
    }

    .mock-dashboard {
        padding: 16px;
    }

    .mock-dashboard h3 {
        margin-bottom: 14px;
        font-size: 1.12rem;
    }

    .mock-user {
        display: none;
    }

    .mock-card-grid {
        gap: 8px;
    }

    .mock-card-grid div {
        min-height: 64px;
        padding: 10px;
    }

    .landing-about {
        gap: 34px;
        padding: 44px 0;
    }

    .mock-calendar {
        min-height: 250px;
        padding: 14px;
    }

    .mock-calendar-grid {
        grid-template-rows: 48px repeat(4, 36px);
        gap: 4px;
    }

    .lesson {
        padding: 6px;
        font-size: 0.68rem;
    }

    .landing-feature-grid {
        grid-template-columns: 1fr;
        padding-top: 46px;
    }

    .landing-chaos-panel {
        margin: 38px 0 34px;
        padding: 26px 20px;
    }

    .landing-chaos-map {
        min-height: 430px;
        max-width: 360px;
        margin: 0 auto;
    }

    .chaos-connectors {
        display: none;
    }

    .landing-chaos-map::before {
        top: 50%;
        width: 96%;
        height: 230px;
    }

    .chaos-icon {
        width: 50px;
        height: 50px;
        border-radius: 14px;
    }

    .chaos-icon svg {
        width: 27px;
        height: 27px;
    }

    .chaos-item {
        gap: 5px;
    }

    .chaos-item span {
        max-width: 86px;
        font-size: 0.68rem;
        line-height: 1.12;
    }

    .chaos-item.notes {
        left: 3%;
        top: 20px;
    }

    .chaos-item.drive {
        right: 20%;
        left: auto;
        top: 10px;
    }

    .chaos-item.messages {
        left: 7%;
        bottom: 76px;
    }

    .chaos-item.grades {
        right: 7%;
        top: 112px;
    }

    .chaos-item.mail {
        left: 50%;
        top: 104px;
        bottom: auto;
        transform: translateX(-50%);
    }

    .chaos-target {
        right: auto;
        left: 50%;
        top: 216px;
        width: 138px;
        height: 98px;
        border-width: 6px;
        outline-offset: 4px;
        transform: translate(-50%, -50%);
    }

    .chaos-target strong {
        font-size: 1.58rem;
    }

    .chaos-target span {
        font-size: 0.62rem;
    }

    .chaos-output {
        right: auto;
        left: 50%;
        top: 312px;
        width: min(220px, 92%);
        gap: 7px;
        transform: translateX(-50%);
    }

    .chaos-output span {
        width: 100%;
        padding: 9px 10px;
        text-align: center;
        font-size: 0.72rem;
    }

    .landing-audience-grid {
        padding-bottom: 44px;
    }

    .landing-audience-card {
        padding: 22px;
    }

    #landing-teacher,
    .student-card {
        grid-template-columns: 1fr;
    }

    .mini-screen {
        justify-self: center;
        width: min(230px, 100%);
    }

    .site-footer {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

    .site-footer nav,
    .footer-legal {
        justify-content: center;
    }

    .mini-screen,
    .device.phone {
        justify-self: center;
    }

    .device.phone {
        width: 160px;
    }

    .mock-phone-app {
        min-height: 280px;
        padding: 0;
    }

    .topbar,
    .panel-heading,
    .dashboard-header,
    .builder-heading {
        display: grid;
    }

    .account-summary {
        justify-content: stretch;
    }

    .account-summary span,
    .account-summary button,
    .tab-button,
    .mode-button,
    .primary-button,
    .secondary-button,
    .ghost-button,
    .remove-row-button {
        width: 100%;
    }

    .stats-grid,
    .wide-stats,
    .teacher-grid,
    .teacher-start-student-row,
    .student-report-summary-grid,
    .student-report-mini-grid,
    .word-row {
        grid-template-columns: 1fr;
    }

    .word-row > .remove-row-button {
        margin-top: 0;
    }

    .teacher-student-report-button {
        justify-self: stretch;
    }

    .flashcard-actions,
    .inline-actions {
        display: grid;
        grid-template-columns: 1fr;
    }
}

body.lingso-android-app {
    min-height: 100svh;
    overflow-x: hidden;
}

body.lingso-android-app .app-shell {
    width: 100%;
    min-height: 100svh;
    padding: 0 0 calc(78px + env(safe-area-inset-bottom));
}

body.lingso-android-app .student-sidebar,
body.lingso-android-app .teacher-sidebar,
body.lingso-android-app .study-sidebar,
body.lingso-android-app .sets-sidebar {
    position: fixed !important;
    right: 0;
    bottom: 0;
    left: 0;
    top: auto !important;
    z-index: 2200;
    display: flex !important;
    justify-content: flex-start;
    align-items: stretch;
    width: 100vw;
    height: auto;
    min-height: 0;
    max-height: none;
    padding: 6px 5px calc(6px + env(safe-area-inset-bottom));
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    border-top: 1px solid var(--line);
    background: #f8efe4;
}

body.lingso-android-app .student-sidebar::-webkit-scrollbar,
body.lingso-android-app .teacher-sidebar::-webkit-scrollbar,
body.lingso-android-app .study-sidebar::-webkit-scrollbar,
body.lingso-android-app .sets-sidebar::-webkit-scrollbar {
    display: none;
}

body.lingso-android-app .student-nav-item,
body.lingso-android-app .teacher-nav-item,
body.lingso-android-app .study-nav-item,
body.lingso-android-app .set-portal-nav-item {
    flex: 0 0 78px;
    width: 78px !important;
    min-width: 78px;
    min-height: 48px;
    padding: 6px 2px;
    white-space: normal;
    line-height: 1.1;
    display: grid;
    place-items: center;
    gap: 1px;
    overflow-wrap: anywhere;
    font-size: 0.62rem;
}

body.lingso-android-app .topbar,
body.lingso-android-app .study-topbar,
body.lingso-android-app .teacher-topbar {
    justify-content: center;
    text-align: center;
}

body.lingso-android-app .topbar > *,
body.lingso-android-app .study-topbar > *,
body.lingso-android-app .teacher-topbar > * {
    justify-content: center;
}

body.lingso-android-app .study-nav-item[data-student-section="student-start-section"] {
    order: 1;
}

body.lingso-android-app .study-nav-item[data-study-mode-target="sets-list-mode"] {
    order: 2;
}

body.lingso-android-app .study-nav-item[data-study-mode-target="sets-mode"] {
    order: 3;
}

body.lingso-android-app .study-nav-item[data-student-section="student-assignments-section"] {
    order: 4;
}

body.lingso-android-app .study-nav-item[data-student-section="student-lessons-section"] {
    order: 5;
}

body.lingso-android-app .study-nav-item[data-student-section="student-materials-section"] {
    order: 6;
}

body.lingso-android-app .study-nav-item[data-student-section="student-board-section"] {
    order: 7;
}

body.lingso-android-app .study-nav-item[data-student-section="student-messages-section"] {
    order: 8;
}

body.lingso-android-app .student-lessons-grid {
    grid-template-columns: 1fr;
}

body.lingso-android-app .study-nav-item.study-admin-link,
body.lingso-android-app .study-nav-item.study-teacher-link,
body.lingso-android-app .study-logout-button {
    order: 20;
}

body.lingso-android-app .student-portal-frame,
body.lingso-android-app .teacher-portal-frame,
body.lingso-android-app .study-portal-frame,
body.lingso-android-app .sets-portal-frame {
    display: block;
    min-height: calc(100svh - 78px);
}

body.lingso-android-app .student-portal-main,
body.lingso-android-app .teacher-portal-main,
body.lingso-android-app .study-portal-main,
body.lingso-android-app .sets-portal-main {
    min-height: calc(100svh - 78px);
    padding-bottom: calc(118px + env(safe-area-inset-bottom));
    max-width: 100vw;
    overflow-x: hidden;
}

body.lingso-android-app .teacher-section-shell,
body.lingso-android-app .teacher-section,
body.lingso-android-app .teacher-card,
body.lingso-android-app .student-section-panel,
body.lingso-android-app .set-portal-section,
body.lingso-android-app .stack-form,
body.lingso-android-app .sets-list,
body.lingso-android-app .student-assignment-list {
    max-width: 100%;
    min-width: 0;
}

body.lingso-android-app .gradebook-wrap,
body.lingso-android-app .teacher-start-calendar-card,
body.lingso-android-app .group-word-set-progress,
body.lingso-android-app .words-table-wrapper {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

body.lingso-android-app .modal-panel {
    width: min(100% - 18px, 720px);
    max-height: calc(100svh - 24px);
    overflow: auto;
}

body.lingso-android-app .app-status-banner {
    bottom: calc(104px + env(safe-area-inset-bottom));
}

body.lingso-android-app .quick-notes-widget {
    position: static;
    right: auto;
    bottom: auto;
    left: auto;
    width: 100%;
    margin: 18px auto 8px;
    transform: none;
    z-index: auto;
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

body.lingso-android-app .quick-notes-widget.student-quick-links {
    flex-direction: column;
}

body.lingso-android-app .quick-notes-toggle {
    width: 46px;
    height: 46px;
}

body.lingso-android-app .quick-notes-toggle svg {
    width: 22px;
    height: 22px;
}

body.lingso-android-app .quick-notes-panel {
    position: fixed;
    right: 12px;
    bottom: calc(104px + env(safe-area-inset-bottom));
    left: 12px;
    width: auto;
    max-height: min(560px, calc(100svh - 190px));
    overflow: auto;
}

body.lingso-android-app .teacher-start-calendar-card {
    gap: 8px;
    padding: 10px;
    overflow: visible;
}

body.lingso-android-app .teacher-start-calendar-toolbar {
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    gap: 6px;
}

body.lingso-android-app .teacher-start-calendar-month {
    font-size: 1rem;
}

body.lingso-android-app .teacher-start-calendar-nav {
    min-height: 32px;
    font-size: 1.05rem;
}

body.lingso-android-app .teacher-start-calendar-grid {
    min-width: 0;
    width: 100%;
}

body.lingso-android-app .teacher-start-calendar-weekday {
    padding: 6px 2px;
    font-size: 0.58rem;
    letter-spacing: 0;
}

body.lingso-android-app .teacher-start-calendar-cell {
    min-height: 68px;
    gap: 4px;
    padding: 4px;
}

body.lingso-android-app .teacher-start-calendar-date {
    width: 22px;
    height: 22px;
    font-size: 0.72rem;
}

body.lingso-android-app .teacher-start-calendar-groups {
    gap: 3px;
}

body.lingso-android-app .teacher-start-calendar-group {
    gap: 1px;
    padding: 4px;
    border-radius: 6px;
    font-size: 0.62rem;
    line-height: 1.1;
}

body.lingso-android-app .teacher-start-calendar-group span {
    font-size: 0.56rem;
}

body.lingso-android-app .landing-chaos-panel {
    display: none;
}

body.lingso-android-app .landing-hero {
    grid-template-columns: 1fr;
    min-height: auto;
}

body.lingso-android-app .landing-hero-copy {
    display: none;
}

body.lingso-android-app .landing-hero .auth-card {
    justify-self: stretch;
    width: 100%;
}

/* Mobile web browsers use the same single-column portal layout as the app. */
@media (max-width: 700px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    body.study-portal-active .app-shell,
    body.teacher-portal-active .app-shell {
        width: 100%;
        padding: 0 0 calc(104px + env(safe-area-inset-bottom));
    }

    body.study-portal-active .workspace-main,
    body.teacher-portal-active .workspace-main,
    body.study-portal-active #study-content,
    body.teacher-portal-active #study-content,
    body.teacher-portal-active #teacher-mode {
        width: 100%;
        min-width: 0;
        overflow-x: hidden;
    }

    body.study-portal-active .student-portal-frame,
    body.study-portal-active .study-portal-frame,
    body.teacher-portal-active .teacher-portal-frame,
    body.study-portal-active .sets-portal-frame {
        display: block;
        min-height: calc(100svh - 72px);
    }

    body.study-portal-active .student-portal-main,
    body.study-portal-active .study-portal-main,
    body.teacher-portal-active .teacher-portal-main,
    body.study-portal-active .sets-portal-main {
        min-width: 0;
        min-height: calc(100svh - 72px);
        max-width: 100%;
        padding-bottom: calc(124px + env(safe-area-inset-bottom));
        overflow-x: hidden;
    }

    body.study-portal-active .student-sidebar,
    body.study-portal-active .study-sidebar,
    body.teacher-portal-active .teacher-sidebar,
    body.study-portal-active .sets-sidebar {
        position: fixed !important;
        top: auto !important;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 1500;
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 78px;
        gap: 4px;
        padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        border-top: 1px solid var(--line);
        border-right: 0;
        border-bottom: 0;
        background: #f8efe4;
        box-shadow: 0 -12px 30px rgba(42, 40, 36, 0.14);
        box-sizing: border-box;
        width: 100%;
    }

    .study-nav-item::before,
    .student-nav-item::before,
    .teacher-nav-item::before,
    .set-portal-nav-item::before,
    .sidebar-logout-button::before {
        content: "•";
        display: block;
        margin-bottom: 3px;
        font-size: 1rem;
        line-height: 1;
    }

    [data-app-nav="start"]::before {
        content: "⌂";
    }

    [data-app-nav="words"]::before {
        content: "Aa";
        font-size: 0.86rem;
        font-weight: 900;
    }

    [data-app-nav="tasks"]::before {
        content: "□";
    }

    [data-app-nav="groups"]::before {
        content: "◉";
    }

    [data-app-nav="materials"]::before {
        content: "▤";
    }

    [data-app-nav="calendar"]::before {
        content: "◷";
    }

    [data-app-nav="messages"]::before {
        content: "✉";
    }

    [data-app-nav="board"]::before {
        content: "▣";
    }

    .sidebar-logout-button::before {
        content: "↪";
    }

    body.study-portal-active .student-section,
    body.teacher-portal-active .teacher-section,
    body.teacher-portal-active .teacher-section-shell,
    body.teacher-portal-active .teacher-card,
    body.study-portal-active .student-section-panel,
    body.study-portal-active .set-portal-section,
    body.study-portal-active .stack-form,
    body.study-portal-active .sets-list,
    body.study-portal-active .student-assignment-list {
        min-width: 0;
        max-width: 100%;
    }
}

@media (max-width: 420px) {
    body.lingso-android-app .app-shell {
        width: 100%;
        padding-right: 0;
        padding-left: 0;
    }

    body.lingso-android-app .login-screen {
        padding: 14px 12px 96px;
    }

    body.lingso-android-app .landing-header {
        grid-template-columns: 1fr;
        gap: 10px;
        padding-bottom: 14px;
    }

    body.lingso-android-app .landing-header .landing-nav {
        justify-content: flex-start;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 4px;
        flex-wrap: nowrap;
    }

    body.lingso-android-app .landing-header .landing-nav a {
        flex: 0 0 auto;
        font-size: 0.78rem;
    }

    body.lingso-android-app .landing-hero {
        gap: 18px;
        padding: 10px 0 28px;
    }

    body.lingso-android-app .landing-hero-copy h1 {
        font-size: 2.05rem;
        line-height: 1.05;
    }

    body.lingso-android-app .landing-hero-copy > p:not(.panel-kicker),
    body.lingso-android-app .landing-section-copy p {
        font-size: 0.92rem;
        line-height: 1.55;
    }

    body.lingso-android-app .landing-actions {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    body.lingso-android-app .auth-card,
    body.lingso-android-app .topbar,
    body.lingso-android-app .mode-panel,
    body.lingso-android-app .student-section-panel,
    body.lingso-android-app .teacher-section {
        padding: 14px 12px;
    }

    body.lingso-android-app .student-sidebar,
    body.lingso-android-app .teacher-sidebar,
    body.lingso-android-app .study-sidebar,
    body.lingso-android-app .sets-sidebar {
        gap: 2px;
        padding: 5px 3px calc(5px + env(safe-area-inset-bottom));
    }

    body.lingso-android-app .student-nav-item,
    body.lingso-android-app .teacher-nav-item,
    body.lingso-android-app .study-nav-item,
    body.lingso-android-app .set-portal-nav-item {
        flex-basis: 72px;
        width: 72px !important;
        min-width: 72px;
        min-height: 44px;
        padding: 5px 1px;
        font-size: 0.56rem;
    }

    body.lingso-android-app .student-nav-item::before,
    body.lingso-android-app .teacher-nav-item::before,
    body.lingso-android-app .study-nav-item::before,
    body.lingso-android-app .set-portal-nav-item::before {
        margin-bottom: 2px;
    }

    body.lingso-android-app .teacher-topbar,
    body.lingso-android-app .panel-heading,
    body.lingso-android-app .compact-heading {
        gap: 8px;
    }

    body.lingso-android-app .teacher-topbar h2,
    body.lingso-android-app .panel-heading h2,
    body.lingso-android-app .compact-heading h2 {
        font-size: 1.35rem;
    }

    body.lingso-android-app .stats-grid,
    body.lingso-android-app .wide-stats,
    body.lingso-android-app .teacher-grid,
    body.lingso-android-app .split-grid,
    body.lingso-android-app .word-row {
        grid-template-columns: 1fr;
    }

    body.lingso-android-app .app-status-banner {
        right: 8px;
        left: 8px;
        bottom: calc(112px + env(safe-area-inset-bottom));
        padding: 10px 12px;
        font-size: 0.78rem;
    }
}

body.lingso-android-app .landing-header {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    text-align: center;
}

body.lingso-android-app .landing-brand {
    justify-self: center;
}

body.lingso-android-app .landing-header .landing-nav {
    justify-content: center;
    flex-wrap: wrap;
    max-width: 100%;
    overflow-x: visible;
}

body.lingso-android-app .sidebar-logout-button {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 1px;
    flex: 0 0 78px;
    width: 78px;
    min-width: 78px;
    min-height: 48px;
    padding: 6px 2px;
    white-space: normal;
    text-align: center;
    font-size: 0.62rem;
    line-height: 1.1;
}

body.lingso-android-app .sidebar-logout-button::before {
    content: "";
    background-image: url("door-open.6b3663c86809.svg");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 22px 22px;
}

@media (max-width: 420px) {
    body.lingso-android-app .sidebar-logout-button {
        flex-basis: 72px;
        width: 72px;
        min-width: 72px;
        min-height: 44px;
        padding: 5px 1px;
        font-size: 0.56rem;
    }
}
