#theme-picker, #language-picker {
  background: var(--mc-theme-panel, #111925);
  color: var(--mc-theme-bright, #f0f4f4);
  border: 1px solid var(--mc-theme-outline, #243846);
  border-radius: 18px;
  box-shadow: 0 22px 72px #0006;
  box-sizing: border-box;
  padding: 0;
  width: min(440px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  max-width: none;
}

#theme-picker::backdrop, #language-picker::backdrop { background: #070a12a8; }

#theme-picker form, #language-picker form {
  display: grid;
  gap: 16px;
  padding: clamp(15px, 5vw, 24px);
}

#theme-picker h2, #language-picker h2 { margin: 0; font-size: clamp(21px, 6vw, 26px); line-height: 1.3; }

.theme-options {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  border: 0;
  min-width: 0;
}

.theme-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.theme-option {
  display: grid;
  grid-template-columns: auto 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 8px 10px;
  border: 1px solid var(--mc-theme-outline);
  border-radius: 10px;
  cursor: pointer;
}

.theme-option:hover { background: var(--mc-theme-background); }
.theme-option:has(input:checked) {
  background: var(--mc-theme-panel-raised);
  border-color: var(--mc-theme-lime);
}

.theme-option:has(input:focus-visible), .theme-done:focus-visible, [data-open-theme]:focus-visible, [data-open-language]:focus-visible, [data-language-cancel]:focus-visible {
  outline: 2px solid var(--mc-theme-lime);
  outline-offset: 2px;
}

.theme-option input[type="radio"] {
  accent-color: var(--mc-theme-lime);
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  outline: none;
}

.theme-swatches {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  height: 22px;
  overflow: hidden;
  border-radius: 5px;
  border: 1px solid var(--mc-theme-subtle);
}

.theme-option-copy {
  display: grid;
  gap: 1px;
  font-size: 14px;
  line-height: 1.25;
}

.theme-option-copy > span { color: var(--mc-theme-muted); font-size: 12px; }

.theme-done {
  justify-self: end;
  padding: 9px 18px;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--mc-theme-lime);
  color: var(--mc-theme-ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.language-option { grid-template-columns: auto minmax(0, 1fr); min-height: 44px; line-height: 1.5; }
.language-note { color: var(--mc-theme-muted); margin: 0; font-size: 13px; }
.language-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.source-language-note { color: var(--muted); }
html[lang="en"] .source-language-note { display: none; }
[data-language-cancel] {
  background: transparent;
  color: var(--mc-theme-bright);
  border: 1px solid var(--mc-theme-outline);
  border-radius: 9px;
  padding: 9px 14px;
  cursor: pointer;
  font: inherit;
}

@media (max-width: 415px) {
  .topbar .breadcrumb { display: none; }
  .topbar .top-actions { justify-content: flex-end; min-width: 0; }
  .topbar .demo-label { overflow: hidden; text-overflow: ellipsis; }
  .topbar .icon-button, .topbar .user-button { flex-shrink: 0; }
}
