/* Floating AI chat widget — brand tokens from tokens.css */
#agent-chat { position: fixed; right: 22px; bottom: 22px; z-index: 9000; font-family: inherit; }
#agent-chat [hidden] { display: none !important; }

.ac-fab {
  display: flex; align-items: center; gap: 8px;
  background: var(--ink, #16181d); color: #fff; border: none; cursor: pointer;
  padding: 13px 20px; border-radius: 999px; font-size: 15px; font-weight: 700;
  box-shadow: 0 8px 28px rgba(0,0,0,.22); transition: transform .15s ease;
}
.ac-fab:hover { transform: translateY(-2px); }

.ac-panel {
  width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 60px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--paper, #fdfcfa); border: 1.5px solid var(--line, #e8e4de);
  border-radius: 18px; box-shadow: 0 18px 60px rgba(0,0,0,.25);
}

.ac-head {
  display: flex; align-items: baseline; gap: 8px; padding: 14px 16px;
  background: var(--ink, #16181d); color: #fff;
}
.ac-head b { font-size: 15px; }
.ac-head span { font-size: 12.5px; color: #c8cdd6; flex: 1; }
.ac-x { background: none; border: none; color: #c8cdd6; font-size: 22px; cursor: pointer; line-height: 1; }

.ac-msgs { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 10px; }
.ac-msg { max-width: 85%; }
.ac-msg p {
  padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.5;
  white-space: pre-line; word-wrap: break-word;
}
.ac-msg.me { align-self: flex-end; }
.ac-msg.me p { background: var(--accent, #e8590c); color: #fff; border-bottom-right-radius: 4px; }
.ac-msg.ai p, .ac-msg.human p { background: #fff; border: 1.5px solid var(--line, #e8e4de); border-bottom-left-radius: 4px; }
.ac-msg.human p { border-color: var(--accent, #e8590c); }
.ac-tag { display: block; font-size: 11px; font-weight: 700; color: var(--accent, #e8590c); margin: 0 0 3px 4px; text-transform: uppercase; letter-spacing: .04em; }

.ac-typing p { display: flex; gap: 4px; }
.ac-typing i { width: 7px; height: 7px; border-radius: 50%; background: #b9b3aa; animation: ac-blink 1.2s infinite; }
.ac-typing i:nth-child(2) { animation-delay: .2s; }
.ac-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes ac-blink { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }

.ac-email { padding: 10px 14px; border-top: 1.5px solid var(--line, #e8e4de); background: #fff7f2; }
.ac-email p { font-size: 12.5px; margin-bottom: 6px; color: #3a3f47; }
.ac-email form { display: flex; gap: 6px; }
.ac-email input { flex: 1; padding: 8px 10px; font-size: 13.5px; border: 1.5px solid var(--line, #e8e4de); border-radius: 8px; }
.ac-email button { padding: 8px 14px; font-size: 13px; font-weight: 700; background: var(--accent, #e8590c); color: #fff; border: none; border-radius: 8px; cursor: pointer; }

.ac-form { display: flex; gap: 8px; padding: 12px 14px; border-top: 1.5px solid var(--line, #e8e4de); background: #fff; }
.ac-form input { flex: 1; padding: 10px 12px; font-size: 14px; border: 1.5px solid var(--line, #e8e4de); border-radius: 10px; }
.ac-form input:focus { outline: none; border-color: var(--accent, #e8590c); }
.ac-form button { width: 42px; font-size: 17px; font-weight: 800; background: var(--ink, #16181d); color: #fff; border: none; border-radius: 10px; cursor: pointer; }

@media (max-width: 480px) { #agent-chat { right: 12px; bottom: 12px; } }
