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

.vmch {
  --vmch-accent: #2563eb;
  --vmch-accent-dark: #173b8f;
  --vmch-accent-dark: color-mix(in srgb, var(--vmch-accent), #0f172a 24%);
  --vmch-text: #172033;
  --vmch-muted: #667085;
  --vmch-border: #e6eaf0;
  --vmch-surface: #ffffff;
  --vmch-soft: #f6f8fc;
  --vmch-shadow: 0 26px 70px rgba(15, 23, 42, 0.22), 0 5px 18px rgba(15, 23, 42, 0.1);
  position: fixed;
  z-index: 99990;
  right: 22px;
  bottom: 22px;
  color: var(--vmch-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  text-align: left;
}

.vmch--left {
  right: auto;
  left: 22px;
}

.vmch [hidden] {
  display: none !important;
}

.vmch button,
.vmch input,
.vmch textarea {
  font: inherit;
}

.vmch button,
.vmch a {
  -webkit-tap-highlight-color: transparent;
}

.vmch button:focus-visible,
.vmch a:focus-visible,
.vmch input:focus-visible,
.vmch textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--vmch-accent), white 55%);
  outline-offset: 2px;
}

.vmch-launcher {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 56px;
  align-items: center;
  gap: 10px;
  margin: 0 0 0 auto;
  padding: 8px 18px 8px 9px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--vmch-accent), white 7%), var(--vmch-accent-dark));
  box-shadow: 0 12px 32px color-mix(in srgb, var(--vmch-accent), transparent 68%), 0 3px 8px rgba(15, 23, 42, 0.15);
  color: #fff;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.vmch--left .vmch-launcher {
  margin: 0 auto 0 0;
}

.vmch-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 38px color-mix(in srgb, var(--vmch-accent), transparent 62%), 0 4px 10px rgba(15, 23, 42, 0.16);
}

.vmch-launcher__icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.vmch-launcher svg,
.vmch-header svg,
.vmch-action svg,
.vmch-contact svg,
.vmch-composer svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.vmch-launcher__label {
  color: #fff;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.vmch-panel {
  position: absolute;
  right: 0;
  bottom: 70px;
  display: flex;
  width: min(408px, calc(100vw - 28px));
  height: min(710px, calc(100vh - 112px));
  min-height: 520px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 24px;
  background: var(--vmch-surface);
  box-shadow: var(--vmch-shadow);
  transform-origin: bottom right;
  animation: vmch-panel-in 230ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.vmch--left .vmch-panel {
  right: auto;
  left: 0;
  transform-origin: bottom left;
}

.vmch-header {
  position: relative;
  display: flex;
  min-height: 82px;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  overflow: hidden;
  background:
    radial-gradient(circle at 88% 8%, rgba(255, 255, 255, 0.18) 0 5%, transparent 5.5%),
    radial-gradient(circle at 75% 115%, rgba(255, 255, 255, 0.12) 0 24%, transparent 24.5%),
    linear-gradient(135deg, color-mix(in srgb, var(--vmch-accent), #fff 5%), var(--vmch-accent-dark));
  color: #fff;
}

.vmch-avatar {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.17);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.vmch-avatar svg {
  width: 27px;
  height: 27px;
}

.vmch-header__copy {
  min-width: 0;
  flex: 1;
}

.vmch-header h2,
.vmch-header p {
  margin: 0;
  color: #fff;
}

.vmch-header h2 {
  font-size: 17px;
  font-weight: 780;
  letter-spacing: -0.015em;
}

.vmch-header p {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 12px;
  opacity: 0.82;
}

.vmch-status-dot {
  width: 7px;
  height: 7px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  background: #6ee7b7;
  box-shadow: 0 0 0 3px rgba(110, 231, 183, 0.15);
}

.vmch-icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: background 180ms ease;
}

.vmch-icon-button:hover {
  background: rgba(255, 255, 255, 0.13);
}

.vmch-icon-button svg {
  width: 21px;
  height: 21px;
}

.vmch-body {
  min-height: 0;
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 17px 16px 18px;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.76), rgba(255, 255, 255, 0) 100px),
    var(--vmch-surface);
  scrollbar-color: #cbd5e1 transparent;
  scrollbar-width: thin;
}

.vmch-body::-webkit-scrollbar {
  width: 6px;
}

.vmch-body::-webkit-scrollbar-thumb {
  border-radius: 9px;
  background: #cbd5e1;
}

.vmch-message-group {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 13px;
  animation: vmch-message-in 200ms ease both;
}

.vmch-message-group--user {
  align-items: flex-end;
}

.vmch-message {
  position: relative;
  width: fit-content;
  max-width: 88%;
  padding: 11px 13px;
  border: 1px solid var(--vmch-border);
  border-radius: 16px 16px 16px 5px;
  background: #fff;
  box-shadow: 0 2px 7px rgba(15, 23, 42, 0.045);
  color: var(--vmch-text);
}

.vmch-welcome > .vmch-message {
  width: 100%;
  max-width: none;
  padding-left: 36px;
  border-color: color-mix(in srgb, var(--vmch-accent), white 82%);
  background: color-mix(in srgb, var(--vmch-accent), white 96%);
}

.vmch-message__spark {
  position: absolute;
  top: 11px;
  left: 13px;
  color: var(--vmch-accent);
  font-size: 16px;
}

.vmch-message--user {
  border-color: transparent;
  border-radius: 16px 16px 5px 16px;
  background: linear-gradient(135deg, var(--vmch-accent), var(--vmch-accent-dark));
  box-shadow: 0 6px 18px color-mix(in srgb, var(--vmch-accent), transparent 82%);
  color: #fff;
}

.vmch-message p {
  margin: 0;
  color: inherit;
  font-size: 14px;
  line-height: 1.52;
  white-space: pre-line;
}

.vmch-actions {
  display: grid;
  gap: 9px;
  margin-top: 13px;
}

.vmch-action {
  display: grid;
  min-height: 67px;
  grid-template-columns: 42px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--vmch-border);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.035);
  color: var(--vmch-text);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.vmch-action:hover {
  border-color: color-mix(in srgb, var(--vmch-accent), white 65%);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.07);
  transform: translateY(-1px);
}

.vmch-action__icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
}

.vmch-action__icon svg {
  width: 21px;
  height: 21px;
}

.vmch-action__icon--blue { background: #eff6ff; color: #2563eb; }
.vmch-action__icon--violet { background: #f5f3ff; color: #7c3aed; }
.vmch-action__icon--amber { background: #fffbeb; color: #d97706; }
.vmch-action__icon--green { background: #ecfdf5; color: #059669; }

.vmch-action strong,
.vmch-action small {
  display: block;
}

.vmch-action strong {
  margin-bottom: 2px;
  color: #1e293b;
  font-size: 14px;
  font-weight: 720;
}

.vmch-action small {
  overflow: hidden;
  color: var(--vmch-muted);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vmch-action__arrow {
  color: #94a3b8;
  font-size: 25px;
  font-weight: 300;
  text-align: center;
}

.vmch-books {
  display: grid;
  width: 100%;
  gap: 8px;
  margin-top: 9px;
}

.vmch-book {
  display: grid;
  min-height: 94px;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 11px;
  padding: 9px;
  border: 1px solid var(--vmch-border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.045);
  color: var(--vmch-text);
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.vmch-book:hover {
  border-color: color-mix(in srgb, var(--vmch-accent), white 65%);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  color: var(--vmch-text);
  transform: translateY(-1px);
}

.vmch-book__media {
  display: grid;
  width: 64px;
  height: 76px;
  place-items: center;
  overflow: hidden;
  border-radius: 9px;
  background: #eef2f7;
}

.vmch-book__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vmch-book__media--empty {
  background: linear-gradient(145deg, var(--vmch-accent), var(--vmch-accent-dark));
  color: #fff;
  font-size: 17px;
  font-weight: 800;
}

.vmch-book__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 2px 2px 1px 0;
}

.vmch-book__copy > strong {
  display: -webkit-box;
  overflow: hidden;
  color: #1e293b;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.vmch-book__copy > small {
  margin-top: 4px;
  overflow: hidden;
  color: var(--vmch-muted);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vmch-book__bottom {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}

.vmch-book__bottom b {
  color: var(--vmch-accent-dark);
  font-size: 13px;
  font-weight: 750;
}

.vmch-book__bottom span {
  color: var(--vmch-accent);
  font-size: 10.5px;
  font-weight: 700;
}

.vmch-links {
  display: flex;
  width: 100%;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.vmch-link {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid color-mix(in srgb, var(--vmch-accent), white 72%);
  border-radius: 10px;
  background: color-mix(in srgb, var(--vmch-accent), white 96%);
  color: var(--vmch-accent-dark);
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: none;
}

.vmch-link:hover {
  background: color-mix(in srgb, var(--vmch-accent), white 91%);
  color: var(--vmch-accent-dark);
}

.vmch-typing {
  display: flex;
  min-width: 58px;
  align-items: center;
  gap: 4px;
  padding: 14px 15px;
}

.vmch-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
  animation: vmch-typing 1s ease-in-out infinite;
}

.vmch-typing span:nth-child(2) { animation-delay: 120ms; }
.vmch-typing span:nth-child(3) { animation-delay: 240ms; }

.vmch-suggestions {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
  overflow-x: auto;
  padding: 9px 14px 4px;
  border-top: 1px solid #f1f5f9;
  background: #fff;
  scrollbar-width: none;
}

.vmch-suggestions::-webkit-scrollbar { display: none; }

.vmch-suggestions button {
  min-height: 35px;
  flex: 0 0 auto;
  padding: 6px 11px;
  border: 1px solid #dbe3ee;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-size: 11.5px;
  font-weight: 650;
  cursor: pointer;
}

.vmch-suggestions button:hover {
  border-color: color-mix(in srgb, var(--vmch-accent), white 55%);
  color: var(--vmch-accent-dark);
}

.vmch-composer {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-end;
  gap: 8px;
  margin: 9px 13px 7px;
  padding: 6px 6px 6px 13px;
  border: 1px solid #d9e0ea;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(15, 23, 42, 0.055);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.vmch-composer:focus-within {
  border-color: color-mix(in srgb, var(--vmch-accent), white 45%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--vmch-accent), transparent 89%), 0 4px 14px rgba(15, 23, 42, 0.06);
}

.vmch-composer textarea {
  width: 100%;
  min-height: 40px;
  max-height: 104px;
  flex: 1;
  resize: none;
  overflow-y: auto;
  padding: 10px 0 7px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--vmch-text);
  font-size: 13px;
  line-height: 1.35;
}

.vmch-composer textarea::placeholder { color: #94a3b8; }

.vmch-composer button {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--vmch-accent), var(--vmch-accent-dark));
  box-shadow: 0 4px 12px color-mix(in srgb, var(--vmch-accent), transparent 75%);
  color: #fff;
  cursor: pointer;
}

.vmch-composer button:disabled {
  box-shadow: none;
  cursor: wait;
  opacity: 0.55;
}

.vmch-composer button svg {
  width: 20px;
  height: 20px;
}

.vmch-disclaimer {
  flex: 0 0 auto;
  margin: 0 12px 9px;
  color: #98a2b3;
  font-size: 9.5px;
  line-height: 1.25;
  text-align: center;
}

.vmch-contact {
  animation: vmch-message-in 190ms ease both;
}

.vmch-contact__back {
  min-height: 38px;
  margin: -4px 0 8px;
  padding: 4px 6px;
  border: 0;
  background: transparent;
  color: var(--vmch-accent-dark);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.vmch-contact__heading {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 15px;
  padding: 13px;
  border: 1px solid #dbeafe;
  border-radius: 15px;
  background: #f5f9ff;
}

.vmch-contact__icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 12px;
  background: var(--vmch-accent);
  color: #fff;
}

.vmch-contact h3,
.vmch-contact p {
  margin: 0;
}

.vmch-contact h3 {
  color: #1e293b;
  font-size: 15px;
  font-weight: 750;
}

.vmch-contact__heading p {
  margin-top: 2px;
  color: var(--vmch-muted);
  font-size: 11px;
}

.vmch-field {
  margin-bottom: 11px;
}

.vmch-field label,
.vmch-field > label {
  display: block;
  margin-bottom: 5px;
  color: #344054;
  font-size: 11.5px;
  font-weight: 700;
}

.vmch-field input,
.vmch-field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 11px;
  border: 1px solid #d9e0ea;
  border-radius: 11px;
  outline: 0;
  background: #fff;
  color: var(--vmch-text);
  font-size: 13px;
}

.vmch-field textarea {
  min-height: 96px;
  resize: vertical;
}

.vmch-field input:focus,
.vmch-field textarea:focus {
  border-color: color-mix(in srgb, var(--vmch-accent), white 42%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--vmch-accent), transparent 89%);
}

.vmch-consent {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: start;
  margin: 4px 0 12px;
  color: var(--vmch-muted);
  font-size: 10.5px;
  line-height: 1.4;
}

.vmch-consent input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--vmch-accent);
}

.vmch-contact__submit {
  width: 100%;
  min-height: 46px;
  padding: 10px 16px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--vmch-accent), var(--vmch-accent-dark));
  box-shadow: 0 6px 16px color-mix(in srgb, var(--vmch-accent), transparent 76%);
  color: #fff;
  font-weight: 750;
  cursor: pointer;
}

.vmch-contact__submit:disabled { cursor: wait; opacity: 0.62; }

.vmch-honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.vmch-form-status {
  margin: 0 0 11px !important;
  padding: 9px 10px;
  border-radius: 10px;
  font-size: 11px;
}

.vmch-form-status.is-success { background: #ecfdf3; color: #067647; }
.vmch-form-status.is-error { background: #fef3f2; color: #b42318; }

.vmch-backdrop {
  display: none;
}

.vmch .screen-reader-text {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
  white-space: nowrap !important;
}

@keyframes vmch-panel-in {
  from { opacity: 0; transform: translateY(12px) scale(0.975); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

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

@media (max-width: 600px) {
  .vmch,
  .vmch--left {
    right: 14px;
    bottom: max(14px, env(safe-area-inset-bottom));
    left: auto;
  }

  .vmch-launcher {
    min-width: 56px;
    min-height: 56px;
    justify-content: center;
    padding: 8px;
  }

  .vmch-launcher__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .vmch-backdrop:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: block;
    width: 100vw;
    height: 100dvh;
    padding: 0;
    border: 0;
    background: rgba(15, 23, 42, 0.44);
    backdrop-filter: blur(2px);
  }

  .vmch-panel,
  .vmch--left .vmch-panel {
    position: fixed;
    top: max(10px, env(safe-area-inset-top));
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 8px;
    z-index: 3;
    width: auto;
    height: auto;
    min-height: 0;
    max-height: none;
    border-radius: 22px;
    transform-origin: bottom center;
  }

  .vmch-header {
    min-height: 76px;
    padding: 12px 13px;
  }

  .vmch-avatar {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  .vmch-body {
    padding: 14px 13px 16px;
  }

  .vmch-action {
    min-height: 64px;
  }

  .vmch-composer {
    margin-right: 10px;
    margin-left: 10px;
  }
}

@media (max-width: 370px) {
  .vmch-action {
    grid-template-columns: 38px minmax(0, 1fr) 16px;
    gap: 8px;
  }
  .vmch-action__icon {
    width: 38px;
    height: 38px;
  }
  .vmch-action small { font-size: 10.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .vmch *,
  .vmch *::before,
  .vmch *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
