/* The language switcher: a pill that opens a small menu. Shared by every page. */
.lang-switch { position: relative; display: inline-flex; margin: 0; font-size: .86rem; }
.lang-switch details { position: relative; }
.lang-switch summary {
    display: inline-flex; align-items: center; gap: 6px;
    height: 36px; padding: 0 10px 0 9px; box-sizing: border-box;
    list-style: none; cursor: pointer; user-select: none;
    font-weight: 700; letter-spacing: .04em; color: inherit;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
    background: color-mix(in srgb, currentColor 5%, transparent);
    transition: background .16s, border-color .16s, box-shadow .16s;
}
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-switch summary:hover,
.lang-switch details[open] summary {
    background: color-mix(in srgb, currentColor 10%, transparent);
    border-color: color-mix(in srgb, currentColor 38%, transparent);
}
.lang-switch summary:focus-visible { outline: 2px solid #0d9488; outline-offset: 2px; }
.lang-switch svg {
    width: 17px; height: 17px; flex: 0 0 auto;
    fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.lang-switch .lang-caret { width: 13px; height: 13px; opacity: .65; transition: transform .18s; }
.lang-switch details[open] .lang-caret { transform: rotate(180deg); }

.lang-menu {
    position: absolute; top: calc(100% + 8px); right: 0; z-index: 9500;
    min-width: 190px; max-height: min(60vh, 340px); overflow-y: auto;
    display: flex; flex-direction: column; gap: 2px; padding: 6px;
    background: var(--panel, #fff); color: var(--ink, #1f2937);
    border: 1px solid var(--line, #e5e7eb); border-radius: 14px;
    box-shadow: 0 18px 44px -14px rgba(15, 23, 42, .32), 0 2px 6px rgba(15, 23, 42, .08);
    animation: lang-menu-in .14s ease-out;
}
@keyframes lang-menu-in { from { opacity: 0; transform: translateY(-4px); } }
.lang-menu button {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    width: 100%; padding: 9px 10px; margin: 0;
    font: inherit; font-weight: 600; letter-spacing: 0; text-align: left; white-space: nowrap;
    color: inherit; background: transparent; border: 0; border-radius: 9px; cursor: pointer;
}
.lang-menu button:hover,
.lang-menu button:focus-visible { background: rgba(13, 148, 136, .1); outline: none; }
.lang-menu .lang-tag {
    font-size: .68rem; font-weight: 800; letter-spacing: .08em; opacity: .5;
    padding: 2px 6px; border-radius: 6px; border: 1px solid currentColor;
}
.lang-menu button.on { color: #0d9488; background: rgba(13, 148, 136, .08); }
.lang-menu button.on .lang-tag { opacity: 1; background: #0d9488; border-color: #0d9488; color: #fff; }
@media (prefers-reduced-motion: reduce) { .lang-menu { animation: none; } }
@media (max-width: 520px) { .lang-switch summary { height: 34px; padding: 0 8px; } }

/* Login and password pages: the switcher floats over the backdrop, beside the theme button. */
.auth-lang { position: absolute; top: 20px; right: 74px; z-index: 4; color: #fff; }
@media (max-width: 520px) { .auth-lang { top: 10px; right: 60px; } }

/* Visit history: the language a visit ran in, and the filter by it. */
.pill.lang { background: color-mix(in srgb, currentColor 9%, transparent); color: inherit; font-weight: 600; }
.lang-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; font-size: .88rem; }
.lang-filter-label { font-weight: 600; margin-right: 2px; }
.lang-filter a {
    padding: 6px 13px; border-radius: 999px; font-weight: 700; text-decoration: none; color: inherit;
    border: 1px solid color-mix(in srgb, currentColor 20%, transparent);
    background: color-mix(in srgb, currentColor 4%, transparent); transition: background .15s, border-color .15s;
}
.lang-filter a:hover { background: color-mix(in srgb, currentColor 10%, transparent); text-decoration: none; }
.lang-filter a.on { background: #0d9488; border-color: #0d9488; color: #fff; }
