.portal-site .workspace:has(#desk:not([hidden])) {
    width: min(calc(100% - 56px), 1580px);
    padding-block: 24px 52px;
}
.desk-banner {
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(340px,auto);
    align-items: center;
    gap: 22px;
    border: 1px solid #d9e4f2;
    border-radius: 15px;
    background: linear-gradient(112deg, #fff 35%, #eaf2ff);
    color: var(--navy);
    padding: clamp(16px, 2.4vw, 29px);
    margin-bottom: 17px;
}
.desk-heading { min-width: 0; overflow-wrap: anywhere; }
.desk-heading #welcome {
    margin: 0;
    line-height: 1.15;
    letter-spacing: -.045em;
    font-size: clamp(1.35rem, 2.7vw, 2.4rem);
}
.desk-heading #school { color: var(--muted); margin: 8px 0 0; font-size: .86rem; }
.desk-account {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 22px;
    margin: 0;
}
.desk-account dt { font-size: .75rem; color: var(--muted); }
.desk-account dd { margin: 4px 0 0; font-size: .87rem; font-weight: 700; overflow-wrap: anywhere; }
.desk-toolbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 15px;
    min-height: 62px;
    margin-bottom: 20px;
    padding: 8px 13px;
    background: #fff;
    color: var(--navy);
    border: 1px solid #dbe5f2;
    border-radius: 12px;
    box-shadow: 0 5px 16px #16345e0c;
}
#menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: none;
    min-height: 42px;
    padding: 0 13px;
    border-radius: 8px;
    background: #eaf2ff;
    color: #174992;
}
#menu-toggle:hover { background: #dceafe; }
.menu-bars {
    width: 17px;
    height: 13px;
    border-block: 2px solid currentColor;
    position: relative;
}
.menu-bars::after {
    content: "";
    position: absolute;
    inset: 50% 0 auto;
    height: 2px;
    transform: translateY(-50%);
    background: currentColor;
}
#current-module { min-width: 0; font-size: .9rem; font-weight: 700; overflow-wrap: anywhere; }
.desk-layout {
    display: grid;
    grid-template-columns: clamp(218px, 17vw, 255px) minmax(0,1fr);
    align-items: start;
    gap: clamp(21px, 2.5vw, 36px);
}
.desk-layout:has(.desk-menu[hidden]) { grid-template-columns: minmax(0,1fr); }
#desk #content {
    border: 1px solid var(--rule);
    background: white;
    border-radius: 16px;
    min-width: 0;
    scroll-margin-top: 78px;
    container-type: inline-size;
    box-shadow: 0 8px 22px #16345e08;
}
.desk-menu {
    min-width: 0;
    padding: 14px 12px;
    border-radius: 14px;
    background: linear-gradient(165deg, #0e2242, #16386b);
    color: #f5f8ff;
    box-shadow: 0 8px 22px #122f5824;
    position: sticky;
    top: 78px;
    max-height: calc(100dvh - 94px);
    overflow: auto;
    scrollbar-color: #7594c2 #16345e;
}
.desk-menu summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    list-style: none;
}
.desk-menu summary::-webkit-details-marker { display: none; }
.desk-menu summary::after {
    content: "";
    flex: 0 0 7px;
    height: 7px;
    border: solid #bfd3f0;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-inline-end: 3px;
}
.desk-menu-branch[open] > summary::after { transform: rotate(225deg); }
.desk-menu #modules-title {
    margin: 0 8px 9px;
    padding: 5px 2px 13px;
    border-bottom: 1px solid #ffffff24;
    color: #fff;
    font-size: .94rem;
    letter-spacing: 0;
}
#desk #tabs {
    display: grid;
    gap: 18px;
    margin: 0;
    padding: 10px 2px 4px;
    border: 0;
}
.desk-menu-group { display: grid; gap: 6px; }
.desk-menu-group h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 8px 1px;
    color: #c0d5f2;
    font-size: .7rem;
    font-weight: 750;
    letter-spacing: .07em;
    text-transform: uppercase;
}
.desk-menu-group h3::after { content: ""; flex: 1; height: 1px; background: #ffffff26; }
#desk .desk-menu-link, .desk-menu-branch > summary {
    min-height: 44px;
    width: 100%;
    background: transparent;
    color: #edf5ff;
    font-size: .92rem;
    font-weight: 650;
    text-align: left;
    line-height: 1.35;
    padding: 10px 11px;
    border-radius: 8px;
}
.desk-menu:focus-within, .desk-menu-link:focus-visible, .desk-menu summary:focus-visible { scroll-margin-block: 8px; }
.desk-menu-link:focus-visible, .desk-menu summary:focus-visible, #cbt-service a:focus-visible {
    outline: 2px solid #a9dcff;
    outline-offset: -2px;
}
#desk .desk-menu-link:hover, .desk-menu summary:hover, .desk-menu-branch:has([aria-current="page"]) > summary {
    background: #ffffff16;
}
#desk .desk-menu-link[aria-current="page"] {
    color: #fff;
    background: linear-gradient(105deg, #1c55bf, #236ac7);
    box-shadow: inset 3px 0 #a4d6ff;
}
.desk-submenu {
    display: grid;
    gap: 5px;
    margin: 7px 0 3px 12px;
    padding: 0 0 0 10px;
    border-inline-start: 1px solid #ffffff38;
}
#desk .desk-submenu .desk-menu-link { font-size: .85rem; }
#cbt-service { border-top: 1px solid #ffffff38; margin-top: 14px; padding: 14px 8px 4px; font-size: .84rem; }
#cbt-service h2 { font-size: .85rem; letter-spacing: 0; margin: 0; }
#cbt-service a { display: block; margin: 9px 0 0; overflow-wrap: anywhere; }
.desk-service-link {
    border-radius: 8px;
    border: 1px solid #ffffff4f;
    background: #ffffff15;
    color: white;
    text-align: center;
    text-decoration: none;
    font-weight: 720;
    padding: 11px 10px;
}
.desk-service-link:hover { background: #ffffff28; }
#desk #content { padding: clamp(17px, 2.7vw, 36px); min-height: 330px; }
.module-heading { border-bottom: 1px solid var(--rule); padding-bottom: 21px; margin-bottom: 24px; }
.module-heading h2 { font-size: clamp(1.45rem, 2.9vw, 2.35rem); margin: 0 0 7px; }
.module-heading p { color: var(--muted); margin: 0; line-height: 1.55; }
.desk-state { padding: 15px; background: #f0f5ff; border-radius: 8px; }
.desk-state p { margin-top: 0; }
#desk .forms { grid-template-columns: repeat(auto-fit,minmax(min(100%,340px),1fr)); gap: 20px; }
#desk .forms:empty { display: none; }
#desk .panel { background: #f8faff; border-color: #d7e3f3; padding: clamp(14px,2vw,20px); }
#desk .panel h3 { margin: 0 0 3px; font-size: 1.08rem; }
#desk .panel :is(input,select,textarea), #desk .tools input { min-height: 42px; border-color: #aebed1; border-radius: 7px; }
#desk .panel button[type="submit"] { justify-self: start; }
#desk .scroll { border: 1px solid var(--rule); border-radius: 12px; }
#desk .scroll:focus-visible, #menu-toggle:focus-visible { outline: 2px solid #2662be; outline-offset: 2px; }
#desk :is(td,th) { border: 0; border-bottom: 1px solid var(--rule); padding: 13px 14px; overflow-wrap: anywhere; }
#desk th { color: #254669; background: #edf3fb; letter-spacing: .012em; }
#desk tbody tr:nth-child(even) { background: #f8fafc; }
#desk tbody tr:last-child td { border-bottom: 0; }
#desk .row-number { width: 1%; text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
#desk .table-empty { padding: 22px; color: var(--muted); background: #f8faff; border: 1px dashed #cad9eb; border-radius: 10px; }
#desk .summary { border: 1px solid #d1e2f5; border-radius: 8px; padding: 14px; line-height: 1.55; }
#desk .card { border-radius: 8px; }
#desk .panel { grid-template-columns: repeat(auto-fit,minmax(min(100%,155px),1fr)); align-items: start; }
#desk .panel > :is(h3,button), #desk .panel > label:has(textarea) { grid-column: 1/-1; }
#desk .panel > label, #desk .panel > label > :is(input,select,textarea) { min-width: 0; }
@media (max-width: 960px) {
    .portal-site .workspace:has(#desk:not([hidden])) { width: calc(100% - 32px); }
    .desk-layout { grid-template-columns: minmax(0,1fr); gap: 16px; }
    .desk-menu { position: static; max-height: none; }
    .desk-banner { grid-template-columns: minmax(0,1fr); gap: 15px; }
}
@media (max-width: 560px) {
    .desk-account { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
    #current-module { font-size: .82rem; }
}
@media print {
    .portal-site .workspace:has(#desk:not([hidden])) { width: 100%; padding: 0; }
    .desk-menu, .desk-toolbar, .desk-banner, .module-heading { display: none !important; }
    .desk-layout { display: block; }
    #desk #content { border: 0; padding: 0; }
    #desk .scroll { border: 0; }
}

.module-transfer {
    border: 1px solid #d9e5f5;
    background: #f7faff;
    border-radius: 9px;
    padding: 11px 16px;
    margin-bottom: 20px;
}
.module-transfer summary { cursor: pointer; font-weight: 700; }
.transfer-row { padding-block: 14px; border-top: 1px solid var(--rule); margin-top: 10px; }
.transfer-row h3 { font-size: 1rem; }
.transfer-row p { color: var(--muted); margin-block: 6px 12px; font-size: .9rem; }
.transfer-row > a { display: inline-block; margin: 0 16px 8px 0; }
.transfer-row form { grid-template-columns: minmax(0,1fr) auto; align-items: end; margin-top: 10px; }
.transfer-row input { min-width: 0; }
.export-class, .table-filter { max-width: 250px; margin-block: 10px; }
.searchable-choice { position: relative; display: grid; align-content: start; gap: 5px; min-width: 0; }
.searchable-choice:focus-within { z-index: 12; }
.searchable-choice::after {
    content: "";
    position: absolute;
    right: 13px;
    bottom: 17px;
    width: 6px;
    height: 6px;
    border: solid #49647e;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    pointer-events: none;
}
.searchable-choice input { min-width: 0; padding-right: 32px; }
.choice-results {
    position: absolute;
    inset: calc(100% + 4px) 0 auto;
    max-height: 225px;
    overflow: auto;
    overscroll-behavior: contain;
    border: 1px solid #afc4df;
    border-radius: 8px;
    background: #fff;
    color: #173651;
    box-shadow: 0 8px 24px #16355226;
}
.choice-option, .choice-empty { padding: 9px 10px; overflow-wrap: anywhere; font-size: .87rem; }
.choice-option { cursor: pointer; }
.choice-option:hover, .choice-current { background: #e9f2ff; }
.choice-option[aria-selected="true"] { color: #164b92; font-weight: 700; }
.choice-empty { color: #52677f; }
.date-weekday { color: #52677f; font-size: .78rem; font-weight: 500; }
.date-weekday:empty { display: none; }
.table-search { display: block; max-width: 330px; margin: 8px 0; }
.receipt-link {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 6px 11px;
    border-radius: 7px;
    background: #e9f1ff;
    color: #174899;
    font-size: .82rem;
    font-weight: 680;
}
@media print { .table-search, .table-filter { display: none !important; } }
.finance-filters { margin: 0; }
.finance-filters label { flex: 1 1 135px; }
.loan-reminders { border: 1px solid #e8c777; background: #fff9e9; padding: 13px 18px; margin-bottom: 15px; border-radius: 9px; }
.loan-reminders h2 { font-size: 1rem; letter-spacing: 0; margin: 0; }
.loan-reminders ul { margin: 7px 0 0; padding-left: 22px; }
.student-card-profile { border: 1px solid #bfd0e6; border-top: 7px solid #1b4fa7; border-radius: 8px; padding: 12px 18px; width: min(100%,360px); }
.student-card-profile .student-name { font-size: 1.14rem; font-weight: 750; }
.student-card-profile p { margin: 8px 0; }
.student-card-profile svg, .student-card-profile img { margin-inline: auto; }
.student-card button { margin: 8px 4px 0; }
@media (max-width: 540px) {
    .transfer-row form { grid-template-columns: 1fr; }
    .transfer-row form button { justify-self: start; }
}
@media print {
    .module-transfer, .loan-reminders { display: none !important; }
    #desk .student-card { border: 0; padding: 0; width: 85.6mm; max-width: 100%; }
}
.password-field {
    display: grid;
    gap: 5px;
    min-width: 0;
}
.password-input { position: relative; }
.password-input > input {
    display: block;
    min-width: 0;
    min-height: 44px;
    padding-inline-end: 3.2rem;
}
.password-input > input::-ms-reveal { display: none; }
.password-input > .password-toggle {
    position: absolute;
    inset-block: 2px;
    inset-inline-end: 2px;
    display: grid;
    place-items: center;
    width: 42px;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #315a92;
}
.password-input > .password-toggle:hover { background: #edf4ff; }
.password-input > .password-toggle:focus-visible { outline: 2px solid #2662be; outline-offset: -3px; }
.password-toggle::before {
    content: "";
    width: 14px;
    height: 14px;
    border-radius: 75% 0 75% 0;
    border: 1.6px solid currentColor;
    transform: rotate(45deg);
    background: radial-gradient(circle,currentColor 0 2px,transparent 2.3px);
}
.password-input > input[type="text"] + .password-toggle::after {
    content: "";
    position: absolute;
    width: 22px;
    height: 1.5px;
    background: currentColor;
    box-shadow: 0 1px 0 #fff;
    transform: rotate(-45deg);
}

.account-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.account-actions button { font-size: .82rem; min-height: 36px; padding: 6px 11px; background: #e9f1ff; color: #174899; }
.account-actions .account-delete { background: #fff0f0; color: #9b2634; }
.account-actions span { color: var(--muted); font-size: .82rem; }
.account-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 14px;
    padding: 16px;
    background: #f5f8fd;
    border: 1px solid #dde7f4;
    border-radius: 12px;
    margin-bottom: 26px;
}
.account-filters {
    flex: 1 1 560px;
    display: grid;
    grid-template-columns: minmax(165px,1.35fr) repeat(3,minmax(120px,1fr));
    gap: 12px;
    min-width: 0;
}
.account-filters label, .account-filters :is(input,select) { min-width: 0; }
.account-filters :is(input,select) { min-height: 42px; }
.account-add {
    flex: none;
    min-height: 42px;
    white-space: nowrap;
}
.account-results-heading {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
    scroll-margin-top: 80px;
}
.account-results-heading h3 { margin: 0; font-size: 1.12rem; }
.account-count, .account-role {
    display: inline-block;
    max-width: 100%;
    border-radius: 7px;
    background: #edf3ff;
    color: #214d8e;
    font-size: .78rem;
    font-weight: 680;
    padding: 5px 9px;
    overflow-wrap: anywhere;
}
#desk .account-table { margin: 13px 0 16px; }
.account-table td.cell-name { font-weight: 730; }
.account-table :is(.cell-login,.cell-assignment) { color: #49617a; }
.account-role { margin: 2px 5px 2px 0; }
.account-assignment { display: block; }
.account-assignment + .account-assignment { margin-top: 4px; }
.account-assignment-fields {
    grid-column: 1 / -1;
    min-width: 0;
    margin: 0;
    padding: 12px 14px 15px;
    border: 1px solid #dbe5f1;
    border-radius: 10px;
    background: white;
}
.account-assignment-fields legend { padding: 0 6px; color: #183960; font-weight: 700; }
.account-role-choices, .teaching-rows { display: grid; gap: 9px; }
.account-role-choices { grid-template-columns: repeat(auto-fit,minmax(min(100%,150px),1fr)); }
.account-role-choices label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 6px 9px;
    background: #f3f7fd;
    border-radius: 7px;
}
.account-role-choices label:has(input:disabled) { color: #52647b; }
.account-role-choices input[type="checkbox"], #desk .panel .account-role-choices input[type="checkbox"] {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    min-height: 0;
    margin: 0;
    accent-color: #174992;
}
.teaching-row {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr)) auto;
    align-items: end;
    gap: 10px;
}
.teaching-row button { min-height: 42px; }
.account-assignment-fields .account-add-assignment { margin-top: 10px; background: #edf3fb; color: #174992; }
@media (max-width: 540px) {
    .teaching-row { grid-template-columns: minmax(0,1fr); padding-bottom: 10px; border-bottom: 1px solid #dbe5f1; }
    .teaching-row button { justify-self: start; }
}
.account-pagination { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.account-pagination button { min-height: 42px; padding: 8px 12px; background: #edf3fb; color: #174992; }
.account-pagination button:disabled { cursor: default; }
.account-pagination span { color: var(--muted); font-size: .86rem; }
@container (max-width: 660px) {
    .account-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }

}
@media print { .account-actions, .account-toolbar, .account-pagination { display: none !important; } }

.attendance-schedule {
    display: grid;
    gap: 13px;
    padding: 16px;
    border: 1px solid #dce6f3;
    border-radius: 12px;
    background: #f6f9fe;
    margin-bottom: 22px;
}
.schedule-heading {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 13px;
}
.schedule-heading h3 { margin: 0; font-size: 1rem; }
.schedule-heading span { border-radius: 7px; padding: 5px 8px; font-size: .78rem; font-weight: 700; }
.schedule-open { background: #e3f5ec; color: #1a5945; }
.schedule-closed { background: #fff0d9; color: #74460a; }
.schedule-details { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,115px),1fr)); gap: 8px; margin: 0; }
.schedule-details > div { padding: 9px 10px; background: #fff; border: 1px solid #dfe8f4; border-radius: 8px; }
.schedule-details dt { color: #52677f; font-size: .75rem; }
.schedule-details dd { margin: 4px 0 0; font-weight: 720; font-size: .89rem; }
.attendance-schedule p { margin: 0; font-size: .83rem; color: #52677f; }
.weekly-attendance {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(min(100%,220px),1fr));
    gap: 12px;
}
.weekly-attendance fieldset {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 9px;
    min-width: 0;
    margin: 0;
    padding: 9px 12px 12px;
    border: 1px solid #d9e5f4;
    border-radius: 9px;
    background: #fff;
}
.weekly-attendance legend { padding-inline: 5px; font-weight: 720; }
.weekly-attendance input { min-width: 0; padding-inline: 6px; }
.weekly-attendance p { grid-column: 1 / -1; margin: 2px 0 0; color: var(--muted); font-size: .85rem; }
@container (max-width: 400px) {
    .account-filters > label:nth-child(-n+2) { grid-column: 1/-1; }
    .schedule-details { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .schedule-details > div:first-child { grid-column: 1/-1; }
}

.edit-record {
    width: min(92vw, 640px);
    max-height: 86vh;
    background: white;
    color: var(--navy);
    border: 1px solid var(--rule);
    border-radius: 14px;
    padding: clamp(16px, 3vw, 28px);
    box-shadow: 0 18px 48px #10294b44;
}
.edit-record::backdrop { background: #0c244a88; }
.edit-record h2 { font-size: 1.45rem; margin-top: 0; }
.edit-record form { gap: 11px; }
.edit-record form > button { justify-self: start; }
.edit-record form > button:last-child { background: #eaf1fc; color: #173b71; }
.edit-message { background: #fff0f1; color: #8a2130; padding: 10px 12px; border-radius: 7px; margin: 0; }
.school-profile { max-width: 750px; }
.school-profile > img { width: 72px; height: 72px; object-fit: contain; }
.school-profile .form-hint { align-self: center; margin: 0; color: var(--muted); font-size: .86rem; }
#desk .profile-reset { display: flex; align-items: center; gap: 7px; }
#desk .profile-reset input { width: auto; min-height: 0; }
.portal-site .site-header .brand img { height: 45px; object-fit: contain; }
.document-logo { max-width: 72px; max-height: 64px; object-fit: contain; }

.finance-toolbar { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 14px; margin: 16px 0; }
.finance-filters { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,145px),1fr)); gap: 9px; }
.finance-filters > label { min-width: 0; }
.finance-filters :is(input,select) { height: 42px; }
.finance-summary { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,157px),1fr)); gap: 10px; margin: 14px 0 22px; }
.finance-summary > div { min-width: 0; padding: 12px 14px; background: #f1f6ff; border: 1px solid #d8e5f7; border-radius: 9px; }
.finance-summary > div:last-child { color: #fff; background: var(--navy); border-color: var(--navy); }
.finance-summary dt { font-weight: 650; font-size: .84rem; }
.finance-summary dd { margin: 3px 0 0; font-weight: 790; font-size: clamp(.95rem,1.65vw,1.3rem); overflow-wrap: anywhere; }
.finance-period { color: var(--muted); margin: 4px 0; }
.finance-report .scroll table { min-width: 890px; }
.finance-report td:last-of-type { min-width: 75px; }
.finance-report td:nth-last-child(2) { white-space: nowrap; }
.academic-card { padding: 20px; background: #f3f7fe; border: 1px solid #dbe7f7; border-radius: 12px; margin-bottom: 26px; }
.academic-card h3 { margin: 0; font-size: 1.5rem; }
.academic-card p { margin: 4px 0 14px; color: var(--muted); }
.academic-filter { width: min(100%,220px); margin-block: 18px; }
.bill-filters { margin: 18px 0 25px; }
.bill-history { width: min(92vw, 790px); }
#desk table.has-actions td:last-child { min-width: 102px; }
@media (max-width: 720px) {
    .finance-toolbar { grid-template-columns: 1fr; }
    .finance-toolbar > button { justify-self: start; }
}
@media print {
    .finance-report .scroll table { min-width: 0; }
    .finance-report td:nth-last-child(2) { white-space: normal; }
    #desk table.has-actions :is(td,th):last-child { display: none; }
    .finance-summary { grid-template-columns: repeat(5,minmax(0,1fr)); }
    .finance-summary > div:last-child { color: var(--navy); background: #e5edf8; }
}

#notice.warning { background: #fff5d4; border-left-color: #b56700; color: #673500; }
.camera-dialog video { width: 100%; aspect-ratio: 16/10; object-fit: contain; background: #0a1a31; border-radius: 9px; }
.camera-dialog .form-hint { color: var(--muted); }
.teaching-program-section {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(min(100%,280px),1fr));
    gap: 12px;
    min-width: 0;
    margin: 4px 0;
    padding: 12px 14px 15px;
    border: 1px solid #dbe5f1;
    border-radius: 10px;
    background: white;
}
.teaching-program-section legend { padding: 0 6px; color: #183960; font-weight: 700; }
.teaching-program-section textarea { min-height: 84px; resize: vertical; }
.teaching-program-section label:has(textarea:is([name="activity"],[name="worksheet"],[name="rubric"],[name="assessment_items"])) {
    grid-column: 1 / -1;
}
.teaching-assist {
    grid-column: 1 / -1;
    display: grid;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 9px;
    border: 1px solid #dbe5f1;
    background: #f5f8fd;
}
.teaching-assist :is(select,button) { width: auto; max-width: 100%; justify-self: start; }
.teaching-assist p { margin: 0; }
.teaching-assist .inline-link { display: inline-block; margin: 2px 14px 2px 0; }
.teaching-document-dialog ul { list-style: none; padding: 0; }
.teaching-document-dialog li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px 15px;
    padding: 13px 0;
    border-top: 1px solid #dbe5f1;
}
.teaching-document-dialog li strong { flex: 1 0 165px; }



@media screen and (max-width: 760px) {
    .portal-site #desk #content { padding: clamp(12px, 3vw, 22px); }
    .portal-site .module-heading { padding-bottom: 16px; margin-bottom: 18px; }
    #desk :is(.forms, .panel, .finance-filters, .account-filters, .weekly-attendance, .teaching-program-section),
    .edit-record form { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    #desk :is(.panel, .tools, .finance-filters, .account-filters) label,
    .edit-record form label { min-width: 0; gap: 7px; }
    #desk .tools, #desk .account-toolbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
        gap: 12px;
    }
    #desk .account-add { justify-self: stretch; white-space: normal; }
    #desk .finance-toolbar > button { justify-self: stretch; }
    #desk :is(.panel, .tools, .finance-filters, .account-filters, .transfer-row) :is(input, select, textarea):not([type=checkbox], [type=radio]),
    #desk :is(.table-search, .table-filter),
    .edit-record :is(input, select, textarea):not([type=checkbox], [type=radio]),
    .auth-content :is(input, select, textarea):not([type=checkbox], [type=radio]) {
        min-width: 0;
        max-width: 100%;
        min-height: 44px;
        height: auto;
        font-size: 1rem;
    }
    #desk :is(.table-search, .table-filter) { max-width: none; }
    #desk :is(.panel, .tools, .transfer-row, .finance-toolbar, .account-toolbar) button:not(.password-toggle),
    .edit-record button { min-height: 44px; max-width: 100%; white-space: normal; }
    #desk .panel > button[type=submit], .edit-record form > button { justify-self: stretch; }
    #desk .weekly-attendance fieldset { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .edit-record {
        width: calc(100% - 24px);
        max-width: none;
        max-height: calc(100dvh - 24px);
        overscroll-behavior: contain;
    }
    .choice-option { min-height: 44px; padding: 11px; }

    #desk .record-list, .edit-record .record-list { border: 0; overflow: visible; }
    .record-list table, .record-list tbody { display: block; min-width: 0; background: transparent; }
    .finance-report .record-list table { min-width: 0; }
    .record-list thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
    .record-list tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
        gap: 6px 10px;
        padding: 13px;
        border: 1px solid var(--rule);
        border-radius: 12px;
        background: #fff;
    }
    .record-list tr + tr { margin-top: 12px; }
    #desk .record-list td,
    .edit-record .record-list td {
        display: block;
        grid-column: 1 / -1;
        min-width: 0;
        padding: 0;
        border: 0;
        white-space: normal;
        overflow-wrap: anywhere;
    }
    #desk .record-list .row-number, .edit-record .record-list .row-number {
        grid-area: 1 / 2;
        justify-self: end;
        width: auto;
        border-radius: 6px;
        padding: 2px 6px;
        color: #405978;
        background: #edf3fa;
        font-size: .78rem;
        font-weight: 700;
    }
    .record-list .row-number::before { content: '#'; }
    #desk .record-list .record-primary, .edit-record .record-list .record-primary {
        grid-area: 1 / 1;
        color: #142a49;
        font-weight: 750;
        font-size: 1rem;
        line-height: 1.4;
    }
    #desk .record-list td[data-label]:not(.record-primary),
    .edit-record .record-list td[data-label]:not(.record-primary) {
        display: grid;
        grid-template-columns: minmax(65px, 37%) minmax(0, 1fr);
        gap: 8px;
        border-top: 1px solid #e1e9f4;
        padding-top: 6px;
    }
    .record-list td[data-label]:not(.record-primary)::before {
        content: attr(data-label);
        color: #405978;
        font-weight: 650;
        font-size: .78rem;
    }
    .record-value { min-width: 0; }
    #desk .record-list .cell-actions, .edit-record .record-list .cell-actions {
        min-width: 0;
        margin-top: 3px;
        padding-top: 8px;
        border-top: 1px solid #e1e9f4;
    }
    .record-list .cell-actions :is(button, .receipt-link) { min-height: 44px; }
}
