/* smit-suggest — живые подсказки в поле поиска.
   Выпадашка живёт в body (position: fixed), поэтому её не режут
   overflow-контейнеры тулбаров. Тёмная тема — оба селектора
   (Bootstrap 5.3 [data-bs-theme] и legacy .dark-theme). */

.smit-sg {
  position: fixed;
  z-index: 3050;                 /* выше выпадашки multisearch (3000) */
  display: none;
  overflow-y: auto;
  padding: 4px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .18);
  -webkit-overflow-scrolling: touch;
}
.smit-sg.show { display: block; }

.smit-sg-item {
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: #334155;
  line-height: 1.25;
}
.smit-sg-item + .smit-sg-item { margin-top: 1px; }
.smit-sg-item:hover,
.smit-sg-item.is-active { background: #eef4f1; }

.smit-sg-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.smit-sg-name {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 600;
  font-size: .86rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.smit-sg-bal {
  flex: 0 0 auto;
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
  color: #15803d;
}
.smit-sg-bal.neg { color: #dc2626; }

.smit-sg-addr {
  margin-top: 2px;
  font-size: .76rem;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.smit-sg-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 4px;
}
.smit-sg-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .74rem;
  color: #64748b;
}
.smit-sg-chip i { font-size: .68rem; opacity: .75; }

.smit-sg-badge {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 600;
  vertical-align: middle;
}
.smit-sg-badge.off { background: #fee2e2; color: #b91c1c; }

.smit-sg mark {
  padding: 0;
  background: #fde68a;
  color: inherit;
  border-radius: 2px;
}

.smit-sg-more {
  margin-top: 2px;
  padding: 8px 10px;
  border-top: 1px solid #eef2f6;
  border-radius: 0 0 8px 8px;
  font-size: .78rem;
  font-weight: 600;
  color: #15803d;
  cursor: pointer;
}
.smit-sg-more:hover { background: #eef4f1; }
.smit-sg-more i { font-size: .7rem; }

.smit-sg-state {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 10px;
  font-size: .8rem;
  color: #64748b;
}

.smit-sg-spin {
  width: 13px;
  height: 13px;
  border: 2px solid #cbd5e1;
  border-top-color: #15803d;
  border-radius: 50%;
  animation: smit-sg-rot .7s linear infinite;
}
@keyframes smit-sg-rot { to { transform: rotate(360deg); } }

/* ---------- тёмная тема ---------- */
[data-bs-theme="dark"] .smit-sg,
.dark-theme .smit-sg {
  background: #1b1f24;
  border-color: #2d333b;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .5);
}
[data-bs-theme="dark"] .smit-sg-item,
.dark-theme .smit-sg-item { color: #cbd5e1; }
[data-bs-theme="dark"] .smit-sg-item:hover,
[data-bs-theme="dark"] .smit-sg-item.is-active,
.dark-theme .smit-sg-item:hover,
.dark-theme .smit-sg-item.is-active { background: #23272d; }
[data-bs-theme="dark"] .smit-sg-addr,
[data-bs-theme="dark"] .smit-sg-chip,
[data-bs-theme="dark"] .smit-sg-state,
.dark-theme .smit-sg-addr,
.dark-theme .smit-sg-chip,
.dark-theme .smit-sg-state { color: #94a3b8; }
[data-bs-theme="dark"] .smit-sg-bal,
.dark-theme .smit-sg-bal { color: #4ade80; }
[data-bs-theme="dark"] .smit-sg-bal.neg,
.dark-theme .smit-sg-bal.neg { color: #f87171; }
[data-bs-theme="dark"] .smit-sg mark,
.dark-theme .smit-sg mark { background: #78500a; color: #fde68a; }
[data-bs-theme="dark"] .smit-sg-more,
.dark-theme .smit-sg-more { border-top-color: #2d333b; color: #6ee7b7; }
[data-bs-theme="dark"] .smit-sg-more:hover,
.dark-theme .smit-sg-more:hover { background: #23272d; }
[data-bs-theme="dark"] .smit-sg-badge.off,
.dark-theme .smit-sg-badge.off { background: #4c1d1d; color: #fca5a5; }

/* ---------- мобильный ---------- */
@media (max-width: 767.98px) {
  .smit-sg {
    border-radius: 12px;
    padding: 6px;
  }
  .smit-sg-item {
    min-height: 44px;            /* палец, а не курсор */
    padding: 10px 12px;
  }
  .smit-sg-name { font-size: .92rem; white-space: normal; }
  .smit-sg-addr { font-size: .8rem; white-space: normal; }
  .smit-sg-chip { font-size: .78rem; }
  .smit-sg-more { min-height: 44px; display: flex; align-items: center; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .smit-sg-spin { animation: none; }
}
