/* Language dropdown (partials/shared/lang-switch.php), used on public card pages and the dashboard. */
.nfc-lang {
    position: relative;
    display: inline-block;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 0.875rem;
    line-height: 1.2;
}

.nfc-lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 6px 10px;
    color: #212529;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 999px;
    cursor: pointer;
    list-style: none;
    font-weight: 600;
}

.nfc-lang-toggle::-webkit-details-marker {
    display: none;
}

.nfc-lang-toggle::after {
    content: "";
    width: 0;
    height: 0;
    border-top: 5px solid currentColor;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
}

.nfc-lang-toggle:focus-visible,
.nfc-lang-menu a:focus-visible {
    outline: 3px solid #0d6efd;
    outline-offset: 2px;
}

.nfc-lang img {
    display: block;
    width: 20px;
    height: 14px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.nfc-lang-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 1100;
    min-width: 200px;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.nfc-lang-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 10px;
    color: #212529;
    border-radius: 6px;
    text-decoration: none;
}

.nfc-lang-menu a:hover {
    background: #f1f3f5;
}

.nfc-lang-menu a[aria-current="true"] {
    font-weight: 700;
    background: #e7f1ff;
}

.nfc-lang-name {
    color: #6c757d;
    font-weight: 400;
}

/* Public card pages: top-right corner of the page, clear of the safe area. It scrolls away with
   the page so it never covers card content; narrow screens get room above the card for it. */
.nfc-lang-corner {
    position: absolute;
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    z-index: 1100;
}

@media (max-width: 520px) {
    body:has(> .nfc-lang-corner) {
        padding-top: 64px;
    }
}
