/* ─────────────────────────────────────────────────
   BroSharp — Widget & Embed Styles
   Swiss Style / International Typographic Style
   ───────────────────────────────────────────────── */

.bs-widget {
  font-family: 'Plus Jakarta Sans', 'Noto Sans SC', sans-serif;
  background: #ffffff;
  border: 1px solid #d0d0d0;
  border-top: 3px solid #CC0000;
  padding: 1.25rem 1.5rem;
  max-width: 520px;
  color: #0a0a0a;
  position: relative;
}

.bs-widget-header {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-bottom: .85rem;
  padding-bottom: .65rem;
  border-bottom: 1px solid #eaeaea;
}

.bs-avatar {
  font-size: 1.5rem;
  line-height: 1;
  display: inline-block;
}

.bs-brand {
  font-family: 'Plus Jakarta Sans', 'Noto Sans SC', sans-serif;
  font-size: .75rem;
  font-weight: 700;
  color: #0a0a0a;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.bs-widget-question {
  font-size: .82rem;
  color: #555555;
  margin-bottom: .75rem;
  padding: .5rem .75rem;
  background: #f4f4f4;
  border-left: 2px solid #CC0000;
  font-weight: 500;
}

.bs-widget-answer {
  font-size: .9375rem;
  line-height: 1.7;
  color: #0a0a0a;
  white-space: pre-wrap;
  word-break: break-word;
  font-weight: 400;
}

.bs-widget-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: .75rem;
  border-top: 1px solid #eaeaea;
  gap: .5rem;
  flex-wrap: wrap;
}

.bs-powered {
  font-size: .7rem;
  color: #909090;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.bs-powered a {
  color: #0a0a0a;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.bs-powered a:hover { color: #CC0000; }

.bs-share-btn {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: .25rem .65rem;
  background: transparent;
  border: 1px solid #0a0a0a;
  color: #0a0a0a;
  cursor: pointer;
  transition: background .15s, color .15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}
.bs-share-btn:hover {
  background: #0a0a0a;
  color: #ffffff;
}

/* Loading state */
.bs-widget-loading {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: #909090;
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  min-height: 60px;
}
.bs-dots { display: flex; gap: 4px; }
.bs-dots span {
  width: 5px; height: 5px;
  background: #CC0000;
  animation: bs-bounce 1.2s infinite ease-in-out;
}
.bs-dots span:nth-child(2) { animation-delay: .2s; }
.bs-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes bs-bounce {
  0%,80%,100% { transform: translateY(0); opacity: .3; }
  40%          { transform: translateY(-5px); opacity: 1; }
}

/* ── Widget page — embed code block ──────────────── */
.embed-block {
  background: #f4f4f4;
  border: 1px solid #d0d0d0;
  border-left: 2px solid #0a0a0a;
  padding: .85rem 1rem;
  font-family: monospace;
  font-size: .78rem;
  color: #555555;
  word-break: break-all;
  position: relative;
}

/* Widget page — live demo topic input */
#widgetTopicInput { font-family: 'Plus Jakarta Sans', 'Noto Sans SC', sans-serif; }

/* ── Conversation thread widget ──────────────── */

.bs-widget--conv {
  max-width: 560px;
}

.bs-conv-thread {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  max-height: 420px;
  overflow-y: auto;
  margin-bottom: .5rem;
  padding-right: .25rem;
  scroll-behavior: smooth;
}
/* Thin scrollbar */
.bs-conv-thread::-webkit-scrollbar { width: 3px; }
.bs-conv-thread::-webkit-scrollbar-track { background: transparent; }
.bs-conv-thread::-webkit-scrollbar-thumb { background: #d0d0d0; }

.bs-conv-q {
  font-size: .82rem;
  color: #555555;
  padding: .45rem .75rem;
  background: #f4f4f4;
  border-left: 2px solid #CC0000;
  font-weight: 500;
  line-height: 1.55;
  word-break: break-word;
}

.bs-conv-a {
  font-size: .9375rem;
  line-height: 1.7;
  color: #0a0a0a;
  white-space: pre-wrap;
  word-break: break-word;
}

.bs-conv-input {
  display: flex;
  gap: .5rem;
  align-items: flex-end;
  padding-top: .65rem;
  border-top: 1px solid #eaeaea;
  margin-bottom: .25rem;
}

.bs-conv-textarea {
  flex: 1;
  background: #ffffff;
  border: 1px solid #d0d0d0;
  color: #0a0a0a;
  padding: .45rem .75rem;
  font-size: .875rem;
  font-family: 'Plus Jakarta Sans', 'Noto Sans SC', sans-serif;
  resize: none;
  outline: none;
  min-height: 36px;
  max-height: 120px;
  overflow-y: auto;
  line-height: 1.5;
  transition: border-color .15s;
}
.bs-conv-textarea:focus    { border-color: #0a0a0a; }
.bs-conv-textarea:disabled { opacity: .45; cursor: not-allowed; }

.bs-conv-send {
  font-family: 'Plus Jakarta Sans', 'Noto Sans SC', sans-serif;
  background: #0a0a0a;
  color: #ffffff;
  border: 1px solid #0a0a0a;
  padding: .45rem .9rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  align-self: flex-end;
  transition: background .15s, border-color .15s;
  line-height: 1.5;
  min-height: 36px;
}
.bs-conv-send:hover    { background: #CC0000; border-color: #CC0000; }
.bs-conv-send:disabled { opacity: .45; cursor: not-allowed; background: #0a0a0a; border-color: #0a0a0a; }

/* Inline topic input */
.bs-input-row {
  display: flex;
  gap: .5rem;
  margin-bottom: .75rem;
}
.bs-input-row input {
  flex: 1;
  background: #ffffff;
  border: 1px solid #d0d0d0;
  color: #0a0a0a;
  padding: .5rem .85rem;
  font-size: .9rem;
  font-weight: 500;
  outline: none;
  font-family: 'Plus Jakarta Sans', 'Noto Sans SC', sans-serif;
  transition: border-color .15s;
}
.bs-input-row input:focus { border-color: #0a0a0a; }
.bs-input-row button {
  font-family: 'Plus Jakarta Sans', 'Noto Sans SC', sans-serif;
  background: #0a0a0a;
  color: #ffffff;
  border: 1px solid #0a0a0a;
  padding: .5rem 1rem;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.bs-input-row button:hover { background: #CC0000; border-color: #CC0000; }
