html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #fcfcfc;
    color: #212529;
}

a {
    color: #2874f0;
}

a:hover {
    color: #1d5fc7;
}

.page-shell {
    flex: 1;
}

#content {
    padding-bottom: 3rem;
}

.debug-header {
    background-color: #8a1818 !important;
}

#main-header {
    background-color: #2874f0;
    color: #ffffff;
}

.header-shell {
    row-gap: 1rem;
}

.header-shell > .order-1.order-lg-last {
    margin-left: auto;
}

.main-navbar {
    display: flex !important;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding-left: 0.25rem;
}

.navbar-brand {
    font-family: "Merienda One", cursive;
    font-size: 1.5rem;
    margin-right: 0;
}

.nav-links .nav-link {
    color: rgba(255, 255, 255, 0.88) !important;
    font-weight: 500;
}

.nav-links .nav-link.active,
.nav-links .nav-link:hover {
    color: #ffffff !important;
}

.active-school-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.25rem;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    border: 0;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.active-school-pill:hover,
.active-school-pill:focus {
    background: rgba(255, 255, 255, 0.24);
    color: #ffffff;
    text-decoration: none;
}

.active-school-pill::after {
    margin-left: 0.15rem;
}

.school-switcher {
    position: relative;
}

.school-switcher__label {
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    opacity: 0.76;
    text-transform: uppercase;
}

.school-switcher__value {
    font-size: 0.84rem;
    font-weight: 700;
}

.school-switcher__menu {
    min-width: min(24rem, 92vw);
    padding: 0;
    border: 0;
    border-radius: 0.9rem;
    overflow: hidden;
    box-shadow: 0 1rem 2.5rem rgba(10, 37, 84, 0.22);
}

.school-switcher__menu-header {
    padding: 1rem 1rem 0.3rem;
    background: linear-gradient(135deg, #eef5ff 0%, #f8fbff 100%);
}

.school-switcher__menu-header h6 {
    margin-bottom: 0.2rem;
    color: #19325f;
    font-size: 0.95rem;
    font-weight: 700;
}

.school-switcher__menu-header p {
    margin-bottom: 0.85rem;
    color: #5871a3;
    font-size: 0.8rem;
    line-height: 1.45;
}

.school-switcher__filter-wrap {
    padding: 0 1rem 0.85rem;
    background: linear-gradient(135deg, #eef5ff 0%, #f8fbff 100%);
}

.school-switcher__filter {
    border: 1px solid #cfe0ff;
    border-radius: 0.65rem;
}

.school-switcher__filter:focus {
    border-color: #7aa7ff;
    box-shadow: 0 0 0 0.2rem rgba(40, 116, 240, 0.12);
}

.school-switcher__list {
    max-height: 19rem;
    padding: 0.65rem;
    overflow-y: auto;
    background: #ffffff;
}

.school-switcher__option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 0.85rem;
    padding: 0.78rem 0.9rem;
    background: #ffffff;
    border: 1px solid transparent;
    border-radius: 0.7rem;
    color: #1e2d49;
    text-align: left;
}

.school-switcher__option + .school-switcher__option {
    margin-top: 0.45rem;
}

.school-switcher__option:hover,
.school-switcher__option:focus {
    background: #f5f9ff;
    border-color: #d8e6ff;
    color: #1e2d49;
    outline: none;
}

.school-switcher__option.is-selected {
    background: #eef5ff;
    border-color: #2874f0;
}

.school-switcher__name {
    font-weight: 600;
    line-height: 1.35;
}

.school-switcher__meta {
    flex-shrink: 0;
    color: #6c757d;
    font-size: 0.78rem;
}

.school-switcher__current-indicator,
.school-directory-current-indicator {
    display: none;
}

.school-switcher__current-indicator.is-visible,
.school-directory-current-indicator.is-visible {
    display: inline;
    color: #2874f0;
    font-weight: 700;
}

.header-form-label {
    display: block;
    margin-bottom: 0.35rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.cart {
    position: relative;
}

.dropdown-menu.selected-courses {
    width: min(30rem, calc(100vw - 1rem));
    max-width: calc(100vw - 1rem);
    left: auto;
    right: 0;
}

.course-count[data-count]:after {
    position: absolute;
    top: -0.2rem;
    right: -0.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: rgba(27, 26, 26, 0.9);
    color: #fcfcfc;
    font-size: 0.8rem;
    font-weight: 700;
    content: attr(data-count);
}

div.dropdown-menu.selected-courses.show {
    width: min(30rem, calc(100vw - 1rem));
    max-width: calc(100vw - 1rem);
    max-height: 26rem;
    padding: 0.85rem;
    overflow-x: hidden;
    overflow-y: auto;
}

#header-course-cart {
    width: 100%;
    margin-bottom: 0.75rem;
    table-layout: fixed;
}

#header-course-cart td,
#header-course-cart th {
    vertical-align: middle;
}

#header-course-cart th {
    color: #6c757d;
    font-size: 0.74rem;
    text-transform: uppercase;
}

#header-course-cart th:nth-child(1),
#header-course-cart td:nth-child(1) {
    width: 5rem;
    white-space: nowrap;
}

#header-course-cart th:nth-child(2),
#header-course-cart td:nth-child(2) {
    width: 6.75rem;
}

#header-course-cart th:nth-child(4),
#header-course-cart td:nth-child(4) {
    width: 2.25rem;
    text-align: right;
}

#header-course-cart .cart-course-code,
#header-course-cart .cart-course-title {
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.3;
}

#header-course-cart .cart-course-title {
    font-weight: 500;
}

.empty-cart .alert {
    margin-bottom: 0;
}

#review-order {
    white-space: nowrap;
    width: 100%;
}

.footer-bg {
    background-color: #f5f5f5;
    border-top: 1px solid #e5e5e5;
}

.footer {
    margin-top: auto;
    padding: 1rem 0;
}

.footer-links,
.footer-social {
    gap: 1rem;
}

.footer a {
    text-decoration: none;
}

.footer-social a {
    color: #6c757d;
}

.footer-social a:hover {
    color: #2874f0;
}

#home-search-bar {
    font-size: calc(0.3rem + 2vmin);
}

#home-search-bar::placeholder {
    font-size: clamp(0.95rem, 0.85rem + 0.35vw, 1.05rem);
}

input.homepage-search {
    height: calc(1.5em + 2rem + 2px);
}

.border-2 {
    border-width: 2px !important;
}

td[colspan]:not([colspan="1"]) {
    text-align: center;
}

.remove-course {
    color: #a62700;
}

.remove-course:hover {
    color: #7f1d00;
    text-decoration: none;
}

.home-masthead {
    margin-top: 2rem;
}

.home-search-panel {
    padding: 1.5rem;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 0.75rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.04);
}

.home-summary {
    background: #f7fbff;
    border-color: #cfe0ff;
    color: #1f3f75;
}

.home-features {
    margin-top: 3rem;
}

.home-features .lead {
    color: #6c757d;
    font-size: 1rem;
}

.school-directory {
    margin-top: 3rem;
}

.school-directory summary {
    padding: 0.9rem 1rem;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 0.75rem;
    cursor: pointer;
    font-weight: 600;
    list-style: none;
}

.school-directory summary::-webkit-details-marker {
    display: none;
}

.school-directory[open] summary {
    border-bottom-right-radius: 0;
    border-bottom-left-radius: 0;
}

.school-directory-panel {
    padding: 1rem;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-top: 0;
    border-radius: 0 0 0.75rem 0.75rem;
}

.school-directory-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.school-directory-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0.9rem;
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 0.6rem;
    color: #212529;
    text-decoration: none;
}

.school-directory-link:hover {
    background: #eef5ff;
    border-color: #cfe0ff;
    color: #212529;
    text-decoration: none;
}

.school-directory-link.is-selected {
    background: #eef5ff;
    border-color: #2874f0;
}

.school-directory-link span {
    font-weight: 500;
}

.school-directory-link small {
    color: #6c757d;
}

.results-summary-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 0.75rem;
}

.results-summary-bar__query {
    font-weight: 600;
}

.hint {
    color: #6c757d;
}

.search-results-wrap {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 0.75rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.04);
}

.search-results-table {
    margin-bottom: 0;
    font-size: 0.94rem;
}

.search-results-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    border-top: 0;
    background: #f8f9fa;
    color: #6c757d;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.search-results-table tbody td {
    vertical-align: middle;
}

.search-results-table tbody tr:nth-child(even) {
    background: #fcfcfc;
}

.search-results-table tbody tr:hover {
    background: #f5f9ff;
}

.search-results-table .btn-primary {
    min-width: 6.4rem;
}

.search-results-table .table-secondary {
    background: #f8f9fa;
    color: #212529;
}

.page-notifications .course-cart,
.page-notifications #choose-notifications .card,
.page-notifications #email-form,
.page-notifications #text-form {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 0.75rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.04);
}

.page-notifications .course-cart {
    overflow: hidden;
}

.page-notifications #choose-notifications .card-header {
    background: #f8f9fa;
}

.page-notifications #email-form,
.page-notifications #text-form {
    margin-top: 1rem;
    padding: 1.25rem;
}

.page-notifications #pay-button,
.page-notifications #free-button {
    margin-top: 0.5rem;
}

@media (max-width: 1199.98px) {
    .school-directory-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .main-navbar {
        align-items: stretch;
        gap: 0.6rem;
    }

    .school-switcher {
        width: 100%;
        margin-top: 0.1rem;
    }

    .active-school-pill {
        width: 100%;
        justify-content: space-between;
        margin-left: 0;
    }

    .nav-links {
        padding-top: 0.35rem;
    }

    .school-switcher__menu {
        width: min(24rem, calc(100vw - 2rem));
    }
}

@media (max-width: 767.98px) {
    #content {
        margin-top: 1rem;
    }

    .results-summary-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .school-directory-grid {
        grid-template-columns: 1fr;
    }

    .footer-links,
    .footer-social {
        justify-content: center;
    }

    div.dropdown-menu.selected-courses.show {
        width: calc(100vw - 1rem);
        max-width: calc(100vw - 1rem);
        max-height: min(22rem, calc(100vh - 6rem));
    }
}

@media (max-width: 575.98px) {
    #cart {
        margin-right: 0.5rem;
    }

    .dropdown-menu.selected-courses {
        width: calc(100vw - 1rem);
        max-width: calc(100vw - 1rem);
        right: 0;
    }

    .school-switcher__menu {
        width: calc(100vw - 1rem);
    }
}
