@import url("https://fonts.googleapis.com/css2?family=Righteous&family=Lobster&family=Roboto:wght@400;500;700&display=swap");

* {
    box-sizing: border-box;
}

/* Mixed assessment mastery report */
.grade.grade-1 { background: #d9363e; }
.grade.grade-2 { background: #d96b16; }
.grade.grade-3 { background: #b57900; }
.grade.grade-4 { background: #3f8f52; }
.grade.grade-5 { background: #16783d; }

.mastery-label {
    display: inline-flex;
    width: fit-content;
    margin-bottom: .45rem;
    padding: .25rem .55rem;
    border-radius: 999px;
    background: #e8f6ed;
    color: #17633a;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.mastery-label.complete { background: #dff3e6; color: #105d33; }
.matrix-cell:focus-visible { outline: 4px solid #111; outline-offset: 3px; }
.matrix-cell.yellow { color: #342700; }
.matrix-cell.report-excluded { background: #657985; color: #fff; }

.completion-final-message,
.completion-mastered-message {
    display: grid;
    gap: .35rem;
    margin: 1rem 0;
    padding: 1rem;
    border-left: 5px solid #16783d;
    background: #e8f6ed;
    color: #105d33;
}

.completion-final-message strong,
.completion-mastered-message strong { font-size: 1.08rem; }

.field-report-modal {
    width: min(68rem, 96vw);
    max-height: calc(100dvh - 2rem);
    padding: 2rem;
}

.field-report-header,
.field-report-footer {
    position: sticky;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: #fff;
}

.field-report-header {
    top: -2rem;
    margin: -2rem -2rem 1rem;
    padding: 1.4rem 4.5rem 1rem 2rem;
    border-bottom: 1px solid #dce3e9;
}

.field-report-header h2 { margin: .15rem 0 0; }
.field-report-header .modal-close { top: 1.25rem; right: 1.35rem; }
.field-report-footer {
    bottom: -2rem;
    justify-content: flex-end;
    margin: 1.5rem -2rem -2rem;
    padding: .9rem 2rem 1.2rem;
    border-top: 1px solid #dce3e9;
}

.field-report-loading { min-height: 12rem; display: grid; place-items: center; color: #52616b; }
.field-report-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .75rem;
    margin-bottom: 1rem;
    padding: .9rem;
    border-left: 5px solid #d9363e;
    background: #fff2f2;
}

.field-report-summary.partial { border-left-color: #b57900; background: #fff8df; }
.field-report-summary.mastered { border-left-color: #16783d; background: #e8f6ed; }
.field-report-summary.excluded { border-left-color: #657985; background: #eef2f4; }
.field-report-summary > div { display: grid; align-content: start; gap: .25rem; min-width: 0; }
.field-report-summary span { color: #59666e; font-size: .8rem; font-weight: 700; text-transform: uppercase; }
.field-report-summary strong { overflow-wrap: anywhere; }
.field-remediated-note { padding: .75rem .9rem; background: #e8f6ed; color: #105d33; }

.field-question-navigator {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 1rem 0;
}

.field-question-navigator button {
    min-width: 3.25rem;
    min-height: 2.75rem;
    border: 2px solid transparent;
    border-radius: .55rem;
    background: #edf1f4;
    color: #27343c;
    cursor: pointer;
    font-weight: 800;
}

.field-question-navigator button.correct { background: #dff3e6; color: #105d33; }
.field-question-navigator button.partial { background: #fff0bd; color: #664500; }
.field-question-navigator button.incorrect { background: #ffe0e1; color: #8e2026; }
.field-question-navigator button.excluded { background: #e7edf0; color: #425661; }
.field-question-navigator button.active { border-color: currentColor; box-shadow: 0 0 0 2px #fff inset; }
.field-question-navigator button:focus-visible { outline: 3px solid #174eb8; outline-offset: 2px; }

.field-question-detail {
    display: grid;
    gap: 1rem;
    padding: 1.15rem;
    border: 1px solid #dce3e9;
    border-radius: .7rem;
    background: #fff;
}

.field-question-result-line { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.field-question-result-line.correct { color: #105d33; }
.field-question-result-line.partial { color: #664500; }
.field-question-result-line.incorrect { color: #8e2026; }
.field-question-result-line.excluded { color: #425661; }
.field-question-detail .student-question-text { margin: 0; white-space: pre-wrap; }
.report-image-trigger { width: min(100%, 42rem); margin-inline: auto; }

.field-answer-options { display: grid; gap: .55rem; margin: 0; padding: 0; list-style: none; }
.field-answer-options li {
    display: grid;
    grid-template-columns: 2.25rem minmax(0, 1fr) auto;
    align-items: center;
    gap: .65rem;
    min-height: 3rem;
    padding: .65rem .8rem;
    border: 2px solid #e1e6ea;
    border-radius: .55rem;
    background: #fafafa;
}

.field-answer-options li.correct { border-color: #16783d; background: #e8f6ed; color: #105d33; }
.field-answer-options li.selected-incorrect { border-color: #d9363e; background: #fff2f2; color: #8e2026; }
.field-answer-options li small { font-weight: 800; }
.field-option-image { grid-column: 2 / -1; border: 0; background: transparent; cursor: zoom-in; }
.field-option-image img { max-width: min(100%, 24rem); max-height: 12rem; object-fit: contain; }

.field-student-answer,
.field-ai-feedback { padding: .8rem .9rem; background: #f2f5f7; }
.field-student-answer p,
.field-ai-feedback p { margin: .35rem 0 0; white-space: pre-wrap; }
.field-correct-answer { margin: 0; padding: .75rem .9rem; background: #e8f6ed; color: #105d33; }
.field-excluded-answer { margin: 0; padding: .75rem .9rem; background: #eef2f4; color: #425661; }
.field-answer-images { display: flex; flex-wrap: wrap; gap: .75rem; }
.field-answer-images button { min-width: 5rem; min-height: 5rem; border: 2px solid #cbd5dc; border-radius: .5rem; background: #fff; cursor: zoom-in; }
.field-answer-images img { display: block; width: 7rem; height: 7rem; object-fit: contain; }
.field-practice-section { margin-top: 1.2rem; }
.field-practice-section h3 { margin-bottom: .65rem; }

@media (max-width: 760px) {
    .field-report-modal { max-height: calc(100dvh - 1rem); padding: 1.1rem; }
    .field-report-header { top: -1.1rem; margin: -1.1rem -1.1rem .8rem; padding: 1rem 3.8rem .8rem 1.1rem; }
    .field-report-header .modal-close { top: .75rem; right: .8rem; }
    .field-report-footer { bottom: -1.1rem; margin: 1.1rem -1.1rem -1.1rem; padding: .75rem 1.1rem; }
    .field-report-summary { grid-template-columns: 1fr; }
    .field-question-result-line { align-items: flex-start; flex-direction: column; gap: .25rem; }
    .field-answer-options li { grid-template-columns: 2rem minmax(0, 1fr); }
    .field-answer-options li small { grid-column: 2; }
}

.topic-type-picker {
    display: flex;
    gap: 0;
    margin: 18px 0;
    padding: 0;
    border: 0;
}

.topic-type-picker legend,
.grade-thresholds legend {
    width: 100%;
    margin-bottom: 8px;
    color: #697279;
    font-size: 15px;
}

.topic-type-picker label {
    position: relative;
    min-width: 150px;
    padding: 12px 18px;
    border: 1px solid #cfd7df;
    background: #fff;
    text-align: center;
    cursor: pointer;
}

.topic-type-picker label:first-of-type { border-radius: 6px 0 0 6px; }
.topic-type-picker label:last-of-type { border-radius: 0 6px 6px 0; }
.topic-type-picker input { position: absolute; opacity: 0; }
.topic-type-picker label:has(input:checked) { border-color: #4373ec; background: #edf3ff; color: #174eb8; font-weight: 700; }

.grade-thresholds {
    display: grid;
    grid-template-columns: repeat(4, minmax(100px, 1fr));
    gap: 12px;
    margin: 18px 0;
    padding: 16px;
    border: 1px solid #d7dfe7;
    border-radius: 6px;
}

.grade-thresholds label span { display: block; margin-bottom: 6px; color: #697279; }
.grade-thresholds input { width: 100%; }

.student-assessment-overview {
    width: min(1180px, 100%);
    margin: 0 auto 34px;
}

.student-overview-heading { margin-bottom: 14px; }
.student-overview-heading h2 { margin: 3px 0 0; font-size: 26px; }

.student-report-groups {
    display: grid;
    gap: 2rem;
}

.student-report-subject {
    display: grid;
    gap: 1rem;
}

.student-report-subject-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: .65rem;
    border-bottom: 2px solid #dbe5f7;
}

.student-report-subject-heading h3 {
    margin: 0;
    color: #19324d;
    font-size: 1.45rem;
}

.student-report-subject-heading span {
    color: #697279;
    font-size: .9rem;
}

.assessment-kind-label {
    color: #174eb8;
    font-weight: 700;
    text-transform: uppercase;
}

.assessment-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
    gap: 18px;
}

.assessment-summary-card {
    padding: 22px;
    border: 1px solid #d7dfe7;
    border-top: 4px solid #4373ec;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 7px 20px rgba(38, 50, 56, .08);
}

.assessment-summary-card header,
.assessment-summary-card footer,
.assessment-score-line,
.remediation-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.assessment-summary-card h3 { margin: 3px 0 0; font-size: 21px; }
.assessment-summary-card header small { color: #697279; }
.assessment-score-line { margin-top: 20px; }
.assessment-score-line strong { color: #174eb8; font-size: 30px; }

.assessment-progress {
    height: 8px;
    margin: 10px 0 18px;
    overflow: hidden;
    border-radius: 4px;
    background: #e2e7ec;
}

.assessment-progress span { display: block; height: 100%; background: #27ae60; }
.assessment-guidance { margin: 16px 0 10px; color: #4a5358; }
.success-text { color: #16733e; }

.remediation-list { display: grid; gap: 8px; }

.remediation-row {
    width: 100%;
    min-height: 58px;
    padding: 10px 12px;
    border: 1px solid #cbd6e1;
    border-radius: 5px;
    background: #f8fafc;
    color: #263238;
    text-align: left;
}

.remediation-row:not(:disabled):hover { border-color: #4373ec; background: #edf3ff; }
.remediation-row span:first-child { display: grid; gap: 3px; }
.remediation-row small { color: #697279; }
.remediation-row.required {
    border: 2px solid #eb4949;
    border-left-width: 6px;
    background: #fff1f1;
    color: #8f1f24;
    box-shadow: 0 3px 10px rgb(235 73 73 / 14%);
}
.remediation-row.required strong { font-size: 1.05rem; }
.remediation-row.required > span { font-weight: 700; }
.remediation-row.completed {
    border: 2px solid #27ae60;
    border-left-width: 6px;
    background: #eaf8f0;
    color: #16733e;
}
.remediation-row.completed:disabled { opacity: 1; cursor: default; }
.remediation-row.completed > span { font-weight: 700; }
.assessment-summary-card footer { margin-top: 18px; padding-top: 14px; border-top: 1px solid #e1e6eb; }

.unmapped-practice-warning {
    display: grid;
    gap: 4px;
    margin-top: 12px;
    padding: 11px 12px;
    border-left: 4px solid #d7a300;
    background: #fff8d9;
    color: #604a00;
}

.mixed-result-panel {
    display: grid;
    grid-template-columns: minmax(180px, .7fr) minmax(210px, .8fr) minmax(340px, 1.5fr);
    gap: 24px;
    width: min(1160px, calc(100% - 40px));
    margin: 0 auto 28px;
    padding: 24px;
    border: 1px solid #ccd7e2;
    border-left: 5px solid #4373ec;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 9px 26px rgba(38, 50, 56, .1);
}

.mixed-result-score,
.mixed-result-grade { display: flex; flex-direction: column; justify-content: center; }
.mixed-result-score > span,
.mixed-result-grade > span { color: #697279; }
.mixed-result-score > strong { margin: 6px 0; color: #174eb8; font-size: 44px; }
.mixed-result-score p { margin: 0; }
.mixed-result-grade { align-items: center; border-inline: 1px solid #e0e5e9; text-align: center; }
.mixed-result-grade .grade { margin-top: 12px; font-size: 26px; }
.mixed-result-guidance h2 { margin: 0 0 5px; font-size: 22px; }
.mixed-result-guidance > p { margin: 0 0 14px; color: #4a5358; }
.mixed-result-guidance .primary-action { margin-top: 16px; }

@media (max-width: 800px) {
    .grade-thresholds { grid-template-columns: repeat(2, minmax(100px, 1fr)); }
    .topic-type-picker {
        display: grid;
        width: 100%;
        min-width: 0;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .topic-type-picker legend { grid-column: 1 / -1; }
    .topic-type-picker label { width: 100%; min-width: 0; padding-inline: 10px; }
    .mixed-result-panel { grid-template-columns: 1fr; width: calc(100% - 24px); }
    .mixed-result-grade { padding: 18px 0; border-inline: 0; border-block: 1px solid #e0e5e9; }
    .assessment-summary-card footer { align-items: flex-start; flex-direction: column; }
}

/* Mathematics taxonomy */
.taxonomy-page,
.taxonomy-review-page {
    min-height: calc(100vh - 76px);
    padding: 40px clamp(18px, 4vw, 64px) 64px;
}

.taxonomy-heading,
.taxonomy-detail-heading,
.taxonomy-legacy-warning,
.review-selection-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.taxonomy-heading {
    margin-bottom: 24px;
}

.taxonomy-subject-picker {
    display: grid;
    gap: 4px;
    min-width: min(220px, 100%);
}

.taxonomy-subject-picker span {
    color: #6c767d;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.taxonomy-subject-picker select {
    min-height: 44px;
    padding: 0 40px 0 14px;
    border: 1px solid #d7dde4;
    border-radius: 12px;
    background: #fff;
    color: #203852;
    font: inherit;
    font-weight: 700;
}

.taxonomy-heading h1 {
    margin: 2px 0 4px;
    font-size: 3rem;
    letter-spacing: 0;
}

.taxonomy-heading p,
.taxonomy-detail-heading h2 {
    margin: 0;
}

.taxonomy-legacy-warning {
    margin-bottom: 18px;
    padding: 14px 18px;
    border-left: 5px solid #efb72f;
    background: #fff8dc;
}

.taxonomy-legacy-warning div {
    display: grid;
    gap: 2px;
}

.taxonomy-coverage-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 18px;
    border-block: 1px solid #d8dee8;
    background: rgb(255 255 255 / 76%);
}

.taxonomy-coverage-summary > div {
    min-height: 70px;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 10px;
    padding: 14px;
}

.taxonomy-coverage-summary > div + div {
    border-left: 1px solid #d8dee8;
}

.taxonomy-coverage-summary strong,
.taxonomy-grid-status strong {
    color: #244fa3;
    font-size: 1.35rem;
}

.taxonomy-coverage-summary span,
.taxonomy-grid-status span {
    color: #68727e;
}

.taxonomy-workspace {
    display: grid;
    grid-template-columns: minmax(330px, 0.85fr) minmax(520px, 1.5fr);
    min-height: 650px;
    border: 1px solid #d8dee8;
    background: #fff;
}

.taxonomy-tree {
    max-height: 76vh;
    overflow: auto;
    border-right: 1px solid #d8dee8;
    background: #f7f8fa;
}

.taxonomy-root,
.tree-select {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 0;
    background: transparent;
    text-align: left;
}

.taxonomy-root {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 17px 18px;
    color: #fff;
    background: #253247;
}

.taxonomy-tree details {
    border-bottom: 1px solid #dfe4eb;
}

.taxonomy-tree summary,
.taxonomy-unit {
    display: flex;
    align-items: center;
    gap: 6px;
}

.taxonomy-tree summary {
    min-height: 52px;
    padding: 6px 8px 6px 12px;
    background: #fff;
}

.taxonomy-tree summary.selected,
.taxonomy-unit.selected,
.taxonomy-root.selected {
    box-shadow: inset 4px 0 #3974ed;
    background: #edf3ff;
    color: #1e3154;
}

.taxonomy-unit {
    min-height: 46px;
    padding: 5px 8px 5px 34px;
}

.taxonomy-unit:hover {
    background: #eef1f5;
}

.tree-select {
    min-width: 0;
    padding: 8px;
}

.tree-select span {
    overflow-wrap: anywhere;
}

.tree-select strong {
    min-width: 28px;
    color: #3974ed;
    text-align: right;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 7px;
    border-radius: 4px;
    font-size: .72rem;
    font-weight: 700;
}

.status-chip.inactive {
    color: #7f2525;
    background: #ffe1df;
}

.status-chip.active {
    color: #17633a;
    background: #d9f5e5;
}

.taxonomy-detail {
    min-width: 0;
    padding: 28px;
}

.taxonomy-detail-heading {
    margin-bottom: 22px;
}

.taxonomy-grid-status {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-bottom: 12px;
    border-bottom: 1px solid #d8dee8;
    padding: 0 0 12px;
}

.taxonomy-grid-status > div:not(.taxonomy-grid-legend) {
    display: grid;
}

.taxonomy-grid-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-left: auto;
}

.taxonomy-grid-legend span {
    border-left: 4px solid;
    padding: 4px 7px;
    background: #f5f6f8;
    font-size: .72rem;
    font-weight: 700;
}

.taxonomy-grid-legend .ready { border-color: #26975a; }
.taxonomy-grid-legend .limited { border-color: #d69b1e; }
.taxonomy-grid-legend .empty { border-color: #a8afb8; }

.taxonomy-grid-wrap {
    overflow-x: auto;
}

.taxonomy-grid {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 8px;
}

.taxonomy-grid th {
    height: 42px;
    color: #596372;
    text-align: center;
}

.grid-stat {
    width: 100%;
    min-width: 104px;
    min-height: 105px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 2px;
    border: 1px solid #dce1e8;
    background: #f5f6f8;
    color: #818995;
}

.grid-stat.ready {
    border-color: #79c39c;
    background: #e9f7ef;
    color: #17633a;
}

.grid-stat.limited {
    border-color: #e4bd65;
    background: #fff6de;
    color: #7a5100;
}

.grid-stat.empty {
    border-color: #dce1e8;
    background: #f5f6f8;
    color: #818995;
}

.grid-stat:not(:disabled):hover {
    border-color: #3974ed;
    box-shadow: 0 5px 14px rgba(31, 55, 92, .12);
}

.grid-stat:disabled {
    cursor: not-allowed;
}

.grid-stat strong {
    font-size: 1.65rem;
}

.grid-stat small {
    font-size: .72rem;
}

.taxonomy-grid-note {
    color: #707986;
    text-align: right;
}

.taxonomy-editor {
    width: min(620px, calc(100vw - 32px));
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.taxonomy-editor label:not(.toggle-line) {
    display: grid;
    gap: 7px;
    margin-bottom: 14px;
}

.taxonomy-editor input,
.taxonomy-editor select,
.taxonomy-editor textarea,
.taxonomy-review-toolbar input,
.taxonomy-review-toolbar select,
.review-taxonomy-fields select {
    width: 100%;
    min-height: 46px;
    border: 1px solid #ced6e2;
    background: #f8f9fb;
    padding: 10px 12px;
}

.taxonomy-editor textarea {
    min-height: 90px;
}

.taxonomy-review-toolbar {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(180px, .55fr) minmax(140px, .4fr) repeat(2, minmax(120px, .35fr)) auto;
    gap: 10px;
    margin-bottom: 16px;
}

.review-selection-bar {
    position: sticky;
    top: 76px;
    z-index: 4;
    padding: 13px 16px;
    border: 1px solid #d6dde7;
    background: #fff;
    box-shadow: 0 5px 14px rgba(31, 55, 92, .08);
}

.taxonomy-review-list {
    border: 1px solid #d6dde7;
    border-top: 0;
    background: #fff;
}

.taxonomy-review-row {
    display: grid;
    grid-template-columns: 42px minmax(280px, 1.3fr) minmax(300px, .9fr);
    gap: 14px;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #e1e5eb;
}

.taxonomy-review-row.selected {
    background: #f2f7ff;
}

.review-question-meta,
.review-taxonomy-fields {
    display: flex;
    align-items: center;
    gap: 9px;
}

.review-question p {
    margin: 8px 0;
    overflow-wrap: anywhere;
}

.review-question-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.review-question-actions .table-action {
    min-width: 92px;
}

.review-taxonomy-fields {
    align-items: end;
}

.review-taxonomy-fields label {
    min-width: 0;
    flex: 1;
}

.review-taxonomy-fields label span {
    display: block;
    margin-bottom: 5px;
    color: #6f7884;
    font-size: .78rem;
}

.taxonomy-question-backdrop {
    z-index: 1200;
}

.taxonomy-question-dialog {
    width: min(1040px, calc(100vw - 32px));
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
}

.taxonomy-question-dialog-heading {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 20px;
    padding-right: 52px;
    margin-bottom: 20px;
}

.taxonomy-question-dialog-heading h2 {
    margin: 2px 0 0;
}

.question-position {
    color: #3970e8;
    font-size: 1.25rem;
    font-weight: 800;
    white-space: nowrap;
}

.taxonomy-question-preview {
    display: grid;
    gap: 18px;
}

.taxonomy-question-prompt {
    margin: 0;
    color: #30383d;
    font-size: 1.1rem;
    line-height: 1.55;
    white-space: pre-wrap;
}

.taxonomy-question-preview-image {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: min(52dvh, 620px);
    margin: 0 auto;
    object-fit: contain;
}

.taxonomy-answer-preview {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.taxonomy-answer-preview > div {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-height: 56px;
    padding: 10px 12px;
    border: 1px solid #d8dde5;
    background: #f8f9fb;
}

.taxonomy-answer-preview > div.correct {
    border-color: #21a65b;
    background: #eaf8ef;
}

.taxonomy-answer-preview small {
    color: #187744;
    font-weight: 700;
}

.taxonomy-written-answer {
    display: grid;
    gap: 5px;
    padding: 14px;
    border-left: 4px solid #21a65b;
    background: #eaf8ef;
}

.taxonomy-written-answer span {
    color: #68737c;
    font-size: .82rem;
}

.taxonomy-preview-classification {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding-top: 20px;
    margin-top: 22px;
    border-top: 1px solid #dce1e8;
}

.taxonomy-preview-classification label,
.taxonomy-question-dialog > label,
.taxonomy-question-fields label {
    display: grid;
    gap: 6px;
}

.taxonomy-preview-classification select,
.taxonomy-question-dialog select,
.taxonomy-question-dialog input,
.taxonomy-question-dialog textarea {
    width: 100%;
    min-height: 46px;
    border: 1px solid #ced6e2;
    background: #f8f9fb;
    padding: 10px 12px;
}

.taxonomy-question-dialog textarea {
    min-height: 130px;
    resize: vertical;
}

.taxonomy-question-image-editor {
    margin: 18px 0;
}

.taxonomy-question-dialog-actions {
    position: sticky;
    bottom: -1px;
    z-index: 2;
    padding: 14px 0 2px;
    background: #fff;
}

.import-change-list {
    display: block;
    color: #9a5a00 !important;
    font-weight: 700;
}

.taxonomy-student-category > summary {
    justify-content: space-between;
}

.student-subcategory-list {
    border-top: 1px solid #e0e5ec;
}

.student-subcategory-row {
    display: grid;
    grid-template-columns: 18px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 13px 18px;
    border-bottom: 1px solid #e7eaf0;
}

.student-subcategory-row div {
    display: grid;
    gap: 2px;
}

.student-subcategory-row small {
    color: #737d89;
}

@media (max-width: 980px) {
    .taxonomy-workspace {
        grid-template-columns: 1fr;
    }

    .taxonomy-tree {
        max-height: 52vh;
        border-right: 0;
        border-bottom: 1px solid #d8dee8;
    }

    .taxonomy-review-row {
        grid-template-columns: 34px 1fr;
    }

    .review-taxonomy-fields {
        grid-column: 2;
    }

    .taxonomy-review-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .taxonomy-page,
    .taxonomy-review-page {
        padding: 24px 12px 48px;
    }

    .taxonomy-heading,
    .taxonomy-legacy-warning,
    .review-selection-bar,
    .review-taxonomy-fields {
        align-items: stretch;
        flex-direction: column;
    }

    .taxonomy-review-toolbar {
        grid-template-columns: 1fr;
    }

    .taxonomy-detail {
        padding: 18px 10px;
    }

    .taxonomy-coverage-summary {
        grid-template-columns: 1fr;
    }

    .taxonomy-coverage-summary > div + div {
        border-top: 1px solid #d8dee8;
        border-left: 0;
    }

    .taxonomy-grid-status {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .taxonomy-grid-legend {
        flex-basis: 100%;
        margin-left: 0;
    }

    .taxonomy-grid {
        min-width: 600px;
    }

    .taxonomy-review-row {
        grid-template-columns: 30px minmax(0, 1fr);
    }

    .review-taxonomy-fields label,
    .review-taxonomy-fields button {
        width: 100%;
    }

    .taxonomy-question-dialog {
        width: calc(100vw - 16px);
        max-height: calc(100dvh - 16px);
        padding: 24px 14px 16px;
    }

    .taxonomy-question-dialog-heading,
    .taxonomy-question-dialog-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .taxonomy-question-dialog-heading {
        padding-right: 44px;
    }

    .taxonomy-preview-classification,
    .taxonomy-answer-preview,
    .taxonomy-question-fields {
        grid-template-columns: 1fr;
    }

    .taxonomy-answer-preview > div {
        grid-template-columns: 28px minmax(0, 1fr);
    }

    .taxonomy-answer-preview small {
        grid-column: 2;
    }
}

html,
body {
    margin: 0;
    font-family: "Roboto", Arial, sans-serif;
    color: #373f41;
}

a {
    color: #737b7d;
    text-decoration: none;
}

h1:focus {
    outline: none;
}

button,
input,
textarea,
select {
    font: inherit;
}

.righteous {
    font-family: "Righteous", cursive;
}

.lobster {
    font-family: "Lobster", cursive;
}

.text-primary {
    color: #4373ec;
}

.learnio-shell {
    min-height: 100vh;
}

.app-bootstrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    color: #4373ec;
    font-family: "Lobster", cursive;
    font-size: 2rem;
}

.learnio-nav {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 20;
    min-height: 64px;
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 0.75rem 1.5rem;
    background: #fff;
    box-shadow: 0 2px 8px rgb(0 0 0 / 18%);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: #000;
    font-size: 23px;
}

.brand img {
    width: 24px;
    height: 24px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: clamp(1rem, 4vw, 4rem);
    font-weight: 700;
}

.nav-links a.active {
    color: #4373ec;
}

.nav-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pill,
.table-action,
.primary-action {
    border: 0;
    border-radius: 25px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0.3rem 1.5rem;
    font-family: "Lobster", cursive;
}

.green {
    background: #27ae60;
}

.green:hover {
    background: #1f894b;
}

.blue {
    background: #4373ec;
}

.blue:hover {
    background: #103aa2;
}

.red {
    background: #eb4949;
}

.yellow {
    background: #e3ad19;
    color: #252525;
}

.yellow:hover {
    background: #c99508;
}

.grey {
    background: #8f8e8b;
}

.avatar {
    width: 34px;
    height: 34px;
    border: 1px solid lightgray;
    border-radius: 50%;
    background: #27ae60;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.page-bg {
    min-height: 100vh;
    width: 100%;
    background: url("/learniobg10-15.png") center top / cover fixed repeat-y;
}

.home-page {
    min-height: 200vh;
}

.home-band {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 4rem;
    padding: 16vh 6vw 10vh;
}

.home-logo {
    width: 100%;
    max-width: 680px;
    border-radius: 10px;
}

.home-copy h1,
.home-copy h2 {
    font-size: clamp(2rem, 4vw, 2.7rem);
    margin: 0 0 0.35rem;
}

.home-copy p {
    color: #737b7d;
    font-size: 1.5rem;
    line-height: 1.25;
    margin: 0;
}

.tech-carousel {
    position: relative;
    width: min(75%, 520px);
    aspect-ratio: 1 / 0.72;
}

.tech-carousel img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
    opacity: 0;
    animation: tech-slide 10s infinite;
}

.tech-carousel img:nth-child(2) { animation-delay: 2.5s; }
.tech-carousel img:nth-child(3) { animation-delay: 5s; }
.tech-carousel img:nth-child(4) { animation-delay: 7.5s; }

@keyframes tech-slide {
    0%, 20% { opacity: 1; transform: translateX(0); }
    25%, 95% { opacity: 0; transform: translateX(-18px); }
    100% { opacity: 1; transform: translateX(0); }
}

.lucida-home {
    --lucida-navy: #0b3a66;
    --lucida-navy-dark: #082f55;
    --lucida-coral: #fa7252;
    min-height: 100vh;
    overflow: hidden;
    background: #f7f9fc;
    color: #1c2733;
}

.lucida-hero {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: grid;
    align-items: center;
    padding: 8rem clamp(1.25rem, 7vw, 7rem) 4.5rem;
    overflow: hidden;
    background: url("/lucida-hero.jpg") center / cover no-repeat;
}

.lucida-hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgb(5 27 48 / 96%) 0%, rgb(8 47 85 / 88%) 43%, rgb(8 47 85 / 34%) 76%, rgb(8 47 85 / 20%) 100%),
        linear-gradient(0deg, rgb(5 27 48 / 42%), transparent 45%);
}

.lucida-hero-content {
    position: relative;
    z-index: 1;
    width: min(47rem, 100%);
    color: #fff;
}

.lucida-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    color: rgb(255 255 255 / 78%);
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.lucida-eyebrow::before {
    width: 2.2rem;
    height: 3px;
    border-radius: 3px;
    background: var(--lucida-coral);
    content: "";
}

.lucida-eyebrow.navy { color: var(--lucida-navy); }

.lucida-hero h1 {
    margin: .7rem 0 1rem;
    color: #fff;
    font-family: "Righteous", sans-serif;
    font-size: clamp(4rem, 9vw, 7.5rem);
    font-weight: 400;
    letter-spacing: -.055em;
    line-height: .93;
}

.lucida-hero h1 span { color: var(--lucida-coral); }

.lucida-hero-lead {
    max-width: 43rem;
    margin: 0;
    color: rgb(255 255 255 / 90%);
    font-size: clamp(1.15rem, 2.1vw, 1.48rem);
    line-height: 1.6;
}

.lucida-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .8rem;
    margin-top: 2rem;
}

.lucida-button {
    min-height: 3.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .7rem 1.55rem;
    border: 2px solid transparent;
    border-radius: 999px;
    font-weight: 900;
    transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.lucida-button:hover { transform: translateY(-2px); }
.lucida-button.primary { background: var(--lucida-coral); color: #fff; }
.lucida-button.primary:hover { background: #e85f42; }
.lucida-button.secondary { border-color: rgb(255 255 255 / 62%); background: rgb(255 255 255 / 8%); color: #fff; }
.lucida-button.secondary:hover { border-color: #fff; background: rgb(255 255 255 / 15%); }

.lucida-hero-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem 1.4rem;
    margin-top: 2.4rem;
    color: rgb(255 255 255 / 78%);
    font-size: .9rem;
    font-weight: 700;
}

.lucida-hero-highlights span::before {
    margin-right: .5rem;
    color: var(--lucida-coral);
    content: "✓";
    font-weight: 900;
}

.lucida-purpose {
    scroll-margin-top: 6rem;
    padding: clamp(4.5rem, 8vw, 7rem) clamp(1.25rem, 7vw, 7rem);
}

.lucida-section-heading {
    width: min(49rem, 100%);
    margin: 0 auto 3rem;
    text-align: center;
}

.lucida-section-heading .lucida-eyebrow { justify-content: center; }
.lucida-section-heading h2,
.lucida-confidence-copy h2 {
    margin: .65rem 0 .8rem;
    color: #10283e;
    font-size: clamp(2rem, 4vw, 3.25rem);
    line-height: 1.12;
}

.lucida-section-heading > p {
    margin: 0;
    color: #5b6a77;
    font-size: 1.12rem;
    line-height: 1.65;
}

.lucida-steps {
    width: min(76rem, 100%);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
    margin: 0 auto;
}

.lucida-steps article {
    position: relative;
    min-height: 16rem;
    padding: 2rem;
    overflow: hidden;
    border: 1px solid #dbe6f2;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 16px 42px rgb(11 58 102 / 8%);
}

.lucida-steps article::after {
    position: absolute;
    right: -1.4rem;
    bottom: -2.7rem;
    color: rgb(11 58 102 / 4%);
    content: "IO";
    font-family: "Righteous", sans-serif;
    font-size: 8rem;
}

.lucida-step-number {
    color: var(--lucida-coral);
    font-size: .84rem;
    font-weight: 900;
    letter-spacing: .12em;
}

.lucida-steps h3 { margin: 1.25rem 0 .65rem; color: var(--lucida-navy); font-size: 1.35rem; }
.lucida-steps p { position: relative; z-index: 1; margin: 0; color: #5b6a77; line-height: 1.65; }

.lucida-confidence {
    width: min(82rem, calc(100% - 2.5rem));
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
    align-items: stretch;
    margin: 0 auto clamp(4.5rem, 8vw, 7rem);
    overflow: hidden;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 22px 60px rgb(11 58 102 / 14%);
}

.lucida-confidence-media { min-height: 31rem; background: #dfeaf4; }
.lucida-confidence-media img { width: 100%; height: 100%; display: block; object-fit: cover; }
.lucida-confidence-copy { padding: clamp(2rem, 5vw, 4.25rem); }
.lucida-confidence-copy h2 { font-size: clamp(1.9rem, 3vw, 2.75rem); }
.lucida-confidence-copy > p { color: #5b6a77; line-height: 1.7; }
.lucida-confidence-copy ul { display: grid; gap: .65rem; margin: 1.4rem 0 1.6rem; padding: 0; list-style: none; }
.lucida-confidence-copy li { display: flex; gap: .65rem; color: #263d50; font-weight: 700; }
.lucida-confidence-copy li::before { color: var(--lucida-coral); content: "✓"; font-weight: 900; }
.lucida-text-link { color: var(--lucida-navy); font-weight: 900; }
.lucida-text-link:hover { color: var(--lucida-coral); }

.lucida-home-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 2rem clamp(1.25rem, 7vw, 7rem);
    background: var(--lucida-navy-dark);
    color: #fff;
}

.lucida-home-footer div { display: grid; gap: .25rem; }
.lucida-home-footer strong { font-family: "Righteous", sans-serif; font-size: 1.4rem; }
.lucida-home-footer span { color: rgb(255 255 255 / 66%); font-size: .88rem; }
.lucida-home-footer a { color: #fff; font-weight: 700; }

@media (max-width: 850px) {
    .lucida-hero { min-height: 50rem; padding-top: 9.5rem; background-position: 56% center; }
    .lucida-hero-overlay { background: linear-gradient(90deg, rgb(5 27 48 / 96%), rgb(8 47 85 / 78%)); }
    .lucida-steps,
    .lucida-confidence { grid-template-columns: 1fr; }
    .lucida-confidence-media { min-height: 22rem; }
}

@media (max-width: 560px) {
    .lucida-hero { min-height: 46rem; padding-top: 10.5rem; }
    .lucida-hero h1 { font-size: clamp(3.5rem, 20vw, 5.4rem); }
    .lucida-hero-actions,
    .lucida-home-footer { align-items: stretch; flex-direction: column; }
    .lucida-button { width: 100%; }
    .lucida-hero-highlights { display: grid; }
    .lucida-purpose { padding-inline: 1rem; }
    .lucida-steps article { min-height: 0; }
    .lucida-confidence { width: calc(100% - 2rem); }
    .lucida-confidence-media { min-height: 15rem; }
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 6rem 1rem 2rem;
    background: url("/learniobglogin.png") center / cover no-repeat;
}

.auth-card,
.profile-card,
.admin-editor,
.data-card {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 3px 12px rgb(0 0 0 / 20%);
}

.auth-card {
    width: min(92vw, 420px);
    padding: 2rem;
}

.auth-card h1 {
    margin: 0 0 1.5rem;
    text-align: center;
    font-size: 3rem;
}

label {
    display: grid;
    gap: 0.35rem;
    margin-bottom: 0.8rem;
}

label span {
    color: #737b7d;
    font-size: 0.9rem;
}

input,
textarea,
select {
    width: 100%;
    border: 0;
    border-bottom: 2px solid #d8dde6;
    background: #f5f5f5;
    padding: 0.9rem;
    outline-color: #4373ec;
}

input:disabled {
    color: #5f6668;
    background: #eceff1;
}

textarea {
    min-height: 7rem;
    resize: vertical;
}

.muted-link,
.form-copy {
    display: block;
    text-align: center;
    color: #737b7d;
    line-height: 1.45;
}

.primary-action {
    width: fit-content;
    margin: 2rem auto 0;
    background: #4373ec;
}

.primary-action.compact {
    margin-top: 0.75rem;
}

.primary-action.as-link {
    width: max-content;
}

.catalogue-page,
.centered-page,
.matrix-page {
    padding: 7rem 1rem 4rem;
}

.centered-page {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.page-title {
    margin: 0 0 4rem;
    text-align: center;
    font-size: 8vh;
    text-shadow: -5px 5px #30303033;
}

.context-back-nav {
    width: min(70rem, 92vw);
    max-width: 100%;
    margin: 0 auto clamp(1.25rem, 3vw, 2rem);
    display: flex;
    justify-content: flex-start;
}

.context-back-nav.persistent {
    position: sticky;
    top: calc(var(--app-nav-height, 72px) + 0.65rem);
    z-index: 18;
    pointer-events: none;
}

@media (min-width: 901px) {
    .context-back-nav.persistent {
        position: fixed;
        inset: auto auto max(1.25rem, env(safe-area-inset-bottom)) max(1rem, calc((100vw - 70rem) / 2));
        width: auto;
        margin: 0;
        z-index: 24;
    }

    .context-back-nav.persistent .context-back-link {
        box-shadow: 0 8px 28px rgb(22 58 104 / 24%);
    }
}

.context-back-link {
    display: inline-flex;
    min-height: 3.15rem;
    max-width: 100%;
    align-items: center;
    gap: 0.7rem;
    padding: 0.42rem 1rem 0.42rem 0.45rem;
    border: 1px solid #d5e0f4;
    border-radius: 999px;
    background: rgb(255 255 255 / 96%);
    box-shadow: 0 5px 18px rgb(22 58 104 / 14%);
    color: #174eb8;
    pointer-events: auto;
    text-decoration: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.context-back-link:hover {
    border-color: #91ace8;
    box-shadow: 0 7px 22px rgb(22 58 104 / 20%);
    color: #103f9c;
    transform: translateX(-3px);
}

.context-back-link:focus-visible {
    outline: 3px solid rgb(67 115 236 / 38%);
    outline-offset: 3px;
}

.context-back-icon {
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 2.25rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #4373ec;
    color: #fff;
}

.context-back-icon svg {
    width: 1.2rem;
    height: 1.2rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.25;
}

.context-back-copy {
    min-width: 0;
    display: grid;
    line-height: 1.05;
}

.context-back-copy small {
    color: #6f7c88;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.context-back-copy strong {
    overflow: hidden;
    font-size: 0.92rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
    .context-back-link {
        transition: none;
    }

    .context-back-link:hover {
        transform: none;
    }
}

.subject-grid {
    width: min(70rem, 94vw);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 2rem;
}

.subject-card {
    height: 15rem;
    border: 0;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 3px 12px rgb(0 0 0 / 18%);
    display: grid;
    place-items: center;
    align-content: center;
    gap: 0.8rem;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}

.subject-card:hover {
    transform: scale(1.05);
}

.subject-initials {
    display: grid;
    place-items: center;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
}

.accordion-list,
.topics-table-wrap,
.data-card {
    width: min(60rem, 92vw);
}

.accordion-list.lower {
    margin-top: 20vh;
    width: min(40rem, 92vw);
}

.course-panel {
    margin-bottom: 0.75rem;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgb(0 0 0 / 14%);
    overflow: hidden;
}

.course-panel summary {
    min-height: 64px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem;
    cursor: pointer;
}

.course-panel ul,
.course-panel p {
    margin: 0;
    padding: 0 1.5rem 1rem 3.5rem;
    color: #737b7d;
}

.course-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
}

.table-action {
    min-height: 30px;
    padding-inline: 1.2rem;
}

.learnio-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.25rem;
}

.learnio-table th {
    background: #27ae60;
    color: #fff;
    padding: 0.8rem;
    text-align: center;
}

.learnio-table th:first-child {
    border-radius: 25px 0 0 25px;
}

.learnio-table th:last-child {
    border-radius: 0 25px 25px 0;
}

.learnio-table td {
    padding: 0.75rem;
    text-align: center;
    background: #f7f5f5;
}

.learnio-table tr:nth-child(even) td {
    background: #ededed;
}

.grade {
    display: inline-grid;
    place-items: center;
    min-width: 2.6rem;
    min-height: 2.6rem;
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
}

.grade.gold {
    background: #daa520;
}

.grade.white {
    background: #fff;
    color: #000;
}

.toolbar-row {
    width: min(60rem, 92vw);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.filter-input {
    max-width: 18rem;
}

.topics-toolbar {
    width: min(74rem, 94vw);
    display: grid;
    grid-template-columns: auto minmax(14rem, 1fr) minmax(10rem, 0.7fr) minmax(10rem, 0.7fr) auto;
    align-items: end;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.topics-toolbar .pill {
    align-self: end;
}

.topic-filter {
    display: grid;
    gap: 0.25rem;
    color: #5f686b;
    font-size: 0.82rem;
    font-weight: 700;
}

.topic-filter .filter-input,
.topic-filter select {
    max-width: none;
    min-height: 2.75rem;
}

.clear-topic-filters {
    margin: 0 0 0.12rem;
}

.topics-browser {
    width: min(74rem, 94vw);
    overflow: hidden;
    border: 1px solid #d8dde6;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 3px 12px rgb(0 0 0 / 14%);
}

.topics-result-count {
    margin: 0;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e8ed;
    color: #6f787b;
    font-size: 0.9rem;
    text-align: right;
}

.topic-subject-section + .topic-subject-section {
    border-top: 5px solid #eef0f3;
}

.topic-subject-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-left: 4px solid #4373ec;
    background: #f1f5ff;
}

.topic-subject-heading h2,
.topic-subject-heading span {
    margin: 0;
}

.topic-subject-heading h2 {
    color: #273033;
    font-size: 1.35rem;
}

.topic-subject-heading > span {
    color: #657073;
    font-size: 0.9rem;
    white-space: nowrap;
}

.topic-group-label {
    display: block;
    margin-bottom: 0.1rem !important;
    color: #4373ec;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.topic-unit-list {
    padding: 0 1.25rem 0.75rem;
}

.topic-unit-group {
    border-bottom: 1px solid #e0e4e9;
}

.topic-unit-group > summary {
    display: grid;
    grid-template-columns: 0.75rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    min-height: 3.5rem;
    padding: 0.6rem 0.25rem;
    color: #3f484b;
    cursor: pointer;
    list-style: none;
}

.topic-unit-group > summary::-webkit-details-marker {
    display: none;
}

.topic-unit-group > summary::before {
    width: 0.45rem;
    height: 0.45rem;
    border-right: 2px solid #4373ec;
    border-bottom: 2px solid #4373ec;
    content: "";
    transform: rotate(-45deg);
    transition: transform 160ms ease;
}

.topic-unit-group[open] > summary::before {
    transform: rotate(45deg);
}

.topic-unit-group > summary:hover {
    color: #103aa2;
}

.topic-unit-name {
    overflow-wrap: anywhere;
    font-size: 1.05rem;
    font-weight: 700;
}

.topic-unit-count {
    color: #768083;
    font-size: 0.85rem;
    white-space: nowrap;
}

.topic-group-table-wrap {
    padding: 0 0 0.75rem 1.5rem;
}

.topic-group-table-wrap .topic-group-table {
    min-width: 700px;
}

.topic-group-table th {
    padding: 0;
}

.topic-group-table th:first-child {
    border-radius: 4px 0 0 4px;
}

.topic-group-table th:last-child {
    border-radius: 0 4px 4px 0;
}

.sort-header {
    width: 100%;
    min-height: 2.75rem;
    border: 0;
    background: transparent;
    color: inherit;
    font-weight: 700;
    cursor: pointer;
}

.sort-header:hover,
.sort-header:focus-visible {
    background: rgb(255 255 255 / 14%);
}

.sort-header span {
    display: inline-block;
    width: 1rem;
}

.topic-name-cell {
    min-width: 11rem;
    font-weight: 700;
    text-align: left !important;
}

.topic-description-cell {
    max-width: 28rem;
    text-align: left !important;
}

.topic-description-cell span {
    display: -webkit-box;
    overflow: hidden;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.topic-group-table time {
    white-space: nowrap;
}

.topic-empty-state {
    margin-top: 1rem;
}

.question-bank-toolbar {
    width: min(90rem, 96vw);
    display: grid;
    grid-template-columns: auto minmax(12rem, 1.5fr) repeat(4, minmax(9rem, 1fr));
    align-items: end;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.question-bank-toolbar .filter-input,
.question-bank-toolbar select {
    max-width: none;
}

.question-bank-table {
    width: min(90rem, 96vw);
}

.question-selection-bar {
    width: min(90rem, 96vw);
    min-height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.55rem 0;
    border-top: 1px solid #d7dddf;
    border-bottom: 1px solid #d7dddf;
}

.question-selection-summary {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: #596467;
    white-space: nowrap;
}

.question-selection-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.selection-cell {
    width: 3rem;
    min-width: 3rem;
}

.selection-checkbox {
    width: 1.15rem;
    height: 1.15rem;
    margin: 0;
    accent-color: #1f9d57;
    cursor: pointer;
}

.selected-question-row td {
    background: #e3f3ea !important;
}

.question-bank-table .learnio-table {
    min-width: 68rem;
}

.question-text-cell {
    max-width: 28rem;
    text-align: left !important;
    white-space: normal;
}

.question-text-cell > strong,
.question-text-cell > span {
    display: block;
}

.question-text-cell > strong {
    margin-bottom: 0.25rem;
    color: #315cc8;
    font-size: 0.78rem;
}

.question-editor-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-right: 2.75rem;
    margin-bottom: 1.25rem;
}

.question-editor-heading h2 {
    margin: 0;
}

.question-editor-heading span {
    display: block;
    margin-top: .25rem;
    color: #697279;
    font-size: .85rem;
}

.question-editor-heading > strong {
    color: #174eb8;
    font-size: 1.15rem;
    white-space: nowrap;
}

.question-bank-preview-modal {
    width: min(64rem, calc(100vw - 2rem));
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
}

.question-preview-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
    margin-bottom: 1.25rem;
    padding: .9rem;
    background: #f5f7fa;
}

.question-preview-meta span,
.question-preview-reference {
    min-width: 0;
    overflow-wrap: anywhere;
}

.question-preview-meta strong,
.question-preview-reference > span {
    display: block;
    margin-bottom: .2rem;
    color: #697279;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.question-preview-reference {
    padding: .9rem 1rem;
    border-left: 4px solid #4373ec;
    background: #f5f8ff;
}

.question-preview-reference p {
    margin: 0;
    white-space: pre-wrap;
}

@media (max-width: 700px) {
    .question-editor-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .question-preview-meta {
        grid-template-columns: 1fr;
    }
}

.add-panel {
    width: min(60rem, 92vw);
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.matrix-heading {
    width: min(70rem, 92vw);
    margin: 0 auto 2rem;
    padding-top: 2rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
}

.matrix-heading h1 {
    font-size: 4rem;
    margin: 0 0 0.5rem;
    text-shadow: -5px 5px #30303033;
}

.topic-countdown {
    flex: 0 0 auto;
    min-width: 9.5rem;
    padding: 0.65rem 0.9rem;
    border-left: 4px solid #4373ec;
    background: #fff;
    box-shadow: 0 3px 12px rgb(0 0 0 / 12%);
    text-align: right;
}

.topic-countdown span { display: block; color: #697279; font-size: 0.82rem; }
.topic-countdown strong { color: #174eb8; font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.topic-countdown.urgent { border-left-color: #eb4949; background: #fff2f2; }
.topic-countdown.urgent strong { color: #b42328; }

.assessment-timer-actions {
    display: flex;
    align-items: stretch;
    gap: .65rem;
}

.student-purpose-card,
.assessment-entry-panel {
    width: min(70rem, 92vw);
    margin: 0 auto 2rem;
    padding: 1.35rem 1.5rem;
    border: 1px solid #cdd9e6;
    border-left: 5px solid #4373ec;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 7px 20px rgb(38 50 56 / 8%);
}

.student-purpose-card h2,
.assessment-entry-panel h2 { margin: .25rem 0 .55rem; }
.student-purpose-card p,
.assessment-entry-panel p { margin: 0; color: #4a5358; line-height: 1.55; }
.subject-grid + .student-assessment-overview { margin-top: 3rem; }
.compact-summary-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.compact-summary-card { padding: 1.15rem 1.25rem; }
.compact-summary-card .assessment-score-line { margin-top: .75rem; }
.compact-summary-card footer { margin-top: .8rem; padding-top: .8rem; }

.subject-assessment-modal { width: min(38rem, 94vw); }
.subject-assessment-modal h2 { margin: .4rem 0 .75rem; font-size: 2rem; }
.subject-assessment-modal p { line-height: 1.55; }
.assessment-instruction-list { display: grid; gap: .45rem; padding-left: 1.3rem; color: #4a5358; }
.assessment-time-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 1.25rem 0 .75rem;
    padding: .9rem 1rem;
    border-radius: 5px;
    background: #edf3ff;
    color: #174eb8;
}
.assessment-time-card strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.assessment-pause-note { color: #697279; font-size: .92rem; }
.assessment-entry-panel { text-align: center; }
.assessment-entry-panel .assessment-time-card { max-width: 28rem; margin-inline: auto; }
.assessment-entry-panel .primary-action { margin-top: 1rem; }

.mixed-result-panel {
    gap: 16px;
    margin-bottom: 20px;
    padding: 16px 18px;
}
.mixed-result-score > strong { font-size: 36px; }
.mixed-result-guidance h2 { font-size: 19px; }
.mixed-result-guidance .primary-action { margin-top: 8px; }

.toggle-row { flex-wrap: wrap; }
.toggle-row small { flex-basis: 100%; padding-left: 2rem; }

@media (max-width: 700px) {
    .assessment-timer-actions { align-items: flex-end; flex-direction: column; }
    .student-purpose-card { width: 94vw; }
}

.assessment-completion-modal { width: min(58rem, 96vw); }
.completion-heading { padding-right: 2.5rem; }
.completion-heading > span { color: #697279; font-weight: 700; text-transform: uppercase; }
.completion-heading h2 { margin: 0.3rem 0; font-size: 2.4rem; }
.completion-heading p { margin: 0; color: #4a5358; }

.category-result-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.category-result-columns section { min-width: 0; }
.category-result-columns h3,
.completion-practice-list h3 { margin: 0 0 0.65rem; font-size: 1.05rem; }
.category-result-list { display: grid; gap: 0.4rem; margin: 0; padding: 0; list-style: none; }
.category-result-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.6rem 0.7rem;
    border-left: 4px solid;
    background: #f7f8f9;
}
.category-result-list li span { min-width: 0; overflow-wrap: anywhere; }
.correct-list li { border-left-color: #27ae60; background: #edf8f2; color: #17633a; }
.incorrect-list li { border-left-color: #eb4949; background: #fff1f1; color: #8f1f24; }
.empty-result-note { margin: 0; color: #697279; }
.completion-practice-list { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid #dce2e7; }
.completion-practice-list .remediation-row + .remediation-row { margin-top: 0.45rem; }
.completion-ready { padding: 0.8rem; border-left: 4px solid #27ae60; background: #edf8f2; color: #17633a; }
.practice-completion-modal {
    width: min(35rem, 94vw);
    padding: 2rem;
    text-align: center;
}
.practice-completion-modal h2 { margin: .65rem 0 .75rem; }
.practice-completion-modal p { margin: 0; color: #4a5358; line-height: 1.6; }
.practice-completion-modal .dialog-actions { justify-content: center; }
.practice-completion-icon {
    display: grid;
    width: 4.25rem;
    height: 4.25rem;
    margin: 0 auto;
    place-items: center;
    border-radius: 50%;
    background: #27ae60;
    color: #fff;
    font-size: 2.35rem;
    font-weight: 700;
    box-shadow: 0 7px 18px rgb(39 174 96 / 25%);
}
.field-remediation-modal { width: min(38rem, 94vw); }
.field-result-code { color: #697279; font-weight: 700; }
.field-remediation-modal h2 { margin: 0.25rem 2.5rem 1rem 0; }

.question-grid {
    width: min(68rem, 94vw);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(var(--columns), minmax(8rem, 1fr));
    gap: 1rem;
}

.matrix-cell {
    min-height: 8rem;
    border: 0;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 0.4rem;
    box-shadow: 0 3px 10px rgb(0 0 0 / 16%);
}

.matrix-cell small {
    min-height: 1.1rem;
    font-size: 0.8rem;
}

.matrix-cell.locked {
    background: #d6d6d6;
    color: #737b7d;
    cursor: default;
}

.student-open-tests-widget {
    position: fixed;
    top: calc(var(--app-nav-height, 72px) + 0.65rem);
    right: max(0.75rem, env(safe-area-inset-right));
    z-index: 19;
    width: min(18rem, calc(100vw - 1.5rem));
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.student-open-tests-toggle {
    min-height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 0.45rem 0.85rem 0.45rem 1rem;
    border: 1px solid #e4e9ef;
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: 0 5px 16px rgb(22 58 104 / 18%);
    color: #173451;
    font-weight: 700;
    cursor: pointer;
}

.student-open-tests-toggle:hover,
.student-open-tests-toggle:focus-visible {
    border-color: #b9c9eb;
    box-shadow: 0 7px 20px rgb(22 58 104 / 23%);
}

.student-open-tests-toggle strong {
    min-width: 1.65rem;
    height: 1.65rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #eb4949;
    color: #fff;
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
}

.student-open-tests-menu {
    width: 100%;
    max-height: min(45vh, 18rem);
    max-height: min(45dvh, 18rem);
    margin-top: 0.4rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0.45rem;
    border: 1px solid #e1e7ed;
    border-radius: 0.7rem;
    background: #fff;
    box-shadow: 0 10px 28px rgb(22 58 104 / 20%);
}

.student-open-tests-menu ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.student-open-tests-menu li + li {
    border-top: 1px solid #edf0f3;
}

.student-open-tests-menu a {
    display: block;
    padding: 0.55rem 0.65rem;
    border-radius: 0.4rem;
    color: #2859bf;
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.student-open-tests-menu a:hover,
.student-open-tests-menu a:focus-visible {
    background: #edf3ff;
    color: #1747ad;
    text-decoration: underline;
}

.student-open-tests-menu p {
    margin: 0;
    padding: 0.65rem;
    color: #697780;
    text-align: center;
}

.admin-attention-toggle strong {
    background: #d68100;
}

.admin-attention-menu li a {
    display: grid;
    gap: 0.2rem;
}

.admin-attention-menu li a span {
    color: #657384;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.25;
}

.admin-attention-all {
    margin-top: 0.35rem;
    border-top: 1px solid #edf0f3;
    text-align: center;
}

.attention-filter-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
}

.attention-filter-banner a {
    color: #1747ad;
    font-weight: 800;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1rem;
    background: rgb(0 0 0 / 48%);
    backdrop-filter: blur(3px);
    animation: lightbox-fade-in 160ms ease-out both;
}

.question-modal {
    width: min(42rem, 94vw);
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    margin: auto 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    position: relative;
    border-radius: 4px;
    background: #fff;
    padding: 2rem;
    box-shadow: 0 8px 30px rgb(0 0 0 / 28%);
    animation: lightbox-panel-in 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.nested-lightbox {
    z-index: 40;
}

@keyframes lightbox-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes lightbox-panel-in {
    from { opacity: 0; transform: translateY(1rem) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 50%;
    background: #eb4949;
    color: #fff;
    cursor: pointer;
}

.answer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.answer {
    min-height: 3rem;
    border: 0;
    border-radius: 4px;
    background: #f7f5f5;
    cursor: pointer;
}

.answer.correct {
    background: #27ae60;
    color: #fff;
}

.answer.incorrect {
    background: #eb4949;
    color: #fff;
}

.snackbar {
    width: fit-content;
    margin: 1rem auto 0;
    border-radius: 4px;
    padding: 0.65rem 1rem;
}

.snackbar.success {
    color: #13532e;
    background: #d9f6e5;
}

.snackbar.error {
    color: #8b1111;
    background: #fde2e2;
}

.snackbar.warning {
    color: #6e4c00;
    background: #fff2c9;
}

.snackbar > span,
.snackbar > strong {
    display: block;
}

.ai-answer-panel,
.ai-question-editor {
    display: grid;
    gap: 0.9rem;
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid #dce5f3;
    border-radius: 0.65rem;
    background: #f8fbff;
}

.ai-answer-panel label,
.ai-question-editor label {
    display: grid;
    gap: 0.4rem;
}

.ai-answer-panel textarea,
.ai-question-editor textarea {
    width: 100%;
    min-height: 7rem;
    resize: vertical;
    padding: 0.75rem;
    border: 1px solid #c8d3df;
    border-radius: 0.45rem;
    font: inherit;
}

.ai-answer-instructions {
    margin: 0;
    color: #334f6c;
    line-height: 1.5;
}

.ai-answer-upload {
    padding: 0.75rem;
    border: 1px dashed #8aa7d8;
    border-radius: 0.45rem;
    background: #fff;
}

.ai-paste-zone {
    display: grid;
    gap: 0.35rem;
    padding: 0.9rem 1rem;
    border: 2px dashed #4a74e8;
    border-radius: 0.65rem;
    background: #eef4ff;
    color: #284a87;
}

.ai-paste-zone strong {
    color: #17386f;
    font-size: 1rem;
}

.ai-paste-zone kbd {
    display: inline-block;
    min-width: 1.7rem;
    padding: 0.08rem 0.3rem;
    border: 1px solid #9eb3dc;
    border-bottom-width: 2px;
    border-radius: 0.25rem;
    background: #fff;
    color: #17386f;
    font: 700 0.82rem/1.3 system-ui, sans-serif;
    text-align: center;
}

.ai-paste-zone small {
    color: #14733d;
    font-weight: 700;
}

.ai-answer-files {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ai-answer-files li,
.review-badge {
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    background: #fff0c9;
    color: #795300;
    font-size: 0.82rem;
    font-weight: 700;
}

.ai-answer-files li {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.ai-answer-files li button {
    display: grid;
    width: 1.35rem;
    height: 1.35rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #b03a2e;
    color: #fff;
    font: 700 1rem/1 system-ui, sans-serif;
    cursor: pointer;
    place-items: center;
}

.ai-answer-files li button:disabled {
    cursor: default;
    opacity: 0.55;
}

.ai-answer-note,
.form-hint {
    color: #67757f;
    line-height: 1.45;
}

.form-hint.warning {
    margin: 0;
    color: #795300;
}

.ai-editor-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.ai-editor-heading > div {
    display: grid;
    gap: 0.25rem;
}

.ai-editor-heading span:not(.review-badge) {
    color: #687780;
    font-size: 0.9rem;
}

.checkbox-row {
    display: flex !important;
    align-items: center;
    gap: 0.6rem !important;
}

@media (max-width: 600px) {
    .ai-answer-panel,
    .ai-question-editor {
        padding: 0.75rem;
    }

    .ai-editor-heading {
        flex-direction: column;
    }
}

.login-hint {
    display: grid;
    gap: 0.25rem;
    margin: 1rem 0;
    border-radius: 4px;
    background: #f7f5f5;
    padding: 0.75rem;
    color: #737b7d;
    font-size: 0.92rem;
}

.profile-card {
    width: min(30rem, 92vw);
    padding: 2rem;
    text-align: center;
}

.profile-dialog {
    width: min(32rem, 94vw);
    text-align: center;
}

.profile-dialog .editable-field {
    text-align: left;
}

.profile-dialog .modal-loading {
    width: 100%;
    margin: 0;
    box-shadow: none;
}

.registration-modal {
    width: min(42rem, 96vw);
}

.auth-dialog {
    width: min(30rem, 94vw);
}

.link-button {
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.profile-avatar {
    width: 7rem;
    height: 7rem;
    display: grid;
    place-items: center;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: #27ae60;
    color: #fff;
    font-size: 2.5rem;
    font-weight: 700;
}

.admin-editor {
    width: min(60rem, 92vw);
    padding: 1.5rem;
}

.admin-preview {
    margin-top: 1.5rem;
}

.people-toolbar,
.filter-toolbar {
    align-items: center;
}

.people-toolbar select,
.filter-toolbar select {
    max-width: 14rem;
}

.loading-panel,
.empty-state {
    width: min(40rem, 92vw);
    margin: 2rem auto;
    padding: 2rem;
    text-align: center;
    color: #737b7d;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 3px 12px rgb(0 0 0 / 16%);
}

.page-loading {
    margin-top: 18vh;
}

.empty-state h2 {
    margin: 0 0 0.5rem;
    color: #373f41;
}

.table-scroll {
    overflow-x: auto;
}

.table-scroll .learnio-table {
    min-width: 760px;
}

.results-table {
    width: min(90rem, 96vw);
}

.row-actions {
    white-space: nowrap;
}

.icon-action,
.edit-toggle {
    width: 2.25rem;
    height: 2.25rem;
    margin: 0 0.12rem;
    border: 0;
    border-radius: 50%;
    color: #fff;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.form-modal h2 {
    margin: 0 2rem 1.5rem 0;
    font-size: 2rem;
}

.form-modal .invalid-field {
    border-color: #e5484d;
    box-shadow: 0 0 0 2px rgba(229, 72, 77, 0.16);
}

.form-error-message {
    margin: 0 0 1rem;
    padding: 0.75rem 0.9rem;
    border-left: 4px solid #e5484d;
    background: #fff0f0;
    color: #a4161a;
}

.wide-modal {
    width: min(52rem, 96vw);
}

.compact-modal {
    width: min(34rem, 94vw);
}

.class-manager-modal {
    width: min(46rem, 96vw);
}

.topic-preview-modal {
    width: min(76rem, 98vw);
}

.topic-preview-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 2.5rem 1.5rem 0;
}

.topic-preview-heading h2 {
    margin: 0.2rem 0 0.35rem;
    font-size: 2.5rem;
}

.topic-preview-heading p {
    margin: 0;
}

.preview-label {
    color: #737b7d;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.preview-refresh {
    flex: 0 0 auto;
    margin-top: 0.25rem;
}

.preview-grid {
    width: 100%;
    margin: 0;
}

.matrix-cell.preview-inspectable.locked:not(:disabled) {
    cursor: pointer;
}

.unlock-rules-modal {
    width: min(52rem, 94vw);
}

.toggle-row {
    min-height: 3.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toggle-row input {
    width: 1.25rem;
    height: 1.25rem;
}

.unlock-target-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
}

.unlock-default-flow {
    max-height: 48vh;
    overflow: auto;
    border-block: 1px solid #d9dfe8;
}

.unlock-default-flow div {
    display: grid;
    grid-template-columns: minmax(8rem, 0.6fr) minmax(12rem, 1.4fr);
    gap: 1rem;
    padding: 0.7rem 0.25rem;
    border-bottom: 1px solid #e8ebef;
}

.unlock-default-flow span {
    color: #737b7d;
}

.class-manager-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.65rem;
    color: #737b7d;
}

.class-picker {
    max-height: 12rem;
    margin-bottom: 1.25rem;
    overflow-y: auto;
    border: 1px solid #d8dde6;
    border-radius: 4px;
}

.class-picker-row {
    width: 100%;
    min-height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 0;
    border-bottom: 1px solid #e7eaf0;
    background: #fff;
    padding: 0.65rem 0.8rem;
    color: #373f41;
    text-align: left;
    cursor: pointer;
}

.class-picker-row:last-child {
    border-bottom: 0;
}

.class-picker-row:hover,
.class-picker-row.selected {
    background: #edf2ff;
}

.class-picker-row.selected {
    box-shadow: inset 4px 0 #4373ec;
}

.class-picker-row span:first-child {
    display: grid;
    min-width: 0;
}

.class-picker-row small {
    margin-top: 0.15rem;
    color: #737b7d;
}

.class-edit-mark {
    color: #4373ec;
    font-size: 1.25rem;
}

.form-section-title {
    margin: 0 0 0.75rem;
    color: #373f41;
    font-size: 1.05rem;
}

.form-grid {
    display: grid;
    gap: 0.75rem;
}

.two-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.check-list {
    margin: 1rem 0 0;
    border: 1px solid #d8dde6;
    border-radius: 4px;
    padding: 0.75rem 1rem;
}

.check-list legend {
    padding: 0 0.35rem;
    color: #737b7d;
    font-size: 0.9rem;
}

.check-list label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0.4rem 0;
}

.check-list input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    padding: 0;
    accent-color: #4373ec;
}

.check-list label > span {
    min-width: 0;
}

.check-list label small {
    display: block;
    margin-top: 0.1rem;
    color: #737b7d;
    font-size: 0.78rem;
}

.fieldset-hint {
    margin: 0.35rem 0;
    color: #737b7d;
}

.source-topic-list {
    max-height: 15rem;
    overflow-y: auto;
}

.source-topic-list .source-select-all {
    position: sticky;
    top: -0.75rem;
    z-index: 1;
    margin: -0.35rem 0 0.55rem;
    border-bottom: 1px solid #d8dde6;
    padding: 0.65rem 0 0.7rem;
    background: #fff;
    font-weight: 700;
}

.taxonomy-source-picker {
    max-height: min(24rem, 46vh);
    max-height: min(24rem, 46dvh);
}

.taxonomy-source-category {
    border-bottom: 1px solid #e1e5eb;
    padding: 0.35rem 0;
}

.taxonomy-source-category.selected {
    border-left: 3px solid #4373ec;
    padding-left: 0.55rem;
    background: #f4f7ff;
}

.taxonomy-source-category-row {
    align-items: center;
    font-weight: 700;
}

.taxonomy-source-category-row span,
.taxonomy-source-units span {
    display: flex;
    min-width: 0;
    flex: 1;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}

.taxonomy-source-category-row small,
.taxonomy-source-units small {
    flex: 0 0 auto;
    color: #737b7d;
    font-weight: 400;
}

.taxonomy-source-units {
    margin-left: 1.75rem;
    border-left: 1px solid #d8dde6;
    padding-left: 0.65rem;
}

.taxonomy-source-units label {
    min-height: 2.15rem;
    padding-block: 0.25rem;
}

.taxonomy-source-units label.included {
    color: #315cbe;
}

.taxonomy-source-legacy {
    margin-top: 0.65rem;
    border-top: 1px solid #d8dde6;
    padding-top: 0.65rem;
}

.taxonomy-source-legacy summary {
    cursor: pointer;
    font-weight: 700;
}

@media (max-width: 640px) {
    .taxonomy-source-category-row span,
    .taxonomy-source-units span {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.1rem;
    }
}

.dialog-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.confirm-dialog {
    width: min(27rem, 92vw);
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    margin: auto 0;
    overflow-y: auto;
    padding: 1.5rem;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 8px 30px rgb(0 0 0 / 28%);
}

.confirm-dialog h2 {
    margin-top: 0;
}

.top-dialog {
    z-index: 40;
}

.admin-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.heading-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
}

.cell-count-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    border-bottom: 1px solid #d8dde6;
    padding: 0.75rem 0;
}

.cell-count-summary strong {
    color: #4373ec;
    font-size: 1.5rem;
}

.question-tabs {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.question-tabs button {
    min-width: 7rem;
    border: 0;
    border-bottom: 3px solid transparent;
    background: #f1f3f4;
    padding: 0.65rem;
    cursor: pointer;
}

.question-tabs button.active {
    border-color: #4373ec;
    color: #4373ec;
}

.student-question-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-right: 2.5rem;
}

.student-question-heading span {
    color: #737b7d;
    font-size: 0.85rem;
}

.student-question-heading h2 {
    margin: 0.15rem 0 0;
}

.student-question-heading > strong {
    min-width: 3.5rem;
    color: #4373ec;
    font-size: 1.35rem;
    text-align: right;
}

.question-progress {
    height: 0.45rem;
    margin: 1rem 0;
    overflow: hidden;
    border-radius: 4px;
    background: #e1e5ea;
}

.question-progress span {
    display: block;
    width: var(--progress);
    height: 100%;
    background: #27ae60;
}

.question-stepper {
    display: flex;
    gap: 0.45rem;
    overflow-x: auto;
    padding-bottom: 0.35rem;
}

.question-stepper button {
    flex: 0 0 2.25rem;
    width: 2.25rem;
    height: 2.25rem;
    border: 2px solid transparent;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
}

.question-stepper button.open { background: #4373ec; }
.question-stepper button.done { background: #27ae60; }
.question-stepper button.wrong { background: #eb4949; }
.question-stepper button.locked { background: #8f8e8b; }
.question-stepper button.active { border-color: #303030; }

.student-question-text {
    margin: 1.25rem 0 1rem;
    font-size: 1.05rem;
    line-height: 1.55;
}

.editor-mode-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin: 0 0 1rem;
    border-bottom: 1px solid #d8dde6;
}

.editor-mode-tabs button {
    min-height: 2.75rem;
    border: 0;
    border-bottom: 3px solid transparent;
    background: #fff;
    color: #4e5659;
    cursor: pointer;
}

.editor-mode-tabs button.active {
    border-color: #eb4949;
    color: #a11212;
    font-weight: 700;
}

.question-image,
.question-image-editor img {
    display: block;
    max-width: 100%;
    max-height: 20rem;
    margin: 0.75rem auto;
    object-fit: contain;
}

.question-image-trigger {
    position: relative;
    display: block;
    width: fit-content;
    max-width: 100%;
    margin: 0.75rem auto;
    overflow: hidden;
    padding: 0;
    border: 1px solid #d8e1ec;
    border-radius: 0.65rem;
    background: #f8fafc;
    box-shadow: 0 4px 14px rgb(26 54 88 / 10%);
    cursor: zoom-in;
}

.question-image-trigger .question-image {
    margin: 0;
    transition: transform 180ms ease;
}

.question-image-trigger:hover .question-image {
    transform: scale(1.015);
}

.question-image-trigger:focus-visible {
    outline: 3px solid rgb(67 115 236 / 42%);
    outline-offset: 3px;
}

.question-image-zoom-hint {
    position: absolute;
    right: 0.55rem;
    bottom: 0.55rem;
    display: inline-flex;
    min-height: 2.25rem;
    align-items: center;
    gap: 0.4rem;
    padding: 0.38rem 0.65rem;
    border-radius: 999px;
    background: rgb(18 50 96 / 90%);
    box-shadow: 0 3px 10px rgb(0 0 0 / 22%);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
}

.question-image-zoom-hint svg {
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.question-image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: clamp(0.75rem, 2vw, 1.5rem);
    background: rgb(7 15 28 / 94%);
    backdrop-filter: blur(6px);
    animation: lightbox-fade-in 160ms ease-out both;
}

.question-image-lightbox-close {
    position: fixed;
    top: max(0.85rem, env(safe-area-inset-top));
    right: max(0.85rem, env(safe-area-inset-right));
    z-index: 2;
    width: 3rem;
    height: 3rem;
    border: 2px solid rgb(255 255 255 / 75%);
    border-radius: 50%;
    background: #eb4949;
    box-shadow: 0 5px 18px rgb(0 0 0 / 28%);
    color: #fff;
    font-size: 1.8rem;
    line-height: 1;
}

.question-image-lightbox-close:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.question-image-lightbox-stage {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    place-items: center;
    gap: 0.75rem;
    margin: 0;
    overflow: auto;
    overscroll-behavior: contain;
    touch-action: pan-x pan-y pinch-zoom;
}

.question-image-lightbox-stage img {
    display: block;
    width: auto;
    height: auto;
    max-width: min(96rem, 100%);
    max-height: calc(100vh - 6.5rem);
    max-height: calc(100dvh - 6.5rem);
    object-fit: contain;
    box-shadow: 0 12px 40px rgb(0 0 0 / 45%);
}

.question-image-lightbox-stage figcaption {
    padding: 0.35rem 3.5rem;
    color: #fff;
    font-size: 0.85rem;
    text-align: center;
}

@media (hover: none) {
    .question-image-trigger:hover .question-image {
        transform: none;
    }
}

.question-image-editor {
    position: relative;
    margin: 0.5rem 0 1rem;
}

.question-image-editor .icon-action {
    position: absolute;
    top: 0;
    right: 0;
}

.file-picker input {
    padding: 0.55rem;
    background: #f7f8fa;
}

.existing-question-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.existing-question-list {
    display: grid;
    max-height: 24rem;
    overflow-y: auto;
    border: 1px solid #d8dde6;
}

.existing-question {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.25rem 1rem;
    border: 0;
    border-bottom: 1px solid #e6e9ed;
    background: #fff;
    padding: 0.8rem;
    text-align: left;
    cursor: pointer;
}

.existing-question p {
    grid-column: 1 / -1;
    margin: 0.25rem 0 0;
}

.existing-question.selected {
    box-shadow: inset 4px 0 #4373ec;
    background: #f1f5ff;
}

.inline-check,
.dependency-row,
.level-picker {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.inline-check {
    margin: 1rem 0;
}

.dependency-row {
    justify-content: space-between;
    border-bottom: 1px solid #edf0f2;
}

.dependency-row:last-child {
    border-bottom: 0;
}

.level-picker input {
    width: 4rem;
}

.recommended-topics {
    display: grid;
    gap: 0.55rem;
    margin-top: 1rem;
    border-top: 1px solid #d8dde6;
    padding-top: 1rem;
}

.recommended-topics h3,
.recommended-topics p {
    margin: 0;
}

.table-action:disabled,
.icon-action:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.local-mail-note code {
    overflow-wrap: anywhere;
}

.editable-profile {
    width: min(31rem, 94vw);
    padding: 2rem 2.5rem;
}

.editable-profile h1 {
    margin: 0 0 1rem;
    text-align: center;
}

.editable-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 2.5rem;
    align-items: center;
    gap: 0.5rem;
}

.editable-field label {
    margin-bottom: 0.65rem;
}

.edit-toggle {
    background: #a2a2a2;
}

.edit-toggle.active {
    background: #27ae60;
}

.password-action {
    width: 100%;
    min-height: 3rem;
    margin: 0.35rem 0 1rem;
    border: 0;
    background: #27ae60;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.management-dock {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 25;
    display: grid;
    justify-items: end;
    gap: 0.55rem;
}

.dock-main,
.dock-actions button {
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 3px 12px rgb(0 0 0 / 25%);
    cursor: pointer;
}

.dock-main {
    width: 3.5rem;
    height: 3.5rem;
    background: #eb4949;
    font-size: 2rem;
}

.dock-actions {
    display: grid;
    gap: 0.45rem;
}

.dock-actions button {
    width: 2.75rem;
    height: 2.75rem;
    background: #4373ec;
}

.dock-actions button:nth-child(even) {
    background: #27ae60;
}

.copy-action {
    margin-left: auto;
}

.register-card {
    width: min(94vw, 470px);
}

.profile-page {
    padding-top: 5rem;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgb(0 0 0 / 20%);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

::-webkit-scrollbar {
    width: 1vh;
    height: 1vh;
}

::-webkit-scrollbar-track {
    background: whitesmoke;
}

::-webkit-scrollbar-thumb {
    background-image: linear-gradient(#27ae60, rgb(41, 97, 65));
    border-radius: 25px;
}

@media (max-width: 760px) {
    .matrix-heading { flex-direction: column; }
    .topic-countdown { width: 100%; text-align: left; }
    .category-result-columns { grid-template-columns: 1fr; }
    .completion-heading h2 { font-size: 1.9rem; }

    .modal-backdrop {
        padding: 0.5rem;
    }

    .question-modal,
    .confirm-dialog {
        width: 100%;
        max-height: calc(100vh - 1rem);
        max-height: calc(100dvh - 1rem);
        padding: 1.25rem;
    }

    .class-manager-heading {
        align-items: flex-start;
    }

    .topic-preview-heading {
        flex-direction: column;
    }

    .learnio-nav {
        flex-wrap: wrap;
        gap: 0.45rem 0.8rem;
        padding: 0.55rem 0.75rem;
    }

    .nav-links {
        order: 3;
        display: flex;
        flex: 1 0 100%;
        gap: 1rem;
        overflow-x: auto;
        padding: 0.25rem 0 0.15rem;
        font-size: 0.85rem;
        white-space: nowrap;
        scrollbar-width: thin;
    }

    .brand {
        font-size: 20px;
    }

    .nav-actions .pill {
        min-width: auto;
        padding: 0.55rem 0.8rem;
    }

    .auth-page,
    .catalogue-page,
    .centered-page,
    .matrix-page,
    .profile-page {
        padding-top: 8.5rem;
    }

    .home-page {
        min-height: 100vh;
    }

    .home-band {
        min-height: 100vh;
        grid-template-columns: 1fr;
        gap: 2rem;
        padding-top: 8rem;
    }

    .tech-band {
        display: none;
    }

    .home-copy p {
        font-size: 1.3rem;
        text-align: justify;
    }

    .page-title {
        font-size: 4rem;
    }

    .question-grid {
        grid-template-columns: 1fr;
    }

    .add-panel,
    .answer-grid,
    .two-columns {
        grid-template-columns: 1fr;
    }

    .toolbar-row {
        width: 94vw;
        flex-wrap: wrap;
    }

    .topics-toolbar {
        width: 94vw;
        grid-template-columns: 1fr 1fr auto;
    }

    .topics-toolbar .pill,
    .topic-search-filter {
        grid-column: 1 / -1;
    }

    .topics-browser {
        width: 94vw;
    }

    .topic-subject-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .topic-subject-heading > span {
        white-space: normal;
    }

    .topic-unit-list {
        padding-inline: 0.75rem;
    }

    .topic-group-table-wrap {
        padding-left: 1rem;
    }

    .question-bank-toolbar {
        width: 94vw;
        grid-template-columns: 1fr 1fr;
    }

    .question-bank-toolbar .pill,
    .question-bank-toolbar .filter-input {
        grid-column: 1 / -1;
    }

    .question-selection-bar {
        width: 94vw;
        align-items: flex-start;
        flex-direction: column;
    }

    .question-selection-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .people-toolbar select,
    .filter-toolbar select,
    .filter-input {
        max-width: none;
        flex: 1 1 12rem;
    }

    .admin-heading {
        align-items: flex-start;
    }

    .admin-heading,
    .student-question-heading {
        flex-direction: column;
    }

    .heading-actions {
        justify-content: flex-start;
    }

    .management-dock {
        right: 1rem;
        bottom: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .modal-backdrop,
    .question-modal,
    .confirm-dialog {
        animation: none;
    }
}

.question-import-page {
    padding: 7rem 3vw 4rem;
}

.import-heading {
    width: min(96rem, 100%);
    margin: 0 auto 1.25rem;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
}

.import-heading h1 {
    margin: 0.15rem 0;
    font-size: 3rem;
}

.import-heading p,
.import-preview-heading p,
.import-preview-heading h2 {
    margin: 0;
}

.section-label {
    color: #737b7d;
    font-size: 0.78rem;
    font-weight: 800;
}

.import-file-action {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.import-file-action input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.import-empty-state {
    width: min(60rem, 100%);
    min-height: 16rem;
    margin: 5rem auto 0;
    border: 2px dashed #aeb8c7;
    border-radius: 4px;
    background: rgb(255 255 255 / 82%);
    display: grid;
    place-content: center;
    gap: 0.5rem;
    padding: 2rem;
    text-align: center;
}

.import-empty-state strong {
    color: #1747b8;
    font-size: 1.35rem;
}

.import-empty-state span {
    color: #687174;
}

.import-summary {
    width: min(96rem, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(5, minmax(7rem, 1fr));
    border-block: 1px solid #d7dde6;
    background: rgb(255 255 255 / 88%);
}

.import-summary > div {
    min-height: 5rem;
    display: grid;
    place-content: center;
    text-align: center;
}

.import-summary > div + div {
    border-left: 1px solid #d7dde6;
}

.import-summary strong {
    color: #1747b8;
    font-size: 1.6rem;
}

.import-summary span {
    color: #687174;
    font-size: 0.82rem;
    font-weight: 700;
}

.import-summary .attention strong {
    color: #a86700;
}

.import-source-line,
.import-actions,
.unit-domain-row {
    width: min(96rem, 100%);
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.import-source-line {
    padding: 1rem 0;
    color: #4d5659;
}

.import-validation {
    width: min(96rem, 100%);
    margin: 0.35rem auto;
    border-left: 4px solid;
    background: #fff;
    padding: 0.7rem 0.9rem;
}

.import-validation.error {
    border-color: #eb4949;
    color: #8b1111;
}

.import-validation.warning {
    border-color: #e0a11b;
    color: #6f4b00;
}

.import-toolbar {
    width: min(96rem, 100%);
    margin: 0.75rem auto;
    display: grid;
    grid-template-columns: minmax(14rem, 2fr) minmax(13rem, 1fr) minmax(11rem, 0.8fr) auto;
    align-items: center;
    gap: 0.65rem;
}

.import-toolbar .filter-input,
.import-toolbar select {
    width: 100%;
    max-width: none;
}

.compact-toggle {
    min-height: 3rem;
    padding-inline: 0.75rem;
    background: #fff;
    white-space: nowrap;
}

.import-table-wrap {
    overflow-x: auto;
    scrollbar-gutter: stable;
}

.import-table {
    min-width: 78rem;
}

.import-table td {
    vertical-align: middle;
}

.import-table .question-text-cell small {
    display: block;
    margin-top: 0.25rem;
    color: #737b7d;
}

.import-table .needs-review-row td {
    background: #fff5d9;
}

.import-unit-select {
    min-width: 15rem;
}

.difficulty-segments {
    display: grid;
    grid-template-columns: repeat(5, 2.35rem);
    width: 11.75rem;
}

.grid-position-editor {
    display: grid;
    gap: 0.35rem;
}

.assessment-segments {
    grid-template-columns: repeat(4, 2.35rem);
    width: 9.4rem;
}

.difficulty-segments button {
    width: 2.35rem;
    height: 2.35rem;
    border: 1px solid #b7c0cf;
    border-right: 0;
    background: #fff;
    color: #4c565a;
    cursor: pointer;
}

.difficulty-segments button:first-child {
    border-radius: 4px 0 0 4px;
}

.difficulty-segments button:last-child {
    border-right: 1px solid #b7c0cf;
    border-radius: 0 4px 4px 0;
}

.difficulty-segments button.active {
    background: #4373ec;
    color: #fff;
    font-weight: 800;
}

.review-toggle {
    min-width: 6.5rem;
    min-height: 2.3rem;
    border: 0;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
}

.review-toggle.approved {
    background: #208c4d;
}

.review-toggle.pending {
    background: #ba7200;
}

.import-actions {
    padding: 1rem 0;
    color: #687174;
}

.import-actions > div {
    display: flex;
    gap: 0.5rem;
}

.import-preview-modal {
    width: min(62rem, 96vw);
}

.import-preview-heading {
    margin-right: 2.5rem;
}

.import-preview-heading > span {
    color: #737b7d;
    font-size: 0.82rem;
    font-weight: 700;
}

.import-preview-heading h2 {
    font-size: 2.4rem;
}

.import-question-image {
    display: block;
    max-width: 100%;
    max-height: 56vh;
    margin: 1.25rem auto;
    object-fit: contain;
}

.import-preview-fields {
    margin-top: 1rem;
}

.manual-review-note {
    border-left: 4px solid #e0a11b;
    background: #fff5d9;
    padding: 0.75rem;
    color: #6f4b00;
}

.unit-import-result {
    width: min(96rem, 100%);
    margin: 1rem auto 0;
    border-top: 1px solid #cfd6e1;
    padding-top: 1rem;
}

.unit-import-result h2 {
    margin: 0 0 0.75rem;
    font-size: 1.35rem;
}

.unit-domain-row {
    min-height: 2.8rem;
    border-bottom: 1px solid #e1e5eb;
}

.unit-domain-row strong {
    min-width: 15rem;
}

.unit-domain-row span {
    color: #5f686b;
    text-align: right;
}

@media (max-width: 850px) {
    .question-import-page {
        padding: 6rem 1rem 3rem;
    }

    .import-heading,
    .import-actions,
    .unit-domain-row {
        align-items: stretch;
        flex-direction: column;
    }

    .import-heading h1 {
        font-size: 2.4rem;
    }

    .import-heading .heading-actions,
    .import-actions > div {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }

    .import-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .import-summary > div + div {
        border-left: 0;
    }

    .import-summary > div:nth-child(even) {
        border-left: 1px solid #d7dde6;
    }

    .import-toolbar {
        grid-template-columns: 1fr;
    }

    .unit-domain-row strong {
        min-width: 0;
    }

    .unit-domain-row span {
        text-align: left;
    }
}

/* Responsive application shell and page hardening */
:root {
    --app-nav-height: 4.5rem;
    --page-inline-space: clamp(0.75rem, 3vw, 2rem);
}

html {
    min-width: 0;
    overflow-x: hidden;
}

body,
.learnio-shell,
.page-bg {
    min-width: 0;
    max-width: 100%;
}

body {
    overflow-x: hidden;
}

img,
svg,
video,
canvas {
    max-width: 100%;
}

button,
input,
textarea,
select,
label,
fieldset {
    min-width: 0;
}

.learnio-nav {
    min-height: var(--app-nav-height);
    gap: clamp(1.25rem, 2.6vw, 3rem);
    padding: 0.75rem clamp(1rem, 2.25vw, 2.5rem);
}

.brand {
    flex: 0 0 auto;
    white-space: nowrap;
}

.brand img {
    flex: 0 0 auto;
}

.nav-menu-panel {
    display: contents;
}

.nav-links {
    min-width: 0;
    gap: clamp(1rem, 3.25vw, 3.5rem);
}

.nav-links a,
.nav-actions button {
    white-space: nowrap;
}

.nav-toggle {
    display: none;
    width: 2.75rem;
    height: 2.75rem;
    margin-left: auto;
    padding: 0.62rem;
    border: 1px solid #d9e0e7;
    border-radius: 0.65rem;
    background: #fff;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: #0b3a66;
    transition: transform 160ms ease, opacity 160ms ease;
}

.nav-toggle span + span {
    margin-top: 0.3rem;
}

.nav-toggle.open span:first-child {
    transform: translateY(0.38rem) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.open span:last-child {
    transform: translateY(-0.38rem) rotate(-45deg);
}

.catalogue-page,
.centered-page,
.matrix-page,
.question-import-page,
.taxonomy-page,
.taxonomy-review-page {
    padding-top: calc(var(--app-nav-height) + clamp(1.75rem, 5vw, 3.5rem));
    padding-right: var(--page-inline-space);
    padding-left: var(--page-inline-space);
}

.centered-page > *,
.catalogue-page > *,
.matrix-page > *,
.question-import-page > *,
.taxonomy-page > *,
.taxonomy-review-page > * {
    max-width: 100%;
}

.page-title {
    margin-bottom: clamp(2rem, 7vw, 4rem);
    font-size: clamp(2.75rem, 8vw, 5.25rem);
    line-height: 1.05;
    overflow-wrap: anywhere;
}

.accordion-list,
.topics-table-wrap,
.data-card,
.toolbar-row,
.topics-toolbar,
.topics-browser,
.question-bank-toolbar,
.question-bank-table,
.question-selection-bar,
.add-panel,
.matrix-heading,
.student-purpose-card,
.assessment-entry-panel,
.question-grid,
.results-table {
    max-width: 100%;
}

.table-scroll,
.taxonomy-grid-wrap,
.import-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
}

.table-scroll:focus-visible,
.taxonomy-grid-wrap:focus-visible,
.import-table-wrap:focus-visible {
    outline: 3px solid rgb(67 115 236 / 40%);
    outline-offset: 2px;
}

.learnio-table th,
.learnio-table td {
    overflow-wrap: anywhere;
}

.results-table {
    width: min(96rem, 100%);
}

.results-table .learnio-table {
    min-width: 76rem;
    font-size: clamp(0.82rem, 1vw, 1rem);
}

.results-table .learnio-table th,
.results-table .learnio-table td {
    padding: 0.65rem 0.5rem;
}

.results-table .table-action {
    padding-inline: 0.85rem;
}

.toolbar-row,
.heading-actions,
.dialog-actions,
.assessment-summary-card header,
.assessment-score-line,
.assessment-summary-card footer,
.remediation-row,
.taxonomy-heading,
.taxonomy-detail-heading,
.taxonomy-legacy-warning,
.review-selection-bar,
.import-source-line,
.import-actions,
.unit-domain-row {
    flex-wrap: wrap;
}

.heading-actions > *,
.dialog-actions > * {
    max-width: 100%;
}

.toolbar-row > * {
    min-width: 0;
}

.filter-toolbar select {
    flex: 0 1 16rem;
    max-width: 16rem;
}

.filter-toolbar .filter-input {
    flex: 0 1 28rem;
    max-width: 28rem;
}

.form-grid > *,
.topics-toolbar > *,
.question-bank-toolbar > *,
.import-toolbar > *,
.taxonomy-review-toolbar > *,
.taxonomy-review-row > *,
.review-taxonomy-fields > *,
.assessment-summary-grid > *,
.subject-grid > * {
    min-width: 0;
}

.question-modal,
.confirm-dialog,
.taxonomy-editor,
.taxonomy-question-dialog {
    max-width: calc(100vw - 2rem);
    max-width: calc(100dvw - 2rem);
}

.question-modal p,
.confirm-dialog p,
.question-modal h2,
.confirm-dialog h2 {
    overflow-wrap: anywhere;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media (max-width: 1100px) {
    .nav-toggle {
        display: block;
    }

    .nav-menu-panel {
        position: absolute;
        inset: 100% 0 auto;
        z-index: 21;
        display: none;
        max-height: calc(100vh - var(--app-nav-height));
        max-height: calc(100dvh - var(--app-nav-height));
        overflow-y: auto;
        padding: 0.75rem var(--page-inline-space) 1rem;
        border-top: 1px solid #e5e9ee;
        background: rgb(255 255 255 / 98%);
        box-shadow: 0 10px 24px rgb(8 47 85 / 16%);
    }

    .nav-menu-panel.open {
        display: grid;
        gap: 0.75rem;
    }

    .nav-links {
        order: initial;
        display: grid;
        width: 100%;
        gap: 0.2rem;
        overflow: visible;
        padding: 0;
        font-size: 1rem;
        white-space: normal;
    }

    .nav-links a {
        width: 100%;
        padding: 0.72rem 0.85rem;
        border-radius: 0.5rem;
    }

    .nav-links a:hover,
    .nav-links a.active {
        background: #edf3ff;
    }

    .nav-actions {
        width: 100%;
        margin: 0;
        padding-top: 0.75rem;
        border-top: 1px solid #e5e9ee;
    }

    .topics-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .topics-toolbar .pill,
    .topics-toolbar .topic-search-filter {
        grid-column: auto;
    }

    .question-bank-toolbar {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .question-bank-toolbar .pill,
    .question-bank-toolbar .filter-input {
        grid-column: auto;
    }

    .add-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mixed-result-panel {
        width: 100%;
    }
}

@media (max-width: 900px) {
    .page-bg {
        background-attachment: scroll;
    }

    .matrix-heading {
        flex-direction: column;
    }

    .toolbar-row {
        width: 100%;
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
        justify-content: stretch;
    }

    .toolbar-row > *,
    .toolbar-row select,
    .toolbar-row .filter-input {
        width: 100%;
        max-width: none;
    }

    .people-toolbar .pill {
        grid-column: 1 / -1;
    }

    .assessment-timer-actions,
    .topic-countdown {
        width: 100%;
    }

    .topic-countdown {
        text-align: left;
    }

    .question-grid,
    .preview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .taxonomy-heading,
    .taxonomy-detail-heading,
    .taxonomy-legacy-warning,
    .review-selection-bar,
    .import-heading,
    .import-actions,
    .unit-domain-row {
        align-items: stretch;
        flex-direction: column;
    }

    .taxonomy-heading .heading-actions,
    .import-heading .heading-actions,
    .import-actions > div {
        width: 100%;
        justify-content: flex-start;
    }

    .taxonomy-heading .heading-actions > *,
    .import-heading .heading-actions > * {
        flex: 1 1 9rem;
    }

    .responsive-card-table {
        display: block;
        min-width: 0 !important;
        border-spacing: 0;
        background: transparent;
    }

    .responsive-card-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }

    .responsive-card-table tbody,
    .responsive-card-table tr,
    .responsive-card-table td {
        display: block;
        width: 100%;
    }

    .responsive-card-table tr {
        margin-bottom: 1rem;
        overflow: hidden;
        border: 1px solid #dce2e8;
        border-left: 4px solid #4373ec;
        border-radius: 0.6rem;
        background: #fff;
        box-shadow: 0 4px 12px rgb(38 50 56 / 9%);
    }

    .responsive-card-table td,
    .responsive-card-table tr:nth-child(even) td {
        display: grid;
        grid-template-columns: minmax(7.75rem, 0.42fr) minmax(0, 1fr);
        align-items: center;
        gap: 0.75rem;
        min-height: 2.8rem;
        padding: 0.62rem 0.8rem;
        border-bottom: 1px solid #edf0f3;
        background: #fff;
        text-align: left;
    }

    .responsive-card-table td:last-child {
        border-bottom: 0;
    }

    .responsive-card-table td::before {
        color: #667176;
        content: attr(data-label);
        font-size: 0.78rem;
        font-weight: 800;
        letter-spacing: 0.025em;
        text-transform: uppercase;
    }

    .responsive-card-table .row-actions,
    .responsive-card-table td[data-label="Radnje"] {
        white-space: normal;
    }

    .responsive-card-table .table-action {
        width: fit-content;
        max-width: 100%;
    }

    .responsive-card-table .grade {
        width: 2.6rem;
        justify-self: start;
    }

    .results-table,
    .results-table.data-card {
        width: 100%;
        overflow: visible;
        background: transparent;
        box-shadow: none;
    }
}

@media (max-width: 720px) {
    :root {
        --page-inline-space: 0.75rem;
    }

    .learnio-nav {
        flex-wrap: nowrap;
        padding: 0.65rem 0.75rem;
    }

    .brand {
        font-size: 1.22rem;
    }

    .brand img {
        width: 1.65rem;
        height: 1.65rem;
    }

    .auth-page,
    .catalogue-page,
    .centered-page,
    .matrix-page,
    .profile-page,
    .question-import-page,
    .taxonomy-page,
    .taxonomy-review-page {
        padding-top: calc(var(--app-nav-height) + 1.5rem);
    }

    .page-title {
        margin-bottom: 1.75rem;
        font-size: clamp(2.6rem, 15vw, 4rem);
        text-shadow: -3px 3px #30303026;
    }

    .subject-grid {
        width: 100%;
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .subject-card {
        height: auto;
        min-height: 12rem;
    }

    .toolbar-row {
        width: 100%;
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        justify-content: stretch;
    }

    .toolbar-row > *,
    .toolbar-row select,
    .toolbar-row .filter-input {
        width: 100%;
        max-width: none;
    }

    .toolbar-row .pill {
        grid-column: 1 / -1;
    }

    .topics-toolbar,
    .question-bank-toolbar,
    .import-toolbar,
    .taxonomy-review-toolbar,
    .add-panel {
        width: 100%;
        grid-template-columns: 1fr;
    }

    .topics-toolbar .pill,
    .topics-toolbar .topic-search-filter,
    .question-bank-toolbar .pill,
    .question-bank-toolbar .filter-input {
        grid-column: auto;
    }

    .topics-browser,
    .question-bank-table,
    .question-selection-bar,
    .student-purpose-card,
    .assessment-entry-panel,
    .matrix-heading,
    .question-grid,
    .accordion-list,
    .data-card,
    .loading-panel,
    .empty-state {
        width: 100%;
    }

    .topic-subject-heading,
    .question-selection-bar,
    .assessment-summary-card header,
    .assessment-summary-card footer,
    .assessment-score-line,
    .remediation-row,
    .assessment-time-card,
    .student-question-heading,
    .topic-preview-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .topic-subject-heading > span,
    .question-selection-summary {
        white-space: normal;
    }

    .topic-unit-list {
        padding-inline: 0.55rem;
    }

    .topic-unit-group > summary {
        grid-template-columns: 0.75rem minmax(0, 1fr);
    }

    .topic-unit-count {
        grid-column: 2;
        white-space: normal;
    }

    .topic-group-table-wrap {
        padding-left: 0.5rem;
    }

    .question-selection-actions,
    .heading-actions,
    .taxonomy-question-dialog-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .student-subcategory-row {
        grid-template-columns: 18px minmax(0, 1fr);
        padding-inline: 0.8rem;
    }

    .student-subcategory-row .table-action {
        grid-column: 2;
        width: 100%;
    }

    .assessment-timer-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .assessment-timer-actions .table-action,
    .assessment-entry-panel .primary-action {
        width: 100%;
    }

    .category-result-columns,
    .answer-grid,
    .two-columns,
    .taxonomy-preview-classification,
    .taxonomy-answer-preview,
    .taxonomy-question-fields {
        grid-template-columns: 1fr;
    }

    .modal-backdrop {
        padding: 0.5rem;
    }

    .question-modal,
    .confirm-dialog,
    .taxonomy-editor,
    .taxonomy-question-dialog {
        width: 100%;
        max-width: calc(100vw - 1rem);
        max-width: calc(100dvw - 1rem);
        max-height: calc(100vh - 1rem);
        max-height: calc(100dvh - 1rem);
        padding: 1.25rem;
    }

    .form-modal h2,
    .field-remediation-modal h2,
    .topic-preview-heading,
    .import-preview-heading {
        margin-right: 2.25rem;
    }

    .dialog-actions {
        align-items: stretch;
    }

    .management-dock {
        right: max(0.75rem, env(safe-area-inset-right));
        bottom: max(0.75rem, env(safe-area-inset-bottom));
    }

    .lucida-hero {
        padding-top: calc(var(--app-nav-height) + 3rem);
    }
}

@media (max-width: 520px) {
    .question-grid,
    .preview-grid {
        grid-template-columns: 1fr;
    }

    .responsive-card-table td,
    .responsive-card-table tr:nth-child(even) td {
        grid-template-columns: minmax(6.5rem, 0.42fr) minmax(0, 1fr);
        gap: 0.55rem;
        padding-inline: 0.65rem;
    }

    .toolbar-row {
        grid-template-columns: 1fr;
    }

    .toolbar-row .pill {
        grid-column: auto;
    }

    .nav-actions {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
    }

    .nav-actions .pill {
        width: 100%;
    }

    .nav-actions .pill:first-child:last-child,
    .nav-actions .pill:first-child:nth-last-child(2) {
        grid-column: auto;
    }

    .dialog-actions > .table-action,
    .dialog-actions > .primary-action {
        flex: 1 1 100%;
        width: 100%;
    }

    .grade-thresholds,
    .import-summary {
        grid-template-columns: 1fr;
    }

    .import-summary > div:nth-child(even),
    .import-summary > div + div {
        border-left: 0;
        border-top: 1px solid #d7dde6;
    }

    .import-heading .heading-actions,
    .import-actions > div {
        grid-template-columns: 1fr;
    }

    .editable-profile,
    .auth-card,
    .profile-card,
    .admin-editor,
    .practice-completion-modal {
        padding: 1.25rem;
    }

    .class-picker-row,
    .dependency-row {
        align-items: stretch;
        flex-direction: column;
    }

    .lucida-hero h1 {
        font-size: clamp(3rem, 19vw, 4.5rem);
    }
}

@media (max-height: 520px) and (orientation: landscape) {
    .nav-menu-panel {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .nav-links {
        grid-template-columns: repeat(3, minmax(8rem, 1fr));
    }

    .nav-actions {
        align-content: start;
        border-top: 0;
        border-left: 1px solid #e5e9ee;
        padding: 0 0 0 0.75rem;
    }
}

.status-page-wrap {
    justify-content: center;
}

.status-page {
    width: min(34rem, 100%);
    padding: clamp(1.5rem, 5vw, 3rem);
    text-align: center;
}

.status-page h1 {
    margin: 0.75rem 0;
    color: #0b3a66;
    font-size: clamp(1.8rem, 6vw, 2.6rem);
}

.status-page p {
    margin: 0;
    color: #687174;
    line-height: 1.6;
}

.status-page .primary-action {
    margin-top: 1.5rem;
}

.status-code {
    display: inline-grid;
    min-width: 4.5rem;
    min-height: 4.5rem;
    place-items: center;
    border-radius: 50%;
    background: #edf3ff;
    color: #4373ec;
    font-size: 1.45rem;
    font-weight: 900;
}

.status-code.error-code {
    background: #fff0f0;
    color: #c9363c;
    font-size: 2rem;
}

/* Monetization */
.test-access-panel {
    width: min(64rem, 100%);
    margin: 1.25rem auto;
    padding: clamp(1.25rem, 3vw, 2rem);
    border: 1px solid #d7dfe7;
    border-top: 4px solid #4373ec;
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: 0 8px 24px rgb(38 50 56 / 10%);
}

.test-access-panel h2 { margin: 0.35rem 0 0.65rem; color: #17324d; }
.test-access-panel > p { color: #58646c; line-height: 1.55; }

.purchase-options-grid,
.pricing-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 21rem), 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
}

.purchase-card,
.pricing-admin-card,
.payment-status-card,
.dcb-entry {
    padding: 1.25rem;
    border: 1px solid #d8e0e8;
    border-radius: 0.65rem;
    background: #f9fbfd;
}

.purchase-card.bundle { border-color: #9bc9ae; background: #f2fbf6; }
.purchase-card > span { color: #6a747a; font-size: 0.85rem; font-weight: 800; text-transform: uppercase; }
.purchase-card > strong { display: block; margin: 0.45rem 0; color: #174eb8; font-size: 1.8rem; }
.purchase-card p { min-height: 3.2rem; color: #566168; line-height: 1.45; }

.purchase-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1rem;
}

.dcb-entry,
.payment-status-card { width: min(36rem, 100%); margin: 1.25rem auto 0; }
.dcb-entry label,
.payment-status-card label { display: grid; gap: 0.4rem; margin: 0.8rem 0; }
.dcb-entry input,
.payment-status-card input { width: 100%; padding: 0.75rem; border: 1px solid #cbd5df; border-radius: 0.4rem; }
.payment-status-card.paid { border-color: #27ae60; background: #f0fbf5; }
.payment-status-card.failed,
.payment-status-card.expired { border-color: #eb4949; background: #fff3f3; }

.monetization-admin-page { align-items: stretch; }
.monetization-heading,
.admin-monetization-section { width: min(96rem, 100%); margin-inline: auto; }
.monetization-heading { margin-bottom: 2rem; }
.monetization-heading .page-title { margin: 0.3rem 0 0.75rem; }
.monetization-heading > p { max-width: 48rem; color: #667178; line-height: 1.55; }
.admin-monetization-section { margin-bottom: 2.5rem; }
.admin-monetization-section > header { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.admin-monetization-section h2 { margin: 0.25rem 0 0; color: #17324d; }
.pricing-admin-card { background: #fff; box-shadow: 0 5px 16px rgb(38 50 56 / 8%); }
.pricing-admin-card > header { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.pricing-admin-card h3 { margin: 0; font-size: 1.35rem; }
.pricing-admin-card small,
.monetization-table small { display: block; margin-top: 0.2rem; color: #6c777d; }
.subject-visibility-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.5rem; padding: 0.8rem; border: 1px solid #f0b9b9; border-radius: 0.55rem; background: #fff3f3; }
.subject-visibility-row.visible { border-color: #a9dfbd; background: #f0fbf4; }
.subject-visibility-row > div { min-width: 0; }
.subject-visibility-row > div > strong { color: #17324d; }
.subject-visibility-row .table-action { flex: 0 0 auto; }
.pricing-product-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 0.8rem; padding: 0.85rem 0; border-top: 1px solid #e6ebef; }
.pricing-product-row > label:first-child { display: grid; gap: 0.35rem; }
.pricing-product-row input[type="number"] { width: 100%; padding: 0.65rem; border: 1px solid #cbd5df; border-radius: 0.4rem; }
.monetization-table { min-width: 64rem; }
.payment-status { display: inline-block; padding: 0.25rem 0.55rem; border-radius: 999px; background: #e8edf2; font-size: 0.8rem; font-weight: 800; }
.payment-status.paid { background: #d7f4e2; color: #126536; }
.payment-status.pending { background: #fff0c9; color: #7b5600; }
.payment-status.failed,
.payment-status.expired { background: #ffe0e0; color: #9a252b; }

@media (max-width: 720px) {
    .purchase-actions,
    .admin-monetization-section > header,
    .pricing-admin-card > header { align-items: stretch; flex-direction: column; }
    .subject-visibility-row { align-items: stretch; flex-direction: column; }
    .subject-visibility-row .table-action { width: 100%; }
    .purchase-actions > *,
    .test-access-panel > .primary-action,
    .dcb-entry > button { width: 100%; }
    .pricing-product-row { grid-template-columns: 1fr; }
    .admin-section-toolbar .filter-input { width: 100%; max-width: none; }
    .monetization-table { min-width: 0; }
}

.status-page .request-id {
    margin-top: 1rem;
    overflow-wrap: anywhere;
    font-size: 0.85rem;
}

.ai-workspace-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .45rem;
    padding: .35rem;
    border-radius: 14px;
    background: #edf2fa;
}
.ai-workspace-tabs button {
    border: 0;
    border-radius: 10px;
    padding: .75rem 1rem;
    color: #4e6077;
    background: transparent;
    font-weight: 700;
    cursor: pointer;
}
.ai-workspace-tabs button.active {
    color: #1748b3;
    background: #fff;
    box-shadow: 0 3px 12px rgba(20, 43, 74, .1);
}
.ai-text-workspace,
.ai-canvas-workspace { display: none; }
.ai-text-workspace.active,
.ai-canvas-workspace.active { display: grid; gap: .65rem; }
.math-symbol-toolbar,
.answer-canvas-toolbar { display: flex; flex-wrap: wrap; gap: .4rem; }
.math-symbol-toolbar button,
.answer-canvas-toolbar button {
    min-width: 2.6rem;
    border: 1px solid #cbd7e9;
    border-radius: 9px;
    padding: .5rem .7rem;
    color: #27405f;
    background: #fff;
    font-weight: 700;
    cursor: pointer;
}
.answer-canvas-toolbar button.active { color: #fff; border-color: #4373ec; background: #4373ec; }
.answer-canvas-toolbar button.danger { margin-left: auto; color: #b52c2c; }
.answer-canvas {
    display: block;
    width: 100%;
    min-height: 280px;
    border: 2px solid #cbd7e9;
    border-radius: 14px;
    background-color: #fff;
    background-image: linear-gradient(#edf1f7 1px, transparent 1px), linear-gradient(90deg, #edf1f7 1px, transparent 1px);
    background-size: 24px 24px;
    box-shadow: inset 0 1px 4px rgba(20, 43, 74, .06);
    cursor: url("cursors/answer-pen.svg") 4 28, crosshair;
    touch-action: none;
}
.answer-canvas[data-tool="eraser"] {
    cursor: url("cursors/answer-eraser.svg") 16 16, crosshair;
}
.answer-canvas[data-tool="line"],
.answer-canvas[data-tool="arrow"] {
    cursor: crosshair;
}
.ink-recognition-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}
.ink-recognition-row small { color: #657384; }
.ink-recognition-notice {
    margin: 0;
    padding: .7rem .85rem;
    border-radius: 10px;
    color: #155c36;
    background: #e7f7ee;
    font-weight: 700;
}
.ai-question-admin-notice {
    margin: 0;
    padding: .8rem 1rem;
    border-left: 4px solid #d68100;
    border-radius: 8px;
    color: #704900;
    background: #fff5dc;
    font-weight: 700;
}
.ai-submission-method {
    display: grid;
    gap: .85rem;
    padding: 1rem;
    border: 1px solid #d9e3f2;
    border-radius: 16px;
    background: #fff;
}
.ai-image-method {
    border-color: #7da2ff;
    background: linear-gradient(135deg, #fff, #f4f8ff);
    box-shadow: 0 7px 22px rgba(38, 84, 180, .09);
}
.ai-method-heading {
    display: flex;
    align-items: center;
    gap: .75rem;
}
.ai-method-heading > div {
    display: grid;
    gap: .15rem;
}
.ai-method-heading strong {
    color: #173b82;
    font-size: 1.08rem;
}
.ai-method-heading small { color: #657384; }
.ai-method-number {
    display: grid;
    flex: 0 0 2rem;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    color: #fff;
    background: #4373ec;
    font-weight: 800;
    place-items: center;
}
.ai-direct-image-options {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(240px, .75fr);
    gap: .75rem;
}
.mobile-answer-transfer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid #bad0ff;
    border-radius: 16px;
    background: linear-gradient(135deg, #eef4ff, #f8fbff);
}
.mobile-answer-transfer > div:first-child { display: grid; gap: .2rem; }
.mobile-capture-session {
    display: grid;
    grid-template-columns: 150px minmax(180px, 1fr);
    align-items: center;
    gap: 1rem;
    width: 100%;
}
.mobile-capture-session img {
    width: 150px;
    height: 150px;
    border: 8px solid #fff;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(20, 43, 74, .14);
}
.mobile-capture-session > div { display: grid; gap: .4rem; }
.mobile-capture-session a,
.link-button { width: fit-content; color: #1e56c9; font-weight: 700; }
.link-button { border: 0; padding: 0; background: transparent; cursor: pointer; text-decoration: underline; }
.ai-alternative-upload {
    padding: .75rem 1rem;
    border: 1px solid #dce4ef;
    border-radius: 12px;
    background: #fafbfd;
}
.ai-alternative-upload summary { color: #56677c; font-weight: 700; cursor: pointer; }
.ai-alternative-upload[open] summary { margin-bottom: .75rem; }
.ai-image-status { color: #176739; font-weight: 700; }
.mobile-capture-page {
    min-height: calc(100vh - 90px);
    display: grid;
    place-items: center;
    padding: 1.25rem;
}
.mobile-capture-card {
    width: min(100%, 620px);
    display: grid;
    gap: 1rem;
    padding: clamp(1.25rem, 5vw, 2.5rem);
    border-radius: 24px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 18px 55px rgba(20, 43, 74, .15);
}
.mobile-capture-card h1 { margin: 0; color: #142b4a; font-size: clamp(2rem, 8vw, 3.5rem); }
.mobile-capture-question {
    padding: 1rem;
    border-left: 4px solid #4373ec;
    border-radius: 8px;
    background: #f4f7fc;
    font-size: 1.05rem;
}
.mobile-capture-progress { display: flex; align-items: baseline; gap: .6rem; }
.mobile-capture-progress strong { color: #1e56c9; font-size: 1.8rem; }
.mobile-camera-button {
    display: grid;
    min-height: 64px;
    place-items: center;
    border-radius: 999px;
    color: #fff;
    background: #4373ec;
    box-shadow: 0 8px 22px rgba(67, 115, 236, .3);
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
}
.mobile-camera-button.disabled { opacity: .65; cursor: wait; }
.mobile-camera-button input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.mobile-capture-help { margin: 0; color: #66768a; text-align: center; }

@media (max-width: 720px) {
    .ai-direct-image-options { grid-template-columns: 1fr; }
    .mobile-answer-transfer { align-items: stretch; flex-direction: column; }
    .mobile-capture-session { grid-template-columns: 1fr; justify-items: center; text-align: center; }
    .mobile-capture-session > div { justify-items: center; }
    .answer-canvas-toolbar button.danger { margin-left: 0; }
    .ink-recognition-row { align-items: stretch; flex-direction: column; }
    .ink-recognition-row .table-action { width: 100%; }
}
