.rbtai-root, .rbtai-root * { box-sizing: border-box; }
.rbtai-root { position: fixed; right: 18px; bottom: 18px; z-index: 99990; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; }

.rbtai-launcher {
  display: flex; align-items: center; gap: 8px;
  border: 0; cursor: pointer; border-radius: 26px; padding: 12px 18px 12px 14px;
  background: var(--rbtai-accent, #fb0204); color: #fff; font-size: 15px; font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,.22); transition: transform .15s ease, box-shadow .15s ease;
}
.rbtai-launcher:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,0,0,.28); }
.rbtai-launcher svg { display: block; }
.rbtai-root.rbtai-open .rbtai-launcher { transform: scale(.92); opacity: .0; pointer-events: none; }

.rbtai-panel {
  position: fixed; right: 18px; bottom: 18px; width: 380px; max-width: calc(100vw - 24px);
  height: 560px; max-height: calc(100vh - 36px);
  background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: 0 18px 48px rgba(0,0,0,.26);
  display: flex; flex-direction: column;
  opacity: 0; pointer-events: none; transform: translateY(14px);
  transition: opacity .18s ease, transform .18s ease;
}
.rbtai-root.rbtai-open .rbtai-panel { opacity: 1; pointer-events: auto; transform: translateY(0); }

.rbtai-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; background: var(--rbtai-accent, #fb0204); color: #fff; }
.rbtai-head-text { flex: 1; min-width: 0; }
.rbtai-title { font-size: 15px; font-weight: 700; }
.rbtai-sub { font-size: 12px; opacity: .85; }
.rbtai-op {
  border: 1px solid rgba(255,255,255,.65); background: transparent; color: #fff;
  border-radius: 8px; padding: 6px 10px; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.rbtai-op:hover { background: rgba(255,255,255,.14); }
.rbtai-close { border: 0; background: transparent; color: #fff; font-size: 22px; line-height: 1; cursor: pointer; padding: 2px 6px; }

.rbtai-msgs { flex: 1; overflow-y: auto; padding: 14px 12px 6px; background: #f6f7f9; }
.rbtai-row { display: flex; margin-bottom: 8px; }
.rbtai-row-bot { justify-content: flex-start; }
.rbtai-row-user { justify-content: flex-end; }
.rbtai-bubble { max-width: 86%; padding: 9px 12px; border-radius: 12px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.rbtai-bubble-bot { background: #fff; color: #1c1c1e; border: 1px solid #e6e8ee; border-bottom-left-radius: 4px; }
.rbtai-bubble-user { background: var(--rbtai-accent, #fb0204); color: #fff; border-bottom-right-radius: 4px; }

.rbtai-typing i { display: inline-block; width: 6px; height: 6px; margin: 0 2px; border-radius: 50%; background: #b9bfc9; animation: rbtai-blink 1.1s infinite; }
.rbtai-typing i:nth-child(2) { animation-delay: .18s; }
.rbtai-typing i:nth-child(3) { animation-delay: .36s; }
@keyframes rbtai-blink { 0%, 70%, 100% { opacity: .35; } 35% { opacity: 1; } }

.rbtai-sources { padding: 0 6px 8px; font-size: 12.5px; }
.rbtai-sources-t { color: #8a919c; margin: 4px 2px; }
.rbtai-source { display: block; color: #3b7ddd; text-decoration: none; margin: 2px 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rbtai-source:hover { text-decoration: underline; }

.rbtai-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px 4px; background: #f6f7f9; }
.rbtai-chip {
  border: 1px solid #d9dee7; background: #fff; color: #333; border-radius: 16px;
  padding: 5px 11px; font-size: 12.5px; cursor: pointer; text-align: left;
}
.rbtai-chip:hover { border-color: var(--rbtai-accent, #fb0204); color: var(--rbtai-accent, #fb0204); }

.rbtai-form { display: flex; align-items: flex-end; gap: 8px; padding: 8px 10px 10px; background: #f6f7f9; border-top: 1px solid #e9ebf0; }
.rbtai-photo-btn {
  width: 40px; height: 40px; flex: 0 0 40px; border: 1px solid #d9dee7; border-radius: 50%;
  background: #fff; color: #6b7280; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.rbtai-photo-btn:hover { color: var(--rbtai-accent, #fb0204); border-color: var(--rbtai-accent, #fb0204); }
.rbtai-photo-preview { position: relative; display: flex; padding: 8px 10px 0; background: #f6f7f9; }
.rbtai-photo-preview[hidden] { display: none; }
.rbtai-photo-preview img { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; border: 1px solid #d9dee7; }
.rbtai-photo-heic {
  width: 60px; height: 60px; flex: 0 0 60px; border: 1px dashed #c3c9d4; border-radius: 8px;
  background: #eef1f5; color: #6b7280; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; letter-spacing: .5px;
}
.rbtai-photo-heic[hidden] { display: none; }
.rbtai-photo-del {
  position: absolute; left: 55px; top: 2px; width: 22px; height: 22px; border: 0; border-radius: 50%;
  background: rgba(20,22,26,.72); color: #fff; font-size: 15px; line-height: 1; cursor: pointer; padding: 0;
}
.rbtai-bubble-img { display: block; max-width: 220px; max-height: 220px; border-radius: 8px; margin-bottom: 6px; }
.rbtai-bubble-text { white-space: pre-wrap; }
.rbtai-input {
  flex: 1; resize: none; border: 1px solid #d9dee7; border-radius: 10px; padding: 9px 11px;
  font-size: 14px; font-family: inherit; line-height: 1.35; max-height: 110px; outline: none; background: #fff;
}
.rbtai-input:focus { border-color: var(--rbtai-accent, #fb0204); }
.rbtai-send {
  width: 40px; height: 40px; flex: 0 0 40px; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--rbtai-accent, #fb0204); color: #fff; display: flex; align-items: center; justify-content: center;
}
.rbtai-send:disabled { opacity: .5; cursor: default; }

.rbtai-lead { position: absolute; inset: 0; background: rgba(20,22,26,.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.rbtai-lead[hidden] { display: none; }
.rbtai-lead-box { width: 100%; background: #fff; border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.rbtai-lead-title { font-size: 16px; font-weight: 700; }
.rbtai-lead-hint { font-size: 12.5px; color: #6b7280; }
.rbtai-lead-box input, .rbtai-lead-box textarea {
  border: 1px solid #d9dee7; border-radius: 10px; padding: 9px 11px; font-size: 14px; font-family: inherit; outline: none; resize: none;
}
.rbtai-lead-box input:focus, .rbtai-lead-box textarea:focus { border-color: var(--rbtai-accent, #fb0204); }
.rbtai-lead-row { display: flex; gap: 8px; margin-top: 2px; }
.rbtai-lead-send { flex: 1; border: 0; border-radius: 10px; background: var(--rbtai-accent, #fb0204); color: #fff; padding: 10px; font-size: 14px; font-weight: 600; cursor: pointer; }
.rbtai-lead-send:disabled { opacity: .5; }
.rbtai-lead-cancel { border: 1px solid #d9dee7; background: #fff; border-radius: 10px; padding: 10px 14px; font-size: 14px; cursor: pointer; }
.rbtai-lead-note { font-size: 11px; color: #9aa1ab; }
.rbtai-lead-status { font-size: 13px; color: #1d7a36; min-height: 16px; }

.rbtai-vpn, .rbtai-vpn * { box-sizing: border-box; }
.rbtai-vpn {
  position: fixed; inset: 0; z-index: 2147483000; display: flex; align-items: center; justify-content: center;
  padding: 18px; background: rgba(15,18,24,.64);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
.rbtai-vpn-card {
  width: 100%; max-width: 430px; background: #fff; border-radius: 16px; padding: 22px;
  box-shadow: 0 24px 70px rgba(0,0,0,.35); color: #1c1c1e;
}
.rbtai-vpn-icon {
  width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px; background: var(--rbtai-accent, #fb0204); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .8px;
}
.rbtai-vpn-title { font-size: 19px; font-weight: 700; line-height: 1.25; margin-bottom: 8px; }
.rbtai-vpn-text { font-size: 14px; line-height: 1.5; color: #5c6470; }
.rbtai-vpn-status { min-height: 18px; margin: 8px 0 2px; font-size: 13px; color: #a15c00; }
.rbtai-vpn-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.rbtai-vpn-primary {
  flex: 1 1 170px; border: 0; border-radius: 10px; padding: 11px 14px; cursor: pointer;
  background: var(--rbtai-accent, #fb0204); color: #fff; font-size: 14px; font-weight: 600;
}
.rbtai-vpn-primary:disabled { opacity: .55; cursor: default; }
.rbtai-vpn-secondary {
  flex: 1 1 170px; border: 1px solid #d9dee7; border-radius: 10px; padding: 11px 14px; cursor: pointer;
  background: #fff; color: #333; font-size: 14px;
}
.rbtai-vpn-secondary:disabled { opacity: .55; cursor: default; }
@media (max-width: 480px) {
  .rbtai-vpn { padding: 12px; align-items: flex-end; }
  .rbtai-vpn-card { padding: 18px; border-radius: 14px; }
}
@media (max-width: 480px) {
  .rbtai-panel { right: 0; bottom: 0; width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .rbtai-launcher-label { display: none; }
  .rbtai-launcher { padding: 14px; border-radius: 50%; }
}
