/* Honeywhale Smart Advisor 2.1 — brand-led visual layer. */
:root {
  --hwsa-ink: #111315;
  --hwsa-paper: #fff;
  --hwsa-soft: #f4f5f5;
  --hwsa-line: #e7e9ea;
  --hwsa-muted: #687078;
  --hwsa-signal: #f4c900;
}

.hwsa-panel {
  width: 400px;
  height: min(632px, calc(100dvh - 56px));
  grid-template-rows: 74px minmax(0, 1fr) 62px;
  border-color: rgba(17, 19, 21, .1);
  border-radius: 20px;
  box-shadow: 0 28px 80px rgba(17, 19, 21, .16), 0 8px 24px rgba(17, 19, 21, .08);
}

.hwsa-header {
  padding: 0 14px 0 16px;
  background: #111315;
}

.hwsa-route-bg {
  right: 14px;
  width: 190px;
  opacity: .055;
}

.hwsa-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.hwsa-identity {
  gap: 10px;
}

.hwsa-identity h2 {
  font-size: 14px !important;
  letter-spacing: -.01em;
}

.hwsa-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
}

.hwsa-view {
  padding: 20px;
}

.hwsa-brand-stage {
  position: relative;
  min-height: 82px;
  margin: -4px 0 16px;
  padding: 13px 14px 8px;
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(105deg, #f5f6f6 0%, #fafafa 62%, #fff 100%);
}

.hwsa-brand-label {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 2px;
  pointer-events: none;
}

.hwsa-brand-label strong {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .14em;
  color: #111315;
}

.hwsa-brand-label span {
  font-size: 10px;
  color: #7a8186;
}

.hwsa-brand-ride {
  position: absolute;
  right: -4px;
  bottom: 0;
  width: 78%;
  height: 70px;
  overflow: visible;
}

.hwsa-brand-route {
  fill: none;
  stroke: #d9dddf;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-dasharray: 2 5;
}

.hwsa-brand-mascot {
  transform-origin: 135px 40px;
}

.hwsa-panel.opening .hwsa-brand-mascot {
  animation: hwsa-brand-ride-in .72s cubic-bezier(.22, .7, .25, 1) both;
}

.hwsa-wheel {
  fill: #111315;
  stroke: #fff;
  stroke-width: 2.5;
}

.hwsa-scooter,
.hwsa-fin,
.hwsa-whale-smile {
  fill: none;
  stroke: #111315;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hwsa-whale-body,
.hwsa-whale-tail {
  fill: #111315;
}

.hwsa-whale-stripe {
  fill: none;
  stroke: #f4c900;
  stroke-width: 7;
  stroke-linecap: round;
}

.hwsa-whale-eye {
  fill: #fff;
}

.hwsa-whale-smile,
.hwsa-fin {
  stroke: #fff;
  stroke-width: 1.8;
}

.hwsa-route-dot {
  fill: #f4c900;
}

.hwsa-intro > span {
  color: #777f84;
}

.hwsa-intro h3 {
  margin: 6px 0 7px !important;
  font-size: 23px !important;
  line-height: 1.08 !important;
  letter-spacing: -.045em;
}

.hwsa-intro p {
  max-width: 315px;
  font-size: 12px;
  line-height: 1.5;
}

.hwsa-tasks {
  gap: 6px;
  margin-top: 16px;
}

.hwsa-tasks > button {
  min-height: 67px;
  padding: 11px 12px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  justify-content: initial;
  gap: 9px;
  border: 0;
  border-radius: 11px;
  background: #f5f6f6;
  box-shadow: none;
  transform: none;
}

.hwsa-tasks > button:hover {
  background: #eceeef;
  transform: translateY(-1px);
}

.hwsa-tasks > button:active {
  transform: translateY(0);
}

.hwsa-tasks svg {
  width: 20px;
  height: 20px;
  padding: 1px;
  stroke-width: 1.6;
}

.hwsa-tasks span {
  gap: 1px;
}

.hwsa-tasks strong {
  font-size: 12px;
  line-height: 1.25;
}

.hwsa-tasks small {
  font-size: 9px;
  color: #7a8186;
}

.hwsa-person {
  width: 100%;
  min-height: 48px;
  margin: 10px 0 0;
  padding: 7px 13px 7px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: 11px;
  background: #f4c900;
  color: #111315;
  text-align: left;
  box-shadow: none;
  transition: background-color .18s ease, transform .18s ease;
}

.hwsa-person:hover {
  background: #ffda1f;
  transform: translateY(-1px);
}

.hwsa-person span {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.hwsa-person strong {
  font-size: 12px;
  font-weight: 800;
}

.hwsa-person small {
  font-size: 9px;
  font-weight: 600;
  color: rgba(17, 19, 21, .65);
}

.hwsa-person b {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(17, 19, 21, .1);
  font-size: 14px;
}

.hwsa-composer {
  padding: 9px 10px;
  gap: 7px;
  border-top-color: #eceeef;
}

.hwsa-composer textarea {
  height: 42px;
  max-height: 42px;
  padding: 10px 13px;
  border: 1px solid #eceeef;
  border-radius: 999px;
  background: #f7f8f8;
  font-size: 13px;
}

.hwsa-composer button {
  width: 42px !important;
  min-width: 42px !important;
  max-width: 42px !important;
  height: 42px;
  border-radius: 50%;
}

.hwsa-flow-head {
  margin-bottom: 16px;
}

.hwsa-choice,
.hwsa-product-card,
.hwsa-faq,
.hwsa-human-card,
.hwsa-compare-item {
  box-shadow: none !important;
}

@keyframes hwsa-brand-ride-in {
  from { opacity: 0; transform: translateX(-6px) translateY(2px); }
  to { opacity: 1; transform: translateX(0) translateY(0); }
}

@media (max-width: 640px) {
  .hwsa-panel {
    left: 12px !important;
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    height: min(690px, calc(100dvh - 24px));
    grid-template-rows: 68px minmax(0, 1fr) 60px;
    border-radius: 18px;
  }

  .hwsa-view {
    padding: 16px;
  }

  .hwsa-brand-stage {
    min-height: 70px;
    margin-bottom: 13px;
    padding: 10px 11px 7px;
  }

  .hwsa-brand-ride {
    width: 72%;
    height: 62px;
  }

  .hwsa-intro h3 {
    font-size: 21px !important;
  }

  .hwsa-intro p {
    font-size: 11px;
  }

  .hwsa-tasks {
    grid-template-columns: 1fr;
    gap: 0;
    margin-top: 12px;
    border-top: 1px solid #eceeef;
  }

  .hwsa-tasks > button {
    min-height: 52px;
    padding: 7px 4px;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 9px;
    border-bottom: 1px solid #eceeef;
    border-radius: 0;
    background: #fff;
  }

  .hwsa-tasks > button:hover {
    background: #f7f8f8;
    transform: none;
  }

  .hwsa-tasks small {
    display: none;
  }

  .hwsa-person {
    min-height: 46px;
    margin-top: 10px;
  }
}

@media (max-width: 379px) {
  .hwsa-brand-label span {
    display: none;
  }

  .hwsa-brand-ride {
    width: 80%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hwsa-panel.opening .hwsa-brand-mascot {
    animation: none;
  }
}

/* v2.2 — conversation-first home, inspired by premium messenger UI. */
.hwsa-panel {
  width: 388px;
  height: min(600px, calc(100dvh - 40px));
  grid-template-rows: 72px minmax(0, 1fr) 62px;
  border-radius: 18px;
  overflow: hidden;
}

.hwsa-header {
  padding: 0 10px 0 14px;
  background: var(--hwsa-signal);
  color: var(--hwsa-ink);
}

.hwsa-identity {
  align-items: center;
  min-width: 0;
}

.hwsa-identity > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hwsa-avatar {
  width: 44px;
  height: 44px;
  overflow: hidden;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(17, 19, 21, .08);
}

.hwsa-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hwsa-panel.opening .hwsa-avatar img {
  animation: hwsa-avatar-arrive .46s cubic-bezier(.22, .7, .25, 1) both;
}

.hwsa-identity h2 {
  color: #111315 !important;
  font-size: 15px !important;
  font-weight: 800 !important;
}

.hwsa-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.hwsa-icon {
  color: #111315 !important;
  background: rgba(255, 255, 255, .68) !important;
  border: 1px solid rgba(17, 19, 21, .1) !important;
}

.hwsa-icon:hover {
  background: #fff !important;
}

.hwsa-more svg { fill: currentColor; stroke: none; }
.hwsa-close svg { fill: none; stroke: currentColor; }

.hwsa-new-chat-popover {
  position: absolute;
  z-index: 20;
  top: 62px;
  right: 12px;
  width: 232px;
  padding: 14px;
  border: 1px solid rgba(17, 19, 21, .12);
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 16px 42px rgba(17, 19, 21, .18);
}

.hwsa-new-chat-popover[hidden] { display: none; }
.hwsa-new-chat-popover span { font-size: 12px; font-weight: 800; }
.hwsa-new-chat-popover p { margin: 4px 0 11px; color: #687078; font-size: 10px; line-height: 1.45; }
.hwsa-new-chat-popover button {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: #111315;
  color: #fff;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}

.hwsa-view[data-view="home"] {
  min-height: 100%;
  padding: 20px;
}

.hwsa-welcome-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.hwsa-reply-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #e0e3e4;
  border-radius: 50%;
  background: #fff;
}

.hwsa-reply-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hwsa-welcome {
  max-width: 84%;
  padding: 13px 15px;
  border-radius: 6px 16px 16px 16px;
  background: #f3f4f4;
  color: #111315;
  box-shadow: 0 7px 18px rgba(17, 19, 21, .045);
  animation: hwsa-message-in .28s ease-out both;
}

.hwsa-welcome strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 800;
}

.hwsa-welcome p {
  margin: 0;
  color: #42484d;
  font-size: 13px;
  line-height: 1.45;
}

.hwsa-tasks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.hwsa-tasks > button {
  display: inline-flex;
  width: auto;
  min-height: 36px;
  padding: 8px 13px;
  border: 1px solid #d9dddf;
  border-radius: 999px;
  background: #fff;
  color: #111315;
  box-shadow: none;
  animation: hwsa-chip-in .3s ease-out both;
}

.hwsa-tasks > button:nth-child(2) { animation-delay: 45ms; }

.hwsa-tasks > button:hover {
  border-color: #111315;
  background: #f7f8f8;
  transform: translateY(-1px);
}

.hwsa-tasks > button span { display: block; }
.hwsa-tasks > button strong { font-size: 12px; font-weight: 700; }

.hwsa-person {
  width: auto;
  min-height: 38px;
  margin: 8px 0 0;
  padding: 8px 12px 8px 14px;
  gap: 10px;
  border-radius: 999px;
  background: #111315;
  color: #fff;
  animation: hwsa-chip-in .3s .09s ease-out both;
}

.hwsa-person:hover { background: #272a2d; }
.hwsa-person small { display: none; }
.hwsa-person strong { font-size: 12px; }
.hwsa-person b {
  width: 22px;
  height: 22px;
  background: var(--hwsa-signal);
  color: #111315;
  font-size: 12px;
}

.hwsa-composer {
  grid-template-columns: minmax(0, 1fr) 42px !important;
  grid-template-rows: 42px;
  grid-template-areas: "input send";
  gap: 7px;
  padding: 9px 10px 10px;
  background: #fff;
  width: 100% !important;
  min-width: 0 !important;
  overflow: visible !important;
}

.hwsa-composer textarea {
  grid-area: input;
  display: block;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
}
.hwsa-composer .hwsa-send { grid-area: send; }

.hwsa-live-conversation {
  margin: 2px 20px 20px;
  padding-top: 4px;
}

.hwsa-live-conversation:empty { display: none; }

.hwsa-message-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
}

.hwsa-message-row.user { justify-content: flex-end; }
.hwsa-message-row .hwsa-message { max-width: calc(100% - 38px); }

@keyframes hwsa-avatar-arrive {
  from { opacity: .35; transform: translateX(-7px) rotate(-3deg); }
  to { opacity: 1; transform: translateX(0) rotate(0); }
}

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

@keyframes hwsa-chip-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
  .hwsa-panel {
    width: min(388px, calc(100dvw - 24px)) !important;
    max-width: calc(100dvw - 24px) !important;
    height: calc(100dvh - max(16px, env(safe-area-inset-top)) - max(16px, env(safe-area-inset-bottom)));
    max-height: 720px;
    grid-template-rows: 68px minmax(0, 1fr) 62px;
  }

  .hwsa-header { padding-left: 10px; padding-right: 8px; }
  .hwsa-avatar { width: 40px; height: 40px; }
  .hwsa-identity { gap: 8px; }
  .hwsa-identity h2 { font-size: 13px !important; }
  .hwsa-icon { width: 34px; height: 34px; }
  .hwsa-header-actions { gap: 3px; }

  .hwsa-view[data-view="home"] { padding: 18px 16px; }
  .hwsa-welcome { max-width: 88%; }
  .hwsa-tasks { gap: 7px; }
  .hwsa-tasks > button {
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid #d9dddf;
    border-radius: 999px;
  }

  .hwsa-live-conversation { margin: 2px 16px 18px; }
}

.hwsa-launcher {
  width: 54px !important;
  min-width: 54px !important;
  height: 54px !important;
  padding: 8px !important;
  border-radius: 50% !important;
}

.hwsa-launcher b { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .hwsa-panel.opening .hwsa-avatar img,
  .hwsa-welcome,
  .hwsa-tasks > button,
  .hwsa-person { animation: none; }
}
