:root {
  --nessa-ai-green: #065f46;
  --nessa-ai-dark: #052e2b;
  --nessa-ai-soft: #ecfdf5;
  --nessa-ai-line: #d1fae5;
  --nessa-ai-text: #17211f;
  --nessa-ai-muted: #64748b;
}

.nessa-ai-launcher {
  position: fixed; right: 24px; bottom: 24px; z-index: 2147483000;
  display: flex; align-items: center; gap: 9px; border: 0; border-radius: 999px;
  padding: 10px 17px 10px 10px; color: #fff; background: linear-gradient(135deg, #047857, #064e3b);
  box-shadow: 0 12px 32px rgba(6, 78, 59, .32); cursor: pointer; font: 700 14px/1 system-ui, sans-serif;
  transition: transform .18s ease, box-shadow .18s ease;
}
.nessa-ai-launcher:hover { transform: translateY(-2px); box-shadow: 0 16px 38px rgba(6, 78, 59, .4); }
.nessa-ai-launcher-mark, .nessa-ai-logo {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.17); border: 1px solid rgba(255,255,255,.28); font-weight: 900;
}
.nessa-ai-overlay {
  position: fixed; inset: 0; z-index: 2147483100; display: none; align-items: center; justify-content: center;
  padding: 24px; background: rgba(2, 18, 14, .58); backdrop-filter: blur(5px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.nessa-ai-overlay.is-open { display: flex; }
.nessa-ai-panel {
  width: min(920px, 96vw); max-height: min(820px, 92vh); display: flex; flex-direction: column; overflow: hidden;
  color: var(--nessa-ai-text); background: #f8fafc; border: 1px solid rgba(255,255,255,.65); border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0,0,0,.35); animation: nessa-ai-enter .18s ease-out;
}
@keyframes nessa-ai-enter { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
.nessa-ai-header {
  display: flex; align-items: center; justify-content: space-between; padding: 18px 22px;
  color: #fff; background: linear-gradient(120deg, #064e3b, #047857);
}
.nessa-ai-identity { display: flex; align-items: center; gap: 12px; }
.nessa-ai-identity h2 { margin: 0 0 3px; color: #fff; font-size: 20px; font-weight: 800; }
.nessa-ai-identity p { margin: 0; color: #d1fae5; font-size: 12px; }
.nessa-ai-close { border: 0; padding: 3px 9px 6px; color: #fff; background: transparent; cursor: pointer; font-size: 29px; line-height: 1; }
.nessa-ai-content { overflow-y: auto; padding: 20px 22px 24px; }
.nessa-ai-prompt { padding: 16px; background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; box-shadow: 0 4px 14px rgba(15,23,42,.04); }
.nessa-ai-prompt label { display: block; margin-bottom: 8px; color: #334155; font-size: 13px; font-weight: 750; }
.nessa-ai-question {
  width: 100%; resize: vertical; min-height: 78px; box-sizing: border-box; padding: 12px 13px;
  color: #0f172a; background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 11px; outline: none;
  font: 14px/1.5 inherit;
}
.nessa-ai-question:focus { border-color: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,.12); }
.nessa-ai-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 11px; }
.nessa-ai-suggestions { display: flex; flex-wrap: wrap; gap: 7px; }
.nessa-ai-chip {
  padding: 7px 10px; color: #065f46; background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 999px;
  cursor: pointer; font-size: 11px; font-weight: 700;
}
.nessa-ai-chip:hover { background: #d1fae5; }
.nessa-ai-analyse {
  min-width: 105px; padding: 10px 17px; color: #fff; background: #047857; border: 0; border-radius: 10px;
  cursor: pointer; font-weight: 800;
}
.nessa-ai-analyse:hover { background: #065f46; }
.nessa-ai-analyse:disabled { opacity: .62; cursor: wait; }
.nessa-ai-output { min-height: 180px; margin-top: 16px; padding: 18px; background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; }
.nessa-ai-answer-title { margin: 0 0 7px; color: #064e3b; font-size: 18px; font-weight: 850; }
.nessa-ai-summary { margin: 0; color: #334155; font-size: 14px; line-height: 1.65; }
.nessa-ai-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 15px; }
.nessa-ai-metric { padding: 12px; background: var(--nessa-ai-soft); border: 1px solid var(--nessa-ai-line); border-radius: 12px; }
.nessa-ai-metric-label { display: block; margin-bottom: 5px; color: #047857; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.nessa-ai-metric-value { display: block; overflow-wrap: anywhere; color: #064e3b; font-size: 15px; }
.nessa-ai-table-wrap { margin-top: 16px; overflow-x: auto; border: 1px solid #e2e8f0; border-radius: 12px; }
.nessa-ai-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.nessa-ai-table th { padding: 10px 12px; color: #475569; background: #f1f5f9; text-align: left; white-space: nowrap; font-weight: 800; }
.nessa-ai-table td { padding: 10px 12px; color: #334155; border-top: 1px solid #e2e8f0; vertical-align: top; }
.nessa-ai-table tbody tr:hover { background: #f8fafc; }
.nessa-ai-note { margin: 14px 0 0; padding-top: 12px; color: var(--nessa-ai-muted); border-top: 1px solid #e2e8f0; font-size: 11px; line-height: 1.55; }
.nessa-ai-footer { padding: 10px 20px; color: #64748b; background: #f1f5f9; border-top: 1px solid #e2e8f0; text-align: center; font-size: 10px; font-weight: 650; }
@media (max-width: 720px) {
  .nessa-ai-overlay { padding: 10px; }
  .nessa-ai-panel { width: 100%; max-height: 96vh; border-radius: 16px; }
  .nessa-ai-content { padding: 14px; }
  .nessa-ai-actions { align-items: stretch; flex-direction: column; }
  .nessa-ai-analyse { width: 100%; }
  .nessa-ai-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nessa-ai-launcher-text { display: none; }
  .nessa-ai-launcher { right: 14px; bottom: 14px; padding: 8px; }
}
