/* Support chat FAB — GenZ / brand cyan — local only */
:root {
  --sc-chat-accent: #0891b2;
  --sc-chat-accent-2: #22d3ee;
  --sc-chat-ink: #0f172a;
  --sc-chat-panel: #ffffff;
  --sc-chat-soft: #ecfeff;
  --sc-chat-shadow: 0 18px 50px rgba(8, 145, 178, 0.28);
}

.sc-chat-fab {
  position: fixed;
  z-index: 1080;
  inset-inline-start: 1.1rem;
  inset-block-end: 1.1rem;
  width: 3.6rem;
  height: 3.6rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(145deg, var(--sc-chat-accent), #0e7490 55%, var(--sc-chat-accent-2));
  color: #fff;
  box-shadow: var(--sc-chat-shadow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
  animation: sc-chat-pop .55s cubic-bezier(.2,.9,.3,1.2) both, sc-chat-pulse 2.6s ease-in-out 1s infinite;
}

.sc-chat-fab:hover,
.sc-chat-fab:focus-visible {
  transform: translateY(-3px) scale(1.04);
  outline: none;
  box-shadow: 0 22px 56px rgba(8, 145, 178, 0.38);
}

.sc-chat-fab svg {
  width: 1.55rem;
  height: 1.55rem;
  display: block;
}

.sc-chat-fab__dot {
  position: absolute;
  top: .35rem;
  inset-inline-end: .35rem;
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  background: #f43f5e;
  box-shadow: 0 0 0 2px #fff;
  display: none;
}

.sc-chat-fab.has-unread .sc-chat-fab__dot {
  display: block;
}

.sc-chat-panel {
  position: fixed;
  z-index: 1081;
  inset-inline-start: 1rem;
  inset-block-end: 5.1rem;
  width: min(22.5rem, calc(100vw - 1.5rem));
  height: min(32rem, calc(100vh - 6.5rem));
  background: var(--sc-chat-panel);
  color: var(--sc-chat-ink);
  border-radius: 1.25rem;
  box-shadow: var(--sc-chat-shadow);
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(8, 145, 178, 0.18);
}

.sc-chat-panel.is-open {
  display: flex;
  animation: sc-chat-rise .28s ease-out;
}

.sc-chat-panel__head {
  padding: .9rem 1rem;
  background: linear-gradient(120deg, #0e7490, var(--sc-chat-accent) 50%, #06b6d4);
  color: #fff;
  display: flex;
  align-items: center;
  gap: .75rem;
}

.sc-chat-panel__avatar {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.sc-chat-panel__title {
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.25;
  margin: 0;
}

.sc-chat-panel__sub {
  margin: .15rem 0 0;
  font-size: .78rem;
  opacity: .9;
}

.sc-chat-panel__close {
  margin-inline-start: auto;
  border: 0;
  background: rgba(255,255,255,.16);
  color: #fff;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  cursor: pointer;
}

.sc-chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  padding: .65rem .75rem .25rem;
  background: var(--sc-chat-soft);
}

.sc-chat-chip {
  border: 1px solid rgba(8, 145, 178, 0.28);
  background: #fff;
  color: #0e7490;
  border-radius: 999px;
  padding: .28rem .7rem;
  font-size: .78rem;
  cursor: pointer;
  transition: background .15s ease;
}

.sc-chat-chip:hover {
  background: #cffafe;
}

.sc-chat-msgs {
  flex: 1;
  overflow-y: auto;
  padding: .85rem .85rem 0.4rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 40%);
}

.sc-chat-bubble {
  max-width: 88%;
  padding: .65rem .8rem;
  border-radius: 1rem;
  font-size: .88rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.sc-chat-bubble--bot,
.sc-chat-bubble--assistant {
  align-self: flex-start;
  background: #ecfeff;
  color: #134e4a;
  border-end-start-radius: .35rem;
}

.sc-chat-bubble--admin {
  align-self: flex-start;
  background: #e0f2fe;
  color: #0c4a6e;
  border-end-start-radius: .35rem;
}

.sc-chat-bubble--user {
  align-self: flex-end;
  background: linear-gradient(145deg, #0891b2, #0e7490);
  color: #fff;
  border-end-end-radius: .35rem;
}

.sc-chat-bubble__who {
  display: block;
  font-size: .68rem;
  opacity: .75;
  margin-bottom: .2rem;
}

.sc-chat-foot {
  padding: .65rem .75rem .85rem;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

.sc-chat-form {
  display: flex;
  gap: .45rem;
  align-items: flex-end;
}

.sc-chat-input {
  flex: 1;
  min-height: 2.5rem;
  max-height: 5.5rem;
  resize: none;
  border: 1px solid #cbd5e1;
  border-radius: .9rem;
  padding: .55rem .75rem;
  font: inherit;
  background: #f8fafc;
}

.sc-chat-input:focus {
  outline: 2px solid rgba(8, 145, 178, .35);
  border-color: var(--sc-chat-accent);
  background: #fff;
}

.sc-chat-send {
  border: 0;
  border-radius: .9rem;
  background: var(--sc-chat-accent);
  color: #fff;
  padding: .55rem .85rem;
  font-weight: 600;
  cursor: pointer;
}

.sc-chat-send:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.sc-chat-hint {
  margin: .45rem 0 0;
  font-size: .72rem;
  color: #64748b;
}

.sc-chat-hint a {
  color: var(--sc-chat-accent);
  font-weight: 600;
}

@keyframes sc-chat-pop {
  from { transform: scale(.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes sc-chat-pulse {
  0%, 100% { box-shadow: var(--sc-chat-shadow); }
  50% { box-shadow: 0 18px 50px rgba(34, 211, 238, 0.45); }
}

@keyframes sc-chat-rise {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 480px) {
  .sc-chat-panel {
    inset-inline-start: .5rem;
    inset-inline-end: .5rem;
    width: auto;
    inset-block-end: 4.8rem;
    height: min(70vh, 30rem);
  }
}
