/* Floating Galataria web chat. Brand teal #0F6B6E / orange #E8A33D. */
:root {
  --gc-teal: #0F6B6E;
  --gc-teal-dk: #0B5558;
  --gc-orange: #E8A33D;
  --gc-cream: #FDF8EC;
  --gc-ink: #1c1917;
  --gc-muted: #5c564f;
  --gc-line: color-mix(in srgb, var(--gc-teal) 16%, #e8e0d2);
}

.gc-root {
  position: relative;
  z-index: 80;
  font-family: "DM Sans", system-ui, sans-serif;
}

.gc-launch {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  width: 60px;
  height: 60px;
  border: 0;
  padding: 0;
  border-radius: 50%;
  background: var(--gc-teal);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--gc-teal) 40%, transparent), 0 0 0 3px color-mix(in srgb, var(--gc-orange) 70%, #fff);
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 90;
}
.gc-launch img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 50%;
  background: var(--gc-cream);
}
.gc-launch:hover { background: var(--gc-teal-dk); }
.gc-launch:focus-visible { outline: 3px solid var(--gc-orange); outline-offset: 3px; }
.gc-launch[aria-expanded="true"] { display: none; }

.gc-panel {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  width: min(380px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 32px));
  max-width: 100vw;
  background: #fff;
  color: var(--gc-ink);
  border: 1px solid var(--gc-line);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(28, 25, 23, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 95;
  box-sizing: border-box;
}
.gc-panel[hidden] { display: none !important; }

.gc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 12px 14px;
  background: var(--gc-teal);
  color: #fff;
  flex: 0 0 auto;
}
.gc-head img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gc-cream);
  object-fit: contain;
  flex: 0 0 auto;
}
.gc-head .who { flex: 1 1 auto; min-width: 0; }
.gc-head .who strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 650;
}
.gc-head .who span {
  display: block;
  font-size: 0.75rem;
  opacity: 0.85;
}
.gc-close {
  border: 0;
  background: transparent;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
}
.gc-close:hover { background: color-mix(in srgb, #000 16%, transparent); }
.gc-close:focus-visible { outline: 2px solid var(--gc-orange); }

.gc-log {
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 14px 14px 8px;
  background: var(--gc-cream);
  display: flex;
  flex-direction: column;
  gap: 8px;
  -webkit-overflow-scrolling: touch;
}
.gc-msg {
  max-width: 86%;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.gc-msg p { margin: 0 0 0.55em; }
.gc-msg p:last-child { margin-bottom: 0; }
.gc-msg a { color: var(--gc-teal-dk); }
.gc-msg.bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--gc-line);
  border-bottom-left-radius: 4px;
}
.gc-msg.user {
  align-self: flex-end;
  background: var(--gc-teal);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.gc-msg.user a { color: #fff; }
.gc-msg.pending { opacity: 0.7; font-style: italic; }

.gc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 14px 8px;
  background: var(--gc-cream);
  flex: 0 0 auto;
}
.gc-chip {
  border: 1px solid var(--gc-line);
  background: #fff;
  color: var(--gc-teal-dk);
  border-radius: 999px;
  padding: 6px 10px;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.gc-chip:hover { background: color-mix(in srgb, var(--gc-orange) 18%, #fff); }

.gc-note {
  margin: 0;
  padding: 0 14px 8px;
  background: var(--gc-cream);
  font-size: 0.72rem;
  color: var(--gc-muted);
  flex: 0 0 auto;
}
.gc-note a { color: var(--gc-teal); }

.gc-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--gc-line);
  background: #fff;
  flex: 0 0 auto;
}
.gc-form label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.gc-form textarea {
  flex: 1 1 auto;
  resize: none;
  min-height: 42px;
  max-height: 96px;
  border: 1px solid var(--gc-line);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.95rem;
  color: var(--gc-ink);
  background: #fff;
  width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.gc-form textarea:focus { outline: 2px solid var(--gc-teal); outline-offset: 0; }
.gc-send {
  flex: 0 0 auto;
  border: 0;
  border-radius: 12px;
  background: var(--gc-orange);
  color: #083E40;
  font: inherit;
  font-weight: 650;
  padding: 0 14px;
  cursor: pointer;
}
.gc-send:hover { filter: brightness(0.96); }
.gc-send:disabled { opacity: 0.5; cursor: not-allowed; }

body.gc-open { overflow: hidden; }

@media (max-width: 640px) {
  .gc-panel {
    inset: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100dvh;
    height: 100%;
    max-width: 100vw;
    max-height: 100dvh;
    border-radius: 0;
    border: 0;
  }
  .gc-launch {
    right: max(14px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .gc-launch, .gc-panel { transition: none; }
}
