/**
 * ISH Academy theme — client QA fixes
 * Source: "ISH Desktop & Responsive Issues_03-11-2026.docx"
 * Loaded last from templates/head.mustache so it wins over style.css / dashboard.css / ish-responsive.css.
 * Each block is tagged with the page + bug number from the client document.
 */

/* ==========================================================================
   HOME (desktop) #1 — reduce the space around "Explore our courses"
   ========================================================================== */
body.pagelayout-frontpage .our-courses-sec.cmn-gap {
    padding: 60px 0;
}

body.pagelayout-frontpage .our-courses .sec-head {
    margin-bottom: 30px;
}

@media (max-width: 991.98px) {
    body.pagelayout-frontpage .our-courses-sec.cmn-gap {
        padding: 40px 0;
    }

    body.pagelayout-frontpage .our-courses .sec-head {
        margin-bottom: 20px;
    }
}

/* ==========================================================================
   HOME (desktop) #3 — "Meet Your Tutors" in Title Case
   ========================================================================== */
body.pagelayout-frontpage .testimonial-sec .sec-head h2 {
    text-transform: capitalize;
}

/* ==========================================================================
   HOME (mobile) #1, #2 / (tablet) #1 — background images must cover their box.
   The responsive overflow guard (img {height:auto}) shrank the hero and
   "Teaching Approach" background images, so text spilled onto a white/light
   area and the "Find out more" button fell outside the dark box.
   ========================================================================== */
body.pagelayout-frontpage .hero-slider-img img,
body.pagelayout-frontpage .t-approach-bg img,
body .t-approach-bg img {
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
}

/* HOME (mobile) #2 — hero subtitle readable over the whole banner width */
@media (max-width: 767.98px) {
    body.pagelayout-frontpage .hero-slider-img::after {
        background: linear-gradient(90deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.55) 100%);
    }

    body.pagelayout-frontpage .hero-content-inr {
        max-width: 100%;
    }
}

/* ==========================================================================
   ABOUT page #1 — "Connect With Us" button in Title Case (all "Didn't find an
   answer?" blocks; text comes from block settings)
   ========================================================================== */
.connect-sec .sec-head .cmn-btn {
    text-transform: capitalize;
}

/* ==========================================================================
   CONTACT (mobile) #1 — logged-out header: "Log In" must stay on one line.
   The flexible "Academy Info" button was taking all free space and squeezing
   the Log In button until its text wrapped.
   ========================================================================== */
@media (max-width: 575.98px) {
    .ds-main-head .nav-right-part .hdr-btn {
        flex: 0 0 auto;
        white-space: nowrap;
        padding-left: 14px !important;
        padding-right: 14px !important;
    }

    .ds-main-head .nav-right-part .nav-btn {
        min-width: 0;
    }

    .ds-main-head .nav-right-part .nav-btn .cmn-btn {
        width: 100%;
        white-space: nowrap;
        padding-left: 12px !important;
        padding-right: 12px !important;
        justify-content: center;
    }
}

@media (max-width: 359.98px) {
    .ds-main-head .nav-right-part .nav-btn .cmn-btn {
        font-size: 12px !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    .ds-main-head .nav-right-part .nav-btn .cmn-btn img {
        width: 20px;
        height: 20px;
        margin-left: 4px;
    }

    .ds-main-head .nav-right-part .hdr-btn {
        font-size: 13px !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
}

/* ==========================================================================
   DASHBOARD /my/ (tablet) #1, (mobile) #1 — "Welcome Back" and
   "Academy Announcements" boxes share the same left/right edges.
   (Below desktop the .row lost its negative margins while .col-12 kept 12px
   padding, so the announcements box was inset.) Same result on desktop.
   ========================================================================== */
body.pagelayout-mydashboard .ds-body > .row {
    margin-left: 0;
    margin-right: 0;
}

body.pagelayout-mydashboard .ds-body > .row > .col-12 {
    padding-left: 0;
    padding-right: 0;
}

/* DASHBOARD (mobile) #3 — "Academy Announcements" left aligned with its content */
@media (max-width: 991.98px) {
    body.pagelayout-mydashboard .ds-cmn-box > .sec-head,
    body.pagelayout-mydashboard .ds-cmn-box > .sec-head h2 {
        justify-content: flex-start;
        align-items: flex-start;
        text-align: left;
    }

    body.pagelayout-mydashboard .ds-cmn-box > .sec-head h2 {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        padding-left: 0;
        padding-right: 0;
    }
}

/* ==========================================================================
   DASHBOARD (tablet) #2 — remove the unwanted vertical divider line in the
   header (next to the profile dropdown) on tablet/mobile.
   ========================================================================== */
@media (max-width: 1099.98px) {
    .ds-main-head .divider.border-start {
        display: none !important;
    }
}

/* ==========================================================================
   DASHBOARD (mobile) #2 — smaller header search icon so it no longer crowds /
   overlaps the "ISH Academy" logo text.
   ========================================================================== */
@media (max-width: 575.98px) {
    .ds-main-head .nav-right-part .ish-header-search,
    body.limitedwidth .ds-main-head .nav-right-part .ish-header-search,
    body.panel-user .ds-main-head .nav-right-part .ish-header-search {
        width: 36px;
        min-width: 36px;
        max-width: 36px;
    }

    .ds-main-head .ish-search-toggle {
        width: 36px !important;
        min-width: 36px;
        height: 36px !important;
        min-height: 36px;
        background-size: 16px;
    }
}

/* ==========================================================================
   MY COURSES (mobile) #1 — bigger sort button ("LAST ACCESSED"): full width
   and same height as the search field above it.
   ========================================================================== */
@media (max-width: 767.98px) {
    .block_myoverview .search-form .filter-btn,
    .block_myoverview .search-form .filter-btn .dropdown {
        width: 100%;
    }

    .block_myoverview .search-form .filter-btn .dropdown-toggle.cmn-btn {
        width: 100%;
        min-height: 44px;
        font-size: 16px !important;
        justify-content: center;
    }
}

@media (max-width: 767.98px) {
    .block_myoverview .search-form .filter-btn .dropdown-menu {
        width: 100%;
    }
}

/* ==========================================================================
   COURSE PAGE (mobile/tablet, all courses) #1 — "Show more / Show less" keeps
   the same position (top-right of the restriction text) after it is clicked.
   Previously the expanded state switched to display:block, so "Show less"
   jumped to the left above the text.
   ========================================================================== */
@media (max-width: 991.98px) {
    html body.path-course-view:is(#page-course-view-topics, #page-course-view-weeks) .activity-availability .showmore-container:not(.collapsed) {
        display: flex;
        flex-wrap: nowrap;
        align-items: flex-start;
        gap: 8px;
        width: 100%;
    }

    html body.path-course-view:is(#page-course-view-topics, #page-course-view-weeks) .activity-availability .showmore-container:not(.collapsed) > .expanded-content {
        order: 1;
        flex: 1 1 auto;
        min-width: 0;
        width: auto;
        margin: 0;
    }

    html body.path-course-view:is(#page-course-view-topics, #page-course-view-weeks) .activity-availability .showmore-container:not(.collapsed) > .showmore-button {
        order: 2;
        flex: 0 0 auto;
        margin-left: auto;
        align-self: flex-start;
    }

    html body.path-course-view:is(#page-course-view-topics, #page-course-view-weeks) .activity-availability .showmore-container > .showmore-button,
    html body.path-course-view:is(#page-course-view-topics, #page-course-view-weeks) .activity-availability .showmore-container > .showmore-button:hover,
    html body.path-course-view:is(#page-course-view-topics, #page-course-view-weeks) .activity-availability .showmore-container > .showmore-button:focus {
        color: #808080;
        text-decoration: none;
        white-space: nowrap;
    }
}

/* ==========================================================================
   COURSE PAGE (mobile/tablet, all courses) #2 — bigger progress chip next to
   "Start Assessment" (same height as the button, never overlapping it).
   ========================================================================== */
@media (max-width: 991.98px) {
    html body.path-course-view:is(#page-course-view-topics, #page-course-view-weeks) .modtype_quiz .topic-status {
        flex: 0 0 auto;
        margin-right: 4px;
    }

    html body.path-course-view:is(#page-course-view-topics, #page-course-view-weeks) .modtype_quiz .topic-status-bar {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 60px;
        min-height: 34px;
        padding: 4px 14px;
    }

    html body.path-course-view:is(#page-course-view-topics, #page-course-view-weeks) .modtype_quiz .topic-status .status-label-text--track {
        font-size: 13px;
    }
}

/* ==========================================================================
   COURSE SETTINGS (tablet) #1 / PARTICIPANTS (mobile) #2 / GRADER REPORT —
   blank white area below the footer while scrolling.
   The theme makes both <html> and <body> scroll containers (overflow-x:hidden
   on both). Screen-reader-only helpers (.sr-only / .visually-hidden /
   .accesshide) are position:absolute against the viewport, so they stretched
   <html> into a second scroll area that showed an empty strip after the
   footer. Pin them with position:fixed (still read by screen readers, still
   visible when focused).
   ========================================================================== */
.sr-only:not(:focus):not(:focus-within):not(.sr-only-focusable),
.visually-hidden:not(:focus):not(:focus-within):not(.visually-hidden-focusable),
.accesshide:not(:focus):not(:focus-within) {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
}

/* ==========================================================================
   COURSE SETTINGS (desktop) #1 / (mobile) #1 — "Expand all / Collapse all"
   styled as a theme button (red outline pill) instead of a faint grey link.
   Applies to every Moodle form that has this control.
   ========================================================================== */
.collapsible-actions .collapseexpand.btn-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 6px 18px !important;
    border: 1px solid var(--theme-clr-1, #d12626) !important;
    border-radius: 50px !important;
    background: var(--white, #fff);
    color: var(--theme-clr-1, #d12626) !important;
    font-size: 14px !important;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none !important;
    transition: all ease-in-out .3s;
}

.collapsible-actions .collapseexpand.btn-link:hover,
.collapsible-actions .collapseexpand.btn-link:focus {
    background: var(--theme-clr-1, #d12626);
    color: var(--white, #fff) !important;
}

/* ==========================================================================
   COURSE SETTINGS (desktop) #2 — "Format" chooser looks like a real dropdown
   (bordered field + arrow), same as the other select boxes of the form.
   ========================================================================== */
.mform .felement[data-fieldtype="choicedropdown"] .dropdown > .dropdown-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-width: 220px;
    min-height: 40px;
    padding: 6px 16px !important;
    background: var(--white, #fff) !important;
    color: var(--black, #000) !important;
    border: 1px solid #bbb !important;
    border-radius: 50px !important;
    font-size: 15px !important;
    font-weight: 500;
    text-transform: none;
    box-shadow: none;
}

.mform .felement[data-fieldtype="choicedropdown"] .dropdown > .dropdown-toggle::after {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin: 0 0 4px;
    border: solid currentColor !important;
    border-width: 0 2px 2px 0 !important;
    transform: rotate(45deg);
    vertical-align: middle;
}

.mform .felement[data-fieldtype="choicedropdown"] .dropdown > .dropdown-toggle:hover,
.mform .felement[data-fieldtype="choicedropdown"] .dropdown > .dropdown-toggle:focus,
.mform .felement[data-fieldtype="choicedropdown"] .dropdown.show > .dropdown-toggle {
    border-color: var(--theme-clr-1, #d12626) !important;
    color: var(--black, #000) !important;
}

/* ==========================================================================
   COURSE SETTINGS (desktop) #3 — form action buttons: proper gap between
   "Save and display" and "Cancel", Cancel shown as secondary (outline) button,
   and less empty space before the "Required" note.
   ========================================================================== */
.mform [data-groupname="buttonar"] .felement > .w-100 > .d-flex {
    gap: 12px;
}

.mform [data-groupname="buttonar"] .fitem,
.mform [data-groupname="buttonar"] [class*="fitem"] {
    margin-bottom: 0 !important;
}

.mform [data-groupname="buttonar"] {
    margin-bottom: 12px !important;
}

.mform [data-groupname="buttonar"] .btn-cancel input.btn-secondary {
    background: var(--white, #fff) !important;
    color: var(--theme-clr-1, #d12626) !important;
    border: 1px solid var(--theme-clr-1, #d12626) !important;
}

.mform [data-groupname="buttonar"] .btn-cancel input.btn-secondary:hover,
.mform [data-groupname="buttonar"] .btn-cancel input.btn-secondary:focus {
    background: var(--theme-clr-1, #d12626) !important;
    color: var(--white, #fff) !important;
}

/* ==========================================================================
   COURSE SETTINGS (mobile) #2 — space between the file-picker buttons
   (Add / Download / view-mode buttons were touching each other).
   ========================================================================== */
.filemanager-toolbar .fp-toolbar {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.filemanager-toolbar .fp-viewbar.btn-group {
    gap: 8px;
}

@media (max-width: 575.98px) {
    .filemanager-toolbar {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
    }

    .filemanager-toolbar .fp-viewbar.btn-group {
        float: none !important;
    }
}

/* ==========================================================================
   PARTICIPANTS (desktop) #1 / (mobile) #1 — First/Last name initials bar:
   "All" no longer overlaps "A"; every letter is the same round button with a
   small gap; "All"/active letter use the theme red.
   (Also applies to the same initials bar on grader report and other reports.)
   ========================================================================== */
.initialbar .initialbargroups {
    gap: 6px;
    align-items: center;
}

.initialbar .initialbargroups .pagination {
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 6px;
}

.initialbar .pagination .page-item .page-link,
.initialbar .pagination .page-item:first-child .page-link,
.initialbar .pagination .page-item:last-child .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    margin: 0 !important;
    border-radius: 50% !important;
    border: 1px solid #bbb;
    color: #555;
    background: var(--white, #fff);
    font-size: 13px;
    line-height: 1;
}

.initialbar .pagination .page-item.initialbarall .page-link {
    width: auto;
    min-width: 46px;
    padding: 0 14px;
    border-radius: 50px !important;
}

.initialbar .pagination .page-item.active .page-link,
.initialbar .pagination .page-item .page-link:hover {
    background: var(--theme-clr-1, #d12626);
    border-color: var(--theme-clr-1, #d12626);
    color: var(--white, #fff);
}

.initialbar .pagination .page-item.disabled .page-link {
    opacity: 0.45;
}

.initialbar .initialbarlabel {
    margin-bottom: 6px;
}

/* ==========================================================================
   PARTICIPANTS (desktop) #1 "give some space" / (tablet) #2 / (mobile) —
   table: Status column icons stay on one line with right padding, and on
   smaller screens the table scrolls inside its own box instead of squeezing
   every column (or overflowing the page sideways).
   The theme had changed Moodle's .no-overflow wrapper to overflow:visible.
   ========================================================================== */
#page-course-view-participants .userlist .no-overflow {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

#page-course-view-participants #participants td:last-child,
#page-course-view-participants #participants th:last-child {
    white-space: nowrap;
    padding-right: 16px;
}

@media (max-width: 1199.98px) {
    #page-course-view-participants #participants th,
    #page-course-view-participants #participants td {
        white-space: nowrap;
        vertical-align: middle;
    }

    #page-course-view-participants #participants th.c1,
    #page-course-view-participants #participants td.c1 {
        min-width: 200px;
        white-space: normal;
    }
}

/* ==========================================================================
   PARTICIPANTS (tablet) #1 — filter: "Match" select and "Select" field have
   the same width/left edge.
   ========================================================================== */
#page-course-view-participants [data-filterregion="filter"] .row {
    --bs-gutter-x: 0;
    margin-left: 0;
    margin-right: 0;
}

#page-course-view-participants [data-filterregion="filter"] .row > div {
    padding-left: 0;
    padding-right: 0;
}

@media (max-width: 767.98px) {
    #page-course-view-participants [data-filterregion="filter"] .row {
        gap: 8px;
        padding: 12px !important;
    }

    #page-course-view-participants [data-filterregion="filter"] .row > div,
    #page-course-view-participants [data-filterregion="filter"] .row > select,
    #page-course-view-participants [data-filterregion="filter"] .row .custom-select {
        width: 100%;
        max-width: 100%;
        margin: 0 !important;
    }

    #page-course-view-participants [data-filterregion="filter"] [data-filteraction="remove"] {
        margin: 0 auto !important;
    }
}

/* ==========================================================================
   PARTICIPANTS (mobile) #1 — "Add condition / Clear filters / Apply filters"
   organised: Add condition on its own line, the two buttons side by side with
   equal width, text on one line.
   ========================================================================== */
@media (max-width: 575.98px) {
    #page-course-view-participants [data-filterregion="actions"] {
        flex-wrap: wrap;
        gap: 10px;
        align-items: center;
    }

    #page-course-view-participants [data-filterregion="actions"] [data-filteraction="add"] {
        flex: 0 0 100%;
        text-align: left;
        padding-left: 0;
    }

    #page-course-view-participants [data-filterregion="actions"] [data-filteraction="reset"],
    #page-course-view-participants [data-filterregion="actions"] [data-filteraction="apply"] {
        flex: 1 1 0;
        margin: 0 !important;
        white-space: nowrap;
        font-size: 14px !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
}

/* Status cell: badge + info/edit/delete icons on one line */
#page-course-view-participants #participants td:last-child > div {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

#page-course-view-participants [data-filterregion="filter"] .row > select.custom-select,
#page-course-view-participants [data-filterregion="filter"] .row .custom-select {
    padding-left: 12px !important;
    padding-right: 32px !important;
}

/* ==========================================================================
   GRADER REPORT (desktop) #1, (mobile) #1 #2, (tablet) #1 — UI while scrolling.
   Moodle 4.x expects the whole page to scroll sideways for the grader table,
   but this theme sets overflow-x:hidden on <body>, so columns to the right
   could not be reached and the sticky header (offset 60px for Boost's fixed
   navbar, which this theme does not have) left a gap where rows showed above
   it. Now the table scrolls inside its own box (both directions): sticky
   header row + sticky name column work inside it, nothing overlaps.
   ========================================================================== */
.path-grade-report-grader .gradeparent {
    overflow: auto;
    max-height: calc(100vh - 120px);
    max-height: calc(100dvh - 120px);
    -webkit-overflow-scrolling: touch;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.path-grade-report-grader .gradeparent tr.heading {
    top: 0 !important;
}

/* Long activity names in the header: max 3 lines (full name stays in the tooltip) */
.path-grade-report-grader .gradeparent tr.heading .gradeitemheader {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
}

/* The fixed "Show 20" bar must not cover the page footer */
body.path-grade-report-grader.hasstickyfooter #page-footer {
    padding-bottom: 90px;
}

@media (max-width: 767.98px) {
    .path-grade-report-grader .gradeparent {
        max-height: calc(100vh - 160px);
        max-height: calc(100dvh - 160px);
    }
}

/* "Overall average" row: pinned to the bottom of the table box (Moodle offsets
   it by the sticky-footer height, which made it float over the last user row). */
.path-grade-report-grader .gradeparent tr.lastrow.pinned,
.path-grade-report-grader .gradeparent tr.avg {
    bottom: 0 !important;
}

@media (max-width: 767.98px) {
    /* Narrower sticky name column on phones so grade columns are visible next to it */
    .path-grade-report-grader .gradeparent .cell.c0,
    .path-grade-report-grader .gradeparent th.header.user,
    .path-grade-report-grader .gradeparent tr.heading th.header {
        min-width: 160px !important;
        width: 160px !important;
        max-width: 160px !important;
        white-space: normal !important;
    }

    .path-grade-report-grader .gradeparent .cell.c0 a,
    .path-grade-report-grader .gradeparent .cell.c0 .username {
        white-space: normal;
        overflow-wrap: break-word;
        word-break: normal;
    }
}

/* ==========================================================================
   REPORTS (desktop) #1, (mobile) #1 — white content box clearly separated.
   Moodle gives /report/view.php the course-page body id
   (#page-course-view-topics) so the course-page layout rules (no grey gap
   above the card, no inner padding) were applied and the white box merged
   with the white header. Restore the normal in-course spacing used by
   Participants / Grades / Settings. (Real course page uses pagelayout-course,
   so it is not affected.)
   ========================================================================== */
body.pagelayout-incourse:is(#page-course-view-topics, #page-course-view-weeks) #page,
body.pagelayout-incourse:is(#page-course-view-topics, #page-course-view-weeks) .ds-main {
    padding-top: 30px !important;
    padding-bottom: 30px !important;
}

body.pagelayout-incourse:is(#page-course-view-topics, #page-course-view-weeks) .ds-body {
    padding: 20px !important;
}

@media (max-width: 767.98px) {
    body.pagelayout-incourse:is(#page-course-view-topics, #page-course-view-weeks) .ds-body {
        padding: 12px !important;
    }
}

/* ==========================================================================
   QUESTION BANK / all course pages — "More" menu alignment: the active item
   had a check-mark in front of it, so it was out of line with every other
   item. All items now start at the same position; the current page is shown
   in theme red on a light background instead.
   ========================================================================== */
.secondary-navigation .moremenu .dropdown-menu .dropdown-item[aria-current="true"]::before,
.secondary-navigation .moremenu .dropdown-menu .dropdown-item.active::before {
    content: none !important;
    display: none !important;
}

.secondary-navigation .moremenu .dropdown-menu .dropdown-item {
    padding: 6px 18px;
}

.secondary-navigation .moremenu .dropdown-menu .dropdown-item.active,
.secondary-navigation .moremenu .dropdown-menu .dropdown-item[aria-current="true"] {
    color: var(--theme-clr-1, #d12626) !important;
    background-color: #fbeaea !important;
    font-weight: 600;
}

.secondary-navigation .moremenu .dropdown-menu .dropdown-item:hover,
.secondary-navigation .moremenu .dropdown-menu .dropdown-item:focus {
    color: var(--white, #fff) !important;
    background-color: var(--theme-clr-1, #d12626) !important;
}

/* ==========================================================================
   SITE ADMIN > PLUGINS (desktop) #1, (mobile) #1 — link list alignment.
   Sub-items were indented only 8px and every link was the same faint grey,
   so levels did not line up visually. Clear indent per level with a guide
   line, darker readable links, category links emphasised.
   ========================================================================== */
:is(#page-admin-search, #page-admin-category) .tab-pane .list-unstyled > li > a {
    display: inline-block;
    padding: 3px 0;
    color: #333;
    line-height: 1.4;
}

:is(#page-admin-search, #page-admin-category) .tab-pane .list-unstyled > li > a:hover {
    color: var(--theme-clr-1, #d12626);
    text-decoration: underline;
}

:is(#page-admin-search, #page-admin-category) .tab-pane .list-unstyled .list-unstyled {
    margin: 2px 0 6px 6px !important;
    padding-left: 16px;
    border-left: 2px solid #e5e5e5;
}

/* a link that is followed by a nested list is a category: show it bolder */
:is(#page-admin-search, #page-admin-category) .tab-pane .list-unstyled > li:has(+ li > .list-unstyled) > a {
    font-weight: 600;
    color: #000;
}

:is(#page-admin-search, #page-admin-category) .tab-pane .row > [class*="col-sm-3"] h4 {
    margin-top: 3px;
}

@media (max-width: 575.98px) {
    :is(#page-admin-search, #page-admin-category) .tab-pane .row > [class*="col-sm-3"] h4 {
        margin-bottom: 8px;
    }

    :is(#page-admin-search, #page-admin-category) .tab-pane .list-unstyled .list-unstyled {
        padding-left: 12px;
    }
}

/* ==========================================================================
   PLUGIN INSTALLER (tablet/mobile) #1 — "Give some space": label, "Choose a
   file" button, drop zone and "Accepted file types" were touching, and the
   drop-zone text overflowed its dashed box (fixed height). Applies to every
   single-file picker in Moodle forms.
   ========================================================================== */
.felement[data-fieldtype="filepicker"] .filepicker-filelist {
    margin-top: 10px;
}

.felement[data-fieldtype="filepicker"] .filepicker-filelist .filepicker-container,
.felement[data-fieldtype="filemanager"] .filemanager-container .dndupload-message {
    height: auto !important;
    min-height: 130px;
    padding-bottom: 14px !important;
}

.felement[data-fieldtype="filepicker"] .dndupload-message {
    padding: 0 12px;
    line-height: 1.4;
}

.felement[data-fieldtype="filepicker"] fieldset > p,
.felement[data-fieldtype="filepicker"] .filepicker-filelist ~ p,
.felement[data-fieldtype="filemanager"] fieldset > p {
    margin-top: 12px;
    margin-bottom: 6px;
}

@media (max-width: 767.98px) {
    .mform .fitem > .col-form-label {
        margin-bottom: 8px;
    }
}

/* the drop zone inside is absolutely positioned, so the frame needs an explicit height */
.felement[data-fieldtype="filepicker"] .filepicker-filelist {
    height: 162px !important;
}

/* ==========================================================================
   QUIZ SETTINGS (desktop) #1, (mobile) #1 "on all pages", DEBUGGING #1 —
   overlapping / non-working extra arrow next to dropdowns.
   Moodle wraps admin-setting selects in <div class="form-select">; the theme's
   Bootstrap 5 stylesheet styles .form-select as a select box, so a second box
   with a dead chevron was drawn around the real dropdown. Reset the wrapper.
   ========================================================================== */
div.form-select {
    display: inline-block;
    width: auto;
    max-width: 100%;
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
    box-shadow: none !important;
    min-height: 0;
    vertical-align: middle;
}

div.form-select > select.custom-select {
    max-width: 100%;
}

/* QUIZ SETTINGS #1 — unit selects ("minutes", "hours", "days") need room for the arrow */
.fdurationelement select.custom-select,
.form-setting .form-duration select.custom-select,
select.custom-select[id$="_unit"],
select.custom-select[name$="[timeunit]"],
select.custom-select[name$="_u"],
select.custom-select[name$="[u]"] {
    min-width: 110px;
    padding-right: 32px !important;
}

@media (max-width: 575.98px) {
    div.form-select,
    div.form-select > select.custom-select {
        width: 100%;
    }
}

/* ==========================================================================
   SEB SETTINGS (tablet) #1, DEBUGGING (desktop) #2 — admin "Save changes":
   text stays on one line (the narrow col-sm-3 made it wrap on tablets) and the
   button sits a little lower, aligned with the settings column.
   ========================================================================== */
#adminsettings .settingsform > .row > .offset-sm-3.col-sm-3 {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
    margin-top: 24px;
    padding-top: 16px;
}

#adminsettings .settingsform > .row > .offset-sm-3.col-sm-3 .btn {
    white-space: nowrap;
}

/* ==========================================================================
   SEB TEMPLATES (desktop + mobile) #1 — "Add new template" button was glued to
   the "Nothing to display" box. Space below single action buttons.
   ========================================================================== */
#region-main .singlebutton {
    margin-bottom: 16px;
}

#page-mod-quiz-accessrule-seb-template #region-main .alert {
    border-radius: 10px;
}

/* ==========================================================================
   COURSE PAGE (mobile) — additional, found during the all-pages review:
   "Collapse all / Expand all" touched the first section title. On phones it
   gets its own line, right-aligned, above the title.
   ========================================================================== */
@media (max-width: 575.98px) {
    html body.path-course-view:is(#page-course-view-topics, #page-course-view-weeks) .course-section-header:has(.section-collapsemenu) {
        flex-wrap: wrap !important;
    }

    html body.path-course-view:is(#page-course-view-topics, #page-course-view-weeks) .course-section-header > .flex-fill:has(> .section-collapsemenu) {
        order: -1;
        flex: 0 0 100% !important;
        width: 100%;
        margin: 0 0 4px !important;
        justify-content: flex-end;
    }

    body.path-course-view .section-collapsemenu {
        white-space: nowrap;
        font-size: 13px;
    }
}
