/* Language menu (top-right) — replaces the old BG/EN/RU flags. */
#languages.lang-form {
    display: inline-flex; align-items: center; gap: 6px; margin: 0 0 0 auto; /* stays at the right edge */
    background: none !important; width: auto !important; height: auto !important;
}
/* The menu: current flag + name; opens a list of flags + names (a <details>, no JS needed). */
#languages .lang-menu { position: relative; }
#languages .lang-menu > summary {
    list-style: none; display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
    background: #141414; color: #f0f0f0; border: 1px solid #3a3a3a; border-radius: 6px;
    padding: 5px 26px 5px 9px; font: 500 13px var(--f-ui, 'Inter', sans-serif); position: relative; user-select: none;
}
#languages .lang-menu > summary::-webkit-details-marker { display: none; }
#languages .lang-menu > summary::after {                       /* the small ▾ */
    content: ""; position: absolute; right: 10px; top: 50%; margin-top: -4px; width: 6px; height: 6px;
    border-right: 1.5px solid #aaa; border-bottom: 1.5px solid #aaa; transform: rotate(45deg);
}
#languages .lang-menu[open] > summary::after { margin-top: -1px; transform: rotate(-135deg); }
#languages .lang-menu > summary:hover { border-color: var(--c-line-hover); }
#languages .lang-menu > summary:focus-visible { outline: 2px solid var(--c-line-hover); outline-offset: 2px; }
#languages .lang-flag { width: 20px; height: 15px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(255,255,255,.18); flex: 0 0 auto; display: block; }
#languages .lang-list {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 180px; padding: 6px;
    background: #141414; border: 1px solid #3a3a3a; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.6);
    display: grid; gap: 2px;
}
#languages .lang-list button {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; border-radius: 5px;
    background: none; color: #e8e2d6; font: 500 13.5px var(--f-ui, 'Inter', sans-serif); text-align: left; cursor: pointer;
}
#languages .lang-list button:hover, #languages .lang-list button:focus-visible { background: #242018; color: #fff; outline: none; }
#languages .lang-list button.on { color: var(--c-text); background: #1d1a14; }

/* Login-panel labels/buttons get longer in some languages (e.g. "Anmelden",
   "パスワード") — let them size to their text instead of the old fixed widths. */
#login_panel input.login { width: auto !important; padding: 0 4px; white-space: nowrap; }
#login_panel .mail, #login_panel span.password { width: auto !important; white-space: nowrap; }
