/* AI chat widget (owned by Opus) */
.bx-chat-fab {
  position: fixed; right: 16px; bottom: 16px; z-index: 60;
  width: 60px; height: 60px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--pine, #0f2a22); color: #f4efe6;
  display: grid; place-items: center;
  box-shadow: 0 10px 30px rgba(15, 42, 34, .35);
  transition: transform .15s ease;
}
.bx-chat-fab:hover { transform: scale(1.05); }
.bx-chat-fab svg { width: 28px; height: 28px; }
.bx-chat-fab .dot { position: absolute; top: 8px; right: 9px; width: 13px; height: 13px; border-radius: 50%; background: var(--signal, #ff5a1f); border: 2px solid var(--pine, #0f2a22); }
.bx-chat-fab[aria-expanded="true"] .dot { display: none; }

.bx-chat-peek {
  position: fixed; right: 16px; bottom: 88px; z-index: 60; max-width: 260px;
  background: #fffdf8; color: #15181a; border-radius: 16px 16px 4px 16px; padding: 12px 34px 12px 14px;
  box-shadow: 0 10px 30px rgba(15, 42, 34, .2); font-size: 15px; line-height: 1.4; cursor: pointer;
  animation: bxIn .35s ease;
}
.bx-chat-peek button { position: absolute; top: 4px; right: 4px; border: 0; background: none; font-size: 18px; color: #6b7468; cursor: pointer; width: 28px; height: 28px; }

.bx-chat-panel {
  position: fixed; right: 16px; bottom: 88px; z-index: 61;
  width: 380px; max-width: calc(100vw - 24px); height: min(600px, calc(100vh - 120px));
  background: #fffdf8; color: #15181a; border-radius: 20px; overflow: hidden;
  box-shadow: 0 2px 6px rgba(15, 42, 34, .1), 0 30px 70px rgba(15, 42, 34, .3);
  display: none; flex-direction: column; animation: bxIn .25s ease; padding: 0; margin: 0;
  font-family: var(--font, system-ui, sans-serif);
}
.bx-chat-panel.open { display: flex; }
@media (max-width: 520px) {
  .bx-chat-panel { right: 0; left: 0; bottom: 0; width: 100%; max-width: 100%; height: 100dvh; border-radius: 0; }
  .bx-chat-panel.open ~ .bx-chat-fab { display: none; }
}
@keyframes bxIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.bx-chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--pine, #0f2a22); color: #f4efe6; }
.bx-chat-head img { width: 38px; height: 38px; border-radius: 10px; }
.bx-chat-head b { display: block; font-size: 16px; }
.bx-chat-head small { display: flex; align-items: center; gap: 6px; font-size: 12.5px; opacity: .8; }
.bx-chat-head small::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #46c37b; }
.bx-chat-head .x { margin-left: auto; border: 0; background: rgba(255,255,255,.1); color: inherit; width: 36px; height: 36px; border-radius: 10px; font-size: 20px; cursor: pointer; }
.bx-chat-head .x:hover { background: rgba(255,255,255,.2); }

.bx-chat-log { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: #f4efe6; overscroll-behavior: contain; }
.bx-msg { max-width: 86%; padding: 10px 14px; border-radius: 16px; font-size: 15px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.bx-msg.bot { align-self: flex-start; background: #fff; border-bottom-left-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.bx-msg.user { align-self: flex-end; background: var(--pine-3, #23503f); color: #fff; border-bottom-right-radius: 4px; }
.bx-msg a { color: var(--signal-2, #e64612); font-weight: 700; }
.bx-msg.user a { color: #fff; }
.bx-typing { display: inline-flex; gap: 4px; padding: 14px; }
.bx-typing i { width: 7px; height: 7px; border-radius: 50%; background: #9aa39a; animation: bxDot 1s infinite; }
.bx-typing i:nth-child(2) { animation-delay: .15s; } .bx-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bxDot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.bx-est { align-self: flex-start; background: var(--pine, #0f2a22); color: #f4efe6; border-radius: 14px; padding: 12px 14px; max-width: 86%; }
.bx-est .r { font-weight: 900; font-size: 24px; font-stretch: 110%; }
.bx-est a { display: inline-block; margin-top: 8px; background: var(--signal, #ff5a1f); color: #fff; text-decoration: none; font-weight: 800; padding: 8px 14px; border-radius: 999px; font-size: 14px; }

.bx-sugg { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 0; background: #fffdf8; }
.bx-sugg button { border: 1.5px solid #d9d0bf; background: #fff; border-radius: 999px; padding: 7px 12px; font-size: 13.5px; font-weight: 600; cursor: pointer; color: #15181a; }
.bx-sugg button:hover { border-color: var(--pine-3, #23503f); }

.bx-chat-form { display: flex; gap: 8px; padding: 10px 12px 12px; background: #fffdf8; border-top: 1px solid #ebe4d6; }
.bx-chat-form textarea { flex: 1; min-height: 46px; max-height: 120px; resize: none; padding: 12px 14px; border-radius: 14px; border: 1.5px solid #d9d0bf; font-size: 16px; font-family: inherit; line-height: 1.3; }
.bx-chat-form textarea:focus { outline: none; border-color: var(--pine-3, #23503f); }
.bx-chat-form button { width: 46px; height: 46px; border: 0; border-radius: 14px; background: var(--signal, #ff5a1f); color: #fff; cursor: pointer; display: grid; place-items: center; flex: none; }
.bx-chat-form button[disabled] { opacity: .5; }
.bx-chat-form button svg { width: 20px; height: 20px; }
.bx-chat-foot { text-align: center; font-size: 11.5px; color: #6b7468; padding: 0 12px 10px; background: #fffdf8; }
