/* Service advisor — Messenger-style chat on Services page */



.service-advisor {

  padding: var(--section-y) clamp(1rem, 3vw, 2rem);

  border-block: 1px solid var(--border);

  overflow: visible;

}



.service-advisor-inner {

  max-width: min(100%, 680px);

  margin: 0 auto;

  min-height: 0;

}



.service-advisor-intro {

  text-align: center;

  margin-bottom: clamp(1.25rem, 3vw, 1.75rem);

}



.service-advisor-intro h2 {

  font-family: 'Clash Display', sans-serif;

  font-weight: 800;

  font-size: clamp(1.35rem, 3vw, 1.75rem);

  letter-spacing: -0.03em;

  margin-bottom: 0.5rem;

}



.service-advisor-intro p {

  color: var(--muted);

  font-size: 0.88rem;

  max-width: 32rem;

  margin: 0 auto;

  line-height: 1.55;

}



/* Robot leaning on chat tab */

.service-advisor-chat-wrap {

  position: relative;

  overflow: visible;

  padding-top: clamp(3.25rem, 12vw, 4.75rem);

}



.advisor-robot-lean {

  position: absolute;

  top: 0;

  right: clamp(0.5rem, 6vw, 2rem);

  width: clamp(108px, 28vw, 158px);

  z-index: 5;

  pointer-events: none;

  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.38));

}



.advisor-robot-lean img {

  display: block;

  width: 100%;

  height: auto;

  transform: translateY(42%);

}



.service-advisor-chat {

  position: relative;

  z-index: 2;

  background: var(--gray2);

  border: 1px solid var(--border);

  border-radius: 16px;

  display: flex;

  flex-direction: column;

  height: min(520px, 68vh);

  max-height: min(520px, 70dvh);

  min-height: min(400px, 55dvh);

  overflow: hidden;

  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);

}



/* Messenger-style header */

.advisor-header {

  flex-shrink: 0;

  padding: 0.75rem 1rem;

  padding-right: clamp(5.5rem, 22vw, 7.5rem);

  border-bottom: 1px solid var(--border);

  display: flex;

  align-items: center;

  gap: 0.65rem;

  background: rgba(0, 0, 0, 0.14);

}



.advisor-header-avatar {

  width: 36px;

  height: 36px;

  border-radius: 50%;

  overflow: hidden;

  flex-shrink: 0;

  border: 2px solid rgba(201, 188, 86, 0.35);

  background: var(--gray);

}



.advisor-header-avatar img {

  width: 100%;

  height: 100%;

  object-fit: cover;

  object-position: center 12%;

  transform: scale(1.35);

}



.advisor-header-info {

  display: flex;

  flex-direction: column;

  gap: 0.1rem;

  min-width: 0;

}



.advisor-header-info strong {

  font-family: 'Clash Display', sans-serif;

  font-size: 0.88rem;

  letter-spacing: -0.02em;

  line-height: 1.2;

}



.advisor-header-info span {

  font-size: 0.68rem;

  color: var(--success);

  line-height: 1.2;

}



.advisor-messages {

  flex: 1 1 auto;

  min-height: 0;

  overflow-x: hidden;

  overflow-y: auto;

  padding: 1rem 1rem 0.85rem;

  display: flex;

  flex-direction: column;

  gap: 0.35rem;

  scroll-behavior: smooth;

}



/* Message rows — avatar + bubble (Messenger style) */

.advisor-msg-row {

  display: flex;

  align-items: flex-end;

  gap: 0.45rem;

  max-width: min(92%, 100%);

  width: fit-content;

  box-sizing: border-box;

  animation: advisorMsgIn 0.28s ease;

}



.advisor-msg-row--bot {

  align-self: flex-start;

}



.advisor-msg-row--user {

  align-self: flex-end;

  flex-direction: row-reverse;

  max-width: 88%;

}



.advisor-msg-row--bot.is-stacked .advisor-msg-avatar {

  visibility: hidden;

}



.advisor-msg-avatar {

  width: 28px;

  height: 28px;

  border-radius: 50%;

  overflow: hidden;

  flex-shrink: 0;

  border: 1.5px solid rgba(201, 188, 86, 0.28);

  background: var(--gray);

  align-self: flex-end;

  margin-bottom: 2px;

}



.advisor-msg-avatar img {

  width: 100%;

  height: 100%;

  object-fit: cover;

  object-position: center 10%;

  transform: scale(1.4);

}



.advisor-msg {

  padding: 0.6rem 0.82rem;

  border-radius: 18px;

  font-size: 0.82rem;

  line-height: 1.5;

  flex: 1 1 auto;

  min-width: 0;

  max-width: 100%;

  overflow-wrap: anywhere;

  word-break: break-word;

  word-wrap: break-word;

  white-space: normal;

  box-sizing: border-box;

}



@keyframes advisorMsgIn {

  from { opacity: 0; transform: translateY(6px); }

  to { opacity: 1; transform: translateY(0); }

}



.advisor-msg-row--bot .advisor-msg {

  background: rgba(255, 255, 255, 0.06);

  border: 1px solid var(--border);

  color: var(--white);

  border-bottom-left-radius: 4px;

}



.advisor-msg-row--user .advisor-msg {

  background: var(--accent-dim);

  border: 1px solid rgba(201, 188, 86, 0.25);

  color: var(--white);

  border-bottom-right-radius: 4px;

}



.advisor-msg strong {

  color: var(--accent);

  font-weight: 600;

}



.advisor-typing {

  display: inline-flex;

  align-items: center;

  gap: 0.3rem;

  padding: 0.72rem 0.95rem;

  min-width: 3.5rem;

}



.advisor-typing span {

  width: 6px;

  height: 6px;

  border-radius: 50%;

  background: var(--muted);

  animation: advisorDot 1.1s infinite ease-in-out;

}



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

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



@keyframes advisorDot {

  0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }

  40% { opacity: 1; transform: translateY(-3px); }

}



.advisor-msg-actions {

  display: flex;

  flex-wrap: wrap;

  gap: 0.4rem;

  margin-top: 0.55rem;

}



.advisor-msg-actions a {

  display: inline-block;

  font-family: 'Clash Display', sans-serif;

  font-size: 0.62rem;

  font-weight: 600;

  letter-spacing: 0.06em;

  text-transform: uppercase;

  text-decoration: none;

  padding: 0.35rem 0.7rem;

  border: 1px solid var(--border-strong);

  color: var(--accent);

  max-width: 100%;

  white-space: normal;

  overflow-wrap: anywhere;

  line-height: 1.35;

  border-radius: 999px;

  transition: background 0.2s, color 0.2s;

}



.advisor-msg-actions a:hover {

  background: var(--accent);

  color: var(--accent-on);

}



.advisor-chips {

  flex-shrink: 0;

  display: flex;

  flex-wrap: wrap;

  gap: 0.35rem;

  padding: 0.55rem 1rem;

  border-top: 1px solid var(--border);

  background: rgba(0, 0, 0, 0.12);

  max-height: 5.5rem;

  overflow-y: auto;

}



.advisor-chip {

  background: transparent;

  border: 1px solid var(--border-strong);

  color: var(--muted);

  font-family: 'DM Sans', sans-serif;

  font-size: 0.68rem;

  padding: 0.32rem 0.65rem;

  border-radius: 999px;

  cursor: pointer;

  transition: border-color 0.2s, color 0.2s, background 0.2s;

  white-space: nowrap;

}



.advisor-chip:hover {

  border-color: var(--accent);

  color: var(--accent);

  background: var(--accent-dim);

}



.advisor-form {

  flex-shrink: 0;

  display: flex;

  gap: 0.5rem;

  padding: 0.75rem 1rem;

  border-top: 1px solid var(--border);

  background: rgba(0, 0, 0, 0.18);

}



.advisor-form input {

  flex: 1;

  min-width: 0;

  background: var(--gray);

  border: 1px solid var(--border);

  color: var(--white);

  font-family: 'DM Sans', sans-serif;

  font-size: 0.82rem;

  padding: 0.6rem 0.85rem;

  border-radius: 999px;

}



.advisor-form input::placeholder {

  color: var(--muted);

}



.advisor-form input:focus {

  outline: none;

  border-color: var(--accent);

}



.advisor-form button {

  flex-shrink: 0;

  background: var(--accent);

  color: var(--accent-on);

  border: none;

  font-family: 'Clash Display', sans-serif;

  font-weight: 700;

  font-size: 0.72rem;

  letter-spacing: 0.05em;

  text-transform: uppercase;

  padding: 0.6rem 1rem;

  border-radius: 999px;

  cursor: pointer;

  transition: background 0.2s, transform 0.2s;

}



.advisor-form button:hover {

  background: var(--accent-hover);

  transform: translateY(-1px);

}



.services-intro {

  max-width: var(--max-w);

  margin: 0 auto;

  padding: calc(var(--nav-h) + 1.75rem) clamp(1rem, 3vw, 2rem) var(--block-gap);

  text-align: center;

}



.services-intro h2 {

  font-family: 'Clash Display', sans-serif;

  font-weight: 800;

  font-size: clamp(1.35rem, 3vw, 1.75rem);

  letter-spacing: -0.03em;

  margin-bottom: 0.5rem;

}



.services-intro p,
.services-intro__lead {
  color: var(--white, #fafaf8);
  font-family: 'Clash Display', sans-serif;
  font-weight: 600;
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  max-width: 40rem;
  margin: 0 auto;
  line-height: 1.45;
  letter-spacing: -0.02em;
}

.services-intro__lead a {
  color: var(--accent, #c9bc56);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

.services-intro__lead a:hover {
  color: var(--accent-hover, #d4c96a);
}



.services-grid--five {

  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)) !important;

  gap: 1.25rem !important;

  background: transparent !important;

  padding: 0 clamp(1rem, 3vw, 2rem) var(--section-y);

  max-width: var(--max-w);

  margin: 0 auto;

}



.service-card.is-highlight {

  border-color: rgba(201, 188, 86, 0.45) !important;

  box-shadow: 0 0 32px rgba(201, 188, 86, 0.12), var(--shadow-md) !important;

  transition: border-color 0.3s, box-shadow 0.3s !important;

}



@media (max-width: 900px) {

  .service-advisor-chat {

    height: min(480px, 62vh);

    min-height: 360px;

  }



  .advisor-robot-lean {

    width: clamp(96px, 30vw, 132px);

    right: clamp(0.25rem, 3vw, 1rem);

  }

}



@media (max-width: 480px) {

  .service-advisor-chat-wrap {

    padding-top: clamp(2.75rem, 16vw, 3.5rem);

  }



  .advisor-header {

    padding-right: clamp(4.75rem, 28vw, 6rem);

  }



  .advisor-robot-lean {

    width: clamp(88px, 34vw, 118px);

    right: 0.15rem;

  }



  .advisor-robot-lean img {

    transform: translateY(38%);

  }



  .advisor-form {

    flex-direction: column;

  }



  .advisor-form button {

    width: 100%;

  }

}



/* ── Fixed advisor launcher — robot + bubble, always on screen ── */

.advisor-fixed {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  left: auto;
  top: auto;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.45rem;
  pointer-events: none;
  max-width: calc(100vw - 1.5rem);
  box-sizing: border-box;
}

.advisor-fixed > * {
  pointer-events: auto;
}

.advisor-fixed-panel {
  position: absolute;
  bottom: calc(100% + 0.5rem);
  right: 0;
  width: min(400px, calc(100vw - 2rem));
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.97);
  transform-origin: bottom right;
  transition:
    opacity 0.28s ease,
    transform 0.28s ease,
    visibility 0.28s;
  pointer-events: none;
}

.advisor-fixed.is-open .advisor-fixed-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.advisor-fixed-chat {
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.06);
  height: min(560px, calc(100dvh - 7.5rem), calc(100vh - 7.5rem));
  min-height: 320px;
  max-height: calc(100dvh - 6.5rem);
  box-sizing: border-box;
}

.advisor-fixed .advisor-chips {
  max-height: min(10rem, 38%);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.advisor-fixed .advisor-form {
  position: relative;
  z-index: 2;
  background: var(--gray2, #2a2a32);
  border-top: 1px solid var(--border);
}

.advisor-fixed .advisor-header {
  padding-right: 2.75rem;
}

.advisor-fixed-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.advisor-fixed-close:hover {
  color: var(--white);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.08);
}

.advisor-fixed-bubble {
  position: absolute;
  bottom: calc(100% + 0.85rem);
  right: 0.15rem;
  max-width: min(280px, calc(100vw - 5rem));
  min-width: min(240px, calc(100vw - 5rem));
  padding: 0.85rem 1.15rem 0.9rem;
  background: #f3f2ee;
  color: #1a1a1e;
  border: none;
  border-radius: 1.15rem 1.15rem 0.35rem 1.15rem;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.06),
    0 12px 28px rgba(0, 0, 0, 0.22);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.96);
  transform-origin: bottom right;
  transition:
    opacity 0.3s ease,
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.3s;
  cursor: pointer;
}

.advisor-fixed-bubble::before {
  content: '';
  position: absolute;
  right: 1.35rem;
  bottom: -0.42rem;
  width: 0.85rem;
  height: 0.85rem;
  background: #f3f2ee;
  border-radius: 0 0 3px 0;
  transform: rotate(45deg);
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.06);
}

.advisor-fixed-bubble.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.advisor-fixed.is-open .advisor-fixed-bubble {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none;
}

.advisor-fixed-bubble p {
  position: relative;
  z-index: 1;
  margin: 0;
  padding-right: 0.9rem;
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: 0.86rem;
  line-height: 1.4;
  color: #1a1a1e;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: normal;
  overflow-wrap: anywhere;
}

.advisor-fixed-bubble-dismiss {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 5;
  width: 1.35rem;
  height: 1.35rem;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: rgba(28, 28, 32, 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  transform: translate(15%, -15%);
}

.advisor-fixed-bubble-dismiss:hover {
  color: rgba(28, 28, 32, 0.7);
  background: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .advisor-fixed-bubble,
[data-theme="light"] .advisor-fixed-bubble::before {
  background: #2a2a32;
}

[data-theme="light"] .advisor-fixed-bubble {
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.05),
    0 12px 28px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .advisor-fixed-bubble p {
  color: #f3f2ee;
}

[data-theme="light"] .advisor-fixed-bubble-dismiss {
  color: rgba(243, 242, 238, 0.4);
}

[data-theme="light"] .advisor-fixed-bubble-dismiss:hover {
  color: rgba(243, 242, 238, 0.85);
  background: rgba(255, 255, 255, 0.08);
}

.advisor-fixed-launch {
  position: relative;
  display: inline-flex;
  overflow: visible;
}

.advisor-fixed-fab-dismiss.fab-hide {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 5;
  height: 1.2rem;
  min-width: 2.1rem;
  padding: 0 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: #1c1c22;
  color: rgba(240, 240, 242, 0.85);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  transform: translate(18%, -35%);
}

.advisor-fixed-fab-dismiss.fab-hide:hover {
  color: #fff;
  background: #2a2a32;
  border-color: rgba(255, 255, 255, 0.28);
}

.advisor-fixed.is-fab-hidden {
  display: none !important;
}

.advisor-fixed-trigger {
  width: 4.35rem;
  height: 4.35rem;
  border-radius: 50%;
  border: 2px solid rgba(201, 188, 86, 0.42);
  background: linear-gradient(180deg, var(--gray2), var(--gray));
  box-shadow:
    0 10px 32px rgba(0, 0, 0, 0.38),
    0 0 24px rgba(201, 188, 86, 0.12);
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.advisor-fixed-trigger:hover {
  transform: translateY(-2px) scale(1.03);
  border-color: rgba(201, 188, 86, 0.65);
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.42),
    0 0 32px rgba(201, 188, 86, 0.2);
}

.advisor-fixed-trigger img {
  width: 138%;
  height: 138%;
  object-fit: cover;
  object-position: center 12%;
  transform: translateY(6%);
  pointer-events: none;
}

@media (max-width: 640px) {

  .advisor-fixed {
    right: 0.75rem;
    bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
  }

  .advisor-fixed-panel {
    position: fixed;
    right: 0.5rem;
    left: 0.5rem;
    width: auto;
    max-width: none;
    bottom: calc(5rem + 4.5rem + env(safe-area-inset-bottom, 0px));
    top: auto;
  }



  .advisor-fixed-chat {

    height: min(62dvh, calc(100dvh - 10.5rem));

    min-height: 260px;

    max-height: calc(100dvh - 10rem);

  }



  .advisor-fixed-trigger {

    width: 3.85rem;

    height: 3.85rem;

  }



  .advisor-fixed-bubble {
    max-width: min(240px, calc(100vw - 5.5rem));
    min-width: 0;
    width: max-content;
  }



  .advisor-msg {

    font-size: 0.8rem;

    padding: 0.55rem 0.75rem;

  }



  .advisor-messages {

    padding: 0.85rem 0.75rem 0.7rem;

  }



  .advisor-chips {

    max-height: 4.75rem;

  }



  .advisor-chip {

    white-space: normal;

    text-align: left;

    line-height: 1.25;

  }

}
