.plc-chat-widget {
  --chat-green: #285902;
  --chat-dark: #11140f;
  --chat-ink: #1b2118;
  --chat-muted: #687061;
  --chat-soft: #f7f6f3;
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9999;
  font-family: Arial, Helvetica, sans-serif;
}
.plc-chat-toggle {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 999px;
  background: var(--chat-green);
  color: #fff;
  padding: 0 18px;
  box-shadow: 0 14px 40px rgba(0,0,0,.22);
  font-weight: 900;
  cursor: pointer;
}
.plc-chat-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #c9f29d;
}
.plc-chat-panel {
  position: absolute;
  right: 0;
  bottom: 62px;
  width: min(380px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid #dde0d7;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(0,0,0,.24);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .18s ease, transform .18s ease;
}
.plc-chat-widget[data-open="true"] .plc-chat-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.plc-chat-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: var(--chat-dark);
  color: #fff;
  padding: 16px 18px;
}
.plc-chat-panel header strong,
.plc-chat-panel header span {
  display: block;
}
.plc-chat-panel header span {
  margin-top: 4px;
  color: #dce0d8;
  font-size: 12px;
}
.plc-chat-close {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255,255,255,.36);
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.plc-chat-messages {
  height: 330px;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  background: var(--chat-soft);
  padding: 16px;
}
.plc-chat-message {
  max-width: 84%;
  border-radius: 8px;
  background: #fff;
  color: var(--chat-ink);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
}
.plc-chat-message[data-sender="customer"] {
  justify-self: end;
  background: var(--chat-green);
  color: #fff;
}
.plc-chat-message[data-sender="admin"],
.plc-chat-message[data-sender="ai"] {
  justify-self: start;
}
.plc-chat-message[data-sender="system"] {
  max-width: 100%;
  justify-self: center;
  background: transparent;
  color: var(--chat-muted);
  text-align: center;
  font-size: 12px;
}
.plc-chat-time {
  display: block;
  margin-top: 5px;
  opacity: .68;
  font-size: 10px;
}
.plc-chat-form {
  display: grid;
  grid-template-columns: 1fr 78px;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid #e2e1dc;
  background: #fff;
}
.plc-chat-form textarea {
  width: 100%;
  height: 44px;
  max-height: 110px;
  resize: vertical;
  border: 1px solid #d8d4cc;
  border-radius: 4px;
  padding: 10px;
  color: var(--chat-ink);
  font: inherit;
  font-size: 13px;
}
.plc-chat-form button,
.plc-chat-login a {
  border: 0;
  border-radius: 4px;
  background: var(--chat-green);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}
.plc-chat-status {
  min-height: 18px;
  margin: 0;
  padding: 0 14px 12px;
  color: var(--chat-muted);
  font-size: 12px;
}
.plc-chat-login {
  padding: 24px;
  background: var(--chat-soft);
}
.plc-chat-login h3 {
  margin: 0 0 8px;
  color: var(--chat-ink);
  font-size: 24px;
  line-height: 1.05;
}
.plc-chat-login p {
  margin: 0 0 18px;
  color: var(--chat-muted);
  line-height: 1.45;
}
.plc-chat-login a {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  text-decoration: none;
}
.plc-chat-login a.secondary {
  border: 2px solid var(--chat-green);
  background: #fff;
  color: var(--chat-green);
}
@media (max-width: 760px) {
  .plc-chat-widget {
    right: 14px;
    bottom: max(92px, env(safe-area-inset-bottom));
  }
  .plc-chat-toggle {
    width: auto;
    min-height: 46px;
    justify-content: center;
    padding: 0 18px;
    gap: 0;
    font-size: 13px;
    border-radius: 999px;
    letter-spacing: .01em;
    box-shadow: 0 12px 30px rgba(12,38,0,.26);
  }
  .plc-chat-dot {
    display: none;
  }
  .plc-chat-dot::before {
    content: "";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 14px;
    font-weight: 900;
  }
  .plc-chat-toggle span:not(.plc-chat-dot) {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: nowrap;
  }
  .plc-chat-panel {
    width: calc(100vw - 28px);
    bottom: 56px;
    max-height: calc(100vh - 170px);
  }
  .plc-chat-messages {
    height: min(330px, calc(100vh - 280px));
  }
}

