[data-cm-language-picker] {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}
.cm-lang-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
}
.cm-lang-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 15px;
}
.cm-lang-flag img { display: block; border-radius: 2px; width: 20px; height: 15px; }
.cm-lang-trigger,
.cm-lang-dialog button {
  min-height: 44px;
  border: 1px solid #67684e;
  border-radius: 9px;
  padding: .45rem .8rem;
  background: #1c1d17;
  color: #f6f3e9;
  font: 700 .875rem/1.25 system-ui, sans-serif;
  cursor: pointer;
}
.cm-lang-trigger:hover,
.cm-lang-dialog button:hover { border-color: #eded43; }
.cm-lang-trigger:focus-visible,
.cm-lang-dialog button:focus-visible,
.cm-lang-option:focus-within { outline: 2px solid #eded43; outline-offset: 2px; }
.cm-lang-dialog {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  flex-direction: column;
  width: min(32rem, calc(100% - 2rem));
  max-height: min(39rem, calc(100dvh - 2rem));
  margin: auto;
  padding: 1.3rem;
  border: 1px solid #65654e;
  border-top: 3px solid #eded43;
  border-radius: 16px;
  background: #141510;
  color: #f6f3e9;
  font-family: system-ui, sans-serif;
  text-align: left;
}
.cm-lang-dialog[open] { display: flex; }
.cm-lang-dialog::backdrop { background: rgb(0 0 0 / 72%); }
.cm-lang-dialog h2 { margin: 0 0 .85rem; color: inherit; font-size: clamp(1.25rem, 4vw, 1.6rem); }
.cm-lang-body { min-height: 0; overflow-y: auto; padding: 0 5px 5px; }
.cm-lang-question { margin: 0 0 .35rem; }
.cm-lang-list { margin: 0; padding: 0; border: 0; min-width: 0; }
.cm-lang-option {
  display: grid;
  grid-template-columns: auto auto minmax(0,1fr);
  align-items: center;
  gap: .65rem;
  margin: 0 0 .35rem;
  min-height: 44px;
  padding: .42rem .55rem;
  border-radius: 7px;
  background: #202117;
  cursor: pointer;
}
.cm-lang-option input { margin: 0; accent-color: #eded43; }
.cm-lang-note { display: block; margin-top: .15rem; color: #d6d4cb; font-size: .79rem; }
.cm-lang-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .55rem; margin-top: .85rem; }
.cm-lang-dialog .cm-lang-primary { border-color: #eded43; background: #eded43; color: #141510; }
.cm-lang-dialog button:disabled { cursor: wait; opacity: .65; }
.cm-lang-error { margin: .35rem 0 0; color: #ffe3a3; }
.cm-lang-error:empty { display: none; }
.cm-lang-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@media (max-width: 36rem) {
  .cm-lang-dialog { inset: auto 0 0; width: 100%; max-width: none; margin: 0; padding-bottom: max(1rem, env(safe-area-inset-bottom)); border-radius: 16px 16px 0 0; }
  .cm-lang-actions button { flex: 1 1 auto; }
}
