.mg-cabinet-footer {
    --mg-footer-tint: color-mix(in srgb, var(--omni-ui-accent) 6%, var(--omni-ui-surface));
    --mg-footer-border: color-mix(in srgb, var(--omni-ui-accent) 25%, var(--omni-ui-surface));
}

.mg-cabinet-footer .omni-site-footer__groups {
    grid-template-columns: minmax(0, .84fr) minmax(0, 1.18fr) minmax(0, 1.08fr);
    gap: 20px clamp(20px, 3vw, 44px);
}

.mg-cabinet-footer .omni-site-footer__groups > section { gap: 7px; }

.mg-cabinet-footer h2,
.mg-cabinet-footer .mg-footer-exchange summary {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 3px;
    font: 650 18px/1.3 var(--omni-ui-font, system-ui, sans-serif);
    color: var(--omni-ui-ink);
}

.mg-cabinet-footer h2 svg,
.mg-cabinet-footer summary svg {
    width: 19px;
    height: 19px;
    flex: none;
    color: var(--omni-ui-accent);
}

.mg-cabinet-footer .omni-site-footer__groups p {
    font-size: 15px;
    line-height: 1.45;
    max-inline-size: 52ch;
}

.mg-cabinet-footer .mg-footer-intro { color: var(--omni-ui-ink); }

.mg-footer-exchange-links {
    display: grid;
    justify-items: start;
    gap: 10px;
}

.mg-footer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 18px;
}

.mg-cabinet-footer a.mg-footer-action {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 7px 12px;
    border: 1px solid var(--mg-footer-border);
    border-radius: 8px;
    background: var(--mg-footer-tint);
    color: var(--omni-ui-accent);
    text-decoration: none;
    font-weight: 650;
    line-height: 1.35;
}

.mg-footer-action svg { flex: none; }

.mg-cabinet-footer a.mg-footer-action:hover {
    border-color: var(--omni-ui-accent);
    background: var(--omni-ui-surface-soft);
}

.mg-cabinet-footer .omni-site-footer__copy-email:not([hidden]) {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    font-size: 14px;
}

.mg-cabinet-footer .mg-footer-safety {
    border: 1px solid var(--mg-footer-border);
    background: var(--mg-footer-tint);
    border-radius: 12px;
    padding: 16px 18px;
}

.mg-footer-safety strong {
    display: block;
    font-size: 15px;
    line-height: 1.4;
    font-weight: 650;
}

.mg-footer-safety strong + p { margin-top: 3px; }
.mg-cabinet-footer .mg-footer-safety > div { max-width: 51ch; }

.mg-cabinet-footer nav.mg-footer-channels { gap: 6px 18px; }

.mg-cabinet-footer .mg-footer-channels a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 44px;
    box-sizing: border-box;
    padding: 0 3px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--omni-ui-ink);
    font: 550 15px/1.3 var(--omni-ui-font, system-ui, sans-serif);
    text-decoration: none;
}

.mg-footer-channels svg { flex: none; width: 19px; height: 19px; }
.mg-footer-channels .omni-site-footer__bestchange svg:first-child { width: 82px; height: auto; }
.mg-footer-channels a[target="_blank"] > svg:last-child {
    width: 13px;
    height: 13px;
    color: var(--omni-ui-muted);
}

.mg-cabinet-footer .mg-footer-channels .omni-cookie-settings-link {
    padding-inline-start: 18px;
    border-inline-start: 1px solid var(--omni-ui-line);
    border-radius: 0;
    color: var(--omni-ui-muted);
    font-weight: 450;
}

.mg-cabinet-footer .mg-footer-channels a:is(:hover, :focus-visible) {
    background: var(--omni-ui-surface-soft);
    color: var(--omni-ui-accent);
}

@media (width > 700px) {
    .mg-cabinet-footer .omni-site-footer__bottom { padding-top: 16px; }
    .mg-footer-channels .mg-footer-handle { display: none; }
    .mg-cabinet-footer .mg-footer-mobile,
    .mg-cabinet-footer a.mg-footer-mobile { display: none; }

    .mg-cabinet-footer .mg-footer-exchange,
    .mg-cabinet-footer .mg-footer-support {
        align-self: start;
        padding-top: 4px;
    }
}

@media (max-width: 700px) {
    #omni-client-orders-title { scroll-margin-block-start: 88px; }
    .mg-cabinet-footer { padding: 16px; }

    .mg-cabinet-footer .omni-site-footer__groups {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .mg-cabinet-footer .omni-site-footer__groups > section { gap: 3px; }
    .mg-cabinet-footer .omni-site-footer__groups .mg-footer-desktop { display: none; }
    .mg-cabinet-footer .mg-footer-support h2 { margin-bottom: 4px; }

    .mg-cabinet-footer .mg-footer-safety {
        gap: 4px;
        padding: 12px 14px;
    }

    .mg-cabinet-footer .mg-footer-safety h2 { margin: 0; }
    .mg-cabinet-footer .omni-site-footer__email { gap: 3px 8px; }

    .mg-cabinet-footer .mg-footer-exchange {
        min-width: 0;
        border-block: 1px solid var(--omni-ui-line);
    }

    .mg-cabinet-footer .mg-footer-exchange summary {
        width: 100%;
        min-height: 46px;
        margin: 0;
        padding: 4px 0;
        text-decoration: none;
        list-style: none;
    }

    .mg-footer-exchange summary::-webkit-details-marker { display: none; }

    .mg-footer-exchange summary::after {
        content: '';
        margin-inline: auto 5px;
        width: 8px;
        height: 8px;
        border: solid var(--omni-ui-muted);
        border-width: 0 1.6px 1.6px 0;
        transform: translateY(-2px) rotate(45deg);
    }

    .mg-footer-exchange[open] summary::after { transform: translateY(2px) rotate(225deg); }
    .mg-footer-exchange-links { gap: 1px; padding: 2px 0 6px; }

    .mg-cabinet-footer .omni-site-footer__bottom {
        gap: 7px;
        margin-top: 14px;
        padding-top: 0;
        border-top: 0;
    }

    .mg-cabinet-footer nav.mg-footer-channels {
        display: grid;
        gap: 0;
        width: 100%;
    }

    .mg-cabinet-footer .mg-footer-channels a[target="_blank"] {
        gap: 10px;
        min-height: 49px;
        padding: 6px 2px;
        border-bottom: 1px solid var(--omni-ui-line);
        border-radius: 0;
    }

    .mg-footer-channels a[target="_blank"] > svg:last-child { margin-inline-start: auto; }
    .mg-footer-channels .omni-site-footer__bestchange svg:first-child { width: 89px; }
    .mg-footer-channels .mg-footer-handle { color: var(--omni-ui-muted); font-size: 14px; font-weight: 400; }
    .mg-cabinet-footer .mg-footer-channels .omni-cookie-settings-link {
        justify-self: start;
        margin-top: 1px;
        padding-inline: 3px;
        border: 0;
    }
}
