#fvt-floating {
  position: fixed;
  left: 18px;
  right: auto;
  bottom: 18px;
  z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

#fvt-btn {  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 999px;
  padding: 10px 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  cursor: pointer;
  background: #fff;
  color: #111;
  font-size: 14px;
}

#fvt-panel {
  /* Keep the button fixed in place; the panel must not change layout */
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  margin-top: 0;
  width: 260px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
  overflow: hidden;
  display: none;
}

#fvt-panel.open { display: block; }

#fvt-panel .row {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  gap: 8px;
}

#fvt-panel select {
  width: 100%;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.15);
}

#fvt-hint {
  font-size: 12px;
  opacity: 0.75;
  padding: 10px 12px;
  line-height: 1.35;
  white-space: pre-line;
}

.fvt-toast {
  position: fixed;
  left: 18px;
  right: auto;
  bottom: 82px;
  z-index: 999999;
  background: #111;
  color: #fff;
  padding: 10px 12px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  font-size: 13px;
  opacity: 0;
  transform: translateY(10px);
  transition: 180ms ease;
  max-width: 320px;
}
.fvt-toast.show {
  opacity: 1;
  transform: translateY(0);
}


/* Language selector with flags */
#fvt-btn {
  display: flex;
  align-items: center;
  gap: 10px;
}

#fvt-btn .fvt-flag {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  overflow: hidden;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.04);
}

#fvt-btn .fvt-flag img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

#fvt-btn .fvt-label {
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
}

#fvt-btn .fvt-caret { color: #111; }

#fvt-panel {
  width: 520px;
  max-width: calc(100vw - 40px);
  max-height: min(70vh, 520px);
  overflow: auto;
}

.fvt-lang-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 560px) {
  #fvt-panel { width: 360px; }
  .fvt-lang-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.fvt-lang-item {
  appearance: none;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}

.fvt-lang-item:hover {
  background: rgba(0,0,0,0.04);
}

.fvt-lang-item .fvt-flag {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  overflow: hidden;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.06);
}

.fvt-lang-item .fvt-name {
  font-size: 16px;
}

.fvt-lang-item.is-active .fvt-name {
  font-weight: 600;
}

.fvt-sep {
  border-top: 1px solid rgba(0,0,0,0.06);
}

.fvt-flag svg{width:100%;height:100%;display:block;}

/* Editor click-mode buttons */
#fvt-mode-wrap {
  margin-top: 10px;
}
#fvt-mode-label {
  font-size: 12px;
  opacity: 0.9;
  margin-bottom: 6px;
}
.fvt-mode-row {
  display: flex;
  gap: 6px;
}
.fvt-mode-btn {
  flex: 1;
  padding: 7px 8px;
  border: 1px solid rgba(0,0,0,0.15);
  background: #fff;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}
.fvt-mode-btn.active {
  font-weight: 600;
  box-shadow: 0 1px 0 rgba(0,0,0,0.08) inset;
}
