:root {
  --sharbot-bg: #020617;
  --sharbot-surface: #0f172a;
  --sharbot-surface-soft: #111827;
  --sharbot-surface-elevated: #1e293b;
  --sharbot-text: #e5e7eb;
  --sharbot-muted: #94a3b8;
  --sharbot-line: rgba(148, 163, 184, 0.25);
  --sharbot-brand: #38bdf8;
  --sharbot-brand-strong: #0ea5e9;
  --sharbot-user: #1d4ed8;
  --sharbot-error: #fca5a5;
  --sharbot-shadow: 0 22px 50px rgba(2, 6, 23, 0.55);
}

.sharbot-launcher {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9998;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #0f172a 0%, #111827 100%);
  color: var(--sharbot-text);
  border: 1px solid rgba(56, 189, 248, 0.28);
  box-shadow: var(--sharbot-shadow);
  padding: 10px 14px 10px 10px;
  cursor: pointer;
  font: 600 14px/1.2 "Segoe UI", Arial, sans-serif;
}

.sharbot-launcher[hidden] {
  display: none;
}

.sharbot-launcher:hover,
.sharbot-launcher:focus-visible {
  background: linear-gradient(135deg, #111827 0%, #1e293b 100%);
  border-color: rgba(56, 189, 248, 0.5);
  transform: translateY(-1px);
}

.sharbot-launcher-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(circle at 30% 30%, rgba(56, 189, 248, 0.28), rgba(14, 165, 233, 0.12));
  border: 1px solid rgba(56, 189, 248, 0.28);
  font-weight: 700;
}

.sharbot-launcher-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sharbot-launcher-fallback {
  color: var(--sharbot-text);
}

.sharbot-window {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  width: min(360px, calc(100vw - 24px));
  height: min(520px, 80vh);
  max-width: 380px;
  max-height: 80vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(2, 6, 23, 0.98) 100%);
  color: var(--sharbot-text);
  border: 1px solid var(--sharbot-line);
  border-radius: 22px;
  box-shadow: var(--sharbot-shadow);
  overflow: hidden;
  font: 14px/1.5 "Segoe UI", Arial, sans-serif;
}

.sharbot-window[hidden] {
  display: none;
}

.sharbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.96) 0%, rgba(15, 23, 42, 0.96) 100%);
  border-bottom: 1px solid var(--sharbot-line);
}

.sharbot-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.sharbot-subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--sharbot-muted);
}

.sharbot-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sharbot-icon-button {
  border: 1px solid var(--sharbot-line);
  background: rgba(30, 41, 59, 0.92);
  color: var(--sharbot-text);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
}

.sharbot-icon-button:hover,
.sharbot-icon-button:focus-visible {
  border-color: var(--sharbot-brand);
  color: var(--sharbot-brand);
  background: rgba(15, 23, 42, 0.98);
}

.sharbot-messages {
  overflow-y: auto;
  padding: 14px;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.14), transparent 24%),
    radial-gradient(circle at top right, rgba(99, 102, 241, 0.12), transparent 22%),
    linear-gradient(180deg, #0b1120 0%, var(--sharbot-bg) 100%);
}

.sharbot-message {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.sharbot-turn {
  display: grid;
  gap: 0;
  scroll-margin-top: 12px;
}

.sharbot-message:last-child {
  margin-bottom: 0;
}

.sharbot-message.is-user {
  justify-items: end;
}

.sharbot-bubble {
  max-width: 100%;
  border-radius: 16px;
  padding: 12px 14px;
  border: 1px solid var(--sharbot-line);
  background: rgba(17, 24, 39, 0.96);
  word-break: break-word;
}

.sharbot-message.is-user .sharbot-bubble {
  background: linear-gradient(135deg, rgba(29, 78, 216, 0.95) 0%, rgba(30, 64, 175, 0.95) 100%);
  color: #eff6ff;
  border-color: rgba(96, 165, 250, 0.35);
}

.sharbot-message.is-assistant .sharbot-bubble {
  background: rgba(17, 24, 39, 0.94);
}

.sharbot-message p {
  margin: 0;
}

.sharbot-examples,
.sharbot-choice-list {
  display: grid;
  gap: 6px;
}

.sharbot-example-button {
  border: 0;
  background: transparent;
  color: var(--sharbot-brand);
  text-align: left;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.sharbot-example-button:hover,
.sharbot-example-button:focus-visible,
.sharbot-tool-link:hover,
.sharbot-tool-link:focus-visible,
.sharbot-text-link:hover,
.sharbot-text-link:focus-visible {
  text-decoration: underline;
  color: var(--sharbot-brand-strong);
}

.sharbot-example-button::before {
  content: "› ";
  color: var(--sharbot-muted);
}

.sharbot-section-title {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--sharbot-muted);
  font-weight: 600;
}

.sharbot-meta {
  display: grid;
  gap: 8px;
}

.sharbot-tool-link,
.sharbot-text-link {
  color: var(--sharbot-brand);
  text-decoration: none;
}

.sharbot-tool-list,
.sharbot-next-step {
  display: grid;
  gap: 4px;
}

.sharbot-choice-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  border: 1px solid var(--sharbot-line);
  background: rgba(30, 41, 59, 0.92);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  font: inherit;
  color: var(--sharbot-text);
  text-align: left;
}

.sharbot-choice-option:hover,
.sharbot-choice-option:focus-visible {
  border-color: var(--sharbot-brand);
  background: rgba(15, 23, 42, 0.98);
}

.sharbot-choice-option input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--sharbot-brand);
}

.sharbot-choice-option.is-disabled {
  opacity: 0.6;
  cursor: progress;
}

.sharbot-choice-back {
  border: 0;
  background: transparent;
  color: var(--sharbot-brand);
  padding: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.sharbot-composer {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--sharbot-line);
  background: rgba(15, 23, 42, 0.98);
}

.sharbot-status {
  min-height: 1.4em;
  margin: 0;
  font-size: 12px;
  color: var(--sharbot-muted);
}

.sharbot-status.is-error {
  color: var(--sharbot-error);
}

.sharbot-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}

.sharbot-input {
  width: 100%;
  min-height: 42px;
  max-height: 120px;
  resize: vertical;
  border: 1px solid var(--sharbot-line);
  border-radius: 14px;
  background: rgba(17, 24, 39, 0.96);
  padding: 11px 12px;
  font: inherit;
  color: var(--sharbot-text);
}

.sharbot-input::placeholder {
  color: var(--sharbot-muted);
}

.sharbot-input:focus {
  outline: 2px solid rgba(56, 189, 248, 0.24);
  border-color: var(--sharbot-brand);
}

.sharbot-send {
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #f8fafc;
  padding: 11px 14px;
  cursor: pointer;
  font: 600 14px/1 "Segoe UI", Arial, sans-serif;
}

.sharbot-send:hover,
.sharbot-send:focus-visible {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
}

.sharbot-send:disabled {
  opacity: 0.65;
  cursor: progress;
}

.sharbot-privacy {
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--sharbot-muted);
}

@media (max-width: 600px) {
  .sharbot-launcher,
  .sharbot-window {
    right: 12px;
    bottom: 12px;
  }

  .sharbot-window {
    width: calc(100vw - 24px);
    max-width: 380px;
    height: min(75vh, 520px);
    max-height: 75vh;
  }
}
