:root {
  --avery-ink:#111821;
  --avery-muted:#66717e;
  --avery-paper:#fffdf9;
  --avery-soft:#f4f1ea;
  --avery-line:#e5dfd6;
  --avery-coral:#ff6848;
  --avery-coral-dark:#e95033;
  --avery-blue:#1b73e8;
  --avery-green:#22a06b;
}

.avery-launcher,
.avery-panel,
.avery-panel * { box-sizing:border-box; }

.avery-launcher {
  position:fixed;
  right:22px;
  bottom:22px;
  z-index:9998;
  display:flex;
  align-items:center;
  gap:10px;
  min-height:54px;
  padding:8px 14px 8px 8px;
  border:1px solid rgba(17,24,33,.12);
  border-radius:999px;
  background:var(--avery-ink);
  color:#fff;
  box-shadow:0 18px 50px rgba(17,24,33,.22);
  cursor:pointer;
  font:700 14px/1.1 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
.avery-launcher:hover { transform:translateY(-1px); }
.avery-launcher img { width:38px;height:38px;border-radius:50%;object-fit:cover;display:block;border:2px solid #fff; }
.avery-launcher small { display:block;margin-top:2px;color:#cbd1d8;font-size:11px;font-weight:600; }
.avery-launcher .avery-online-dot { width:8px;height:8px;border-radius:50%;background:#3ad28d;box-shadow:0 0 0 3px rgba(58,210,141,.16); }

.avery-panel {
  position:fixed;
  right:22px;
  bottom:90px;
  z-index:9999;
  width:min(390px, calc(100vw - 28px));
  height:min(650px, calc(100vh - 120px));
  display:none;
  grid-template-rows:auto auto 1fr auto auto;
  overflow:hidden;
  border:1px solid rgba(17,24,33,.14);
  border-radius:22px;
  background:var(--avery-paper);
  color:var(--avery-ink);
  box-shadow:0 30px 90px rgba(17,24,33,.26);
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
.avery-panel.is-open { display:grid; animation:averyIn .18s ease-out both; }
@keyframes averyIn { from{opacity:0;transform:translateY(10px) scale(.985)} to{opacity:1;transform:none} }

.avery-head {
  display:flex;align-items:center;gap:11px;padding:14px 15px;background:var(--avery-ink);color:#fff;
}
.avery-head img { width:42px;height:42px;border-radius:50%;object-fit:cover;border:2px solid rgba(255,255,255,.85); }
.avery-head-main { min-width:0;flex:1; }
.avery-head-title { display:flex;align-items:center;gap:7px;font-weight:800;font-size:15px; }
.avery-head-title i { width:8px;height:8px;border-radius:50%;background:#3ad28d;display:inline-block; }
.avery-head-sub { margin-top:3px;color:#cbd1d8;font-size:11px; }
.avery-close { border:0;background:transparent;color:#fff;font-size:23px;line-height:1;cursor:pointer;padding:4px 6px;border-radius:8px; }
.avery-close:hover { background:rgba(255,255,255,.09); }

.avery-disclosure {
  padding:9px 14px;border-bottom:1px solid var(--avery-line);background:#faf7f2;color:#6d655c;font-size:11px;line-height:1.35;
}
.avery-disclosure strong { color:#433d37; }

.avery-messages {
  overflow:auto;
  overscroll-behavior:contain;
  padding:16px 14px 12px;
  display:flex;flex-direction:column;gap:10px;
  background:linear-gradient(180deg,#fffdf9 0%,#faf7f2 100%);
}
.avery-msg { max-width:86%;padding:11px 12px;border-radius:15px;font-size:13px;line-height:1.42;white-space:pre-wrap;word-break:break-word; }
.avery-msg.bot { align-self:flex-start;background:#fff;border:1px solid var(--avery-line);border-bottom-left-radius:5px; }
.avery-msg.user { align-self:flex-end;background:var(--avery-ink);color:#fff;border-bottom-right-radius:5px; }
.avery-msg.typing { color:var(--avery-muted);font-style:italic; }

.avery-quick {
  display:flex;gap:7px;overflow:auto;padding:10px 12px 8px;border-top:1px solid var(--avery-line);background:#fff;
  scrollbar-width:none;
}
.avery-quick::-webkit-scrollbar{display:none}
.avery-chip {
  flex:0 0 auto;border:1px solid var(--avery-line);background:#fff;color:var(--avery-ink);padding:8px 10px;border-radius:999px;font:700 11px/1 system-ui;cursor:pointer;
}
.avery-chip:hover { border-color:#c8beb2;background:#fbf7f0; }

.avery-compose { display:grid;grid-template-columns:1fr 44px;gap:8px;padding:10px 12px 12px;background:#fff; }
.avery-compose textarea {
  resize:none;min-height:44px;max-height:100px;padding:11px 12px;border:1px solid var(--avery-line);border-radius:14px;background:#faf8f4;color:var(--avery-ink);outline:none;font:500 13px/1.35 system-ui;
}
.avery-compose textarea:focus { border-color:#b9ad9f;background:#fff;box-shadow:0 0 0 3px rgba(255,104,72,.08); }
.avery-send { width:44px;height:44px;border:0;border-radius:13px;background:var(--avery-coral);color:#fff;font-size:18px;cursor:pointer;box-shadow:0 9px 18px rgba(255,104,72,.20); }
.avery-send:hover { background:var(--avery-coral-dark); }
.avery-send:disabled { opacity:.55;cursor:not-allowed; }

.avery-error { margin:0 12px 10px;padding:8px 10px;border-radius:10px;background:#fff0ed;color:#9c3324;font-size:11px;display:none; }
.avery-error.show { display:block; }

@media (max-width:640px){
  .avery-launcher { right:14px;bottom:14px; }
  .avery-launcher .avery-label { display:none; }
  .avery-launcher { padding:7px;min-height:auto; }
  .avery-launcher img { width:44px;height:44px; }
  .avery-launcher .avery-online-dot { display:none; }
  .avery-panel { right:10px;bottom:76px;width:calc(100vw - 20px);height:min(72vh, 640px);border-radius:18px; }
}

/* Avery guided V1 — zero API cost */
.avery-actions{padding:10px 12px 12px;border-top:1px solid var(--avery-line);background:#fff;max-height:210px;overflow:auto}
.avery-option-wrap{display:grid;gap:7px}
.avery-option{display:block;width:100%;border:1px solid var(--avery-line);background:#fff;color:var(--avery-ink);padding:10px 12px;border-radius:12px;font:700 12px/1.2 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;text-align:left;text-decoration:none;cursor:pointer}
.avery-option:hover{border-color:#c8beb2;background:#fbf7f0}
.avery-option.avery-primary{background:var(--avery-coral);border-color:var(--avery-coral);color:#fff;text-align:center}
.avery-option.avery-primary:hover{background:var(--avery-coral-dark)}
.avery-guided-form{display:grid;grid-template-columns:1fr auto;gap:8px}
.avery-guided-form input{min-width:0;padding:11px 12px;border:1px solid var(--avery-line);border-radius:12px;background:#faf8f4;color:var(--avery-ink);outline:none;font:500 13px/1.2 system-ui}
.avery-guided-form input:focus{border-color:#b9ad9f;background:#fff;box-shadow:0 0 0 3px rgba(255,104,72,.08)}
.avery-guided-form button{border:0;border-radius:12px;background:var(--avery-coral);color:#fff;padding:0 14px;font-weight:800;cursor:pointer}
@media(max-width:420px){.avery-guided-form{grid-template-columns:1fr}.avery-guided-form button{min-height:42px}}
