html.tmf-prisna-style-pill .lang-toggle,
html.tmf-prisna-style-links .lang-toggle {
    --tmf-lang-toggle-width: 220px;
    --tmf-lang-toggle-height: 36px;
    --tmf-lang-toggle-color: #17263b;
    --tmf-lang-toggle-background: #ffffff;

    position: relative;
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0;
    color: var(--tmf-lang-toggle-color);
    font-family: inherit;
    font-size: 13px;
    line-height: 1;
    vertical-align: middle;
}

html.tmf-prisna-style-pill .lang-toggle > input.check-toggle,
html.tmf-prisna-style-links .lang-toggle > input.check-toggle {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

html.tmf-prisna-style-pill .lang-toggle > label,
html.tmf-prisna-style-links .lang-toggle > label {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    margin: 0;
    padding: 0;
    cursor: pointer;
}

html.tmf-prisna-style-pill .lang-toggle > input.check-toggle:focus-visible + label,
html.tmf-prisna-style-links .lang-toggle > input.check-toggle:focus-visible + label {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

html.tmf-prisna-style-pill .lang-toggle > span.on,
html.tmf-prisna-style-pill .lang-toggle > span.off,
html.tmf-prisna-style-links .lang-toggle > span.on,
html.tmf-prisna-style-links .lang-toggle > span.off {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    margin: 0;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
}

html.tmf-prisna-show-flags .lang-toggle span.flag {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 1.35em;
    margin-right: 5px;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    font-size: 1.05em;
    font-style: normal;
    line-height: 1;
}

html:not(.tmf-prisna-show-flags).tmf-prisna-style-pill .lang-toggle span.flag,
html:not(.tmf-prisna-show-flags).tmf-prisna-style-links .lang-toggle span.flag {
    display: none;
}

/* Pill switch. */
html.tmf-prisna-style-pill .lang-toggle {
    width: var(--tmf-lang-toggle-width);
    height: var(--tmf-lang-toggle-height);
    font-weight: 600;
}

html.tmf-prisna-style-pill .lang-toggle > label {
    overflow: hidden;
    background: var(--tmf-lang-toggle-background);
    border: 1px solid var(--tmf-lang-toggle-color);
    border-radius: calc(var(--tmf-lang-toggle-height) / 2);
}

html.tmf-prisna-style-pill .lang-toggle > label::before {
    position: absolute;
    top: 2px;
    bottom: 2px;
    left: 2px;
    width: calc(50% - 2px);
    background: var(--tmf-lang-toggle-color);
    border-radius: calc((var(--tmf-lang-toggle-height) - 4px) / 2);
    content: "";
    transition: transform 140ms ease-out;
}

html.tmf-prisna-style-pill .lang-toggle > input.check-toggle:checked + label::before {
    transform: translateX(100%);
}

html.tmf-prisna-style-pill .lang-toggle > span.on,
html.tmf-prisna-style-pill .lang-toggle > span.off {
    flex: 0 0 50%;
    justify-content: center;
    height: 100%;
    padding: 0 7px;
    color: var(--tmf-lang-toggle-color);
    text-align: center;
    transition: color 100ms ease-out;
}

html.tmf-prisna-style-pill .lang-toggle > input.check-toggle:not(:checked) ~ span.on,
html.tmf-prisna-style-pill .lang-toggle > input.check-toggle:checked ~ span.off {
    color: var(--tmf-lang-toggle-background);
}

/* Plain language labels. */
html.tmf-prisna-style-links .lang-toggle {
    min-height: 28px;
    gap: 9px;
    width: auto;
    font-weight: 500;
}

html.tmf-prisna-style-links .lang-toggle > span.on,
html.tmf-prisna-style-links .lang-toggle > span.off {
    min-height: 28px;
    padding: 0;
    opacity: 0.55;
    transition: opacity 100ms ease-out;
}

html.tmf-prisna-style-links .lang-toggle > span.on::after {
    margin-left: 9px;
    opacity: 0.45;
    content: "/";
}

html.tmf-prisna-style-links .lang-toggle > input.check-toggle:not(:checked) ~ span.on,
html.tmf-prisna-style-links .lang-toggle > input.check-toggle:checked ~ span.off {
    font-weight: 700;
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    html.tmf-prisna-style-pill .lang-toggle > label::before,
    html.tmf-prisna-style-pill .lang-toggle > span.on,
    html.tmf-prisna-style-pill .lang-toggle > span.off,
    html.tmf-prisna-style-links .lang-toggle > span.on,
    html.tmf-prisna-style-links .lang-toggle > span.off {
        transition: none;
    }
}
