.sv-chat {
  --sv-chat-border: rgba(132, 216, 255, 0.22);
  position: fixed;
  z-index: 60;
  display: flex;
  justify-content: flex-end;
  width: min(410px, calc(100% - 48px - env(safe-area-inset-left) - env(safe-area-inset-right)));
  pointer-events: none;
  right: max(24px, env(safe-area-inset-right));
  bottom: calc(22px + env(safe-area-inset-bottom) + var(--sv-chat-keyboard-offset, 0px));
  color: var(--text);
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  font-size: 14px;
  line-height: 1.55;
}

#dashboard-heading {
  scroll-margin-top: 112px;
}

#salonprofile {
  scroll-margin-top: 150px;
}

.sv-chat button,
.sv-chat input {
  font: inherit;
}

.sv-chat svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sv-chat-launcher {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 64px;
  padding: 10px 22px 10px 12px;
  border: 1px solid rgba(132, 216, 255, 0.6);
  border-radius: 999px;
  background: linear-gradient(120deg, #102b48, #0a172a);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), 0 0 24px rgba(29, 212, 255, 0.08);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease;
}

.sv-chat-launcher:hover {
  transform: translateY(-3px);
  border-color: var(--accent-dark);
}

.sv-chat-launcher-icon,
.sv-chat-avatar {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #07111f;
  background: linear-gradient(135deg, #9ee6ff, #24b9ff);
}

.sv-chat-launcher-label strong,
.sv-chat-launcher-label > span {
  display: block;
}

.sv-chat-launcher-label strong {
  font-size: 14px;
  letter-spacing: 0.01em;
}

.sv-chat-launcher-label > span {
  color: #a9c5e2;
  font-size: 12px;
}

.sv-chat-panel {
  position: absolute;
  right: 0;
  bottom: 80px;
  display: flex;
  flex-direction: column;
  width: 100%;
  pointer-events: auto;
  height: min(660px, calc(var(--sv-chat-viewport, 100dvh) - 128px));
  max-height: calc(100dvh - 128px);
  overflow: hidden;
  border: 1px solid var(--sv-chat-border);
  border-radius: 26px;
  background: #0b1728;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55), 0 0 40px rgba(29, 212, 255, 0.04);
  animation: sv-chat-reveal 220ms ease-out;
}

.sv-chat-panel[hidden] {
  display: none;
}

.sv-chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  padding: 20px 16px;
  background: radial-gradient(ellipse at top left, rgba(39, 141, 255, 0.2), transparent 80%), #102139;
}

.sv-chat-avatar {
  width: 36px;
  height: 36px;
  background: radial-gradient(circle at 32% 28%, #e5faff, #25bdff 50%, #1371d3);
  box-shadow: 0 0 0 5px rgba(132, 216, 255, 0.08);
}

.sv-chat-heading {
  flex: 1;
  min-width: 0;
}

.sv-chat-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--accent-dark);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.sv-chat-heading h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.sv-chat-icon-button {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 34px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #b7cee8;
  cursor: pointer;
}

.sv-chat-icon-button:hover {
  color: #fff;
  background: rgba(132, 216, 255, 0.1);
}

.sv-chat-description {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  margin: 0;
  padding: 10px 18px;
  border-bottom: 1px solid var(--sv-chat-border);
  color: #a9c5e2;
  font-size: 11px;
}

.sv-chat-description > span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-dark);
}

.sv-chat-log {
  position: relative;
  flex: 1;
  min-height: 0;
  padding: 20px 18px 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #345777 transparent;
  background: radial-gradient(ellipse at top right, rgba(29, 212, 255, 0.04), transparent 65%);
}

.sv-chat-message {
  width: fit-content;
  max-width: 94%;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(132, 216, 255, 0.12);
  border-radius: 3px 18px 18px 18px;
  background: #14243a;
  overflow-wrap: anywhere;
}

.sv-chat-message-author {
  display: block;
  margin-bottom: 7px;
  color: var(--accent-dark);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.sv-chat-message p {
  margin: 0;
  color: #e0ebf8;
  font-size: 13px;
  line-height: 1.65;
}

.sv-chat-message p + p {
  margin-top: 10px;
}

.sv-chat-message--user {
  margin-left: auto;
  border-color: rgba(39, 141, 255, 0.3);
  border-radius: 18px 3px 18px 18px;
  background: #11375b;
}

.sv-chat-message--user p {
  white-space: pre-wrap;
}

.sv-chat-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.sv-chat-links a {
  display: inline-block;
  padding: 7px 10px;
  border: 1px solid rgba(132, 216, 255, 0.32);
  border-radius: 9px;
  color: #ace5ff;
  background: rgba(39, 141, 255, 0.08);
  font-size: 12px;
  font-weight: 600;
}

.sv-chat-links a:hover {
  background: rgba(39, 141, 255, 0.18);
}

.sv-chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  flex-shrink: 0;
  padding: 10px 18px 15px;
}

.sv-chat-suggestions button {
  padding: 7px 10px;
  border: 1px solid var(--sv-chat-border);
  border-radius: 999px;
  background: transparent;
  color: #b6cbe3;
  font-size: 11px;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
}

.sv-chat-suggestions button:hover {
  border-color: var(--accent-dark);
  color: var(--accent-dark);
  background: rgba(132, 216, 255, 0.06);
}

.sv-chat-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin: 0 16px;
  padding: 6px 6px 6px 13px;
  border: 1px solid var(--sv-chat-border);
  border-radius: 14px;
  background: #07111f;
}

.sv-chat-form:focus-within {
  border-color: var(--accent-dark);
}

.sv-chat-form input {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 10px 0;
  border: 0;
  outline: none;
  color: var(--text);
  background: transparent;
  font-size: 14px;
}

.sv-chat-form input::placeholder {
  color: #87a2c0;
}

.sv-chat-send {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  color: #07111f;
  background: var(--accent-dark);
  cursor: pointer;
}

.sv-chat-send:disabled {
  color: #87a2c0;
  background: #17293e;
  cursor: default;
}

.sv-chat-note {
  flex-shrink: 0;
  margin: 0;
  padding: 10px 18px 15px;
  color: #96adca;
  font-size: 10px;
  line-height: 1.5;
}

.sv-chat-note a {
  color: #bed8f3;
  text-decoration: underline;
}

.sv-chat-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@keyframes sv-chat-reveal {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 520px) {
  .sv-chat {
    width: calc(100% - 24px - env(safe-area-inset-left) - env(safe-area-inset-right));
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(14px + env(safe-area-inset-bottom) + var(--sv-chat-keyboard-offset, 0px));
  }

  .sv-chat-launcher {
    gap: 9px;
    min-height: 54px;
    padding: 6px 16px 6px 6px;
  }

  .sv-chat-launcher-label strong { font-size: 12px; }
  .sv-chat-launcher-label > span { font-size: 10px; }

  .sv-chat-panel {
    bottom: 68px;
    height: min(630px, calc(var(--sv-chat-viewport, 100dvh) - 106px - env(safe-area-inset-bottom)));
    max-height: calc(100dvh - 106px - env(safe-area-inset-bottom));
    border-radius: 22px;
  }

  .sv-chat-header { gap: 9px; padding: 16px 12px; }
  .sv-chat-heading h2 { font-size: 20px; }
  .sv-chat-icon-button { width: 40px; height: 40px; }
  .sv-chat-form input { font-size: 16px; }
}

.sv-chat.is-compact .sv-chat-suggestions,
.sv-chat.is-compact .sv-chat-description,
.sv-chat.is-compact .sv-chat-kicker {
  display: none;
}

.sv-chat.is-compact .sv-chat-header {
  padding-block: 10px;
}

.sv-chat.is-compact .sv-chat-heading h2 {
  font-size: 18px;
}

.sv-chat.is-compact .sv-chat-note {
  padding-block: 8px;
}

@media (prefers-reduced-motion: reduce) {
  .sv-chat-panel { animation: none; }
  .sv-chat-launcher { transition: none; }
}
