.rhex-multilingual {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: hsl(var(--foreground));
}

.rhex-multilingual-trigger {
  display: inline-flex;
  width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  gap: 0.125rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: hsl(var(--foreground));
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.rhex-multilingual-trigger:hover,
.rhex-multilingual-trigger[aria-expanded="true"] {
  background: hsl(var(--muted));
}

.rhex-multilingual-trigger:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

.rhex-multilingual-icon {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.rhex-multilingual-icon svg {
  display: block;
  width: 1rem;
  height: 1rem;
  max-width: 1rem;
  max-height: 1rem;
}

.rhex-multilingual-code {
  max-width: 1.25rem;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
}

.rhex-multilingual-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 80;
  width: min(14rem, calc(100vw - 2rem));
  max-height: min(24rem, calc(100vh - 5rem));
  overflow: auto;
  border: 1px solid hsl(var(--border));
  border-radius: 0.75rem;
  background: hsl(var(--popover, var(--card)));
  color: hsl(var(--popover-foreground, var(--foreground)));
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
  padding: 0.375rem;
}

.dark .rhex-multilingual-menu {
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.42);
}

.rhex-multilingual-menu[hidden] {
  display: none;
}

.rhex-multilingual-option {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0.625rem 0.75rem;
  text-align: left;
}

.rhex-multilingual-option:hover,
.rhex-multilingual-option:focus-visible {
  background: hsl(var(--muted));
  outline: none;
}

.rhex-multilingual-option-label,
.rhex-multilingual-option-native {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
  line-height: 1.2;
}

.rhex-multilingual-option-native {
  color: hsl(var(--muted-foreground));
  font-size: 0.75rem;
}

.rhex-multilingual-status {
  position: absolute;
  top: calc(100% + 0.375rem);
  right: 0;
  width: max-content;
  max-width: 13rem;
  pointer-events: none;
  color: hsl(var(--muted-foreground));
  font-size: 0.75rem;
  line-height: 1.4;
}

.rhex-mt-admin,
.rhex-mt-admin * {
  box-sizing: border-box;
}

.rhex-mt-admin {
  display: grid;
  gap: 1rem;
}

.rhex-mt-feedback {
  border: 1px solid hsl(var(--border));
  border-radius: 0.75rem;
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  line-height: 1.6;
  padding: 0.75rem 1rem;
}

.rhex-mt-feedback[data-tone="success"] {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.08);
}

.rhex-mt-feedback[data-tone="error"] {
  border-color: hsl(var(--destructive) / 0.35);
  background: hsl(var(--destructive) / 0.08);
  color: hsl(var(--destructive));
}

.rhex-mt-admin-hero,
.rhex-mt-panel {
  border: 1px solid hsl(var(--border));
  border-radius: 0.75rem;
  background: hsl(var(--card));
  color: hsl(var(--card-foreground));
}

.rhex-mt-admin-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem;
}

.rhex-mt-admin-hero h2,
.rhex-mt-panel-title h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
}

.rhex-mt-admin-hero p,
.rhex-mt-panel-title p,
.rhex-mt-actions span {
  margin: 0.25rem 0 0;
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  line-height: 1.6;
}

.rhex-mt-admin-hero a {
  flex: 0 0 auto;
  color: hsl(var(--primary));
  font-size: 0.875rem;
  text-decoration: none;
}

.rhex-mt-admin-form {
  display: grid;
  gap: 1rem;
}

.rhex-mt-panel {
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
}

.rhex-mt-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rhex-mt-field {
  display: grid;
  gap: 0.5rem;
}

.rhex-mt-field span,
.rhex-mt-check span {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
}

.rhex-mt-field input,
.rhex-mt-field select,
.rhex-mt-field textarea,
.rhex-mt-language-row input,
.rhex-mt-language-row select {
  width: 100%;
  min-width: 0;
  border: 1px solid hsl(var(--border));
  border-radius: 0.625rem;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.5;
  padding: 0.625rem 0.75rem;
}

.rhex-mt-field textarea {
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.rhex-mt-check {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.rhex-mt-check input {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}

.rhex-mt-danger span {
  color: hsl(var(--destructive));
}

.rhex-mt-language-list {
  display: grid;
  gap: 0.5rem;
}

.rhex-mt-language-table {
  display: grid;
  gap: 0.5rem;
  overflow-x: auto;
}

.rhex-mt-language-header {
  display: grid;
  min-width: 58rem;
  grid-template-columns: 4.25rem minmax(8rem, 1fr) minmax(7rem, 0.8fr) minmax(8rem, 0.9fr) minmax(8rem, 1fr) minmax(8rem, 1fr) 4.5rem;
  gap: 0.625rem;
  padding: 0 0.5rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
}

.rhex-mt-language-row {
  display: grid;
  min-width: 58rem;
  grid-template-columns: 4.25rem minmax(8rem, 1fr) minmax(7rem, 0.8fr) minmax(8rem, 0.9fr) minmax(8rem, 1fr) minmax(8rem, 1fr) 4.5rem;
  gap: 0.625rem;
  align-items: center;
  border: 1px solid hsl(var(--border));
  border-radius: 0.5rem;
  background: hsl(var(--background));
  padding: 0.625rem;
}

.rhex-mt-language-row label {
  display: grid;
  gap: 0.375rem;
}

.rhex-mt-language-row .rhex-mt-check {
  align-self: center;
}

.rhex-mt-language-row span {
  display: none;
  color: hsl(var(--muted-foreground));
  font-size: 0.75rem;
}

.rhex-mt-language-row .rhex-mt-language-enabled span {
  display: inline;
  color: hsl(var(--foreground));
  font-size: 0.8125rem;
}

.rhex-mt-secondary-button,
.rhex-mt-actions button,
.rhex-mt-delete-language {
  display: inline-flex;
  width: fit-content;
  min-height: 2.5rem;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  padding: 0 1rem;
}

.rhex-mt-secondary-button {
  background: hsl(var(--secondary, var(--muted)));
  color: hsl(var(--secondary-foreground, var(--foreground)));
}

.rhex-mt-delete-language {
  background: hsl(var(--destructive) / 0.1);
  color: hsl(var(--destructive));
}

.rhex-mt-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.rhex-mt-actions button {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.rhex-mt-actions button:disabled,
.rhex-mt-secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

@media (max-width: 768px) {
  .rhex-multilingual-menu {
    right: -3rem;
  }

  .rhex-mt-admin-hero,
  .rhex-mt-grid {
    grid-template-columns: 1fr;
  }

  .rhex-mt-admin-hero {
    display: grid;
  }

  .rhex-mt-language-header {
    display: none;
  }

  .rhex-mt-language-row {
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rhex-mt-language-row label {
    gap: 0.25rem;
  }

  .rhex-mt-language-row span {
    display: inline;
  }

  .rhex-mt-delete-language {
    width: 100%;
  }
}

.translate_api_in_progress {
  position: relative;
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  text-shadow: none !important;
  overflow: hidden;
}

.translate_api_in_progress::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 0.82em;
  transform: translateY(-50%);
  border-radius: 0.22em;
  background: linear-gradient(90deg, rgba(255,255,255,0.82), rgba(245,245,245,0.95), rgba(255,255,255,0.82));
  box-shadow: 0 0 0 1px rgba(255,255,255,0.28) inset;
  pointer-events: none;
}

.dark .translate_api_in_progress::after {
  background: linear-gradient(90deg, rgba(255,255,255,0.62), rgba(255,255,255,0.82), rgba(255,255,255,0.62));
}

.rhex-mt-translation-pending .rhex-mt-pending-text,
.rhex-mt-translation-pending .rhex-mt-pending-input::placeholder {
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  text-shadow: none !important;
}

.rhex-mt-translation-pending .rhex-mt-pending-text {
  position: relative;
  overflow: hidden;
}

.rhex-mt-translation-pending .rhex-mt-pending-text::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 0.82em;
  transform: translateY(-50%);
  border-radius: 0.22em;
  background: linear-gradient(90deg, rgba(255,255,255,0.78), rgba(245,245,245,0.96), rgba(255,255,255,0.78));
  pointer-events: none;
}

.rhex-mt-translation-pending .rhex-mt-pending-input {
  background-image: linear-gradient(90deg, rgba(255,255,255,0.78), rgba(245,245,245,0.96), rgba(255,255,255,0.78));
  background-size: calc(100% - 3rem) 0.82em;
  background-position: 1.5rem 50%;
  background-repeat: no-repeat;
}
