/* Biziz Destek Botu + canlı sohbet */
#sb-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #c62828;
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 12px 18px;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
}
#sb-toggle:hover { transform: translateY(-2px); }
#sb-toggle i { font-size: 22px; }

#sb-panel {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 360px;
  max-width: calc(100vw - 24px);
  height: 520px;
  max-height: calc(100vh - 110px);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 2147483001;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
#sb-panel.open { display: flex; }
#sb-panel.sb-live-mode {
  height: min(640px, calc(100vh - 90px));
}

.sb-head {
  background: #c62828;
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.sb-head-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.sb-head strong { font-size: 15px; }
.sb-head button {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}
.sb-back-bot {
  font-size: 18px !important;
  padding: 0 4px;
  opacity: 0.95;
}
.sb-back-bot[hidden] { display: none !important; }

#sb-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: #f5f5f5;
}

.sb-row { display: flex; margin-bottom: 12px; }
.sb-row.bot { justify-content: flex-start; }
.sb-row.user { justify-content: flex-end; }
.sb-row.system { justify-content: center; }
.sb-bubble {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}
.sb-row.bot .sb-bubble {
  background: #c62828;
  color: #fff;
  border-bottom-left-radius: 4px;
}
.sb-row.user .sb-bubble {
  background: #e8e8e8;
  color: #222;
  border-bottom-right-radius: 4px;
}
.sb-system {
  font-size: 12px;
  color: #666;
  background: #eee;
  padding: 6px 10px;
  border-radius: 8px;
  max-width: 95%;
  text-align: center;
  line-height: 1.4;
}
.sb-name {
  font-size: 11px;
  opacity: 0.9;
  margin-bottom: 6px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.sb-name-live {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  text-transform: none;
  letter-spacing: 0.01em;
  margin-bottom: 8px;
  opacity: 1;
}
.sb-row.bot .sb-name-live {
  background: rgba(255,255,255,0.22);
  color: #fff;
}
.sb-row.user .sb-name-live {
  background: rgba(198,40,40,0.12);
  color: #b71c1c;
}
.sb-bubble-text {
  white-space: pre-wrap;
}

.sb-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.sb-btn {
  background: #fff;
  border: 1.5px solid #c62828;
  color: #c62828;
  border-radius: 8px;
  padding: 9px 12px;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}
.sb-btn:hover { background: #ffebee; }

.sb-hint {
  font-size: 12px;
  font-weight: 600;
  color: #c62828;
  text-align: center;
  padding: 8px 12px;
  margin: 0;
  background: #ffebee;
  border-top: 1px solid #ffcdd2;
  letter-spacing: 0.01em;
}
.sb-foot {
  border-top: 1px solid #e0e0e0;
  padding: 10px;
  display: flex;
  gap: 8px;
  background: #fff;
  flex-shrink: 0;
}
.sb-foot-locked {
  background: #f7f7f7;
}
#sb-input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  outline: none;
}
#sb-input:disabled {
  background: #eee;
  color: #999;
  cursor: not-allowed;
  border-color: #e0e0e0;
}
#sb-send {
  background: #c62828;
  color: #fff;
  border: none;
  border-radius: 8px;
  width: 44px;
  cursor: pointer;
}
#sb-send:disabled {
  background: #ef9a9a;
  cursor: not-allowed;
  opacity: 0.75;
}
#sb-panel.sb-live-mode .sb-hint:not([hidden]) {
  background: #fff3e0;
  color: #e65100;
  border-top-color: #ffe0b2;
}

@media (max-width: 480px) {
  #sb-panel {
    right: 8px;
    left: 8px;
    width: auto;
    bottom: 76px;
  }
  #sb-toggle span { display: none; }
  #sb-toggle { padding: 14px; border-radius: 50%; }
}
