.rb-chat-screen {
  background: var(--rb-bg);
}

.rb-chat-floating-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px 14px 8px;
  background: transparent;
  z-index: 12;
}

.rb-chat-circle-btn {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--rb-border);
  background: var(--rb-surface);
  color: var(--rb-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--rb-shadow-sm);
}

.rb-chat-center-id {
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 0;
}

.rb-chat-avatar-center {
  position: relative;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.rb-online-dot {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--rb-green);
  border: 2px solid var(--rb-bg);
}

.rb-chat-name-pill {
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 700;
  padding: 2px 11px;
  border-radius: 999px;
  background: var(--rb-surface);
  border: 1px solid var(--rb-border);
  box-shadow: var(--rb-shadow-sm);
}

.rb-chat-right-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px 6px;
  border-radius: 999px;
  background: var(--rb-surface);
  border: 1px solid var(--rb-border);
  box-shadow: var(--rb-shadow-sm);
}

.rb-chat-pill-icon {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.rb-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 8px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rb-chat-date-divider {
  text-align: center;
  font-size: 11.5px;
  color: var(--rb-text-muted);
  margin: 4px 0 6px;
}

.rb-msg-row {
  display: flex;
  flex-direction: column;
  max-width: 84%;
}

.rb-msg-row.is-user {
  align-self: flex-end;
  align-items: flex-end;
}

.rb-msg-row.is-bot {
  align-self: flex-start;
  align-items: flex-start;
}

.rb-msg-sender-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--rb-text-sub);
  margin: 0 0 3px 6px;
}

.rb-msg-bubble {
  padding: 11px 14px;
  border-radius: 18px;
  font-size: 14.5px;
  line-height: 1.48;
  word-break: break-word;
}

.rb-msg-row.is-user .rb-msg-bubble {
  background: var(--rb-dark);
  color: var(--rb-bg);
  border-bottom-right-radius: 5px;
}

.rb-msg-row.is-bot .rb-msg-bubble {
  background: var(--rb-surface-muted);
  color: var(--rb-text);
  border-bottom-left-radius: 5px;
}

.rb-thinking-bar:not([hidden]) {
  margin: 0 14px 8px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--rb-surface);
  border: 1px solid var(--rb-border);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--rb-text-sub);
}

.rb-composer {
  flex-shrink: 0;
  padding: 0 12px calc(14px + env(safe-area-inset-bottom, 0px));
  background: transparent;
  z-index: 20;
}

.rb-composer-card {
  width: 100%;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid rgba(15, 20, 28, 0.085);
  border-radius: 26px;
  padding: 14px 14px 10px;
  box-shadow: 0 8px 28px -6px rgba(15, 20, 28, 0.08), 0 2px 6px rgba(15, 20, 28, 0.03);
  margin: 0;
  display: flex;
  flex-direction: column;
}

[data-theme="dark"] .rb-composer-card {
  background: rgba(19, 27, 46, 0.88);
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.rb-attach-row:not([hidden]) {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.rb-attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 8px;
  border-radius: 14px;
  background: var(--rb-bg);
  border: 1px solid var(--rb-border);
  font-size: 12px;
  font-weight: 600;
  color: var(--rb-text);
  max-width: 240px;
}

.rb-attach-badge {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--rb-surface-muted);
  color: var(--rb-text);
  font-size: 9.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rb-attach-thumb {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.rb-attach-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.rb-attach-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--rb-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rb-attach-sub {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--rb-text-muted);
}

.rb-attach-rm {
  border: 0;
  background: transparent;
  color: var(--rb-text-muted);
  cursor: pointer;
  font-size: 13px;
  padding: 2px 4px;
}

#inp-chat-message {
  width: 100%;
  min-height: 28px;
  border: 0;
  outline: none;
  background: transparent;
  resize: none;
  font-size: 17px;
  line-height: 1.45;
  color: var(--rb-text);
  max-height: 120px;
  padding: 2px 4px;
  margin: 0;
}

#inp-chat-message::placeholder {
  color: var(--rb-text-muted);
}

.rb-card-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.rb-row-spacer {
  flex: 1;
}

.rb-c-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--rb-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.rb-c-btn:hover,
.rb-c-btn:active {
  background: var(--rb-surface-muted);
  color: var(--rb-text);
}

.rb-c-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rb-send-plain {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--rb-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.18s ease, color 0.18s ease, transform 0.14s ease, opacity 0.18s ease;
}

.rb-send-plain.is-idle {
  opacity: 0.42;
  cursor: default;
}

.rb-send-plain.is-ready {
  background: var(--rb-text);
  color: var(--rb-bg);
  opacity: 1;
}

.rb-send-plain.is-ready:active {
  transform: scale(0.92);
}

.rb-sheet:not([hidden]) {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 540px;
  margin: 0 auto;
  background: var(--rb-bg);
  border-top: 1px solid var(--rb-border);
  border-radius: 24px 24px 0 0;
  padding: 16px 16px calc(22px + env(safe-area-inset-bottom, 0px));
  z-index: 130;
  box-shadow: var(--rb-shadow-md);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rb-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
}

.rb-sheet-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--rb-text);
}

.rb-sheet-x {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid var(--rb-border);
  background: var(--rb-surface);
  color: var(--rb-text);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.rb-sheet-x svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.3;
  stroke-linecap: round;
}

.rb-attach-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.rb-attach-card {
  background: var(--rb-surface);
  border: 1px solid var(--rb-border);
  border-radius: 16px;
  padding: 14px 8px 12px;
  min-height: 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--rb-text);
  box-shadow: var(--rb-shadow-sm);
  cursor: pointer;
  transition: transform 0.14s ease, background 0.14s ease;
}

.rb-attach-card:hover,
.rb-attach-card:active {
  background: var(--rb-surface-muted);
  transform: scale(0.97);
}

.rb-attach-orb {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--rb-bg);
  border: 1px solid var(--rb-border);
  color: var(--rb-text);
  display: grid;
  place-items: center;
}

.rb-attach-orb svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rb-profile-edit-pill {
  margin-top: 10px;
  border: 0;
  border-radius: 999px;
  background: #E5E7EB;
  color: #111827;
  font-size: 13.5px;
  font-weight: 600;
  padding: 7px 18px;
  cursor: pointer;
}

.rb-floating-popover {
  position: absolute;
  background: var(--rb-surface);
  border: 1px solid var(--rb-border);
  border-radius: 20px;
  padding: 8px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rb-floating-popover.is-top-menu {
  top: 62px;
  right: 18px;
  min-width: 220px;
}

.rb-popover-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  font-size: 15px;
  font-weight: 500;
  color: var(--rb-text);
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.rb-popover-item:hover,
.rb-popover-item:active {
  background: var(--rb-surface-muted);
}

.rb-thinking-text {
  flex: 1;
  min-width: 0;
}

.rb-voice-mic-icon {
  display: block;
}
