/* Hero tips SMS chat interface */
.tips-widget {
  position: fixed;
  right: var(--tips-control-right, 24px);
  bottom: var(--tips-control-bottom, 24px);
  z-index: 2147483647 !important;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}
.tips-wrap {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--light);
  padding: 0;
  display: flex;
  flex-direction: column;
  height: min(420px, calc(100vh - 96px));
  width: min(360px, calc(100vw - 32px));
  overflow: hidden;
  position: absolute;
  right: 0;
  bottom: 56px;
  z-index: 2147483647 !important;
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.2);
  transition: opacity 0.24s ease, transform 0.24s ease, visibility 0.24s ease;
  transform-origin: bottom right;
}
.tips-widget:not(.is-open) .tips-wrap {
  opacity: 0;
  transform: translateY(14px) scale(0.96);
  pointer-events: none;
  visibility: hidden;
}
.tips-widget.is-open .tips-wrap {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  visibility: visible;
}
.tips-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  flex-shrink: 0;
}
.tips-head svg { width: 16px; height: 16px; color: var(--red); }
.tips-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--blue);
}
.tips-launcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,0.95);
  color: var(--text);
  box-shadow: 0 4px 18px rgba(0,0,0,0.08);
  backdrop-filter: blur(20px);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.tips-launcher:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.tips-launcher:focus-visible {
  outline: 2px solid rgba(200,16,46,0.45);
  outline-offset: 3px;
}
.tips-launcher-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tips-launcher-icon svg {
  width: 18px;
  height: 18px;
}
.tips-unread-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  text-shadow: none;
}
.tips-unread-badge.is-hidden {
  display: none;
}
/* SMS chat container */
.tips-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 14px 12px 6px;
  gap: 0;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.tips-chat::-webkit-scrollbar { display: none; }
.tips-chat::before {
  content: '';
  flex: 1;
}

.tips-pause-btn {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(200,16,46,0.25);
  background: rgba(254,242,242,0.9);
  color: var(--red);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
  opacity: 0.88;
  transition: opacity 0.2s ease, color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  z-index: 5;
}
.tips-pause-btn:hover {
  opacity: 1;
  border-color: rgba(200,16,46,0.35);
  background: rgba(254,242,242,1);
}
.tips-pause-btn svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}
.tips-pause-btn .icon-play { display: none; }
.tips-pause-btn.is-paused {
  color: var(--red);
  background: rgba(254,242,242,0.9);
  border-color: rgba(200,16,46,0.25);
}
.tips-pause-btn.is-paused .icon-pause { display: none; }
.tips-pause-btn.is-paused .icon-play { display: block; }

.tips-wrap.paused .typing-dots span { animation-play-state: paused; }

/* SMS bubble with tail using border-mask technique */
.sms-bubble {
  color: #fff;
  font-size: 0.88rem;
  line-height: 1.6;
  word-wrap: break-word;
  max-width: 85%;
  align-self: flex-start;
  flex-shrink: 0;
  margin-bottom: 4px;

  --s: 0.7em;
  --r: 0.9em;

  padding: 10px 13px;
  border: var(--s) solid #0000;
  border-radius: calc(var(--r) + var(--s));
  border-bottom-left-radius: 0;
  background: border-box var(--red);
  -webkit-mask:
    radial-gradient(100% 100% at 0 0, #0000 99%, #000 102%)
      0 calc(100% - var(--s)) / var(--s) var(--s) no-repeat border-box,
    linear-gradient(#000 0 0) padding-box;
  mask:
    radial-gradient(100% 100% at 0 0, #0000 99%, #000 102%)
      0 calc(100% - var(--s)) / var(--s) var(--s) no-repeat border-box,
    linear-gradient(#000 0 0) padding-box;
  animation: smsPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Typing dots inside bubble */
.sms-bubble.typing {
  padding: 13px 18px;
}
.typing-dots {
  display: flex;
  gap: 5px;
  align-items: center;
  height: 1.1em;
}
.typing-dots span {
  width: 7px;
  height: 7px;
  background: rgba(255,255,255,0.85);
  border-radius: 50%;
  animation: dotBounce 1.1s ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.18s; }
.typing-dots span:nth-child(3) { animation-delay: 0.36s; }
@keyframes dotBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
  40% { transform: translateY(-5px); opacity: 1; }
}

@keyframes smsPop {
  0% { opacity: 0; transform: translateY(10px) scale(0.94); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

