/* Grace web chat for tummysolutions.com. No framework, no CDN, no web fonts. */

.gws {
  --gws-navy: #1f2a57;
  --gws-gold: #d7b56d;
  --gws-ink: #23262e;
  --gws-mut: #55596a;
  --gws-line: #d8dae2;
  --gws-paper: #ffffff;
  --gws-soft: #f3f4f8;
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 2147483000;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--gws-ink);
}

.gws *,
.gws *::before,
.gws *::after {
  box-sizing: border-box;
}

.gws-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 12px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--gws-navy);
  color: var(--gws-gold);
  font: 600 15px/1.2 inherit;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(15, 20, 40, 0.28);
}

.gws-pill:hover {
  background: #27336a;
}

.gws-pill:focus-visible,
.gws button:focus-visible,
.gws textarea:focus-visible,
.gws a:focus-visible {
  outline: 3px solid var(--gws-gold);
  outline-offset: 2px;
}

.gws-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gws-gold);
  flex: 0 0 auto;
}

.gws-panel {
  display: none;
  width: 360px;
  max-width: calc(100vw - 24px);
  max-height: min(74vh, 640px);
  flex-direction: column;
  overflow: hidden;
  background: var(--gws-paper);
  border: 1px solid var(--gws-line);
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(15, 20, 40, 0.3);
}

.gws.gws-open .gws-panel {
  display: flex;
}

.gws.gws-open .gws-pill {
  display: none;
}

.gws-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  background: var(--gws-navy);
  color: var(--gws-gold);
}

.gws-head h2 {
  margin: 0;
  font: 700 15px/1.3 inherit;
  color: var(--gws-gold);
}

.gws-close {
  margin-left: auto;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--gws-gold);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.gws-close:hover {
  background: rgba(255, 255, 255, 0.14);
}

.gws-note {
  padding: 9px 14px;
  background: var(--gws-soft);
  border-bottom: 1px solid var(--gws-line);
  color: var(--gws-mut);
  font-size: 12.5px;
}

.gws-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--gws-line);
}

.gws-quick button {
  padding: 8px 12px;
  min-height: 36px;
  border: 1px solid var(--gws-navy);
  border-radius: 999px;
  background: var(--gws-paper);
  color: var(--gws-navy);
  font: 600 13px/1.2 inherit;
  cursor: pointer;
}

.gws-quick button:hover {
  background: var(--gws-navy);
  color: var(--gws-gold);
}

.gws-log {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gws-msg {
  max-width: 88%;
  padding: 9px 12px;
  border-radius: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.gws-msg.gws-them {
  align-self: flex-start;
  background: var(--gws-soft);
  color: var(--gws-ink);
}

.gws-msg.gws-me {
  align-self: flex-end;
  background: var(--gws-navy);
  color: #ffffff;
}

.gws-card {
  align-self: flex-start;
  max-width: 100%;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--gws-line);
  border-left: 4px solid var(--gws-navy);
  border-radius: 10px;
  background: var(--gws-paper);
}

.gws-card b {
  display: block;
  font-size: 14px;
  color: var(--gws-navy);
}

.gws-card span {
  display: block;
  margin: 3px 0 8px;
  color: var(--gws-mut);
  font-size: 13px;
}

.gws-card a {
  display: inline-block;
  padding: 9px 14px;
  min-height: 40px;
  border-radius: 8px;
  background: var(--gws-navy);
  color: var(--gws-gold);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}

.gws-card a:hover {
  background: #27336a;
}

.gws-typing {
  align-self: flex-start;
  display: inline-flex;
  gap: 5px;
  padding: 11px 13px;
  border-radius: 12px;
  background: var(--gws-soft);
}

.gws-typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gws-mut);
  animation: gws-bounce 1.2s infinite ease-in-out;
}

.gws-typing i:nth-child(2) {
  animation-delay: 0.16s;
}

.gws-typing i:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes gws-bounce {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

.gws-foot {
  border-top: 1px solid var(--gws-line);
  padding: 10px 12px;
}

.gws-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.gws-foot textarea {
  flex: 1 1 auto;
  resize: none;
  min-height: 42px;
  max-height: 110px;
  padding: 10px 11px;
  border: 1px solid var(--gws-line);
  border-radius: 9px;
  font: 400 15px/1.4 inherit;
  color: var(--gws-ink);
  background: var(--gws-paper);
}

.gws-send {
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  background: var(--gws-navy);
  color: var(--gws-gold);
  font: 600 14px/1 inherit;
  cursor: pointer;
}

.gws-send[disabled] {
  opacity: 0.55;
  cursor: default;
}

.gws-count {
  display: block;
  margin-top: 6px;
  text-align: right;
  color: var(--gws-mut);
  font-size: 11.5px;
}

.gws-count.gws-over {
  color: #a12b2b;
  font-weight: 600;
}

.gws-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

@media (max-width: 480px) {
  .gws {
    right: 10px;
    bottom: 10px;
    left: 10px;
  }

  .gws-panel {
    width: 100%;
    max-width: none;
    max-height: 78vh;
  }

  .gws-pill {
    float: right;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gws-typing i {
    animation: none;
    opacity: 0.6;
  }
}
