.lang-picker {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.lang-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 36px;
    padding: 0 9px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.lang-trigger:hover { color: var(--ink); background: var(--surface-alt); border-color: var(--line-soft); }
.lang-trigger .icon { width: 17px; height: 17px; flex: none; }
.lang-trigger-name {
    max-width: 112px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lang-chevron { flex: none; opacity: 0.55; }

.lang-panel {
    position: absolute;
    top: calc(100% + 8px);
    inset-inline-end: 0;
    z-index: 130;
    display: flex;
    flex-direction: column;
    width: 300px;
    max-height: min(420px, calc(100vh - var(--nav-height) - 24px));
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 18px 40px -18px rgba(29, 23, 43, 0.32);
}
html[data-theme="dark"] .lang-panel { box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.72); }
.lang-panel[hidden], .lang-list[hidden], .lang-list li[hidden], .lang-empty[hidden] { display: none; }

.lang-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line-soft);
    color: var(--faint);
    flex: none;
}
.lang-search .icon { width: 16px; height: 16px; flex: none; }
.lang-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 14px;
}
.lang-search input::placeholder { color: var(--faint); }

.lang-list {
    list-style: none;
    margin: 0;
    padding: 6px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--ink);
    text-decoration: none;
}
.lang-option:hover, .lang-option:focus-visible { background: var(--surface-alt); }
.lang-option[aria-current="true"] { background: var(--brand-soft); }
.lang-option-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.lang-option-name {
    font-size: 14px;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lang-option-meta {
    font-size: 11.5px;
    line-height: 1.35;
    color: var(--faint);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lang-option-check {
    display: inline-flex;
    flex: none;
    color: var(--brand);
    opacity: 0;
}
.lang-option[aria-current="true"] .lang-option-check { opacity: 1; }

.lang-empty {
    margin: 0;
    padding: 18px 14px;
    text-align: center;
    font-size: 13px;
    color: var(--faint);
}

.lang-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 28px;
    font-size: 13px;
}

.lang-links a { color: var(--muted); }
.lang-links a:hover { color: var(--brand); }

.lang-trigger:focus-visible,
.lang-option:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

[dir="rtl"] .nav-links,
[dir="rtl"] .nav-actions {
    margin-left: 0;
    margin-right: auto;
}
[dir="rtl"] .skip-link { left: auto; right: 16px; }
[dir="rtl"] .brand-latin { padding-left: 0; padding-right: 2px; }
[dir="rtl"] .hero-art { right: auto; left: -20px; }
[dir="rtl"] .project-arrow {
    margin-left: 0;
    margin-right: auto;
    transform: translateX(4px) scaleX(-1);
}
[dir="rtl"] .project-card:hover .project-arrow { transform: scaleX(-1); }
[dir="rtl"] .project-badge { right: auto; left: -4px; }
[dir="rtl"] .member-sign {
    border-left: 0;
    border-right: 2px solid var(--line);
    padding-left: 0;
    padding-right: 12px;
}
[dir="rtl"] .member-avatar-group img + img { margin-left: 0; margin-right: -12px; }
[dir="rtl"] .qr-modal-close { right: auto; left: 12px; }
[dir="rtl"] .qr-modal-confirm { text-align: right; }
[dir="rtl"] .qr-modal-id-value { direction: ltr; unicode-bidi: isolate; text-align: left; }
[dir="rtl"] .footer-filing { direction: ltr; }
[dir="rtl"] .back-to-top { right: auto; left: 22px; }
[dir="rtl"] .text-link .icon-arrow-right,
[dir="rtl"] .btn .icon-arrow-right,
[dir="rtl"] .member-link .icon-arrow-right,
[dir="rtl"] .member-link .icon-external { transform: scaleX(-1); }

html[lang="ja"] body {
    font-family: "Inter", "Noto Sans JP", "Hiragino Sans", "Yu Gothic", "Meiryo", -apple-system, sans-serif;
}
html[lang="ko"] body {
    font-family: "Inter", "Noto Sans KR", "Malgun Gothic", "Apple SD Gothic Neo", -apple-system, sans-serif;
}
html[lang="zh-Hant"] body {
    font-family: "Inter", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", -apple-system, sans-serif;
}
html[lang="ar"] body {
    font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", "Geeza Pro", sans-serif;
}
html[lang="fa"] body {
    font-family: Tahoma, "Segoe UI", "Noto Naskh Arabic", "Geeza Pro", sans-serif;
}
html[lang="he"] body {
    font-family: "Segoe UI", Arial, "Noto Sans Hebrew", "David", sans-serif;
}
html[lang="hi"] body {
    font-family: "Nirmala UI", "Noto Sans Devanagari", "Mangal", sans-serif;
}
html[lang="bn"] body {
    font-family: "Nirmala UI", "Noto Sans Bengali", "Vrinda", sans-serif;
}
html[lang="th"] body {
    font-family: "Leelawadee UI", Tahoma, "Noto Sans Thai", sans-serif;
}

@media (max-width: 640px) {
    .lang-trigger { width: 36px; padding: 0; }
    .lang-trigger-name, .lang-chevron { display: none; }
    .lang-panel {
        position: fixed;
        top: calc(var(--nav-height) - 4px);
        inset-inline: 12px;
        width: auto;
        max-height: calc(100vh - var(--nav-height) - 12px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .lang-trigger { transition: none; }
}
