/* Keep the public-page language control aligned with LanguageSwitcher/index.css. */
.creative-language-toggle {
  position: relative;
  width: max-content;
  height: 32px;
  flex: 0 0 auto;
  color: #4d63a5;
  font-size: 13px;
  font-weight: 500;
}

.creative-language-toggle[hidden],
.creative-language-menu[hidden] {
  display: none;
}

.creative-language-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  height: 100%;
  padding: 0 10px;
  box-sizing: border-box;
  border: 1px solid rgba(82, 117, 235, 0.16);
  border-radius: 999px;
  background: linear-gradient(135deg, #fff 0%, #f3f6ff 100%);
  box-shadow: 0 2px 6px rgba(60, 110, 255, 0.05);
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.creative-language-trigger:hover,
.creative-language-toggle.is-open .creative-language-trigger {
  border-color: rgba(82, 117, 235, 0.34);
  background: #edf2ff;
  box-shadow: 0 3px 10px rgba(60, 110, 255, 0.1);
  color: #3c6eff;
}

.creative-language-trigger:focus-visible {
  outline: 2px solid rgba(60, 110, 255, 0.45);
  outline-offset: 2px;
}

.creative-language-globe {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  color: #5878ed;
  pointer-events: none;
}

.creative-language-current {
  flex: 0 0 auto;
  text-align: left;
  white-space: nowrap;
}

.creative-language-chevron {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  color: #94a3b8;
  pointer-events: none;
  transition: transform 0.2s ease;
}

.creative-language-toggle.is-open .creative-language-chevron {
  transform: rotate(180deg);
}

.creative-language-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 1000;
  width: 244px;
  max-width: calc(100vw - 24px);
  max-height: min(340px, calc(100vh - 100px));
  padding: 6px;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid #e7ecf5;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.04);
  scrollbar-width: thin;
  scrollbar-color: #dce3ef transparent;
}

.creative-language-menu::-webkit-scrollbar {
  width: 5px;
}

.creative-language-menu::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background: #dce3ef;
}

.creative-language-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  box-sizing: border-box;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #334155;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.creative-language-option + .creative-language-option {
  margin-top: 2px;
}

.creative-language-option:hover:not(:disabled),
.creative-language-option:focus-visible {
  outline: none;
  background: #f4f7fc;
}

.creative-language-option.is-selected,
.creative-language-option.is-selected:hover,
.creative-language-option.is-selected:focus-visible {
  background: #eef3ff;
  color: #3c6eff;
}

.creative-language-option-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
}

.creative-language-option-check {
  display: none;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.creative-language-option.is-selected .creative-language-option-check {
  display: block;
}

.creative-language-option-badge {
  display: none;
  flex-shrink: 0;
  padding: 2px 6px;
  border: 1px solid #edf0f5;
  border-radius: 5px;
  color: #a5afbf;
  font-size: 10px;
  font-weight: 400;
  line-height: 14px;
}

.creative-language-option:disabled {
  color: #a6afbe;
  cursor: not-allowed;
}

.creative-language-option:disabled .creative-language-option-badge {
  display: block;
}
