/* widget.css — Floating selection toolbar */

/* ── Container ────────────────────────────────────────── */

#sel-widget {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 900;

  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 4px 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);

  display: flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
  user-select: none;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  transform: translateX(-50%) translateY(4px);
}

#sel-widget.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* ── Loading pulse ───────────────────────────────────── */

#sel-widget.loading {
  border-color: #2563eb;
  animation: sw-pulse 1.2s ease-in-out infinite;
}

@keyframes sw-pulse {
  0%, 100% { border-color: #2563eb; box-shadow: 0 4px 16px rgba(0,0,0,0.4); }
  50%      { border-color: #60a5fa; box-shadow: 0 4px 16px rgba(37,99,235,0.2); }
}

/* ── Shared button base ──────────────────────────────── */

#sel-widget button {
  height: 28px;
  min-width: 28px;
  padding: 0 6px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #ccc;
  font-size: 12px;
  font-weight: 600;
  font-family: Inter, sans-serif;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s, color 0.1s;
}

#sel-widget button:hover:not(:disabled) {
  background: #2a2a2a;
  color: #fff;
}

#sel-widget button:disabled {
  opacity: 0.35;
  cursor: default;
}

/* ── Separator ───────────────────────────────────────── */

.sw-sep {
  width: 1px;
  height: 18px;
  background: #333;
  margin: 0 3px;
  flex-shrink: 0;
}

/* ── Humanize button accent ──────────────────────────── */

#sw-humanize {
  color: #60a5fa;
  gap: 4px;
}

#sw-humanize:hover:not(:disabled) {
  background: rgba(37,99,235,0.12);
  color: #93bbfc;
}

/* ── Result bar ──────────────────────────────────────── */

#sw-result {
  display: none;
  align-items: center;
  gap: 4px;
}

#sw-status {
  font-size: 11px;
  color: #888;
  padding: 0 4px;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Accept button green ─────────────────────────────── */

#sw-accept {
  color: #4ade80;
}

#sw-accept:hover {
  background: rgba(74,222,128,0.12) !important;
}

/* ── Revert button red ───────────────────────────────── */

#sw-revert {
  color: #f87171;
}

#sw-revert:hover {
  background: rgba(248,113,113,0.12) !important;
}

/* ── Re-humanize button ──────────────────────────────── */

#sw-rehuman {
  color: #60a5fa;
}

#sw-rehuman:hover {
  background: rgba(37,99,235,0.12) !important;
}

/* ── Format bar ──────────────────────────────────────── */

#sw-format {
  display: flex;
  align-items: center;
  gap: 2px;
}
