/* Bot helper widget (desktop + mobile) */

.bot-helper {
  position: fixed;
  left: 16px;
  bottom: 24px;
  z-index: 99990;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.bot-launcher {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 320px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-main);
  box-shadow: 0 10px 25px rgba(0,0,0,.10);
  cursor: pointer;
}

.bot-launcher__icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--color-primary) 15%, transparent);
  color: var(--color-primary);
  flex: none;
}

.bot-launcher__text {
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.2;
  text-align: left;
}

.bot-panel {
  position: absolute;
  left: 0;
  bottom: 56px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 120px);
  border-radius: 18px;
  border: 1px solid var(--color-border);
  background: var(--color-background);
  box-shadow: 0 25px 60px rgba(0,0,0,.18);
  overflow: hidden;
  display: none;
}

.bot-panel.is-open {
  display: flex;
  flex-direction: column;
}

.bot-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.bot-panel__title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bot-panel__titleIcon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--color-secondary) 15%, transparent);
  color: var(--color-secondary);
}

.bot-panel__titleText {
  font-weight: 900;
  font-size: 14px;
}

.bot-panel__subtitle {
  font-size: 11px;
  color: var(--color-text-sec);
}

.bot-panel__close {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: var(--color-background);
  color: var(--color-text-main);
  cursor: pointer;
}

.bot-panel__body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
}

.bot-quick {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.bot-chip {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-main);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.bot-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.bot-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-sec);
}

.bot-input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  background: var(--color-background);
  border-radius: 14px;
}

.bot-input i {
  color: var(--color-text-sec);
}

.bot-input input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--color-text-main);
  font-size: 13px;
  font-weight: 700;
}

.bot-hint {
  font-size: 11px;
  color: var(--color-text-sec);
}

.bot-results {
  flex: 1;
  overflow: auto;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: 14px;
  padding: 8px;
}

.bot-empty {
  padding: 18px;
  border-radius: 14px;
  background: var(--color-background);
  border: 1px dashed var(--color-border);
  text-align: center;
}

.bot-empty__icon {
  font-size: 24px;
  color: var(--color-primary);
}

.bot-empty__title {
  margin-top: 6px;
  font-weight: 900;
}

.bot-empty__text {
  margin-top: 2px;
  color: var(--color-text-sec);
  font-size: 12px;
}

.bot-result {
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 10px;
  display: flex;
  gap: 10px;
  cursor: pointer;
}

.bot-result + .bot-result { margin-top: 8px; }

.bot-result__img {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: none;
}

.bot-result__img img { width: 100%; height: 100%; object-fit: contain; background: #fff; }

.bot-result__content { min-width: 0; }

.bot-result__title {
  font-weight: 900;
  font-size: 13px;
  line-height: 1.2;
  margin-bottom: 4px;
  color: var(--color-text-main);
}

.bot-result__meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--color-text-sec);
  font-weight: 700;
}

.bot-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-sec);
}

.bot-badge--ok { color: #16a34a; border-color: rgba(22,163,74,.35); background: rgba(22,163,74,.08); }
.bot-badge--vip { color: #7c3aed; border-color: rgba(124,58,237,.35); background: rgba(124,58,237,.08); }

.bot-overlay {
  display: none;
}

/* Mobile: panel becomes full screen */
@media (max-width: 768px) {
  /* Keep the launcher above the mobile bottom navigation (h-16) */
  .bot-helper {
    left: auto;
    right: 14px;
    bottom: calc(env(safe-area-inset-bottom) + 88px);
    z-index: 99990;
  }

  /* Compact floating action button (doesn't block the menu) */
  .bot-launcher {
    width: 54px;
    height: 54px;
    padding: 0;
    border-radius: 999px;
    max-width: none;
    justify-content: center;
    gap: 0;
  }

  .bot-launcher__text { display: none; }

  .bot-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: 0;
    width: auto;
    height: auto;
    max-height: none;
    border-radius: 0;
    z-index: 99995;
  }

  .bot-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 99985;
    display: none;
    pointer-events: none;
  }

  .bot-overlay.is-open { display: block; pointer-events: auto; }
}
