/* Lisa, Lane Movers AI concierge */
:root {
  --lisa-blue: #0076bd;
  --lisa-blue-deep: #0a2a43;
  --lisa-cyan: #35c8ff;
  --lisa-ink: #18212b;
  --lisa-muted: #65717d;
  --lisa-line: #dce4eb;
  --lisa-page: #f3f7fa;
  --lisa-white: #ffffff;
  --lisa-success: #22a861;
  --lisa-danger: #b83d32;
  --lisa-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

.chatbar,
.chatbar * {
  box-sizing: border-box;
}

.chatbar {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 130;
  font-family: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  color: var(--lisa-ink);
}

.chatbar-panel [hidden] {
  display: none !important;
}

/* Launcher */
.chatbar-trigger {
  position: relative;
  display: grid;
  width: 74px;
  height: 74px;
  padding: 0;
  place-items: center;
  overflow: visible;
  border: 3px solid var(--lisa-white);
  border-radius: 50%;
  background: var(--lisa-blue-deep);
  box-shadow:
    0 16px 38px rgba(10, 42, 67, 0.28),
    0 0 0 2px rgba(0, 118, 189, 0.9),
    0 0 26px rgba(53, 200, 255, 0.5);
  cursor: pointer;
  transition: transform 220ms var(--lisa-ease), box-shadow 220ms var(--lisa-ease);
  isolation: isolate;
}

.chatbar-trigger::before {
  content: "";
  position: absolute;
  inset: -8px;
  z-index: -1;
  border: 2px solid rgba(53, 200, 255, 0.72);
  border-radius: 50%;
  animation: lisaBeacon 3.2s var(--lisa-ease) infinite;
  pointer-events: none;
}

.chatbar-trigger:hover {
  transform: translateY(-3px) scale(1.035);
  box-shadow:
    0 20px 46px rgba(10, 42, 67, 0.34),
    0 0 0 2px var(--lisa-blue),
    0 0 34px rgba(53, 200, 255, 0.72);
}

.chatbar-trigger:active {
  transform: translateY(-1px) scale(0.98);
}

.chatbar-trigger:focus-visible,
.chat-close:focus-visible,
.home-card:focus-visible,
.chat-quick button:focus-visible,
.chat-cta:focus-visible,
.chat-input button:focus-visible,
.chat-capture button:focus-visible,
.chan-row:focus-visible {
  outline: 3px solid var(--lisa-cyan);
  outline-offset: 3px;
}

.fab-avatar {
  position: absolute;
  inset: 2px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  transition: opacity 180ms ease, transform 260ms var(--lisa-ease);
}

.fab-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.fab-close-icon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--lisa-white);
  font-size: 1.45rem;
  line-height: 1;
  opacity: 0;
  transform: rotate(-60deg) scale(0.7);
  transition: opacity 180ms ease, transform 260ms var(--lisa-ease);
}

.chat-dot {
  position: absolute;
  right: 0;
  bottom: 2px;
  width: 15px;
  height: 15px;
  border: 3px solid var(--lisa-white);
  border-radius: 50%;
  background: var(--lisa-success);
  box-shadow: 0 2px 8px rgba(34, 168, 97, 0.35);
  transition: opacity 160ms ease;
}

.chat-launch-label {
  position: absolute;
  right: calc(100% + 13px);
  bottom: 6px;
  display: flex;
  min-width: 178px;
  padding: 10px 14px 11px;
  flex-direction: column;
  align-items: flex-start;
  border: 1px solid rgba(0, 118, 189, 0.24);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 12px 34px rgba(10, 42, 67, 0.16);
  color: var(--lisa-ink);
  line-height: 1.2;
  pointer-events: none;
  transform-origin: right center;
  transition: opacity 180ms ease, transform 260ms var(--lisa-ease);
}

.chat-launch-label::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: 17px;
  width: 9px;
  height: 9px;
  border-top: 1px solid rgba(0, 118, 189, 0.24);
  border-right: 1px solid rgba(0, 118, 189, 0.24);
  background: var(--lisa-white);
  transform: rotate(45deg);
}

.chat-launch-label strong {
  color: var(--lisa-blue-deep);
  font-size: 0.9rem;
  font-weight: 750;
}

.chat-launch-label em {
  margin-top: 3px;
  color: var(--lisa-muted);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 500;
}

.chatbar.open .fab-avatar {
  opacity: 0;
  transform: scale(0.7) rotate(55deg);
}

.chatbar.open .fab-close-icon {
  opacity: 1;
  transform: rotate(0) scale(1);
}

.chatbar.open .chat-dot,
.chatbar.open .chat-launch-label {
  opacity: 0;
  pointer-events: none;
  transform: translateX(8px) scale(0.96);
}

/* Panel */
.chatbar-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 18px);
  display: flex;
  width: 404px;
  max-width: calc(100vw - 40px);
  max-height: min(620px, calc(100dvh - 122px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(10, 42, 67, 0.14);
  border-radius: 24px;
  background: var(--lisa-white);
  box-shadow:
    0 30px 90px rgba(10, 42, 67, 0.25),
    0 8px 28px rgba(10, 42, 67, 0.12);
  transform-origin: right bottom;
  animation: lisaPanelIn 380ms var(--lisa-ease) both;
}

.chatbar-panel.closing {
  animation: lisaPanelOut 190ms ease-in both;
  pointer-events: none;
}

.chat-head {
  display: flex;
  min-height: 74px;
  padding: 14px 14px 14px 17px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--lisa-blue-deep);
  color: var(--lisa-white);
}

.chat-ava {
  position: relative;
  flex: 0 0 auto;
}

.chat-ava::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: 0;
  width: 11px;
  height: 11px;
  border: 2px solid var(--lisa-blue-deep);
  border-radius: 50%;
  background: #39d27c;
}

.chat-ava img {
  display: block;
  width: 46px;
  height: 46px;
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  object-fit: cover;
}

.chat-id {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  line-height: 1.25;
}

.chat-id strong {
  color: var(--lisa-white);
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.chat-id em {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.76rem;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-id em::before {
  content: none;
}

.chat-close {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(255, 255, 255, 0.76);
  font: inherit;
  font-size: 1.18rem;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.chat-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--lisa-white);
  transform: rotate(4deg);
}

/* Arrival view */
.chat-home {
  display: flex;
  padding: 22px 18px 14px;
  flex-direction: column;
  gap: 6px;
  background: var(--lisa-page);
}

.home-tagline {
  margin: 0;
  color: var(--lisa-ink);
  font-size: 1.22rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.home-subtitle {
  margin: 0 0 10px;
  color: var(--lisa-muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.home-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.home-card {
  display: flex;
  min-height: 60px;
  padding: 10px 12px;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--lisa-line);
  border-radius: 15px;
  background: var(--lisa-white);
  color: var(--lisa-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms var(--lisa-ease);
}

.home-card:hover {
  border-color: rgba(0, 118, 189, 0.46);
  box-shadow: 0 8px 24px rgba(10, 42, 67, 0.09);
  transform: translateY(-1px);
}

.home-card.home-primary {
  border-color: rgba(0, 118, 189, 0.38);
  background: #eef8fe;
}

.home-ico {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
  background: #e7f4fb;
  color: var(--lisa-blue);
}

.home-primary .home-ico {
  background: var(--lisa-blue);
  color: var(--lisa-white);
}

.home-ico svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-body {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.home-body strong {
  color: var(--lisa-ink);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
}

.home-body em {
  overflow: hidden;
  color: var(--lisa-muted);
  font-size: 0.75rem;
  font-style: normal;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-arrow {
  flex: 0 0 auto;
  color: #8b99a5;
  font-size: 1rem;
  transition: color 180ms ease, transform 180ms var(--lisa-ease);
}

.home-card:hover .home-arrow {
  color: var(--lisa-blue);
  transform: translateX(3px);
}

.chat-home.exiting {
  animation: lisaHomeOut 180ms ease-in both;
  pointer-events: none;
}

.chat-log.entering {
  animation: lisaChatIn 240ms var(--lisa-ease) both;
}

/* Conversation */
.chat-log {
  display: flex;
  min-height: 176px;
  max-height: min(340px, 40dvh);
  padding: 18px 16px 10px;
  flex-direction: column;
  gap: 11px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--lisa-page);
  scrollbar-color: #b8c6d1 transparent;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.chat-log::-webkit-scrollbar {
  width: 5px;
}

.chat-log::-webkit-scrollbar-thumb {
  border-radius: 6px;
  background: #b8c6d1;
}

.chat-msg {
  max-width: 84%;
  padding: 10px 13px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.48;
  animation: lisaMessageIn 220ms var(--lisa-ease) both;
}

.chat-msg.bot {
  align-self: flex-start;
  border: 1px solid var(--lisa-line);
  border-bottom-left-radius: 5px;
  background: var(--lisa-white);
  color: var(--lisa-ink);
  white-space: pre-line;
}

.chat-msg.user {
  align-self: flex-end;
  border-bottom-right-radius: 5px;
  background: var(--lisa-blue);
  color: var(--lisa-white);
}

.chat-msg.typing {
  display: flex;
  width: auto;
  max-width: 64px;
  align-items: center;
  gap: 5px;
}

.chat-msg.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lisa-blue);
  opacity: 0.42;
  animation: lisaTyping 1.15s ease-in-out infinite;
}

.chat-msg.typing span:nth-child(2) {
  animation-delay: 140ms;
}

.chat-msg.typing span:nth-child(3) {
  animation-delay: 280ms;
}

.chat-quick {
  display: flex;
  padding: 9px 16px 3px;
  flex-wrap: wrap;
  gap: 7px;
  background: var(--lisa-white);
}

.chat-quick.inflow,
.chat-quick.suggested {
  padding: 2px 0;
  background: transparent;
}

.chat-quick.suggested {
  margin-top: 2px;
}

.chat-quick button,
.chat-cta {
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid #cbd9e4;
  border-radius: 999px;
  background: var(--lisa-white);
  color: var(--lisa-blue-deep);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.chat-quick button:hover,
.chat-cta:hover {
  border-color: var(--lisa-blue);
  background: #eef8fe;
  color: var(--lisa-blue-deep);
  transform: translateY(-1px);
}

.chat-cta {
  align-self: flex-start;
}

.chip-primary {
  width: 100%;
  justify-content: center;
  order: -1;
  border-color: var(--lisa-blue) !important;
  background: var(--lisa-blue) !important;
  color: var(--lisa-white) !important;
  font-weight: 700 !important;
}

.chip-primary:hover {
  background: var(--lisa-blue-deep) !important;
}

.chat-input {
  display: flex;
  padding: 10px 12px 5px;
  align-items: center;
  gap: 8px;
  border-top: 1px solid #e7edf2;
  background: var(--lisa-white);
}

.chat-input input,
.chat-capture input {
  min-width: 0;
  border: 1px solid #cbd6df;
  background: var(--lisa-white);
  color: var(--lisa-ink);
  font: inherit;
  font-size: 0.9rem;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.chat-input input {
  height: 46px;
  padding: 0 15px;
  flex: 1;
  border-radius: 999px;
}

.chat-input input::placeholder,
.chat-capture input::placeholder {
  color: #697985;
  opacity: 1;
}

.chat-input input:focus,
.chat-capture input:focus {
  outline: none;
  border-color: var(--lisa-blue);
  box-shadow: 0 0 0 3px rgba(0, 118, 189, 0.14);
}

.chat-input button {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--lisa-blue);
  color: var(--lisa-white);
  font: inherit;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms var(--lisa-ease);
}

.chat-input button:hover {
  background: var(--lisa-blue-deep);
  transform: scale(1.04);
}

.chat-fine {
  margin: 0;
  padding: 4px 14px 10px;
  background: var(--lisa-white);
  color: #75838e;
  font-size: 0.66rem;
  letter-spacing: 0;
  line-height: 1.4;
  text-align: center;
}

/* Lead capture and handoff */
.chat-capture {
  display: flex;
  padding: 3px 0;
  flex-direction: column;
  gap: 8px;
}

.chat-capture input {
  height: 44px;
  padding: 0 12px;
  border-radius: 11px;
}

.chat-capture button {
  min-height: 44px;
  border: 0;
  border-radius: 11px;
  background: var(--lisa-blue);
  color: var(--lisa-white);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.chat-capture button:hover {
  background: var(--lisa-blue-deep);
  transform: translateY(-1px);
}

.cap-consent {
  display: flex;
  padding: 2px 0;
  align-items: flex-start;
  gap: 8px;
  color: var(--lisa-muted);
  font-size: 0.7rem;
  line-height: 1.4;
  cursor: pointer;
}

.cap-consent input {
  width: 15px;
  height: 15px;
  margin-top: 1px;
  flex: 0 0 auto;
  accent-color: var(--lisa-blue);
}

.cap-consent a {
  color: var(--lisa-blue-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.chat-capture.needs-consent .cap-consent {
  color: var(--lisa-danger);
}

.chat-capture.needs-consent .cap-consent input {
  outline: 2px solid var(--lisa-danger);
  outline-offset: 2px;
}

.chat-summary {
  display: flex;
  padding: 13px 14px;
  flex-direction: column;
  gap: 6px;
  border: 1px solid rgba(0, 118, 189, 0.3);
  border-radius: 13px;
  background: #eef8fe;
  animation: lisaMessageIn 220ms var(--lisa-ease) both;
}

.chat-summary strong {
  margin-bottom: 3px;
  color: var(--lisa-blue-deep);
  font-size: 0.76rem;
  font-weight: 750;
}

.chat-summary span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--lisa-ink);
  font-size: 0.79rem;
  text-align: right;
}

.chat-summary span em {
  color: var(--lisa-muted);
  font-style: normal;
  text-align: left;
}

.chat-summary-src {
  margin-top: 3px;
  padding-top: 7px;
  justify-content: flex-start !important;
  border-top: 1px solid rgba(0, 118, 189, 0.18);
  color: var(--lisa-muted) !important;
  font-size: 0.64rem !important;
}

.chat-handoff {
  display: flex;
  flex-direction: column;
  gap: 7px;
  animation: lisaMessageIn 220ms var(--lisa-ease) both;
}

.chan-row {
  display: flex;
  min-height: 50px;
  padding: 9px 11px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--lisa-line);
  border-radius: 13px;
  background: var(--lisa-white);
  color: var(--lisa-ink);
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.chan-row:hover {
  border-color: var(--lisa-blue);
  background: #eef8fe;
  color: var(--lisa-ink);
  transform: translateY(-1px);
}

.chan-row.primary {
  border-color: rgba(0, 118, 189, 0.42);
  background: #eef8fe;
}

.chan-ico {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: var(--lisa-blue);
}

.chan-main {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  line-height: 1.25;
}

.chan-main strong {
  color: var(--lisa-ink);
  font-size: 0.84rem;
  font-weight: 700;
}

.chan-main em {
  color: var(--lisa-muted);
  font-size: 0.7rem;
  font-style: normal;
}

.chan-tag {
  padding: 3px 7px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--lisa-blue);
  color: var(--lisa-white);
  font-size: 0.58rem;
  font-weight: 750;
}

.chan-2 {
  display: flex;
  gap: 7px;
}

.chan-2 .chan-row {
  flex: 1;
  justify-content: center;
}

.chan-2 .chan-main {
  flex: 0 1 auto;
}

.chan-2 .chan-main strong {
  font-size: 0.8rem;
}

/* Contextual nudge */
.chatbar-trigger.pulse {
  box-shadow:
    0 16px 38px rgba(10, 42, 67, 0.28),
    0 0 0 2px var(--lisa-blue),
    0 0 34px rgba(53, 200, 255, 0.7);
}

.chat-nudge {
  position: absolute;
  right: 0;
  bottom: calc(100% + 17px);
  width: max-content;
  max-width: min(280px, 78vw);
  padding: 11px 14px;
  border: 1px solid rgba(0, 118, 189, 0.25);
  border-radius: 14px;
  background: var(--lisa-white);
  box-shadow: 0 14px 38px rgba(10, 42, 67, 0.16);
  color: var(--lisa-blue-deep);
  font-size: 0.8rem;
  font-weight: 650;
  line-height: 1.35;
  cursor: pointer;
  animation: lisaNudgeIn 300ms var(--lisa-ease) both;
}

.chat-nudge::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 28px;
  width: 10px;
  height: 10px;
  border-right: 1px solid rgba(0, 118, 189, 0.25);
  border-bottom: 1px solid rgba(0, 118, 189, 0.25);
  background: var(--lisa-white);
  transform: translateY(-5px) rotate(45deg);
}

@keyframes lisaBeacon {
  0%, 35% { opacity: 0.82; transform: scale(0.94); }
  72%, 100% { opacity: 0; transform: scale(1.32); }
}

@keyframes lisaPanelIn {
  from { opacity: 0; transform: translateY(18px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes lisaPanelOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(10px) scale(0.97); }
}

@keyframes lisaHomeOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-5px); }
}

@keyframes lisaChatIn {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes lisaMessageIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes lisaTyping {
  0%, 60%, 100% { opacity: 0.38; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

@keyframes lisaNudgeIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 640px) {
  .chatbar {
    right: 14px;
    bottom: 88px;
  }

  .chatbar-trigger {
    width: 66px;
    height: 66px;
  }

  .chat-launch-label {
    right: calc(100% + 10px);
    bottom: 8px;
    min-width: auto;
    padding: 9px 11px;
  }

  .chat-launch-label strong {
    font-size: 0.82rem;
  }

  .chat-launch-label em {
    display: none;
  }

  .chatbar-panel {
    right: 0;
    bottom: calc(100% + 14px);
    width: min(394px, calc(100vw - 28px));
    max-width: none;
    max-height: calc(100dvh - 104px);
    border-radius: 21px;
  }

  .chat-head {
    min-height: 68px;
    padding: 11px 10px 11px 14px;
  }

  .chat-ava img {
    width: 43px;
    height: 43px;
  }

  .chat-home {
    padding: 17px 14px 12px;
  }

  .chat-log {
    max-height: 38dvh;
    padding: 15px 13px 8px;
  }

  .chat-quick {
    padding-inline: 13px;
  }

  .chat-input {
    padding-inline: 10px;
  }
}

@media (max-width: 380px) {
  .chat-launch-label {
    display: none;
  }

  .chatbar-panel {
    width: calc(100vw - 20px);
  }

  .home-body em {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chatbar-trigger::before,
  .chat-msg.typing span {
    animation: none;
  }

  .chatbar *,
  .chatbar *::before,
  .chatbar *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}
