/* CSK portal: distribution-platform visual language, isolated to portal.php. */
body.mps-portal-body {
    --portal-blue-900: #163f76;
    --portal-blue-800: #1e4f91;
    --portal-blue-700: #2f67ad;
    --portal-blue-600: #3b76bb;
    --portal-blue-100: #eaf2fb;
    --portal-blue-050: #f4f8fd;
    --portal-ink: #20324c;
    --portal-muted: #62758d;
    --portal-border: #d5e2ef;
    --portal-surface: #ffffff;
    --portal-canvas: #eef3f8;
    margin: 0 !important;
    overflow: hidden !important;
    color: var(--portal-ink) !important;
    background: var(--portal-canvas) !important;
    font-family: Roboto, Arial, sans-serif !important;
}

body.mps-portal-body .zis-topbar.navbar,
body.mps-portal-body .navbar.zis-topbar {
    border: 0 !important;
    background: linear-gradient(180deg, #3b76bb 0%, #2f67ad 54%, #1e4f91 100%) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .24),
        inset 0 -1px 0 rgba(255, 255, 255, .08),
        0 3px 10px rgba(24, 63, 113, .18) !important;
}

body.mps-portal-body .zis-topbar.navbar::after,
body.mps-portal-body .navbar.zis-topbar::after {
    bottom: -6px !important;
    height: 6px !important;
    background: linear-gradient(180deg, rgba(93, 134, 181, .28) 0%, rgba(47, 103, 173, .10) 45%, rgba(15, 23, 42, 0) 100%) !important;
}

body.mps-portal-body .zis-brand-block {
    width: 205px !important;
}

body.mps-portal-body .zis-logo-3d {
    letter-spacing: 2px !important;
}

body.mps-portal-body .zis-account-dropdown {
    min-width: 190px !important;
}

body.mps-portal-body .zis-account-caret-svg {
    width: 12px !important;
    height: 12px !important;
    fill: none !important;
    stroke: rgba(255, 255, 255, .82) !important;
    stroke-width: 1.8 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
}

.mps-portal-main {
    position: fixed !important;
    top: 52px !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    display: block !important;
    grid-template-columns: none !important;
    padding: clamp(14px, 2vw, 28px) !important;
    padding-bottom: calc(clamp(14px, 2vw, 28px) + env(safe-area-inset-bottom)) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    background:
        radial-gradient(circle at 10% 0%, rgba(59, 118, 187, .08), transparent 30%),
        linear-gradient(180deg, #f3f7fb 0%, var(--portal-canvas) 100%) !important;
    -webkit-overflow-scrolling: touch;
}

.mps-portal-shell {
    width: min(100%, 1440px);
    min-width: 0;
    margin: 0 auto;
}

.mps-portal-user-strip,
.mps-portal-profile-card {
    position: relative;
    min-width: 0;
}

.mps-portal-user-strip {
    margin-bottom: 12px;
}

.mps-portal-profile-card {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    padding: 10px 13px;
    border: 1px solid rgba(173, 197, 221, .9);
    border-radius: 9px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 3px 10px rgba(30, 79, 145, .07), inset 0 1px 0 #fff;
}

.mps-portal-profile-avatar {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    border-radius: 9px;
    background: linear-gradient(145deg, var(--portal-blue-600), var(--portal-blue-800));
    box-shadow: 0 5px 12px rgba(30, 79, 145, .22), inset 0 1px 0 rgba(255, 255, 255, .24);
    font-size: 16px;
}

.mps-portal-profile-body {
    min-width: 0;
    padding: 0 !important;
}

.mps-portal-profile-label,
.mps-portal-profile-body strong,
.mps-portal-profile-body #portal_user_meta {
    display: block;
    min-width: 0;
}

.mps-portal-profile-label {
    margin-bottom: 2px;
    color: #7789a0 !important;
    font-size: 10px;
    font-weight: 750;
    line-height: 14px;
    letter-spacing: .55px;
    text-transform: uppercase;
}

.mps-portal-profile-body strong {
    overflow: hidden;
    color: var(--portal-ink) !important;
    font-size: 16px !important;
    font-weight: 750;
    line-height: 21px !important;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mps-portal-profile-body #portal_user_meta {
    margin-top: 3px !important;
    overflow-wrap: anywhere;
    color: var(--portal-muted) !important;
    font-size: 11.5px;
    line-height: 16px !important;
    white-space: normal !important;
}

.mps-portal-scope {
    min-width: 0;
    grid-column: 3;
    justify-self: end;
    max-width: 100%;
    padding: 4px 8px;
    overflow: hidden;
    color: #315f92;
    border: 1px solid #c9daeb;
    border-radius: 999px;
    background: #edf5fc;
    font-size: 10.5px;
    font-weight: 650;
    line-height: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.mps-zis-body .mps-portal-modules-card {
    min-width: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    border: 1px solid var(--portal-border) !important;
    border-radius: 12px !important;
    background: var(--portal-surface) !important;
    box-shadow: 0 7px 22px rgba(24, 63, 113, .08) !important;
}

.mps-portal-section-head {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px clamp(16px, 2vw, 22px);
    border-bottom: 1px solid #dce7f2;
    background: linear-gradient(180deg, #fff 0%, #f8fbfe 100%);
}

.mps-portal-section-head > div:first-child {
    min-width: 0;
}

.mps-portal-section-kicker {
    display: block;
    margin-bottom: 1px;
    color: var(--portal-blue-700);
    font-size: 10px;
    font-weight: 800;
    line-height: 14px;
    letter-spacing: .65px;
    text-transform: uppercase;
}

.mps-portal-section-head h2 {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    color: var(--portal-ink);
    font-size: 18px;
    font-weight: 750;
    line-height: 24px;
}

.mps-portal-section-head h2 i {
    color: var(--portal-blue-700);
    font-size: 17px;
}

.mps-portal-section-head p {
    margin: 2px 0 0;
    color: var(--portal-muted);
    font-size: 12px;
    line-height: 17px;
}

.mps-portal-module-count {
    min-width: 68px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 5px 10px;
    color: var(--portal-blue-700);
    border: 1px solid #cfdeec;
    border-radius: 9px;
    background: var(--portal-blue-050);
}

.mps-portal-module-count > span {
    font-size: 18px;
    font-weight: 800;
    line-height: 22px;
}

.mps-portal-module-count > small {
    color: #536b86;
    font-size: 9px;
    font-weight: 700;
    line-height: 12px;
    letter-spacing: .45px;
    text-transform: uppercase;
}

.mps-portal-modules {
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)) !important;
    align-items: stretch !important;
    align-content: start !important;
    gap: 10px !important;
    padding: clamp(10px, 1.4vw, 16px) !important;
    overflow: visible !important;
    background: #f8fafc;
}

.mps-portal-module-card {
    position: relative;
    min-width: 0;
    min-height: 138px !important;
    display: grid !important;
    grid-template-columns: 44px minmax(0, 1fr) !important;
    grid-template-rows: minmax(52px, 1fr) auto !important;
    gap: 10px !important;
    padding: 13px !important;
    overflow: hidden;
    border: 1px solid #d5e2ef !important;
    border-radius: 10px !important;
    background: #fff !important;
    box-shadow: 0 3px 11px rgba(24, 63, 113, .07) !important;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease !important;
}

.mps-portal-module-card::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--portal-blue-600), var(--portal-blue-800));
    opacity: .86;
}

.mps-portal-module-card.is-active:hover,
.mps-portal-module-card.is-active:focus-within {
    z-index: 2;
    border-color: #adc6df !important;
    box-shadow: 0 9px 22px rgba(30, 79, 145, .13) !important;
    transform: translateY(-2px);
}

.mps-portal-module-icon {
    width: 44px !important;
    height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    align-self: start;
    color: var(--portal-blue-700) !important;
    border: 1px solid #c9daeb !important;
    border-radius: 9px !important;
    background: linear-gradient(145deg, #f4f9fe, #e6f0fa) !important;
    box-shadow: inset 0 1px 0 #fff;
    font-size: 17px !important;
}

.mps-portal-module-main {
    min-width: 0 !important;
    align-self: center;
}

.mps-portal-module-code {
    display: block !important;
    margin-bottom: 4px !important;
    overflow: hidden;
    color: #6d8097 !important;
    font-size: 9.5px !important;
    font-weight: 800;
    line-height: 13px !important;
    letter-spacing: .7px;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.mps-portal-module-main strong {
    display: -webkit-box !important;
    overflow: hidden !important;
    color: var(--portal-ink) !important;
    font-size: 15px !important;
    font-weight: 750;
    line-height: 20px !important;
    white-space: normal !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.mps-portal-module-action {
    min-width: 0;
    grid-column: 1 / -1;
}

.mps-portal-module-open,
.mps-portal-module-open:visited {
    width: 100%;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 10px;
    color: #fff;
    border: 1px solid #285d9f;
    border-radius: 7px;
    background: linear-gradient(180deg, #3b76bb, #2f67ad);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 2px 5px rgba(30, 79, 145, .16);
    font-size: 11.5px;
    font-weight: 700;
    line-height: 18px;
    text-decoration: none;
    transition: background .15s ease, box-shadow .15s ease, transform .15s ease;
}

.mps-portal-module-open:hover,
.mps-portal-module-open:focus {
    color: #fff;
    background: linear-gradient(180deg, #3470b6, #285e9f);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .24), 0 3px 8px rgba(30, 79, 145, .24);
    outline: none;
    text-decoration: none;
}

.mps-portal-module-open:focus-visible {
    outline: 3px solid rgba(47, 103, 173, .25);
    outline-offset: 2px;
}

.mps-portal-module-open:active {
    transform: translateY(1px);
}

.mps-portal-module-open i {
    font-size: 10px;
}

.mps-portal-module-open.is-disabled {
    color: #78899d;
    border-color: #d7e1eb;
    background: #eef2f6;
    box-shadow: none;
    cursor: not-allowed;
}

.mps-portal-module-card.is-disabled {
    opacity: .76;
}

.mps-portal-empty {
    min-height: 220px;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    grid-column: 1 / -1;
    gap: 7px;
    padding: 30px;
    color: var(--portal-muted);
    border: 1px dashed #c8d8e8;
    border-radius: 10px;
    background: #fff;
    text-align: center;
}

.mps-portal-empty i {
    margin-bottom: 5px;
    color: #86a5c5;
    font-size: 28px;
}

.mps-portal-empty strong {
    color: var(--portal-ink);
    font-size: 14px;
}

.mps-portal-empty span {
    max-width: 440px;
    font-size: 12px;
    line-height: 18px;
}

body.mps-portal-body .mps-loader {
    top: 52px !important;
    background: rgba(232, 239, 247, .74) !important;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

body.mps-portal-body .mps-loader-box {
    gap: 9px !important;
    padding: 12px 16px !important;
    color: #315f92 !important;
    border: 1px solid #c8d9e9 !important;
    border-radius: 9px !important;
    background: rgba(255, 255, 255, .96) !important;
    box-shadow: 0 8px 24px rgba(24, 63, 113, .14) !important;
}

body.mps-portal-body .app-modal .modal-content {
    overflow: hidden !important;
    border: 1px solid #bfd1e3 !important;
    border-radius: 10px !important;
    background: #fff !important;
    box-shadow: 0 18px 48px rgba(15, 36, 65, .24) !important;
}

body.mps-portal-body .app-modal .modal-header {
    min-height: 42px !important;
    padding: 10px 13px !important;
    color: #fff !important;
    border: 0 !important;
    background: linear-gradient(180deg, #3b76bb, #2f67ad) !important;
}

body.mps-portal-body .app-modal .modal-title {
    color: #fff !important;
    font-size: 13px !important;
    font-weight: 700 !important;
}

body.mps-portal-body .app-modal .modal-header .close {
    width: 28px !important;
    height: 28px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    margin: -3px -4px -3px 0 !important;
    padding: 0 !important;
    color: #fff !important;
    border: 0 !important;
    border-radius: 6px !important;
    background: rgba(255, 255, 255, .12) !important;
    box-shadow: none !important;
    font-size: 20px !important;
    line-height: 1 !important;
    opacity: 1 !important;
    order: 2;
}

body.mps-portal-body .app-modal .modal-header .close:hover,
body.mps-portal-body .app-modal .modal-header .close:focus {
    background: rgba(255, 255, 255, .22) !important;
    outline: none !important;
}

body.mps-portal-body .app-modal .modal-body {
    margin: 0 !important;
    padding: 18px !important;
    color: var(--portal-ink) !important;
    border: 0 !important;
    background: #fff !important;
    font-size: 12.5px;
    line-height: 1.55;
}

@media (max-width: 820px) {
    .mps-portal-main {
        padding: 14px !important;
        padding-bottom: calc(14px + env(safe-area-inset-bottom)) !important;
    }

    .mps-portal-profile-card {
        width: 100%;
        max-width: none;
    }
}

@media (max-width: 640px) {
    body.mps-portal-body .zis-topbar-inner {
        gap: 6px !important;
        padding: 0 max(7px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left)) !important;
    }

    body.mps-portal-body .zis-brand-block {
        width: 66px !important;
    }

    body.mps-portal-body .zis-logo-3d {
        font-size: 23px !important;
        line-height: 25px !important;
        letter-spacing: 1.5px !important;
    }

    body.mps-portal-body .zis-logo-subtitle,
    body.mps-portal-body .zis-page-context {
        display: none !important;
    }

    body.mps-portal-body .zis-action-group {
        height: 32px !important;
        gap: 2px !important;
        margin: 0 !important;
        padding: 0 6px !important;
    }

    body.mps-portal-body .zis-action-group .zis-top-btn {
        width: 30px !important;
        height: 30px !important;
    }

    body.mps-portal-body .zis-right-block {
        min-width: 0 !important;
        gap: 9px !important;
        padding-left: 2px !important;
    }

    body.mps-portal-body .zis-account-menu {
        min-width: 0 !important;
    }

    body.mps-portal-body .zis-account-toggle {
        min-width: 0 !important;
        gap: 5px !important;
    }

    body.mps-portal-body .zis-account-name {
        max-width: 112px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    body.mps-portal-body .zis-emblem {
        width: 32px !important;
        height: 32px !important;
    }

    .mps-portal-main {
        padding: 10px !important;
        padding-bottom: calc(10px + env(safe-area-inset-bottom)) !important;
    }

    .mps-portal-profile-card {
        grid-template-columns: 44px minmax(0, 1fr);
        gap: 10px;
        padding: 13px;
    }

    .mps-portal-profile-avatar {
        width: 44px;
        height: 44px;
        font-size: 17px;
    }

    .mps-portal-scope {
        grid-column: 1 / -1;
    }

    body.mps-zis-body .mps-portal-modules-card {
        border-radius: 10px !important;
    }

    .mps-portal-section-head {
        align-items: flex-start;
        padding: 15px;
    }

    .mps-portal-module-count {
        min-width: 62px;
        padding: 6px 9px;
    }

    .mps-portal-modules {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 10px !important;
        padding: 10px !important;
    }

    .mps-portal-module-card {
        min-height: 154px !important;
        padding: 14px !important;
    }

    .mps-portal-module-open {
        min-height: 42px;
        padding-right: 13px;
        padding-left: 13px;
    }

    body.mps-portal-body .app-modal .modal-dialog {
        width: auto !important;
        margin: 16px 10px !important;
    }
}

@media (max-width: 430px) {
    body.mps-portal-body .zis-brand-block {
        width: 55px !important;
    }

    body.mps-portal-body .zis-logo-3d {
        font-size: 21px !important;
        letter-spacing: 1px !important;
    }

    body.mps-portal-body .zis-action-group {
        padding: 0 4px !important;
        border-left: 1px solid rgba(255, 255, 255, .18) !important;
        border-right: 1px solid rgba(255, 255, 255, .18) !important;
    }

    body.mps-portal-body .zis-account-name {
        display: none !important;
    }

    body.mps-portal-body .zis-account-toggle::before {
        content: "\f2bd";
        display: inline-block;
        color: rgba(255, 255, 255, .86);
        font-family: FontAwesome;
        font-size: 18px;
        font-style: normal;
        font-weight: normal;
        line-height: 1;
    }

    body.mps-portal-body .zis-account-toggle {
        min-width: 32px !important;
        min-height: 40px !important;
        justify-content: center !important;
    }

    body.mps-portal-body .zis-emblem {
        width: 30px !important;
        height: 30px !important;
    }

    body.mps-portal-body .zis-account-dropdown {
        position: fixed !important;
        top: 48px !important;
        right: 7px !important;
        left: 7px !important;
        width: auto !important;
        min-width: 0 !important;
    }

    .mps-portal-section-head h2 {
        font-size: 18px;
        line-height: 24px;
    }

    .mps-portal-section-head p {
        max-width: 220px;
    }
}

@media (max-width: 340px) {
    body.mps-portal-body .zis-emblem {
        display: none !important;
    }

    .mps-portal-section-head {
        gap: 9px;
    }

    .mps-portal-module-count {
        min-width: 54px;
        padding-right: 6px;
        padding-left: 6px;
    }
}

@media (max-height: 520px) and (orientation: landscape) {
    .mps-portal-main {
        padding: 9px !important;
    }

    .mps-portal-profile-card {
        padding: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mps-portal-module-card,
    .mps-portal-module-open {
        transition: none !important;
    }

    .mps-portal-module-card.is-active:hover,
    .mps-portal-module-card.is-active:focus-within {
        transform: none !important;
    }
}
