/* Shared language picker for the public website and authenticated training panel. */
.locale-menu { position: relative; flex-shrink: 0; font: 14px/1.4 var(--sans); color: var(--text); }
.locale-menu summary { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 12px; border: 1px solid transparent; border-radius: 10px; background: var(--bg-2); cursor: pointer; list-style: none; font-weight: 600; white-space: nowrap; transition: background .15s, border-color .15s; }
.locale-menu summary::-webkit-details-marker { display: none; }
.locale-menu svg { display: block; flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.locale-menu .locale-globe { color: var(--muted); }
.locale-menu .locale-chevron { width: 16px; height: 16px; color: var(--muted); transition: transform .15s; }
.locale-short { display: none; }
.locale-menu summary:hover { border-color: var(--line-2); background: var(--card-2); }
.locale-menu[open] summary { border-color: var(--line-2); background: var(--card); }
.locale-menu[open] .locale-chevron { transform: rotate(180deg); }
.locale-options { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; display: grid; width: 256px; max-width: calc(100vw - 32px); max-height: min(70dvh, 440px); overflow-y: auto; overscroll-behavior: contain; padding: 8px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--card); box-shadow: var(--shadow); }
.locale-heading { padding: 6px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 600; }
.locale-options a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 10px; border-radius: 8px; color: var(--text); }
.locale-options a:hover { background: var(--bg-2); color: var(--text); }
.locale-options a[aria-current] { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.locale-options a:focus-visible { outline-offset: -2px; }
.locale-code { flex: none; display: grid; place-items: center; width: 30px; height: 26px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .04em; }
.locale-options a[aria-current] .locale-code { border-color: var(--accent-line); color: var(--accent); }
.locale-menu .locale-check { margin-left: auto; color: var(--accent); }
/* The mobile navigation owns its scroll area, so the picker cannot fall below the screen. */
.mmenu { max-height: calc(100dvh - 68px - var(--botnav)); overflow-y: auto; }
.mmenu-foot .locale-menu { width: 100%; }
.mmenu-foot .locale-menu summary { justify-content: flex-start; }
.mmenu-foot .locale-chevron { margin-left: auto; }
.mmenu-foot .locale-options { position: static; width: 100%; max-width: none; max-height: 240px; margin-top: 8px; box-shadow: none; }
html[lang=ja] :is(h1, h2, h3) { line-height: 1.45; letter-spacing: 0; }
@media(max-width: 1200px) { .top-user .locale-name, .app-topbar .locale-name { display: none; }.top-user .locale-short, .app-topbar .locale-short { display: inline; } }
@media(max-width: 560px) { .app-topbar .locale-menu { position: static; }.app-topbar .locale-options { left: 16px; right: 16px; width: auto; max-width: none; } }
@media(prefers-reduced-motion: reduce) { .locale-menu summary, .locale-menu .locale-chevron { transition: none; } }
