/*
 * Restrained MSPT web shell trial.
 *
 * This file intentionally loads after feature styles, but every presentation
 * selector is scoped to body.page-leaps-shell. Legacy pages retain their
 * existing shell until they are reviewed and migrated deliberately.
 */

body.page-leaps-shell {
    --shell-canvas: #f5f6f8;
    --shell-bg: #f5f6f8;
    --shell-surface: #f9fafb;
    --shell-text: #1b1c1d;
    --shell-muted: #62666b;
    --shell-border: #d4d4d5;
    --shell-link: #176dad;
    --shell-selected: #eaf4fc;
    background-color: var(--shell-canvas);
}

html:has(> body.page-leaps-shell) {
    background-color: #f5f6f8;
}

:root[data-theme="dark"] body.page-leaps-shell {
    --shell-canvas: #17191c;
    --shell-bg: #17191c;
    --shell-surface: #21252a;
    --shell-text: #e8eaed;
    --shell-muted: #adb4be;
    --shell-border: #41464e;
    --shell-link: #7ec5ff;
    --shell-selected: #20384b;
}

:root[data-theme="dark"]:has(> body.page-leaps-shell) {
    background-color: #17191c;
}

html body.page-leaps-shell #layout-container {
    margin-top: 0;
    padding-inline: 12px;
}

html body.page-leaps-shell #layout-container > .ui.stackable.grid.header-row {
    align-items: center;
    background: var(--shell-bg);
    border-bottom: 1px solid var(--shell-border);
    box-shadow: none;
    box-sizing: border-box;
    display: grid;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    gap: 12px;
    grid-template-columns: minmax(260px, 6fr) minmax(220px, 5fr) minmax(320px, 5fr);
    margin: 0 auto 14px;
    max-width: 1440px;
    min-height: 64px;
    padding: 9px 4px;
    width: 100%;
}

html body.page-leaps-shell #layout-container > .ui.stackable.grid.header-row > .column {
    margin: 0;
    min-width: 0;
    padding: 0 8px !important;
    width: auto !important;
}

html body.page-leaps-shell #layout-container > .header-row .layout-brand {
    color: var(--shell-text);
    gap: 9px;
}

html body.page-leaps-shell #layout-container > .header-row .layout-brand-column {
    align-items: center;
    display: flex !important;
    gap: 10px;
}

html body.page-leaps-shell #layout-container > .header-row .layout-back-button {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 7px;
    color: var(--shell-muted);
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 40px;
    height: 40px;
    justify-content: center;
    margin: 0;
    padding: 0;
    width: 40px;
}

html body.page-leaps-shell #layout-container > .header-row .layout-back-button .icon {
    font-size: 20px;
    margin: 0;
}

html body.page-leaps-shell #layout-container > .header-row .layout-back-button:hover,
html body.page-leaps-shell #layout-container > .header-row .layout-back-button:focus-visible {
    background: var(--shell-selected);
    color: var(--shell-link);
    outline: none;
}

html body.page-leaps-shell #layout-container > .header-row .layout-brand:hover,
html body.page-leaps-shell #layout-container > .header-row .layout-brand:focus {
    color: var(--shell-link);
}

html body.page-leaps-shell #layout-container > .header-row .layout-brand-logo {
    flex-basis: 34px;
    height: 34px;
    width: 34px;
}

html body.page-leaps-shell #layout-container > .header-row .layout-brand-name {
    font-size: 19px;
    font-weight: 750;
    letter-spacing: -0.02em;
}

html body.page-leaps-shell #layout-container > .header-row #iconInput {
    background: var(--shell-surface);
    border: 1px solid var(--shell-border);
    border-radius: 6px;
    box-shadow: none;
    min-height: 40px;
}

html body.page-leaps-shell #layout-container > .header-row #iconInput:focus-within {
    border-color: var(--shell-link);
    outline: 2px solid color-mix(in srgb, var(--shell-link) 22%, transparent);
    outline-offset: 1px;
}

html body.page-leaps-shell #layout-container > .header-row #iconInput .prompt {
    background: transparent;
    color: var(--shell-text);
    font-size: 14px;
    height: 38px;
}

html body.page-leaps-shell #layout-container > .header-row .right-aligned {
    align-items: center;
    display: flex !important;
    gap: 8px;
    justify-content: flex-end;
    min-width: 0;
    text-align: right;
    white-space: nowrap;
}

html body.page-leaps-shell #layout-container > .header-row .welcome-text {
    color: var(--shell-muted);
    flex: 0 1 auto;
    font-size: 13px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html body.page-leaps-shell #layout-container > .header-row #toggleIcon {
    align-items: center;
    border-radius: 6px;
    color: var(--shell-muted);
    display: inline-flex;
    flex: 0 0 40px;
    height: 40px;
    justify-content: center;
    margin: 0;
    width: 40px;
}

html body.page-leaps-shell #layout-container > .header-row #toggleIcon:hover,
html body.page-leaps-shell #layout-container > .header-row #toggleIcon:focus-visible {
    background: var(--shell-selected);
    color: var(--shell-link);
    outline: none;
}

html body.page-leaps-shell #layout-container > .header-row :is(#layout-button, #layout-button-logout, #layout-button-register, #layout-button-login) {
    align-items: center;
    background: transparent !important;
    border: 1px solid var(--shell-border) !important;
    border-radius: 7px !important;
    box-shadow: none !important;
    color: var(--shell-text) !important;
    display: inline-flex;
    font-size: 13px !important;
    font-weight: 650;
    justify-content: center;
    min-height: 40px;
    padding: 8px 12px !important;
}

html body.page-leaps-shell #layout-container > .header-row :is(#layout-button, #layout-button-logout, #layout-button-register, #layout-button-login):hover,
html body.page-leaps-shell #layout-container > .header-row :is(#layout-button, #layout-button-logout, #layout-button-register, #layout-button-login):focus-visible {
    background: var(--shell-selected) !important;
    border-color: var(--shell-link) !important;
    color: var(--shell-link) !important;
    outline: none;
}

html body.page-leaps-shell #layout-container > .header-row #searchDropdownResults,
html body.page-leaps-shell #layout-container > .header-row #account-menu {
    background: var(--shell-surface);
    border: 1px solid var(--shell-border);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
    color: var(--shell-text);
}

html body.page-leaps-shell #menu.mspt-main-menu.ui.text.menu {
    align-items: stretch;
    border-bottom: 1px solid var(--shell-border);
    gap: 2px;
    margin: 8px 0 18px !important;
    min-height: 42px;
    padding: 0;
}

html body.page-leaps-shell #menu.mspt-main-menu.ui.text.menu > .item,
html body.page-leaps-shell #menu.mspt-main-menu.ui.text.menu > .ui.dropdown.item {
    align-items: center;
    background: transparent !important;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    color: var(--shell-muted) !important;
    display: inline-flex;
    font-size: 13px !important;
    font-weight: 650;
    min-height: 41px;
    padding: 9px 10px 7px !important;
}

html body.page-leaps-shell #menu.mspt-main-menu.ui.text.menu > .item:hover,
html body.page-leaps-shell #menu.mspt-main-menu.ui.text.menu > .item:focus,
html body.page-leaps-shell #menu.mspt-main-menu.ui.text.menu > .ui.dropdown.item:hover,
html body.page-leaps-shell #menu.mspt-main-menu.ui.text.menu > .ui.dropdown.item:focus {
    background: var(--shell-selected) !important;
    color: var(--shell-link) !important;
    outline: none;
}

html body.page-leaps-shell #menu.mspt-main-menu.ui.text.menu > .item.active,
html body.page-leaps-shell #menu.mspt-main-menu.ui.text.menu > .ui.dropdown.item.mspt-current-group {
    background: var(--shell-selected) !important;
    border-bottom-color: #2185d0;
    color: var(--shell-link) !important;
    font-weight: 750;
}

html body.page-leaps-shell #menu.mspt-main-menu.ui.text.menu .ui.dropdown .menu {
    background: var(--shell-surface) !important;
    border: 1px solid var(--shell-border) !important;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14) !important;
}

html body.page-leaps-shell #menu.mspt-main-menu.ui.text.menu .ui.dropdown .menu > .item,
html body.page-leaps-shell #menu.mspt-main-menu.ui.text.menu .mspt-audit-submenu > .menu > .item {
    background: var(--shell-surface) !important;
    color: var(--shell-text) !important;
    font-size: 13px !important;
}

html body.page-leaps-shell #menu.mspt-main-menu.ui.text.menu .ui.dropdown .menu > .item:hover,
html body.page-leaps-shell #menu.mspt-main-menu.ui.text.menu .ui.dropdown .menu > .item:focus,
html body.page-leaps-shell #menu.mspt-main-menu.ui.text.menu .ui.dropdown .menu > .item.active,
html body.page-leaps-shell #menu.mspt-main-menu.ui.text.menu .mspt-audit-submenu > .menu > .item:hover,
html body.page-leaps-shell #menu.mspt-main-menu.ui.text.menu .mspt-audit-submenu > .menu > .item:focus,
html body.page-leaps-shell #menu.mspt-main-menu.ui.text.menu .mspt-audit-submenu > .menu > .item.active {
    background: var(--shell-selected) !important;
    color: var(--shell-link) !important;
}

html body.page-leaps-shell #menu.mspt-main-menu #unread-count {
    background: var(--shell-muted);
    color: var(--shell-bg);
}

html body.page-leaps-shell #customFooter.ui.vertical.footer.segment {
    background: var(--shell-canvas) !important;
    border: 0 !important;
    border-radius: 0;
    border-top: 1px solid var(--shell-border) !important;
    box-shadow: none !important;
    color: var(--shell-text) !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    margin: 32px auto 0 !important;
    max-width: 1440px;
    padding: 16px 18px 12px !important;
    text-align: left;
    width: calc(100% - 24px);
}

html body.page-leaps-shell #customFooter > .ui.center.aligned.container {
    background: var(--shell-canvas);
    text-align: left;
}

html body.page-leaps-shell #customFooter .ui.stackable.inverted.divided.grid {
    background: var(--shell-canvas);
    display: grid;
    align-items: start;
    gap: 12px 40px;
    grid-template-columns: minmax(300px, 1.3fr) minmax(180px, 0.7fr) minmax(180px, 0.7fr);
    margin: 0;
}

html body.page-leaps-shell #customFooter .ui.stackable.inverted.divided.grid > .column {
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 10px !important;
    width: auto !important;
}

html body.page-leaps-shell #customFooter :is(.ui.inverted.header, p) {
    color: var(--shell-text) !important;
}

html body.page-leaps-shell #customFooter .ui.inverted.header {
    font-size: 14px;
    margin: 0 0 6px !important;
}

html body.page-leaps-shell #customFooter .footer-brand-column > p,
html body.page-leaps-shell #customFooter .footer-brand-column > .button,
html body.page-leaps-shell #customFooter .footer-support-column {
    display: none !important;
}

html body.page-leaps-shell #customFooter .footer-brand-column {
    align-self: start;
}

html body.page-leaps-shell #customFooter .footer-brand-column .header {
    align-items: center;
    display: flex;
    font-size: 15px;
    gap: 9px;
    line-height: 1.35;
}

html body.page-leaps-shell #customFooter .footer-brand-column .header::before {
    background: url("/static/mspt-logo.svg") center / contain no-repeat;
    content: "";
    flex: 0 0 28px;
    height: 28px;
    width: 28px;
}

html body.page-leaps-shell #customFooter p {
    color: var(--shell-muted) !important;
    font-size: 12px;
    line-height: 1.45;
}

html body.page-leaps-shell #customFooter .ui.inverted.link.list .item,
html body.page-leaps-shell #customFooter a {
    color: var(--shell-link) !important;
    font-size: 13px;
    line-height: 1.35;
    padding-block: 4px;
}

html body.page-leaps-shell #customFooter .footer-links-column .ui.inverted.link.list {
    display: grid;
    gap: 1px 18px;
    grid-template-columns: minmax(0, max-content);
    justify-content: start;
    margin: 0;
}

html body.page-leaps-shell #customFooter .ui.inverted.link.list .item:hover,
html body.page-leaps-shell #customFooter .ui.inverted.link.list .item:focus,
html body.page-leaps-shell #customFooter a:hover,
html body.page-leaps-shell #customFooter a:focus {
    color: var(--shell-link) !important;
    text-decoration: underline;
}

html body.page-leaps-shell #customFooter .ui.inverted.primary.basic.button {
    background: transparent !important;
    border: 1px solid var(--shell-border) !important;
    border-radius: 7px !important;
    box-shadow: none !important;
    color: var(--shell-link) !important;
    font-size: 13px;
    min-height: 40px;
    padding: 8px 12px;
}

html body.page-leaps-shell #customFooter .ui.inverted.primary.basic.button:hover,
html body.page-leaps-shell #customFooter .ui.inverted.primary.basic.button:focus-visible {
    background: var(--shell-selected) !important;
    border-color: var(--shell-link) !important;
    outline: none;
    text-decoration: none;
}

html body.page-leaps-shell #customFooter .ui.section.divider {
    border-color: var(--shell-border) !important;
    margin: 12px 0 8px !important;
}

html body.page-leaps-shell #customFooter #linkList {
    align-items: start;
    background: var(--shell-canvas);
    display: flex;
    flex-wrap: wrap;
    gap: 3px 0;
    justify-content: start;
    padding: 0;
}

html body.page-leaps-shell #customFooter #linkList .footerItem {
    color: var(--shell-muted) !important;
    margin: 0;
    max-width: 920px;
    text-align: left;
}

html body.page-leaps-shell #customFooter #linkList .footerItem:nth-child(-n + 2)::after {
    content: "\00a0\00b7";
    margin-right: 6px;
}

html body.page-leaps-shell #customFooter #linkList .footerItem:nth-child(n + 4) {
    flex-basis: 100%;
}

html body.page-leaps-shell .workflow-guide-link {
    align-items: center;
    border: 1px solid var(--shell-border);
    border-radius: 6px;
    color: var(--shell-link);
    display: inline-flex;
    font-size: 12px;
    font-weight: 650;
    min-height: 32px;
    padding: 6px 9px;
    text-decoration: none;
}

html body.page-leaps-shell .workflow-guide-link:hover,
html body.page-leaps-shell .workflow-guide-link:focus-visible {
    background: var(--shell-selected);
    border-color: var(--shell-link);
    color: var(--shell-link);
    text-decoration: none;
}

html body.page-leaps-shell .workflow-guide-modal {
    background: var(--shell-bg);
    border-color: var(--shell-border);
    border-radius: 7px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
    color: var(--shell-text);
    width: min(760px, calc(100vw - 32px));
}

html body.page-leaps-shell :is(.workflow-guide-header, .workflow-guide-footer) {
    border-color: var(--shell-border);
}

html body.page-leaps-shell :is(.workflow-guide-header h2, .workflow-guide-body, .workflow-guide-body h3, .workflow-guide-body strong) {
    color: var(--shell-text);
}

html body.page-leaps-shell .workflow-guide-body section + section {
    border-color: var(--shell-border);
}

html body.page-leaps-shell .workflow-guide-close {
    color: var(--shell-muted);
}

html body.page-leaps-shell .workflow-guide-close:hover {
    background: var(--shell-selected);
    color: var(--shell-link);
}

html body.page-leaps-shell .workflow-guide-footer .button {
    background: transparent !important;
    border: 1px solid var(--shell-border) !important;
    border-radius: 7px !important;
    box-shadow: none !important;
    color: var(--shell-text) !important;
}

html body.page-leaps-shell .workflow-guide-footer .button:hover,
html body.page-leaps-shell .workflow-guide-footer .button:focus-visible {
    background: var(--shell-selected) !important;
    border-color: var(--shell-link) !important;
    color: var(--shell-link) !important;
}

@media (max-width: 900px) {
    html body.page-leaps-shell #layout-container > .ui.stackable.grid.header-row {
        gap: 8px;
        grid-template-columns: minmax(0, 1fr);
        padding: 8px 0 10px;
    }

    html body.page-leaps-shell #layout-container > .header-row .right-aligned {
        flex-wrap: wrap;
    }

    html body.page-leaps-shell #customFooter .ui.stackable.inverted.divided.grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    html body.page-leaps-shell #customFooter .footer-brand-column {
        grid-column: 1 / -1;
    }
}

@media (max-width: 600px) {
    html body.page-leaps-shell #layout-container {
        padding-inline: 8px;
    }

    html body.page-leaps-shell #layout-container > .header-row .layout-brand-logo {
        flex-basis: 30px;
        height: 30px;
        width: 30px;
    }

    html body.page-leaps-shell #layout-container > .header-row .layout-brand-name {
        font-size: 17px;
    }

    html body.page-leaps-shell #layout-container > .header-row .welcome-text {
        display: none;
    }

    html body.page-leaps-shell #layout-container > .header-row .right-aligned {
        justify-content: flex-start;
    }

    html body.page-leaps-shell #customFooter.ui.vertical.footer.segment {
        margin-top: 24px !important;
        padding: 16px 12px 12px !important;
        width: calc(100% - 16px);
    }

    html body.page-leaps-shell #customFooter .ui.stackable.inverted.divided.grid {
        gap: 16px;
        grid-template-columns: 1fr;
    }

    html body.page-leaps-shell #customFooter #linkList {
        grid-template-columns: 1fr;
    }

    html body.page-leaps-shell #customFooter #linkList .footerItem,
    html body.page-leaps-shell #customFooter #linkList .footerItem:nth-child(n + 4) {
        grid-column: 1;
        text-align: left;
    }
}
