/* Live chat — floating customer widget + staff console helpers */

:root {
  --lc-ink: #1a1f1c;
  --lc-paper: #f7f4ef;
  --lc-teal: #1f6f65;
  --lc-teal-deep: #145048;
  --lc-line: rgba(26, 31, 28, 0.12);
  --lc-staff: #2a4a6b;
  --lc-shadow: 0 18px 50px rgba(20, 30, 28, 0.28);
}

.lc-fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1200;
  width: 3.4rem;
  height: 3.4rem;
  border: 0;
  border-radius: 999px;
  background: var(--lc-teal);
  color: #fff;
  box-shadow: var(--lc-shadow);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.18s ease, background 0.18s ease;
}

.lc-fab:hover,
.lc-fab:focus-visible {
  background: var(--lc-teal-deep);
  transform: translateY(-2px) scale(1.03);
  outline: none;
}

.lc-fab[hidden] {
  display: none !important;
}

.lc-fab-badge {
  position: absolute;
  top: -0.15rem;
  right: -0.15rem;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: #b42318;
  color: #fff;
  font: 700 0.65rem/1.15rem Manrope, sans-serif;
}

.lc-fab svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: currentColor;
}

.lc-panel {
  position: fixed;
  right: 1.25rem;
  bottom: 5.1rem;
  z-index: 1200;
  width: min(22.5rem, calc(100vw - 1.5rem));
  height: min(32rem, calc(100vh - 7rem));
  display: flex;
  flex-direction: column;
  background: var(--lc-paper);
  color: var(--lc-ink);
  border: 1px solid var(--lc-line);
  border-radius: 1.1rem;
  box-shadow: var(--lc-shadow);
  overflow: hidden;
}

.lc-panel[hidden] {
  display: none !important;
}

.lc-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, #1f6f65, #163f3b);
  color: #fff;
}

.lc-panel-head h2 {
  margin: 0;
  font: 700 1rem/1.2 Syne, sans-serif;
  letter-spacing: 0.01em;
}

.lc-panel-head p {
  margin: 0.15rem 0 0;
  font: 500 0.72rem/1.3 Manrope, sans-serif;
  opacity: 0.85;
}

.lc-panel-close {
  border: 0;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.lc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background:
    radial-gradient(circle at 10% 0%, rgba(31, 111, 101, 0.08), transparent 40%),
    var(--lc-paper);
}

.lc-empty {
  margin: auto;
  text-align: center;
  color: rgba(26, 31, 28, 0.55);
  font: 500 0.85rem/1.4 Manrope, sans-serif;
  max-width: 16rem;
}

.lc-bubble {
  max-width: 85%;
  padding: 0.55rem 0.7rem;
  border-radius: 0.85rem;
  border: 1px solid var(--lc-line);
  background: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
}

.lc-bubble.is-me {
  align-self: flex-end;
  background: rgba(31, 111, 101, 0.12);
  border-color: rgba(31, 111, 101, 0.25);
}

.lc-bubble.is-them {
  align-self: flex-start;
}

.lc-bubble-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
  font: 600 0.65rem/1 Manrope, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(26, 31, 28, 0.5);
}

.lc-bubble-body {
  white-space: pre-wrap;
  word-break: break-word;
  font: 500 0.9rem/1.4 Manrope, sans-serif;
}

.lc-compose {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem;
  padding: 0.7rem;
  border-top: 1px solid var(--lc-line);
  background: #fff;
}

.lc-compose textarea {
  resize: none;
  min-height: 2.6rem;
  max-height: 6rem;
  border: 1px solid var(--lc-line);
  border-radius: 0.7rem;
  padding: 0.55rem 0.65rem;
  font: 500 0.9rem/1.35 Manrope, sans-serif;
  background: var(--lc-paper);
  color: var(--lc-ink);
}

.lc-compose button {
  border: 0;
  border-radius: 0.7rem;
  padding: 0 0.9rem;
  background: var(--lc-teal);
  color: #fff;
  font: 700 0.8rem/1 Manrope, sans-serif;
  cursor: pointer;
}

.lc-compose button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.lc-status {
  padding: 0.35rem 0.9rem 0.55rem;
  font: 500 0.72rem/1.3 Manrope, sans-serif;
  color: rgba(26, 31, 28, 0.55);
  background: #fff;
}

/* Staff live chat page */
.lc-staff {
  display: grid;
  grid-template-columns: minmax(16rem, 22rem) 1fr;
  gap: 1rem;
  min-height: 70vh;
}

.lc-staff-list,
.lc-staff-thread {
  background: rgba(247, 244, 239, 0.92);
  border: 1px solid var(--lc-line);
  border-radius: 1rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 28rem;
}

.lc-staff-list h2,
.lc-staff-thread-head {
  margin: 0;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--lc-line);
  font: 700 1rem/1.2 Syne, sans-serif;
}

.lc-conv-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
}

.lc-conv-item {
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--lc-line);
  background: transparent;
  padding: 0.85rem 1rem;
  cursor: pointer;
  color: inherit;
}

.lc-conv-item:hover,
.lc-conv-item.is-active {
  background: rgba(31, 111, 101, 0.1);
}

.lc-conv-item strong {
  display: block;
  font: 700 0.92rem/1.3 Manrope, sans-serif;
}

.lc-conv-item span {
  display: block;
  margin-top: 0.2rem;
  font: 500 0.75rem/1.3 Manrope, sans-serif;
  color: rgba(26, 31, 28, 0.55);
}

.lc-conv-item .lc-pill {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: #b42318;
  color: #fff;
  font: 700 0.65rem/1 Manrope, sans-serif;
}

.lc-staff-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--lc-line);
}

.lc-staff-actions .btn {
  font-size: 0.8rem;
}

@media (max-width: 840px) {
  .lc-staff {
    grid-template-columns: 1fr;
  }

  .lc-fab,
  .lc-panel {
    right: 0.75rem;
  }

  .lc-fab {
    bottom: 0.75rem;
  }

  .lc-panel {
    bottom: 4.5rem;
    height: min(70vh, 32rem);
  }
}
