/* Zoodnet AI widget — scoped under #zoodnet-ai-root */
#zoodnet-ai-root, #zoodnet-ai-root * { box-sizing: border-box; }
#zoodnet-ai-root {
  --zn-brand: #2563eb;
  --zn-brand-dark: #1d4ed8;
  --zn-bg: #ffffff;
  --zn-bg-soft: #f1f5f9;
  --zn-text: #1e293b;
  --zn-muted: #64748b;
  --zn-border: #e2e8f0;
  --zn-bubble-bot: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
#zoodnet-ai-root.zn-dark {
  --zn-bg: #0f172a;
  --zn-bg-soft: #020617;
  --zn-text: #e2e8f0;
  --zn-muted: #94a3b8;
  --zn-border: #334155;
  --zn-bubble-bot: #1e293b;
}

/* Floating button */
.zn-fab {
  position: fixed; bottom: 20px; right: 20px; z-index: 2147483000;
  width: 60px; height: 60px; border: 0; border-radius: 50%;
  background: var(--zn-brand); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 30px rgba(37,99,235,.35);
  transition: transform .15s ease, background .15s ease;
}
.zn-fab:hover { transform: scale(1.06); background: var(--zn-brand-dark); }
.zn-fab:active { transform: scale(.95); }
.zn-fab svg { width: 26px; height: 26px; }
.zn-fab .zn-dot { position: absolute; top: -2px; right: -2px; width: 12px; height: 12px; border-radius: 50%; background: #34d399; border: 2px solid #fff; animation: zn-bounce 1.4s infinite; }
.zn-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #ef4444; color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* Panel */
.zn-panel {
  position: fixed; bottom: 20px; right: 20px; z-index: 2147483000;
  width: 380px; height: 600px; max-width: calc(100vw - 32px); max-height: calc(100vh - 40px);
  background: var(--zn-bg); color: var(--zn-text);
  border: 1px solid var(--zn-border); border-radius: 18px; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgba(2,6,23,.28);
  animation: zn-slide-up .28s cubic-bezier(.16,1,.3,1);
}
.zn-panel.zn-max { width: 720px; height: 840px; }
.zn-panel.zn-min { height: 64px; }

@media (max-width: 520px) {
  .zn-panel, .zn-panel.zn-max { width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; bottom: 0; right: 0; border-radius: 0; }
  .zn-panel.zn-min { height: 64px; bottom: 0; }
}

/* Header */
.zn-header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: linear-gradient(135deg, var(--zn-brand), var(--zn-brand-dark)); color: #fff; }
.zn-avatar { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.zn-title { flex: 1; min-width: 0; }
.zn-title strong { display: block; font-size: 14px; line-height: 1.2; }
.zn-title span { font-size: 11px; opacity: .85; display: flex; align-items: center; gap: 4px; }
.zn-title span i { width: 6px; height: 6px; border-radius: 50%; background: #6ee7b7; display: inline-block; }
.zn-iconbtn { width: 28px; height: 28px; border: 0; background: transparent; color: #fff; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: .9; }
.zn-iconbtn:hover { background: rgba(255,255,255,.2); }
.zn-iconbtn svg { width: 16px; height: 16px; }

/* Messages */
.zn-body { flex: 1; overflow-y: auto; padding: 16px 12px; background: var(--zn-bg-soft); display: flex; flex-direction: column; gap: 10px; }
.zn-body::-webkit-scrollbar { width: 6px; } .zn-body::-webkit-scrollbar-thumb { background: rgba(120,120,120,.4); border-radius: 3px; }
.zn-row { display: flex; }
.zn-row.user { justify-content: flex-end; }
.zn-bubble { max-width: 85%; padding: 9px 13px; border-radius: 16px; font-size: 14px; line-height: 1.5; animation: zn-fade .2s ease; }
.zn-row.user .zn-bubble { background: var(--zn-brand); color: #fff; border-bottom-right-radius: 4px; }
.zn-row.bot .zn-bubble { background: var(--zn-bubble-bot); color: var(--zn-text); border-bottom-left-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.zn-bubble strong { font-weight: 700; }

/* Preview card */
.zn-preview { margin-top: 8px; border: 1px solid var(--zn-border); border-radius: 12px; overflow: hidden; }
.zn-preview iframe { width: 100%; height: 190px; border: 0; background: #fff; pointer-events: none; }
.zn-preview button { width: 100%; border: 0; padding: 7px; background: #0f172a; color: #fff; font-size: 12px; font-weight: 600; cursor: pointer; }
.zn-preview button:hover { background: #1e293b; }
.zn-modal { position: fixed; inset: 0; z-index: 2147483600; background: rgba(0,0,0,.75); display: flex; flex-direction: column; padding: 10px; }
.zn-modal iframe { flex: 1; width: 100%; border: 0; border-radius: 10px; background: #fff; }
.zn-modal .zn-close { align-self: flex-end; margin-bottom: 8px; background: #fff; border: 0; border-radius: 8px; padding: 6px 12px; font-weight: 600; cursor: pointer; }

/* Typing */
.zn-typing { display: flex; gap: 4px; padding: 12px 14px; background: var(--zn-bubble-bot); border-radius: 16px; border-bottom-left-radius: 4px; width: fit-content; }
.zn-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--zn-muted); animation: zn-bounce 1s infinite; }
.zn-typing i:nth-child(2) { animation-delay: .15s; } .zn-typing i:nth-child(3) { animation-delay: .3s; }

/* Composer */
.zn-foot { border-top: 1px solid var(--zn-border); background: var(--zn-bg); padding: 8px; }
.zn-inputrow { display: flex; gap: 8px; align-items: flex-end; }
.zn-input { flex: 1; resize: none; max-height: 110px; border: 1px solid var(--zn-border); background: var(--zn-bg-soft); color: var(--zn-text); border-radius: 12px; padding: 9px 12px; font-size: 14px; outline: none; font-family: inherit; }
.zn-input:focus { border-color: var(--zn-brand); }
.zn-send { width: 40px; height: 40px; border: 0; border-radius: 12px; background: var(--zn-brand); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.zn-send:hover { background: var(--zn-brand-dark); } .zn-send:disabled { opacity: .4; cursor: default; }
.zn-send svg { width: 17px; height: 17px; }
.zn-foot-links { display: flex; justify-content: space-between; padding: 4px 4px 0; }
.zn-foot-links button { background: 0; border: 0; cursor: pointer; font-size: 11px; }
.zn-link-quote { color: var(--zn-brand); font-weight: 600; }
.zn-link-clear { color: var(--zn-muted); }

/* Lead form */
.zn-lead { border-top: 1px solid var(--zn-border); background: var(--zn-bg); padding: 12px; }
.zn-lead-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.zn-lead-head strong { font-size: 14px; } .zn-lead-head button { background: 0; border: 0; color: var(--zn-muted); cursor: pointer; font-size: 16px; }
.zn-lead-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.zn-lead-grid input { width: 100%; border: 1px solid var(--zn-border); background: var(--zn-bg); color: var(--zn-text); border-radius: 9px; padding: 7px 10px; font-size: 13px; outline: none; }
.zn-lead-grid input:focus { border-color: var(--zn-brand); }
.zn-lead-project { width: 100%; margin-top: 8px; resize: none; border: 1px solid var(--zn-border); background: var(--zn-bg); color: var(--zn-text); border-radius: 9px; padding: 7px 10px; font-size: 13px; outline: none; font-family: inherit; }
.zn-lead-project:focus { border-color: var(--zn-brand); }
.zn-hp { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }
.zn-lead-submit { width: 100%; margin-top: 8px; border: 0; border-radius: 10px; background: var(--zn-brand); color: #fff; padding: 9px; font-weight: 600; cursor: pointer; }
.zn-lead-submit:hover { background: var(--zn-brand-dark); } .zn-lead-submit:disabled { opacity: .5; }
.zn-err { color: #ef4444; font-size: 12px; margin: 4px 0 0; }

@keyframes zn-slide-up { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes zn-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes zn-bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
