/* NCTU navigation and responsive dashboard; native Canvas typography and cards. */
html.nctu-university-theme{--nctu-red:#b51f38;--nctu-header:#f8cb46;--nctu-yellow:#efbd40;--nctu-top-height:78px;scroll-padding-top:calc(var(--nctu-top-height) + 16px)}
html.nctu-university-theme #header #skip_navigation_link{position:absolute;left:20px;top:-100px;background:#fff;color:#a9182c;padding:12px;z-index:110}
html.nctu-university-theme #header #skip_navigation_link:focus{top:10px}
.nctu-university-brand{display:flex;align-items:center;gap:16px;text-decoration:none!important;flex:0 0 auto;color:var(--nctu-red)!important}
.nctu-university-brand img{width:172px;height:48px;object-fit:contain;background:transparent;padding:0;border-radius:0}
@media(min-width:768px){
 html.nctu-university-theme #header.ic-app-header{position:fixed;top:0;left:0;right:0;bottom:auto;width:100%;height:var(--nctu-top-height);padding:0;background:var(--nctu-header);box-shadow:none!important;border-bottom:3px solid var(--nctu-yellow);box-sizing:border-box;z-index:100;overflow:visible;--ic-brand-global-nav-bgd:var(--nctu-header)!important;--ic-brand-global-nav-logo-bgd:var(--nctu-header)!important;--ic-brand-global-nav-ic-icon-svg-fill:#66361c!important;--ic-brand-global-nav-ic-icon-svg-fill--active:#fff!important;--ic-brand-global-nav-menu-item__text-color:#66361c!important;--ic-brand-global-nav-menu-item__text-color--active:#fff!important;--ic-brand-global-nav-avatar-border:#8d572e60!important}
 html.nctu-university-theme #header .ic-app-header__main-navigation{display:flex;align-items:center;gap:20px;height:75px;padding:0 20px;box-sizing:border-box;width:100%}
 html.nctu-university-theme #header .ic-app-header__logomark-container,html.nctu-university-theme #header .ic-app-header__secondary-navigation{display:none}
 html.nctu-university-theme #header #menu{display:flex;align-items:stretch;justify-content:flex-end;flex:1;min-width:0;height:75px;margin:0;padding:0;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;list-style:none}
 html.nctu-university-theme #header #menu>.ic-app-header__menu-list-item{flex:0 0 auto;position:relative;width:auto;margin:0;background:transparent}
 html.nctu-university-theme #header #menu .ic-app-header__menu-list-link{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:6px;box-sizing:border-box;width:96px;min-width:96px;height:75px;padding:15px 12px 3px;background:transparent;color:#66361c;border-radius:0;font-size:14px;line-height:1.3;text-decoration:none;border-bottom:3px solid transparent}
 html.nctu-university-theme #header #menu .ic-app-header__menu-list-link:hover{background:#f2bf31;color:#66361c}
 html.nctu-university-theme #header #menu .ic-app-header__menu-list-item--active .ic-app-header__menu-list-link{color:#fff;background:var(--nctu-red);border-bottom-color:var(--nctu-red)}
 html.nctu-university-theme #header #menu .menu-item-icon-container{width:30px;height:30px;margin:0;padding:0;flex:0 0 30px;position:relative;line-height:1}
 html.nctu-university-theme #header #menu svg{width:30px!important;height:30px!important;fill:currentColor}
 html.nctu-university-theme #header #menu .ic-avatar{width:30px;height:30px;border:1px solid #8d572e60}
 html.nctu-university-theme #header #menu .ic-avatar img{width:100%;height:100%;object-fit:cover}
 html.nctu-university-theme #header #menu .menu-item__text{margin:0;padding:0;white-space:nowrap;display:block;max-width:none;opacity:1;position:static;color:inherit!important;background:transparent!important;transform:none}
 html.nctu-university-theme #header #menu .menu-item__text::before,html.nctu-university-theme #header #menu .menu-item__text::after{display:none}
 html.nctu-university-theme #header #menu .menu-item__badge{position:absolute;top:-5px;right:-5px}
 html.nctu-university-theme #header #menu a:focus-visible{outline-color:#8d1222;outline-offset:-4px}
 html.nctu-university-theme #wrapper.ic-Layout-wrapper{margin-left:0!important;padding-top:var(--nctu-top-height)}
 html.nctu-university-theme .ic-app-header--collapsed #wrapper,html.nctu-university-theme .ic-app-header--expanded #wrapper{margin-left:0!important}
 html.nctu-university-theme #mobile-header{display:none}
 html.nctu-university-theme body:not(.hide-global-nav) .tray-with-space-for-global-nav{margin-left:0!important}
}

/* Use the available screen width without stretching a lone course card. */
html.nctu-university-theme body:has(#dashboard) #wrapper.ic-Layout-wrapper{max-width:none!important;width:100%;box-sizing:border-box}
html.nctu-university-theme #dashboard .ic-DashboardCard__box__container,
html.nctu-university-theme #dashboard .ic-DashboardCard__box:has(> .ic-DashboardCard > .ic-DashboardCard__placeholder-svg){display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,262px),1fr));gap:24px;margin:0;width:100%;box-sizing:border-box}
html.nctu-university-theme #dashboard .ic-DashboardCard{width:100%;margin:0;min-width:0;box-sizing:border-box}
html.nctu-university-theme #dashboard .ic-DashboardCard__action-container{display:flex}
html.nctu-university-theme #dashboard .ic-DashboardCard__action{flex:1 1 0;width:auto;min-width:0}
html.nctu-university-theme #dashboard .ic-DashboardCard[data-nctu-filtered]{display:none!important}
/* Native loading cards are direct box children, unlike the loaded cards. */
html.nctu-university-theme #dashboard .ic-DashboardCard__box:has(> .ic-DashboardCard > .ic-DashboardCard__placeholder-svg){padding:12px 24px}
html.nctu-university-theme #dashboard .ic-DashboardCard__box:has(> .ic-DashboardCard > .ic-DashboardCard__placeholder-svg)>br{display:none}
html.nctu-university-theme #dashboard .ic-DashboardCard:has(> .ic-DashboardCard__placeholder-svg){height:273px}
html.nctu-university-theme #dashboard .ic-DashboardCard__placeholder-svg{height:273px}
/* One teaching card represents one administrative class. */
html.nctu-university-theme #dashboard [data-nctu-classes]{white-space:normal!important;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;line-height:1.5;height:auto}
.nctu-dashboard-filter{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:8px 0 24px}
.nctu-dashboard-filter label{font-weight:600}
.nctu-dashboard-filter select{width:min(100%,420px);min-width:200px;max-width:100%;margin:0;font:inherit}
.nctu-dashboard-filter-status{color:#56646d;font-size:14px}
.nctu-dashboard-term-heading{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:16px 0 0;padding:16px 20px;border-left:5px solid var(--nctu-red,#b51f38);border-radius:4px;background:#f4f5f6;color:#2d3b45;font-size:24px;font-weight:700;line-height:1.4}
.nctu-dashboard-term-heading[hidden]{display:none}
.nctu-dashboard-term-count{font-size:14px;font-weight:400;color:#56646d}
.ic-DashboardCard__box__container>.ic-DashboardCard{order:var(--nctu-section-order,0)}
.nctu-dashboard-grouped-terms>.ic-DashboardCard{order:var(--nctu-term-order,999)}
@media(max-width:767px){.nctu-dashboard-term-heading{font-size:20px;padding:12px 16px}.nctu-dashboard-term-count{width:100%}}
html.nctu-university-theme body:has(#DashboardCard_Container[style*="display: none"]) .nctu-dashboard-filter{display:none}
/* Personal Files is now a topbar entry; retain native file permissions. */
html.nctu-university-theme #nav-tray-portal .navigation-tray-container a[href="/files"]{display:none}
@media(max-width:767px){.nctu-dashboard-filter{margin-bottom:20px}.nctu-dashboard-filter select{flex:1;min-width:0}.nctu-dashboard-filter-status{width:100%}}
@media(min-width:768px) and (max-width:1199px){
 .nctu-university-brand img{width:160px;height:46px}
 html.nctu-university-theme #header .ic-app-header__main-navigation{gap:14px;padding:0 18px}
 html.nctu-university-theme #header #menu .ic-app-header__menu-list-link{width:88px;min-width:88px;padding:14px 8px 2px;font-size:13px}
}
@media(max-width:767px){
 html.nctu-university-theme{--nctu-top-height:64px}
 .nctu-university-strip,html.nctu-university-theme #header .nctu-university-brand{display:none}
 html.nctu-university-theme #mobile-header{height:64px;flex-wrap:nowrap;background:var(--nctu-header);color:#66361c;border-bottom:3px solid var(--nctu-yellow);box-sizing:border-box;--ic-brand-global-nav-menu-item__text-color:#66361c!important}
 html.nctu-university-theme #mobile-header .Button--icon-action-rev{color:#66361c}
 html.nctu-university-theme #mobile-header .Button--icon-action-rev *{color:inherit}
 html.nctu-university-theme #mobile-header .mobile-header-title{color:#fff;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;padding:0 6px}
 .nctu-mobile-brand{display:flex;align-items:center;gap:12px;flex:0 1 238px;min-width:0;padding:0 4px}
 .nctu-mobile-brand>img{width:128px;height:38px;object-fit:contain;background:transparent;padding:0;border-radius:0}
 html.nctu-university-theme #mobile-header .mobile-header-space{flex:1;min-width:0}
 html.nctu-university-theme #wrapper.ic-Layout-wrapper{margin-left:0!important}
 html.nctu-university-theme #header.ic-app-header{--ic-brand-global-nav-bgd:var(--nctu-header)!important;--ic-brand-global-nav-ic-icon-svg-fill:#66361c!important;--ic-brand-global-nav-menu-item__text-color:#66361c!important}
}
@media(prefers-reduced-motion:reduce){html.nctu-university-theme *{scroll-behavior:auto}}
@media print{html.nctu-university-theme #header,html.nctu-university-theme #mobile-header{display:none!important}html.nctu-university-theme #wrapper.ic-Layout-wrapper{padding-top:0!important;margin-left:0!important}}

/* University logo and the official Canvas wordmark share one transparent lockup. */
.nctu-canvas-brand{display:flex;align-items:center;border-left:1px solid #9d6d2860;padding-left:18px}
.nctu-university-brand .nctu-canvas-brand img{width:140px;height:46px;padding:0;background:transparent}
@media(min-width:768px) and (max-width:1199px){.nctu-university-brand>img{width:132px;height:42px}.nctu-university-brand .nctu-canvas-brand img{width:96px;height:34px}.nctu-canvas-brand{padding-left:14px}.nctu-university-brand{gap:14px}}
@media(max-width:767px){.nctu-mobile-brand .nctu-canvas-brand{padding-left:12px}.nctu-mobile-brand .nctu-canvas-brand img{width:82px;height:30px;background:transparent}.nctu-university-theme #mobile-header .mobile-header-title{display:none}}

@media(min-width:768px){html.nctu-university-theme #header #menu .ic-app-header__menu-list-item--active a:focus-visible{outline-color:#fff}}

@media(min-width:768px){
 html.nctu-university-theme #header #menu .menu-item-icon-container{display:flex;align-items:center;justify-content:center}
 html.nctu-university-theme #header #menu .menu-item-icon-container i::before{font-size:28px!important;line-height:30px!important;display:block;width:30px;text-align:center}
}

/* Local correction: long Vietnamese labels stay inside equal navigation cells. */
@media(min-width:768px){
 html.nctu-university-theme #header #menu .ic-app-header__menu-list-link{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:30px 30px;align-content:start;justify-content:normal;justify-items:center;gap:3px;padding:10px 6px 0}
 html.nctu-university-theme #header #menu .menu-item__text{display:block;align-self:center;white-space:normal!important;overflow-wrap:normal;word-break:normal;width:100%;max-width:100%;min-width:0;height:auto;max-height:30px;text-align:center;font-size:inherit;line-height:15px}
}

@media(min-width:768px){
 html.nctu-university-theme #header #menu{justify-content:flex-start}
 html.nctu-university-theme #header #menu>.ic-app-header__menu-list-item:first-child{margin-left:auto}
 html.nctu-university-theme #header #menu .menu-item-icon-container{display:flex;align-items:center;justify-content:center}
 html.nctu-university-theme #header #menu .menu-item-icon-container i::before{font-size:28px!important;line-height:30px!important;display:block;width:30px;text-align:center}
 html.nctu-university-theme #header #menu a:focus-visible{outline:3px solid #8d1222;outline-offset:-4px}
 html.nctu-university-theme #header #menu .ic-app-header__menu-list-item--active a:focus-visible{outline-color:#fff}
 /* Offset Canvas' native sticky dashboard heading below the relocated navbar. */
 html.nctu-university-theme #dashboard_header_container{top:var(--nctu-top-height)}
}

/* Six everyday course links; native tools remain available on demand. */
#section-tabs[data-nctu-simple=true]:not([data-nctu-expanded=true])>li[data-nctu-secondary]{display:none}
#section-tabs .nctu-course-tools{margin-top:12px;padding-top:12px;border-top:1px solid #d8dce1}
#section-tabs .nctu-course-tools .Button{width:100%;min-height:44px;text-align:left;white-space:normal;font-family:inherit}
#section-tabs .nctu-course-tools a{display:block;margin-top:8px}
@media print{#section-tabs .nctu-course-tools{display:none}}

#section-tabs[data-nctu-simple=true]{display:flex;flex-direction:column}
#section-tabs[data-nctu-simple=true]:not([data-nctu-expanded=true])>li{order:var(--nctu-nav-order,200)}

/* Canvas trays share the viewport with the horizontal navbar. */
@media(min-width:768px){
 html.nctu-university-theme #nav-tray-portal span:has(> [role="dialog"]){top:var(--nctu-top-height)!important;height:calc(100vh - var(--nctu-top-height))!important;max-height:calc(100vh - var(--nctu-top-height))!important}
 html.nctu-university-theme #nav-tray-portal .navigation-tray-container{min-height:calc(100vh - var(--nctu-top-height))}
 html.nctu-university-theme #left-side #sticky-container{top:var(--nctu-top-height);max-height:calc(100vh - var(--nctu-top-height));max-height:calc(100dvh - var(--nctu-top-height))}
 html.nctu-university-theme #main [id],html.nctu-university-theme #main :is(input,select,textarea,button,a){scroll-margin-top:16px}
}
