/* The Excellia assistant (assets/js/chat.js).
   Brand tokens only — no new colours. Full-screen sheet on a phone, a card on
   the desktop, and nothing that moves if the visitor asked for less motion. */

.xc-launch {
  position: fixed;
  right: clamp(.75rem, 3vw, 1.5rem);
  bottom: clamp(.75rem, 3vw, 1.5rem);
  /* Above the site's sticky masthead (90) and its mobile nav (89), or the
     header paints over the conversation on a phone. */
  z-index: 120;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1.05rem;
  border: 0;
  border-radius: 999px;
  background: var(--navy-800);
  color: #fff;
  font: 600 .9375rem/1 var(--font-body, inherit);
  box-shadow: var(--lift-3, 0 10px 30px rgba(10, 37, 64, .25));
  cursor: pointer;
}
.xc-launch:hover { background: var(--navy-700); }
.xc-launch:focus-visible { outline: 3px solid var(--blue-500); outline-offset: 2px; }
.xc-launch svg { width: 1.25rem; height: 1.25rem; }

.xc-panel {
  position: fixed;
  z-index: 121;
  right: clamp(.75rem, 3vw, 1.5rem);
  bottom: calc(clamp(.75rem, 3vw, 1.5rem) + 3.5rem);
  width: min(23rem, calc(100vw - 1.5rem));
  max-height: min(34rem, calc(100vh - 6rem));
  display: flex;
  flex-direction: column;
  background: var(--surface, #fff);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: var(--lift-4, 0 24px 60px rgba(10, 37, 64, .28));
  overflow: hidden;
  animation: xc-in .16s ease-out;
}
@keyframes xc-in { from { opacity: 0; transform: translateY(.5rem); } }

.xc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .8rem 1rem;
  background: var(--navy-800);
  color: #fff;
}
.xc-head strong { display: block; font-size: .9375rem; }
.xc-head span { font-size: .75rem; color: var(--ink-2-on-navy); }
.xc-x {
  border: 0;
  background: transparent;
  color: #fff;
  padding: .35rem;
  border-radius: .5rem;
  cursor: pointer;
  line-height: 0;
}
.xc-x:hover { background: rgba(255, 255, 255, .14); }
.xc-x svg { width: 1.25rem; height: 1.25rem; }

.xc-log {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: .9rem 1rem .5rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  background: var(--surface-sunk, #f5f7fa);
}
.xc-msg {
  max-width: 90%;
  padding: .55rem .75rem;
  border-radius: .8rem;
  font-size: .875rem;
  line-height: 1.55;
}
.xc-msg--bot { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: .25rem; }
.xc-msg--you { align-self: flex-end; background: var(--blue-600); color: #fff; border-bottom-right-radius: .25rem; }
.xc-summary {
  display: block;
  padding: .5rem .65rem;
  background: var(--surface-sunk-2, #eaeff7);
  border-radius: .5rem;
  font-size: .8125rem;
}

.xc-choices {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  padding: .75rem 1rem;
  border-top: 1px solid var(--line);
  background: #fff;
}
.xc-choice {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem .8rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: 600 .8125rem/1.2 inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.xc-choice:hover { border-color: var(--blue-600); color: var(--blue-700); }
.xc-choice:focus-visible { outline: 3px solid var(--blue-500); outline-offset: 2px; }
.xc-choice svg { width: 1.1rem; height: 1.1rem; flex: none; }
.xc-choice--wa { background: #25D366; border-color: #1da851; color: #05331a; }
.xc-choice--wa:hover { background: #1da851; color: #fff; }
.xc-choice--danger { background: var(--red-600); border-color: var(--red-700); color: #fff; }
.xc-choice--danger:hover { background: var(--red-700); color: #fff; }
.xc-choice--quiet { border-style: dashed; color: var(--ink-3); font-weight: 500; }

.xc-ask { width: 100%; }
.xc-ask__label { display: block; font-size: .8125rem; font-weight: 600; margin-bottom: .3rem; }
.xc-ask__row { display: flex; gap: .4rem; }
.xc-ask__input {
  flex: 1 1 auto;
  min-width: 0;
  padding: .5rem .65rem;
  border: 1px solid var(--line-strong);
  border-radius: .5rem;
  font: 400 .875rem/1.4 inherit;
  color: var(--ink);
}
.xc-ask__input:focus-visible { outline: 3px solid var(--blue-500); outline-offset: 1px; }
.xc-ask__send {
  padding: .5rem .9rem;
  border: 0;
  border-radius: .5rem;
  background: var(--blue-600);
  color: #fff;
  font: 600 .8125rem/1.2 inherit;
  cursor: pointer;
}
.xc-ask__send:hover { background: var(--blue-700); }

.xc-foot {
  margin: 0;
  padding: .6rem 1rem .8rem;
  border-top: 1px solid var(--line);
  background: #fff;
  font-size: .6875rem;
  line-height: 1.5;
  color: var(--ink-3);
}
.xc-foot a { color: var(--red-700); }

/* On a phone the panel takes the screen — a 23rem card in the corner of a
   375px screen is a card nobody can type into. */
@media (max-width: 30rem) {
  .xc-panel {
    inset: 0;
    width: 100%;
    max-height: 100%;
    border: 0;
    border-radius: 0;
  }
  body.xc-open { overflow: hidden; }
  .xc-launch span { display: none; }
  .xc-launch { padding: .8rem; }
}

@media (prefers-reduced-motion: reduce) {
  .xc-panel { animation: none; }
}
