/* Pannello flottante «AI SEO & GEO Assistant» (panel.js) — tema scuro #0f0f1a.
   2.0.7 (29/10/2026, pulizia grafica): era un blocco <style> creato da panel.js a ogni apertura
   dell'editor; ora è un foglio vero, accodato con lo script in Aisa_Panel. Contenuto invariato. */
#aisa-toggle-btn {
  position: fixed; right: 0; top: 50%;
  transform: rotate(-90deg);
  transform-origin: center center;
  background: linear-gradient(135deg, #1f1f3a, #15152a); color: #e2c97e; border: 1px solid #3a3a5a;
  border-bottom: none;
  padding: 11px 22px; border-radius: 10px 10px 0 0; cursor: pointer;
  font-family: 'Segoe UI', sans-serif; font-size: 13px; font-weight: 700;
  letter-spacing: .05em; z-index: 99998; display: flex; align-items: center; gap: 9px;
  box-shadow: 0 -3px 14px rgba(0,0,0,.4); transition: background .2s, color .2s; white-space: nowrap;
}
#aisa-toggle-btn:hover { background: linear-gradient(135deg, #2a2a4e, #1f1f3a); color: #f3dfa6; }
#aisa-toggle-btn.aisa-dragging { transition: none; cursor: grabbing; background: #2d2d4e; }
.aisa-toggle-grip { display: inline-flex; align-items: center; color: #6a6a90; cursor: grab; }
#aisa-toggle-btn:hover .aisa-toggle-grip { color: #9a9ac0; }
#aisa-panel {
  position: fixed; top: 32px; right: -360px; width: 340px; height: calc(100vh - 32px);
  background: #0f0f1a; color: #e8e6f0; z-index: 99999; display: flex; flex-direction: column;
  font-family: 'Segoe UI', system-ui, sans-serif; font-size: 13px;
  box-shadow: -4px 0 24px rgba(0,0,0,.5); transition: right .3s cubic-bezier(.4,0,.2,1);
  border-left: 1px solid #2a2a4a;
}
#aisa-panel.aisa-open { right: 0; }
.aisa-header { background: #1a1a2e; padding: 12px 14px; display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid #2a2a4a; flex-shrink: 0; cursor: move; user-select: none; }
.aisa-header-icon { color: #e2c97e; flex-shrink: 0; }
.aisa-header-title { flex: 1; font-size: 13px; font-weight: 600; color: #e2c97e; letter-spacing: .03em; }
.aisa-header-drag { color: #555; }
.aisa-close-btn { background: none; border: none; color: #888; cursor: pointer; padding: 2px;
  display: flex; align-items: center; border-radius: 3px; transition: color .2s, background .2s; }
.aisa-close-btn:hover { color: #e8e6f0; background: #2a2a4a; }
.aisa-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.aisa-body::-webkit-scrollbar { width: 4px; }
.aisa-body::-webkit-scrollbar-track { background: #0f0f1a; }
.aisa-body::-webkit-scrollbar-thumb { background: #3a3a5a; border-radius: 2px; }
.aisa-section-label { font-size: 10px; font-weight: 600; letter-spacing: .1em; color: #a8e3ff;
  text-transform: uppercase; margin-bottom: 6px; }
.aisa-controls { display: flex; flex-direction: column; gap: 8px; }
.aisa-row { display: flex; gap: 8px; }
.aisa-select { flex: 1; background: #1a1a2e; color: #c8c6d8; border: 1px solid #2a2a4a; border-radius: 6px;
  padding: 7px 10px; font-size: 12px; font-family: inherit; cursor: pointer; outline: none;
  transition: border-color .2s; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23a8e3ff'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
.aisa-select:focus { border-color: #e2c97e; }
.aisa-action-row { display: flex; gap: 7px; align-items: stretch; }
.aisa-ctx-opt { display: flex; align-items: center; gap: 7px; margin-top: 8px; font-size: 12px;
  color: #a090d8; cursor: pointer; user-select: none; }
.aisa-ctx-opt input { accent-color: #e2c97e; margin: 0; }
.aisa-ctx-opt.done { color: #4ade80; }
.aisa-generate-btn { flex: 1; background: linear-gradient(135deg, #e2c97e, #c9a84c); color: #0f0f1a;
  border: none; border-radius: 8px; padding: 11px 16px; font-size: 13px; font-weight: 700;
  font-family: inherit; cursor: pointer; display: flex; align-items: center; justify-content: center;
  gap: 8px; letter-spacing: .02em; transition: opacity .2s, transform .15s; flex-shrink: 0; }
.aisa-generate-btn:hover { opacity: .92; transform: translateY(-1px); }
.aisa-generate-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.aisa-load-btn { flex-shrink: 0; background: #1a1a2e; color: #8888b8; border: 1px solid #3a3a5a;
  border-radius: 8px; padding: 11px 12px; font-size: 11px; font-weight: 600; font-family: inherit;
  cursor: pointer; display: flex; align-items: center; gap: 5px; white-space: nowrap; transition: all .2s; }
.aisa-load-btn:hover { background: #252545; color: #e2c97e; border-color: #5a5a8a; }
.aisa-load-btn.aisa-loaded { color: #4ade80; border-color: #2a5a2a; background: #1a3a1a; }
.aisa-loader { display: none; align-items: center; gap: 10px; padding: 14px; background: #1a1a2e;
  border-radius: 8px; border: 1px solid #2a2a4a; }
.aisa-loader.visible { display: flex; }
.aisa-spinner { width: 18px; height: 18px; border: 2px solid #2a2a4a; border-top-color: #e2c97e;
  border-radius: 50%; animation: aisa-spin .7s linear infinite; flex-shrink: 0; }
@keyframes aisa-spin { to { transform: rotate(360deg); } }
.aisa-loader-text { font-size: 12px; color: #888; }
.aisa-error { display: none; background: #2a1515; border: 1px solid #5a2020; border-radius: 8px;
  padding: 10px 12px; color: #ff8a8a; font-size: 12px; line-height: 1.5; }
.aisa-error.visible { display: block; }
.aisa-locked { background: linear-gradient(135deg, #2a2440, #1c1830); border: 1px solid #5b4aa8;
  border-radius: 8px; padding: 12px 14px; color: #cbb6ff; font-size: 12px; line-height: 1.55; margin-bottom: 12px; }
.aisa-locked b { color: #e2c97e; }
.aisa-locked a { display: inline-block; margin-top: 8px; background: linear-gradient(135deg, #e2c97e, #c9a84c);
  color: #0f0f1a; font-weight: 700; text-decoration: none; padding: 6px 12px; border-radius: 6px; }
.aisa-results { display: none; flex-direction: column; gap: 10px; }
.aisa-results.visible { display: flex; }
.aisa-result-item { background: #1a1a2e; border: 1px solid #2a2a4a; border-radius: 8px;
  padding: 10px 12px; transition: border-color .2s; }
.aisa-result-item:hover { border-color: #3a3a6a; }
.aisa-result-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.aisa-result-label { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #7a78a0; }
.aisa-char-count { font-size: 10px; color: #555; }
.aisa-char-count.aisa-ok { color: #4ade80; }
.aisa-char-count.aisa-warn { color: #f59e0b; }
.aisa-char-count.aisa-bad { color: #f87171; }
.aisa-result-text { font-size: 12px; color: #c8c6d8; line-height: 1.7; margin-bottom: 6px;
  word-break: break-word; min-height: 22px; outline: none;
  /* Box editabile sempre visibile: anche un title fatto solo di token (chip) o vuoto
     si legge chiaramente come campo modificabile, non "sparito". */
  background: #14122a; border: 1px solid #2e2850; border-radius: 6px; padding: 7px 9px; }
.aisa-result-text:focus { color: #e8e6f0; border-color: #5b3fa8; background: #181534; }
.aisa-result-text .aisa-yoast-chip { display: inline-block; background: #2d1f5e; color: #c4b5fd;
  border: 1px solid #5b3fa8; border-radius: 10px; padding: 1px 7px; font-size: 11px; font-weight: 600;
  line-height: 1.6; cursor: default; user-select: none; white-space: nowrap; vertical-align: baseline; }
.aisa-result-text .aisa-yoast-chip--unknown { background: #2a2a2a; color: #888; border-color: #444; }
/* WC value chip = stesso layout del chip variabile (.aisa-yoast-chip), solo verde. */
.aisa-result-text .aisa-wc-chip { background: #14271b; color: #9fe3bb; border-color: #3e8a5e; }
.aisa-var-row { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 7px; }
.aisa-var-btn { background: #1e1a3a; color: #8878c8; border: 1px solid #3a3060; border-radius: 10px;
  padding: 2px 8px; font-size: 10px; font-weight: 600; font-family: inherit; cursor: pointer;
  white-space: nowrap; transition: all .15s; line-height: 1.6; }
.aisa-var-btn:hover { background: #2e2860; color: #d8c8ff; border-color: #6050b0; }
.aisa-val-btn { background: #14271b; color: #6bbf8a; border: 1px solid #2c5a3e; border-radius: 10px;
  padding: 2px 8px; font-size: 10px; font-weight: 600; font-family: inherit; cursor: pointer;
  white-space: nowrap; transition: all .15s; line-height: 1.6; }
.aisa-val-btn:hover { background: #1c3a28; color: #9fe3bb; border-color: #3e8a5e; }
.aisa-val-btn svg { vertical-align: -2px; margin-right: 2px; }
.aisa-wc-lbl-toggle { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; color: #9c9cc6; cursor: pointer; margin-right: 6px; user-select: none; }
.aisa-wc-lbl-toggle input { accent-color: #6bbf8a; margin: 0; }
.aisa-wc-row { margin-top: 2px; }
.aisa-result-actions { display: flex; gap: 6px; align-items: stretch; }
.aisa-apply-btn { flex: 1; background: #252540; color: #a0a0c8; border: 1px solid #3a3a5a;
  border-radius: 5px; padding: 5px 8px; font-size: 11px; font-weight: 600; font-family: inherit;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 4px; transition: all .15s; }
/* nelle azioni dei campi l'apply è compatto a sinistra */
.aisa-result-actions .aisa-apply-btn { flex: 0 1 auto; }
.aisa-fv-btn { flex: 0 1 auto; background: #1e1a3a; color: #a090d8; border: 1px solid #3a3060;
  border-radius: 5px; padding: 5px 9px; font-size: 11px; font-weight: 600; font-family: inherit;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 4px; transition: all .15s; white-space: nowrap; }
.aisa-fv-btn:hover { background: #2a2050; color: #c8b8f8; border-color: #6050b0; }
.aisa-fv-btn:disabled { opacity: .45; cursor: not-allowed; }
.aisa-field-variants { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 7px; }
.aisa-field-variants:empty { display: none; }
.aisa-field-variants .aisa-variant-chip { white-space: normal; text-align: left; line-height: 1.45; max-width: 100%; }
.aisa-rotation-row { display: flex; align-items: center; gap: 8px; margin-top: 7px; }
.aisa-rot-btn { flex: 1; background: #15233a; color: #7ab8e8; border: 1px solid #2a4060; border-radius: 5px;
  padding: 5px 8px; font-size: 11px; font-weight: 600; font-family: inherit; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 5px; transition: all .15s; }
.aisa-rot-btn:hover { background: #1e3450; color: #a8d8f8; border-color: #4a70a0; }
.aisa-rot-btn:disabled { opacity: .5; cursor: not-allowed; }
.aisa-rot-status { font-size: 11px; color: #4ade80; font-weight: 600; white-space: nowrap; }
.aisa-apply-btn:hover { background: #2f2f60; color: #e2c97e; border-color: #5a5a8a; }
.aisa-apply-btn.aisa-applied { background: #1a3a1a; color: #4ade80; border-color: #2a5a2a; }
.aisa-copy-btn { background: #252540; color: #a8e3ff; border: 1px solid #2a2a4a; border-radius: 5px;
  padding: 5px 8px; font-size: 11px; font-family: inherit; cursor: pointer; display: flex; align-items: center; transition: all .15s; }
.aisa-copy-btn:hover { color: #a0a0c8; border-color: #3a3a5a; }
.aisa-regen-btn { background: #1a1a2e; color: #a8e3ff; border: 1px solid #2a2a4a; border-radius: 5px;
  padding: 5px 7px; font-family: inherit; cursor: pointer; display: flex; align-items: center; transition: all .15s; }
.aisa-regen-btn:hover { color: #e2c97e; border-color: #5a5a3a; background: #2a2a1a; }
.aisa-regen-btn.aisa-spinning svg { animation: aisa-spin .6s linear infinite; }
.aisa-regen-btn:disabled { opacity: .4; cursor: not-allowed; }
.aisa-apply-all-btn { width: 100%; background: #1e3a2a; color: #4ade80; border: 1px solid #2a5a3a;
  border-radius: 8px; padding: 10px 16px; font-size: 12px; font-weight: 700; font-family: inherit;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  letter-spacing: .03em; transition: all .15s; margin-top: 4px; }
.aisa-apply-all-btn:hover { background: #254a32; border-color: #3a6a48; }
.aisa-apply-all-row { display: flex; gap: 8px; margin-top: 4px; }
.aisa-apply-all-row .aisa-apply-all-btn { margin-top: 0; }
.aisa-apply-all-rot { background: #2a2050; color: #c4b5fd; border-color: #5b3fa8; }
.aisa-apply-all-rot:hover { background: #34286a; border-color: #6d4ec8; }
.aisa-keyphrase-item { border-color: #3a3060; }
.aisa-keyphrase-item:hover { border-color: #5a50a0; }
.aisa-result-text[placeholder]:empty:before { content: attr(placeholder); color: #444; pointer-events: none; }
.aisa-kp-actions { flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
.aisa-kp-btn { flex: 1; min-width: 0; background: #1e1a3a; color: #a090d8; border: 1px solid #3a3060;
  border-radius: 5px; padding: 5px 7px; font-size: 11px; font-weight: 600; font-family: inherit;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 4px;
  transition: all .15s; white-space: nowrap; }
.aisa-kp-btn:hover { background: #2a2050; color: #c8b8f8; border-color: #6050b0; }
.aisa-kp-btn:disabled { opacity: .45; cursor: not-allowed; }
.aisa-kp-update { background: #1a2a3a; color: #7ab8e8; border-color: #2a4060; }
.aisa-kp-update:hover { background: #1e3450; color: #a8d8f8; border-color: #4a70a0; }
.aisa-kp-update.aisa-updating { opacity: .6; cursor: not-allowed; animation: aisa-pulse .8s ease-in-out infinite; }
@keyframes aisa-pulse { 0%,100%{opacity:.6} 50%{opacity:1} }
.aisa-kp-apply-row { margin-top: 0; }
.aisa-kp-apply-row .aisa-apply-btn { width: 100%; }
.aisa-kp-variants { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
.aisa-kp-variants:empty { display: none; }
.aisa-variant-chip { background: #1e1a3a; color: #b0a0e8; border: 1px solid #3a3060; border-radius: 12px;
  padding: 3px 10px; font-size: 11px; cursor: pointer; transition: all .15s; white-space: nowrap; }
.aisa-variant-chip:hover { background: #2e2860; color: #d8c8ff; border-color: #6050b0; }
.aisa-variant-chip.aisa-selected { background: #3a2880; color: #fff; border-color: #7060c0; }
.aisa-update-post-btn { width: 100%; background: #1a1a2e; color: #a0a0c8; border: 1px solid #3a3a5a;
  border-radius: 8px; padding: 10px 16px; font-size: 12px; font-weight: 700; font-family: inherit;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  letter-spacing: .03em; transition: all .15s; flex-shrink: 0; }
.aisa-update-post-btn:hover { background: #252545; color: #e2c97e; border-color: #5a5a8a; }
.aisa-update-post-btn.aisa-saving { opacity: .6; cursor: not-allowed; }
.aisa-update-post-btn.aisa-saved { background: #1a3a1a; color: #4ade80; border-color: #2a5a2a; }
.aisa-update-post-btn.aisa-nochange { color: #5a5a72; border-color: #24243a; background: #141422; cursor: default; }
.aisa-update-post-btn.aisa-nochange:hover { color: #5a5a72; border-color: #24243a; background: #141422; }
.aisa-update-post-btn.aisa-dirty { background: #1e3a2a; color: #4ade80; border-color: #2a5a3a; }
.aisa-update-post-btn.aisa-dirty:hover { background: #254a32; color: #6ee89a; border-color: #3a6a48; }
/* Apply button idle (pending) vs applied */
.aisa-apply-btn.aisa-applied { background: #1a3a1a; color: #4ade80; border-color: #2a5a2a; }
.aisa-divider { height: 1px; background: #1e1e32; margin: 2px 0; }
.aisa-no-key-warn { background: #2a2010; border: 1px solid #5a4010; border-radius: 6px; padding: 8px 10px;
  color: #e2a84c; font-size: 11px; line-height: 1.5; }
.aisa-no-key-warn a { color: #e2c97e; }
/* Variante "info" (azzurra) del banner .aisa-locked */
.aisa-locked.aisa-note-info { background: linear-gradient(135deg, #16263a, #13202e); border-color: #2a4a6a; color: #9cc4e8; }
/* Multilingual Rotation */
.aisa-ml-hint { font-size: 11px; color: #bababa; margin: 0 0 7px; line-height: 1.5; }
.aisa-ml-hint a { color: #e2c97e; }
.aisa-ml-syncwarn { font-size: 11px; color: #e8c98a; background: #2a2415; border: 1px solid #5a4a20;
  border-radius: 6px; padding: 7px 9px; margin: 0 0 7px; line-height: 1.5; }
.aisa-ml-syncwarn a { color: #f3dfa6; font-weight: 600; }
.aisa-ml-status { font-size: 11px; color: #bababa; margin-top: 6px; min-height: 14px; }
.aisa-results-via { font-weight: 700; }
/* Overlay centrale di avanzamento generazione multilingua (barra neon) */
.aisa-ml-overlay { position: fixed; inset: 0; z-index: 100001; display: flex; align-items: center;
  justify-content: center; background: rgba(8,8,16,.72); backdrop-filter: blur(4px);
  opacity: 0; transition: opacity .25s; }
.aisa-ml-overlay.aisa-show { opacity: 1; }
.aisa-ml-card { width: min(420px, 92vw); background: linear-gradient(160deg, #15152a, #0c0c16); color: #e8e6f0;
  border: 1px solid #2a2a4a; border-radius: 16px; padding: 24px 22px 20px; text-align: center;
  box-shadow: 0 24px 70px rgba(0,0,0,.6), 0 0 46px rgba(0,229,255,.10);
  font-family: 'Segoe UI', system-ui, sans-serif; transform: translateY(6px); transition: transform .25s; }
.aisa-ml-overlay.aisa-show .aisa-ml-card { transform: translateY(0); }
.aisa-ml-card h3 { margin: 0 0 6px; font-size: 15px; color: #a8e3ff; letter-spacing: .02em; }
.aisa-ml-ov-sub { font-size: 12px; color: #bababa; min-height: 16px; margin-bottom: 16px; }
.aisa-ml-bar-wrap { height: 12px; background: #0a0a14; border: 1px solid #23233f; border-radius: 999px; overflow: hidden; }
.aisa-ml-bar { height: 100%; width: 0; border-radius: 999px; transition: width .35s cubic-bezier(.4,0,.2,1);
  background: linear-gradient(90deg, #00e5ff, #7a5cff, #ff2bd6, #00e5ff); background-size: 300% 100%;
  box-shadow: 0 0 12px rgba(0,229,255,.75), 0 0 22px rgba(255,43,214,.45); animation: aisa-neon 1.5s linear infinite; }
@keyframes aisa-neon { 0% { background-position: 0% 50%; } 100% { background-position: 300% 50%; } }
.aisa-ml-pct { margin-top: 11px; font-size: 13px; color: #c8c6d8; font-weight: 700; letter-spacing: .04em; }
.aisa-ml-card.aisa-done h3 { color: #4ade80; }
.aisa-ml-card.aisa-done .aisa-ml-bar { background: #1e3a2a; box-shadow: 0 0 16px rgba(74,222,128,.6); animation: none; }
.aisa-ml-card.aisa-done .aisa-ml-pct { color: #4ade80; }
/* «Results via <provider>»: colore del provider (stessa mappa PROVIDER_COLORS di panel.js; prima era style="color:…"). */
.aisa-results-via { color: #888; }
.aisa-results-via--wp_ai { color: #21759b; }
.aisa-results-via--claude { color: #d97706; }
.aisa-results-via--openai { color: #10b981; }
.aisa-results-via--gemini { color: #3b82f6; }
.aisa-results-via--deepseek { color: #6366f1; }
.aisa-results-via--glm { color: #0ea5e9; }
.aisa-results-via--grok { color: #64748b; }
.aisa-results-via--mistral { color: #f97316; }
