/* Language menu and the translation note. Written by hand; tool/i18n.py links it from every page. */
:root{--lm-text:var(--text);--lm-muted:var(--muted);--lm-card:var(--card);--lm-line:var(--line);--lm-hover:var(--bg2);--lm-accent:var(--brand)}
@media (prefers-color-scheme: dark){:root{--lm-accent:#a99fff}}
.langmenu{position:relative;margin:0;flex:none}
.langmenu>summary{display:inline-flex;align-items:center;gap:7px;min-height:44px;padding:0 12px;list-style:none;cursor:pointer;border-radius:999px;color:var(--lm-text);font-size:.9rem;font-weight:500;white-space:nowrap;transition:background .15s}
.langmenu>summary::-webkit-details-marker{display:none}
.langmenu>summary:hover,.langmenu[open]>summary{background:var(--lm-hover)}
.langmenu svg{width:20px;height:20px;flex:none;fill:none;stroke:currentColor;stroke-width:1.7}
.langmenu>summary::after{content:"";width:7px;height:7px;border:solid currentColor;border-width:0 2px 2px 0;transform:rotate(45deg);margin:-4px 2px 0 1px;opacity:.7}
.langmenu ul{position:absolute;right:0;top:calc(100% + 6px);z-index:30;margin:0;padding:6px;list-style:none;min-width:11.5rem;max-height:calc(100vh - 84px);overflow-y:auto;background:var(--lm-card);border:1px solid var(--lm-line);border-radius:14px;box-shadow:0 18px 40px rgba(0,0,0,.35)}
.langmenu li{margin:0;padding:0}
.langmenu li a,.langmenu li a:not(.head-link){display:flex;align-items:center;min-height:44px;margin:0;padding:0 12px;border-radius:9px;color:var(--lm-text);font-size:.95rem;font-weight:500;text-decoration:none;white-space:nowrap}
.langmenu li a:hover{background:var(--lm-hover)}
.langmenu li a[aria-current]{color:var(--lm-accent);font-weight:700}
.langmenu li a[aria-current]::after{content:"\2713";margin-left:auto;padding-left:16px}
/* On a phone the button is the globe alone; the menu still names every language. */
@media (max-width:640px){.langmenu>summary>span{display:none}.langmenu>summary{padding:0 8px}}
.i18n-note{font-size:.92rem;color:var(--lm-muted);border-left:3px solid var(--lm-line);padding:2px 0 2px 12px}
/* The links and the globe stay on one line; when they do not fit beside the name, they take the next row. */
header.top{flex-wrap:wrap;gap:0 12px}
header.top nav{display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-end;margin-left:auto}
header.top nav>a:first-child{margin-left:0}
header.top .langmenu{margin-left:8px}header.top .langmenu li a{margin-left:0}
/* A translated heading can hold one word longer than a phone is wide. */
html:not([lang=en]) :is(h1,h2,h3){overflow-wrap:break-word;hyphens:auto}
/* Korean breaks lines between words, not inside them. */
html[lang=ko] body{word-break:keep-all}
/* On a phone the English header stays on one row at 390 px: tighter links and the globe without its arrow. */
@media (max-width:480px){header.top nav a{margin-left:10px;font-size:0.875rem}header.top .langmenu{margin-left:4px}.langmenu>summary{padding:0 6px}.langmenu>summary::after{display:none}}
@media (max-width:380px){header.top{gap:0 8px}header.top .logo{font-size:1.0625rem;gap:8px}header.top nav a{margin-left:8px;font-size:0.84375rem}header.top .langmenu{margin-left:2px}.langmenu>summary{padding:0 4px}}
