
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ===== CSS VARIABLES ===== */
:root {
  /* ---- Brand tokens (override via branding.config.js) ---- */
  --ts-brand-primary: #4285F4;
  --ts-brand-primary-rgb: 124, 90, 255;
  --ts-brand-primary-hover: #6d28d9;
  --ts-brand-primary-soft: rgba(124, 90, 255, 0.12);
  --ts-brand-primary-border: rgba(124, 90, 255, 0.35);
  --ts-brand-primary-glow: rgba(124, 90, 255, 0.35);
  --ts-brand-gradient: linear-gradient(135deg, #4285F4, #6d28d9);

  --ql-bg: #0a0a0b;
  --ql-bg-elevated: #111113;
  --ql-bg-surface: #18181b;
  --ql-bg-hover: #1f1f23;
  --ql-border: rgba(255,255,255,0.06);
  --ql-border-hover: rgba(255,255,255,0.12);
  --ql-text-primary: #f4f4f5;
  --ql-text-secondary: #a1a1aa;
  --ql-text-muted: #71717a;
  --ql-accent: var(--ts-brand-primary);
  --ql-accent-hover: var(--ts-brand-primary-hover);
  --ql-accent-glow: rgba(66, 133, 244,0.25);
  --ql-accent-subtle: rgba(66, 133, 244,0.08);
  --ql-success: #34d399;
  --ql-success-bg: rgba(52,211,153,0.08);
  --ql-warning: #fbbf24;
  --ql-warning-bg: rgba(251,191,36,0.08);
  --ql-danger: #f87171;
  --ql-danger-bg: rgba(248,113,113,0.08);
  --ql-radius: 16px;
  --ql-radius-sm: 10px;
  --ql-radius-xs: 8px;
  --ql-shadow: 0 24px 80px -12px rgba(0,0,0,0.6), 0 0 0 1px var(--ql-border);
  --ql-shadow-hover: 0 32px 100px -12px rgba(0,0,0,0.7), 0 0 0 1px var(--ql-border-hover);
  --ql-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --ql-glass: rgba(17,17,19,0.85);
}

/* ===== MAIN CONTAINER ===== */
#ql-floating {
  position: fixed;
  width: 400px;
  z-index: 999999999;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  border-radius: var(--ql-radius);
  overflow: hidden;
  background: var(--ql-bg);
  border: 1px solid var(--ql-border);
  box-shadow: var(--ql-shadow);
  transition: box-shadow var(--ql-transition), height 0.3s ease;
  display: flex;
  flex-direction: column;
  min-height: 60px;
  overflow-y: auto;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

#ql-floating:hover {
  box-shadow: var(--ql-shadow-hover);
}

#ql-floating * {
  box-sizing: border-box;
}

/* Ensure all interactive elements are clickable */
#ql-floating button,
#ql-floating input,
#ql-floating textarea,
#ql-floating label,
#ql-floating a,
#ql-floating select {
  pointer-events: auto !important;
  position: relative;
  z-index: 1;
}

/* ===== MINIMIZED ===== */
#ql-floating.ql-minimized {
  height: auto !important;
  min-height: 52px;
  overflow: hidden;
}
#ql-floating.ql-minimized #ql-body,
#ql-floating.ql-minimized #ql-footer,
#ql-floating.ql-minimized #ql-resize-handle,
#ql-floating.ql-minimized #ql-notif-panel {
  display: none !important;
}

/* ===== HEADER ===== */
#ql-header {
  cursor: move;
  padding: 14px 18px;
  background: var(--ql-bg-elevated);
  border-bottom: 1px solid var(--ql-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  flex-shrink: 0;
}

.ql-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ql-brand {
  font-size: 14px;
  font-weight: 700;
  color: var(--ql-text-primary);
  letter-spacing: -0.02em;
}

.ql-badge-pro-header {
  font-size: 9px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--ql-accent), #34A853);
  color: #fff;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ql-header-right {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.ql-icon-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: var(--ql-radius-xs);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all var(--ql-transition);
  color: var(--ql-text-muted);
  position: relative;
}
.ql-icon-btn:hover {
  background: var(--ql-bg-hover);
  color: var(--ql-text-primary);
}

/* ===== NOTIFICATION BADGE ===== */
.ql-notif-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 0 8px rgba(239,68,68,0.4);
}

/* ===== NOTIFICATION PANEL ===== */
.ql-notif-panel {
  position: absolute;
  top: 52px;
  right: 8px;
  left: 8px;
  background: var(--ql-bg-surface);
  border: 1px solid var(--ql-border);
  border-radius: 14px;
  box-shadow: 0 16px 48px -12px rgba(0,0,0,0.5);
  z-index: 10;
  max-height: 300px;
  overflow-y: auto;
  animation: ql-slide-down 0.2s ease;
}
@keyframes ql-slide-down {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.ql-notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--ql-border);
  font-size: 13px;
  font-weight: 700;
  color: var(--ql-text-primary);
}
.ql-notif-close-btn {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--ql-text-muted);
  padding: 4px 8px;
  border-radius: 6px;
  transition: all var(--ql-transition);
}
.ql-notif-close-btn:hover { background: var(--ql-bg-hover); color: var(--ql-text-primary); }
.ql-notif-list { padding: 8px; }
.ql-notif-empty {
  text-align: center;
  color: var(--ql-text-muted);
  font-size: 12px;
  padding: 20px 0;
  margin: 0;
}
.ql-notif-item {
  padding: 12px 14px;
  border-radius: var(--ql-radius-sm);
  background: var(--ql-bg-hover);
  margin-bottom: 6px;
  border: 1px solid var(--ql-border);
  transition: all var(--ql-transition);
}
.ql-notif-item:hover {
  border-color: var(--ql-border-hover);
}
.ql-notif-item:last-child { margin-bottom: 0; }
.ql-notif-item-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--ql-text-primary);
  margin-bottom: 3px;
}
.ql-notif-item-msg {
  font-size: 11px;
  color: var(--ql-text-secondary);
  margin-bottom: 6px;
  line-height: 1.5;
}
.ql-notif-link {
  font-size: 11px;
  color: var(--ql-accent);
  text-decoration: none;
  font-weight: 600;
  transition: opacity var(--ql-transition);
}
.ql-notif-link:hover { opacity: 0.8; }
.ql-notif-item-date {
  font-size: 10px;
  color: var(--ql-text-muted);
  margin-top: 6px;
}

/* ===== CUSTOM ALERT ===== */
.ql-custom-alert {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  border-radius: var(--ql-radius);
  backdrop-filter: blur(8px);
}
.ql-alert-content {
  background: var(--ql-bg-surface);
  border: 1px solid var(--ql-border);
  border-radius: var(--ql-radius);
  padding: 28px 24px;
  text-align: center;
  width: 85%;
  max-width: 300px;
  box-shadow: 0 24px 60px -12px rgba(0,0,0,0.6);
  animation: ql-alert-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes ql-alert-in {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.ql-alert-icon { font-size: 40px; margin-bottom: 12px; }
.ql-alert-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ql-text-primary);
  margin-bottom: 8px;
}
.ql-alert-message {
  font-size: 13px;
  color: var(--ql-text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}
.ql-alert-ok-btn {
  padding: 10px 36px;
  border: none;
  border-radius: var(--ql-radius-sm);
  background: linear-gradient(135deg, var(--ql-accent), #34A853);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--ql-transition);
  box-shadow: 0 4px 16px var(--ql-accent-glow);
}
.ql-alert-ok-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px var(--ql-accent-glow);
}


/* ===== BODY ===== */
#ql-body {
  padding: 18px;
  flex: 1;
  overflow-y: auto;
}

/* ===== PROFILE CARD ===== */
.ql-profile-card {
  background: var(--ql-bg-surface);
  border: 1px solid var(--ql-border);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
  transition: border-color var(--ql-transition);
}
.ql-profile-card:hover {
  border-color: var(--ql-border-hover);
}

.ql-profile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.ql-profile-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ql-profile-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ql-text-primary);
  letter-spacing: -0.01em;
}

.ql-status-badge {
  font-size: 9px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 6px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ql-badge-test {
  background: var(--ql-warning-bg);
  color: var(--ql-warning);
  border: 1px solid rgba(251,191,36,0.15);
}

.ql-badge-pro {
  background: var(--ql-success-bg);
  color: var(--ql-success);
  border: 1px solid rgba(52,211,153,0.15);
}

/* ===== SYNC STATUS ===== */
.ql-sync-status {
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 8px;
  padding: 0;
}

.ql-sync-ok .ql-sync-text {
  color: var(--ql-success);
}

.ql-sync-waiting .ql-sync-text {
  color: var(--ql-warning);
}

/* ===== TRIAL COUNTDOWN ===== */
.ql-trial-countdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--ql-border);
  margin-top: 8px;
}

.ql-countdown-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.ql-countdown-icon { font-size: 13px; }
.ql-countdown-label {
  color: var(--ql-text-secondary);
  font-weight: 500;
}
.ql-countdown-time {
  margin-left: auto;
  font-family: 'SF Mono', 'Fira Code', 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--ql-warning);
  letter-spacing: 0.03em;
}
.ql-countdown-expired {
  color: var(--ql-danger);
  font-weight: 600;
  font-size: 12px;
}

.ql-trial-bar {
  width: 100%;
  height: 6px;
  border-radius: 6px;
  background: var(--ql-bg-hover);
  overflow: hidden;
  position: relative;
}

.ql-trial-bar-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--ql-accent), #34A853, #38bdf8);
  background-size: 200% 100%;
  animation: ql-bar-shimmer 3s ease infinite;
  transition: width 1s ease;
  box-shadow: 0 0 8px rgba(var(--ts-brand-primary-rgb), 0.4);
}

.ql-trial-bar-fill.ql-bar-urgent {
  background: linear-gradient(90deg, #ef4444, #f97316);
  background-size: 200% 100%;
  animation: ql-bar-shimmer 1.5s ease infinite, ql-bar-pulse 2s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.ql-trial-bar-fill.ql-bar-expired {
  background: var(--ql-danger);
}

@keyframes ql-bar-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes ql-bar-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ===== LIFETIME LICENSE ===== */
.ql-lifetime-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;

  padding: 14px 12px;
  border-radius: 14px;

  background:
    linear-gradient(
      135deg,
      rgba(var(--ts-brand-primary-rgb),0.14),
      rgba(255,66,66,0.08)
    );

  border: 1px solid rgba(var(--ts-brand-primary-rgb),0.22);

  position: relative;
  overflow: hidden;
}

.ql-lifetime-card::before {
  content: '';
  position: absolute;
  inset: 0;

  background:
    radial-gradient(
      circle at top right,
      rgba(var(--ts-brand-primary-rgb),0.18),
      transparent 45%
    );

  pointer-events: none;
}

.ql-lifetime-icon {
  font-size: 20px;
  line-height: 1;

  color: var(--ts-brand-primary);

  text-shadow:
    0 0 12px rgba(var(--ts-brand-primary-rgb),0.45),
    0 0 24px rgba(var(--ts-brand-primary-rgb),0.25);

  animation: ql-lifetime-float 3s ease-in-out infinite;
}

.ql-lifetime-label {
  font-size: 11px;
  font-weight: 800;

  letter-spacing: 0.18em;
  text-transform: uppercase;

  background: linear-gradient(
    90deg,
    var(--ts-brand-primary),
    #ffffff,
    #fda4af
  );

  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ql-lifetime-status {
  font-size: 11px;
  font-weight: 500;
  color: var(--ql-text-secondary);

  opacity: 0.9;
}

@keyframes ql-lifetime-float {
  0%,100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-3px);
  }
}

/* ===== TEXTAREA ===== */
#ql-floating textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--ql-border);
  background: var(--ql-bg-surface);
  color: var(--ql-text-primary);
  font-size: 13px;
  font-family: 'Inter', -apple-system, sans-serif;
  transition: border-color var(--ql-transition), box-shadow var(--ql-transition);
  box-sizing: border-box;
  outline: none;
  resize: vertical;
  min-height: 64px;
  margin-bottom: 10px;
  line-height: 1.5;
}

#ql-floating textarea:focus {
  border-color: var(--ql-accent);
  box-shadow: none;
}

#ql-floating textarea::placeholder {
  color: var(--ql-text-muted);
}

/* ===== ACTION BAR ===== */
.ql-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 0;
  gap: 8px;
}

.ql-action-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.ql-action-center {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ql-action-right-send {
  flex-shrink: 0;
}

.ql-tool-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--ql-border);
  background: var(--ql-bg-surface);
  border-radius: var(--ql-radius-xs);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--ql-transition);
  color: var(--ql-text-muted);
}
.ql-tool-btn:hover {
  background: var(--ql-accent-subtle);
  border-color: rgba(var(--ts-brand-primary-rgb),0.2);
  color: var(--ql-accent);
  box-shadow: 0 0 12px var(--ql-accent-glow);
  transform: translateY(-1px);
}
.ql-tool-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

/* Tool button loading */
.ql-tool-loading {
  animation: ql-spin 0.8s linear infinite;
}
@keyframes ql-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Recording indicator */
.ql-recording {
  background: var(--ql-danger-bg) !important;
  border-color: rgba(248,113,113,0.3) !important;
  color: var(--ql-danger) !important;
  animation: ql-pulse 1.5s ease-in-out infinite;
}
@keyframes ql-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(248,113,113,0.3); }
  50% { box-shadow: 0 0 0 8px rgba(248,113,113,0); }
}

.ql-toggle-label-inline {
  font-size: 10px;
  font-weight: 600;
  color: var(--ql-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ===== SEND BUTTON ===== */
.ql-send-btn {
  padding: 8px 22px;
  border: none;
  border-radius: var(--ql-radius-sm);
  background: linear-gradient(135deg, var(--ql-accent), #34A853);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--ql-transition);
  box-shadow: 0 2px 12px var(--ql-accent-glow);
  letter-spacing: -0.01em;
}
.ql-send-btn:hover {
  box-shadow: 0 6px 24px var(--ql-accent-glow);
  transform: translateY(-1px);
  filter: brightness(1.1);
}
.ql-send-btn:active {
  transform: translateY(0);
  filter: brightness(0.95);
}
.ql-send-btn.ql-sending,
.ql-send-btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* ===== TOGGLE ===== */
.ql-toggle {
  position: relative;
  width: 36px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
}
.ql-toggle input {
  opacity: 0; width: 0; height: 0; position: absolute;
}
.ql-toggle-slider {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: var(--ql-bg-hover);
  border: 1px solid var(--ql-border);
  transition: all 0.3s ease;
}
.ql-toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--ql-text-muted);
  top: 1px; left: 1px;
  transition: all 0.3s ease;
}
.ql-toggle input:checked + .ql-toggle-slider {
  background: var(--ql-accent-subtle);
  border-color: rgba(var(--ts-brand-primary-rgb),0.3);
}
.ql-toggle input:checked + .ql-toggle-slider::before {
  transform: translateX(16px);
  background: var(--ql-accent);
  box-shadow: none;
}

/* ===== LOG ===== */
#ql-log, #ql-license-log {
  font-size: 12px;
  margin-top: 10px;
  min-height: 18px;
  padding: 0 4px;
  font-weight: 600;
  text-align: center;
}
.ql-log-success { color: var(--ql-success) !important; }
.ql-log-error { color: var(--ql-danger) !important; }
.ql-log-info { color: var(--ql-accent) !important; }

/* ===== SHORTCUTS ===== */
.ql-shortcuts-section {
  margin-top: 8px;
}

.ql-shortcuts-title {
  display: block;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ql-text-muted);
  margin-bottom: 12px;
}

.ql-shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.ql-chip {
  padding: 8px 4px;
  border-radius: var(--ql-radius-xs);
  border: 1px solid var(--ql-border);
  background: var(--ql-bg-surface);
  color: var(--ql-text-secondary);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--ql-transition);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.ql-chip svg {
  flex-shrink: 0;
}
.ql-chip:hover {
  background: var(--ql-accent-subtle);
  border-color: rgba(var(--ts-brand-primary-rgb),0.2);
  color: var(--ts-brand-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px var(--ql-accent-glow);
}

/* ===== LICENSE GATE ===== */
.ql-license-gate {
  text-align: center;
  padding: 24px 0;
}
.ql-lock-icon { font-size: 40px; margin-bottom: 16px; }
.ql-gate-title { font-size: 17px; font-weight: 700; color: var(--ql-text-primary); margin-bottom: 6px; letter-spacing: -0.02em; }
.ql-gate-desc { font-size: 13px; color: var(--ql-text-secondary); margin-bottom: 20px; line-height: 1.5; }

#ql-floating input {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--ql-radius-sm);
  border: 1px solid var(--ql-border);
  background: var(--ql-bg-surface);
  color: var(--ql-text-primary);
  font-size: 13px;
  font-family: 'Inter', -apple-system, sans-serif;
  transition: all var(--ql-transition);
  box-sizing: border-box;
  outline: none;
}
#ql-floating input:focus {
  border-color: var(--ql-accent);
  box-shadow: none;
}
#ql-floating input::placeholder { color: var(--ql-text-muted); }

#ql-validate-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: var(--ql-radius-sm);
  background: linear-gradient(135deg, var(--ql-accent), #34A853);
  color: white;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--ql-transition);
  margin-top: 8px;
  box-shadow: 0 4px 16px var(--ql-accent-glow);
  letter-spacing: -0.01em;
}
#ql-validate-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px var(--ql-accent-glow);
  filter: brightness(1.1);
}

/* ===== FOOTER ===== */
.ql-footer {
  padding: 10px 18px;
  border-top: 1px solid var(--ql-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--ql-text-muted);
}
.ql-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.ql-footer-version {
  font-size: 9px;
  color: var(--ql-text-muted);
  opacity: 0.5;
}
.ql-support-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ql-text-muted);
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  transition: color var(--ql-transition);
  cursor: pointer;
}
.ql-support-link:hover {
  color: var(--ql-accent);
}
.ql-support-link svg {
  flex-shrink: 0;
}

.ql-badge-mz {
  font-size: 9px;
  font-weight: 600;
  color: var(--ql-text-muted);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 2px 8px;
  border-radius: 99px;
  letter-spacing: 0.02em;
}

/* ===== SWEETALERT EXPIRED MODAL ===== */
.ql-sweetalert-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: inherit;
}
.ql-sweetalert-overlay.ql-sweetalert-visible {
  opacity: 1;
}
.ql-sweetalert-box {
  background: var(--ql-surface);
  border: 1px solid var(--ql-border);
  border-radius: 20px;
  padding: 32px 28px;
  text-align: center;
  max-width: 320px;
  width: 90%;
  transform: scale(0.85);
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 25px 60px rgba(0,0,0,0.5);
}
.ql-sweetalert-visible .ql-sweetalert-box {
  transform: scale(1);
}
.ql-sweetalert-icon {
  font-size: 48px;
  margin-bottom: 12px;
  animation: ql-shake 0.6s ease 0.3s both;
}
@keyframes ql-shake {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-12deg); }
  40% { transform: rotate(12deg); }
  60% { transform: rotate(-8deg); }
  80% { transform: rotate(8deg); }
}
.ql-sweetalert-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--ql-text);
  margin: 0 0 8px;
}
.ql-sweetalert-text {
  font-size: 13px;
  color: var(--ql-text-secondary);
  line-height: 1.5;
  margin: 0 0 20px;
}
.ql-sweetalert-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ql-sweetalert-btn {
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  text-decoration: none;
  text-align: center;
  transition: all 0.2s ease;
}
.ql-sweetalert-btn-primary {
  background: linear-gradient(135deg, var(--ql-accent), #34A853);
  color: #fff;
  box-shadow: 0 4px 15px var(--ql-accent-glow);
}
.ql-sweetalert-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--ql-accent-glow);
}
.ql-sweetalert-btn-secondary {
  background: rgba(255,255,255,0.06);
  color: var(--ql-text-secondary);
  border: 1px solid var(--ql-border);
}
.ql-sweetalert-btn-secondary:hover {
  background: rgba(255,255,255,0.1);
}


.ql-resize-handle {
  height: 10px;
  cursor: ns-resize;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ql-resize-handle::after {
  content: '';
  width: 40px;
  height: 3px;
  border-radius: 3px;
  background: var(--ql-border);
  transition: background var(--ql-transition);
}
.ql-resize-handle:hover::after {
  background: var(--ql-accent);
  box-shadow: 0 0 8px var(--ql-accent-glow);
}

.ql-field { margin-bottom: 14px; }
.ql-field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ql-text-muted);
  margin-bottom: 8px;
}

/* ===== LIGHT MODE ===== */
#ql-floating.ql-light {
  --ql-bg: #ffffff;
  --ql-bg-elevated: #fafafa;
  --ql-bg-surface: #f4f4f5;
  --ql-bg-hover: #e4e4e7;
  --ql-border: rgba(0,0,0,0.06);
  --ql-border-hover: rgba(0,0,0,0.12);
  --ql-text-primary: #18181b;
  --ql-text-secondary: #52525b;
  --ql-text-muted: #a1a1aa;
  --ql-accent-subtle: rgba(66, 133, 244,0.08);
  --ql-accent-glow: rgba(66, 133, 244,0.25);
  --ql-shadow: 0 24px 80px -12px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.04);
  --ql-shadow-hover: 0 32px 100px -12px rgba(0,0,0,0.18), 0 0 0 1px rgba(0,0,0,0.06);
}

/* ===== PAYMENT UI ===== */
.ql-gate-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  color: var(--ql-text-muted);
  font-size: 11px;
}
.ql-gate-divider::before, .ql-gate-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--ql-border);
}

.ql-buy-btn {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--ql-accent);
  background: var(--ql-accent-subtle);
  color: var(--ql-accent);
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--ql-radius-sm);
  cursor: pointer;
  transition: all var(--ql-transition);
}
.ql-buy-btn:hover {
  background: var(--ql-accent);
  color: #fff;
  box-shadow: 0 4px 16px var(--ql-accent-glow);
}

.ql-pay-section { padding: 0; }
.ql-pay-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--ql-text-primary);
  margin-bottom: 14px;
  text-align: center;
  letter-spacing: -0.02em;
}

.ql-packages-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.ql-pay-loading {
  text-align: center;
  color: var(--ql-text-muted);
  font-size: 12px;
  padding: 20px 0;
}

.ql-pkg-card {
  background: var(--ql-bg-surface);
  border: 1px solid var(--ql-border);
  border-radius: 14px;
  padding: 14px 16px;
  position: relative;
  transition: all var(--ql-transition);
}
.ql-pkg-card:hover {
  border-color: var(--ql-border-hover);
}
.ql-pkg-highlight {
  border-color: var(--ql-accent);
  background: var(--ql-accent-subtle);
  box-shadow: 0 0 20px var(--ql-accent-glow);
}

.ql-pkg-popular {
  position: absolute;
  top: -8px;
  right: 12px;
  background: linear-gradient(135deg, var(--ql-accent), #34A853);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 6px;
  letter-spacing: 0.05em;
}

.ql-pkg-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ql-text-primary);
  margin-bottom: 4px;
}
.ql-pkg-price {
  font-size: 22px;
  font-weight: 800;
  color: var(--ql-accent);
  margin-bottom: 2px;
  letter-spacing: -0.03em;
}
.ql-pkg-price span {
  font-size: 12px;
  font-weight: 600;
  color: var(--ql-text-muted);
}
.ql-pkg-duration {
  font-size: 11px;
  color: var(--ql-text-secondary);
  margin-bottom: 8px;
}
.ql-pkg-features {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
}
.ql-pkg-features li {
  font-size: 11px;
  color: var(--ql-text-secondary);
  padding: 2px 0;
}
.ql-pkg-features li::before {
  content: '✓ ';
  color: var(--ql-success);
  font-weight: 700;
}

.ql-pkg-select-btn {
  width: 100%;
  padding: 8px;
  border: none;
  border-radius: var(--ql-radius-xs);
  background: var(--ql-bg-hover);
  color: var(--ql-text-primary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--ql-transition);
}
.ql-pkg-select-btn:hover {
  background: var(--ql-accent);
  color: #fff;
}

.ql-selected-pkg {
  font-size: 12px;
  color: var(--ql-text-primary);
  padding: 10px 12px;
  background: var(--ql-accent-subtle);
  border: 1px solid rgba(var(--ts-brand-primary-rgb),0.2);
  border-radius: var(--ql-radius-xs);
  margin-bottom: 14px;
}

.ql-pay-field {
  margin-bottom: 12px;
}
.ql-pay-field label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ql-text-muted);
  margin-bottom: 6px;
}
.ql-pay-field input {
  width: 100%;
  padding: 10px 12px;
  background: var(--ql-bg);
  border: 1px solid var(--ql-border);
  border-radius: var(--ql-radius-xs);
  color: var(--ql-text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--ql-transition);
}
.ql-pay-field input:focus {
  border-color: var(--ql-accent);
  box-shadow: none;
}
.ql-pay-hint {
  font-size: 10px;
  color: var(--ql-text-muted);
  margin-top: 4px;
  display: block;
}

.ql-pay-methods {
  display: flex;
  gap: 8px;
}
.ql-method-btn {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--ql-border);
  background: var(--ql-bg);
  color: var(--ql-text-secondary);
  border-radius: var(--ql-radius-xs);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--ql-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
}
.ql-method-btn:hover {
  border-color: var(--ql-border-hover);
  background: var(--ql-bg-hover);
}
.ql-method-btn.ql-method-active {
  border-color: var(--ql-accent);
  background: var(--ql-accent-subtle);
  color: var(--ql-accent);
}

.ql-confirm-pay-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: var(--ql-radius-sm);
  background: linear-gradient(135deg, var(--ql-accent), #34A853);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: all var(--ql-transition);
  box-shadow: 0 4px 16px var(--ql-accent-glow);
  font-family: inherit;
}
.ql-confirm-pay-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px var(--ql-accent-glow);
}
.ql-confirm-pay-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.ql-pay-log {
  margin-top: 10px;
  font-size: 11px;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: var(--ql-radius-xs);
  display: none;
}
.ql-pay-log.ql-pay-error {
  display: block;
  background: var(--ql-danger-bg);
  color: var(--ql-danger);
  border: 1px solid rgba(248,113,113,0.2);
}
.ql-pay-log.ql-pay-success {
  display: block;
  background: var(--ql-success-bg);
  color: var(--ql-success);
  border: 1px solid rgba(52,211,153,0.2);
}
.ql-pay-log.ql-pay-info {
  display: block;
  background: var(--ql-accent-subtle);
  color: var(--ql-accent);
  border: 1px solid rgba(var(--ts-brand-primary-rgb),0.2);
}

/* ===== FILE ATTACHMENT ===== */
.ql-attach-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.ql-attach-btn {
  width: 34px;
  height: 34px;
  border: 1px dashed var(--ql-border);
  background: var(--ql-bg-surface);
  border-radius: var(--ql-radius-xs);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--ql-transition);
  color: var(--ql-text-muted);
  flex-shrink: 0;
}
.ql-attach-btn:hover {
  background: var(--ql-accent-subtle);
  border-color: rgba(var(--ts-brand-primary-rgb),0.3);
  color: var(--ql-accent);
}
.ql-attach-count {
  font-size: 10px;
  color: var(--ql-text-muted);
  font-weight: 500;
}
.ql-attach-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  max-height: 120px;
  overflow-y: auto;
}
.ql-attach-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  background: var(--ql-bg-surface);
  border: 1px solid var(--ql-border);
  border-radius: var(--ql-radius-xs);
  font-size: 10px;
  color: var(--ql-text-secondary);
  max-width: 180px;
  animation: ql-fade-in 0.2s ease;
}
@keyframes ql-fade-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.ql-attach-thumb {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}
.ql-attach-icon {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: var(--ql-bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.ql-attach-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ql-attach-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
  color: var(--ql-text-primary);
}
.ql-attach-size {
  font-size: 9px;
  color: var(--ql-text-muted);
}
.ql-attach-remove {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ql-danger);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  opacity: 0;
  transition: opacity var(--ql-transition);
}
.ql-attach-item:hover .ql-attach-remove {
  opacity: 1;
}
.ql-attach-uploading {
  opacity: 0.6;
}
.ql-attach-uploading::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  height: 2px;
  background: var(--ql-accent);
  border-radius: 2px;
  animation: ql-upload-progress 1.5s ease-in-out infinite;
}
@keyframes ql-upload-progress {
  0% { width: 0; }
  50% { width: 70%; }
  100% { width: 100%; }
}

/* Watermark Removal Button */
.ql-watermark-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px 16px;
  margin-top: 8px;
  border: 1px solid rgba(248,113,113,0.2);
  border-radius: var(--ql-radius-sm);
  background: linear-gradient(135deg, rgba(248,113,113,0.08), rgba(248,113,113,0.04));
  color: #f87171;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--ql-transition);
}
.ql-watermark-btn:hover {
  background: linear-gradient(135deg, rgba(248,113,113,0.15), rgba(248,113,113,0.08));
  border-color: rgba(248,113,113,0.35);
  box-shadow: 0 0 20px -4px rgba(248,113,113,0.2);
  transform: translateY(-1px);
}
.ql-watermark-btn:active { transform: scale(0.98); }
.ql-watermark-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ===== SHIELD MODE BUTTON ===== */
.ql-shield-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px 16px;
  margin-top: 6px;
  border: 1px solid rgba(var(--ts-brand-primary-rgb),0.2);
  border-radius: var(--ql-radius-sm);
  background: linear-gradient(135deg, rgba(var(--ts-brand-primary-rgb),0.08), rgba(var(--ts-brand-primary-rgb),0.04));
  color: var(--ql-accent);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--ql-transition);
}
.ql-shield-btn:hover {
  background: linear-gradient(135deg, rgba(var(--ts-brand-primary-rgb),0.15), rgba(var(--ts-brand-primary-rgb),0.08));
  border-color: rgba(var(--ts-brand-primary-rgb),0.35);
  box-shadow: 0 0 20px -4px rgba(var(--ts-brand-primary-rgb),0.2);
  transform: translateY(-1px);
}
.ql-shield-btn:active { transform: scale(0.98); }
.ql-shield-btn.ql-shield-active {
  background: linear-gradient(135deg, rgba(52,211,153,0.12), rgba(52,211,153,0.06));
  border-color: rgba(52,211,153,0.3);
  color: #34d399;
}
.ql-shield-btn.ql-shield-active:hover {
  background: linear-gradient(135deg, rgba(52,211,153,0.18), rgba(52,211,153,0.1));
  border-color: rgba(52,211,153,0.45);
  box-shadow: 0 0 20px -4px rgba(52,211,153,0.2);
}

/* ===== SHIELD OVERLAY (injected on Lovable chat input) ===== */
.ql-shield-overlay {
  position: absolute;
  inset: 0;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 24px;
  background: rgba(10,10,11,0.88);
  backdrop-filter: blur(8px);
  border: 1.5px solid rgba(var(--ts-brand-primary-rgb),0.3);
  box-shadow: 0 0 40px -8px rgba(var(--ts-brand-primary-rgb),0.25), inset 0 0 60px -20px rgba(var(--ts-brand-primary-rgb),0.08);
  cursor: not-allowed;
  animation: ql-shield-pulse 2.5s ease-in-out infinite;
  pointer-events: all;
}
.ql-shield-overlay svg {
  width: 32px;
  height: 32px;
  stroke: var(--ts-brand-primary);
  filter: drop-shadow(0 0 12px rgba(var(--ts-brand-primary-rgb),0.5));
  animation: ql-shield-icon-float 3s ease-in-out infinite;
}
.ql-shield-overlay-text {
  color: #34A853;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  text-align: center;
  letter-spacing: 0.02em;
}
.ql-shield-overlay-sub {
  color: #71717a;
  font-size: 10px;
  font-family: 'Inter', sans-serif;
}
@keyframes ql-shield-pulse {
  0%, 100% { border-color: rgba(var(--ts-brand-primary-rgb),0.3); box-shadow: 0 0 40px -8px rgba(var(--ts-brand-primary-rgb),0.25); }
  50% { border-color: rgba(var(--ts-brand-primary-rgb),0.5); box-shadow: 0 0 60px -8px rgba(var(--ts-brand-primary-rgb),0.35); }
}
@keyframes ql-shield-icon-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* ===== TABS SYSTEM (Floating Popup) ===== */
.ql-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  padding: 3px;
  background: var(--ql-bg-surface);
  border-radius: var(--ql-radius-sm);
  border: 1px solid var(--ql-border);
}
.ql-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 10px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--ql-text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--ql-transition);
}
.ql-tab:hover { background: rgba(255,255,255,0.04); color: var(--ql-text-secondary); }
.ql-tab.ql-tab-active { background: var(--ql-accent-subtle); color: var(--ql-accent); border: 1px solid rgba(var(--ts-brand-primary-rgb),0.2); }
.ql-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--ql-accent);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
}

/* ===== CHAT HISTORY (Floating Popup) ===== */
.ql-chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}
.ql-chat-messages {
  max-height: 280px;
  overflow-y: auto;
  padding: 4px 0;
}
.ql-chat-bubble {
  padding: 10px 12px;
  margin: 6px 0;
  border-radius: var(--ql-radius-sm);
  background: var(--ql-bg-surface);
  border: 1px solid var(--ql-border);
  color: var(--ql-text-primary);
  font-size: 11px;
  line-height: 1.5;
  word-break: break-word;
  transition: border-color var(--ql-transition);
}
.ql-chat-bubble:hover { border-color: var(--ql-border-hover); }
.ql-chat-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 9px;
}
.ql-chat-status-ok { color: var(--ql-success); }
.ql-chat-status-err { color: var(--ql-danger); }
.ql-chat-time { color: var(--ql-text-muted); }

.ql-chat-date-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}
.ql-chat-date-divider::before, .ql-chat-date-divider::after { content: ''; flex: 1; height: 1px; background: var(--ql-border); }
.ql-chat-date-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--ql-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  background: var(--ql-bg-surface);
  border: 1px solid var(--ql-border);
  border-radius: 10px;
  white-space: nowrap;
}
.ql-chat-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 4px 0;
  border-top: 1px solid var(--ql-border);
  margin-top: 8px;
}
.ql-chat-count { font-size: 10px; color: var(--ql-text-muted); font-weight: 500; }
.ql-chat-clear {
  flex: 1;
  padding: 8px;
  border: 1px solid rgba(248,113,113,0.2);
  border-radius: var(--ql-radius-sm);
  background: rgba(248,113,113,0.05);
  color: var(--ql-danger);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--ql-transition);
  text-align: center;
}
.ql-chat-clear:hover { background: rgba(248,113,113,0.12); border-color: rgba(248,113,113,0.35); }

/* ===== NATIVE CHAT MODE ("Usar Chat Padrão") ===== */
.ql-native-chat-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  margin-top: 6px;
  border: 1px solid var(--ql-border);
  border-radius: var(--ql-radius-sm);
  background: var(--ql-accent-subtle);
  color: var(--ql-accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--ql-transition);
}
.ql-native-chat-btn:hover {
  background: var(--ql-accent-glow);
  border-color: var(--ql-accent);
}

.ql-native-badge {
  position: absolute;
  top: -10px;
  right: 12px;
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, var(--ts-brand-primary), #34A853);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  font-family: 'Inter', -apple-system, sans-serif;
  padding: 3px 10px;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(var(--ts-brand-primary-rgb),0.4);
  letter-spacing: 0.3px;
  pointer-events: none;
  animation: ql-badge-pulse 2s ease-in-out infinite;
}
@keyframes ql-badge-pulse {
  0%, 100% { box-shadow: 0 2px 12px rgba(var(--ts-brand-primary-rgb),0.4); }
  50% { box-shadow: 0 2px 20px rgba(var(--ts-brand-primary-rgb),0.7); }
}

.ql-native-return-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 8px auto 0;
  padding: 6px 18px;
  border: 1px solid rgba(var(--ts-brand-primary-rgb),0.3);
  border-radius: 20px;
  background: rgba(var(--ts-brand-primary-rgb),0.1);
  color: #34A853;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Inter', -apple-system, sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 99999;
}
.ql-native-return-btn:hover {
  background: rgba(var(--ts-brand-primary-rgb),0.2);
  border-color: rgba(var(--ts-brand-primary-rgb),0.5);
  transform: translateY(-1px);
}

@keyframes ql-send-blink {
  0% { background-color: var(--ts-brand-primary); }
  25% { background-color: #ef4444; }
  50% { background-color: #22c55e; }
  75% { background-color: #eab308; }
  100% { background-color: var(--ts-brand-primary); }
}
#chatinput-send-message-button.ql-native-send-active {
  animation: ql-send-blink 2s linear infinite !important;
  opacity: 1 !important;
  cursor: pointer !important;
  pointer-events: auto !important;
}
#chatinput-send-message-button.ql-native-send-active:disabled {
  opacity: 1 !important;
  cursor: pointer !important;
  pointer-events: auto !important;
}
#chatinput-send-message-button.ql-native-sending {
  animation: ql-sending-pulse 0.8s ease-in-out infinite !important;
  opacity: 1 !important;
  pointer-events: none !important;
}
@keyframes ql-sending-pulse {
  0%, 100% { background-color: var(--ts-brand-primary) !important; transform: scale(1); }
  50% { background-color: var(--ts-brand-primary) !important; transform: scale(1.15); }
}

.ql-native-sending-overlay {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999999999;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--ts-brand-primary), var(--ts-brand-primary));
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Segoe UI', sans-serif;
  box-shadow: 0 4px 20px rgba(var(--ts-brand-primary-rgb),0.4);
  animation: ql-sending-fadein 0.3s ease;
}
.ql-native-sending-overlay .ql-spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ql-spin 0.6s linear infinite;
}
@keyframes ql-spin { to { transform: rotate(360deg); } }
@keyframes ql-sending-fadein { from { opacity:0; transform: translateX(-50%) translateY(10px); } to { opacity:1; transform: translateX(-50%) translateY(0); } }

.ql-native-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 9999999999;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Inter', -apple-system, sans-serif;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
}
.ql-native-toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.ql-native-toast-success {
  background: rgba(34, 197, 94, 0.15);
  color: #34d399;
  border: 1px solid rgba(34, 197, 94, 0.3);
  backdrop-filter: blur(12px);
}
.ql-native-toast-error {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.3);
  backdrop-filter: blur(12px);
}

/* ===== DRAG & DROP OVERLAY ===== */
.ql-drag-overlay {
  position: absolute;
  inset: 0;
  z-index: 99999;
  background: rgba(var(--ts-brand-primary-rgb), 0.15);
  backdrop-filter: blur(6px);
  border: 2px dashed rgba(var(--ts-brand-primary-rgb), 0.6);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.ql-drag-overlay-inner {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--ts-brand-primary);
  background: rgba(10, 10, 11, 0.85);
  padding: 12px 24px;
  border-radius: 10px;
  border: 1px solid rgba(var(--ts-brand-primary-rgb), 0.3);
}

.ql-lifetime-card{
  position: relative;
  overflow: hidden;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:4px;
  padding:14px 12px;
  margin-top:10px;
  border-radius:16px;
  border:1px solid rgba(34,197,94,0.28);
  background:
    linear-gradient(135deg, rgba(34,197,94,0.16), rgba(16,185,129,0.08)),
    rgba(255,255,255,0.03);
  box-shadow:
    0 10px 30px rgba(16,185,129,0.12),
    inset 0 1px 0 rgba(255,255,255,0.05);
  animation: qlLifetimeGlow 3s ease-in-out infinite;
}

.ql-lifetime-card::before{
  content:'';
  position:absolute;
  inset:0;
  background:linear-gradient(
    120deg,
    transparent 20%,
    rgba(255,255,255,0.08) 50%,
    transparent 80%
  );
  transform:translateX(-100%);
  animation: qlLifetimeShine 4s linear infinite;
}

.ql-lifetime-icon{
  font-size:22px;
  font-weight:700;
  color:#4ade80;
  text-shadow:0 0 14px rgba(74,222,128,0.45);
}

.ql-lifetime-label{
  font-size:12px;
  font-weight:800;
  letter-spacing:1.8px;
  color:#86efac;
}

.ql-lifetime-status{
  font-size:11px;
  color:rgba(255,255,255,0.72);
}

@keyframes qlLifetimeGlow{
  0%,100%{
    box-shadow:
      0 10px 30px rgba(16,185,129,0.10),
      inset 0 1px 0 rgba(255,255,255,0.05);
  }
  50%{
    box-shadow:
      0 14px 40px rgba(16,185,129,0.18),
      inset 0 1px 0 rgba(255,255,255,0.08);
  }
}

@keyframes qlLifetimeShine{
  from{
    transform:translateX(-100%);
  }
  to{
    transform:translateX(200%);
  }
}

/* ===== v5.2 brand, dark contrast and language selector ===== */
.ql-brand-logo,.sp-brand-logo{
  width:34px;
  height:34px;
  object-fit:contain;
  flex:0 0 auto;
  display:block;
}
.sp-login-logo{
  width:clamp(120px, 34vw, 140px) !important;
  max-width:72% !important;
  height:auto !important;
  object-fit:contain !important;
  margin:0 auto 18px !important;
  filter:drop-shadow(0 14px 26px rgba(66, 133, 244,0.24));
}
.ql-license-logo{
  width:clamp(150px, 52%, 210px);
  max-width:78%;
  height:auto;
  object-fit:contain;
  display:block;
  margin:0 auto 18px;
  filter:drop-shadow(0 14px 28px rgba(66, 133, 244,0.22));
}
.ql-lock-icon:has(.ql-license-logo){
  background:transparent !important;
  width:auto !important;
  height:auto !important;
  box-shadow:none !important;
}
.ql-i18n-switcher{
  display:inline-flex;
  align-items:center;
  gap:2px;
  padding:2px;
  border:1px solid var(--ql-border);
  background:rgba(255,255,255,0.05);
  border-radius:999px;
  margin:0 4px;
}
.ql-i18n-btn{
  min-width:38px;
  height:26px;
  border:0;
  border-radius:999px;
  background:transparent;
  color:var(--ql-text-secondary);
  cursor:pointer;
  font-size:10px;
  font-weight:800;
  line-height:1;
  letter-spacing:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:3px;
  padding:0 7px;
}
.ql-i18n-btn:hover,.ql-i18n-btn:focus-visible{
  color:var(--ql-text-primary);
  background:var(--ql-bg-hover);
  outline:none;
}
.ql-i18n-btn.ql-i18n-active{
  color:#fff;
  background:linear-gradient(135deg,var(--ql-accent),#34A853);
  box-shadow:0 8px 18px rgba(66, 133, 244,0.24);
}
#ql-floating.ql-minimized .ql-i18n-switcher{
  display:none;
}
body:not(.sp-light) .sp-profile-action,
body:not(.sp-light) .sp-icon-btn,
#ql-floating:not(.ql-light) .ql-icon-btn{
  color:#f5f5f5 !important;
  background:rgba(255,255,255,0.06);
  border-color:rgba(255,255,255,0.10);
}
body:not(.sp-light) .sp-profile-action:hover,
body:not(.sp-light) .sp-icon-btn:hover,
#ql-floating:not(.ql-light) .ql-icon-btn:hover{
  color:#fff !important;
  background:rgba(66, 133, 244,0.16);
  box-shadow:0 0 0 1px rgba(66, 133, 244,0.22);
}
body:not(.sp-light) .sp-theme-icon,
body:not(.sp-light) .sp-sound-btn svg,
body:not(.sp-light) .sp-help-btn svg,
body:not(.sp-light) .sp-notif-btn svg{
  color:#f5f5f5 !important;
  stroke:currentColor !important;
  opacity:1 !important;
}
@media (max-width:420px){
  .ql-i18n-btn{ min-width:30px; padding:0 5px; font-size:0; }
  .ql-i18n-btn .ql-i18n-code{ display:inline; }
  .ql-i18n-btn .ql-i18n-flag{ font-size:13px; }
}
