/* StayPilot chat widget — shared landing/app */
#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, #0EA5A6); color: #fff; font-size: 22px; z-index: 900;
  box-shadow: 0 8px 24px rgba(15, 45, 61, .35);
}
#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;
}
#spChatPanel.open { display: flex; }
.spc-head {
  background: #0F2D3D; color: #fff; padding: 12px 14px;
  display: flex; align-items: center; gap: 10px;
}
.spc-head img { height: 22px; }
.spc-head span { font-weight: 700; font-size: 14px; flex: 1; }
.spc-head button { background: none; border: 0; color: #fff; font-size: 16px; cursor: pointer; }
.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: #0EA5A6; color: #fff; border-bottom-right-radius: 4px; }
.spc-msg.bot {
  align-self: flex-start; background: var(--soft, #F4F7FA);
  color: var(--text, #0F2D3D); 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, #0EA5A6); color: var(--teal, #0EA5A6); background: none;
  border-radius: 20px; padding: 5px 11px; font-size: 11.5px; cursor: pointer;
}
.spc-quick button:hover { background: var(--teal, #0EA5A6); 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, #0F2D3D);
}
.spc-in button {
  background: #0EA5A6; color: #fff; border: 0; border-radius: 10px;
  width: 42px; cursor: pointer; font-size: 15px;
}
@media (max-width: 640px) {
  body.has-tabbar #spChatFab { bottom: calc(76px + env(safe-area-inset-bottom)); }
  body.has-tabbar #spChatPanel { bottom: calc(140px + env(safe-area-inset-bottom)); }
}
