/* The Spa at Andreas: concierge chat ("Gina"). Uses the site's .sp-root colour tokens,
   so it follows the light/dark toggle automatically. Lower-right, like the hotel's trigger. */
.cg {
  --cg-user: var(--acc, #3F5A4C);
  --cg-user-text: #FFFFFF;
  --cg-shadow: 0 10px 40px rgba(28, 35, 33, 0.22), 0 2px 10px rgba(28, 35, 33, 0.12);
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 900; /* below the skip link (1000) */
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  font-family: 'Manrope', system-ui, sans-serif;
  color: var(--ink);
  pointer-events: none; /* the wrapper never blocks the page; only the bubble and panel take clicks */
}
.cg > * { pointer-events: auto; }
html[data-theme="dark"] .cg { --cg-shadow: 0 10px 40px rgba(0, 0, 0, 0.55), 0 2px 10px rgba(0, 0, 0, 0.35); }

/* Bubble: round button that widens to a pill with the name on hover or keyboard focus */
.cg-bubble {
  order: 2;
  display: inline-flex;
  align-items: center;
  gap: 0;
  box-sizing: border-box;
  height: 52px;
  min-width: 52px;
  padding: 0 15px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--cg-shadow);
  cursor: pointer;
  font: 600 15px/1 'Manrope', system-ui, sans-serif;
  transition: gap .25s ease, padding .25s ease, background-color .2s ease;
}
.cg-bubble-icon { width: 22px; height: 22px; flex-shrink: 0; }
.cg-bubble-label {
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  transition: max-width .3s ease, opacity .25s ease;
}
.cg-bubble:hover, .cg-bubble:focus-visible, .cg-open .cg-bubble { gap: 10px; padding: 0 20px 0 16px; }
.cg-bubble:hover .cg-bubble-label, .cg-bubble:focus-visible .cg-bubble-label, .cg-open .cg-bubble-label { max-width: 160px; opacity: 1; }

/* Panel: labelled, non-modal dialog above the bubble */
.cg-panel {
  order: 1;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 600px;
  max-height: calc(100vh - 120px);
  max-height: calc(100dvh - 120px);
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line2);
  border-radius: 16px;
  box-shadow: var(--cg-shadow);
  overflow: hidden;
  transform-origin: bottom right;
  animation: cg-in .28s cubic-bezier(.34, 1.4, .64, 1);
}
.cg-panel[hidden] { display: none; }
@keyframes cg-in { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }

.cg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 12px 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--soft);
}
.cg-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cg-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-text); flex-shrink: 0; }
.cg-title { margin: 0; font-family: 'Instrument Serif', serif; font-weight: 400; font-size: 24px; line-height: 1; }
.cg-status { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line2); color: var(--text2); }
.cg-actions { display: flex; align-items: center; gap: 6px; }
.cg-new, .cg-close {
  font: 600 13px/1 'Manrope', system-ui, sans-serif;
  min-height: 36px;
  min-width: 36px;
  padding: 0 12px;
  border: 1px solid var(--line2);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.cg-close { padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.cg-close svg { width: 18px; height: 18px; }
.cg-new:hover, .cg-close:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.cg-log {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--card);
}
.cg-msg { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.cg-msg.cg-user { align-items: flex-end; }
.cg-text {
  max-width: 85%;
  padding: 10px 14px;
  font-size: 15px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  border-radius: 16px 16px 16px 4px;
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--ink);
}
.cg-user .cg-text { border-radius: 16px 16px 4px 16px; background: var(--cg-user); border-color: var(--cg-user); color: var(--cg-user-text); }
.cg-text a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.cg-book {
  font: 600 14px/1 'Manrope', system-ui, sans-serif;
  min-height: 44px;
  padding: 0 18px;
  border: none;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  cursor: pointer;
}
.cg-book:hover { background: var(--accent-text); color: var(--bg); }

.cg-typing .cg-text { display: inline-flex; gap: 5px; align-items: center; padding: 14px; }
.cg-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-text); animation: cg-dot 1.2s ease-in-out infinite; }
.cg-typing i:nth-of-type(2) { animation-delay: .15s; }
.cg-typing i:nth-of-type(3) { animation-delay: .3s; }
@keyframes cg-dot { 0%, 80%, 100% { opacity: .35; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.cg-error {
  margin: 0;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.5;
  border-radius: 10px;
  border: 1px solid #B42318;
  background: #FEF3F2;
  color: #912018;
}
html[data-theme="dark"] .cg-error { background: #3A1A16; border-color: #FFB9A9; color: #FFD8CF; }

.cg-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: var(--card); }
.cg-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  box-sizing: border-box;
  padding: 10px 14px;
  font: 16px/1.3 'Manrope', system-ui, sans-serif; /* 16px: no zoom-on-focus on iOS */
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line2);
  border-radius: 12px;
}
.cg-input::placeholder { color: var(--text3); opacity: 1; }
.cg-send {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  cursor: pointer;
}
.cg-send svg { width: 18px; height: 18px; }
.cg-send:disabled { opacity: .5; cursor: default; }
.cg-foot { margin: 0; padding: 0 12px 10px; font-size: 12px; line-height: 1.4; text-align: center; color: var(--text3); background: var(--card); }

/* Visible focus in both themes (same two-tone ring as the rest of the site) */
.cg :is(button, input, a, [tabindex]):focus-visible {
  outline: 3px solid #1C2321 !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 6px #FFFFFF !important;
}
.cg-log:focus-visible { outline-offset: -4px !important; }

.cg .sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* Phones: full-width panel above the bubble */
@media (max-width: 480px) {
  .cg { right: 16px; bottom: 16px; left: 16px; align-items: flex-end; }
  .cg-panel { width: 100%; max-width: none; height: calc(100dvh - 104px); max-height: none; border-radius: 14px; }
  .cg-bubble { height: 48px; min-width: 48px; padding: 0 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .cg-panel { animation: none; }
  .cg-bubble, .cg-bubble-label { transition: none; }
  .cg-typing i { animation: none; opacity: .8; }
}

/* Keep support and its form in the panel flow, with room for the log and composer. */
.cg-log { min-height: 0; }
.cg-support {
  flex: 0 0 auto;
  max-height: 55%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.45;
}
.cg-support [hidden] { display: none; }
.cg-support-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.cg-support-intro { flex-basis: 100%; margin: 0; }
.cg-support button, .cg-call {
  min-height: 32px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}
.cg-call { display: inline-flex; align-items: center; }
.cg-handoff-form {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line2);
  border-radius: 10px;
}
.cg-handoff-form label { display: block; }
.cg-handoff-form :is(textarea, input[type=email]) {
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin-top: 4px;
  padding: 6px;
  border: 1px solid var(--line2);
  border-radius: 6px;
  color: var(--ink);
  background: var(--card);
  font: inherit;
  font-size: 16px;
}
.cg-handoff-form textarea:focus-visible { outline: 2px solid var(--ink); }
.cg-handoff-form button { justify-self: start; }
.cg-handoff-form button:disabled { opacity: .55; cursor: default; }
.cg-handoff-result { margin: 0; }
