/* Current manuscript theme: adapt the reading surface, never scale its text. */
html {scroll-padding-top:16px}
:where(input,textarea,select,button) {max-width:100%}
:where(.page-shell,.manuscript-page,.workspace-application-detail,.application-dossier,.panel) {min-width:0}
:where(.account-menu,.sheet-view-popover,.sheet-view-fields-popover) {max-width:calc(100vw - 24px)}
:where(.modal,.dialog,[role="dialog"]) {max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px)}
@media (max-width:1100px) {
 .form-card-footer,.form-card-actions,.heading-actions,.workspace-section-heading {flex-wrap:wrap}
 .workspace-student-heading {flex-wrap:wrap}
 .workspace-file-row {min-width:0}
 .workspace-file-row strong,.workspace-facts dd {overflow-wrap:anywhere}
}
@media (max-width:900px) {
 /* Keep the existing art behind the bounded study reading region. */
 html[data-luforms-theme=scholarly] body:has(.manuscript-page) .app-header .main-nav {flex-wrap:nowrap;overflow-x:auto;max-width:100%;gap:20px;white-space:nowrap;scrollbar-width:thin}
 html[data-luforms-theme=scholarly] body:has(.manuscript-page) .app-header .main-nav a {flex:none;min-height:42px;padding:8px 0}
 html[data-luforms-theme=scholarly] .student-workspace .tabs {display:flex;flex-wrap:nowrap;overflow-x:auto;max-width:100%;gap:20px;white-space:nowrap;scrollbar-width:thin}
 html[data-luforms-theme=scholarly] .student-workspace .tabs>button {flex:none;min-height:42px}
 html[data-luforms-theme=scholarly] .directory-toolbar {flex-wrap:wrap;gap:8px}
 html[data-luforms-theme=scholarly] .directory-search {min-width:0;max-width:100%}
 html[data-luforms-theme=scholarly] .workspace-application-layout {min-width:0;grid-template-columns:minmax(0,1fr)}
 html[data-luforms-theme=scholarly] .workspace-application-rail {min-width:0;max-width:100%;overflow-x:auto}
 html[data-luforms-theme=scholarly] .application-dossier {min-width:0;max-width:100%;overflow-wrap:anywhere}
 html[data-luforms-theme=scholarly] .workspace-profile-structured,
 html[data-luforms-theme=scholarly] .workspace-profile-columns,
 html[data-luforms-theme=scholarly] .workspace-account-grid {grid-template-columns:minmax(0,1fr)}
 html[data-luforms-theme=scholarly] .workspace-profile-columns>section+section {padding-left:0;border-left:0}
 .workspace-file-actions,.application-file-actions,.workflow-item-meta,.application-heading-actions {flex-wrap:wrap;max-width:100%}
 /* Directory cards retain the approved hierarchy on small screens. */
 body.collection-dashboard .topbar {left:7vw;right:7vw;top:24px;height:auto;min-height:0;padding:0}
 body.collection-dashboard .topbar-inner {width:100%;min-height:0;flex-wrap:wrap;gap:8px;padding:0}
 body.collection-dashboard .brand strong {font-size:27px}
 body.collection-dashboard .topnav {width:100%;max-width:100%;display:flex;gap:10px;flex-wrap:wrap;margin:0}
 body.collection-dashboard .topnav>a {padding:5px 0;min-height:40px}
 body.collection-dashboard .page-shell.dashboard-page {position:fixed;inset:148px 7vw 9dvh;width:auto;min-height:0;max-height:none;margin:0;padding:0;overflow:auto;border:0}
 body.collection-dashboard .dashboard-page>.page-heading {padding:0 0 14px;min-height:0;margin:0 0 14px;gap:8px;flex-wrap:wrap}
 body.collection-dashboard .page-heading h1 {font-size:28px}
 body.collection-dashboard .form-card-grid {display:grid;grid-template-columns:minmax(0,1fr);gap:16px}
 body.collection-dashboard .form-card {position:relative;display:flex;flex-direction:column;min-width:0;padding:20px;border:1px solid #cbb48b;border-radius:5px;background:#fcf7e9e8;box-shadow:none}
 body.collection-dashboard .form-card::before {display:none}
 body.collection-dashboard .form-card.is-disabled {background:#ded3bfe8}
 body.collection-dashboard .form-card h2 {font-size:24px;margin:0 0 5px;padding:0;overflow-wrap:anywhere}
 body.collection-dashboard .form-card .slug {font-size:13px;overflow-wrap:anywhere}
 body.collection-dashboard .form-card .metric-row {display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:24px 0;padding:0;border:0}
 body.collection-dashboard .metric-row>div {min-width:0;text-align:left;padding:0}
 body.collection-dashboard .metric-row>div:last-child {grid-column:1/-1;border-top:1px solid #d6c4a3;padding-top:10px}
 body.collection-dashboard .metric-row dt {font-size:24px;line-height:1.5;margin:0}
 body.collection-dashboard .metric-row dt.metric-time {font-size:14px}
 body.collection-dashboard .metric-row dd {font-size:13px;margin:2px 0 0}
 body.collection-dashboard .form-card-footer {gap:10px;align-items:center}
 body.collection-dashboard .form-card-actions {display:flex;gap:14px;flex-wrap:wrap;margin:0;align-items:center}
 body.collection-dashboard .form-card-actions form {margin:0}
 body.collection-dashboard .form-card-actions :is(a,button) {font-size:14px;padding:8px 0;min-height:40px;color:#435a40;background:transparent;border:0;box-shadow:none;text-decoration:none}
 body.collection-dashboard .form-card .status-text {font-size:14px;background:none;padding:0}
 /* Workspaces are document tools: chrome wraps, only tables scroll sideways. */
 body.collection-workspace {display:flex;flex-direction:column;height:100dvh;min-height:0;overflow:hidden;background:#f7f3e8}
 body.collection-workspace::before,body.collection-workspace>.manuscript-art {display:none}
 body.collection-workspace .topbar {position:relative;inset:auto;flex:none;height:auto;min-height:0;margin:0;padding:8px 12px;background:#f8f3e6;border:0;border-top:2px solid #8f382d;border-bottom:1px solid #bea775}
 body.collection-workspace .topbar-inner {width:100%;min-height:0;flex-wrap:wrap;gap:6px 16px;padding:0}
 body.collection-workspace .brand strong {font-size:24px}
 body.collection-workspace .topnav {gap:8px;flex-wrap:wrap;margin:0;max-width:100%}
 body.collection-workspace .topnav>a {min-height:40px;padding:6px}
 body.collection-workspace .page-shell.page-shell {position:relative;inset:auto;flex:1 1 auto;width:auto;min-height:0;max-height:none;margin:10px 10px 8px;padding:0;overflow:auto;border:0;background:none}
 body.collection-workspace .page-shell>.page-heading {min-height:0;padding:0 0 12px;margin:0 0 8px;gap:10px;flex-wrap:wrap}
 body.collection-workspace .page-heading h1 {font-size:26px;line-height:1.4;overflow-wrap:anywhere}
 body.collection-workspace .heading-actions {gap:8px;max-width:100%;justify-content:flex-start}
 body.collection-workspace .button {min-height:40px;padding:8px 10px;font-size:14px;white-space:normal}
 body.collection-workspace .page-shell.admin-master-page {display:flex;flex-direction:column;overflow:hidden}
 body.collection-workspace .admin-master-page>.page-heading,
 body.collection-workspace .admin-master-page>.sheet-filter-host {flex:none}
 body.collection-workspace .sheet-view-strip {min-width:0;max-width:100%;overflow-x:auto}
 body.collection-workspace .sheet-filter-toolbar {flex-wrap:wrap;gap:4px;padding:4px}
 body.collection-workspace .sheet-filter-toolbar button {min-height:36px}
 body.collection-workspace .admin-master-sheet,
 body.collection-workspace .master-table-fragment {display:flex;flex-direction:column;flex:1 1 0;min-height:0;min-width:0;margin:0}
 body.collection-workspace .master-table-fragment>.table-wrap {flex:1 1 0;min-height:0;max-height:none;overflow:auto;overscroll-behavior:contain;touch-action:pan-x pan-y}
 body.collection-workspace .sheet-panel .spreadsheet-table {min-width:100%;width:max-content;font-size:14px}
 body.collection-workspace .panel {padding:14px;max-width:100%;min-width:0}
 body.collection-workspace .table-wrap {max-width:100%;overflow:auto}
 body.collection-workspace .detail-main,.account-admin-layout {grid-template-columns:minmax(0,1fr)}
 body.collection-workspace :is(input,select,textarea) {font-size:16px}
 .channel-auth-shell {width:calc(100% - 24px);min-width:0;margin-inline:auto}
 .channel-login-card,.channel-brand-panel {min-width:0;max-width:100%}
 .channel-topbar {flex-wrap:wrap;gap:8px}
 .channel-topbar .brand {min-width:0;max-width:100%}
 .channel-topbar .brand strong {overflow-wrap:anywhere}
}
@media (max-width:600px) {
 html[data-luforms-theme=scholarly] .workspace-student-heading h1 {font-size:28px}
 html[data-luforms-theme=scholarly] .workspace-student-meta {font-size:14px;line-height:1.6}
 html[data-luforms-theme=scholarly] .workspace-file-row {flex-wrap:wrap;gap:8px}
 html[data-luforms-theme=scholarly] .workspace-file-row>span:first-of-type {flex:1 1 70%}
 html[data-luforms-theme=scholarly] .workspace-file-status {font-size:13px}
 html[data-luforms-theme=scholarly] .workspace-login .workspace-login-form input {font-size:16px}
 body.collection-workspace .sheet-heading>div {width:100%}
 body.collection-workspace .heading-actions .sheet-transfer-controls {display:flex;flex-wrap:wrap;gap:8px}
}
@media (max-height:600px) and (min-width:901px) {
 html[data-luforms-theme=scholarly] .workspace-login .workspace-signin {top:24px;bottom:24px;transform:none;overflow:auto}
 html[data-luforms-theme=scholarly] .workspace-login .workspace-signin h1 {margin-bottom:14px}
 html[data-luforms-theme=scholarly] .workspace-login .workspace-login-brand span {font-size:32px}
 html[data-luforms-theme=scholarly] body:has(.manuscript-page) .app-header {top:20px;height:48px;min-height:0}
 html[data-luforms-theme=scholarly] body:has(.manuscript-page) .manuscript-page {top:84px;bottom:36px}
}
@media (pointer:coarse) {
 :where(.workspace-login-form,.channel-login-form) input {font-size:16px}
 :where(.account-button,.icon-button,.sheet-filter-trigger) {min-height:40px;min-width:40px}
}

/* Channel entry is a working form: retain the paper palette without a large
   decorative frame consuming the phone's input and keyboard space. */
@media (max-width:900px) {
 body.sheet-body {height:100dvh;min-height:0;display:flex;flex-direction:column;overflow:hidden;background:#f7f3e8}
 body.sheet-body::before,body.sheet-body>.manuscript-art,body.sheet-body .manuscript-ornaments {display:none}
 body.sheet-body .channel-topbar {position:relative;inset:auto;flex:none;min-height:56px;height:auto;width:100%;margin:0;padding:8px 12px;border:0;border-top:2px solid #8f382d;border-bottom:1px solid #bea775;background:#f8f3e6}
 body.sheet-body .channel-topbar .brand {flex:1;min-width:0}
 body.sheet-body .channel-topbar .brand strong {font-size:20px;line-height:1.4}
 body.sheet-body .page-shell.channel-sheet-page {position:relative;inset:auto;flex:1;min-height:0;max-height:none;width:auto;margin:0;padding:14px 12px calc(80px + env(safe-area-inset-bottom,0px));overflow:auto;background:none;border:0}
 body.sheet-body .channel-sheet-page .sheet-heading {margin:0 0 12px;padding:0;gap:10px}
 body.sheet-body .channel-sheet-page .sheet-heading h1 {font-size:24px;line-height:1.4;overflow-wrap:anywhere;margin:0}
 body.sheet-body .channel-sheet-page .sheet-heading button {min-height:40px}
 body.sheet-body .channel-sheet-page .sheet-panel {padding:0;border:1px solid #d4c8af;border-radius:3px;background:#fcfaf5}
 body.sheet-body .channel-sheet-page .table-summary {padding:8px;gap:8px;background:#f0ebdf;flex-wrap:wrap}
 body.sheet-body .channel-sheet-page .spreadsheet-viewport {border:0;border-radius:0;background:#fcfaf5}
 body.sheet-body:not(.personal-entry-sheet) .channel-sheet-page .editable-spreadsheet tr[data-spreadsheet-row] {border-color:#d4c8af;box-shadow:none}
 body.sheet-body:not(.personal-entry-sheet) .channel-sheet-page .editable-spreadsheet tr>td.row-no {background:#eee7d6;color:#5c513e;border-color:#d4c8af}
 body.sheet-body:not(.personal-entry-sheet) .channel-sheet-page .editable-spreadsheet tr>td.sheet-edit-cell {background:#fcfaf5;border-color:#e4dcc9}
 body.sheet-body .mobile-add-student {right:12px;bottom:calc(12px + env(safe-area-inset-bottom,0px));min-height:44px;box-shadow:0 2px 8px #46372224}
 body.sheet-body .sheet-description-dialog {width:calc(100% - 24px);max-width:600px;max-height:calc(100dvh - 32px);overflow:auto}
 body.sheet-body :is(input,select,textarea) {font-size:16px}
}

@media (max-width:900px) {
 html[data-luforms-theme=scholarly] .directory .directory-toolbar .directory-search-actions {display:flex;flex:1 1 100%;min-width:0;max-width:100%;flex-wrap:wrap}
 html[data-luforms-theme=scholarly] .directory .directory-toolbar .directory-search-actions .search-field {box-sizing:border-box;flex:1 1 180px;min-width:0;width:auto;max-width:100%;margin-left:0}
 html[data-luforms-theme=scholarly] body:has(.manuscript-page) .app-header .main-nav,
 html[data-luforms-theme=scholarly] .student-workspace .tabs {overflow-y:hidden}
}

@media (max-width:900px) {
 body.collection-workspace .page-heading.sheet-heading {display:block}
 body.collection-workspace .sheet-heading .heading-actions {display:flex;flex-wrap:wrap;gap:8px;margin-top:10px;width:100%;align-items:center}
 body.collection-workspace .sheet-heading .heading-actions>* {flex:0 0 auto;max-width:100%}
 body.collection-workspace .sheet-heading .heading-actions :is(a,button) {white-space:nowrap;min-height:36px;font-size:13px;padding:7px 9px}
 body.collection-workspace .sheet-heading .back-link {padding:0;border:0;background:none;font-size:12px;min-height:24px}
 body.collection-workspace .sheet-heading h1 {font-size:24px;margin:8px 0}
 body.collection-workspace .sheet-view-strip {overflow-y:hidden}
 body.collection-workspace .admin-master-sheet {padding:0;border:1px solid #d4c8af;border-radius:0;background:#fcfaf5}
 body.collection-workspace .admin-master-sheet .table-wrap {border:0;border-radius:0}
 body.collection-workspace .spreadsheet-table :is(th,td) {height:36px;padding:3px 8px;background:#fcfaf5;vertical-align:middle}
 body.collection-workspace .spreadsheet-table th {background:#f0ebdf;font-size:13px}
 body.collection-workspace .spreadsheet-table :is(input:not([type=checkbox]),select) {font-size:16px;height:28px;min-height:0;padding-block:2px;background:transparent}
 body.collection-workspace .sheet-filter-host {border-radius:0}
}

/* Browser zoom can produce a short, narrow CSS viewport on a desktop screen. */
@media (max-width:900px) and (max-height:600px) {
 html[data-luforms-theme=scholarly] body:has(.manuscript-page) .app-header {top:18px;height:80px;left:4vw;right:4vw;gap:4px;align-content:flex-start}
 html[data-luforms-theme=scholarly] body:has(.manuscript-page) .app-header .brand {font-size:26px}
 html[data-luforms-theme=scholarly] body:has(.manuscript-page) .app-header .main-nav {height:36px}
 html[data-luforms-theme=scholarly] body:has(.manuscript-page) .app-header .main-nav a {min-height:36px;padding:5px 0;font-size:16px}
 html[data-luforms-theme=scholarly] body:has(.manuscript-page) .manuscript-page {top:106px;bottom:36px;left:4vw;right:4vw;padding-top:0}
 html[data-luforms-theme=scholarly] .directory.manuscript-page .page-heading {margin:0 0 6px;padding:0}
 html[data-luforms-theme=scholarly] .directory .page-heading h1 {font-size:26px;line-height:1.4}
 html[data-luforms-theme=scholarly] .directory .directory-toolbar {padding-top:4px;min-height:36px;gap:4px 12px}
 html[data-luforms-theme=scholarly] .directory .directory-controls {margin-bottom:6px}
 html[data-luforms-theme=scholarly] .directory .directory-toolbar .directory-search-actions {flex:1 1 260px}
 html[data-luforms-theme=scholarly] .workspace-login .workspace-login-shell {height:100dvh;min-height:0;overflow:auto}
 html[data-luforms-theme=scholarly] .workspace-login .workspace-signin {position:absolute;top:16px;bottom:16px;left:8%;right:8%;width:auto;max-width:420px;margin-inline:auto;transform:none;overflow:auto;padding:20px;background:#faf5e9f5;border:1px solid #cbb48b}
 html[data-luforms-theme=scholarly] .workspace-login .workspace-login-brand {position:static;height:auto;padding:0;margin-bottom:6px}
 html[data-luforms-theme=scholarly] .workspace-login .workspace-login-brand span {font-size:32px}
 html[data-luforms-theme=scholarly] .workspace-login .workspace-signin h1 {font-size:20px;margin-bottom:16px}
}
@media (max-width:760px),(min-width:761px) and (max-aspect-ratio:7/5) {
 html[data-luforms-theme=scholarly] .campus-door .campus-map {width:max(200%,calc((100dvh - 158px) / 2 * 1752 / 898));height:auto;aspect-ratio:1752/898;top:calc((100% - 44px)/2);translate:calc(var(--crop)*-100%) -50%}
}
@media (max-width:760px) and (min-aspect-ratio:4/3) {
 .portal-calibrated .campus-portrait {display:flex}
 .portal-calibrated .campus-door {width:50%;height:100%}
 html[data-luforms-theme=scholarly] .campus-door .campus-map {width:200%}
}
@media (max-width:900px) and (max-height:600px) and (min-aspect-ratio:6/5) {
 html[data-luforms-theme=scholarly] .workspace-login .workspace-campus {background-image:url('./gothic/optimized/college-crafts-login-scriptorium-e1b497f0fdba.webp')}
 html[data-luforms-theme=scholarly] body:has(.manuscript-page) {--chapter-art:url('./gothic/optimized/college-crafts-directory-riverside-standard-v2-fca73e12d570.webp')}
 html[data-luforms-theme=scholarly] body:has(.student-page) {--chapter-art:url('./gothic/optimized/college-crafts-overview-cloister-standard-v2-d36b8c012f16.webp')}
 html[data-luforms-theme=scholarly] body:has(.manuscript-page) .manuscript-page {left:max(4vw,var(--scene-left,4vw));right:max(4vw,var(--scene-right,4vw));bottom:max(65px,var(--scene-bottom,65px))}
 html[data-luforms-theme=scholarly] body:has(.manuscript-page) .app-header {left:max(4vw,var(--scene-left,4vw));right:max(4vw,var(--scene-right,4vw))}
 html[data-luforms-theme=scholarly] body:has(.manuscript-page) .app-header .brand,
 html[data-luforms-theme=scholarly] body:has(.manuscript-page) .app-header .account-button {background:#f8f0df}
 html[data-luforms-theme=scholarly] body:has(.manuscript-page)::after {content:"";position:fixed;inset:0;box-sizing:border-box;border:2px solid #8d3026;box-shadow:inset 0 0 0 1px #d1ad5b,inset 0 0 0 3px #8d3026;pointer-events:none;z-index:2}
}
