

:root {
  --vp-asst-ink: #0f1115;
  --vp-asst-ink-soft: #1a1d24;
  --vp-asst-surface: #ffffff;
  --vp-asst-surface-2: #f7f7f5;
  --vp-asst-line: rgba(15, 17, 21, 0.06);
  --vp-asst-text: #1a1d24;
  --vp-asst-text-soft: #6b6f76;
  --vp-asst-text-faint: #9a9fa6;
  --vp-asst-accent: #d4a571;
  --vp-asst-accent-strong: #b8864a;
  --vp-asst-shadow-lg: 0 24px 60px -12px rgba(15, 17, 21, 0.25), 0 8px 24px -8px rgba(15, 17, 21, 0.12);
  --vp-asst-shadow-md: 0 8px 24px -8px rgba(15, 17, 21, 0.18);
}


.vp-asst-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--vp-asst-ink);
  color: #fff;
  border: 0;
  cursor: pointer;
  box-shadow: var(--vp-asst-shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s cubic-bezier(.2, .9, .35, 1.1),
              box-shadow 0.2s;
  font-family: 'Geologica', system-ui, sans-serif;
  padding: 0;
}
.vp-asst-launcher:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: var(--vp-asst-shadow-lg);
}
.vp-asst-launcher:active { transform: translateY(0) scale(0.98); }

.vp-asst-launcher-icon {
  width: 26px;
  height: 26px;
  stroke: #fff;
  fill: none;
  stroke-width: 1.8;
}

.vp-asst-launcher-dot {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 2px var(--vp-asst-ink);
  animation: vp-asst-pulse 2s infinite;
}
@keyframes vp-asst-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}


.vp-asst-window {
  position: fixed;
  right: 24px;
  bottom: 92px;
  z-index: 9999;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 620px;
  max-height: calc(100vh - 130px);
  background: var(--vp-asst-surface);
  border-radius: 20px;
  box-shadow: var(--vp-asst-shadow-lg);
  display: none;
  flex-direction: column;
  overflow: hidden;
  overscroll-behavior: contain;
  font-family: 'Geologica', system-ui, sans-serif;
  color: var(--vp-asst-text);
  transform: translateY(12px) scale(0.96);
  opacity: 0;
}


html.vp-asst-locked {
  overflow: hidden;
  touch-action: none;
}
html.vp-asst-locked body {
  overflow: hidden;
}


.vp-asst-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(15, 17, 21, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  display: none;
}
.vp-asst-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}
.vp-asst-window.is-open {
  display: flex;
  animation: vp-asst-pop-in 0.28s cubic-bezier(.2, .9, .35, 1.05) forwards;
}
@keyframes vp-asst-pop-in {
  to { opacity: 1; transform: translateY(0) scale(1); }
}


.vp-asst-header {
  padding: 18px 20px;
  background: var(--vp-asst-ink);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}
.vp-asst-avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2a2d33 0%, #1a1d24 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}
.vp-asst-avatar::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.vp-asst-avatar-icon {
  width: 18px;
  height: 18px;
  stroke: var(--vp-asst-accent);
  fill: none;
  stroke-width: 1.8;
}
.vp-asst-header-text {
  flex: 1;
  min-width: 0;
}
.vp-asst-title {
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: #fff;
}
.vp-asst-subtitle {
  font-size: 12px;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.55);
  display: flex;
  align-items: center;
  gap: 6px;
}
.vp-asst-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
}
.vp-asst-close {
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  border: 0;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}
.vp-asst-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}


.vp-asst-body {
  flex: 1;
  
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
  background: var(--vp-asst-surface);
}
.vp-asst-body::-webkit-scrollbar { width: 6px; }
.vp-asst-body::-webkit-scrollbar-thumb { background: var(--vp-asst-line); border-radius: 3px; }


.vp-asst-row {
  display: flex;
  max-width: 100%;
}
.vp-asst-row-user { justify-content: flex-end; }
.vp-asst-row-bot { justify-content: flex-start; }

.vp-asst-msg {
  max-width: 86%;
  padding: 12px 16px;
  border-radius: 16px;
  line-height: 1.55;
  font-size: 14px;
  letter-spacing: -0.005em;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.vp-asst-msg-bot {
  background: var(--vp-asst-surface-2);
  color: var(--vp-asst-text);
  border-bottom-left-radius: 4px;
}
.vp-asst-msg-user {
  background: var(--vp-asst-ink);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.vp-asst-msg-error {
  background: #fef2ec;
  color: #7c3a14;
  border-bottom-left-radius: 4px;
  font-size: 13px;
  max-width: 92%;
}

.vp-asst-msg p { margin: 0; }
.vp-asst-msg p + p { margin-top: 8px; }
.vp-asst-msg strong { font-weight: 600; }
.vp-asst-msg ul { margin: 6px 0 0; padding-left: 18px; }
.vp-asst-msg li { margin: 2px 0; }
.vp-asst-msg a {
  color: var(--vp-asst-accent-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
}


.vp-asst-quick-replies {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.vp-asst-quick-btn {
  background: var(--vp-asst-surface);
  border: 1px solid var(--vp-asst-line);
  color: var(--vp-asst-text);
  padding: 10px 14px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  line-height: 1.4;
  
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(15, 17, 21, 0.04);
}
.vp-asst-quick-btn:hover {
  border-color: var(--vp-asst-ink);
  background: var(--vp-asst-surface-2);
}
.vp-asst-quick-btn:active { transform: scale(0.99); }


.vp-asst-op-cta {
  display: flex;
  margin-top: 8px;
}
.vp-asst-op-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--vp-asst-ink);
  color: var(--vp-asst-surface);
  padding: 11px 16px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(15, 17, 21, 0.04);
}
.vp-asst-op-btn:hover { background: var(--vp-asst-ink-soft); }
.vp-asst-op-btn:active { transform: scale(0.99); }


.vp-asst-typing {
  align-self: flex-start;
  padding: 12px 16px;
  background: var(--vp-asst-surface-2);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.vp-asst-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--vp-asst-text-faint);
  animation: vp-asst-bounce 1.3s infinite ease-in-out both;
}
.vp-asst-typing span:nth-child(2) { animation-delay: 0.15s; }
.vp-asst-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes vp-asst-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.45; }
  40% { transform: translateY(-5px); opacity: 1; }
}


.vp-asst-footer {
  padding: 14px 16px 16px;
  background: var(--vp-asst-surface);
  border-top: 1px solid var(--vp-asst-line);
}
.vp-asst-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  background: var(--vp-asst-surface-2);
  border-radius: 16px;
  padding: 6px 6px 6px 14px;
  transition: box-shadow 0.15s;
}
.vp-asst-form:focus-within {
  box-shadow: 0 0 0 3px rgba(15, 17, 21, 0.08);
}
.vp-asst-input {
  flex: 1;
  resize: none;
  border: 0;
  outline: 0;
  padding: 8px 0;
  font-family: inherit;
  
  font-size: 16px;
  background: transparent;
  max-height: 120px;
  line-height: 1.4;
  color: var(--vp-asst-text);
  touch-action: manipulation;
}
.vp-asst-submit { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.vp-asst-close { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.vp-asst-launcher { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.vp-asst-input::placeholder { color: var(--vp-asst-text-faint); }
.vp-asst-submit {
  background: var(--vp-asst-ink);
  color: #fff;
  border: 0;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
  padding: 0;
}
.vp-asst-submit:disabled {
  background: var(--vp-asst-text-faint);
  cursor: not-allowed;
}
.vp-asst-submit:hover:not(:disabled) { background: var(--vp-asst-ink-soft); }
.vp-asst-submit:active:not(:disabled) { transform: scale(0.94); }
.vp-asst-submit svg { width: 16px; height: 16px; }

.vp-asst-hint {
  font-size: 11px;
  color: var(--vp-asst-text-faint);
  margin: 10px 4px 0;
  line-height: 1.4;
  text-align: center;
}


@media (max-width: 640px) {
  .vp-asst-launcher {
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom, 16px));
    width: 52px;
    height: 52px;
  }
  .vp-asst-window {
    right: 0;
    left: 0;
    top: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    
    height: 100svh;
    height: 100dvh;
    max-height: 100svh;
    max-height: 100dvh;
    border-radius: 0;
    transform: translateY(100%);
  }
  .vp-asst-backdrop {
    
    display: none;
  }
  .vp-asst-window.is-open {
    animation: vp-asst-slide-up 0.32s cubic-bezier(.2, .9, .35, 1.05) forwards;
  }
  @keyframes vp-asst-slide-up {
    to { opacity: 1; transform: translateY(0) scale(1); }
  }
  .vp-asst-header {
    
    padding-top: max(18px, calc(env(safe-area-inset-top, 0px) + 14px));
  }
  .vp-asst-footer {
    
    padding-bottom: max(16px, calc(env(safe-area-inset-bottom, 0px) + 8px));
  }
  .vp-asst-msg { font-size: 15px; }
  .vp-asst-quick-btn { font-size: 14px; padding: 12px 14px; }
  .vp-asst-hint { font-size: 12px; }
}
