/* LMIS visual theme. Loaded after the shared component styles. */
:root {
    font-size: 100%;
    --lm-ink: #142641;
    --lm-muted: #536682;
    --lm-line: #d7e3ef;
    --lm-surface: #fff;
    --lm-wash: #edf5fa;
    --lm-navy: #102744;
    --lm-blue: #1855a1;
    --lm-teal: #007c75;
    --lm-focus: #007f89;
    --lm-radius: 1rem;
    --lm-shadow: 0 2px 4px #122b4910, 0 14px 34px #122b4910;
    --lm-lift: 0 5px 9px #122b4917, 0 20px 38px #122b4922;
    --lm-hero: radial-gradient(ellipse at 88% 0%, #2d91a252, transparent 58%), linear-gradient(120deg, #254b77, #32638a 70%, #27667e);
}

body {
    --lm-font-ui: Arial, Helvetica, sans-serif;
    --bs-body-font-family: var(--lm-font-ui);
    font-family: var(--lm-font-ui);
    --bs-body-color: var(--lm-ink);
    --bs-link-color: var(--lm-blue);
    --bs-link-hover-color: #0a427e;
    color: var(--lm-ink);
    background: radial-gradient(ellipse at 88% 0%, #d6efed 0, transparent 32rem),
                linear-gradient(145deg, #eef4fb, #f8fbfd 55%, #edf5fa);
    background-attachment: fixed;
}

body[dir="rtl"] { --lm-font-ui: Tahoma, Arial, sans-serif; }
body :is(.form-control, .form-select, .custom-card-header-title, .label-with-icon) {
    font-family: var(--lm-font-ui);
}
body[dir="rtl"] :is(.discussion-rich-text, .discussion-feed-card) [dir="ltr"] {
    font-family: Arial, Helvetica, sans-serif;
}
body :is(a, button, input, select, textarea, [tabindex]:not(h1, h2, h3, h4, h5, h6)):focus-visible {
    outline: 2px solid var(--lm-focus);
    outline-offset: 3px;
}

.page-wrapper .row.flex-nowrap > .col { min-inline-size: 0; }
.page-wrapper .text-muted { color: var(--lm-muted) !important; }

/* Public and signed-in navigation. */
body .top-nav-bar {
    background: #fafffff2;
    border-block-end: 1px solid var(--lm-line);
    box-shadow: 0 5px 24px #0d294b13;
    backdrop-filter: blur(16px);
}
body .top-nav-bar .nav-link {
    color: var(--lm-ink);
    border-radius: .75rem;
    font-weight: 600;
    padding-inline: .85rem;
}
body .top-nav-bar .nav-link:is(:hover, .active, :focus-visible) {
    background: #e3f2f5;
    color: #0d5b68;
}
body .nav-container {
    background: linear-gradient(170deg, #fff 5%, #eaf4fc);
    border-color: var(--lm-line) !important;
    box-shadow: 5px 0 28px #10274412;
}
body[dir="rtl"] .nav-container { box-shadow: -5px 0 28px #10274412; }
body #admin-side-bar { gap: .13rem; padding: .65rem; }
body #admin-side-bar .nav-link {
    gap: .25rem;
    color: var(--lm-ink);
    font-weight: 600;
    padding: .55rem .72rem;
    border-radius: .75rem !important;
    border: 1px solid transparent;
    transition: background-color .18s ease, box-shadow .18s ease;
}
body #admin-side-bar .nav-link:is(:hover, :focus-visible) { background: #dfedf7; }
body #admin-side-bar .nav-link.active {
    color: #fff;
    background: linear-gradient(125deg, #163d75, #086d77);
    border-color: #155c77;
    box-shadow: 0 5px 13px #164a7039;
}
body #admin-side-bar .nav-link.active img { filter: brightness(0) invert(1); }
body #admin-side-bar .nav-link img { inline-size: 1.15rem; block-size: 1.15rem; object-fit: contain; }
body #nav-collapse-button { background: #fff; box-shadow: var(--lm-shadow); }
body #offcanvasResponsive { background: #f5faff; border-color: var(--lm-line); }
body .footer {
    background: var(--lm-hero) !important;
    border-block-start: 2px solid #30c4b8;
    min-block-size: 3rem;
    block-size: auto;
    padding: .65rem 1rem;
    color: #e4f3fa !important;
}

/* Dashboard, report index, settings and course cards. */
body .db-page { background: transparent; }
body .db-platform-bar { border-radius: .8rem; background: #e5f2f9; color: var(--lm-navy); }
body .db-hero, body .page-cover-container {
    background: var(--lm-hero);
    border-radius: clamp(.8rem, 2vw, 1.5rem);
    box-shadow: var(--lm-lift);
}
body .db-hero {
    isolation: isolate;
    overflow: hidden;
    color: white;
}
body .db-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: repeating-linear-gradient(125deg, transparent 0 36px, #ffffff0c 37px 38px);
    mask-image: linear-gradient(90deg, transparent, #000);
}
body .db-card,
body .settings-card,
body .card:not(.custom-table-head, .custom-table-head-placeholder, .custom-table-body-placeholder) {
    border-radius: var(--lm-radius) !important;
    border-color: var(--lm-line);
    box-shadow: var(--lm-shadow);
}
body .db-card {
    background: linear-gradient(150deg, #fff 52%, #eef7fb);
    border-block-end: 3px solid #b8d5e5;
}
body .db-value { color: var(--lm-navy); font-variant-numeric: tabular-nums; }
body .db-user-stats .db-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-inline: clamp(.65rem, 1.2vw, 1rem);
}
body .db-user-stats .db-label { flex: 1; }
body .db-section-rule { background: linear-gradient(90deg, #8bc7d0, #dce8f3); }
body .settings-card .img-container, body .db-icon {
    border-radius: .8rem;
    box-shadow: inset 0 1px 1px #fff9, 0 4px 9px #1237571c;
}
body .settings-card .img-container { background: linear-gradient(135deg, #eaf5ff, #d7f2ef); }
body :is(.settings-card, .db-card, .card.custom-table-body) {
    transition: box-shadow .2s ease, translate .2s ease, border-color .2s ease;
}
@media (hover: hover) and (pointer: fine) {
    body :is(.settings-card, .db-card-link .db-card, .card.custom-table-body):hover {
        translate: 0 -3px;
        box-shadow: var(--lm-lift);
        border-color: #b9d7e6;
    }
}

/* Report filters, tables, paging and detail tabs. */
body :is(.filters-form, .actions, .admin-list-search .filter-form) {
    border-radius: var(--lm-radius);
    border: 1px solid var(--lm-line);
    background: var(--lm-surface);
    box-shadow: var(--lm-shadow);
}
body .filters-form { padding: clamp(.8rem, 2.5vw, 1.5rem); }
body .filters-form > .row { margin-inline: 0; }
body .table-responsive { border-radius: var(--lm-radius); }
body :is(.quickgrid, .table) {
    --bs-table-color: var(--lm-ink);
    --bs-table-bg: #fff;
    --bs-table-striped-bg: #f2f7fb;
    --bs-table-hover-bg: #e6f3f6;
    --bs-table-border-color: #dce7f1;
}
body :is(.quickgrid, .table) thead th {
    background-color: #dcebf5;
    color: #173858;
    border-block-end: 1px solid #bdcedf;
}
body :is(.quickgrid, .table) td { border-color: #e0eaf2; }
body :is(.quickgrid, .table) tbody tr:hover > td { background-color: #eaf6f9; }
body .card.custom-table-head { background: #dcebf5; color: #173858; border-radius: .85rem; }
body .card.custom-table-body { border-inline-start: 4px solid #4d9eaf; border-inline-end: 0; }
body .pagination .page-link { color: var(--lm-blue); border-color: var(--lm-line); }
body .pagination .active > .page-link { background: var(--lm-blue); color: #fff; }
body :is(.details-nav ul, ul.details-nav, ul.community-tabs) {
    gap: .25rem;
    padding: .3rem;
    background: #fff;
    border: 1px solid var(--lm-line);
    border-radius: var(--lm-radius);
    box-shadow: var(--lm-shadow);
    max-inline-size: 100%;
    flex-wrap: wrap;
}
body :is(.details-nav, ul.community-tabs) :is(a, button).active {
    background-color: #ddf0f1 !important;
    color: #145365 !important;
}
body .page-cover-container .image { border-radius: inherit; }
body .page-cover-container .title { inset-inline: .9rem; width: auto; text-shadow: 0 2px 8px #091d38; }
body .go-previous-page { color: var(--lm-blue); font-weight: 600; }
body .go-previous-page:hover { color: var(--lm-teal); }

/* Forms and controls, including the component library's Select2 fields. */
body :is(.btn, .form-control, .form-select, .sk-select, .sk-multi-select, .lp-input) {
    border-radius: .7rem !important;
}
body :is(.btn-primary, .btn-tertiary) {
    --bs-btn-color: white;
    --bs-btn-bg: #1855a1;
    --bs-btn-border-color: #1855a1;
    --bs-btn-hover-color: white;
    --bs-btn-hover-bg: #0a626c;
    --bs-btn-hover-border-color: #0a626c;
    --bs-btn-active-color: white;
    --bs-btn-active-bg: #104657;
    --bs-btn-active-border-color: #104657;
    box-shadow: 0 4px 10px #1855a12b;
}
body .btn-outline-secondary {
    --bs-btn-color: #244762;
    --bs-btn-border-color: #a4bdd1;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #244762;
    --bs-btn-hover-border-color: #244762;
}
body .btn { transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease; }
body .btn:active:not(:disabled) { box-shadow: inset 0 2px 5px #122b4933; }
body :is(.form-control, .form-select, .sk-select, .sk-multi-select):not(.invalid, :disabled) {
    border-color: #bdcfe0;
}
body :is(.form-control, .form-select, .sk-select, .sk-multi-select):focus {
    border-color: var(--lm-focus);
    box-shadow: 0 0 0 .22rem #007f8926;
}
body .select2-container--default :is(.select2-selection--single, .select2-selection--multiple) {
    border: 1px solid #bdcfe0;
    border-radius: .7rem;
}
body :is(.dropdown-menu, .modal-content, .popover) {
    border-radius: var(--lm-radius);
    border-color: var(--lm-line);
    box-shadow: var(--lm-lift);
}
body .dropdown-item:is(:hover, :focus) { background: #e7f3f9; color: var(--lm-ink); }
body .upload-area { background: linear-gradient(145deg, #f8fcff, #e9f7f7); border-color: #649eae !important; }
body .upload-area:focus-within { outline: 2px solid var(--lm-focus); }
body .progress { border-radius: 2rem; background-color: #dbe8f1; }
body .fc {
    --fc-border-color: var(--lm-line);
    --fc-button-bg-color: var(--lm-blue);
    --fc-button-border-color: var(--lm-blue);
    --fc-button-hover-bg-color: var(--lm-teal);
    --fc-today-bg-color: #ddf4ef;
}
body .fc .fc-view-harness { background: white; box-shadow: var(--lm-shadow); }

/* Public landing and sign-in use the same palette and elevation. */
body .landing-page-part1 {
    background: var(--lm-hero);
    color: #f5fbff;
    position: relative;
    isolation: isolate;
}
body .landing-page-part1 :is(.welcome-msg, .intro) { color: #f5fbff; }
body .landing-page-part1 :is(.pattern1-img, .pattern2-img) { opacity: .22; }
body .landing-page-part1 .item2 img {
    filter: drop-shadow(0 20px 22px #06162d80);
    animation: lm-hero-in .8s cubic-bezier(.2,.7,.3,1) both;
}
body .landing-page-part1 .btn-primary {
    --bs-btn-bg: #0b8078;
    --bs-btn-border-color: #1ca999;
}
body :is(.landing-page-part2, .landing-page-part4, .landing-page-part6) { background: #f7fbff; }
body :is(.landing-page-part3, .landing-page-part5) { background: #eaf4f8; }
body .landing-page-part2 :is(.img1, .img2, .img34) { border-radius: 1rem; box-shadow: var(--lm-lift); }
body .landing-page-part3 .title { color: var(--lm-teal); }
body .lp-brand { background: var(--lm-hero); }
body .lp-form-panel { background: linear-gradient(145deg, #e8f3fa, #f9fcfd 70%); }
body .lp-form-box {
    background: #fff;
    border: 1px solid var(--lm-line);
    border-radius: 1.35rem;
    box-shadow: var(--lm-lift);
    padding: clamp(1.15rem, 3vw, 2.4rem);
}
body #Button_Login { background: linear-gradient(115deg, #1855a1, #00766e); }

@keyframes lm-hero-in {
    from { opacity: 0; transform: perspective(900px) translateY(18px) rotateX(8deg); }
    to { opacity: 1; transform: perspective(900px) translateY(0) rotateX(0); }
}
@media (max-width: 767.98px) {
    body .top-nav-bar .navbar-brand { margin-inline: .75rem !important; }
    body .create-new-page { margin-inline: 1rem; }
    body .create-new-page .card { padding: clamp(1rem, 5vw, 2rem); }
    body .fc .fc-toolbar { flex-wrap: wrap; gap: .65rem; }
    body .lp-form-box { box-sizing: border-box; max-inline-size: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    body :is(.landing-page-part1 .item2 img, .db-card, .settings-card, .btn, #admin-side-bar .nav-link, .card.custom-table-body) {
        animation: none !important;
        transition: none !important;
        translate: none !important;
    }
}
@media print {
    body { background: white; }
    body :is(.db-card, .card, .table-responsive, .filters-form) { box-shadow: none; }
}

/* Raised dashboard ornament, built from the existing decorative circles. */
body .db-hero-circles {
    opacity: .8;
    perspective: 700px;
    transform: translateY(-50%) rotate(-16deg);
    pointer-events: none;
}
body .db-hero-circles span {
    border: 1px solid #93e9df77;
    border-radius: 27%;
    background: linear-gradient(150deg, #c4fbf23d, #2bb5ab22 56%, #0830555e);
    box-shadow: inset 0 1px 1px #e5fffab3, 0 8px 0 #103d57, 0 16px 22px #07193060;
}
body .db-hero-circles span:nth-child(2) { transform: translateY(17px) rotate(14deg); }
body .db-hero-circles span:nth-child(3) { transform: translateY(-19px) rotate(27deg); }
body .db-card:hover { transform: none; }
body .db-hero .db-hero-badge {
    z-index: 1;
    background: #254b77e6;
    border-color: #8ad1d662;
    box-shadow: inset 0 1px 0 #ffffff24;
}
@media (max-width: 767.98px) {
    body .db-hero-circles { opacity: .23; }
}

/* Sign-in, messaging and discussion surfaces. */
body .lp-logo-link {
    display: inline-grid;
    place-items: center;
    padding: .8rem 1.15rem;
    border-radius: .95rem;
    border: 1px solid #ffffffb3;
    background: linear-gradient(145deg, #fff, #eef5fa);
    box-shadow: 0 4px 0 #d0e2ee, 0 14px 26px #183a593b;
}
body .lp-logo { display: block; max-inline-size: 100%; height: auto; }
body .lp-form-panel {
    background: radial-gradient(ellipse at 75% 13%, #d7ebf6, transparent 60%),
                linear-gradient(155deg, #f7fbff, #e7f5f4);
}
body .lp-form-box {
    max-inline-size: 30rem;
    padding: clamp(1.1rem, 3.5vw, 2.55rem);
    border-radius: 1.6rem;
    background: linear-gradient(165deg, #fff 62%, #f4f9fd);
    box-shadow: inset 0 1px 0 #fff, 0 5px 0 #d9e8f3, var(--lm-lift);
}
body .lp-form-header { margin-block-end: 1.8rem; }
body .lp-form-title {
    font-size: clamp(1.22rem, 2.25vw, 1.65rem);
    line-height: 1.55;
    margin-block: .35rem .2rem;
    text-wrap: balance;
}
body .lp-form-subtitle { color: var(--lm-muted); line-height: 1.7; }
body .lp-form-icon, body .messaging-heading-icon {
    background: linear-gradient(145deg, #3169a7, #176c81);
    box-shadow: inset 0 1px 1px #ffffff60, 0 4px 0 #174a72, 0 9px 18px #3169a749;
}
body .lp-input:focus { border-color: var(--lm-focus); box-shadow: 0 0 0 .22rem #007f8926; }

body .messaging-page {
    max-inline-size: 72rem;
    margin: clamp(1rem, 4vw, 3rem) auto;
    padding-inline: clamp(.75rem, 3vw, 2rem);
}
body .messaging-heading {
    display: flex;
    align-items: center;
    gap: 1.15rem;
    padding: clamp(1rem, 3vw, 2rem);
    margin-block-end: 1.3rem;
    border: 1px solid #bbd4e6;
    border-radius: 1.35rem;
    background: radial-gradient(ellipse at 95% 5%, #d7efee, transparent 60%), linear-gradient(140deg, #fff, #e5f0fb);
    box-shadow: inset 0 1px 0 #fff, 0 4px 0 #cbdfea, var(--lm-shadow);
}
body .messaging-heading h1 { margin: 0; color: var(--lm-navy); font-weight: 750; font-size: clamp(1.35rem, 3vw, 2rem); }
body .messaging-heading-icon {
    display: grid;
    place-items: center;
    flex: 0 0 3rem;
    block-size: 3rem;
    border-radius: .85rem;
    color: white;
}
body .messaging-heading-icon svg { inline-size: 1.5rem; block-size: 1.5rem; }
body .messaging-card {
    background: linear-gradient(155deg, #fff 50%, #f3f9fd);
    border-radius: 1.35rem !important;
    box-shadow: 0 5px 0 #e0eaf3, var(--lm-lift) !important;
}
body .messaging-card .card-body { padding: clamp(1rem, 3.4vw, 2.3rem); }
body .messaging-recipient-options { display: flex; flex-wrap: wrap; gap: .65rem; }
body .messaging-recipient-options .form-check {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin: 0;
    padding: .48rem .75rem;
    border: 1px solid #c8dbe9;
    border-radius: .8rem;
    background: #f6faff;
    box-shadow: 0 2px 0 #e4edf5;
}
body .messaging-recipient-options .form-check-input { float: none; margin: 0; flex: 0 0 auto; }
body .messaging-recipient-options .form-check-label { cursor: pointer; }
body .messaging-recipient-options .form-check:has(:checked) { border-color: #64a0b1; background: #e1f3f5; color: #134f63; }
body .messaging-members { background: #f0f7fb; box-shadow: inset 0 1px 3px #183a5910; }
body .messaging-card .form-control { background-color: #fbfdff; }
body .messaging-card textarea { resize: vertical; }
body .messaging-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .65rem; }
body .messaging-actions .btn { min-inline-size: min(9rem, 100%); }

/* Post cards and indented replies are separate surfaces. */
body .discussion-thread {
    margin: clamp(1rem, 3vw, 2.3rem) auto;
    max-inline-size: none;
    padding-inline: clamp(.75rem, 2vw, 1.75rem);
}
body :is(.discussion-post-card, .discussion-feed-card) {
    min-inline-size: 0;
    padding: clamp(1rem, 2.6vw, 1.8rem);
    border: 1px solid #c2d7ea;
    border-block-start: 4px solid #3875ad;
    border-radius: 1.2rem;
    background: linear-gradient(155deg, #fff 60%, #f0f7fe);
    box-shadow: 0 4px 0 #dce9f4, var(--lm-shadow);
    overflow-wrap: anywhere;
}
body .discussion-feed-card { margin-block-end: 1rem; }
body .discussion-author { gap: .65rem; }
body .discussion-author > img { object-fit: cover; box-shadow: 0 0 0 3px #e0edf7; flex-shrink: 0; }
body .discussion-author > div { min-inline-size: 0; }
body .discussion-author-name { font-weight: 700; }
body .discussion-post-title { font-size: clamp(1.25rem, 2.8vw, 1.85rem); margin-block: .4rem .65rem; }
body .discussion-thread .discussion-rich-text { min-inline-size: 0; overflow-wrap: anywhere; line-height: 1.7; }
body .discussion-thread .discussion-rich-text :is(img, video) { max-inline-size: 100%; height: auto; }
body .discussion-thread .discussion-rich-text :is(pre, table) { display: block; max-inline-size: 100%; overflow-x: auto; }
body .discussion-count {
    display: inline-block;
    background: #e3eff8;
    color: #28506f;
    padding: .25rem .75rem;
    border-radius: 2rem;
    font-size: .85rem;
}
body .discussion-replies:empty { display: none; }
body .discussion-replies {
    display: grid;
    gap: .85rem;
    margin-block: 1.2rem;
    margin-inline-start: clamp(.35rem, 3vw, 2.35rem);
    padding-inline-start: clamp(.55rem, 2vw, 1rem);
    border-inline-start: 2px solid #a1c7ce;
}
body .discussion-reply {
    position: relative;
    min-inline-size: 0;
    padding: clamp(.8rem, 2vw, 1.25rem);
    border: 1px solid #bcdadf;
    border-radius: 1rem;
    background: linear-gradient(145deg, #f0faf9, #fff);
    box-shadow: 0 3px 0 #dfefee, 0 7px 18px #183a5912;
    overflow-wrap: anywhere;
}
body .discussion-reply::before {
    content: "";
    position: absolute;
    inset-inline-end: 100%;
    inset-block-start: 2rem;
    inline-size: clamp(.55rem, 2vw, 1rem);
    border-block-start: 2px solid #a1c7ce;
    pointer-events: none;
}
body .discussion-reply .discussion-author > img { box-shadow: 0 0 0 3px #d1ebe8; }
body .discussion-thread .discussion-post-actions { flex-wrap: wrap; }
body .discussion-composer {
    margin-block-start: 1.15rem;
    padding: clamp(.85rem, 2vw, 1.25rem);
    border: 1px solid #c2d7ea;
    border-radius: 1rem;
    background: #edf6fc;
    box-shadow: var(--lm-shadow);
}
body .discussion-composer textarea { min-block-size: 5rem; resize: vertical; }
body .discussion-composer-actions { display: flex; justify-content: flex-end; margin-block-start: .75rem; }
body .discussion-index-filters > form {
    padding: clamp(.75rem, 2vw, 1.25rem);
    border: 1px solid var(--lm-line);
    border-radius: var(--lm-radius);
    background: #fff;
    box-shadow: var(--lm-shadow);
}
body .discussion-index-filters > form > .row { margin-inline: 0; }

@media (max-width: 575.98px) {
    body .messaging-actions > .btn { flex: 1 1 7rem; }
    body .discussion-thread .discussion-post-actions { justify-content: start; }
}


/* Desktop rail follows the page. Keep account controls outside the scrolling links. */
@media (min-width: 768px) {
    .page-wrapper > .admin-workspace,
    .admin-workspace > .admin-workspace-inner {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
    }

    .admin-workspace .admin-workspace-row { flex: 1 1 auto; }
    .admin-workspace .admin-workspace-rail {
        background: linear-gradient(155deg, #f7fbff, #e8f2f9);
        border-inline-end: 1px solid #cfdfec;
    }

    body .admin-workspace-rail .admin-rail-panel {
        position: sticky;
        inset-block-start: 0;
        z-index: 12;
        display: flex !important;
        flex-direction: column;
        inline-size: clamp(11rem, 16vw, 15rem);
        max-block-size: 100vh;
        max-block-size: 100dvh;
        padding: .55rem !important;
        background: transparent;
        box-shadow: none;
    }

    body .admin-workspace-rail .admin-rail-panel.is-collapsed { inline-size: 4.35rem; }

    .admin-rail-panel > .container-fluid,
    .admin-rail-panel > .container-fluid > .row,
    .admin-rail-panel > .container-fluid > .row > .col-auto {
        display: contents !important;
    }

    .admin-rail-panel #sidebar {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        min-block-size: 0;
        margin-inline: 0 !important;
    }

    .admin-rail-panel #sidebar-nav { min-block-size: 0; }

    body .admin-rail-panel #admin-side-bar {
        display: block;
        min-block-size: 0;
        overflow-y: auto;
        overscroll-behavior-block: contain;
        scrollbar-width: thin;
        padding: .55rem .25rem;
    }

    .admin-rail-panel #admin-side-bar .nav-link { margin-block: .15rem; }
    .admin-rail-panel.is-collapsed #admin-side-bar .nav-link { justify-content: center; padding-inline: .25rem; }
    .admin-rail-panel #admin-side-bar .nav-link > span.show { min-inline-size: 0; overflow-wrap: anywhere; white-space: normal; }
    .admin-rail-panel #sidebar-nav > .row { margin-inline: 0; }
    .admin-rail-panel #sidebar-nav > .row img { max-inline-size: 100%; }
    .admin-rail-panel .admin-rail-toggle { display: flex; justify-content: flex-end; padding: 0 !important; }
    .admin-rail-panel.is-collapsed .admin-rail-toggle { justify-content: center; }
    body .admin-rail-panel #nav-collapse-button {
        position: static;
        box-shadow: inset 0 1px 0 #fff, 0 2px 6px #17385819;
        border: 1px solid #d1e2ef;
    }
    .admin-rail-panel #sidebar-nav > hr { margin: .3rem 0; opacity: .15; }
    .admin-rail-panel .admin-rail-account {
        flex: 0 0 auto;
        padding: .42rem;
        border: 1px solid #d7e5f0;
        border-radius: .85rem;
        background: #f9fcff;
        box-shadow: 0 2px 0 #dbe8f3;
    }
    .admin-rail-panel .admin-rail-account .col { min-inline-size: 0; padding-inline: 0; }
    .admin-rail-panel .admin-rail-account a[href="/home/profile"] { min-inline-size: 0; }
    .admin-rail-panel .admin-rail-account a[href="/home/profile"] > span { min-inline-size: 0; overflow-wrap: anywhere; }
    .admin-rail-panel .admin-rail-account a[href="/home/profile"] > img { inline-size: 2rem; block-size: 2rem; flex: 0 0 auto; object-fit: cover; }
    .admin-rail-panel.is-collapsed .admin-rail-account .col-1 { inline-size: auto; gap: .4rem; }
    .admin-rail-panel.is-collapsed .admin-rail-account .d-flex > .d-flex { gap: .45rem; }
}

/* Give discussion cards the full reading column, with a shallow reply inset. */
body :is(.discussion-post-card, .discussion-feed-card) {
    border-block-start: 1px solid #c2d7ea;
    border-inline-start: 5px solid #3b78ad;
    background: radial-gradient(ellipse at 95% 0%, #e5f1fc, transparent 44%),
                linear-gradient(155deg, #fff 66%, #f2f8fe);
    box-shadow: inset 0 1px 0 #fff, 0 5px 0 #dce9f4, var(--lm-shadow);
}
body .discussion-replies {
    margin-inline-start: clamp(.2rem, 1vw, .85rem);
    gap: 1rem;
}
body .discussion-reply {
    border-inline-start: 3px solid #71b4b2;
    background: linear-gradient(145deg, #eaf8f6, #fff 70%);
    box-shadow: inset 0 1px 0 #fff, 0 4px 0 #dfefee, 0 9px 20px #183a5915;
}
body .discussion-composer { box-shadow: inset 0 1px 0 #fff, 0 4px 0 #dce9f4, var(--lm-shadow); }

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    body .discussion-feed-card { transition: box-shadow .18s ease, translate .18s ease; }
    body .discussion-feed-card:focus-within,
    body .discussion-feed-card:hover { translate: 0 -2px; box-shadow: var(--lm-lift); }
}


/* Course and session materials */
body .materials-library {
    --material-accent: #18588d;
    --material-line: #d2e3ef;
    min-inline-size: 0;
}
body .materials-toolbar { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .65rem; margin-block: 1.25rem .85rem; }
body .materials-toolbar .btn,
body .material-dialog .btn { min-block-size: 2.65rem; font-weight: 650; }
body .materials-toolbar .btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding-inline: 1rem; }
body .materials-toolbar .btn img { inline-size: 1.15rem; block-size: 1.15rem; margin: 0 !important; }
body .materials-picker {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .6rem;
    max-inline-size: 35rem;
    margin-inline-start: auto;
    margin-block-end: 1.25rem;
    padding: .7rem;
    background: #fff;
    border: 1px solid var(--material-line);
    border-radius: 1.1rem;
    box-shadow: 0 4px 0 #deebf4, var(--lm-shadow);
}
body .materials-picker[hidden] { display: none; }
body .material-choice {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: .55rem;
    inline-size: 100%;
    min-block-size: 5.5rem;
    padding: .55rem .3rem;
    color: #1f4464;
    font-weight: 650;
    background: linear-gradient(145deg, #f7fbff, var(--material-tint, #e4f0fc));
    border: 1px solid var(--material-line);
    box-shadow: 0 3px 0 #dceaf5;
    overflow-wrap: anywhere;
}
body .material-choice:hover { background: var(--material-tint, #e4f0fc); border-color: #83adcc; color: #173858; }
body .material-choice img { inline-size: 1.6rem; block-size: 1.6rem; object-fit: contain; }
body .material-choice--link { --material-tint: #e3f5f0; }
body .material-choice--video { --material-tint: #efebfa; }

body .materials-library .nav-tabs {
    padding: .35rem;
    gap: .3rem;
    border: 1px solid var(--material-line);
    border-radius: 1rem;
    background: #fff;
    box-shadow: var(--lm-shadow);
}
body .materials-library .nav-tabs .nav-link {
    border: 1px solid transparent;
    border-radius: .7rem;
    color: #365770;
    font-weight: 650;
    margin: 0;
}
body .materials-library .nav-tabs .nav-link:hover { background: #eff7fb; }
body .materials-library .nav-tabs .nav-link.active {
    background: linear-gradient(135deg, #e2f0fb, #dff3f1);
    border-color: #b8d8e6;
    color: #16496b;
}
body .materials-library .materials-grid {
    width: 100%;
    table-layout: fixed;
    border-spacing: 0 .7rem;
}
body .materials-library .materials-grid tbody::before { content: none; }
body .materials-library .materials-grid :is(th, td) { padding: .7rem; }
body .materials-library .materials-grid th {
    position: static;
    z-index: auto;
    border: 0;
    background: #deecf6;
    color: #274e6c;
}
body .materials-library .materials-grid :is(th, td):last-child { inline-size: 3.5rem; text-align: center; }
body .materials-library .materials-grid tbody tr {
    box-shadow: 0 3px 0 #dce8f2, var(--lm-shadow) !important;
    border-radius: .85rem;
}
body .materials-library .materials-grid tbody td {
    background: #fff;
    border-block: 1px solid var(--material-line);
    vertical-align: middle;
    color: #335470;
    overflow-wrap: anywhere;
}
body .materials-library .materials-grid tbody tr:hover > td { background: #f6fbfe; }
body .materials-library .materials-grid :is(th, td):first-child { border-radius: 0; border-start-start-radius: .85rem; border-end-start-radius: .85rem; }
body .materials-library .materials-grid :is(th, td):last-child { border-radius: 0; border-start-end-radius: .85rem; border-end-end-radius: .85rem; }
body[dir] .materials-library .materials-grid tbody td:first-child { border-inline-start: 3px solid #699bc2; }
body .materials-library .materials-grid tbody td:last-child { border-inline-end: 1px solid var(--material-line); }
body .material-name {
    display: flex;
    align-items: center;
    gap: .7rem;
    min-inline-size: 0;
    color: #183d5d;
    font-weight: 650;
    overflow-wrap: anywhere;
}
body a.material-name { text-decoration: none; }
body a.material-name:hover { color: var(--lm-teal); text-decoration: underline; }
body .material-name-icon {
    display: grid;
    place-items: center;
    flex: 0 0 2.3rem;
    block-size: 2.3rem;
    border-radius: .65rem;
    background: linear-gradient(145deg, #ebf5fe, #d5e8fa);
    box-shadow: inset 0 1px 0 #fff, 0 2px 0 #c2daed;
}
body a.material-name .material-name-icon { background: #e2f4ee; box-shadow: 0 2px 0 #cce9e0; }
body .material-name-icon img { inline-size: 1.15rem; block-size: 1.15rem; object-fit: contain; }
body .materials-grid .material-type { display: inline-block; padding: .2rem .5rem; border-radius: .45rem; color: #225578; background: #e8f2fa; font-size: .79rem; font-weight: 750; }
body .materials-library .material-menu-toggle {
    display: inline-grid;
    place-items: center;
    min-inline-size: 2.15rem;
    min-block-size: 2.15rem;
    padding: .25rem;
    border: 1px solid var(--material-line);
    background: #f4f9fd;
}
body .materials-library .material-menu-toggle:hover { background: #e0eef8; }
body .material-menu-toggle img { inline-size: 1rem; block-size: 1rem; }
body .materials-library .material-menu {
    min-inline-size: 10rem;
    padding: .3rem;
    text-align: start;
    border-radius: .85rem;
}
body .materials-library .material-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .5rem .65rem;
    border-radius: .55rem;
    font-weight: 600;
    text-align: start;
}
body .material-menu .dropdown-item img { inline-size: 1rem; block-size: 1rem; object-fit: contain; }
body .materials-library .material-menu .material-delete { color: #a4263d; }
body .materials-library .material-menu .material-delete:is(:hover, :focus) { background: #fce9ed; }
body .material-video-card { background: linear-gradient(140deg, #fff, #f4f2fb); }
body .material-video-card .card-body { overflow-wrap: anywhere; }
body .material-video-card .embed-thumbnail { border-radius: .85rem; background: #e9e5f5; margin: .65rem; }
body .material-video-card .material-video-actions { padding: .85rem; display: flex; justify-content: flex-end; }
body .materials-empty {
    padding: 1rem;
    border-radius: 1rem;
    border: 1px dashed var(--material-line);
    background: #f8fcff;
    color: var(--lm-muted);
}
body .materials-empty img { max-inline-size: min(12rem, 100%); }

/* Attachment dialogs share the layout, with an accent for each attachment type. */
body .material-dialog {
    --attach-accent: #1c5990;
    --attach-tint: #e7f2fc;
    overflow-y: auto;
}
body .material-dialog--link { --attach-accent: #136b60; --attach-tint: #e3f4ee; }
body .material-dialog--video { --attach-accent: #584895; --attach-tint: #efeafa; }
body .material-dialog .modal-dialog { max-width: min(36rem, calc(100% - 1.25rem)); margin-inline: auto; }
body .custom-modal .material-dialog .modal-content {
    padding: 0;
    border-radius: 1.4rem;
    border: 1px solid #c6d9e9;
    background: #fff;
    box-shadow: 0 5px 0 #b9ccde, 0 24px 65px #132e5a4a;
}
body .material-dialog .material-dialog-header {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: 1.15rem 3rem 1.15rem 1.15rem;
    padding-inline: 1.15rem 3rem;
    border-radius: 1.35rem 1.35rem 0 0;
    background: linear-gradient(140deg, #fff, var(--attach-tint));
    border-block-end: 1px solid #dbe7f2;
    text-align: start;
}
body .material-dialog-icon {
    display: grid;
    place-items: center;
    flex: 0 0 3.15rem;
    block-size: 3.15rem;
    border-radius: .85rem;
    background: var(--attach-tint);
    border: 1px solid #c9daea;
    box-shadow: inset 0 1px 0 #fff, 0 3px 0 #cbdcee;
}
body .material-dialog-icon img { inline-size: 1.55rem; block-size: 1.55rem; object-fit: contain; }
body .material-dialog .material-dialog-title { color: var(--attach-accent); font-size: 1.2rem; font-weight: 750; margin: 0; overflow-wrap: anywhere; }
body .material-dialog .material-dialog-caption { color: var(--lm-muted); font-size: .92rem; margin: .25rem 0 0; }
body .material-dialog .material-dialog-close { z-index: 1; inset-inline-end: .85rem; inset-block-start: .9rem; opacity: .75; }
body .custom-modal .material-dialog .material-dialog-body { padding: clamp(.8rem, 3vw, 1.35rem); text-align: start; }
body .material-dialog .material-dialog-field { margin-block-end: .9rem; }
body .material-dialog .material-dialog-field label { display: inline-block; font-weight: 650; margin-block-end: .3rem; }
body .material-dialog .form-control { min-block-size: 2.5rem; background: #fbfdff; }
body .material-dialog .material-dialog-actions { display: flex; flex-wrap: wrap; gap: .65rem; padding: .9rem 0 0; margin-block-start: .85rem; border-block-start: 1px solid #dbe7f2; }
body .material-dialog .material-dialog-actions > .btn { flex: 1 1 8rem; }
body .material-dialog .material-submit {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--attach-accent);
    --bs-btn-border-color: var(--attach-accent);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #204360;
    --bs-btn-hover-border-color: #204360;
    --bs-btn-disabled-bg: var(--attach-accent);
    --bs-btn-disabled-border-color: var(--attach-accent);
    box-shadow: 0 3px 0 #17385838;
}
body .material-dialog .material-dropzone {
    gap: .6rem;
    background: radial-gradient(ellipse at 50% 0%, #fff, var(--attach-tint));
    border: 2px dashed #7ea9c9 !important;
    border-radius: 1rem !important;
    padding: 1.25rem .85rem;
    color: #173e62;
    cursor: pointer;
}
body .material-dialog .material-dropzone:hover { border-color: var(--attach-accent) !important; }
body .material-dropzone input { inset: 0; inline-size: 100%; block-size: 100%; opacity: 0; cursor: pointer; }
body .material-dropzone .material-browse { pointer-events: none; }
body .material-dialog .material-queue-card { background: #f3f8fc; overflow-wrap: anywhere; }
body .material-dialog .material-queue-card .card-body { padding: .75rem; }

@media (max-width: 575.98px) {
    body .materials-toolbar > .btn { flex: 1 1 8rem; }
    body .materials-library .materials-grid :is(th, td) { padding: .45rem .3rem; font-size: .8rem; }
    body .materials-library .materials-grid :is(th, td):last-child { inline-size: 2.8rem; }
    body .materials-library .materials-grid :is(th, td).col-2 { width: 20%; }
    body .materials-grid .material-type { padding-inline: .25rem; }
    body .material-name { gap: .35rem; }
    body .material-name-icon { display: none; }
    body .materials-library .nav-tabs .nav-link { padding-inline: .45rem; }
}
@media (prefers-reduced-motion: no-preference) {
    body .materials-picker,
    body .custom-modal .material-dialog .modal-content { animation: lm-material-enter .22s ease-out both; }
    body .material-choice { transition: translate .15s ease, box-shadow .15s ease, border-color .15s ease; }
    body .material-choice:is(:hover, :focus-visible) { translate: 0 -2px; box-shadow: 0 5px 0 #dceaf5; }
}
@keyframes lm-material-enter {
    from { opacity: 0; translate: 0 .4rem; }
    to { opacity: 1; translate: 0 0; }
}
