.portal-mobile-toggle,
.portal-submenu-toggle {
    display: none;
}

@media (max-width: 1200px) {
    .portal-responsive {
        margin: 0;
    }

    .portal-responsive form,
    .portal-responsive table,
    .portal-responsive iframe {
        max-width: 100%;
    }

    .portal-responsive .wrapper {
        width: 100%;
        min-width: 0;
    }

    .portal-responsive img,
    .portal-responsive video {
        max-width: 100%;
        object-fit: contain;
    }

    .portal-responsive img {
        height: auto;
    }

    .portal-responsive input:not([type="checkbox"]):not([type="radio"]),
    .portal-responsive textarea,
    .portal-responsive select {
        box-sizing: border-box;
        max-width: 100%;
    }

    .portal-responsive .panel-link-search {
        width: min(100%, 32rem);
    }

    .portal-content {
        min-width: 0;
        max-width: 100%;
        overflow-x: auto;
        overflow-wrap: anywhere;
    }

    .portal-responsive .portal-panel-shell,
    .portal-responsive .portal-panel-columns,
    .portal-responsive .portal-panel-shell > tbody,
    .portal-responsive .portal-panel-columns > tbody,
    .portal-responsive .portal-panel-shell > tbody > tr,
    .portal-responsive .portal-panel-columns > tbody > tr,
    .portal-responsive .portal-panel-shell > tbody > tr > td,
    .portal-responsive .portal-panel-columns > tbody > tr > td {
        display: block;
        box-sizing: border-box;
        width: 100% !important;
        min-width: 0;
        height: auto;
    }

    .portal-responsive .control-panel-sidebar li {
        white-space: normal;
    }

    .portal-responsive .portal-mobile-toggle,
    .portal-responsive .portal-submenu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 2.75rem;
        padding: .45rem .8rem;
        border: 1px solid #afc1cd;
        border-radius: .45rem;
        background: #f1f6fa;
        color: #173748;
        font: 600 1rem Arial, Helvetica, sans-serif;
        cursor: pointer;
    }

    .portal-responsive .portal-mobile-toggle {
        margin: .4rem;
    }

    .portal-responsive .portal-mobile-toggle:focus-visible,
    .portal-responsive .portal-submenu-toggle:focus-visible {
        outline: 2px solid #087699;
        outline-offset: 2px;
    }

    .portal-responsive #navMenu {
        display: block;
        width: 100%;
        max-width: 100%;
        text-align: left;
    }

    .portal-responsive #navMenu ul {
        position: static;
        display: block;
        visibility: visible;
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0;
    }

    .portal-responsive #navMenu ul ul {
        padding-inline-start: .75rem;
    }

    .portal-responsive #navMenu ul li {
        position: static;
        float: none;
        visibility: visible;
        box-sizing: border-box;
        width: 100%;
        margin: 0;
        padding: 0;
        text-align: left;
    }

    .portal-responsive #navMenu ul li > a,
    .portal-responsive #navMenu ul li > span {
        box-sizing: border-box;
        height: auto;
        min-height: 2.75rem;
        padding: .65rem .85rem;
        line-height: 1.3;
        text-align: left;
    }

    .portal-responsive #navMenu .portal-has-submenu {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
    }

    .portal-responsive #navMenu .portal-has-submenu > ul {
        grid-column: 1 / -1;
    }

    .portal-responsive #navMenu .portal-submenu-toggle {
        grid-column: 2;
        grid-row: 1;
        min-width: 2.75rem;
    }

    .portal-responsive #navMenu .portal-mobile-collapsed,
    .portal-responsive .portal-mobile-collapsed.control-panel-sidebar {
        display: none;
    }
}

@media (max-width: 640px) {
    .portal-responsive .portal-header-tools,
    .portal-responsive .portal-header-tools > tbody,
    .portal-responsive .portal-header-tools > tbody > tr,
    .portal-responsive .portal-header-tools > tbody > tr > td {
        display: block;
        box-sizing: border-box;
        width: 100%;
        height: auto;
        text-align: left;
    }

    .portal-responsive .portal-header-tools > tbody > tr > td {
        padding: .35rem .65rem;
    }

    .portal-responsive .portal-content textarea,
    .portal-responsive .portal-content input[type="text"],
    .portal-responsive .portal-content input[type="email"],
    .portal-responsive .portal-content input[type="password"],
    .portal-responsive .portal-content select {
        font-size: 1rem;
    }

    .portal-content table:has(textarea):not(:has(table textarea, th)),
    .portal-content table:has(textarea):not(:has(table textarea, th)) > tbody,
    .portal-content table:has(textarea):not(:has(table textarea, th)) > tbody > tr,
    .portal-content table:has(textarea):not(:has(table textarea, th)) > tbody > tr > td {
        display: block;
        box-sizing: border-box;
        width: 100% !important;
        max-width: 100%;
        height: auto;
    }
}

@media (max-width: 1200px) {
    .portal-responsive .portal-content,
    .portal-responsive .portal-content fieldset,
    .portal-responsive .portal-content marquee,
    .portal-responsive .portal-content .calendar-container,
    .portal-responsive .portal-content .dotted,
    .portal-responsive .portal-content .container,
    .portal-responsive .portal-content .map-container {
        box-sizing: border-box;
        min-width: 0;
        max-width: 100%;
    }

    .portal-responsive .portal-content .map-container {
        width: 100%;
        margin-inline: 0;
    }

    .portal-responsive .portal-content .main-layout {
        flex-wrap: wrap;
    }

    .portal-responsive .portal-content .main-layout > .sidebar,
    .portal-responsive .portal-content .main-layout > .content-area {
        flex: 1 1 100%;
        min-width: 0;
        width: 100%;
    }

    .portal-responsive .portal-content .courses-row,
    .portal-responsive .portal-content .company-container {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .portal-responsive .portal-content .courses-row > .course-card {
        box-sizing: border-box;
        flex: 1 1 14rem;
        min-width: 0;
        max-width: 100%;
    }

    .portal-responsive .portal-content .company-column,
    .portal-responsive .portal-content .company-column3 {
        max-width: 100%;
    }

    .portal-responsive .portal-content #sidebar3,
    .portal-responsive .portal-content #content_area3 {
        float: none;
        width: 100%;
    }

    .portal-responsive #rendzr {
        display: block;
        width: 100%;
        overflow-x: auto;
    }

    .portal-responsive .portal-content input[type="file"] {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .portal-responsive .portal-content .courses-row > .course-card {
        flex-basis: 100%;
    }

    .portal-responsive .portal-content .map-container {
        height: clamp(14rem, 68vw, 22rem);
    }

    .portal-responsive #rendzr > tbody,
    .portal-responsive #rendzr > tbody > tr,
    .portal-responsive #rendzr > tbody > tr > td {
        display: block;
        box-sizing: border-box;
        width: 100%;
        height: auto;
    }
}

@media (max-width: 1200px) {
    .portal-responsive .containerReg,
    .portal-responsive .form-table {
        box-sizing: border-box;
        max-width: 100%;
        min-width: 0;
        margin-inline: auto;
    }

    .portal-responsive .form-table {
        width: 100%;
    }

    .portal-responsive :is(.form-table, .c100_ctc_table_email) textarea {
        width: 100%;
    }

    .portal-responsive .portal-content > table:has(.c100_ctc_table_outer),
    .portal-responsive .portal-content > table:has(.c100_ctc_table_outer) > tbody,
    .portal-responsive .portal-content > table:has(.c100_ctc_table_outer) > tbody > tr,
    .portal-responsive .portal-content > table:has(.c100_ctc_table_outer) > tbody > tr > td {
        display: block;
        box-sizing: border-box;
        width: 100%;
    }
}

@media (max-width: 640px) {
    .portal-responsive .form-table,
    .portal-responsive .form-table > tbody,
    .portal-responsive .form-table > tbody > tr,
    .portal-responsive .form-table > tbody > tr > td,
    .portal-responsive #rendzr #Table1,
    .portal-responsive #rendzr #Table1 > tbody,
    .portal-responsive #rendzr #Table1 > tbody > tr,
    .portal-responsive #rendzr #Table1 > tbody > tr > td {
        display: block;
        box-sizing: border-box;
        width: 100%;
    }
}

@media (max-width: 1200px) {
    .portal-responsive #rendzr .slideRight2,
    .portal-responsive :is(#rendzr, .c100_ctc_table_outer) fieldset {
        box-sizing: border-box;
        max-width: 100%;
        min-width: 0;
    }

    .portal-responsive .c100_ctc_table_outer,
    .portal-responsive .c100_ctc_table_outer > tbody,
    .portal-responsive .c100_ctc_table_outer > tbody > tr,
    .portal-responsive .c100_ctc_table_outer > tbody > tr > td {
        display: block;
        box-sizing: border-box;
        width: 100%;
    }
}

/* ---- Footer menu (MasterPage.master): heading + list blocks that wrap 4 / 2 / 1 per row ---- */
.ot-footer-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px 24px;
    width: 100%;
}

.ot-footer-grid .ot-footer-col ul {
    margin-top: 6px;
}

@media (max-width: 1200px) {
    /* nothing may push the page wider than the screen (hidden slide-out panels, fixed-width tables) */
    html,
    body.portal-responsive {
        overflow-x: hidden;
    }

    .portal-responsive #rendzr {
        overflow-x: visible;
    }

    .portal-responsive #rendzr > tbody,
    .portal-responsive #rendzr > tbody > tr,
    .portal-responsive #rendzr > tbody > tr > td {
        display: block;
        box-sizing: border-box;
        width: 100% !important;
        height: auto;
    }

    .ot-footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* home page banner had a fixed 455px height, leaving large blank gaps */
    .portal-responsive #ctl00_Image1 {
        height: auto !important;
    }

    .portal-responsive img {
        max-width: 100%;
    }

    .portal-responsive .sidebar {
        max-width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 640px) {
    .ot-footer-grid {
        grid-template-columns: 1fr;
    }

    /* old fixed-width layout tables shrink to the screen instead of being cut off */
    .portal-responsive .portal-content table,
    .portal-responsive #rendzr table {
        width: 100% !important;
        max-width: 100%;
        table-layout: auto;
    }

    .portal-responsive .portal-content td,
    .portal-responsive .portal-content th {
        width: auto !important;
        overflow-wrap: anywhere;
    }
}

/* ---- Forms built from layout tables: stack label / field / validator vertically on tablets and phones ---- */
@media (max-width: 900px) {
    .portal-responsive .portal-content table:has(input, select, textarea),
    .portal-responsive .portal-content table:has(input, select, textarea) > tbody,
    .portal-responsive .portal-content table:has(input, select, textarea) > tbody > tr,
    .portal-responsive .portal-content table:has(input, select, textarea) > tbody > tr > td,
    .portal-responsive .portal-content table:has(input, select, textarea) > tbody > tr > th {
        display: block;
        box-sizing: border-box;
        width: 100% !important;
        height: auto;
    }

    .portal-responsive .portal-content select,
    .portal-responsive .portal-content textarea,
    .portal-responsive .portal-content input:not([type="checkbox"]):not([type="radio"]):not([type="image"]) {
        max-width: 100%;
        box-sizing: border-box;
    }

    .portal-responsive .portal-content table {
        max-width: 100%;
    }

    .portal-responsive .portal-content p.title,
    .portal-responsive .portal-content .maintitle {
        white-space: normal;
        overflow-wrap: anywhere;
    }
}

/* ---- Header search: box and button the same height, centred on one line (all master pages) ---- */
input[id$="txtBoxSearch"],
input[id$="btnSearch"] {
    box-sizing: border-box;
    height: 32px !important;
    vertical-align: middle;
    margin: 0;
}

input[id$="txtBoxSearch"] {
    padding: 0 8px;
    border: 1px solid #767676;
    border-radius: 4px 0 0 4px;
    max-width: calc(100% - 40px);
}

input[id$="btnSearch"] {
    width: 32px !important;
    object-fit: cover;
    border: 1px solid #252525;
    border-left: 0;
    border-radius: 0 4px 4px 0;
    margin-left: -4px;   /* removes the gap so box and button read as one control */
}

/* ---- Comment box + buttons in the same cell: box on its own line, buttons lined up underneath ---- */
td:has(> textarea) > textarea {
    display: block;
    margin: 0 0 10px 0;
}

td:has(> textarea) > input[type="submit"],
td:has(> textarea) > input[type="button"],
td:has(> textarea) > input[type="reset"] {
    vertical-align: top;
    margin: 0 8px 0 0;
}
