.bot-helper {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 45;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.bot-launcher {
  position: relative;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgb(var(--color-border-rgb));
  background: rgb(var(--color-surface-rgb));
  color: rgb(var(--color-text-main-rgb));
  box-shadow: var(--shadow-e3);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-standard), box-shadow var(--dur-base) var(--ease-standard), transform var(--dur-fast) var(--ease-standard);
}

.bot-launcher:active {
  transform: scale(.94);
}

.bot-launcher[aria-expanded="true"] {
  border-color: rgb(var(--color-primary-rgb) / .5);
}

.bot-launcher__icon {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgb(var(--color-primary-soft-rgb));
  color: rgb(var(--color-primary-soft-ink-rgb));
  font-size: 20px;
}

.bot-launcher__text {
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgb(var(--color-text-main-rgb));
  color: rgb(var(--color-background-rgb));
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(6px, -50%);
  transition: opacity var(--dur-fast) var(--ease-standard), transform var(--dur-fast) var(--ease-standard);
}

.bot-launcher:focus-visible .bot-launcher__text {
  opacity: 1;
  transform: translate(0, -50%);
}

@media (hover: hover) {
  .bot-launcher:hover {
    border-color: rgb(var(--color-primary-rgb) / .5);
    box-shadow: var(--shadow-e4);
    transform: translateY(-2px);
  }

  .bot-launcher:hover .bot-launcher__text {
    opacity: 1;
    transform: translate(0, -50%);
  }

  .bot-menu__item:hover {
    border-color: rgb(var(--color-primary-rgb) / .45);
    color: rgb(var(--color-primary-ink-rgb));
    transform: translateY(-1px);
  }

  .bot-result:hover {
    border-color: rgb(var(--color-primary-rgb) / .45);
  }
}

.bot-panel {
  position: absolute;
  right: 0;
  bottom: 64px;
  width: 380px;
  max-width: calc(100vw - 48px);
  height: 580px;
  max-height: calc(100vh - 140px);
  border-radius: var(--radius-sheet, 28px);
  border: 1px solid rgb(var(--color-border-rgb));
  background: rgb(var(--color-background-rgb));
  box-shadow: var(--shadow-e4);
  overflow: hidden;
  display: none;
  transform-origin: bottom right;
}

.bot-panel.is-open {
  display: flex;
  flex-direction: column;
  animation: bot-panel-in var(--dur-base) var(--ease-enter) both;
}

@keyframes bot-panel-in {
  from { opacity: 0; transform: translateY(8px) scale(.97); }
  to { opacity: 1; transform: none; }
}

.bot-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px 12px 16px;
  background: rgb(var(--color-surface-rgb));
  border-bottom: 1px solid rgb(var(--color-border-rgb));
  flex: none;
}

.bot-panel__title { display: flex; align-items: center; gap: 12px; }

.bot-panel__titleIcon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgb(var(--color-primary-soft-rgb));
  color: rgb(var(--color-primary-soft-ink-rgb));
  font-size: 20px;
}

.bot-panel__titleText {
  font-family: "Plus Jakarta Sans", "Inter", ui-sans-serif, system-ui, sans-serif;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -.01em;
  color: rgb(var(--color-text-main-rgb));
}

.bot-panel__subtitle { font-size: 12px; color: rgb(var(--color-text-sec-rgb)); }

.bot-panel__close {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: rgb(var(--color-text-main-rgb));
  font-size: 20px;
  cursor: pointer;
  flex: none;
  transition: background-color var(--dur-fast) var(--ease-standard), transform var(--dur-fast) var(--ease-standard);
}

.bot-panel__close:hover { background: rgb(var(--color-surface-2-rgb)); }
.bot-panel__close:active { transform: scale(.92); }

.bot-panel__body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.bot-menu { display: flex; flex-direction: column; gap: 16px; }

.bot-menu__group { display: flex; flex-direction: column; gap: 8px; }

.bot-menu__group:empty { display: none; }

.bot-menu__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgb(var(--color-text-sec-rgb));
}

.bot-menu__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.bot-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 48px;
  padding: 6px 10px;
  border-radius: 14px;
  border: 1px solid rgb(var(--color-border-rgb));
  background: rgb(var(--color-surface-rgb));
  color: rgb(var(--color-text-main-rgb));
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: border-color var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard), transform var(--dur-fast) var(--ease-standard);
}

.bot-menu__item:active { transform: scale(.97); }

.bot-menu__icon {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgb(var(--color-primary-soft-rgb));
  color: rgb(var(--color-primary-soft-ink-rgb));
  font-size: 16px;
}

.bot-menu__item--tg .bot-menu__icon { background: rgb(var(--color-info-soft-rgb)); color: rgb(var(--color-info-ink-rgb)); }

.bot-menu__item--install {
  border-color: rgb(var(--color-primary-rgb) / .45);
  color: rgb(var(--color-primary-ink-rgb));
  font-weight: 700;
}

.bot-search {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px dashed rgb(var(--color-border-rgb));
}

.bot-input {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgb(var(--color-border-strong-rgb) / .5);
  background: rgb(var(--color-surface-rgb));
  border-radius: 14px;
  transition: border-color var(--dur-fast) var(--ease-standard), box-shadow var(--dur-fast) var(--ease-standard);
}

.bot-input:focus-within {
  border-color: rgb(var(--color-primary-rgb));
  box-shadow: 0 0 0 4px rgb(var(--color-primary-rgb) / .15);
}

.bot-input i { color: rgb(var(--color-text-sec-rgb)); font-size: 18px; }

.bot-input input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: rgb(var(--color-text-main-rgb));
  font-size: 16px;
  font-weight: 500;
}

.bot-input input:focus-visible { outline: none; }

.bot-filters { display: flex; gap: 8px; flex-wrap: wrap; }

.bot-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgb(var(--color-border-rgb));
  background: rgb(var(--color-surface-rgb));
  font-size: 13px;
  font-weight: 600;
  color: rgb(var(--color-text-sec-rgb));
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard), border-color var(--dur-fast) var(--ease-standard);
}

.bot-check:has(input:checked) {
  background: rgb(var(--color-primary-soft-rgb));
  border-color: rgb(var(--color-primary-rgb) / .4);
  color: rgb(var(--color-primary-soft-ink-rgb));
}

.bot-check input { width: 16px; height: 16px; accent-color: rgb(var(--color-primary-rgb)); }

.bot-hint { font-size: 12px; color: rgb(var(--color-text-sec-rgb)); }

.bot-results {
  min-height: 120px;
  border: 1px solid rgb(var(--color-border-rgb));
  background: rgb(var(--color-surface-rgb));
  border-radius: 16px;
  padding: 8px;
}

.bot-empty {
  padding: 18px;
  border-radius: 12px;
  background: rgb(var(--color-background-rgb));
  border: 1px dashed rgb(var(--color-border-rgb));
  text-align: center;
}

.bot-empty__icon { font-size: 24px; color: rgb(var(--color-primary-ink-rgb)); }
.bot-empty__title { margin-top: 6px; font-weight: 700; font-size: 14px; color: rgb(var(--color-text-main-rgb)); }
.bot-empty__text { margin-top: 2px; color: rgb(var(--color-text-sec-rgb)); font-size: 13px; }

.bot-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 0;
  background: rgb(var(--color-primary-rgb));
  color: rgb(var(--color-primary-contrast-rgb));
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.bot-result {
  background: rgb(var(--color-background-rgb));
  border: 1px solid rgb(var(--color-border-rgb));
  border-radius: 14px;
  padding: 10px;
  display: flex;
  gap: 12px;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-standard), transform var(--dur-fast) var(--ease-standard);
}

.bot-result:active { transform: scale(.98); }
.bot-result + .bot-result { margin-top: 8px; }

.bot-result__img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgb(var(--color-border-rgb));
  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: 700;
  font-size: 14px;
  line-height: 1.3;
  margin-bottom: 6px;
  color: rgb(var(--color-text-main-rgb));
}

.bot-result__meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
  color: rgb(var(--color-text-sec-rgb));
  font-weight: 600;
}

.bot-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgb(var(--color-surface-2-rgb));
  color: rgb(var(--color-text-sec-rgb));
}

.bot-badge--ok { background: rgb(var(--color-success-soft-rgb)); color: rgb(var(--color-success-ink-rgb)); }
.bot-badge--vip { background: rgb(var(--color-secondary-soft-rgb)); color: rgb(var(--color-secondary-soft-ink-rgb)); }

.bot-overlay { display: none; }

.bot-helper :focus-visible {
  outline: 2px solid rgb(var(--color-ring-rgb));
  outline-offset: 2px;
}

@media (max-width: 768px) {
  .bot-helper {
    position: static;
    z-index: auto;
  }

  .bot-launcher {
    display: none;
  }

  .bot-panel {
    position: fixed;
    inset: 0;
    width: auto;
    max-width: none;
    height: auto;
    max-height: none;
    border: 0;
    border-radius: 0;
    z-index: 320;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .bot-panel.is-open {
    animation-name: bot-panel-sheet;
    animation-duration: var(--dur-slow);
  }

  @keyframes bot-panel-sheet {
    from { transform: translateY(24px); opacity: 0; }
    to { transform: none; opacity: 1; }
  }

  .bot-overlay {
    position: fixed;
    inset: 0;
    background: rgb(var(--color-scrim-rgb) / var(--scrim-alpha, .48));
    z-index: 310;
    display: none;
    pointer-events: none;
  }

  .bot-overlay.is-open { display: block; pointer-events: auto; }
}

@media (min-width: 420px) and (max-width: 768px) {
  .bot-menu__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .bot-launcher, .bot-menu__item, .bot-result, .bot-launcher__text { transition: none; }
  .bot-panel.is-open { animation: none; }
  .bot-launcher:hover, .bot-menu__item:hover { transform: none; }
}
