:root{
  --rw-a-accent:#101014;
  --rw-a-accent2:#0b0b0f;
  --rw-a-bg:#ffffff;
  --rw-a-soft:#f7f7f9;
  --rw-a-text:#101014;
  --rw-a-muted:#5b5b66;
  --rw-a-border:rgba(16,16,20,.12);
  --rw-a-shadow:0 18px 60px rgba(0,0,0,.18);
  --rw-a-radius:18px;
  --rw-a-font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

.rw-a-wrap{
  position:fixed !important;
  right:16px !important;
  bottom:calc(16px + env(safe-area-inset-bottom)) !important;
  z-index:2147483647 !important;
  font-family:var(--rw-a-font);
  pointer-events:auto;
}

/* Bubble */
.rw-a-bubble{
  height:56px;
  min-width:56px;
  padding:0 14px;
  border-radius:999px;
  border:1px solid var(--rw-a-border);
  background:linear-gradient(180deg, var(--rw-a-accent), var(--rw-a-accent2));
  color:#fff;
  box-shadow:var(--rw-a-shadow);
  cursor:pointer;
  display:flex;
  align-items:center;
  gap:10px;
  text-align:left;
  font-weight:800;
  letter-spacing:.2px;
  position:relative;
  -webkit-tap-highlight-color: transparent;
  touch-action:manipulation;
}
.rw-a-bubble .rw-a-bubble-icon{
  width:34px;height:34px;
  border-radius:999px;
  background:rgba(255,255,255,.18);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  line-height:1;
}
.rw-a-bubble .rw-a-bubble-text{ display:flex; flex-direction:column; line-height:1.05; }
.rw-a-bubble .rw-a-bubble-title{ font-size:14px; }
.rw-a-bubble .rw-a-bubble-sub{ font-size:12px; opacity:.92; font-weight:700; }

/* Nudge */
.rw-a-nudge{
  position:absolute;
  right:0;
  bottom:70px;
  width:min(280px, calc(100vw - 28px));
  background:var(--rw-a-bg);
  border:1px solid var(--rw-a-border);
  border-radius:16px;
  box-shadow:0 16px 50px rgba(0,0,0,.16);
  padding:12px;
  color:var(--rw-a-text);
  display:none;
}
.rw-a-nudge.open{ display:block; }
.rw-a-nudge::after{
  content:"";
  position:absolute;
  right:22px;
  bottom:-8px;
  width:16px;height:16px;
  background:var(--rw-a-bg);
  border-right:1px solid var(--rw-a-border);
  border-bottom:1px solid var(--rw-a-border);
  transform:rotate(45deg);
}
.rw-a-nudge-top{ display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.rw-a-nudge-title{ font-weight:900; font-size:13px; }
.rw-a-nudge-x{
  width:28px;height:28px;
  border-radius:10px;
  border:1px solid var(--rw-a-border);
  background:#fff;
  cursor:pointer;
  font-size:18px;
  line-height:24px;
  color:#222;
}
.rw-a-nudge-body{ margin-top:6px; font-size:13px; color:var(--rw-a-muted); line-height:1.25; }
.rw-a-nudge-cta{ margin-top:10px; display:flex; gap:8px; }
.rw-a-nudge-btn{
  flex:1;
  border-radius:12px;
  border:1px solid rgba(16,16,20,.18);
  background:rgba(16,16,20,.06);
  color:var(--rw-a-text);
  font-weight:900;
  padding:10px;
  cursor:pointer;
}
.rw-a-nudge-btn:hover{ background:rgba(16,16,20,.09); }

/* Panel */
.rw-a-panel{
  position:absolute;
  right:0;
  bottom:72px;
  width:min(420px, calc(100vw - 28px));
  height:min(620px, calc(100vh - 120px));
  background:var(--rw-a-bg);
  border:1px solid var(--rw-a-border);
  border-radius:var(--rw-a-radius);
  box-shadow:var(--rw-a-shadow);
  display:none;
  overflow:hidden;
}
.rw-a-panel.open{ display:flex; flex-direction:column; }

.rw-a-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:12px;
  background:var(--rw-a-soft);
  border-bottom:1px solid rgba(16,16,20,.08);
}
.rw-a-title{ color:var(--rw-a-text); font-weight:900; }
.rw-a-x{
  width:38px;height:38px;
  border-radius:12px;
  border:1px solid var(--rw-a-border);
  background:#fff;
  color:#222;
  cursor:pointer;
  font-size:20px;
  line-height:34px;
}

.rw-a-body{
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:10px;
  flex:1;
  min-height:0;
}
.rw-a-msgs{
  flex:1;
  min-height:0;
  overflow:auto;
  padding-right:4px;
}

.rw-a-m{ display:flex; margin:10px 0; }
.rw-a-m.user{ justify-content:flex-end; }
.rw-a-m.bot{ justify-content:flex-start; }

.rw-a-b{
  max-width:88%;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(16,16,20,.10);
  color:var(--rw-a-text);
  background:#fff;
  font-size:14px;
  line-height:1.35;
}
.rw-a-m.user .rw-a-b{
  background:rgba(16,16,20,.06);
  border-color:rgba(16,16,20,.16);
}
.rw-a-typing{ color:var(--rw-a-muted); }

.rw-a-cta{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.rw-a-primary{
  flex:1;
  text-align:center;
  font-weight:900;
  color:#fff;
  text-decoration:none;
  border-radius:12px;
  padding:10px 12px;
  background:linear-gradient(180deg, var(--rw-a-accent), var(--rw-a-accent2));
  border:1px solid rgba(0,0,0,.10);
}
.rw-a-reset{
  width:90px;
  border-radius:12px;
  padding:10px;
  border:1px solid var(--rw-a-border);
  background:#fff;
  color:#222;
  cursor:pointer;
}

.rw-a-foot{
  display:flex;
  gap:8px;
  padding:12px;
  border-top:1px solid rgba(16,16,20,.08);
  background:var(--rw-a-soft);
}
.rw-a-in{
  flex:1;
  height:40px;
  border-radius:12px;
  border:1px solid var(--rw-a-border);
  background:#fff;
  color:#111;
  padding:0 12px;
  outline:none;
}
.rw-a-send{
  width:92px;
  height:40px;
  border-radius:12px;
  border:1px solid rgba(0,0,0,.10);
  background:var(--rw-a-accent);
  color:#fff;
  cursor:pointer;
  font-weight:900;
}
.rw-a-send:disabled{ opacity:.6; cursor:not-allowed; }

/* HARD SAFETY: hide any legacy chips/links containers if they exist */
.rw-a-links,
.rw-a-link,
.rw-a-prompts,
.rw-a-suggestions{
  display:none !important;
}

@media (max-width: 520px){
  .rw-a-bubble{ padding:0 12px; }
  .rw-a-bubble .rw-a-bubble-sub{ display:none; }
  .rw-a-panel{
    width:calc(100vw - 24px);
    height:min(72vh, 640px);
    bottom:74px;
  }
}
