/* UI layer — language switch: compact segmented control, fixed top-right, mirrored by the "Unofficial fan concept" chip
   top-left (same height, same glass; sections.css). Flags are inline SVG <symbol>s (index.html), decorative; the EN / ES / CA
   text stays visible next to each flag at every width. The top-centre island sits between them on wide screens; below 1000 px
   wide the pair steps down under the island while a preview is active (core's own rule, kept: the island is never covered). */
html:root:root #lang-switch {
  top: calc(env(safe-area-inset-top, 0px) + var(--row-top)); right: calc(env(safe-area-inset-right, 0px) + 12px + var(--sbw, 0px)); bottom: auto;
  gap: 2px; padding: 3px; background: var(--ov-bg); border: 1px solid var(--ov-line); border-radius: var(--radius-pill); box-shadow: var(--ov-shadow);
  transition: top var(--dur-2) var(--ease-out);
}
/* Lyrics open: the pair stays at the top (the modal bar sits below it), so nothing jumps and the bottom keeps the waveform + transport only. */
@media (max-width: 999px) {
  html:root:root[data-modal="closed"]:not([data-player="idle"]) #lang-switch { top: calc(env(safe-area-inset-top, 0px) + var(--row-island)); }
}
#lang-switch button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 44px; min-height: 44px; padding: 0 12px;
  font: 700 0.8125rem / 1 var(--font-body); letter-spacing: 0.06em; color: var(--c-cream); background: transparent; border: 0; border-radius: var(--radius-pill);
  cursor: pointer; transition: background-color 180ms var(--ov-ease), color 180ms var(--ov-ease);
}
#lang-switch button:hover { background: rgb(242 230 201 / 0.14); }
#lang-switch button[aria-pressed="true"] { color: var(--c-night); background: var(--c-cream); }
#lang-switch :focus-visible { outline-offset: 0; }

.flag { position: relative; display: block; flex: none; width: 22px; height: 15px; border-radius: 3px; overflow: hidden; }
.flag svg { display: block; width: 22px; height: 15px; }
.flag::after { content: ""; position: absolute; inset: 0; border-radius: 3px; box-shadow: inset 0 0 0 1px rgb(242 230 201 / 0.35); } /* 1 px inner border keeps flags readable on dark */

/* The EN / ES / CA signature is never hidden: below 400 px the segments just get tighter. */
@media (max-width: 400px) {
  #lang-switch button { min-width: 44px; padding: 0 6px; gap: 4px; font-size: 0.6875rem; letter-spacing: 0.04em; }
}
