/* Language switcher with every locale (config/locales.js): the same pill as .drawer-lang button,
   on links (public pages link to themselves in each language) and laid out as a wrapping grid so
   nine native names fit the menu at phone width. Additive: nothing here touches the old pills. */
.drawer-lang.lang-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 6px;
  width: 100%;
  margin: 8px 0 0;
}
.drawer-lang-row .drawer-lang.lang-links { margin-left: 0; flex-basis: 100%; }
.drawer-lang.lang-links a,
.drawer-lang.lang-links button {
  display: block;
  padding: 6px 8px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.drawer-lang.lang-links a[aria-current="true"], .drawer-lang.lang-links button[aria-pressed="true"] {
  color: var(--on-gold);
  background: linear-gradient(135deg, #f0c040, #e08020);
  border-color: transparent;
}
@media (hover: hover) { .drawer-lang.lang-links a:hover, .drawer-lang.lang-links button:hover {
  color: var(--on-gold);
  background: linear-gradient(135deg, #f0c040, #e08020);
  border-color: transparent;
} }

/* "This page is also in …" suggestion (public/js/locale-banner.js). */
.locale-banner {
  position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  z-index: 9000; display: flex; align-items: center; gap: 10px;
  width: min(520px, calc(100vw - 32px)); box-sizing: border-box; padding: 10px 10px 10px 16px;
  border-radius: 14px; background: rgba(20, 18, 34, 0.96); border: 1px solid rgba(240, 192, 64, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); color: var(--text, #f4f1ea); font-size: 13px; line-height: 1.35;
}
.locale-banner > span { flex: 1 1 auto; min-width: 0; }
.locale-banner a.locale-banner-go {
  flex-shrink: 0; padding: 7px 12px; border-radius: 999px; font-weight: 600; color: var(--on-gold); text-decoration: none;
  background: linear-gradient(135deg, #f0c040, #e08020);
}
.locale-banner button {
  flex-shrink: 0; width: 28px; height: 28px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255, 255, 255, 0.06); color: var(--muted, #aaa); font-size: 16px; line-height: 28px;
}

/* Settings → Language with every locale: the grid takes its own line under the label. */
.set-row:has(.set-lang.lang-links) { flex-wrap: wrap; }
.set-lang.lang-links { flex-basis: 100%; margin: 8px 0 2px; }

/* Language dropdown with flags (2026-11-18): views/partials/nav-menu.ejs, Settings (app/portal.js),
   public/js/lang-dd.js. A <details>: works without JS; the script keeps the button on the current
   language and closes it on a choice, outside click or Escape. */
.lang-dd { position: relative; margin-left: auto; }
.lang-dd[open] { z-index: 60; }
/* The row the open dropdown sits in must stack above the buttons around it (auth buttons are positioned). */
*:has(> .lang-dd[open]) { position: relative; z-index: 60; }
.lang-dd > summary { list-style: none; }
.lang-dd > summary::-webkit-details-marker { display: none; }
.lang-dd-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 10px 6px 8px; cursor: pointer;
  border-radius: 999px; color: var(--text, #f4f1ea); font-size: 13px; font-weight: 600; line-height: 1;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.12);
}
@media (hover: hover) { .lang-dd-btn:hover { border-color: rgba(240, 192, 64, 0.5); } }
.lang-dd-btn:focus-visible { outline: 2px solid var(--gold, #f0c040); outline-offset: 2px; }
.lang-dd-chev { color: var(--muted, #aaa); transition: transform 0.15s; }
.lang-dd[open] .lang-dd-chev { transform: rotate(180deg); }
.lang-flag { width: 20px; height: 15px; flex: none; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15); }
.lang-dd-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 210px; max-height: min(60vh, 420px); overflow-y: auto;
  padding: 6px; border-radius: 14px; background: rgba(20, 18, 34, 0.98); border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5); display: grid; gap: 2px;
}
.lang-dd-up .lang-dd-menu { top: auto; bottom: calc(100% + 6px); }
.lang-dd-menu a, .lang-dd-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 8px 10px; border: 0; border-radius: 10px;
  background: none; color: var(--text, #f4f1ea); font: inherit; font-size: 14px; font-weight: 500; text-align: left; text-decoration: none; cursor: pointer;
}
@media (hover: hover) { .lang-dd-menu a:hover, .lang-dd-menu button:hover { background: rgba(255, 255, 255, 0.07); } }
.lang-dd-menu a[aria-current="true"], .lang-dd-menu button[aria-pressed="true"] { background: rgba(240, 192, 64, 0.14); color: var(--gold, #f0c040); font-weight: 600; }
.lang-dd-menu a:focus-visible, .lang-dd-menu button:focus-visible { outline: 2px solid var(--gold, #f0c040); outline-offset: -2px; }
.set-row:has(.lang-dd) { flex-wrap: nowrap; }
@media (prefers-reduced-motion: reduce) { .lang-dd-chev { transition: none; } }
