.lang-pop { position: relative; }
.lang-pop-btn { cursor: pointer; }
.lang-pop-panel {
    position: absolute;
    z-index: 1080;
    top: calc(100% + 0.45rem);
    inset-inline-end: 0;
    width: 15.5rem;
    max-width: calc(100vw - 1.5rem);
    max-height: min(72vh, 24rem);
    overflow: auto;
    padding: 0.4rem;
    border: 1px solid var(--line, #e4e4e7);
    border-radius: 0.9rem;
    background: var(--surface-elevated, #fff);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
}
.lang-pop-panel[hidden] { display: none !important; }
.lang-pop-search {
    width: 100%;
    margin: 0 0 0.3rem;
    border: 1px solid var(--line, #e4e4e7);
    border-radius: 0.6rem;
    background: transparent;
    color: inherit;
    font: inherit;
    min-height: 2.25rem;
    padding: 0.35rem 0.7rem;
}
.lang-pop-grid {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.lang-pop-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 2.35rem;
    padding: 0.3rem 0.7rem;
    border-radius: 0.55rem;
    color: inherit;
    text-decoration: none;
    font-weight: 650;
}
.lang-pop-item .bi { font-size: 1.05rem; }
.lang-pop-name { display: inline-flex; align-items: center; gap: 0.5rem; min-width: 0; }
.lang-pop-flag {
    width: 1.15rem;
    height: 0.78rem;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.16);
    flex: 0 0 auto;
}
.lang-pop-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.15rem;
    height: 0.95rem;
    padding: 0 0.2rem;
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
    box-shadow: inset 0 0 0 1px currentColor;
    opacity: 0.75;
    flex: 0 0 auto;
    font-family: system-ui, sans-serif;
}
.lang-pop-item:hover { background: color-mix(in srgb, var(--accent, #0d7a72) 12%, transparent); }
.lang-pop-item.is-on {
    background: var(--ink, #111);
    color: var(--surface, #fff);
}
.lang-pop-empty { margin: 0.4rem 0 0; color: var(--muted, #666); }
@media (max-width: 760px) {
    .lang-pop-panel {
        width: min(15.5rem, calc(100vw - 1.5rem));
    }
}
html[data-color-scheme="dark"] .lang-pop-panel {
    background: var(--surface-elevated, #1c1c1f);
    border-color: var(--line, #333);
}
