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

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ql-bg: #0c0912;
  --ql-bg-elevated: #15101f;
  --ql-bg-surface: #1b1426;
  --ql-bg-hover: #261a37;
  --ql-border: rgba(166,75,244,0.22);
  --ql-border-hover: rgba(255,61,119,0.40);
  --ql-text-primary: #f6f4f8;
  --ql-text-secondary: #b6acc4;
  --ql-text-muted: #8a7f9c;
  --ql-accent: #c44bf4;
  --ql-accent-hover: #ff5da2;
  --ql-accent-glow: rgba(196,75,244,0.36);
  --ql-accent-subtle: rgba(166,75,244,0.14);
  --ql-gradient: linear-gradient(135deg, #ff7a18 0%, #ff3d77 40%, #a64bf4 72%, #4f6bff 100%);
  --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: 12px;
  --ql-radius-sm: 8px;
  --ql-radius-xs: 6px;
  --ql-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--ql-bg);
  color: var(--ql-text-primary);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.sp-light {
  --ql-bg: #f1f5f9;
  --ql-bg-elevated: #ffffff;
  --ql-bg-surface: #f8fafc;
  --ql-bg-hover: #e2e8f0;
  --ql-border: rgba(15,23,42,0.12);
  --ql-border-hover: rgba(15,23,42,0.22);
  --ql-text-primary: #0f172a;
  --ql-text-secondary: #475569;
  --ql-text-muted: #94a3b8;
  --ql-accent: #c44bf4;
  --ql-accent-hover: #ff3d77;
  --ql-accent-glow: rgba(196,75,244,0.18);
  --ql-accent-subtle: rgba(166,75,244,0.10);
  --ql-success: #10b981;
  --ql-success-bg: rgba(16,185,129,0.10);
  --ql-warning: #d97706;
  --ql-warning-bg: rgba(217,119,6,0.10);
  --ql-danger: #dc2626;
  --ql-danger-bg: rgba(220,38,38,0.10);
}
body.sp-light {
  background: linear-gradient(145deg, #f1f5f9, #e2e8f0 58%, #f1f5f9) !important;
}
body.sp-light .sp-header {
  background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(248,250,252,0.95)) !important;
  border-bottom-color: rgba(15,23,42,0.10) !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06) !important;
}
body.sp-light .sp-profile-card,
body.sp-light .sp-license-gate,
body.sp-light .sp-shortcuts-grid button,
body.sp-light .sp-textarea,
body.sp-light .sp-notif-panel {
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(248,250,252,0.90)) !important;
  border-color: rgba(15,23,42,0.10) !important;
}
body.sp-light .sp-textarea { color: #0f172a !important; }
body.sp-light .sp-shortcuts-grid button { color: #0f172a !important; }
body.sp-light .sp-brand-logo { box-shadow: 0 0 12px rgba(14,165,233,0.25); }

@keyframes sp-fade-in {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.92); }
}
body { animation: sp-fade-in 0.4s ease-out; }

.sp-header {
  padding: 14px 16px;
  background: var(--ql-bg-elevated);
  border-bottom: 1px solid var(--ql-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.sp-brand { display: flex; align-items: center; gap: 8px; }
.sp-brand-text { font-size: 14px; font-weight: 700; letter-spacing: -0.02em; }
.sp-badge { font-size: 9px; font-weight: 800; padding: 3px 8px; border-radius: 6px; background: var(--ql-gradient); color: #fff; letter-spacing: 0.08em; text-transform: uppercase; }

.sp-header-actions { display: flex; align-items: center; gap: 2px; }
.sp-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; }
.sp-icon-btn:hover { background: var(--ql-bg-hover); color: var(--ql-text-primary); }
.sp-notif-badge { position: absolute; top: -3px; right: -3px; width: 16px; height: 16px; border-radius: 50%; background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; font-size: 8px; font-weight: 800; display: flex; align-items: center; justify-content: center; }

.sp-body { flex: 1; overflow-y: auto; padding: 16px; }

.sp-license-gate { text-align: center; padding: 40px 16px; }
.sp-lock-icon { display: flex; justify-content: center; margin-bottom: 16px; }
.sp-gate-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.sp-gate-desc { font-size: 13px; color: var(--ql-text-secondary); margin-bottom: 20px; }
.sp-input { width: 100%; padding: 12px 14px; 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: inherit; outline: none; transition: all var(--ql-transition); }
.sp-input:focus { border-color: var(--ql-accent); box-shadow: 0 0 0 3px var(--ql-accent-subtle); }
.sp-input::placeholder { color: var(--ql-text-muted); }
.sp-btn-primary { width: 100%; padding: 12px; border: none; border-radius: var(--ql-radius-sm); background: var(--ql-gradient); color: #fff; 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); }
.sp-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px var(--ql-accent-glow); }
.sp-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.sp-log { font-size: 12px; margin-top: 10px; font-weight: 600; text-align: center; min-height: 18px; }
.sp-log-success { color: var(--ql-success); }
.sp-log-error { color: var(--ql-danger); }
.sp-log-info { color: var(--ql-accent); }

.sp-profile-card { background: var(--ql-bg-surface); border: 1px solid var(--ql-border); border-radius: var(--ql-radius); padding: 14px; margin-bottom: 14px; transition: border-color var(--ql-transition); }
.sp-profile-card:hover { border-color: var(--ql-border-hover); }
.sp-profile-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.sp-profile-name { font-size: 14px; font-weight: 700; }
.sp-status-badge { font-size: 9px; font-weight: 800; padding: 3px 10px; border-radius: 6px; letter-spacing: 0.08em; text-transform: uppercase; }
.sp-badge-test { background: var(--ql-warning-bg); color: var(--ql-warning); border: 1px solid rgba(251,191,36,0.15); }
.sp-badge-pro { background: var(--ql-success-bg); color: var(--ql-success); border: 1px solid rgba(52,211,153,0.15); }
.sp-sync-status { font-size: 12px; font-weight: 500; }
.sp-sync-ok { color: var(--ql-success); }
.sp-sync-waiting { color: var(--ql-warning); }

.sp-trial-countdown { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: var(--ql-radius-sm); background: rgba(255,255,255,0.03); border: 1px solid var(--ql-border); margin-top: 8px; }
.sp-countdown-row { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.sp-countdown-label { color: var(--ql-text-secondary); font-weight: 500; }
.sp-countdown-time { margin-left: auto; font-family: 'SF Mono', monospace; font-size: 13px; font-weight: 700; color: var(--ql-warning); }
.sp-trial-bar { width: 100%; height: 5px; border-radius: 5px; background: var(--ql-bg-hover); overflow: hidden; }
.sp-trial-bar-fill { height: 100%; border-radius: 5px; background: var(--ql-gradient); background-size: 200% 100%; animation: sp-shimmer 3s ease infinite; transition: width 1s ease; }
.sp-trial-bar-fill.sp-bar-urgent { background: linear-gradient(90deg, #ef4444, #f97316); animation: sp-shimmer 1.5s ease infinite; }
@keyframes sp-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.sp-textarea { width: 100%; padding: 12px 14px; 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: inherit; outline: none; resize: vertical; min-height: 64px; margin-bottom: 6px; line-height: 1.5; transition: all var(--ql-transition); }
.sp-textarea:focus { border-color: var(--ql-accent); box-shadow: 0 0 0 3px var(--ql-accent-subtle); }
.sp-textarea::placeholder { color: var(--ql-text-muted); }

.sp-attach-preview { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; max-height: 100px; overflow-y: auto; }
.sp-attach-item { position: relative; display: flex; align-items: center; gap: 5px; padding: 4px 7px; background: var(--ql-bg-surface); border: 1px solid var(--ql-border); border-radius: 6px; font-size: 10px; color: var(--ql-text-secondary); max-width: 160px; animation: sp-fade-in 0.2s ease; }
.sp-attach-thumb { width: 24px; height: 24px; border-radius: 4px; object-fit: cover; flex-shrink: 0; }
.sp-attach-icon { width: 24px; height: 24px; border-radius: 4px; background: var(--ql-bg-hover); display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.sp-attach-info { display: flex; flex-direction: column; min-width: 0; }
.sp-attach-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 80px; color: var(--ql-text-primary); font-size: 9px; }
.sp-attach-size { font-size: 8px; color: var(--ql-text-muted); }
.sp-attach-remove { position: absolute; top: -3px; right: -3px; width: 14px; height: 14px; border-radius: 50%; background: var(--ql-danger); color: #fff; border: none; cursor: pointer; font-size: 8px; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.2s; }
.sp-attach-item:hover .sp-attach-remove { opacity: 1; }
.sp-attach-uploading { opacity: 0.6; }
.sp-attach-btn { width: 32px; height: 32px; 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); font-size: 14px; flex-shrink: 0; }
.sp-attach-btn:hover { background: var(--ql-accent-subtle); border-color: rgba(124,90,255,0.3); color: var(--ql-accent); }

.sp-action-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 6px; }
.sp-action-left { display: flex; align-items: center; gap: 6px; }
.sp-action-center { display: flex; align-items: center; gap: 4px; }
.sp-toggle { position: relative; width: 34px; height: 18px; cursor: pointer; flex-shrink: 0; }
.sp-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.sp-toggle-slider { position: absolute; inset: 0; border-radius: 18px; background: var(--ql-bg-hover); border: 1px solid var(--ql-border); transition: all 0.3s ease; }
.sp-toggle-slider::before { content: ''; position: absolute; width: 14px; height: 14px; border-radius: 50%; background: var(--ql-text-muted); top: 1px; left: 1px; transition: all 0.3s ease; }
.sp-toggle input:checked + .sp-toggle-slider { background: var(--ql-accent-subtle); border-color: rgba(124,90,255,0.3); }
.sp-toggle input:checked + .sp-toggle-slider::before { transform: translateX(16px); background: var(--ql-accent); box-shadow: 0 0 6px var(--ql-accent-glow); }
.sp-toggle-label { font-size: 10px; font-weight: 600; color: var(--ql-text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.sp-tool-btn { width: 32px; height: 32px; 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); }
.sp-tool-btn:hover { background: var(--ql-accent-subtle); border-color: rgba(124,90,255,0.2); color: var(--ql-accent); }
.sp-tool-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.sp-tool-loading { animation: sp-spin 0.8s linear infinite; }
@keyframes sp-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.sp-send-btn { padding: 7px 18px; border: none; border-radius: var(--ql-radius-sm); background: var(--ql-gradient); color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; transition: all var(--ql-transition); box-shadow: 0 2px 10px var(--ql-accent-glow); }
.sp-send-btn:hover { box-shadow: 0 4px 18px var(--ql-accent-glow); transform: translateY(-1px); }
.sp-send-btn:disabled { opacity: 0.5; pointer-events: none; }

.sp-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: 10px; margin-top: 4px; }
.sp-shortcuts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.sp-chip { padding: 7px 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: 10px; 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: 4px; }
.sp-chip:hover { background: var(--ql-accent-subtle); border-color: rgba(124,90,255,0.2); color: #c4b5fd; transform: translateY(-1px); }
.sp-chip svg { flex-shrink: 0; width: 12px; height: 12px; }

.sp-watermark-btn { width: 100%; padding: 8px 12px; border: none; border-radius: var(--ql-radius-sm); background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; font-size: 12px; font-weight: 700; cursor: pointer; transition: all var(--ql-transition); display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 12px; }
.sp-watermark-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.sp-watermark-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.sp-alert-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 100; backdrop-filter: blur(8px); animation: sp-alert-bg 0.2s ease; }
@keyframes sp-alert-bg { from { opacity: 0; } to { opacity: 1; } }
.sp-alert-box { background: var(--ql-bg-surface); border: 1px solid var(--ql-border); border-radius: var(--ql-radius); padding: 24px 20px; text-align: center; width: 85%; max-width: 280px; animation: sp-alert-pop 0.3s cubic-bezier(0.34,1.56,0.64,1); }
@keyframes sp-alert-pop { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.sp-alert-icon { font-size: 36px; margin-bottom: 10px; }
.sp-alert-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.sp-alert-message { font-size: 12px; color: var(--ql-text-secondary); margin-bottom: 16px; line-height: 1.5; }
.sp-alert-ok { padding: 8px 28px; border: none; border-radius: var(--ql-radius-sm); background: var(--ql-gradient); color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; }

.sp-notif-panel { position: fixed; top: 52px; right: 8px; left: 8px; background: var(--ql-bg-surface); border: 1px solid var(--ql-border); border-radius: var(--ql-radius); box-shadow: 0 16px 48px -12px rgba(0,0,0,0.5); z-index: 50; max-height: 300px; overflow-y: auto; animation: sp-slide-down 0.2s ease; }
@keyframes sp-slide-down { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.sp-notif-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--ql-border); font-size: 13px; font-weight: 700; }
.sp-notif-close { border: none; background: none; cursor: pointer; font-size: 13px; color: var(--ql-text-muted); padding: 4px 8px; border-radius: 6px; }
.sp-notif-close:hover { background: var(--ql-bg-hover); color: var(--ql-text-primary); }
.sp-notif-list { padding: 8px; }
.sp-notif-empty { text-align: center; color: var(--ql-text-muted); font-size: 12px; padding: 16px 0; margin: 0; }
.sp-notif-item { padding: 10px 12px; border-radius: var(--ql-radius-sm); background: var(--ql-bg-hover); margin-bottom: 5px; border: 1px solid var(--ql-border); }
.sp-notif-item-title { font-size: 12px; font-weight: 700; margin-bottom: 2px; }
.sp-notif-item-msg { font-size: 11px; color: var(--ql-text-secondary); margin-bottom: 4px; line-height: 1.4; }
.sp-notif-item-date { font-size: 10px; color: var(--ql-text-muted); }
.sp-notif-link { font-size: 11px; color: var(--ql-accent); text-decoration: none; font-weight: 600; }

.sp-footer { padding: 10px 16px; border-top: 1px solid var(--ql-border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; font-size: 10px; color: var(--ql-text-muted); }
.sp-footer-badge { font-size: 9px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); padding: 2px 8px; border-radius: 99px; }
.sp-back-to-popup { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--ql-text-muted); background: none; border: 1px solid var(--ql-border); border-radius: var(--ql-radius-xs); padding: 4px 10px; cursor: pointer; transition: all var(--ql-transition); font-family: inherit; }
.sp-back-to-popup:hover { background: var(--ql-bg-hover); color: var(--ql-text-primary); border-color: var(--ql-border-hover); }

.sp-support-link { display: flex; align-items: center; gap: 5px; color: var(--ql-text-muted); text-decoration: none; font-size: 11px; font-weight: 600; transition: color var(--ql-transition); }
.sp-support-link:hover { color: var(--ql-accent); }
.sp-support-link svg { width: 12px; height: 12px; }

/* Modal Plan Mode */
.sp-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 9999; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); animation: sp-fadeIn 0.2s ease; }
.sp-modal { background: var(--ql-bg-elevated); border: 1px solid var(--ql-border); border-radius: var(--ql-radius); max-width: 340px; width: 90%; padding: 20px; box-shadow: 0 24px 80px -12px rgba(0,0,0,0.6); animation: sp-scaleIn 0.2s ease; }
.sp-modal-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--ql-warning-bg); border: 1px solid rgba(251,191,36,0.15); display: flex; align-items: center; justify-content: center; font-size: 20px; margin: 0 auto 12px; }
.sp-modal-title { font-size: 14px; font-weight: 700; color: var(--ql-text-primary); text-align: center; margin-bottom: 10px; }
.sp-modal-body { font-size: 11px; color: var(--ql-text-secondary); line-height: 1.6; margin-bottom: 16px; }
.sp-modal-body strong { color: var(--ql-warning); }
.sp-modal-step { display: flex; gap: 8px; margin-bottom: 8px; align-items: flex-start; }
.sp-modal-step-num { min-width: 20px; height: 20px; border-radius: 50%; background: var(--ql-accent-subtle); border: 1px solid rgba(124,90,255,0.2); color: var(--ql-accent); font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sp-modal-step-text { font-size: 11px; color: var(--ql-text-secondary); line-height: 1.5; }
.sp-modal-step-text strong { color: var(--ql-text-primary); font-weight: 600; }
.sp-modal-check { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; cursor: pointer; }
.sp-modal-check input { accent-color: var(--ql-accent); width: 14px; height: 14px; cursor: pointer; }
.sp-modal-check label { font-size: 11px; color: var(--ql-text-muted); cursor: pointer; }
.sp-modal-btn { width: 100%; padding: 10px; border: none; border-radius: var(--ql-radius-sm); background: var(--ql-gradient); color: #fff; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all var(--ql-transition); }
.sp-modal-btn:hover { box-shadow: 0 0 20px -4px var(--ql-accent-glow); transform: translateY(-1px); }
@keyframes sp-fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sp-scaleIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* Watermark Removal Button */
.sp-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);
}
.sp-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);
}
.sp-watermark-btn:active { transform: scale(0.98); }
.sp-watermark-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ========== Tab Navigation ========== */
.sp-tabs { display: flex; gap: 0; margin-bottom: 14px; background: var(--ql-bg-surface); border: 1px solid var(--ql-border); border-radius: var(--ql-radius); overflow: hidden; }
.sp-tab { flex: 1; padding: 10px 12px; border: none; background: transparent; color: var(--ql-text-muted); font-size: 12px; font-weight: 600; cursor: pointer; transition: all var(--ql-transition); font-family: inherit; display: flex; align-items: center; justify-content: center; gap: 6px; position: relative; }
.sp-tab:hover { color: var(--ql-text-secondary); background: var(--ql-bg-hover); }
.sp-tab.sp-tab-active { color: var(--ql-accent); background: var(--ql-accent-subtle); }
.sp-tab.sp-tab-active::after { content: ''; position: absolute; bottom: 0; left: 20%; right: 20%; height: 2px; background: var(--ql-accent); border-radius: 2px 2px 0 0; }
.sp-tab-badge { min-width: 18px; height: 18px; border-radius: 9px; background: var(--ql-accent); color: #fff; font-size: 9px; font-weight: 800; display: flex; align-items: center; justify-content: center; padding: 0 5px; }

/* ========== Chat History (WhatsApp-like) ========== */
.sp-chat-container { display: flex; flex-direction: column; height: 100%; }
.sp-chat-messages { flex: 1; overflow-y: auto; padding: 8px 4px; display: flex; flex-direction: column; gap: 6px; }
.sp-chat-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 16px; text-align: center; color: var(--ql-text-muted); }
.sp-chat-empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.4; }
.sp-chat-empty-title { font-size: 14px; font-weight: 600; color: var(--ql-text-secondary); margin-bottom: 4px; }
.sp-chat-empty-desc { font-size: 11px; line-height: 1.5; }

.sp-chat-bubble { max-width: 88%; align-self: flex-end; background: linear-gradient(135deg, var(--ql-accent), #6d4aef); color: #fff; padding: 10px 14px; border-radius: 16px 16px 4px 16px; font-size: 12px; line-height: 1.5; word-wrap: break-word; white-space: pre-wrap; position: relative; animation: sp-msg-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); box-shadow: 0 2px 8px rgba(124,90,255,0.2); }
.sp-chat-bubble::after { content: ''; position: absolute; bottom: 0; right: -6px; width: 12px; height: 12px; background: #6d4aef; clip-path: polygon(0 0, 0% 100%, 100% 100%); }

@keyframes sp-msg-in {
  0% { opacity: 0; transform: translateY(12px) scale(0.92); }
  60% { opacity: 1; transform: translateY(-2px) scale(1.02); }
  100% { transform: translateY(0) scale(1); }
}

.sp-chat-meta { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 4px; padding-right: 4px; }
.sp-chat-time { font-size: 9px; color: rgba(255,255,255,0.65); font-weight: 500; }
.sp-chat-check { font-size: 10px; color: rgba(255,255,255,0.5); }
.sp-chat-status { font-size: 9px; padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.sp-chat-status-ok { background: rgba(52,211,153,0.15); color: var(--ql-success); }
.sp-chat-status-err { background: rgba(248,113,113,0.15); color: var(--ql-danger); }

.sp-chat-date-divider { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.sp-chat-date-divider::before, .sp-chat-date-divider::after { content: ''; flex: 1; height: 1px; background: var(--ql-border); }
.sp-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; }

.sp-chat-actions { display: flex; align-items: center; gap: 6px; padding: 10px 4px 0; border-top: 1px solid var(--ql-border); margin-top: auto; }
.sp-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; }
.sp-chat-clear:hover { background: rgba(248,113,113,0.12); border-color: rgba(248,113,113,0.35); }
.sp-chat-count { font-size: 10px; color: var(--ql-text-muted); font-weight: 500; }

/* ===== SHIELD BUTTON (Sidebar) ===== */
.sp-shield-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px 16px;
  margin-top: 6px;
  border: 1px solid rgba(124,90,255,0.2);
  border-radius: var(--ql-radius-sm);
  background: linear-gradient(135deg, rgba(124,90,255,0.08), rgba(124,90,255,0.04));
  color: var(--ql-accent);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--ql-transition);
}
.sp-shield-btn:hover {
  background: linear-gradient(135deg, rgba(124,90,255,0.15), rgba(124,90,255,0.08));
  border-color: rgba(124,90,255,0.35);
  box-shadow: 0 0 20px -4px rgba(124,90,255,0.2);
}
.sp-shield-btn.sp-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: var(--ql-success);
}
.sp-shield-btn.sp-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);
}

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


/* ===== MASTER LOVABLE BRAND REFRESH ===== */
body {
  background:
    radial-gradient(circle at 8% -8%, rgba(56,189,248,.24), transparent 34%),
    radial-gradient(circle at 90% 5%, rgba(37,99,235,.22), transparent 32%),
    linear-gradient(160deg, #15101f, #0c0912 58%, #15101f);
}
.sp-header {
  background: linear-gradient(135deg, rgba(27,20,38,.96), rgba(15,11,22,.92));
  border-bottom-color: rgba(56,189,248,.24);
  box-shadow: 0 14px 34px rgba(0,0,0,.22);
}
.sp-brand-logo { width:28px; height:28px; border-radius:9px; object-fit:cover; box-shadow:0 0 18px rgba(56,189,248,.42); }
.sp-profile-card, .sp-license-gate, .sp-shortcuts-grid button, .sp-textarea, .sp-notif-panel {
  background: linear-gradient(180deg, rgba(27,20,38,.82), rgba(15,11,22,.74));
  border-color: rgba(56,189,248,.22);
}
.sp-btn-primary, .sp-send-btn {
  background: var(--ql-gradient) !important;
  box-shadow: 0 14px 36px rgba(37,99,235,.28), 0 0 24px rgba(34,211,238,.16);
}

#sp-validate-btn,#ql-validate-btn{pointer-events:auto!important;cursor:pointer!important;position:relative!important;z-index:999999!important;}

.sp-support-link { pointer-events: none !important; cursor: default !important; }
