body[data-stage13] #app button{font:inherit;cursor:pointer;margin:4px 7px 4px 0;padding:.45rem .8rem;border-radius:7px;border:1px solid #b9cadc;background:#fff;color:#174d88}body[data-stage13] #app button.primary{background:#1b4d89;color:white}body[data-stage13] #app .panel{padding:20px;margin-block:16px}body[data-stage13] #app label{display:block;margin-block:12px}body[data-stage13] #app input:not([type=checkbox]),body[data-stage13] #app select,body[data-stage13] #app textarea{font:inherit;max-width:100%;padding:7px}body[data-stage13] [data-storage-mode]{max-width:1132px;margin:16px auto;color:#53647c;padding-inline:24px}body[data-stage13] #app dialog form{min-width:min(28rem,70vw)}body[data-stage13] #app h2{margin-bottom:12px}
body[data-stage13] .records:has(>[data-published-record]){display:block}
body[data-stage13] [data-published-record]{margin:0 0 18px;min-width:0;max-width:100%}
body[data-stage13] .homework-upload{display:block;min-width:0;max-width:100%;padding:14px 0}
body[data-stage13] .homework-upload label{display:block;max-width:100%;white-space:normal}
body[data-stage13] .homework-upload input[type=file]{display:block;box-sizing:border-box;min-width:0;width:100%;max-width:100%;font-size:14px}
body[data-stage13] .homework-upload small{display:block;margin-top:8px;overflow-wrap:anywhere}
body[data-stage13] [data-published-record] button{max-width:100%;white-space:normal;overflow-wrap:anywhere}
body[data-stage13] .term-console button{border:1px solid #b8c9dc;border-radius:8px;background:#fff;color:#1b4d89;padding:9px 13px;font:inherit;cursor:pointer}
body[data-stage13] .term-console th,body[data-stage13] .term-console td{min-width:4rem;overflow-wrap:anywhere}
body[data-stage13] .term-console dialog label,body[data-stage13] .term-console dialog input,body[data-stage13] .term-console dialog select{display:block;width:100%;box-sizing:border-box}
body[data-stage13] .term-console dialog form{padding:20px}
/* Stage14 targeted responsive repairs. Existing portal layout and colours remain. */
body[data-stage13] #app{min-width:0;box-sizing:border-box}
body[data-stage13] #app header{flex-wrap:wrap}
body[data-stage13] #app .profile-card,body[data-stage13] #app .import-preview{padding:16px;border:1px solid #d9e2ec;border-radius:9px;margin:12px 0;background:#fff;overflow-wrap:anywhere;min-width:0}
body[data-stage13] #app .profile-card h3{margin:0 0 8px}
body[data-stage13] #app button,body[data-stage13] #app input,body[data-stage13] #app select{min-height:42px}
body[data-stage13] #app input:not([type=checkbox]),body[data-stage13] #app select,body[data-stage13] #app textarea{box-sizing:border-box;max-width:100%;font-size:16px}
body[data-stage13] #app dialog{box-sizing:border-box;max-height:90dvh;overflow:auto;max-width:calc(100vw - 24px);padding:16px}
body[data-stage13] #app dialog form{min-width:0;width:100%;padding:0}
body[data-stage13] #app dialog menu,body[data-stage13] #app .actions{display:flex;flex-wrap:wrap;padding:0;gap:8px}
body[data-stage13] #app .table-wrap,body[data-stage13] #app .table-scroll{max-width:100%;overflow:auto}
body[data-stage13] #app .import-preview section{margin:16px 0}
@media(max-width:600px){
 body[data-stage13] #app{width:100%;margin:0 auto;padding:16px}
 body[data-stage13] #app .panel{padding:14px}
 body[data-stage13] #app .grid,body[data-stage13] #app .course-grid,body[data-stage13] #app .records{grid-template-columns:1fr;min-width:0}
 body[data-stage13] #app h1{font-size:1.45rem;overflow-wrap:anywhere}
 body[data-stage13] #app table{min-width:0;width:100%}
 body[data-stage13] #app thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 body[data-stage13] #app tbody,body[data-stage13] #app tr,body[data-stage13] #app td{display:block;width:100%;box-sizing:border-box;min-width:0}
 body[data-stage13] #app tr{border:1px solid #d9e2ec;margin:10px 0;border-radius:8px;padding:8px}
 body[data-stage13] #app td{border:0;padding:7px;overflow-wrap:anywhere}
 body[data-stage13] #app td[data-label]::before{content:attr(data-label) '：';font-weight:650;color:#526178;margin-right:6px}
 body[data-stage13] #app label,body[data-stage13] #app input:not([type=checkbox]),body[data-stage13] #app select,body[data-stage13] #app textarea{width:100%;margin-inline:0}
 body[data-stage13] #app dialog{width:calc(100vw - 24px)}
}

/* Stage15 scoped additions retain the existing portal layout. */
.stage15-bar{display:flex;flex-wrap:wrap;gap:.5rem;margin:1rem auto;max-width:1200px;padding:0 1rem}.stage15-dialog{box-sizing:border-box;width:min(680px,calc(100vw - 24px));max-height:90dvh;overflow:auto;border:1px solid #b8cad9;border-radius:12px;padding:1rem;overflow-wrap:anywhere}.stage15-dialog header{display:flex;align-items:center;justify-content:space-between;gap:.5rem}.stage15-dialog label{display:block;margin:.75rem 0}.stage15-dialog input:not([type=checkbox]),.stage15-dialog textarea,.stage15-dialog select{box-sizing:border-box;max-width:100%;width:100%;font:inherit}.stage15-dialog textarea{min-height:7rem}.stage15-dialog button{min-height:40px;margin:.2rem;white-space:normal}.stage15-dialog menu{padding:0;display:flex;flex-wrap:wrap;gap:.5rem}.stage15-dialog .message-copy{white-space:pre-wrap}.stage15-dialog [role=status]{white-space:pre-wrap;color:#8c3924}
