/* StreetSpot chat widget — shared landing/app */
:root {
  --teal: #bb2d3b; --card: #ffffff; --line: #e2e8f0;
  --soft: #f8fafc; --text: #0f172a; --bg: #ffffff;
}
.dark {
  --card: #0f172a; --line: #1e293b; --soft: #1e293b;
  --text: #f1f5f9; --bg: #1e293b;
}
#spChatFab {
  position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom));
  width: 54px; height: 54px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--teal, #bb2d3b); color: #fff; font-size: 22px; z-index: 900;
  box-shadow: 0 8px 24px rgba(15, 45, 61, .35);
  transition: transform .18s ease, box-shadow .22s ease;
}
#spChatFab:hover { transform: scale(1.07); box-shadow: 0 12px 30px rgba(15, 45, 61, .42); }
#spChatFab:active { transform: scale(.93); }
#spChatPanel {
  position: fixed; right: 18px; bottom: calc(82px + env(safe-area-inset-bottom));
  width: min(360px, calc(100vw - 28px)); height: min(500px, calc(100dvh - 120px));
  background: var(--card, #fff); border: 1px solid var(--line, #e3edf1);
  border-radius: 16px; box-shadow: 0 16px 48px rgba(15, 45, 61, .28);
  display: none; flex-direction: column; overflow: hidden; z-index: 901;
  transform-origin: bottom right;
}
#spChatPanel.open { display: flex; animation: spcIn .24s cubic-bezier(.22,.9,.32,1.06); }
@keyframes spcIn { from { opacity: 0; transform: translateY(14px) scale(.96); } }
.spc-msg { animation: spcMsg .22s ease; }
@keyframes spcMsg { from { opacity: 0; transform: translateY(6px); } }
.spc-head {
  background: #0f172a; color: #fff; padding: 12px 14px;
  display: flex; align-items: center; gap: 10px;
}
.spc-logo {
  background: #fff; border-radius: 9px; padding: 3px 8px;
  display: inline-flex; align-items: center; flex-shrink: 0;
}
.spc-logo img { height: 18px; display: block; }
.spc-title { font-weight: 700; font-size: 14px; flex: 1; }
.spc-head button { background: none; border: 0; color: #fff; font-size: 16px; cursor: pointer; }
/* assistant persona picker — Vasco / Leonor */
.spc-pers { display: flex; gap: 5px; align-items: center; }
.spc-pers button {
  width: 30px; height: 30px; border-radius: 50%; padding: 0; overflow: hidden;
  border: 2px solid rgba(255,255,255,.25); opacity: .55; flex-shrink: 0;
  transition: opacity .15s ease, border-color .15s ease, transform .15s ease;
  background: #fff;
}
.spc-pers button img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.spc-pers button.on { opacity: 1; border-color: #bb2d3b; transform: scale(1.08); }
.spc-ava {
  width: 22px; height: 22px; border-radius: 50%; object-fit: cover; object-position: top;
  float: left; margin: 1px 8px 2px 0; border: 1px solid var(--line, #e3edf1); background: #fff;
}
.spc-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.spc-msg {
  max-width: 85%; padding: 9px 13px; border-radius: 14px; font-size: 13.5px;
  line-height: 1.5; white-space: pre-wrap; word-break: break-word;
}
.spc-msg.user { align-self: flex-end; background: #bb2d3b; color: #fff; border-bottom-right-radius: 4px; }
.spc-msg.bot {
  align-self: flex-start; background: var(--soft, #F4F7FA);
  color: var(--text, #0f172a); border: 1px solid var(--line, #e3edf1);
  border-bottom-left-radius: 4px;
}
.spc-think { color: #8fa0ad; }
.spc-quick { display: flex; gap: 6px; padding: 8px 12px; flex-wrap: wrap; }
.spc-quick button {
  border: 1px solid var(--teal, #bb2d3b); color: var(--teal, #bb2d3b); background: none;
  border-radius: 20px; padding: 5px 11px; font-size: 11.5px; cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.spc-quick button:hover { background: var(--teal, #bb2d3b); color: #fff; }
.spc-in { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line, #e3edf1); }
.spc-in input {
  flex: 1; border: 1px solid var(--line, #e3edf1); border-radius: 10px;
  padding: 10px 12px; font-size: 16px; background: var(--bg, #fff); color: var(--text, #0f172a);
}
.spc-in button {
  background: #bb2d3b; color: #fff; border: 0; border-radius: 10px;
  width: 42px; cursor: pointer; font-size: 15px;
}
/* the mobile tabbar shows below lg (1024px) — keep the fab clear of it */
@media (max-width: 1023px) {
  body.has-tabbar #spChatFab { bottom: calc(84px + env(safe-area-inset-bottom)); }
  body.has-tabbar #spChatPanel { bottom: calc(148px + env(safe-area-inset-bottom)); }
}
