.chat-toggle {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 68px;
  height: 68px;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  z-index: 19990;
  overflow: visible;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.24s ease, filter 0.24s ease;
}

.chat-toggle.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.92);
}

.chat-toggle:hover {
  transform: translateY(-3px);
  filter: drop-shadow(0 18px 38px rgba(7, 18, 34, 0.22));
}

.chat-toggle-ring {
  display: none;
}

:root {
  --chat-window-gap: 24px;
  --chat-window-gap-mobile: 12px;
  --bot-feature: #2f4f73;
  --bot-feature-soft: rgba(47, 79, 115, 0.62);
  --bot-feature-glow: rgba(118, 197, 255, 0.32);
  --bot-head-top: #8ec5ff;
  --bot-head-bottom: #5c88d8;
  --bot-head-panel-top: rgba(255, 255, 255, 0.68);
  --bot-head-panel-bottom: rgba(204, 230, 255, 0.28);
  --bot-head-panel-border: rgba(255, 255, 255, 0.42);
  --bot-head-mark: rgba(255, 255, 255, 0.24);
  --bot-antenna-top: #9fe1ff;
  --bot-antenna-bottom: #4f87df;
  --bot-antenna-orb-inner: #f8fdff;
  --bot-antenna-orb-outer: #86d1ff;
  --bot-eye-top: #ffffff;
  --bot-eye-bottom: #d8efff;
  --bot-eye-happy-bottom: #9cf1ff;
  --bot-eye-curious-bottom: #b7e3ff;
  --bot-eye-sad-top: #eef6ff;
  --bot-eye-sad-bottom: #b7cae6;
  --bot-cheek: rgba(255, 164, 189, 0.52);
  --bot-cheek-happy: rgba(255, 146, 179, 0.72);
  --bot-cloth-top: #173253;
  --bot-cloth-bottom: #4f78a5;
  --bot-cloth-limb-top: rgba(176, 212, 255, 0.94);
  --bot-cloth-limb-bottom: rgba(90, 138, 197, 0.42);
  --bot-feet: rgba(111, 160, 219, 0.5);
}

[data-theme="light"] {
  --bot-cloth-top: #efe4a6;
  --bot-cloth-bottom: #d7a85c;
  --bot-cloth-limb-top: rgba(255, 232, 177, 0.94);
  --bot-cloth-limb-bottom: rgba(213, 158, 87, 0.46);
  --bot-feet: rgba(209, 161, 96, 0.52);
}

.chat-bot-shell {
  position: relative;
  z-index: 1;
  width: 52px;
  height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  --bot-head-x: -50%;
  --bot-head-y: 0px;
  --bot-head-tilt: 0deg;
  --bot-body-y: 0px;
  --bot-body-tilt: 0deg;
  --bot-mouth-y: 0px;
}

.chat-toggle-face {
  transform: translateY(1px);
}

.chat-avatar-face {
  width: 46px;
  height: 52px;
}

.chat-bot-brows {
  position: absolute;
  top: 13px;
  left: 50%;
  z-index: 2;
  display: flex;
  gap: 6px;
  transform: translateX(-50%);
  opacity: 0.42;
  transition: transform 180ms ease, opacity 180ms ease;
}

.bot-brow {
  width: 8px;
  height: 2px;
  border-radius: 999px;
  background: var(--bot-feature);
  box-shadow: 0 0 8px var(--bot-feature-glow);
  transform-origin: center;
  transition: transform 180ms ease, opacity 180ms ease, background 180ms ease;
}

.chat-toggle-bot {
  position: absolute;
  top: 6px;
  left: 50%;
  width: 34px;
  height: 30px;
  transform: translate(var(--bot-head-x), var(--bot-head-y)) rotate(var(--bot-head-tilt));
  border-radius: 16px 16px 14px 14px;
  background: linear-gradient(180deg, var(--bot-head-top), var(--bot-head-bottom));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 10px 18px rgba(0, 0, 0, 0.18);
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.chat-toggle-bot::before {
  content: '';
  position: absolute;
  inset: 5px 4px 7px;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--bot-head-panel-top), var(--bot-head-panel-bottom));
  border: 1px solid var(--bot-head-panel-border);
}

.chat-toggle-bot::after {
  content: '';
  position: absolute;
  inset: auto 8px 5px;
  height: 3px;
  border-radius: 999px;
  background: var(--bot-head-mark);
}

.chat-bot-antenna {
  position: absolute;
  top: 0;
  left: 50%;
  width: 4px;
  height: 10px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--bot-antenna-top), var(--bot-antenna-bottom));
  box-shadow: 0 0 8px rgba(125, 194, 255, 0.34);
}

.chat-bot-antenna::after {
  content: '';
  position: absolute;
  left: 50%;
  top: -3px;
  width: 8px;
  height: 8px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--bot-antenna-orb-inner), var(--bot-antenna-orb-outer) 72%);
  box-shadow: 0 0 14px rgba(141, 196, 255, 0.44);
}

.chat-bot-body {
  position: absolute;
  top: 36px;
  left: 50%;
  width: 24px;
  height: 15px;
  transform: translate(-50%, var(--bot-body-y)) rotate(var(--bot-body-tilt));
  border-radius: 12px 12px 16px 16px;
  background: linear-gradient(180deg, var(--bot-cloth-top), var(--bot-cloth-bottom));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 8px 16px rgba(7, 18, 34, 0.16);
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.chat-bot-body::before,
.chat-bot-body::after {
  content: '';
  position: absolute;
  top: 4px;
  width: 6px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--bot-cloth-limb-top), var(--bot-cloth-limb-bottom));
  opacity: 0.82;
}

.chat-bot-body::before {
  left: -4px;
  transform: rotate(18deg);
}

.chat-bot-body::after {
  right: -4px;
  transform: rotate(-18deg);
}

.chat-bot-feet {
  position: absolute;
  top: 49px;
  left: 50%;
  z-index: 0;
  display: flex;
  gap: 6px;
  transform: translateX(-50%);
}

.chat-bot-feet span {
  width: 7px;
  height: 4px;
  border-radius: 999px;
  background: var(--bot-feet);
}

[data-theme="dark"] .chat-toggle {
  background: transparent;
}

.chat-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  background: transparent;
  z-index: 20000;
}

.chat-backdrop.active {
  display: block;
}

.chat-nudge {
  position: fixed;
  right: 28px;
  bottom: 108px;
  max-width: min(300px, calc(100vw - 40px));
  padding: 1rem 1.08rem;
  border-radius: 24px 24px 14px 24px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(220, 227, 238, 0.95);
  box-shadow:
    0 16px 34px rgba(7, 18, 34, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
  color: var(--text-primary);
  font-size: 0.86rem;
  line-height: 1.45;
  z-index: 19995;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.24s ease, transform 0.24s ease;
  text-align: left;
  cursor: pointer;
  appearance: none;
  font: inherit;
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  isolation: isolate;
}

.chat-nudge-content {
  display: grid;
  gap: 0.38rem;
}

.chat-nudge.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.chat-nudge:not(.active) {
  pointer-events: none;
}

.chat-nudge:empty {
  display: none;
}

.chat-nudge-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  position: relative;
  z-index: 1;
  width: fit-content;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5b7390;
}

.chat-nudge-label::before {
  content: '';
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #79aee8 0%, #3f78b8 100%);
  box-shadow: 0 0 0 0.14rem rgba(121, 174, 232, 0.18);
}

.chat-nudge-question {
  display: block;
  position: relative;
  z-index: 1;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #1d2c40;
}

[data-theme="dark"] .chat-nudge {
  background: rgba(18, 27, 42, 0.96);
  border-color: rgba(188, 209, 239, 0.26);
  box-shadow:
    0 18px 38px rgba(4, 10, 20, 0.44),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .chat-nudge-label {
  color: rgba(184, 205, 236, 0.9);
}

[data-theme="dark"] .chat-nudge-label::before {
  background: linear-gradient(135deg, #8bc1ff 0%, #5c8fd2 100%);
  box-shadow: 0 0 0 0.14rem rgba(107, 160, 228, 0.18);
}

[data-theme="dark"] .chat-nudge-question {
  color: rgba(245, 248, 255, 0.98);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}

.chat-window {
  position: fixed;
  top: max(var(--chat-window-gap), calc(env(safe-area-inset-top, 0px) + var(--chat-window-gap)));
  right: max(var(--chat-window-gap), calc(env(safe-area-inset-right, 0px) + var(--chat-window-gap)));
  bottom: max(var(--chat-window-gap), calc(env(safe-area-inset-bottom, 0px) + var(--chat-window-gap)));
  width: min(430px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - (var(--chat-window-gap) * 2)));
  max-height: min(720px, calc(100dvh - (var(--chat-window-gap) * 2) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)));
  display: none;
  flex-direction: column;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 253, 0.97));
  backdrop-filter: blur(26px) saturate(150%);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 36px 110px rgba(4, 13, 26, 0.24);
  z-index: 20010;
  overflow: hidden;
}

.chat-window::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 90px;
  background: linear-gradient(180deg, rgba(120, 166, 221, 0.1), transparent);
  pointer-events: none;
}

[data-theme="dark"] .chat-window {
  background: linear-gradient(180deg, rgba(8, 15, 26, 0.98), rgba(12, 21, 34, 0.95));
  border-color: rgba(173, 193, 223, 0.16);
}

.chat-window.active {
  display: flex;
  animation: chatIn 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.chat-window.active .chat-header,
.chat-window.active .chat-suggestions,
.chat-window.active .chat-messages,
.chat-window.active .chat-input-area {
  animation: chatSectionIn 0.46s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.chat-window.active .chat-suggestions {
  animation-delay: 0.03s;
}

.chat-window.active .chat-messages {
  animation-delay: 0.06s;
}

.chat-window.active .chat-input-area {
  animation-delay: 0.12s;
}

@keyframes chatIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

.chat-header,
.chat-input-area {
  padding-left: 1.2rem;
  padding-right: 1.2rem;
}

.chat-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.12rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(8, 21, 40, 0.08);
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 0.88rem;
}

.chat-header-copy {
  display: grid;
  gap: 0.12rem;
}

.chat-title-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.chat-online-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #33d17a;
  box-shadow: 0 0 0 5px rgba(51, 209, 122, 0.12);
}

.chat-avatar {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.48rem;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.chat-eyes {
  position: absolute;
  top: 16px;
  left: 50%;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transform: translate(calc(-50% + var(--eye-shift-x, 0)), var(--eye-shift-y, 0));
  transition: transform 120ms ease;
}

.chat-avatar::before {
  content: none;
}

.chat-avatar-face .chat-toggle-bot::before {
  inset: 4px 4px 6px;
}

.chat-avatar-face .chat-toggle-bot {
  top: 5px;
  width: 32px;
  height: 28px;
}

.chat-avatar-face .chat-bot-body {
  top: 33px;
  width: 22px;
  height: 13px;
}

.chat-avatar-face .chat-bot-feet {
  top: 45px;
}

.bot-eye {
  width: 8px;
  height: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 140ms ease;
}

.bot-eye-core {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--bot-eye-top), var(--bot-eye-bottom));
  box-shadow: 0 0 10px rgba(163, 219, 255, 0.5);
  transform-origin: center 60%;
  animation: eyeBlink 7.2s ease-in-out infinite;
}

.bot-eye:nth-child(2) .bot-eye-core {
  animation-delay: 0.18s;
}

.chat-bot-mouth {
  position: absolute;
  left: 50%;
  top: 28px;
  z-index: 2;
  width: 10px;
  height: 5px;
  border-bottom: 1.5px solid var(--bot-feature-soft);
  border-radius: 0 0 10px 10px;
  transform: translate(-50%, var(--bot-mouth-y));
  opacity: 0.68;
  transition: transform 180ms ease, width 180ms ease, height 180ms ease, opacity 180ms ease, border-color 180ms ease;
}

.chat-bot-cheek {
  position: absolute;
  top: 25px;
  z-index: 1;
  width: 7px;
  height: 4px;
  border-radius: 999px;
  background: var(--bot-cheek);
  filter: blur(0.3px);
  opacity: 0.72;
  transition: opacity 180ms ease, transform 180ms ease, background 180ms ease;
}

.bot-cheek-left {
  left: 11px;
}

.bot-cheek-right {
  right: 11px;
}

.chat-bot-shell.is-reacting .chat-eyes {
  transform: translate(calc(-50% + var(--eye-shift-x, 0)), var(--eye-shift-y, 0)) scale(1.04);
}

.chat-bot-shell.is-reacting .bot-eye-core {
  box-shadow: 0 0 14px rgba(163, 219, 255, 0.72);
}

.chat-bot-shell.is-reacting .chat-bot-brows {
  opacity: 0.92;
}

.chat-bot-shell[data-reaction="typing"] .chat-eyes {
  transform: translate(calc(-50% + var(--eye-shift-x, 0)), calc(var(--eye-shift-y, 0) - 1px)) scale(1.03);
}

.chat-bot-shell[data-reaction="typing"] .chat-bot-brows,
.chat-bot-shell[data-reaction="thinking"] .chat-bot-brows {
  transform: translateX(-50%) translateY(-1px);
}

.chat-bot-shell[data-reaction="typing"] .bot-brow:first-child,
.chat-bot-shell[data-reaction="thinking"] .bot-brow:first-child {
  transform: rotate(12deg) translateY(1px);
}

.chat-bot-shell[data-reaction="typing"] .bot-brow:last-child,
.chat-bot-shell[data-reaction="thinking"] .bot-brow:last-child {
  transform: rotate(-12deg) translateY(-1px);
}

.chat-bot-shell[data-reaction="typing"] .chat-bot-mouth,
.chat-bot-shell[data-reaction="thinking"] .chat-bot-mouth {
  width: 7px;
  height: 7px;
  top: 26px;
  border: 1.8px solid var(--bot-feature);
  border-radius: 999px;
  opacity: 0.92;
  animation: botThinkPulse 0.9s ease-in-out infinite;
}

.chat-bot-shell[data-reaction="typing"] {
  --bot-head-y: -1px;
  --bot-body-y: 1px;
}

.chat-bot-shell[data-reaction="happy"] .bot-eye-core {
  background: linear-gradient(180deg, var(--bot-eye-top), var(--bot-eye-happy-bottom));
  box-shadow: 0 0 16px rgba(115, 235, 255, 0.8);
}

.chat-bot-shell[data-reaction="happy"] .chat-eyes {
  transform: translate(calc(-50% + var(--eye-shift-x, 0)), calc(var(--eye-shift-y, 0) - 1px)) scale(1.05);
}

.chat-bot-shell[data-reaction="happy"] .bot-brow:first-child {
  transform: rotate(-12deg) translateY(-1px);
}

.chat-bot-shell[data-reaction="happy"] .bot-brow:last-child {
  transform: rotate(12deg) translateY(-1px);
}

.chat-bot-shell[data-reaction="happy"] .chat-bot-mouth {
  width: 12px;
  height: 6px;
  border-color: rgba(120, 240, 255, 0.95);
  border-radius: 0 0 12px 12px;
  opacity: 1;
}

.chat-bot-shell[data-reaction="happy"] {
  --bot-head-y: -1px;
  --bot-body-y: -1px;
}

.chat-bot-shell[data-reaction="happy"] .chat-bot-cheek {
  opacity: 1;
  background: var(--bot-cheek-happy);
}

.chat-bot-shell[data-reaction="sad"] .bot-eye-core {
  background: linear-gradient(180deg, var(--bot-eye-sad-top), var(--bot-eye-sad-bottom));
  box-shadow: 0 0 10px rgba(143, 180, 209, 0.42);
}

.chat-bot-shell[data-reaction="sad"] .chat-eyes {
  transform: translate(calc(-50% + var(--eye-shift-x, 0)), calc(var(--eye-shift-y, 0) + 1px)) scaleY(1.08);
}

.chat-bot-shell[data-reaction="sad"] .bot-brow:first-child {
  transform: rotate(14deg) translateY(1px);
}

.chat-bot-shell[data-reaction="sad"] .bot-brow:last-child {
  transform: rotate(-14deg) translateY(1px);
}

.chat-bot-shell[data-reaction="sad"] .chat-bot-mouth {
  width: 10px;
  height: 5px;
  top: 27px;
  border-bottom: 0;
  border-top: 1.8px solid var(--bot-feature);
  border-radius: 10px 10px 0 0;
  opacity: 0.95;
}

.chat-bot-shell[data-reaction="sad"] {
  --bot-head-y: 1px;
  --bot-body-y: 1px;
}

.chat-bot-shell[data-reaction="questionable"] .bot-eye:first-child {
  transform: translateY(-1px) rotate(-7deg);
}

.chat-bot-shell[data-reaction="questionable"] .bot-eye:last-child {
  transform: translateY(1px) rotate(7deg);
}

.chat-bot-shell[data-reaction="questionable"] .bot-brow:first-child,
.chat-bot-shell[data-reaction="curious"] .bot-brow:first-child {
  transform: rotate(-18deg) translateY(-1px);
}

.chat-bot-shell[data-reaction="questionable"] .bot-brow:last-child,
.chat-bot-shell[data-reaction="curious"] .bot-brow:last-child {
  transform: rotate(14deg) translateY(1px);
}

.chat-bot-shell[data-reaction="questionable"] .chat-bot-mouth,
.chat-bot-shell[data-reaction="curious"] .chat-bot-mouth {
  width: 8px;
  height: 3px;
  border-radius: 999px;
  opacity: 0.9;
}

.chat-bot-shell[data-reaction="curious"] .chat-eyes {
  transform: translate(calc(-50% + var(--eye-shift-x, 0)), calc(var(--eye-shift-y, 0) - 1px)) scale(1.04);
}

.chat-bot-shell[data-reaction="curious"] .bot-eye-core {
  background: linear-gradient(180deg, var(--bot-eye-top), var(--bot-eye-curious-bottom));
  box-shadow: 0 0 15px rgba(150, 209, 255, 0.72);
}

.chat-bot-shell[data-reaction="curious"] {
  --bot-head-y: -1px;
  --bot-head-tilt: -2deg;
}

.chat-bot-shell[data-reaction="questionable"] {
  --bot-head-tilt: 4deg;
  --bot-body-tilt: -2deg;
}

.chat-bot-shell[data-reaction="questionable"] .chat-bot-cheek {
  opacity: 0.48;
}

[data-theme="light"] .chat-avatar {
  background: transparent;
  box-shadow: none;
}

@keyframes botThinkPulse {
  0%, 100% {
    transform: translateX(-50%) scale(1);
    opacity: 0.82;
  }
  50% {
    transform: translateX(-50%) scale(0.82);
    opacity: 1;
  }
}

@keyframes eyeBlink {
  0%, 46%, 48%, 82%, 84%, 100% {
    transform: scaleY(1);
    opacity: 1;
  }
  47%, 83% {
    transform: scaleY(0.15);
    opacity: 0.82;
  }
}

.chat-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
}

.chat-status {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.79rem;
  line-height: 1.35;
}

.chat-close {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(14, 36, 64, 0.08);
  border-radius: 12px;
  background: rgba(7, 18, 34, 0.04);
  color: var(--text-secondary);
  font-size: 1.45rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.chat-close:hover {
  transform: translateY(-1px);
  background: rgba(7, 18, 34, 0.08);
  border-color: rgba(14, 36, 64, 0.12);
}

.chat-suggestions {
  padding: 0 1.2rem 0.95rem;
  display: grid;
  gap: 0.72rem;
  border-bottom: 1px solid rgba(8, 21, 40, 0.06);
}

.suggestions-title {
  margin: 0;
  color: #537395;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.suggestions-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.52rem;
}

.suggestion-chip {
  border: 1px solid rgba(14, 36, 64, 0.08);
  border-radius: 999px;
  padding: 0.52rem 0.8rem;
  background: rgba(255, 255, 255, 0.58);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.suggestion-chip:hover {
  transform: translateY(-1px);
  background: rgba(19, 42, 73, 0.06);
  border-color: rgba(14, 36, 64, 0.14);
  box-shadow: 0 10px 22px rgba(7, 18, 34, 0.08);
}

[data-theme="dark"] .suggestions-title {
  color: #8eb5df;
}

[data-theme="dark"] .suggestion-chip {
  background: rgba(146, 180, 230, 0.08);
  border-color: rgba(173, 193, 223, 0.16);
}

.suggest-btn,
.action-btn {
  text-align: left;
  border: 1px solid rgba(14, 36, 64, 0.09);
  background: rgba(9, 20, 36, 0.035);
  color: var(--text-primary);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  padding: 0.76rem 0.9rem;
  border-radius: 15px;
  font-size: 0.84rem;
  line-height: 1.38;
  font-weight: 600;
}

.suggest-btn,
.action-btn {
  flex: 0 0 auto;
}

.suggest-btn:hover,
.action-btn:hover,
.chat-input:focus,
.chat-send:hover {
  transform: translateY(-1px);
}

.suggest-btn:hover {
  background: rgba(19, 42, 73, 0.06);
  border-color: rgba(14, 36, 64, 0.14);
}

.action-btn:hover {
  box-shadow: 0 10px 24px rgba(7, 18, 34, 0.14);
}

[data-theme="dark"] .suggest-btn,
[data-theme="dark"] .action-btn,
[data-theme="dark"] .chat-close,
[data-theme="dark"] .chat-input {
  background: rgba(146, 180, 230, 0.08);
  border-color: rgba(173, 193, 223, 0.16);
}

.chat-messages {
  flex: 1;
  padding: 1rem 1.2rem 1.12rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.82rem;
}

.chat-message {
  max-width: 91%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chat-message.user {
  align-self: flex-end;
}

.chat-message.assistant,
.typing-indicator {
  align-self: flex-start;
}

.message-content {
  padding: 0.92rem 1rem;
  border-radius: 20px;
  line-height: 1.6;
  font-size: 0.92rem;
}

.message-content p,
.message-content ul {
  margin: 0;
}

.message-content p + ul,
.message-content ul + p,
.message-content p + p {
  margin-top: 0.58rem;
}

.message-list {
  padding-left: 1.05rem;
}

.message-list li + li {
  margin-top: 0.34rem;
}

.chat-message.user .message-content {
  background: linear-gradient(135deg, #07111f, #2f527d);
  color: #f4f7fb;
  border-bottom-right-radius: 8px;
}

.chat-message.assistant .message-content {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-bottom-left-radius: 8px;
  box-shadow: 0 12px 28px rgba(7, 18, 34, 0.08);
}

[data-theme="dark"] .chat-message.assistant .message-content {
  background: rgba(146, 180, 230, 0.08);
}

.typing-dots {
  display: inline-flex;
  gap: 0.28rem;
  padding: 0.78rem 0.88rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.46);
}

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-secondary);
  animation: dotBounce 1.2s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.14s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.28s;
}

.message-actions,
.suggest-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.message-actions {
  margin-top: 0.02rem;
}

.action-btn {
  background: linear-gradient(135deg, rgba(7, 17, 31, 0.96), rgba(47, 82, 125, 0.92));
  color: #f7fbff;
  border-color: transparent;
}

.suggest-btn {
  background: rgba(9, 20, 36, 0.035);
}

@keyframes dotBounce {
  0%, 80%, 100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  40% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

.chat-input-area {
  display: grid;
  gap: 0.66rem;
  padding-top: 0.95rem;
  padding-bottom: 1.08rem;
  border-top: 1px solid rgba(8, 21, 40, 0.08);
}

.chat-input-note {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.73rem;
  line-height: 1.4;
  text-align: center;
}

.chat-input-shell {
  position: relative;
  display: flex;
  gap: 0.68rem;
}

.chat-input {
  flex: 1;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 18px;
  padding: 0.92rem 0.98rem;
  background: rgba(255, 255, 255, 0.42);
  color: var(--text-primary);
  outline: none;
  font-size: 0.93rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.chat-input:focus {
  border-color: rgba(67, 118, 184, 0.32);
  box-shadow: 0 0 0 4px rgba(84, 137, 205, 0.08);
}

.chat-send {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(135deg, #07111f, #375887);
  color: #f7fbff;
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  box-shadow: 0 16px 32px rgba(17, 44, 77, 0.22);
}

.chat-send:hover {
  filter: brightness(1.04);
}

.autocomplete-dropdown {
  position: absolute;
  left: 0;
  right: 54px;
  bottom: calc(100% + 10px);
  padding: 0.4rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.68);
  box-shadow: 0 18px 48px rgba(7, 18, 34, 0.16);
  display: none;
  z-index: 2;
}

.autocomplete-item {
  padding: 0.66rem 0.78rem;
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 0.84rem;
  line-height: 1.4;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

.autocomplete-item:hover {
  background: rgba(19, 42, 73, 0.06);
  transform: translateX(1px);
}

[data-theme="dark"] .autocomplete-dropdown {
  background: rgba(8, 15, 26, 0.98);
  border-color: rgba(173, 193, 223, 0.16);
}

body.chat-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  .chat-toggle {
    right: 16px;
    bottom: 16px;
  }

  .chat-nudge {
    right: 14px;
    bottom: 96px;
    max-width: calc(100vw - 28px);
  }

  .chat-window {
    top: max(var(--chat-window-gap-mobile), calc(env(safe-area-inset-top, 0px) + var(--chat-window-gap-mobile)));
    right: max(var(--chat-window-gap-mobile), calc(env(safe-area-inset-right, 0px) + var(--chat-window-gap-mobile)));
    left: max(var(--chat-window-gap-mobile), calc(env(safe-area-inset-left, 0px) + var(--chat-window-gap-mobile)));
    bottom: max(var(--chat-window-gap-mobile), calc(env(safe-area-inset-bottom, 0px) + var(--chat-window-gap-mobile)));
    width: auto;
    max-height: calc(100vh - (var(--chat-window-gap-mobile) * 2));
    max-height: calc(100dvh - (var(--chat-window-gap-mobile) * 2) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    border-radius: 24px;
  }

  .chat-message {
    max-width: 100%;
  }
}
