/* ═══════════════════════════════════════════════════════════════
   TETRA AI — website chat ("Claire, the front desk")
   Loaded after site.css on every page; uses its tokens.
   ═══════════════════════════════════════════════════════════════ */
.tchat-launch{
  position:fixed; right:22px; bottom:22px; z-index:70;
  display:inline-flex; align-items:center; gap:10px;
  padding:12px 18px 12px 14px; border-radius:999px;
  background:linear-gradient(160deg, #0A3A6B, var(--navy));
  color:var(--ice); font-family:var(--font-body); font-weight:600; font-size:14.5px; letter-spacing:.01em;
  border:1px solid rgba(133,183,235,.35);
  box-shadow:0 18px 40px -16px rgba(2,26,51,.7), inset 0 1px 0 rgba(230,241,251,.12);
  transition:transform .25s var(--ease-out), box-shadow .25s, opacity .25s;
  opacity:0; transform:translateY(12px);
}
.tchat-launch.in{ opacity:1; transform:none }
.tchat-launch:hover{ transform:translateY(-2px); box-shadow:0 24px 48px -16px rgba(55,138,221,.55), inset 0 1px 0 rgba(230,241,251,.14) }
.tchat-launch:focus-visible{ outline:2px solid var(--electric); outline-offset:3px }
.tchat-launch .live-dot{ width:8px; height:8px; flex:0 0 auto }
.tchat-launch__chip{ width:34px; height:14px; opacity:.95 }
body.tchat-open .tchat-launch{ opacity:0; pointer-events:none; transform:translateY(12px) }

.tchat{
  position:fixed; right:22px; bottom:22px; z-index:71;
  width:min(392px, calc(100vw - 32px)); height:min(640px, calc(100vh - 44px));
  display:flex; flex-direction:column;
  background:var(--white); color:var(--ink);
  border-radius:22px; overflow:hidden;
  box-shadow:0 40px 90px -30px rgba(2,26,51,.6), 0 0 0 1px rgba(4,44,83,.1);
  transform-origin:bottom right;
  opacity:0; transform:translateY(16px) scale(.96); pointer-events:none;
  transition:opacity .28s var(--ease-out), transform .32s var(--ease-out);
  font-family:var(--font-body);
}
.tchat.open{ opacity:1; transform:none; pointer-events:auto }

.tchat__head{
  display:flex; align-items:center; gap:12px; padding:14px 14px 14px 16px;
  background:linear-gradient(160deg, #0A3A6B, var(--navy)); color:var(--ice);
}
.tchat__avatar{
  width:40px; height:40px; border-radius:50%; flex:0 0 auto;
  background:rgba(230,241,251,.1); border:1px solid rgba(133,183,235,.35);
  display:grid; place-items:center;
}
.tchat__avatar canvas{ width:26px; height:12px }
.tchat__who{ min-width:0; flex:1 }
.tchat__name{ display:block; font-family:var(--font-head); font-weight:800; font-size:16px; letter-spacing:-.01em; line-height:1.15 }
.tchat__role{ display:flex; align-items:center; gap:7px; font-size:12.5px; color:var(--dark-mute); margin-top:3px }
.tchat__role .live-dot{ width:7px; height:7px }
.tchat__close{
  width:36px; height:36px; border-radius:10px; display:grid; place-items:center; color:var(--dark-mute);
  transition:background-color .2s, color .2s;
}
.tchat__close:hover{ background:rgba(230,241,251,.1); color:var(--white) }
.tchat__close:focus-visible{ outline:2px solid var(--sky); outline-offset:2px }

.tchat__log{
  flex:1; overflow-y:auto; overscroll-behavior:contain;
  padding:18px 16px 8px; display:flex; flex-direction:column; gap:10px;
  background:linear-gradient(180deg, #F6F9FD, var(--white) 120px);
  scroll-behavior:smooth;
}
.tchat__msg{
  max-width:86%; padding:11px 14px; border-radius:16px; font-size:14.5px; line-height:1.55;
  animation:tchatrise .3s var(--ease-out) both; word-wrap:break-word; overflow-wrap:anywhere;
}
@keyframes tchatrise{ from{ opacity:0; transform:translateY(6px) } to{ opacity:1; transform:none } }
.tchat__msg--bot{ align-self:flex-start; background:var(--ice); color:var(--ink); border-bottom-left-radius:6px }
.tchat__msg--you{ align-self:flex-end; background:var(--electric); color:var(--white); border-bottom-right-radius:6px }
.tchat__msg p+p{ margin-top:8px }
.tchat__msg ul{ margin:6px 0 2px 18px }
.tchat__msg li+li{ margin-top:3px }
.tchat__msg a{ color:var(--electric); font-weight:600; text-decoration:underline; text-underline-offset:2px }
.tchat__msg--you a{ color:var(--white) }
.tchat__msg--sys{
  align-self:center; max-width:92%; text-align:center; background:transparent;
  color:var(--ink-mute); font-size:12.5px; padding:4px 8px;
}
.tchat__typing{ display:inline-flex; gap:5px; align-items:center; height:14px }
.tchat__typing i{ width:6px; height:6px; border-radius:50%; background:var(--electric); opacity:.45; animation:tchatdots 1.1s ease-in-out infinite }
.tchat__typing i:nth-child(2){ animation-delay:.16s } .tchat__typing i:nth-child(3){ animation-delay:.32s }
@keyframes tchatdots{ 0%,80%,100%{ transform:translateY(0); opacity:.45 } 40%{ transform:translateY(-4px); opacity:1 } }

.tchat__chips{ display:flex; flex-wrap:wrap; gap:8px; padding:4px 16px 10px }
.tchat__chip{
  padding:8px 13px; border-radius:999px; font-size:13px; font-weight:600; color:var(--navy);
  background:var(--white); border:1px solid rgba(55,138,221,.45);
  transition:background-color .2s, border-color .2s, transform .2s var(--ease-out);
}
.tchat__chip:hover{ background:var(--ice); border-color:var(--electric); transform:translateY(-1px) }
.tchat__chip:focus-visible{ outline:2px solid var(--electric); outline-offset:2px }

.tchat__form{
  display:flex; align-items:flex-end; gap:8px; padding:10px 12px 8px 14px;
  border-top:1px solid var(--hairline-l); background:var(--white);
}
.tchat__input{
  flex:1; resize:none; border:1px solid rgba(4,44,83,.18); border-radius:14px;
  padding:11px 13px; font:inherit; font-size:14.5px; line-height:1.45; color:var(--ink);
  max-height:120px; min-height:44px; background:var(--white);
  transition:border-color .2s, box-shadow .2s;
}
.tchat__input:focus-visible{ outline:none; border-color:var(--electric); box-shadow:0 0 0 3px rgba(55,138,221,.18) }
.tchat__send{
  width:44px; height:44px; border-radius:50%; flex:0 0 auto; display:grid; place-items:center;
  background:var(--electric); color:var(--white);
  box-shadow:0 8px 20px -10px rgba(55,138,221,.7);
  transition:transform .2s var(--ease-out), opacity .2s, box-shadow .2s;
}
.tchat__send:hover{ transform:translateY(-1px) }
.tchat__send:disabled{ opacity:.45; cursor:default; transform:none; box-shadow:none }
.tchat__send:focus-visible{ outline:2px solid var(--electric); outline-offset:3px }
.tchat__foot{
  padding:6px 16px 12px; font-size:11px; color:var(--ink-mute); text-align:center; line-height:1.45;
}
.tchat__foot a{ color:inherit }

@media (max-width:600px){
  .tchat{ right:0; bottom:0; width:100vw; height:100%; height:100dvh; border-radius:0; transform-origin:bottom center }
  .tchat-launch{ right:16px; bottom:16px; padding:11px 16px 11px 12px; font-size:14px }
  .tchat__msg{ max-width:90% }
}
@media (prefers-reduced-motion: reduce){
  .tchat, .tchat-launch, .tchat__msg{ transition:none !important; animation:none !important }
  .tchat-launch{ opacity:1; transform:none }
  .tchat__typing i{ animation:none; opacity:.8 }
}
