/* =========================================================
   Resale Rascals, floating "Message support" panel
   Shared across desktop (index.html) + mobile (Landing Mobile.html)
   Everything namespaced .rrc-* to avoid host-page collisions.
   No pulsing or glowing dots (owner, 2026-10-11); test/home-dots.test.js checks this file too.
   ========================================================= */

.rrc {
  --rrc-bg: #0c0a10;
  --rrc-bg-2: #15121c;
  --rrc-ink: #f4f1ea;
  --rrc-accent: #c5ff3d;
  --rrc-accent-2: #b14bff;
  --rrc-text-accent: #3dd7ff;   /* live-chat font accent, cyan, distinct from brand green + purple */
  --rrc-line: rgba(255,255,255,0.08);
  --rrc-line-2: rgba(255,255,255,0.14);
  --rrc-sans: Arial, -apple-system, BlinkMacSystemFont, sans-serif;
  --rrc-serif: Arial, sans-serif;
  --rrc-mono: Arial, 'Helvetica Neue', Helvetica, sans-serif;

  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90; /* under the mobile drawers (shell 200, marketing nav 101); hidden while they are open */
  font-family: var(--rrc-sans);
  -webkit-font-smoothing: antialiased;
}
.rrc, .rrc * { box-sizing: border-box; }
.rrc button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

body.rr-drawer-open .rrc, body.nav-open .rrc { visibility: hidden; }
.rrc-panel[aria-hidden="true"] { visibility: hidden; }

/* ============== LAUNCHER (the floating bubble) ============== */
/* Icon only: the dark bubble with a soft purple halo around the logo, no label. The button
   keeps its aria-label ("Message support") for screen readers. */
.rrc button.rrc-launcher {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  padding: 0;
  border-radius: 50%;
  background-color: #0a0a0f;
  background-image: none;
  border: 1px solid rgba(177,75,255,0.5);
  color: var(--rrc-ink);
  box-shadow: 0 14px 34px rgba(0,0,0,0.55),
              0 1px 0 rgba(255,255,255,0.14) inset,
              0 0 0 6px rgba(177,75,255,0.1),
              0 0 30px rgba(177,75,255,0.28);
  transition: transform 0.22s cubic-bezier(.2,.8,.3,1), box-shadow 0.25s;
  position: relative;
}
.rrc-launcher:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 44px rgba(0,0,0,0.5),
              0 0 0 6px rgba(177,75,255,0.08),
              0 0 34px rgba(177,75,255,0.26);
}
.rrc-launcher:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.rrc-launcher:active { transform: translateY(-1px) scale(0.98); }

.rrc-launcher-av {
  position: relative;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--rrc-bg);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.rrc-launcher-av img { width: 30px; height: 30px; border-radius: 50%; display: block; }

.rrc-launcher-copy { display: none; }
.rrc-launcher-copy .t {
  font-family: var(--rrc-serif);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: #fff;
}
.rrc-launcher-copy .s {
  font-family: var(--rrc-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rrc-text-accent);
  margin-top: 3px;
  display: flex; align-items: center; gap: 5px;
}

/* launcher hidden while panel is open */
.rrc.open .rrc-launcher {
  opacity: 0; transform: translateY(10px) scale(0.85); pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

/* ============== PANEL (the support window) ============== */
.rrc-panel {
  position: absolute;
  right: 0; bottom: 0;
  width: 380px;
  height: min(640px, calc(100vh - 96px));
  background: var(--rrc-bg);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 30px 70px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--rrc-ink);
  line-height: 1.5;
  transform-origin: bottom right;
  opacity: 0;
  transform: translateY(14px) scale(0.92);
  pointer-events: none;
  transition: opacity 0.26s ease, transform 0.32s cubic-bezier(.2,.85,.3,1);
}
.rrc.open .rrc-panel {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

/* ---------- header ---------- */
.rrc-head {
  background: linear-gradient(180deg, var(--rrc-bg-2) 0%, var(--rrc-bg) 100%);
  border-bottom: 1px solid var(--rrc-line);
  padding: 16px 14px 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 13px;
  flex-shrink: 0;
  position: relative;
}
.rrc-head::after {
  content: ''; position: absolute; bottom: -1px; left: 28px;
  width: 38px; height: 3px; background: var(--rrc-accent); border-radius: 0 0 3px 3px;
  box-shadow: 0 0 8px rgba(197,255,61,0.5);
}
.rrc-stack { display: flex; flex-shrink: 0; }
.rrc-stack img {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--rrc-bg); margin-left: -8px; background: #2a2436;
}
.rrc-stack img:first-child { margin-left: 0; }
.rrc-titles { flex: 1; min-width: 0; }
.rrc-titles h3 {
  font-size: 15px; font-weight: 600; letter-spacing: -0.01em; margin: 1px 0 4px;
  color: #fff; display: flex; align-items: center; gap: 6px;
}
.rrc-titles h3 .v {
  width: 13px; height: 13px; background: var(--rrc-accent); color: var(--rrc-bg);
  border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700;
}
.rrc-status {
  font-family: var(--rrc-mono); font-size: 9.5px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--rrc-text-accent);
  display: flex; align-items: center; gap: 6px;
}
.rrc-close {
  width: 30px; height: 30px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 7px; color: rgba(255,255,255,0.55);
  transition: all 0.15s;
}
.rrc-close:hover { background: rgba(255,255,255,0.07); color: #fff; }
.rrc-close svg { width: 16px; height: 16px; }

/* ---------- body / scroller ---------- */
.rrc-body {
  flex: 1; overflow-y: auto; padding: 20px 18px;
  display: flex; flex-direction: column; gap: 14px; scrollbar-width: none;
}
.rrc-body::-webkit-scrollbar { display: none; }

/* welcome */
.rrc-welcome { text-align: center; padding: 6px 4px 0; }
.rrc-welcome-avs { display: flex; justify-content: center; margin-bottom: 16px; }
.rrc-welcome-avs img {
  width: 54px; height: 54px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--rrc-bg); margin-left: -12px; box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.rrc-welcome-avs img:first-child { margin-left: 0; }
.rrc-welcome h2 {
  font-family: var(--rrc-serif); font-size: 22px; font-weight: 600;
  letter-spacing: -0.02em; margin: 0 0 8px; color: #fff; line-height: 1.15;
}
.rrc-welcome h2 em { font-style: italic; color: var(--rrc-text-accent); font-weight: 500; }
.rrc-welcome .p {
  font-size: 13px; color: rgba(255,255,255,0.65); line-height: 1.5;
  margin: 0 auto 16px; max-width: 280px;
}
.rrc-replytime {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--rrc-mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: rgba(255,255,255,0.45);
  padding: 6px 10px; background: rgba(255,255,255,0.03);
  border: 1px solid var(--rrc-line); border-radius: 2px;
}

.rrc-suggestions { display: flex; flex-direction: column; gap: 6px; margin-top: 22px; }
.rrc-suggestion {
  background: rgba(255,255,255,0.03); border: 1px solid var(--rrc-line);
  padding: 11px 14px; border-radius: 2px; color: rgba(255,255,255,0.9);
  font-size: 13px; text-align: left; transition: all 0.15s;
  display: flex; align-items: center; gap: 10px;
}
.rrc-suggestion:hover { background: rgba(197,255,61,0.06); border-color: rgba(197,255,61,0.3); }
.rrc-suggestion .ic {
  width: 22px; height: 22px; border-radius: 3px; background: rgba(197,255,61,0.1);
  color: var(--rrc-text-accent); display: flex; align-items: center; justify-content: center;
  font-size: 11px; flex-shrink: 0;
}
.rrc-suggestion .arr {
  margin-left: auto; font-family: var(--rrc-mono); font-size: 11px;
  color: rgba(255,255,255,0.35); transition: color 0.15s;
}
.rrc-suggestion:hover .arr { color: var(--rrc-text-accent); }

/* messages */
.rrc-divider {
  text-align: center; font-family: var(--rrc-mono); font-size: 9.5px;
  color: rgba(255,255,255,0.3); letter-spacing: 0.15em; text-transform: uppercase;
  margin: 2px 0; position: relative;
}
.rrc-divider span { background: var(--rrc-bg); padding: 0 10px; position: relative; z-index: 1; }
.rrc-divider::before {
  content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px;
  background: rgba(255,255,255,0.06); z-index: 0;
}
.rrc-msg { display: flex; gap: 8px; max-width: 88%; }
.rrc-msg.me { align-self: flex-end; flex-direction: row-reverse; }
.rrc-msg .av { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex-shrink: 0; margin-top: 2px; }
.rrc-msg .content { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rrc-msg .name { font-size: 11px; color: rgba(255,255,255,0.55); font-weight: 500; padding: 0 2px; }
.rrc-msg .bubble {
  padding: 9px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.45;
  letter-spacing: -0.005em; white-space: pre-wrap; word-wrap: break-word;
}
.rrc-msg.them .bubble { background: rgba(255,255,255,0.05); color: var(--rrc-ink); border-top-left-radius: 4px; }
.rrc-msg.me .bubble {
  background: linear-gradient(135deg, #b14bff, #8b3fe1); color: #fff;
  border-top-right-radius: 4px; box-shadow: 0 2px 8px rgba(177,75,255,0.25);
}
.rrc-msg .time {
  font-family: var(--rrc-mono); font-size: 9.5px; color: rgba(255,255,255,0.35);
  padding: 0 4px; display: flex; align-items: center; gap: 4px;
}
.rrc-msg.me .time { justify-content: flex-end; }
.rrc-msg .time .check { color: var(--rrc-text-accent); }

.rrc-system {
  text-align: center; font-family: var(--rrc-mono); font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.4);
  padding: 6px 12px; align-self: center; background: rgba(255,255,255,0.03); border-radius: 2px;
}

/* ---------- footer / input ---------- */
.rrc-disclaimer {
  padding: 8px 18px; font-size: 10.5px; color: rgba(255,255,255,0.35);
  text-align: center; border-top: 1px solid rgba(255,255,255,0.05); line-height: 1.4;
}
.rrc-disclaimer a { color: rgba(61,215,255,0.75); text-decoration: underline; text-underline-offset: 2px; }
.rrc-foot {
  padding: 12px 14px 14px; border-top: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0; background: var(--rrc-bg);
}
.rrc-input-row {
  display: flex; gap: 8px; align-items: center;
  background: rgba(255,255,255,0.04); border: 1px solid var(--rrc-line);
  border-radius: 3px; padding: 7px 8px 7px 14px; transition: border-color 0.15s, background 0.15s;
}
.rrc-input-row:focus-within { border-color: rgba(197,255,61,0.35); background: rgba(255,255,255,0.06); }
.rrc-input {
  flex: 1; background: none; border: 0; color: #fff; font: inherit;
  font-size: 13.5px; outline: none; padding: 2px 0; min-width: 0;
}
.rrc-input::placeholder { color: rgba(255,255,255,0.3); }
.rrc-send {
  background: var(--rrc-accent); color: var(--rrc-bg); border: 0;
  width: 32px; height: 32px; border-radius: 2px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; flex-shrink: 0;
}
.rrc-send:hover:not(:disabled) { box-shadow: 0 0 16px rgba(197,255,61,0.5); }
.rrc-send:disabled { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.3); cursor: not-allowed; }
.rrc-send svg { width: 14px; height: 14px; }

/* ============== MOBILE ============== */
@media (max-width: 520px) {
  /* the closed bubble is just the icon; the open panel spans the screen */
  .rrc { right: 14px; bottom: 14px; }
  .rrc.open { left: 14px; }
  .rrc-panel {
    right: 0; left: 0; bottom: 0;
    width: auto;
    height: min(620px, calc(100dvh - 24px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .rrc-launcher, .rrc-panel { transition: opacity 0.2s; }
}
