@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 {
  /* ---- 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-soft: var(--ts-brand-primary-soft);
  --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: 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: #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);
}

@keyframes sp-fade-in {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}
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-logo{
  height:36px;
  width:auto;
  object-fit:contain;
  display:block;
}
.sp-brand-text { font-size: 14px; font-weight: 700; letter-spacing: -0.02em; color: #9A1DFF}
.sp-badge { font-size: 9px; font-weight: 800; padding: 3px 8px; border-radius: 6px; background: linear-gradient(135deg, var(--ql-accent), #EA4335); 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, #4285F4, #4285F4); color: #fff; font-size: 8px; font-weight: 800; display: flex; align-items: center; justify-content: center; }

.sp-body { flex: 1; overflow: hidden; padding: 16px 16px 0; display: flex; flex-direction: column; min-height: 0; isolation: isolate; }
.sp-body > #sp-update-banner,
.sp-body > .sp-profile-card,
.sp-body > #sp-reseller-btn,
.sp-body > .sp-tabs { flex-shrink: 0; }
#sp-tab-content { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding-bottom: 16px; margin: 0 -4px; padding-left: 4px; padding-right: 4px; }

.sp-license-gate { text-align: center; padding: 40px 16px; }
.sp-lock-icon { font-size: 40px; 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: linear-gradient(135deg, var(--ql-accent), #4285F4); 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-btn-buy { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 10px 14px; border: 2px solid #22c55e; border-radius: var(--ql-radius-sm); background: rgba(34,197,94,0.12); color: #22c55e; font-size: 13px; font-weight: 700; cursor: pointer; transition: all var(--ql-transition); margin-top: 16px; box-shadow: 0 0 0 0 rgba(34,197,94,0); }
.sp-btn-buy:hover { background: rgba(34,197,94,0.2); box-shadow: 0 0 20px rgba(34,197,94,0.35), 0 4px 16px rgba(34,197,94,0.2); transform: translateY(-1px); }
.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: #4285F4; }
.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: linear-gradient(
    90deg,
    #E8A6FF,
    #4285F4,
    #9A1DFF,
    #5A00A8
  );
  background-size: 300% 100%;
  animation: sp-shimmer 4s ease infinite;
  transition: width 1s ease;
}
.sp-trial-bar-fill.sp-bar-urgent {
  background: linear-gradient(
    90deg,
    #4285F4,
    #9A1DFF,
    #5A00A8
  );
  background-size: 300% 100%;
  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: 10px; 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: none; }
.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(var(--ts-brand-primary-rgb),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(var(--ts-brand-primary-rgb),0.3); box-shadow: none; }
.sp-toggle input:checked + .sp-toggle-slider::before { transform: translateX(16px); background: var(--ql-accent); }
.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(var(--ts-brand-primary-rgb),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: linear-gradient(135deg, var(--ql-accent), #4285F4); 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(var(--ts-brand-primary-rgb),0.2); color: var(--ts-brand-primary); 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, #4285F4, #4285F4); 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: linear-gradient(135deg, var(--ql-accent), #4285F4); 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 Modo Plano */
.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(var(--ts-brand-primary-rgb),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: linear-gradient(135deg, var(--ql-accent), var(--ql-accent-hover)); 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 !important; visibility: visible !important; opacity: 1 !important; pointer-events: auto !important; gap: 0; margin-bottom: 14px; background: var(--ql-bg-surface); border: 1px solid var(--ql-border); border-radius: var(--ql-radius); overflow: hidden; position: sticky; top: 0; z-index: 50; flex-shrink: 0; }
.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%; min-height: 0; overflow: hidden; }
.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), var(--ts-brand-primary)); 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(var(--ts-brand-primary-rgb),0.2); }
.sp-chat-bubble::after { content: ''; position: absolute; bottom: 0; right: -6px; width: 12px; height: 12px; background: var(--ts-brand-primary); 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(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);
}
.sp-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);
}
.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(var(--ts-brand-primary-rgb), 0.15);
  backdrop-filter: blur(6px);
  border: 2px dashed rgba(var(--ts-brand-primary-rgb), 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: 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);
}


/* ===== LIFETIME LICENSE ===== */
.sp-lifetime-card {
  width: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px 12px;
  border-radius: 14px;
  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));
}

.sp-lifetime-icon {
  font-size: 22px;
  color: #4ade80;
}

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

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

/* ===== NEW SIDEBAR COMPOSER DESIGN ===== */

.sp-composer-shell {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.sp-log {
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  min-height: 16px;
  overflow: hidden;
  z-index: 10;
  flex-shrink: 0;
}

.sp-shortcuts-modern {
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 0;
  flex-shrink: 0;
}

.sp-chip-modern {
  aspect-ratio: 1 / 1;
  min-height: 64px;
  flex-direction: column;
  gap: 5px;
  padding: 7px 3px;
  border-radius: 16px;
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(200,76,255,0.12);
  color: var(--ql-text-secondary);
  font-size: 10px;
  font-weight: 700;
}

.sp-chip-modern:hover {
  background: rgba(255,255,255,0.065);
  border-color: rgba(200,76,255,0.28);
  color: var(--ql-text-primary);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(200,76,255,0.10);
}

.sp-chip-icon {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(200,76,255,0.12);
  border: 1px solid rgba(200,76,255,0.14);
  font-size: 18px;
}

.sp-chip-icon svg {
  width: 14px;
  height: 14px;
}

.sp-compose-card {
  flex: 1;
  min-height: 0;
  border-radius: 24px;
  padding: 14px;
  background:
    radial-gradient(circle at top left, rgba(200,76,255,0.16), transparent 38%),
    rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.08);
  /* box-shadow:
    0 18px 50px rgba(0,0,0,0.28),
    inset 0 1px 0 rgba(255,255,255,0.04); */
  display: flex;
  flex-direction: column;
}

.sp-textarea-modern {
  height: 154px;
  min-height: 80px;
  flex: 1;
  resize: none;
  border: none;
  background: transparent;
  padding: 4px 2px 10px;
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.6;
  box-shadow: none !important;
  min-height: 0;
}

@media (max-height: 600px) {
  .sp-shortcuts-modern { display: none; }
  .sp-composer-shell { gap: 8px; }
  .sp-textarea-modern { height: 72px; min-height: 52px; }
  .sp-mode-row { flex-wrap: wrap; gap: 6px; }
  .sp-log { margin-top: 2px; min-height: 16px; font-size: 11px; }
}

@media (max-height: 480px) {
  .sp-compose-card { padding: 8px 10px; }
  .sp-textarea-modern { height: 52px; min-height: 40px; padding: 2px 2px 4px; margin-bottom: 4px; }
  .sp-compose-toolbar { padding-top: 4px; gap: 4px; }
  .sp-mode-row { display: flex !important; gap: 5px; padding-top: 2px; }
  .sp-mode-row .sp-toggle-label { font-size: 10px; }
  .sp-icon-tool { width: 28px; height: 28px; font-size: 13px; }
  .sp-send-modern { width: 34px; height: 34px; font-size: 16px; }
}

.sp-textarea-modern:focus {
  border: none;
  box-shadow: none !important;
}

.sp-compose-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

.sp-compose-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.sp-icon-tool {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.045);
  color: var(--ql-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--ql-transition);
  font-size: 15px;
}

.sp-icon-tool:hover {
  background: rgba(200,76,255,0.12);
  border-color: rgba(200,76,255,0.24);
  color: var(--ql-text-primary);
  transform: translateY(-1px);
}

.sp-icon-tool.sp-recording {
  background: var(--ql-accent-subtle);
  border-color: rgba(200,76,255,0.32);
  color: var(--ql-accent);
  box-shadow: 0 0 0 3px var(--ql-accent-subtle);
}

.sp-icon-tool.sp-shield-active {
  background: rgba(52,211,153,0.14);
  border-color: rgba(52,211,153,0.32);
  color: var(--ql-success);
}

.sp-send-modern {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--ql-accent), #4285F4);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(200,76,255,0.28);
  transition: all var(--ql-transition);
  flex-shrink: 0;
}

.sp-send-modern:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 14px 36px rgba(200,76,255,0.36);
}

.sp-send-modern:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.sp-mode-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 2px;
  flex-shrink: 0;
}

.sp-mode-row .sp-toggle-label {
  margin-right: auto;
}

.sp-mini-action {
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--ql-text-secondary);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all var(--ql-transition);
}

.sp-mini-action:hover {
  background: rgba(255,90,90,0.10);
  border-color: rgba(255,90,90,0.24);
  color: var(--ql-text-primary);
  box-shadow: none;
}

.sp-hidden-action {
  width: 100%;
}

.sp-brand {
  display: flex;
  align-items: center;
  gap: 7px;
}

.sp-brand-logo {
  height: 26px;
  width: auto;
  object-fit: contain;
  display: block;
}

.sp-brand-community {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1;
  color: var(--ts-brand-primary);
  text-shadow: 0 2px 14px rgba(var(--ts-brand-primary-rgb), 0.28);
}

.sp-badge {
  margin-left: 4px;
}

.sp-profile-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.sp-profile-left{
  display:flex;
  align-items:center;
  gap:8px;
}

.sp-profile-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  margin-left:auto;
  flex-shrink:0;
}

.sp-profile-action{
  width:24px;
  height:24px;
  padding:0;
  border:none;
  background:transparent;
  color:#111111;
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
  cursor:pointer;
  transition:.18s ease;
}

.sp-profile-action:hover{
  opacity:.72;
  transform:translateY(-1px);
}

.sp-profile-badge{
  position:absolute;
  top:-4px;
  right:-3px;
  min-width:14px;
  height:14px;
  border-radius:999px;
  background:#4285F4;
  color:#fff;
  font-size:9px;
  font-weight:700;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0 4px;
}

.sp-action-icon{
  width:16px;
  height:16px;
  stroke-width:2.2;
}

.sp-logout-btn{
  color:#ff3b5c;
}

.sp-help-btn{
  color:#2a2a2a;
}

.sp-notif-btn{
  color:#2a2a2a;
}

.sp-theme-icon{
  width:16px;
  height:16px;
  color:#2a2a2a;
  display:block;
}

body:not(.sp-light) .sp-theme-icon{
  color:var(--ts-brand-primary);
}

.sp-theme-btn{
  margin-left:0 !important;
}

.sp-profile-action,
.sp-theme-btn{
  flex:0 0 24px;
}

.sp-license-gate{
  min-height: calc(100vh - 115px);
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  padding:0 32px;
}

.sp-login-logo{
  width:82px;
  height:auto;
  object-fit:contain;
  margin-bottom:12px;
}

.sp-login-topbar{
  display:flex;
  gap:6px;
  margin-bottom:18px;
  justify-content:center;
}

.sp-login-action-btn{
  display:inline-flex;
  align-items:center;
  gap:5px;
  padding:7px 14px;
  border-radius:999px;
  border:1px solid rgba(var(--ts-brand-primary-rgb),0.25);
  background:rgba(var(--ts-brand-primary-rgb),0.07);
  color:var(--ts-brand-primary);
  font-size:12px;
  font-weight:600;
  font-family:inherit;
  cursor:pointer;
  text-decoration:none;
  transition:all var(--ql-transition);
}

.sp-login-action-btn:hover{
  background:rgba(var(--ts-brand-primary-rgb),0.14);
  border-color:rgba(var(--ts-brand-primary-rgb),0.4);
  color:#e9d5ff;
}

.sp-gate-actions{
  width:100%;
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:14px;
}

.sp-glass-card{
  display:flex;
  align-items:center;
  gap:12px;
  padding:11px 14px;
  border-radius:14px;
  background:rgba(var(--ts-brand-primary-rgb),0.05);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
  border:1px solid rgba(var(--ts-brand-primary-rgb),0.18);
  box-shadow:0 4px 20px rgba(var(--ts-brand-primary-rgb),0.08), inset 0 1px 0 rgba(255,255,255,0.06);
  text-decoration:none;
  cursor:pointer;
  transition:all 0.22s cubic-bezier(0.4,0,0.2,1);
  position:relative;
  overflow:hidden;
}

.sp-glass-card::before{
  content:'';
  position:absolute;
  inset:0;
  background:linear-gradient(135deg, rgba(var(--ts-brand-primary-rgb),0.08) 0%, transparent 60%);
  opacity:0;
  transition:opacity 0.22s ease;
}

.sp-glass-card:hover{
  background:rgba(var(--ts-brand-primary-rgb),0.10);
  border-color:rgba(var(--ts-brand-primary-rgb),0.35);
  box-shadow:0 6px 28px rgba(var(--ts-brand-primary-rgb),0.18), 0 0 40px rgba(var(--ts-brand-primary-rgb),0.10), inset 0 1px 0 rgba(255,255,255,0.10);
  transform:translateY(-1px);
}

.sp-glass-card:hover::before{
  opacity:1;
}

.sp-glass-card:active{
  transform:translateY(0);
}

.sp-glass-icon{
  flex-shrink:0;
  display:flex;
  align-items:center;
  justify-content:center;
  width:36px;
  height:36px;
  border-radius:10px;
  background:rgba(var(--ts-brand-primary-rgb),0.12);
  border:1px solid rgba(var(--ts-brand-primary-rgb),0.22);
  color:var(--ts-brand-primary);
  box-shadow:0 0 12px rgba(var(--ts-brand-primary-rgb),0.15);
  transition:all 0.22s ease;
  position:relative;
  z-index:1;
}

.sp-glass-card:hover .sp-glass-icon{
  background:rgba(var(--ts-brand-primary-rgb),0.20);
  box-shadow:0 0 18px rgba(var(--ts-brand-primary-rgb),0.30);
}

.sp-glass-content{
  flex:1;
  display:flex;
  flex-direction:column;
  gap:1px;
  min-width:0;
  position:relative;
  z-index:1;
  text-align:left;
}

.sp-glass-title{
  font-size:12.5px;
  font-weight:700;
  color:#d8b4fe;
  letter-spacing:0.1px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.sp-glass-sub{
  font-size:11px;
  font-weight:400;
  color:var(--ts-brand-primary);
  opacity:0.75;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.sp-glass-arrow{
  flex-shrink:0;
  display:flex;
  align-items:center;
  color:rgba(var(--ts-brand-primary-rgb),0.5);
  transition:all 0.22s ease;
  position:relative;
  z-index:1;
}

.sp-glass-card:hover .sp-glass-arrow{
  color:rgba(200,130,255,0.9);
  transform:translateX(3px);
}

.sp-log{
  margin-top:10px;
  font-size:11px;
  color:#c084fc;
  text-align:center;
  min-height:14px;
  font-weight:500;
}

.sp-footer{
  padding:14px 18px 16px;
  display:flex;
  justify-content:center;
  align-items:center;
  border-top:1px solid rgba(200,76,255,.08);
  background:transparent;
}

.sp-footer-badge{
  display:flex;
  align-items:center;
  justify-content:center;
  padding:8px 16px;
  border-radius:999px;
  border:1px solid rgba(200,76,255,.22);
  background:rgba(200,76,255,.05);
  color:#4285F4;
  font-size:11px;
  font-weight:700;
  letter-spacing:.2px;
  transition:.2s ease;
}

.sp-footer-badge:hover{
  background:rgba(200,76,255,.09);
  border-color:rgba(200,76,255,.34);
}
/* ===== Skills ===== */
.sp-skills-toolbar { display: flex; align-items: center; justify-content: space-between; margin: 10px 0 12px; }
.sp-skills-new { background: var(--ql-accent); color: #fff; border: none; border-radius: 8px; padding: 8px 12px; font-size: 12px; font-weight: 700; cursor: pointer; transition: all var(--ql-transition); }
.sp-skills-new:hover { filter: brightness(1.1); transform: translateY(-1px); }
.sp-skills-count { font-size: 11px; color: var(--ql-text-muted); }
.sp-skills-list { display: flex; flex-direction: column; gap: 8px; }
.sp-skill-card { border: 1px solid var(--ql-border, rgba(var(--ts-brand-primary-rgb),0.18)); background: var(--ql-bg-card, rgba(255,255,255,0.02)); border-radius: 10px; padding: 10px 12px; transition: border-color var(--ql-transition); }
.sp-skill-card:hover { border-color: var(--ql-accent); }
.sp-skill-head { display: flex; align-items: center; gap: 10px; }
.sp-skill-icon { font-size: 18px; width: 28px; text-align: center; flex-shrink: 0; }
.sp-skill-info { flex: 1; min-width: 0; }
.sp-skill-name { font-size: 12px; font-weight: 700; color: var(--ql-text); }
.sp-skill-desc { font-size: 10px; color: var(--ql-text-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-skill-actions { display: flex; gap: 4px; }
.sp-skill-btn { width: 26px; height: 26px; border-radius: 6px; border: 1px solid transparent; background: rgba(var(--ts-brand-primary-rgb),0.08); color: var(--ql-text-secondary); font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all var(--ql-transition); }
.sp-skill-btn:hover { background: var(--ql-accent); color: #fff; }
.sp-skill-inject:hover { background: #10b981; }
.sp-skill-del:hover { background: #ef4444; }
.sp-skill-preview { margin-top: 8px; padding: 8px 10px; background: rgba(0,0,0,0.18); border-radius: 6px; font-size: 10px; color: var(--ql-text-muted); font-family: ui-monospace, monospace; line-height: 1.5; max-height: 60px; overflow: hidden; }

.sp-skill-form { display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }
.sp-skill-form-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.sp-skill-back { background: transparent; border: none; color: var(--ql-accent); font-size: 12px; cursor: pointer; font-weight: 600; }
.sp-skill-form-title { font-size: 13px; font-weight: 700; color: var(--ql-text); }
.sp-skill-field-row { display: flex; gap: 8px; }
.sp-skill-field { display: flex; flex-direction: column; gap: 4px; }
.sp-skill-field label { font-size: 10px; font-weight: 600; color: var(--ql-text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.sp-skill-field input, .sp-skill-field textarea { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid rgba(var(--ts-brand-primary-rgb),0.22); background: rgba(255,255,255,0.02); color: var(--ql-text); font-size: 12px; outline: none; font-family: inherit; resize: vertical; box-sizing: border-box; }
.sp-skill-field input:focus, .sp-skill-field textarea:focus { border-color: var(--ql-accent); }
.sp-skill-field textarea { font-family: ui-monospace, monospace; line-height: 1.5; min-height: 140px; }
.sp-skill-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.sp-skill-cancel { background: transparent; border: 1px solid rgba(var(--ts-brand-primary-rgb),0.25); color: var(--ql-text-secondary); padding: 8px 14px; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer; }
.sp-skill-save { background: var(--ql-accent); color: #fff; border: none; padding: 8px 16px; border-radius: 8px; font-size: 12px; font-weight: 700; cursor: pointer; }
.sp-skill-save:hover { filter: brightness(1.1); }

/* Skills picker popover */
.sp-skills-picker { background: var(--ql-bg-elevated); border: 1px solid var(--ql-border); border-radius: 10px; padding: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.15); z-index: 9999; min-width: 220px; max-width: 320px; max-height: 320px; overflow-y: auto; color: var(--ql-text-primary); }
.sp-skills-picker-head { font-size: 10px; font-weight: 700; color: var(--ql-text-muted); text-transform: uppercase; padding: 4px 8px 8px; letter-spacing: 0.5px; }
.sp-skills-picker-list { display: flex; flex-direction: column; gap: 2px; }
.sp-skills-picker-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: transparent; border: none; border-radius: 6px; color: var(--ql-text-primary); font-size: 12px; cursor: pointer; text-align: left; width: 100%; transition: background var(--ql-transition); }
.sp-skills-picker-item:hover { background: var(--ql-bg-hover); }
.sp-skills-picker-icon { font-size: 14px; }
.sp-skills-picker-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-skills-picker-empty { padding: 16px; text-align: center; font-size: 11px; color: var(--ql-text-muted); }
.sp-skills-picker-hint { font-size: 10px; opacity: 0.7; }

/* ===== Built-in Lovable Skills ===== */
.sp-skills-section-title{
  font-size:11px;text-transform:uppercase;letter-spacing:.06em;
  color:var(--ql-text-muted);margin:14px 4px 6px;font-weight:600;
}
.sp-skill-badge-builtin{
  display:inline-block;margin-left:6px;padding:1px 6px;border-radius:8px;
  font-size:10px;font-weight:600;background:var(--ql-accent);color:#fff;vertical-align:middle;
}
.sp-skill-card-builtin{border-left:3px solid var(--ql-accent);}
.sp-skills-picker-section{
  font-size:10px;text-transform:uppercase;letter-spacing:.06em;
  color:var(--ql-text-muted);padding:6px 10px 2px;font-weight:600;
}

/* ===== Light mode: overlays, modais e preview de skills ===== */
body.sp-light .sp-alert-overlay,
body.sp-light .sp-modal-overlay {
  background: rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(4px);
}
body.sp-light .sp-alert-box,
body.sp-light .sp-modal {
  box-shadow: 0 24px 80px -12px rgba(15, 23, 42, 0.18);
}
body.sp-light .sp-skill-preview {
  background: rgba(15, 23, 42, 0.05);
}
body.sp-light .sp-skill-btn {
  background: rgba(var(--ts-brand-primary-rgb), 0.08);
}

/* ===== Active Skill chip (acima do textarea) ===== */
.sp-active-skill {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 6px 4px 8px;
}
.sp-active-skill-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 10px;
  border-radius: 999px;
  background: var(--ql-accent-soft);
  border: 1px solid var(--ql-accent);
  color: var(--ql-accent);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.sp-active-skill-ico { font-size: 13px; }
.sp-active-skill-name { letter-spacing: 0.02em; }
.sp-active-skill-x {
  width: 18px; height: 18px;
  border: none; background: rgba(var(--ts-brand-primary-rgb),0.18);
  color: var(--ql-accent);
  border-radius: 50%; cursor: pointer;
  font-size: 14px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.sp-active-skill-x:hover { background: var(--ql-accent); color: #fff; }
.sp-active-skill-hint {
  font-size: 10px; color: var(--ql-text-muted);
}

/* Edge toggle button — independent, anchored to left edge of side panel */
#ts-sidebar-edge-toggle {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 60px;
  border: none;
  border-radius: 0 12px 12px 0;
  cursor: pointer;
  z-index: 2147483647;
  background: var(--ql-accent);
  color: #fff;
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transition: box-shadow 220ms ease, left 220ms ease, background 220ms ease;
}
#ts-sidebar-edge-toggle:hover {
  left: 2px;
  background: var(--ql-accent-hover);
  box-shadow: 0 12px 32px var(--ql-accent-glow);
}


/* ===== 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-switcher{
    gap:1px;
    padding:2px;
    margin-left:6px;
    flex:0 0 auto;
  }
  .ql-i18n-btn{
    min-width:32px;
    width:32px;
    height:26px;
    padding:0;
    font-size:11px;
  }
  .ql-i18n-btn .ql-i18n-code{
    display:inline;
    font-size:11px;
    line-height:1;
  }
  .ql-i18n-btn .ql-i18n-code{ display:inline; }
}
.sp-header .ql-i18n-switcher{ margin-left:auto; }

@media (max-width:420px){
  .sp-header{
    padding-left:14px;
    padding-right:14px;
    gap:8px;
  }
  .sp-brand{
    min-width:0;
    flex:1 1 auto;
  }
  .sp-brand-text{
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  .sp-badge{
    flex:0 0 auto;
  }
}
