:root {
    --bg: #ffffff;
    --surface: #ffffff;
    --text: #202124;
    --muted: #6b7280;
    --line: #d9dee6;
    --accent: #789889;
    --accent-dark: #789889;
    --warn: #5f551f;
    --warning-bg: #c0b256;
    --warning-border: #a89a3f;
    --bad: #d58478;
    --ok: #207044;
    --markdown-image-height: 240px;
}

.test-question-editor-list {
    display: grid;
    gap: 18px;
}

.test-question-editor-item {
    border-bottom: 1px solid var(--line);
    min-width: 0;
    padding-bottom: 18px;
}

.test-question-editor-head {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.test-question-editor-head > strong {
    flex: 1 1 180px;
}

.test-question-editor-head label {
    align-items: center;
    display: flex;
    gap: 6px;
}

.test-question-statement {
    margin: 14px 0;
    min-width: 0;
}

.test-question-readonly-fields {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0;
}

.test-question-readonly-fields > div {
    border-top: 1px solid var(--line);
    min-width: 0;
    padding-top: 10px;
}

.test-question-readonly-fields dt {
    color: var(--muted);
    font-size: 13px;
}

.test-question-readonly-fields dd {
    margin: 4px 0 0;
    overflow-wrap: anywhere;
}

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

    .test-question-editor-head > strong {
        flex-basis: 100%;
        order: -1;
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

a {
    color: var(--accent-dark);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.topbar {
    align-items: center;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 28px;
    justify-content: space-between;
    min-height: 58px;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar-nav {
    margin-left: auto;
}

.topbar-nav a {
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
}

.brand {
    align-items: center;
    color: var(--text);
    display: inline-flex;
    font-size: 18px;
    font-weight: 700;
    gap: 10px;
}

.site-header-brand {
    flex: 0 0 auto;
    font-size: 18px;
    letter-spacing: 0;
    line-height: 1.15;
    max-width: 360px;
    text-align: left;
    text-transform: uppercase;
}

.site-header-brand:hover {
    text-decoration: none;
}

.brand-icon {
    border: 1px solid var(--line);
    border-radius: 50%;
    display: block;
    flex: 0 0 auto;
}

.nav {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.account-nav {
    background: #f7f9fb;
    border-bottom: 1px solid var(--line);
    justify-content: center;
    padding: 10px 28px;
}

.account-nav a {
    color: var(--text);
    font-weight: 700;
}

.account-mode-switch {
    align-items: center;
    background: #e9edf4;
    border-radius: 9px;
    display: inline-flex;
    gap: 3px;
    margin-left: 12px;
    padding: 3px;
}

.account-mode-switch form {
    margin: 0;
}

.account-mode-switch button {
    background: transparent;
    border: 0;
    color: var(--muted);
    min-height: 32px;
    padding: 5px 10px;
}

.account-mode-switch button.active {
    background: var(--surface);
    box-shadow: 0 1px 4px rgba(31, 42, 35, 0.14);
    color: var(--text);
}

.logout-form {
    margin: 0;
}

.logout-form button,
.button,
button {
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 6px;
    color: #ffffff;
    cursor: pointer;
    display: inline-block;
    font: inherit;
    min-height: 38px;
    padding: 8px 12px;
}

.button:hover,
button:hover {
    text-decoration: none;
}

button:disabled {
    opacity: 0.55;
    cursor: default;
}

.secondary-button {
    background: #ffffff;
    border-color: var(--accent);
    color: var(--accent-dark);
}

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

.disabled-button {
    background: #eef1f5;
    border-color: var(--line);
    color: var(--muted);
    cursor: default;
}

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

.page {
    margin: 0 auto;
    max-width: 1180px;
    padding: 28px;
}

.site-footer {
    align-items: center;
    color: var(--muted);
    display: flex;
    font-size: 13px;
    gap: 16px;
    justify-content: space-between;
    margin: 0 auto;
    max-width: 1180px;
    padding: 0 28px 24px;
}

.copy-toast {
    background: rgba(31, 42, 35, 0.92);
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(31, 42, 35, 0.18);
    color: #ffffff;
    font-size: 18px;
    left: 50%;
    max-width: min(420px, calc(100vw - 48px));
    opacity: 0;
    padding: 14px 20px;
    pointer-events: none;
    position: fixed;
    text-align: center;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.98);
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 1000;
}

.copy-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.copy-toast.is-fading {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.98);
    transition-duration: 1s;
}

.public-page-head {
    margin: 18px auto 24px;
    max-width: 940px;
}

.public-page-head h1 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 52px;
    font-weight: 400;
    line-height: 1.1;
    margin: 0;
}

.news-admin-panel {
    margin: 0 auto 24px;
    max-width: 940px;
}

.news-editor {
    margin-top: 14px;
}

.news-editor textarea {
    min-height: 180px;
}

.news-feed {
    display: grid;
    gap: 22px;
    margin: 0 auto;
    max-width: 940px;
    min-width: 0;
    width: 100%;
}

.news-card {
    border: 0;
    border-radius: 0;
    min-width: 0;
    padding: 0;
    width: 100%;
}

.news-card.is-draft {
    border-style: dashed;
}

.news-card-head {
    align-items: stretch;
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    min-width: 0;
}

.news-card-head > div,
.news-card-head time {
    padding: 14px 16px;
}

.news-card-head time {
    color: var(--muted);
    text-align: right;
}

.news-card h2 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 30px;
    font-weight: 400;
    line-height: 1.2;
    margin: 0;
}

.news-preview,
.news-body {
    padding: 18px 16px;
}

.news-preview.markdown,
.news-body.markdown {
    max-width: 100%;
    min-width: 0;
    overflow-x: visible;
    width: 100%;
}

.news-preview.is-collapsed {
    max-height: 460px;
    overflow: hidden;
}

.news-card-actions {
    align-items: center;
    border-top: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    padding: 12px 16px;
}

.news-expand-link {
    background: transparent;
    border: 0;
    color: var(--accent-dark);
    font-style: italic;
    margin-right: auto;
    min-height: 0;
    padding: 0;
}

.share-button {
    background: var(--accent);
    border-color: var(--accent);
}

.icon-actions {
    align-items: center;
    display: inline-flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.news-icon-actions {
    margin-left: auto;
}

.news-detail {
    margin: 0 auto;
    max-width: 860px;
}

.news-detail-head {
    border-bottom: 1px solid var(--line);
    margin-bottom: 20px;
    padding-bottom: 16px;
}

.news-detail-head h1 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 46px;
    font-weight: 400;
    line-height: 1.12;
    margin: 16px 0 8px;
}

.attachment-snippet-list {
    display: grid;
    gap: 12px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.attachment-snippet-list li {
    border: 1px solid var(--line);
    border-radius: 6px;
    display: grid;
    gap: 8px;
    padding: 12px;
}

.attachment-snippet-list code {
    background: #f5f7fa;
    border: 1px solid var(--line);
    border-radius: 4px;
    display: block;
    overflow-x: auto;
    padding: 8px;
}

.news-pending-attachments {
    display: grid;
    gap: 8px;
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
}

.news-pending-attachments li {
    align-items: start;
    border: 1px solid var(--line);
    border-radius: 6px;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 10px;
}

.news-pending-attachments code {
    background: #f5f7fa;
    border: 1px solid var(--line);
    border-radius: 4px;
    display: block;
    margin-top: 6px;
    overflow-x: auto;
    padding: 6px 8px;
}

.news-pending-remove {
    border-radius: 50%;
    font-size: 20px;
    height: 30px;
    line-height: 1;
    min-height: 30px;
    padding: 0;
    width: 30px;
}

.embedded-video {
    aspect-ratio: 16 / 9;
    background: #111827;
    border-radius: 6px;
    margin: 16px 0;
    overflow: hidden;
    width: 100%;
}

.embedded-video iframe {
    border: 0;
    height: 100%;
    width: 100%;
}

.placeholder-page {
    align-items: center;
    display: flex;
    justify-content: center;
    margin: 0 auto;
    max-width: 980px;
    min-height: min(70vh, 720px);
    padding: 32px 0;
}

.placeholder-page img {
    display: block;
    height: auto;
    max-width: min(420px, 82vw);
}

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

.contacts-layout {
    display: grid;
    gap: 28px;
    grid-template-columns: minmax(220px, 3fr) minmax(300px, 5fr);
    margin: 0 auto;
    max-width: 940px;
}

.contact-photo-card {
    align-self: start;
    aspect-ratio: 3 / 4;
    background: #f7f8f6;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 8px 18px rgba(32, 33, 36, 0.08);
    margin: 0;
    padding: 8px;
    overflow: hidden;
}

.contact-photo {
    border-radius: 5px;
    display: block;
    height: 100%;
    object-fit: cover;
    object-position: center;
    width: 100%;
}

.contact-info-card {
    align-content: start;
    align-items: flex-end;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    gap: 14px;
    justify-items: end;
    padding: 10px 0;
    text-align: right;
}

.contact-link {
    align-items: center;
    color: var(--text);
    display: inline-flex;
    flex-direction: row-reverse;
    font-size: 20px;
    gap: 12px;
    justify-content: flex-start;
}

.contact-link:hover {
    color: var(--accent-dark);
    text-decoration: none;
}

.contact-icon {
    border-radius: 50%;
    display: block;
    flex: 0 0 auto;
    height: 34px;
    width: 34px;
}

.contact-mail-icon {
    align-items: center;
    background: var(--accent);
    color: #ffffff;
    display: inline-flex;
    font-weight: 700;
    justify-content: center;
}

.contact-profi-widget {
    --profi-widget-scale: 1;
    display: flex;
    justify-content: flex-end;
    margin-top: auto;
    min-height: calc(100px * var(--profi-widget-scale));
    overflow: hidden;
    width: 100%;
}

.contact-profi-widget .profi-widget {
    transform: scale(var(--profi-widget-scale));
    transform-origin: right bottom;
}

.contact-body {
    border-top: 1px solid var(--line);
    grid-column: 1 / -1;
    padding-top: 22px;
}

.test-link-tools {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.test-link-tools code {
    overflow-wrap: anywhere;
    white-space: normal;
}

.teacher-tests-table {
    min-width: 0;
    table-layout: auto;
}

.teacher-tests-table .test-title-cell {
    min-width: 180px;
}

.teacher-tests-table th:last-child,
.teacher-tests-table td:last-child {
    text-align: right;
}

.teacher-test-actions {
    align-items: center;
    justify-content: flex-end;
    min-width: 168px;
}

.teacher-test-actions .inline-form {
    align-items: center;
    display: inline-flex;
    line-height: 1;
}

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

.category-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.category-actions .auto-submit-form label {
    align-items: center;
    display: inline-flex;
    gap: 8px;
}

.category-actions select {
    max-width: 220px;
}

.task-category-title-row h2 {
    margin: 0;
}

.task-category-tree {
    margin-top: 18px;
}

.task-collection-row .inline-form,
.material-head-actions .inline-form {
    align-items: center;
    display: inline-flex;
    line-height: 1;
}

.collection-folder-form label {
    align-items: center;
    display: flex;
    gap: 10px;
}

.collection-folder-form select {
    max-width: min(420px, 100%);
}

.task-category-detail-title {
    flex: 1 1 auto;
    min-width: 0;
}

.task-category-detail-title h1,
.task-category-detail-title p {
    margin: 0;
}

.test-landing {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: min(64vh, 620px);
}

.test-landing-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    max-width: 720px;
    padding: 32px;
    width: 100%;
}

.test-landing-card h1 {
    font-size: 34px;
    line-height: 1.2;
    margin: 4px 0 14px;
}

.test-landing-actions {
    margin-top: 18px;
}

.pagination {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 24px auto 0;
    max-width: 940px;
}

.footer-logout-form {
    margin: 0;
}

.footer-logout-form button {
    background: transparent;
    border: 0;
    color: var(--bad);
    min-height: 0;
    padding: 0;
}

.footer-logout-form button:hover {
    text-decoration: underline;
}

.task-basket {
    bottom: 18px;
    position: fixed;
    right: 18px;
    width: min(210px, calc(100vw - 24px));
    z-index: 30;
}

.task-basket:not(.has-items) {
    display: none;
}

.task-basket-toggle {
    box-shadow: 0 8px 18px rgba(32, 33, 36, 0.16);
    font-size: 13px;
    min-height: 34px;
    padding: 7px 10px;
    width: 100%;
}

.task-basket-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 12px 24px rgba(32, 33, 36, 0.18);
    font-size: 13px;
    margin-top: 6px;
    max-height: min(300px, calc(100vh - 120px));
    overflow: auto;
    padding: 10px;
}

.task-basket-head {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: space-between;
    margin-bottom: 8px;
}

.task-basket-list {
    display: grid;
    gap: 6px;
    list-style: none;
    margin: 0 0 10px;
    padding: 0;
}

.task-basket-list li {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    display: grid;
    gap: 4px 8px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 6px 8px;
}

.task-basket-topic {
    color: var(--muted);
    font-size: 12px;
    grid-column: 1;
}

.task-basket-remove {
    align-self: center;
    background: transparent;
    border: 0;
    color: var(--bad);
    font-size: 18px;
    grid-column: 2;
    grid-row: 1 / span 2;
    min-height: 28px;
    padding: 0 4px;
}

.task-basket form {
    margin: 0;
}

.task-basket form button {
    width: 100%;
}

.narrow {
    margin: 48px auto;
    max-width: 520px;
}

.page-head,
.section-head {
    align-items: center;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    margin-bottom: 18px;
}

.page-head h1,
.section-head h2 {
    margin: 0;
}

.page-head p {
    color: var(--muted);
    margin: 4px 0 0;
}

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

.student-add-menu {
    position: relative;
    z-index: 20;
}

.student-add-menu > button {
    cursor: pointer;
}

.student-add-menu > button::after {
    content: "⌄";
    margin-left: 7px;
    font-size: 12px;
}

.student-add-menu > button[aria-expanded="true"]::after {
    content: "⌃";
}

.student-add-menu-panel {
    position: absolute;
    top: calc(100% + 7px);
    right: 0;
    display: grid;
    min-width: 190px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 12px 30px rgba(32, 33, 36, .14);
}

.student-add-menu-panel[hidden] {
    display: none;
}

.student-add-menu-panel a {
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.student-add-menu-panel a:hover {
    color: var(--accent);
    background: rgba(120, 152, 137, .12);
}

.inline-form {
    display: inline;
    margin: 0;
}

.folder-create-form {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.folder-create-form label {
    display: grid;
    gap: 4px;
}

.folder-create-form label span,
.folder-parent-control .muted {
    font-size: 13px;
}

.auto-submit-form select,
.folder-create-form select,
.folder-create-form input {
    min-width: 190px;
}

.active-link {
    font-weight: 700;
}

.work-folder-section {
    border-top: 1px solid var(--line);
    margin-left: calc(var(--folder-depth, 0) * 18px);
    margin-top: 18px;
    padding-top: 18px;
}

.root-folder-section {
    margin-left: 0;
}

.work-folder-section h3 {
    margin: 0 0 12px;
}

.work-folder-summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    font-size: 20px;
    font-weight: 700;
    gap: 12px;
    justify-content: space-between;
    list-style: none;
    margin-bottom: 12px;
}

.work-folder-summary::-webkit-details-marker {
    display: none;
}

.work-folder-summary::before {
    color: var(--accent-dark);
    content: "▾";
    font-size: 15px;
    margin-right: 2px;
}

.work-folder-section:not([open]) > .work-folder-summary::before {
    content: "▸";
}

.work-folder-summary span:first-child {
    margin-right: auto;
}

.folder-parent-control {
    margin: 0 0 12px;
}

.folder-parent-control label {
    align-items: center;
    display: inline-flex;
    gap: 8px;
}

.link-button {
    background: transparent;
    border: 0;
    color: var(--accent-dark);
    display: inline;
    min-height: 0;
    padding: 0;
}

.link-button:hover {
    text-decoration: underline;
}

.danger-link {
    color: var(--bad);
}

.page-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.page-actions form {
    margin: 0;
}

.panel,
.form-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 18px;
    padding: 20px;
}

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

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

.workflow-step {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    gap: 10px;
    padding: 12px;
}

.workflow-step span {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 999px;
    display: inline-flex;
    font-weight: 700;
    height: 28px;
    justify-content: center;
    width: 28px;
}

.workflow-step.active {
    background: var(--surface);
}

.workflow-step.active span {
    background: var(--accent);
    color: #ffffff;
}

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

.stat span {
    color: var(--muted);
    display: block;
    font-size: 14px;
}

.stat strong {
    display: block;
    font-size: 28px;
    margin-top: 4px;
}

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

table {
    border-collapse: collapse;
    min-width: 760px;
    width: 100%;
}

.task-bank-subjects table {
    min-width: 0;
    width: 100%;
}

.task-bank-subjects th:last-child,
.task-bank-subjects td:last-child {
    text-align: right;
    white-space: nowrap;
    width: 1%;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

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

.muted-panel {
    background: #ffffff;
}

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

.assigned-tests-panel .student-card-grid {
    grid-template-columns: 1fr;
}

.student-test-card,
.student-attempt-card,
.empty-card {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
}

.archived-card {
    background: #f8fafc;
}

.student-card-head {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 14px;
}

.student-card-head h3,
.student-attempt-card h3 {
    font-size: 18px;
    margin: 0;
}

.student-card-head p,
.student-attempt-card p {
    color: var(--muted);
    margin: 4px 0 0;
}

.status-pill {
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    padding: 6px 9px;
    white-space: nowrap;
}

.status-pill.done {
    border-color: #b7dcc7;
    color: var(--ok);
}

.status-pill.pending {
    background: var(--warning-bg);
    border-color: var(--warning-border);
    color: var(--warn);
}

.status-pill.new {
    border-color: var(--accent);
    color: var(--accent-dark);
}

.status-pill.locked {
    border-color: var(--line);
    color: var(--muted);
}

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

.student-card-meta div {
    min-width: 0;
}

.student-card-meta dt {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 2px;
}

.student-card-meta dd {
    font-weight: 700;
    margin: 0;
}

.student-card-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pdf-button {
    align-items: center;
    display: inline-flex;
    gap: 7px;
}

.pdf-doc-icon {
    border: 1.8px solid currentColor;
    border-radius: 2px;
    display: inline-block;
    height: 18px;
    position: relative;
    width: 14px;
}

.pdf-doc-icon::before {
    border-bottom: 1.8px solid currentColor;
    border-left: 1.8px solid currentColor;
    content: "";
    height: 5px;
    position: absolute;
    right: -1.8px;
    top: -1.8px;
    width: 5px;
}

.attempt-card-list {
    display: grid;
    gap: 10px;
}

.student-attempt-card {
    align-items: center;
    display: flex;
    gap: 14px;
    justify-content: space-between;
}

.attempt-result {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    text-align: right;
}

.empty-cell {
    padding: 18px 10px;
}

.empty-cell strong {
    display: block;
    margin-bottom: 10px;
}

.answer-preview {
    color: var(--muted);
    max-width: 220px;
}

.messages {
    margin-bottom: 18px;
}

.message {
    background: #ffffff;
    border: 1px solid #cce8d5;
    border-radius: 6px;
    margin-bottom: 8px;
    padding: 10px 12px;
}

.message.error,
.message.warning {
    background: var(--warning-bg);
    border-color: var(--warning-border);
    color: var(--warn);
}

form p {
    margin: 0 0 14px;
}

label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="file"],
select,
textarea {
    background: #ebeff4;
    border: 1px solid #cfd6c8;
    border-radius: 6px;
    color: var(--text);
    font: inherit;
    font-size: 16px;
    max-width: 100%;
    padding: 9px 10px;
    width: 100%;
}

textarea {
    resize: vertical;
}

.helptext {
    color: var(--muted);
    display: block;
    font-size: 13px;
    margin-top: 4px;
}

.random-task-form {
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(120px, 0.35fr) repeat(3, minmax(200px, 1fr));
}

.random-task-form p {
    margin: 0;
}

.random-task-form button {
    align-self: end;
    justify-self: start;
}

.category-form {
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(180px, 0.9fr) repeat(3, minmax(190px, 1fr));
}

.category-form p {
    margin: 0;
}

.category-form button {
    align-self: end;
    justify-self: start;
}

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

.category-row {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    padding: 12px;
}

.category-row h3 {
    margin: 0 0 4px;
}

.category-row p {
    margin: 0;
}

.danger-zone {
    border-color: #d58478;
}

.danger-zone h2 {
    color: var(--bad);
}

.confirm-form {
    display: grid;
    gap: 10px;
    max-width: 520px;
}

.confirm-form button {
    justify-self: start;
}

.errorlist {
    color: var(--bad);
    margin: 0 0 8px;
    padding-left: 18px;
}

.form-actions,
.submit-row {
    align-items: center;
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.submit-row {
    justify-content: flex-end;
}

.submit-row.is-hidden {
    display: none;
}

.submit-row .primary {
    font-weight: 700;
    min-height: 46px;
    min-width: 180px;
}

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

.wide-left {
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
}

.small-input {
    max-width: 90px;
}

.question-card,
.question-result {
    border-bottom: 1px solid var(--line);
    padding: 18px 0;
}

.question-card:first-child,
.question-result:first-child {
    padding-top: 0;
}

.question-card header,
.question-result header {
    align-items: center;
    display: flex;
    gap: 14px;
    justify-content: space-between;
}

.question-card h2,
.question-result h2,
.question-result h3 {
    font-size: 20px;
    margin: 0 0 10px;
}

.task-card-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
}

.task-result-actions {
    justify-content: space-between;
    margin: 0 0 12px;
}

.task-result-actions p {
    margin: 0;
}

.task-select-control {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    display: inline-flex;
    gap: 6px;
    min-height: 38px;
    padding: 7px 10px;
    white-space: nowrap;
}

.markdown {
    max-width: 760px;
}

.question-card .markdown,
.question-result .markdown {
    max-width: 100%;
}

.question-card .markdown > :not(:has(img)),
.question-result .markdown > :not(:has(img)) {
    max-width: 100%;
}

.question-card .markdown > :has(img),
.question-result .markdown > :has(img) {
    max-width: 100%;
}

.markdown img,
.zoomable-image {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 6px;
    cursor: zoom-in;
    display: block;
    height: var(--markdown-image-height);
    margin: 12px 0;
    max-width: 100%;
    object-fit: contain;
    object-position: center;
    padding: 8px;
    width: 100%;
}

.markdown img.animated-gif {
    background: transparent;
    border: 0;
    border-radius: 0;
    cursor: default;
    height: auto;
    margin-left: auto;
    margin-right: auto;
    padding: 0;
    width: auto;
}

.markdown {
    overflow-wrap: break-word;
    overflow-x: auto;
}

.markdown .katex-display {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
}

.markdown .katex-display[data-math-zoom] {
    border-radius: 6px;
    cursor: zoom-in;
    padding: 8px 6px;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.markdown .katex-display[data-math-zoom]:hover {
    background: rgba(120, 152, 137, 0.08);
    box-shadow: inset 0 0 0 1px rgba(120, 152, 137, 0.18);
}

.markdown .katex-display[data-math-zoom]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.markdown .katex-display > .katex {
    display: inline-block;
    min-width: max-content;
}

.markdown table,
.question-card .markdown table,
.question-result .markdown table {
    border: 1px solid var(--line);
    border-collapse: collapse;
    display: table;
    margin: 14px auto;
    max-width: none;
    min-width: 0;
    table-layout: auto;
    width: max-content;
}

.markdown th,
.markdown td,
.question-card .markdown th,
.question-card .markdown td,
.question-result .markdown th,
.question-result .markdown td {
    border: 1px solid var(--line);
    min-width: 44px;
    padding: 8px 12px;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
}

.markdown th,
.question-card .markdown th,
.question-result .markdown th {
    background: #f6f8fb;
    color: var(--text);
    font-size: inherit;
}

.news-preview.markdown table,
.news-body.markdown table {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
    table-layout: auto;
    width: 100%;
}

.news-preview.markdown th,
.news-preview.markdown td,
.news-body.markdown th,
.news-body.markdown td {
    min-width: 0;
    overflow-wrap: anywhere;
    text-align: left;
    white-space: normal;
}

.markdown table + p {
    margin-top: 14px;
}

body.lightbox-open {
    overflow: hidden;
}

.image-lightbox[hidden] {
    display: none;
}

.image-lightbox {
    align-items: center;
    background: rgba(20, 25, 34, 0.88);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 28px;
    position: fixed;
    z-index: 1000;
}

.image-lightbox:not(.is-open) {
    display: none;
}

.image-lightbox img {
    background: #ffffff;
    border-radius: 6px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
    max-height: calc(100vh - 80px);
    max-width: calc(100vw - 48px);
    object-fit: contain;
}

.image-lightbox.is-math img {
    display: none;
}

.math-lightbox-content {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
    color: var(--text);
    max-height: calc(100vh - 80px);
    max-width: calc(100vw - 48px);
    overflow: auto;
    padding: 28px;
}

.math-lightbox-content .katex-display {
    font-size: 1.8rem;
    margin: 0;
    max-width: none;
    overflow: visible;
    padding: 0;
}

.math-lightbox-content .katex-display > .katex {
    min-width: max-content;
}

.image-lightbox-close {
    align-items: center;
    background: #ffffff;
    border: 1px solid #ffffff;
    border-radius: 999px;
    color: var(--text);
    display: inline-flex;
    font-size: 30px;
    height: 44px;
    justify-content: center;
    line-height: 1;
    min-height: 44px;
    padding: 0;
    position: fixed;
    right: 18px;
    top: 18px;
    width: 44px;
}

.attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.attachments a {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 6px 10px;
}

.field-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(var(--field-count, 1), minmax(0, 1fr));
    max-width: 100%;
    width: 100%;
}

.field-grid label,
.answer-field {
    margin: 0;
    min-width: 0;
    width: 100%;
}

.multi-field-rows {
    display: grid;
    gap: 12px;
    max-width: 100%;
    width: 100%;
}

.answer-block {
    margin-top: 18px;
}

.multi-answer-block {
    max-width: 100%;
    width: 100%;
}

.answer-block-title {
    font-size: 16px;
    line-height: 1.3;
    margin: 0 0 8px;
}

.answer-field .answer-input {
    width: 100%;
}

.answer-input {
    min-height: 46px;
}

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

.test-step-controls {
    align-items: center;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(160px, 1fr) auto minmax(160px, 1fr);
    margin: 18px 0;
}

.test-step-controls button {
    justify-self: stretch;
}

.test-step-counter {
    color: var(--muted);
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
}

.choice-list {
    display: grid;
    gap: 10px;
    max-width: 760px;
}

.choice-option {
    align-items: flex-start;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 6px;
    display: flex;
    gap: 10px;
    margin: 0;
    min-height: 52px;
    padding: 12px;
    touch-action: manipulation;
}

.choice-option input {
    flex: 0 0 auto;
    height: 20px;
    margin-top: 2px;
    width: 20px;
}

.choice-option span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.file-picker {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    font-weight: 400;
    gap: 10px;
    margin: 12px 0 8px;
    max-width: 760px;
    min-height: 52px;
    position: relative;
    touch-action: manipulation;
}

.file-picker input[type="file"] {
    cursor: pointer;
    height: 100%;
    inset: 0;
    opacity: 0;
    padding: 0;
    position: absolute;
    width: 100%;
}

.file-picker-button {
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 6px;
    color: #ffffff;
    display: inline-flex;
    min-height: 46px;
    padding: 10px 14px;
    text-align: center;
}

.file-picker-name {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.preview-options {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.preview-options label {
    align-items: center;
    display: flex;
    gap: 6px;
    margin: 0;
}

.answer-box,
.criteria-box,
.hint-box,
.solution-box {
    border-top: 1px solid var(--line);
    margin-top: 14px;
    padding-top: 14px;
}

.hint-details {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin: 14px 0;
    max-width: 100%;
    padding: 0;
}

.hint-details summary {
    cursor: pointer;
    font-weight: 700;
    list-style-position: inside;
    min-height: 44px;
    padding: 10px 12px;
    touch-action: manipulation;
}

.hint-details .markdown {
    border-top: 1px solid var(--line);
    padding: 12px;
}

.task-links {
    overflow-wrap: anywhere;
}

.task-list .question-card:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.sticky-head {
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    margin: -28px -28px 20px;
    padding: 18px 28px;
    position: sticky;
    top: 58px;
    z-index: 5;
}

.timer,
.result-badge {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    font-weight: 700;
    padding: 10px 14px;
}

.result-badge span {
    color: var(--muted);
    display: block;
    font-size: 13px;
    font-weight: 400;
}

.result-details h2 {
    margin: 0 0 12px;
}

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

.result-summary-item {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
}

.result-summary-item span {
    color: var(--muted);
    display: block;
    font-size: 13px;
    margin-bottom: 4px;
}

.result-summary-item strong {
    display: block;
    font-size: 20px;
}

.answer-detail-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 14px 0;
    max-width: 900px;
}

.answer-detail-grid div {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    min-width: 0;
    padding: 12px;
}

.answer-detail-grid dt {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 4px;
}

.answer-detail-grid dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.teacher-feedback {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin: 12px 0;
    max-width: 760px;
    padding: 12px;
}

.teacher-feedback p {
    margin: 4px 0 0;
}

.status {
    border-radius: 999px;
    font-size: 13px;
    padding: 4px 9px;
}

.status.ok {
    background: #ffffff;
    color: var(--ok);
}

.status.bad {
    background: #ffffff;
    color: var(--bad);
}

.status.pending {
    background: #ffffff;
    color: var(--warn);
}

.manual-review-form {
    border-top: 1px solid var(--line);
    margin-top: 14px;
    max-width: 520px;
    padding-top: 14px;
}

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

.self-review-task {
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

.notification-list {
    display: grid;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.notification-item {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    padding: 12px;
}

.notification-item.unread {
    border-left: 4px solid var(--accent);
}

.notification-item p {
    margin: 4px 0;
}

.notification-actions {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.material-page-head {
    display: grid;
    gap: 12px;
}

.material-breadcrumbs {
    align-items: center;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 14px;
    gap: 6px;
}

.material-breadcrumbs a {
    color: var(--accent-dark);
}

.material-breadcrumb-separator {
    color: var(--line);
}

.material-title-row {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    width: 100%;
}

.material-title-row h1 {
    flex: 1 1 auto;
    margin: 0;
}

.material-head-actions,
.material-row-actions {
    align-items: center;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 10px;
}

.material-folder-controls {
    align-items: center;
    display: inline-flex;
    flex: 0 0 auto;
    gap: 6px;
    margin-left: auto;
}

.material-title-row .material-head-actions {
    flex: 0 0 auto;
    line-height: 1.1;
    margin-left: auto;
}

.material-title-row .material-head-actions .material-icon-button,
.material-title-row .material-head-actions .icon-button {
    --material-icon-size: clamp(34px, 4.4vw, 48px);
}

.material-row-actions {
    flex: 0 0 auto;
    margin-left: auto;
}

.material-row-actions .inline-form,
.material-folder-controls .inline-form {
    --material-icon-size: clamp(22px, 1.25em, 30px);
    align-items: center;
    display: inline-flex;
    flex: 0 0 auto;
    height: var(--material-icon-size);
    line-height: 1;
}

.material-row-actions .inline-form .material-icon-button,
.material-folder-controls .inline-form .material-icon-button {
    vertical-align: middle;
}

.materials-tree {
    display: grid;
    gap: 8px;
    margin: 0 auto;
    max-width: 940px;
}

.material-folder {
    border-bottom: 1px solid var(--line);
    padding: 6px 0;
}

.material-folder-row,
.material-article-row {
    align-items: center;
    display: flex;
    gap: 12px;
    min-height: 42px;
    width: 100%;
}

.material-folder-row {
    font-size: 20px;
    justify-content: flex-start;
}

.material-article-row {
    font-size: 18px;
    justify-content: space-between;
}

.material-folder-title,
.material-article-row > a {
    color: var(--text);
    flex: 1 1 auto;
    font-size: 1em;
    font-weight: 700;
    min-width: 0;
}

.material-article-row > a {
    font-weight: 400;
}

.material-folder-content {
    display: grid;
    gap: 4px;
    padding: 6px 0 6px 22px;
}

.material-folder-content[hidden] {
    display: none;
}

.material-icon-button,
.icon-button {
    --material-icon-size: clamp(22px, 1.25em, 30px);
    align-items: center;
    aspect-ratio: 1 / 1;
    background: transparent;
    border: 0;
    border-radius: 4px;
    box-sizing: border-box;
    box-shadow: 0 2px 0 rgba(31, 42, 35, 0.18);
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: inherit;
    height: var(--material-icon-size);
    justify-content: center;
    line-height: 1;
    max-height: 30px;
    max-width: 30px;
    min-height: 22px;
    min-width: 22px;
    overflow: hidden;
    padding: 0;
    text-decoration: none;
    transition: box-shadow 0.12s ease, transform 0.12s ease;
    width: var(--material-icon-size);
}

.material-icon-button:hover,
.icon-button:hover {
    transform: translateY(-1px);
}

.material-icon-button:active,
.icon-button:active,
.material-action-menu.is-open > .material-icon-button,
.icon-button.is-copied {
    box-shadow: inset 0 2px 4px rgba(31, 42, 35, 0.22);
    transform: translateY(1px);
}

.material-icon-button img,
.icon-button img {
    display: block;
    height: 100%;
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    pointer-events: none;
    width: 100%;
}

.public-head-icon-button {
    --material-icon-size: clamp(34px, 0.9em, 52px);
}

.material-folder-toggle .material-toggle-collapse {
    display: none;
}

.material-folder.is-open > .material-folder-row .material-toggle-expand {
    display: none;
}

.material-folder.is-open > .material-folder-row .material-toggle-collapse {
    display: block;
}

.material-action-menu {
    display: inline-flex;
    position: relative;
}

.material-action-menu-panel.is-hidden {
    display: none !important;
}

.material-action-menu-panel {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    display: grid;
    gap: 4px;
    min-width: 130px;
    padding: 8px;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 12;
}

.material-action-menu-panel a {
    color: var(--text);
    padding: 6px 8px;
}

.danger-link {
    color: var(--bad);
}

pre {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow-x: auto;
    padding: 10px;
}

code {
    background: #ffffff;
    border-radius: 4px;
    padding: 2px 4px;
}

@media (max-width: 760px) {
    :root {
        --markdown-image-height: 180px;
    }

    .topbar,
    .page-head,
    .section-head,
    .page-actions,
    .notification-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .page {
        padding: 18px;
    }

    .brand {
        font-size: 16px;
    }

    .topbar-nav {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
        margin-bottom: 18px;
        margin-left: 0;
        width: 100%;
    }

    .topbar-nav a {
        line-height: 1.15;
    }

    .random-task-form,
    .category-form {
        grid-template-columns: 1fr;
    }

    .site-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
        padding: 0 18px 18px;
    }

    .task-basket {
        bottom: 14px;
        left: 14px;
        right: 14px;
        width: auto;
    }

    .test-form {
        display: grid;
        gap: 14px;
    }

    .question-card {
        border: 1px solid var(--line);
        border-radius: 8px;
        padding: 16px;
    }

    .question-result {
        border: 1px solid var(--line);
        border-radius: 8px;
        margin-bottom: 14px;
        padding: 16px;
    }

    .question-card:first-child {
        padding-top: 16px;
    }

    .question-result:first-child {
        padding-top: 16px;
    }

    .question-card header,
    .question-result header {
        align-items: flex-start;
        gap: 8px;
    }

    .question-card h2,
    .question-result h2,
    .question-result h3 {
        font-size: 19px;
        line-height: 1.25;
    }

    .question-card .markdown,
    .question-result .markdown,
    .choice-list,
    .field-grid,
    .file-picker {
        max-width: 100%;
    }

    .result-summary-grid,
    .answer-detail-grid {
        grid-template-columns: 1fr;
    }

    .markdown img,
    .zoomable-image {
        height: auto;
        max-height: 220px;
        min-height: 140px;
    }

    .math-lightbox-content {
        padding: 18px;
    }

    .math-lightbox-content .katex-display {
        font-size: 1.35rem;
    }

    .choice-option {
        align-items: center;
        min-height: 56px;
        padding: 14px;
    }

    .test-step-controls {
        grid-template-columns: 1fr;
    }

    .test-step-counter {
        order: -1;
    }

    .teacher-tests-table-wrap {
        overflow-x: visible;
    }

    .teacher-tests-table,
    .teacher-tests-table thead,
    .teacher-tests-table tbody,
    .teacher-tests-table tr,
    .teacher-tests-table th,
    .teacher-tests-table td {
        display: block;
    }

    .teacher-tests-table thead {
        display: none;
    }

    .teacher-tests-table tbody {
        display: grid;
        gap: 10px;
    }

    .teacher-tests-table tr {
        border: 1px solid var(--line);
        border-radius: 8px;
        display: grid;
        gap: 10px;
        padding: 12px;
    }

    .teacher-tests-table th,
    .teacher-tests-table td {
        border: 0;
        padding: 0;
        text-align: left;
    }

    .teacher-tests-table th:last-child,
    .teacher-tests-table td:last-child {
        text-align: left;
    }

    .teacher-tests-table .test-title-cell {
        min-width: 0;
        overflow-wrap: anywhere;
        width: auto;
    }

    .teacher-tests-table .teacher-test-actions {
        gap: 6px;
        justify-content: flex-start;
        min-width: 0;
    }

    .category-row {
        align-items: stretch;
        grid-template-columns: 1fr;
    }

    .category-actions {
        justify-content: flex-start;
    }

    .category-actions .auto-submit-form label {
        align-items: flex-start;
        flex-direction: column;
    }

    .category-actions select {
        max-width: 100%;
        width: 100%;
    }

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

    .field-grid label {
        width: 100%;
    }

    .file-picker {
        align-items: stretch;
        flex-direction: column;
    }

    .file-picker-button {
        align-items: center;
        justify-content: center;
        width: 100%;
    }

    .submit-row {
        background: #ffffff;
        border-top: 1px solid var(--line);
        bottom: 0;
        justify-content: stretch;
        margin: 4px -18px -18px;
        padding: 12px 18px;
        position: sticky;
        z-index: 4;
    }

    .submit-row .primary {
        min-height: 52px;
        width: 100%;
    }

    .stats-grid,
    .student-card-grid,
    .workflow,
    .category-form,
    .random-task-form,
    .two-columns,
    .wide-left {
        grid-template-columns: 1fr;
    }

    .category-row {
        align-items: stretch;
        flex-direction: column;
    }

    .random-task-form button {
        justify-self: stretch;
    }

    .student-card-head,
    .student-attempt-card,
    .attempt-result {
        align-items: stretch;
        flex-direction: column;
        text-align: left;
    }

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

    .student-card-actions,
    .student-card-actions .button,
    .attempt-result .button {
        width: 100%;
    }

    .student-card-actions .button,
    .attempt-result .button {
        text-align: center;
    }

    .sticky-head {
        margin: -18px -18px 4px;
        padding: 14px 18px;
        position: static;
    }

    .public-page-head h1,
    .news-detail-head h1 {
        font-size: 36px;
    }

    .public-page-head,
    .news-feed {
        max-width: 100%;
        width: 100%;
    }

    .news-card,
    .news-card-head,
    .news-preview,
    .news-card-actions {
        max-width: 100%;
        min-width: 0;
        width: 100%;
    }

    .news-preview.markdown,
    .news-body.markdown {
        overflow-x: hidden;
    }

    .news-card-head {
        grid-template-columns: 1fr;
    }

    .news-card-head time {
        border-left: 0;
        border-top: 1px solid var(--line);
    }

    .news-card-actions {
        align-items: center;
        flex-direction: row;
        justify-content: flex-end;
    }

    .news-card-actions .news-expand-link {
        margin-right: auto;
    }

    .news-card-actions .icon-button {
        width: var(--material-icon-size);
    }

    .material-title-row {
        align-items: center;
        flex-direction: row;
    }

    .material-head-actions {
        justify-content: flex-end;
    }

    .material-title-row .material-head-actions {
        align-items: center;
    }

    .material-title-row .material-head-actions .material-icon-button,
    .material-title-row .material-head-actions .icon-button {
        --material-icon-size: 36px;
    }

    .material-action-menu-panel {
        left: auto;
        right: 0;
    }

    .material-folder-content {
        padding-left: 12px;
    }

    .contacts-layout {
        align-items: stretch;
        gap: 12px;
        grid-template-columns: minmax(96px, 38%) minmax(0, 1fr);
    }

    .contact-photo-card {
        max-width: none;
        padding: 5px;
        width: 100%;
    }

    .contact-info-card {
        gap: 10px;
        min-width: 0;
        padding: 2px 0;
    }

    .contact-link {
        font-size: clamp(13px, 3.7vw, 16px);
        gap: 8px;
        max-width: 100%;
    }

    .contact-link span:not(.contact-icon) {
        overflow-wrap: anywhere;
    }

    .contact-icon {
        height: 26px;
        width: 26px;
    }

    .contact-profi-widget {
        --profi-widget-scale: 0.56;
    }

    .test-landing-card {
        padding: 22px;
    }

    .placeholder-page img {
        max-width: 260px;
    }
}
