:root {
    --mmlg-text: #161616;
    --mmlg-muted: #666;
    --mmlg-border: #e8e8e8;
    --mmlg-surface: #fff;
    --mmlg-accent: #153d8a;
}

html.mmlg-is-open,
body.mmlg-is-open {
    overflow: hidden !important;
}

.mmlg-modal[hidden] {
    display: none !important;
}

.mmlg-modal {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: grid;
    place-items: center;
    padding: 20px;
    font-family: inherit;
}

.mmlg-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .72);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}

.mmlg-dialog {
    position: relative;
    width: min(100%, 620px);
    max-height: calc(100vh - 40px);
    overflow: auto;
    padding: clamp(28px, 5vw, 52px);
    border-radius: 18px;
    background: var(--mmlg-surface);
    box-shadow: 0 26px 80px rgba(0, 0, 0, .28);
    color: var(--mmlg-text);
    text-align: center;
}

.mmlg-logo {
    display: block;
    width: auto;
    max-width: 180px;
    max-height: 72px;
    margin: 0 auto 24px;
    object-fit: contain;
}

.mmlg-brand {
    margin: 0 0 22px;
    font-size: 20px;
    font-weight: 800;
}

.mmlg-dialog h2 {
    margin: 0 0 12px;
    color: var(--mmlg-text);
    font-size: clamp(26px, 4vw, 38px);
    line-height: 1.15;
    letter-spacing: -.025em;
}

.mmlg-dialog h2 span {
    color: #aaa;
    font-weight: 400;
}

.mmlg-subtitle {
    margin: 0;
    color: var(--mmlg-muted);
    font-size: 15px;
    line-height: 1.55;
}

.mmlg-subtitle-uk {
    margin-top: 2px;
}

.mmlg-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 30px;
}

.mmlg-language-card {
    display: flex;
    align-items: center;
    gap: 15px;
    min-height: 98px;
    padding: 18px;
    border: 1px solid var(--mmlg-border);
    border-radius: 14px;
    background: #fff;
    color: var(--mmlg-text) !important;
    text-align: left;
    text-decoration: none !important;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.mmlg-language-card:hover,
.mmlg-language-card:focus-visible {
    border-color: var(--mmlg-accent);
    box-shadow: 0 10px 30px rgba(21, 61, 138, .12);
    outline: none;
    transform: translateY(-2px);
}

.mmlg-flag {
    display: inline-flex;
    flex: 0 0 auto;
    width: 48px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: 5px;
    box-shadow: 0 2px 7px rgba(0, 0, 0, .08);
}

.mmlg-flag svg {
    display: block;
    width: 100%;
    height: auto;
}

.mmlg-language-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.mmlg-language-text strong {
    color: inherit;
    font-size: 18px;
    line-height: 1.2;
}

.mmlg-language-text small {
    color: #888;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
}

.mmlg-floating-switcher,
.mmlg-inline-switcher {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 8px 11px;
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: 999px;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 7px 24px rgba(0, 0, 0, .14);
    font-family: inherit;
}

.mmlg-floating-switcher {
    position: fixed;
    left: 18px;
    bottom: 18px;
    z-index: 999999;
}

.mmlg-is-open .mmlg-floating-switcher {
    visibility: hidden;
}

.mmlg-language-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #191919 !important;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none !important;
}

.mmlg-language-link .mmlg-flag {
    width: 23px;
    border-radius: 3px;
}

.mmlg-language-link .mmlg-language-text {
    display: block;
}

.mmlg-language-link .mmlg-language-text strong {
    font-size: 13px;
}

.mmlg-divider {
    width: 1px;
    height: 18px;
    background: #ddd;
}

@media (max-width: 560px) {
    .mmlg-modal {
        padding: 12px;
    }

    .mmlg-dialog {
        padding: 30px 20px;
        border-radius: 15px;
    }

    .mmlg-options {
        grid-template-columns: 1fr;
    }

    .mmlg-language-card {
        min-height: 82px;
    }

    .mmlg-floating-switcher {
        left: 12px;
        bottom: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mmlg-language-card {
        transition: none;
    }
}
