/* University branding, scoped to public home and sign-in pages. */
.pagelayout-login .login-layout-left { display:none!important; }
.pagelayout-login .login-layout-right { width:100%;flex:0 0 100%;max-width:100%;padding:32px 20px;background:#f4f6f8; }
.pagelayout-login .login-layout-right-content { max-width:460px;background:#fff;border:1px solid #dce3e9;border-radius:8px;padding:32px; }
.pagelayout-login #logoimage { max-height:100px;width:auto; }
.pagelayout-login .loginform h1 { font-size:26px;text-align:center; }
.pagelayout-login .loginform>p { text-align:center; }
.pagelayout-login .login-languagemenu { margin:20px 0!important; }
.pagelayout-login .login-separator { margin:24px 0!important; }
#page-site-index #page.drawers .main-inner { max-width:1140px;margin:24px auto;padding:28px; }
#page-site-index #page-header h1 { font-size:28px;line-height:1.3; }
#ulsau-home { width:100%;max-width:none;margin:0 0 28px;padding:24px;background:#fff;border:1px solid #dce3e9;border-radius:8px; }
#ulsau-home .ulsau-brand { display:inline-flex;padding:12px 18px;background:#073763;border-radius:4px;margin-bottom:16px; }
#ulsau-home .ulsau-brand img { width:180px;height:auto;max-width:100%;margin:0!important; }
#ulsau-home h2 { font-size:22px;line-height:1.4; }
#ulsau-home p { line-height:1.6; }
#ulsau-home img { max-width:100%;height:auto; }
#ulsau-home .carousel-item { text-align:center; }
#ulsau-home .carousel-item img { max-height:240px;object-fit:contain; }
#ulsau-home .carousel-control-prev,#ulsau-home .carousel-control-next { width:44px;background:rgba(7,55,99,.7);height:44px;top:calc(50% - 22px);border-radius:4px; }
#page-site-index #frontpage-category-names { padding:20px 24px;background:#fff;border:1px solid #dce3e9;border-radius:8px; }
#page-site-index .course_category_tree .category>.info { padding:8px 0; }
@media(max-width:767px){
 .pagelayout-login .login-layout-right{padding:16px 12px;}
 .pagelayout-login .login-layout-right-content{padding:24px 20px;}
 #page-site-index #page.drawers .main-inner{margin:12px;padding:16px;}
 #page-site-index #page-header h1{font-size:24px;}
 #ulsau-home,#page-site-index #frontpage-category-names{padding:16px;}
}
#page-login-index #region-main.login-layout-right { background:#f4f6f8; }
#page-login-index #region-main-box.login-layout-right-content { background:#fff;border:1px solid #dce3e9;border-radius:8px; }
#page-login-index .login-layout-right { padding:24px 16px; }
#page-login-index .login-layout-right-content { padding:24px; }
#page-login-index #logoimage { max-height:80px; }
#page-login-index #loginlogo { margin-bottom:16px!important; }
#page-login-index .loginform>p { margin-bottom:20px!important; }

/* P1: retain usable course search width beside category selection. */
#page-course-index-category .d-flex:has(> .navitem .simplesearchform),
#page-course-index .d-flex:has(> .navitem .simplesearchform) { flex-wrap:wrap; gap:12px; }
body[id^="page-course-index"] .navitem:has(.simplesearchform) { flex:1 1 280px; min-width:0; }
body[id^="page-course-index"] .navitem:has(select) { flex:1 1 320px; min-width:0; }
body[id^="page-course-index"] .navitem select { max-width:100%; width:100%; }
body[id^="page-course-index"] .navitem .input-group { flex-wrap:nowrap; width:100%; }
body[id^="page-course-index"] .navitem .input-group input { min-width:0; flex:1 1 auto; width:1%; }
body[id^="page-course-index"] .navitem .simplesearchform { width:100%; }
/* P2 university home and preferences. */
#ulsau-home .ulsau-brand,#ulsau-home > h2 { display:none; }
#ulsau-contact { margin-top:28px; padding:20px 0; border-top:1px solid #dce3e9; line-height:1.7; }
#page-user-forum .ulsau-select-help { display:block; margin-top:6px; color:#526475; font-size:.9rem; white-space:normal; }
#page-message-notificationpreferences .preference-table thead th { position:sticky; top:60px; z-index:2; background:#fff; box-shadow:0 1px #dce3e9; }
#page-message-notificationpreferences .ulsau-group-toggle { width:100%; text-align:left; font-weight:600; padding:12px; border:0; background:#eef3f7; color:#17354c; }
#page-message-notificationpreferences .ulsau-group-toggle::before { content:'▾ '; }
#page-message-notificationpreferences .ulsau-group-toggle[aria-expanded="false"]::before { content:'▸ '; }
@media(max-width:767px) {
 #page-user-profile .profile_tree { column-count:1!important; columns:1!important; }
 #page-user-forum .mform select { width:100%; max-width:100%; min-width:0; }
 #page-message-notificationpreferences .preference-table { table-layout:fixed; width:100%; }
 #page-message-notificationpreferences .preference-table th,#page-message-notificationpreferences .preference-table td { overflow-wrap:anywhere; padding:8px; }
 #page-message-notificationpreferences .preference-table th:first-child { width:50%; }
}
@media(max-width:767px) { #page-site-index #page.drawers .main-inner { width:calc(100% - 24px); min-width:0; } }
#ulsau-help { margin:0 8px; white-space:nowrap; flex-shrink:0; }
@media(max-width:767px){#ulsau-help{min-width:32px;margin:0 4px;}}
#ulsau-help { align-self:center; display:inline-flex; align-items:center; justify-content:center; height:34px; padding:5px 10px; line-height:1.3; }
/* Compact headings without reducing form-input text or browser zoom. */
#page-header h1 { font-size:1.75rem; line-height:1.25; overflow-wrap:anywhere; }
#region-main h2,.mform fieldset legend,.mform fieldset .fheader { font-size:1.375rem; line-height:1.3; }
#region-main h3 { font-size:1.2rem; line-height:1.35; }
@media(max-width:767px) {
 body { font-size:.9375rem; line-height:1.5; }
 #page-header h1,#page-site-index #page-header h1 { font-size:1.3rem; line-height:1.25; }
 #region-main h2,#ulsau-home h2,.mform fieldset legend,.mform fieldset .fheader { font-size:1.125rem; line-height:1.35; }
 #region-main h3,#region-main h4 { font-size:1.0625rem; line-height:1.35; }
 #page.drawers .main-inner { margin-top:12px; padding:12px; }
 #page-header { margin-bottom:12px!important; padding:0!important; }
 #page-header .breadcrumb { margin-bottom:12px; }
 #page-header .page-header-headings { min-width:0; }
 #region-main { min-width:0; }
 #page-admin-tool-dataprivacy-summary .card-body { padding:14px!important; }
 #page-admin-tool-dataprivacy-summary .card-header { padding:10px 14px; }
 #page-admin-tool-dataprivacy-summary .card-header h3 { margin:0; }
 #region-main .mform .fitem { margin-bottom:14px; }
 .mform .felement,.mform .fcontainer,.mform .fgroup { min-width:0; max-width:100%; }
 .mform input[type=text],.mform input[type=password],.mform input[type=email],.mform input[type=number],.mform textarea,.mform select { max-width:100%; font-size:16px; }
 .mform .d-flex { flex-wrap:wrap; }
 #region-main .activityname,#region-main .coursename,#region-main .contentafterlink { overflow-wrap:anywhere; }
 #region-main img { max-width:100%; }
 .pagelayout-login #region-main-box.login-layout-right-content { padding:20px 16px; }
 .pagelayout-login .login-layout-right { padding:12px 8px!important; }
 .pagelayout-login .loginform h1 { font-size:1.3rem; }
 .pagelayout-login #logoimage { max-height:64px; }
 .drawer.drawer-left { width:min(285px,calc(100vw - 40px)); }
 .drawer .drawerheader { padding:8px 12px; min-height:56px; }
 .drawer .drawerheader .logo img { max-height:44px; width:auto; }
 .footer-content-popover { max-width:calc(100vw - 24px); overflow-wrap:anywhere; }
}
@media(max-width:374px) {
 body { font-size:.875rem; }
 .navbar.fixed-top { padding-left:4px!important; padding-right:4px!important; }
 .navbar .navbar-toggler { width:32px; padding:2px!important; }
 .navbar .editmode-switch-form { margin-left:2px!important; }
 .navbar .popover-region { width:32px; }
 .navbar .popover-region-toggle { width:32px; padding:0; }
 .navbar .usermenu .dropdown-toggle { padding-left:2px!important; padding-right:2px!important; }
 .navbar .usermenu .userpicture { width:28px; height:28px; }
 .navbar .divider { display:none; }
 #ulsau-help { font-size:12px; margin:0 3px; padding:5px 7px; }
 #page.drawers .main-inner { padding:10px; }
}
@media(max-width:767px) {
 body { font-size:15px!important; }
 #page.drawers #topofscroll.main-inner { margin-top:8px; padding:12px!important; }
 .secondary-navigation { padding-bottom:8px!important; }
 .secondary-navigation .moremenu { height:48px; }
 .secondary-navigation .nav-link { padding:12px 10px!important; }
 #page-header .d-flex.flex-wrap { row-gap:8px; }
}
@media(max-width:374px) { body { font-size:14px!important; } #page.drawers #topofscroll.main-inner{padding:10px!important;} }
@media(max-width:767px) {
 .tertiary-navigation>.d-flex,.tertiary-navigation .navitem { flex-wrap:wrap; gap:8px; min-width:0; }
 .tertiary-navigation .navitem { margin:0 0 8px; max-width:100%; }
 .tertiary-navigation .navitem:has(.user-search) { flex:1 1 220px; }
 .tertiary-navigation .user-search,.tertiary-navigation .simplesearchform { width:100%; min-width:0; }
 .tertiary-navigation .user-search input { min-width:0; width:100%; }
 #region-main .ulsau-table-scroll { max-width:100%; overflow-x:auto; overscroll-behavior-x:contain; -webkit-overflow-scrolling:touch; margin-bottom:16px; }
 .ulsau-table-scroll:focus-visible { outline:2px solid #176eb5; outline-offset:2px; }
 #region-main .btn,#region-main input[type=submit] { max-width:100%; white-space:normal; overflow-wrap:anywhere; }
 #page-mod-assign-view .gradingtable { max-width:100%; }
 #page-message-notificationpreferences .hover-tooltip { max-width:100%; right:0; }
}
@media(max-width:767px){
 #page-grade-report-grader-index .gradeparent{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;}
 #page-mod-assign-view .fileuploadsubmission{min-width:0!important;width:auto!important;max-width:100%;overflow-wrap:anywhere;}
 #page-mod-assign-view .ygtvtable{width:100%;table-layout:fixed;}
 #page-mod-assign-view .ygtvcell.ygtvhtml{width:auto!important;}
 #page-mod-assign-view .ygtvcell:not(.ygtvhtml){width:18px;}
 .course-linear-navigation .d-flex{flex-wrap:wrap;}
 #page-message-notificationpreferences .hover-tooltip{position:fixed;left:12px!important;right:12px!important;width:auto!important;max-width:calc(100vw - 24px);white-space:normal;}
}
.course_category_tree .category.with_children > .info > .categoryname {background-image:none!important;position:relative;padding-left:48px!important;min-height:36px;display:flex;align-items:center;flex-wrap:wrap;column-gap:4px;}
.course_category_tree .categoryname > a {min-width:0;overflow-wrap:anywhere;}
.ulsau-category-toggle {position:absolute;left:0;top:0;width:36px;height:36px;min-width:36px;border:1px solid #c9d3df;border-radius:6px;background:#fff;color:#184e77;display:flex;align-items:center;justify-content:center;padding:0;cursor:pointer;}
.ulsau-category-toggle span {font-size:24px;line-height:1;pointer-events:none;}
.ulsau-category-toggle[aria-expanded=true] span {transform:rotate(90deg);}
.ulsau-category-toggle:hover {background:#edf4fa;}
.ulsau-category-toggle:focus-visible {outline:3px solid #176eb5;outline-offset:2px;}
.course_category_tree .category > .info {margin-bottom:8px;}
