#front-language-panel {
  position: fixed; inset: auto; margin: 0; padding: 5px;
  width: min(184px, calc(100vw - 16px)); max-height: calc(100dvh - 16px);
  box-sizing: border-box; overflow: auto;
  background: white; color: #202738; border: 1px solid #dce2ec; border-radius: 10px;
  box-shadow: 0 8px 28px #19294a24;
}
#front-language-panel button {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  min-height: 44px; margin: 0; padding: 0 12px; border: 0; border-radius: 6px;
  background: transparent; color: inherit; box-shadow: none; font: 500 15px/1.35 system-ui;
}
#front-language-panel button span { visibility: hidden; }
#front-language-panel button[aria-pressed="true"] { background: #eff2ff; color: #3347ba; }
#front-language-panel button[aria-pressed="true"] span { visibility: visible; }
#front-language-panel button:hover { background: #f3f5fa; }
#front-language-panel button:focus-visible, .front-language:focus-visible { outline: 2px solid #4056d9; outline-offset: -2px; }
body:has(#front-language-panel:popover-open) .front-language::after { visibility: hidden; }
#dialog[open]:has(> .dialog-head) {
  display: flex; flex-direction: column; padding: 0;
  max-width: calc(100vw - 24px); max-height: calc(100dvh - 32px);
  background: #fff; color: #172035; border: 1px solid #dbe1eb; border-radius: 14px;
  box-shadow: 0 16px 64px #18263e30; overflow: hidden;
}
#dialog::backdrop { background: #19253857; backdrop-filter: blur(3px); }
#dialog > .dialog-head {
  flex: none; gap: 16px; padding: 10px 20px; align-items: center;
  border-bottom: 1px solid #e1e6ef; background: white;
}
#dialog > .dialog-head h2 { font-size: 18px; line-height: 1.4; overflow-wrap: anywhere; }
#dialog > .dialog-head button { flex: none; }
#dialog > .dialog-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
@media (max-width: 600px) {
  #dialog[open]:has(> .dialog-head) { max-height: calc(100dvh - 20px - env(safe-area-inset-bottom)); }
  #dialog > .dialog-head { padding: 6px 14px; }
  #dialog > .dialog-body { padding-inline: 14px; }
}
