/* ================= CHATBOT ================= */
.bot { position: fixed; z-index: 60; right: max(16px, 2vw); bottom: calc(max(16px, 2vw) + env(safe-area-inset-bottom, 0px)); }

.bot__launcher {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 18px 8px 8px; border-radius: 999px; border: 1px solid rgb(255 255 255 / .12);
  background: var(--ink); color: var(--white);
  box-shadow: 0 18px 40px -16px rgb(10 21 48 / .7);
  font-weight: 600; font-size: .92rem;
  transition: transform .3s var(--ease), opacity .3s;
}
.bot__launcher:hover { transform: translateY(-3px); }
.bot.is-open .bot__launcher { opacity: 0; visibility: hidden; pointer-events: none; transform: scale(.9); }
.bot__orb { position: relative; width: 42px; height: 42px; border-radius: 50%; background: var(--volt); display: grid; place-items: center; }
.bot__orb::before, .bot__orb::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1.5px solid var(--volt); opacity: 0; animation: orb 2.6s ease-out infinite; }
.bot__orb::after { animation-delay: 1.3s; }
@keyframes orb { 0% { transform: scale(.85); opacity: .9; } 100% { transform: scale(1.5); opacity: 0; } }
.bot__avatar svg { width: 20px; height: 20px; fill: var(--ink); }
.bot__orb svg { width: 24px; height: 24px; }
.bot__orb .bubble { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.bot__orb .bolt { fill: var(--ink); animation: zap 3s ease-in-out infinite; transform-origin: 12px 11px; }
@keyframes zap { 0%, 80%, 100% { transform: scale(1); } 86% { transform: scale(1.35); } 92% { transform: scale(.9); } }
.bot__label { display: grid; text-align: left; line-height: 1.15; }
.bot__label small { font: 500 .58rem/1.2 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--volt); }

/* teaser bubble: announces the chatbot */
.bot__teaser {
  position: absolute; right: 0; bottom: calc(100% + 14px); width: min(280px, calc(100vw - 32px));
  background: var(--white); color: var(--ink); border-radius: 18px 18px 6px 18px;
  box-shadow: 0 24px 50px -20px rgb(10 21 48 / .55), 0 0 0 1px rgb(10 21 48 / .06);
  animation: teaserIn .5s var(--ease) both;
}
.bot__teaser::after { content: ""; position: absolute; right: 26px; bottom: -7px; width: 14px; height: 14px; background: var(--white); transform: rotate(45deg); border-radius: 0 0 3px 0; }
@keyframes teaserIn { from { transform: translateY(10px) scale(.92); opacity: 0; } to { transform: none; opacity: 1; } }
.bot.is-open .bot__teaser { display: none; }
.bot__teaser-body { display: grid; gap: 8px; width: 100%; padding: 14px 34px 14px 16px; border: 0; background: none; text-align: left; border-radius: inherit; }
.bot__teaser-tag { display: inline-flex; align-items: center; gap: 6px; font: 500 .6rem/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--volt-deep); }
.bot__teaser-text { font-size: .9rem; line-height: 1.45; }
.bot__teaser-typing { display: flex; gap: 4px; padding: 4px 0; }
.bot__teaser-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--navy); animation: blink 1.2s infinite; }
.bot__teaser-typing i:nth-child(2) { animation-delay: .15s; }
.bot__teaser-typing i:nth-child(3) { animation-delay: .3s; }
.bot__teaser:not(.is-typed) .bot__teaser-text { display: none; }
.bot__teaser.is-typed .bot__teaser-typing { display: none; }
.bot__teaser-close { position: absolute; top: 6px; right: 6px; z-index: 1; width: 28px; height: 28px; border-radius: 50%; border: 0; background: transparent; color: var(--mute); font-size: 1.1rem; line-height: 1; }
.bot__teaser-close:hover { background: var(--mist); color: var(--ink); }

.bot__panel {
  position: absolute; right: 0; bottom: 0;
  width: min(390px, calc(100vw - 32px)); height: min(600px, calc(100svh - 120px));
  display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink);
  border-radius: 24px; overflow: hidden;
  box-shadow: 0 40px 90px -30px rgb(10 21 48 / .55), 0 0 0 1px rgb(10 21 48 / .06);
  transform-origin: bottom right;
  animation: botIn .4s var(--ease) both;
}
@keyframes botIn { from { transform: translateY(16px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }

.bot__head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 16px 18px; background: var(--ink); color: var(--white); }
.bot__avatar { width: 40px; height: 40px; border-radius: 12px; background: var(--volt); display: grid; place-items: center; flex: none; }
.bot__head h2 { font: 800 1.05rem/1.1 var(--f-display); font-stretch: 112%; font-variation-settings: "wdth" 112; }
.bot__head p { display: flex; align-items: center; gap: 6px; font: 400 .68rem/1.4 var(--f-mono); color: var(--on-dark-mute); }
.bot__close { margin-left: auto; width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgb(255 255 255 / .18); background: transparent; color: var(--white); font-size: 1.4rem; line-height: 1; }
.bot__close:hover { background: rgb(255 255 255 / .08); }

.bot__log { flex: 1; overflow-y: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.msg { max-width: 86%; padding: 11px 14px; border-radius: 16px; font-size: .93rem; line-height: 1.5; animation: msgIn .3s var(--ease) both; overflow-wrap: anywhere; }
@keyframes msgIn { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
.msg--bot { align-self: flex-start; background: var(--white); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg--user { align-self: flex-end; background: var(--navy); color: var(--white); border-bottom-right-radius: 6px; }
.msg p + p { margin-top: 6px; }
.msg b { font-weight: 600; }
.msg__actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.msg__actions a {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 999px;
  background: var(--ink); color: var(--white); font-size: .8rem; font-weight: 600; text-decoration: none;
}
.msg__actions a:hover { background: var(--navy); }
.msg__actions a.is-volt { background: var(--volt); color: var(--ink); }

.typing { align-self: flex-start; display: flex; gap: 4px; padding: 14px 16px; background: var(--white); border: 1px solid var(--line); border-radius: 16px; border-bottom-left-radius: 6px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--navy); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.bot__chips { display: flex; gap: 6px; padding: 8px 16px; overflow-x: auto; scrollbar-width: none; }
.bot__chips::-webkit-scrollbar { display: none; }
.bot__chips button {
  flex: none; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--white);
  font-size: .8rem; font-weight: 500; color: var(--navy); transition: border-color .2s, background-color .2s;
}
.bot__chips button:hover { border-color: var(--volt); background: rgb(155 194 58 / .12); }

.bot__form { display: flex; gap: 8px; padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--white); }
.bot__form input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 999px; padding: 12px 16px; font: 400 1rem/1.2 var(--f-body); background: var(--paper); color: var(--ink); }
.bot__form input:focus { outline: none; border-color: var(--navy); }
.bot__form button { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--volt); display: grid; place-items: center; transition: transform .2s var(--ease); }
.bot__form button:hover { transform: scale(1.06); }
.bot__form button svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 520px) {
  .bot__label { display: none; }
  .bot__launcher { padding: 6px; }
  .bot.is-open { inset: 0; }
  .bot__panel { position: fixed; inset: 0; width: 100%; height: 100%; border-radius: 0; padding-top: env(safe-area-inset-top, 0px); }
}
