.rcc, .rcc * { box-sizing: border-box; }
.rcc {
  --rcc-c: #0E5A3C;
  --rcc-paper: #F6F7F4;
  --rcc-ink: #17211B;
  --rcc-muted: #5B6B62;
  --rcc-line: #DDE3DC;
  position: fixed;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 99999;
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--rcc-ink);
}
.rcc button { font: inherit; cursor: pointer; }
.rcc :focus-visible { outline: 3px solid #E0A526; outline-offset: 2px; }

.rcc-launcher {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 20px 13px 16px;
  border: 0; border-radius: 999px;
  background: var(--rcc-c); color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(14, 90, 60, .35);
}
.rcc-launcher svg { width: 22px; height: 22px; flex: none; }

.rcc-panel {
  position: absolute; right: 0; bottom: 64px;
  width: 360px; height: min(560px, calc(100dvh - 120px));
  display: flex; flex-direction: column;
  background: var(--rcc-paper);
  border: 1px solid var(--rcc-line); border-radius: 16px;
  box-shadow: 0 16px 48px rgba(23, 33, 27, .22);
  overflow: hidden;
}
.rcc-panel[hidden] { display: none; }

.rcc-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: var(--rcc-c); color: #fff;
}
.rcc-title { font-weight: 700; font-size: 16px; }
.rcc-close {
  width: 32px; height: 32px; border: 0; border-radius: 8px;
  background: transparent; color: #fff; font-size: 22px; line-height: 1;
}
.rcc-close:hover { background: rgba(255, 255, 255, .16); }

.rcc-log {
  flex: 1; overflow-y: auto; padding: 16px 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.rcc-msg { max-width: 86%; padding: 10px 13px; border-radius: 14px; word-wrap: break-word; overflow-wrap: anywhere; }
.rcc-msg p { margin: 0; }
.rcc-msg p + p { margin-top: 8px; }
.rcc-bot { align-self: flex-start; background: #fff; border: 1px solid var(--rcc-line); border-bottom-left-radius: 4px; }
.rcc-user { align-self: flex-end; background: var(--rcc-c); color: #fff; border-bottom-right-radius: 4px; }
.rcc-bot a { color: var(--rcc-c); text-decoration: underline; }

.rcc-typing { display: inline-flex; gap: 4px; padding: 13px 14px; }
.rcc-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--rcc-muted); animation: rcc-blink 1.2s infinite ease-in-out; }
.rcc-typing i:nth-child(2) { animation-delay: .15s; }
.rcc-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes rcc-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.rcc-staff { padding: 12px 14px; border-top: 1px solid var(--rcc-line); background: #fff; }
.rcc-staff[hidden] { display: none; }
.rcc-staff-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.rcc-staff-h { margin: 0; font-weight: 600; }
.rcc-staff-close {
  width: 26px; height: 26px; flex: none; line-height: 1;
  border: 0; border-radius: 8px; background: transparent;
  color: var(--rcc-muted); font-size: 19px;
}
.rcc-staff-close:hover { background: var(--rcc-paper); color: var(--rcc-ink); }
.rcc-staff-list { display: flex; flex-direction: column; gap: 6px; }
.rcc-staff a {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--rcc-c); color: var(--rcc-c);
  text-decoration: none; font-weight: 600;
}
.rcc-staff a svg { width: 18px; height: 18px; flex: none; }
.rcc-staff a:hover { background: var(--rcc-c); color: #fff; }

.rcc-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--rcc-line); background: #fff; }
.rcc-input {
  flex: 1; resize: none; max-height: 96px;
  padding: 10px 12px; border: 1px solid var(--rcc-line); border-radius: 12px;
  font: inherit; font-size: 16px; color: var(--rcc-ink); background: var(--rcc-paper);
}
.rcc-send {
  padding: 10px 16px; border: 0; border-radius: 12px;
  background: var(--rcc-c); color: #fff; font-weight: 600;
}
.rcc-send:disabled { opacity: .5; cursor: not-allowed; }

.rcc-foot { padding: 6px 12px 10px; background: #fff; text-align: center; }
.rcc-human {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: none; color: var(--rcc-muted);
  text-decoration: underline; font-size: 13px; padding: 4px;
}
.rcc-human svg { width: 15px; height: 15px; flex: none; }

@media (max-width: 480px) {
  .rcc { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .rcc-panel { position: fixed; left: 8px; right: 8px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .rcc-typing i { animation: none; opacity: .6; }
}
