/* Zibo embed — matches ChatbotWidget (homescoop-mobile) */
:root {
  --zibo-bg: #0a0a0a;
  --zibo-surface: #1a1a1a;
  --zibo-surface-elevated: #242424;
  --zibo-border: rgba(255, 255, 255, 0.08);
  --zibo-border-subtle: rgba(255, 255, 255, 0.04);
  --zibo-border-strong: rgba(255, 255, 255, 0.15);
  --zibo-text: #ffffff;
  --zibo-text-secondary: rgba(255, 255, 255, 0.7);
  --zibo-text-muted: rgba(255, 255, 255, 0.55);
  --zibo-success: #10b981;
  --zibo-user-bubble: #141414;
  --zibo-primary: #3b82f6;
  --zibo-fab-size: 56px;
  --zibo-panel-width: 426px;
  --zibo-panel-height: 480px;
  --zibo-fab-edge: 24px;
  --zibo-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#zibo-embed-root {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99990;
  font-family: var(--zibo-font);
}

#zibo-embed-root * {
  box-sizing: border-box;
}

#zibo-embed-root .zibo-backdrop,
#zibo-embed-root .zibo-fab,
#zibo-embed-root .zibo-panel {
  pointer-events: auto;
}

.zibo-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 99991;
  border: none;
  padding: 0;
  cursor: default;
}

.zibo-backdrop[hidden] {
  display: none !important;
}

.zibo-fab {
  position: fixed;
  right: var(--zibo-fab-edge);
  bottom: var(--zibo-fab-edge);
  width: var(--zibo-fab-size);
  height: var(--zibo-fab-size);
  border: none;
  border-radius: 50%;
  background: var(--zibo-success);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99994;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.zibo-fab:hover {
  transform: scale(0.96);
  opacity: 0.92;
}

.zibo-fab svg {
  width: 26px;
  height: 26px;
}

.zibo-panel {
  position: fixed;
  right: var(--zibo-fab-edge);
  bottom: calc(var(--zibo-fab-edge) + var(--zibo-fab-size) + 8px);
  width: min(var(--zibo-panel-width), calc(100vw - 48px));
  height: min(var(--zibo-panel-height), calc(100vh - 120px));
  background: var(--zibo-surface);
  border: 1px solid var(--zibo-border-strong);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  z-index: 99993;
}

.zibo-panel[hidden] {
  display: none !important;
}

.zibo-sheet-handle-row {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 8px 0 4px;
  background: var(--zibo-surface);
}

.zibo-sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--zibo-border-strong);
}

.zibo-panel-header-wrap {
  background: var(--zibo-surface);
  flex-shrink: 0;
}

.zibo-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--zibo-surface);
}

.zibo-panel-header-left {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
}

.zibo-home-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.zibo-header-logo {
  height: 32px;
  width: 150px;
  object-fit: contain;
  object-position: left center;
}

.zibo-panel-close {
  width: 44px;
  height: 44px;
  border-radius: 4px;
  background: transparent;
  border: none;
  color: var(--zibo-text-secondary);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.zibo-panel-close:hover {
  background: var(--zibo-surface-elevated);
  border: 1px solid var(--zibo-border);
}

.zibo-panel-header-divider {
  height: 1px;
  background: var(--zibo-surface-elevated);
  width: 100%;
}

.zibo-panel-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 16px 24px 8px;
  background: var(--zibo-surface-elevated);
}

.zibo-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 8px;
  padding-bottom: 16px;
  color-scheme: dark;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

.zibo-messages::-webkit-scrollbar {
  width: 8px;
  background: transparent;
}

.zibo-messages::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.22);
  border-radius: 100px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.zibo-msg {
  max-width: 90%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 15px;
  line-height: 20px;
  word-break: break-word;
}

.zibo-msg-bot {
  align-self: flex-start;
  background: var(--zibo-surface);
  color: var(--zibo-text);
  border: 1px solid var(--zibo-border-subtle);
}

.zibo-msg-user {
  align-self: flex-end;
  background: var(--zibo-user-bubble);
  color: var(--zibo-text);
}

.zibo-msg-bot p {
  margin: 4px 0;
}

.zibo-msg-bot p:first-child {
  margin-top: 0;
}

.zibo-msg-bot p:last-child {
  margin-bottom: 0;
}

.zibo-msg-bot strong {
  font-weight: 700;
}

.zibo-msg-bot a {
  color: var(--zibo-primary);
  font-weight: 700;
  text-decoration: underline;
}

.zibo-msg-thinking {
  display: flex;
  align-items: center;
  gap: 8px;
}

.zibo-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--zibo-text);
  border-radius: 50%;
  animation: zibo-spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes zibo-spin {
  to {
    transform: rotate(360deg);
  }
}

.zibo-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--zibo-border);
}

.zibo-chips:empty {
  display: none;
  padding: 0;
  border-top: none;
}

.zibo-chip {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 20px;
  background: var(--zibo-surface);
  border: 1px solid var(--zibo-border-subtle);
  color: var(--zibo-text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.zibo-chip:hover {
  background: var(--zibo-surface-elevated);
  border-color: var(--zibo-border);
}

.zibo-input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--zibo-border);
  margin-top: 16px;
}

.zibo-input-row.has-chips {
  margin-top: 0;
  border-top: none;
}

.zibo-input-wrap {
  flex: 1;
  min-height: 44px;
  position: relative;
  border-radius: 8px;
  border: 1px solid var(--zibo-border-subtle);
  background: var(--zibo-surface);
  overflow: hidden;
}

.zibo-input-placeholder {
  position: absolute;
  left: 16px;
  top: 11px;
  right: 16px;
  font-size: 15px;
  line-height: 20px;
  color: var(--zibo-text-muted);
  pointer-events: none;
}

.zibo-input-placeholder[hidden] {
  display: none;
}

.zibo-input {
  width: 100%;
  min-height: 44px;
  max-height: 82px;
  resize: none;
  border: none;
  background: transparent;
  color: var(--zibo-text);
  padding: 11px 16px;
  font: 400 15px/20px var(--zibo-font);
  outline: none;
  overflow-y: auto;
  color-scheme: dark;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.zibo-input::-webkit-scrollbar {
  width: 4px;
}

.zibo-input::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.18);
  border-radius: 100px;
}

.zibo-send {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--zibo-success);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.zibo-send:disabled {
  background: var(--zibo-border-subtle);
  opacity: 0.7;
  cursor: not-allowed;
  box-shadow: none;
}

.zibo-disclaimer {
  padding: 4px 0 0;
  font-size: 11px;
  line-height: 14px;
  color: var(--zibo-text-muted);
  text-align: center;
}

@media (max-width: 767px) {
  .zibo-panel {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: min(64vh, 520px);
    border-radius: 16px 16px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.18);
  }

  .zibo-sheet-handle-row {
    display: flex;
  }

  .zibo-fab {
    bottom: 16px;
    right: 16px;
  }

  .zibo-panel-body {
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }
}
