/* ============================================
   FRAGMENT AUCTION — Mini App Styles
   Тёмная тема, акценты TON-голубого, плотная сетка
   ============================================ */

:root {
  --bg-base: #0a0e14;
  --bg-elev-1: #11161f;
  --bg-elev-2: #1a2230;
  --bg-elev-3: #232d3f;
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);

  --text-primary: #f0f4fa;
  --text-secondary: #8b95a8;
  --text-tertiary: #5a6478;
  --text-muted: #3a4256;

  --accent: #3aa8ff;
  --accent-hover: #5cb8ff;
  --accent-dim: rgba(58, 168, 255, 0.15);
  --accent-glow: rgba(58, 168, 255, 0.35);

  --success: #2ed573;
  --warning: #ffa726;
  --danger: #ff4757;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 24px var(--accent-glow);

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-montserrat: 'Montserrat', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --header-h: 64px;
  --tabbar-h: 68px;

  /* Плавные переходы */
  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 0.18s var(--ease-smooth);
  --t-mid:  0.28s var(--ease-smooth);
  --t-slow: 0.4s  var(--ease-out);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Глобальный плавный transition для всех кнопок и интерактивных элементов */
button, input, a, label {
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast),
              box-shadow var(--t-fast), opacity var(--t-fast), transform var(--t-fast);
}

html, body {
  height: 100%;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body {
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-top: env(safe-area-inset-top);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input {
  font-family: inherit;
  color: inherit;
}

/* ============================================
   АТМОСФЕРНЫЙ ФОН
   ============================================ */
.bg-aura {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.aura {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: drift 28s ease-in-out infinite;
}

.aura-1 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #3aa8ff 0%, transparent 70%);
  top: -100px;
  left: -100px;
}

.aura-2 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, #7c4dff 0%, transparent 70%);
  bottom: -50px;
  right: -100px;
  animation-delay: -7s;
  opacity: 0.25;
}

.aura-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, #00d4aa 0%, transparent 70%);
  top: 40%;
  left: 40%;
  animation-delay: -14s;
  opacity: 0.15;
}

@keyframes drift {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(50px, -30px); }
  66% { transform: translate(-30px, 50px); }
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(circle at 50% 30%, black 0%, transparent 80%);
}

/* ============================================
   ШАПКА
   ============================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  background: rgba(10, 14, 20, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

/* ============================================
   ГЛАВНЫЙ КОНТЕЙНЕР
   ============================================ */
.main {
  position: relative;
  padding: 20px 16px 24px;
  max-width: 560px;
  margin: 0 auto;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.screen-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.screen-head > div:not(.icon-btn) {
  flex: 1;
}

.screen-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.screen-sub {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-secondary);
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), opacity var(--t-fast), transform var(--t-fast);
}

.icon-btn:hover {
  background: var(--bg-elev-2);
  color: var(--text-primary);
}
.icon-btn:active {
  background: var(--bg-elev-2);
  color: var(--text-primary);
  transform: scale(0.93);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

/* ============================================
   СТАТ-БАР
   ============================================ */
.stats-bar {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  font-weight: 500;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.stat-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
  margin: 0 12px;
}

/* ============================================
   ФИЛЬТРЫ
   ============================================ */
.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin-bottom: 16px;
  padding-bottom: 4px;
}

.filters::-webkit-scrollbar { display: none; }

.filter-chip {
  flex-shrink: 0;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), opacity var(--t-fast), transform var(--t-fast);
}

.filter-chip:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.filter-chip.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent);
}

/* ============================================
   СПИСОК NFT
   ============================================ */
.nft-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 80px;
}

.nft-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), opacity var(--t-fast), transform var(--t-fast);
  position: relative;
}

.nft-item:hover {
  border-color: var(--border-strong);
  background: var(--bg-elev-2);
  transform: translateY(-1px);
}

.nft-item.selected {
  background: linear-gradient(135deg, var(--accent-dim), transparent);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 4px 16px rgba(58, 168, 255, 0.2);
}

.nft-checkbox {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border-strong);
  border-radius: 6px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), opacity var(--t-fast), transform var(--t-fast);
}

.nft-item.selected .nft-checkbox {
  background: var(--accent);
  border-color: var(--accent);
}

.nft-checkbox svg {
  width: 14px;
  height: 14px;
  color: white;
  opacity: 0;
  transition: opacity var(--t-fast);
}

.nft-item.selected .nft-checkbox svg {
  opacity: 1;
}

.nft-image {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--bg-elev-3);
  overflow: hidden;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.nft-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nft-image-fallback {
  font-size: 20px;
  color: var(--text-tertiary);
}

.nft-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.nft-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nft-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.nft-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nft-tag.tag-onsale {
  background: rgba(46, 213, 115, 0.15);
  color: var(--success);
}

.nft-tag.tag-auction {
  background: rgba(255, 167, 38, 0.15);
  color: var(--warning);
}

.nft-tag.tag-bid {
  background: rgba(46, 213, 115, 0.15);
  color: var(--success);
}



.nft-floor {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
}

.nft-price {
  text-align: right;
  flex-shrink: 0;
}

.nft-price-value {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
}

.nft-price-value svg {
  width: 12px;
  height: 12px;
  color: var(--accent);
}

.nft-price-usd {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* Скелетон */
.nft-skeleton {
  height: 72px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, var(--bg-elev-1), var(--bg-elev-2), var(--bg-elev-1));
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================
   ПУСТОЕ СОСТОЯНИЕ
   ============================================ */
.empty-state {
  text-align: center;
  padding: 60px 24px;
}

.empty-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  color: var(--text-muted);
}

.empty-icon svg {
  width: 100%;
  height: 100%;
}

.empty-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.empty-text {
  font-size: 13px;
  color: var(--text-tertiary);
}

.hidden {
  display: none !important;
}

/* ============================================
   КАРТОЧКИ (на экране конфига)
   ============================================ */
.card {
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 14px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-sub {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.text-btn {
  font-size: 12px;
  color: var(--text-tertiary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.text-btn:hover { color: var(--accent); }

/* ============================================
   ПОЛЯ ФОРМЫ
   ============================================ */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.form-row:last-child { margin-bottom: 0; }

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.field-hint {
  cursor: help;
  opacity: 0.6;
  font-size: 10px;
}

.input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.input-prefix, .input-suffix {
  display: grid;
  place-items: center;
  color: var(--text-tertiary);
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 500;
  flex-shrink: 0;
}

.input-prefix svg {
  width: 14px;
  height: 14px;
  color: var(--accent);
}

.input-wrap input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  padding: 12px 8px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-primary);
  min-width: 0;
  width: 100%;
}

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

.input-wrap input::-webkit-outer-spin-button,
.input-wrap input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.input-wrap input[type=number] { -moz-appearance: textfield; }

/* Быстрые варианты длительности */
.quick-picks {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.quick-pick {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-tertiary);
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), opacity var(--t-fast), transform var(--t-fast);
}

.quick-pick:hover {
  color: var(--text-primary);
}

.quick-pick.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent);
}

/* ============================================
   АВТО-РЕЛИСТИНГ
   ============================================ */
.auto-card {
  background: linear-gradient(135deg, var(--bg-elev-1), rgba(58, 168, 255, 0.04));
  border-color: rgba(58, 168, 255, 0.2);
}

.auto-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auto-info { flex: 1; }

.auto-icon {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

/* Тоггл */
.toggle {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg-elev-3);
  border-radius: var(--radius-pill);
  transition: background var(--t-fast), transform var(--t-fast);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: background var(--t-fast), transform var(--t-fast);
}

.toggle input:checked + .toggle-slider {
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.toggle input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

.auto-details {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}

.auto-details.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.auto-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.auto-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.auto-control {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.auto-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  font-size: 16px;
  color: var(--text-secondary);
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), opacity var(--t-fast), transform var(--t-fast);
}

.auto-btn:hover {
  background: var(--bg-elev-3);
  color: var(--text-primary);
}

.auto-value {
  min-width: 40px;
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 14px;
  color: var(--accent);
}

.auto-note {
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.5;
  padding: 10px 12px;
  background: var(--bg-elev-2);
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--accent);
}

/* ============================================
   СПИСОК ВЫБРАННЫХ
   ============================================ */
.selected-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.selected-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-elev-2);
  border-radius: var(--radius-sm);
}

.selected-row img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--bg-elev-3);
}

.selected-row-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.selected-row-remove {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: var(--text-tertiary);
  transition: color var(--t-fast);
}

.selected-row-remove:hover { color: var(--danger); }

.selected-row-remove svg {
  width: 14px;
  height: 14px;
}

/* ============================================
   ЗАКРЕПЛЁННЫЙ ДОК С КНОПКОЙ
   ============================================ */

/* Экран конфига — dock в потоке, не fixed */
#screen-config {
  padding-bottom: 24px;
}
.action-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding: 12px 16px;
  background: linear-gradient(to top, var(--bg-base) 60%, transparent);
  z-index: 40;
  transition: transform 0.25s var(--ease-smooth), opacity 0.25s var(--ease-smooth);
}

/* На экране конфига — dock в потоке документа, не мешает клавиатуре */
#screen-config .action-dock {
  position: static;
  background: none;
  padding: 16px 0 0;
  margin-top: 8px;
}

.action-dock .summary {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  padding: 0 4px 8px;
  color: var(--text-tertiary);
}

.action-dock .summary-row {
  display: flex;
  gap: 6px;
}

.action-dock .summary-row span:last-child {
  font-family: var(--font-mono);
  color: var(--text-secondary);
  font-weight: 600;
}

.btn-primary {
  width: 100%;
  max-width: 528px;
  margin: 0 auto;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: white;
  background: linear-gradient(135deg, var(--accent), #2a85d9);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(58, 168, 255, 0.35);
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), opacity var(--t-fast), transform var(--t-fast);
  position: relative;
  overflow: hidden;
}

.btn-primary:before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.15));
  opacity: 0;
  transition: opacity var(--t-fast);
}

.btn-primary:hover:not(:disabled):before { opacity: 1; }

.btn-primary:active:not(:disabled) {
  transform: scale(0.97);
  transition: transform 0.08s var(--ease-smooth);
}

.btn-primary:disabled {
  background: var(--bg-elev-2);
  color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
}

.btn-counter {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
}

.btn-arrow {
  width: 16px;
  height: 16px;
}

.btn-ghost {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), opacity var(--t-fast), transform var(--t-fast);
}

.btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

/* ============================================
   АКТИВНЫЕ АУКЦИОНЫ
   ============================================ */
.active-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.active-card {
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.active-card.has-auto::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--accent), transparent);
}

.active-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.active-head img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--bg-elev-3);
}

.active-head-info { flex: 1; min-width: 0; }

.active-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.active-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.active-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.active-stat {
  background: var(--bg-elev-2);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.active-stat-label {
  font-size: 10px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.active-stat-value {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  margin-top: 2px;
}

.active-actions {
  display: flex;
  gap: 8px;
}

.active-actions button {
  flex: 1;
  height: 36px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), opacity var(--t-fast), transform var(--t-fast);
}

.active-actions button svg {
  width: 14px;
  height: 14px;
}

.btn-stop-auto {
  background: var(--bg-elev-2);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-stop-auto:hover {
  background: rgba(255, 71, 87, 0.1);
  color: var(--danger);
  border-color: var(--danger);
}

.btn-stop-auto.enabled {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent);
}

.btn-enable-auto {
  background: var(--bg-elev-2);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-enable-auto:hover {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent);
}

.btn-cancel-auction {
  background: var(--bg-elev-2);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-cancel-auction:hover {
  background: rgba(255, 71, 87, 0.1);
  color: var(--danger);
  border-color: var(--danger);
}

/* Прогресс бар времени */
.time-progress {
  height: 4px;
  background: var(--bg-elev-2);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: 12px;
}

.time-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #00d4aa);
  border-radius: var(--radius-pill);
  transition: width 0.8s var(--ease-smooth);
}

/* ============================================
   НИЖНЯЯ НАВИГАЦИЯ
   ============================================ */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--tabbar-h);
  padding: 0 16px env(safe-area-inset-bottom);
  background: rgba(10, 14, 20, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
}

.tab {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 500;
  position: relative;
  transition: color var(--t-fast);
}

.tab svg {
  width: 22px;
  height: 22px;
}

.tab.active {
  color: var(--accent);
}

.tab.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 2px;
  background: var(--accent);
  border-radius: 0 0 2px 2px;
}

.tab-badge {
  position: absolute;
  top: 8px;
  right: calc(50% - 18px);
  background: var(--danger);
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-pill);
  min-width: 14px;
  text-align: center;
}

/* ============================================
   ТОСТЫ
   ============================================ */
.toast-container {
  position: fixed;
  top: calc(var(--header-h) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: calc(100% - 32px);
  max-width: 400px;
}

.toast {
  pointer-events: auto;
  padding: 12px 16px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.35s var(--ease-out);
}

.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
.toast.info { border-color: var(--accent); }

.toast svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.toast.success svg { color: var(--success); }
.toast.error svg { color: var(--danger); }
.toast.info svg { color: var(--accent); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================
   МОДАЛКА
   ============================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  z-index: 300;
  padding: 24px;
  animation: fadeIn 0.25s var(--ease-smooth);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--bg-elev-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  animation: modalIn 0.35s var(--ease-spring);
  overflow: visible;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.92) translateY(8px); }
  to { opacity: 1; transform: scale(1); }
}



.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.modal-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 8px;
}

.modal-actions button {
  flex: 1;
  height: 44px;
}

/* ============================================
   АДАПТИВ
   ============================================ */
@media (max-width: 380px) {
  .form-row { grid-template-columns: 1fr; }
  .screen-title { font-size: 20px; }
  .quick-picks { gap: 4px; }
}

/* ============================================
   PER-NFT НАСТРОЙКИ (selected list override)
   ============================================ */
.sel-item {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}

.sel-main {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
}

.sel-main img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.sel-img-fallback {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--bg-elev-3);
  display: grid;
  place-items: center;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.sel-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.sel-custom-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  background: rgba(58, 168, 255, 0.15);
  color: var(--accent);
  border-radius: 4px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

/* sel-edit-btn removed */

.sel-remove-btn {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  font-size: 13px;
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: color var(--t-fast);
  cursor: pointer;
}

.sel-remove-btn:hover { color: var(--danger); }

/* Панель переопределений */
.sel-override {
  padding: 12px 12px 14px;
  border-top: 1px dashed var(--border);
  background: rgba(58, 168, 255, 0.03);
  animation: fadeIn 0.2s var(--ease-out);
}

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

.ov-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ov-reset-field {
  display: flex;
  align-items: flex-end;
}

.ov-field label {
  font-size: 11px;
  font-family: var(--font-montserrat);
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.ov-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-elev-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 6px;
  gap: 4px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.ov-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.ov-inp {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: 'Montserrat', system-ui, sans-serif !important;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  padding: 7px 0;
  width: 0;
  min-width: 0;
  letter-spacing: 0;
}

.ov-inp::placeholder { color: var(--text-muted); font-size: 11px; }

.ov-inp::-webkit-outer-spin-button,
.ov-inp::-webkit-inner-spin-button { -webkit-appearance: none; }
.ov-inp[type=number] { -moz-appearance: textfield; }

.ov-input-wrap span {
  font-size: 11px;
  color: var(--text-tertiary);
  font-family: var(--font-display);
  font-weight: 500;
  flex-shrink: 0;
}

.ov-reset-btn {
  width: 100%;
  height: 30px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  background: var(--bg-elev-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), opacity var(--t-fast), transform var(--t-fast);
}

.ov-reset-btn:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: rgba(255, 71, 87, 0.08);
}

/* Обновляем версию кеша стилей — добавили новые классы */

/* ============================================
   ГРУППИРОВКА АУКЦИОНОВ ПО БАТЧАМ
   ============================================ */
.batch-card {
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color var(--t-mid), box-shadow var(--t-mid);
}

.batch-card.expanded {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-dim);
}

.batch-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  cursor: pointer;
  transition: background var(--t-fast);
}

.batch-head:hover {
  background: var(--bg-elev-2);
}

.batch-preview {
  display: flex;
  position: relative;
  flex-shrink: 0;
}

.batch-preview img,
.batch-img-fallback {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid var(--bg-elev-1);
  margin-left: -10px;
}

.batch-preview img:first-child,
.batch-preview .batch-img-fallback:first-child {
  margin-left: 0;
}

.batch-img-fallback {
  background: var(--bg-elev-3);
  display: grid;
  place-items: center;
  color: var(--text-tertiary);
  font-size: 14px;
}

.batch-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.batch-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

.batch-meta {
  font-size: 12px;
  color: var(--text-tertiary);
  font-family: var(--font-display);
}

.batch-cancel-all {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: rgba(255, 71, 87, 0.1);
  border: 1px solid rgba(255, 71, 87, 0.2);
  border-radius: 8px;
  color: var(--danger);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--t-fast);
}

.batch-cancel-all:hover {
  background: rgba(255, 71, 87, 0.2);
}

.batch-cancel-all svg {
  width: 14px;
  height: 14px;
}

.batch-toggle-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-tertiary);
  transition: transform var(--t-mid), background var(--t-fast);
  cursor: pointer;
  flex-shrink: 0;
}

.batch-toggle-btn svg {
  width: 16px;
  height: 16px;
  transition: transform var(--t-mid);
}

.batch-toggle-btn.open svg {
  transform: rotate(180deg);
}

.batch-items {
  border-top: 1px solid var(--border);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fadeIn 0.25s var(--ease-out);
}

.batch-items.collapsed {
  display: none;
}

.batch-item {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.batch-item-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.batch-item-row img,
.batch-item-img-fallback {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.batch-item-img-fallback {
  background: var(--bg-elev-3);
  display: grid;
  place-items: center;
  color: var(--text-tertiary);
}

.batch-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.batch-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.batch-item-meta {
  font-size: 11px;
  color: var(--text-tertiary);
  font-family: var(--font-display);
}

.batch-item-cancel {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: rgba(255, 71, 87, 0.08);
  border: 1px solid rgba(255, 71, 87, 0.2);
  border-radius: 8px;
  color: var(--danger);
  cursor: pointer;
  transition: all var(--t-fast);
  flex-shrink: 0;
}

.batch-item-cancel:hover {
  background: rgba(255, 71, 87, 0.15);
  border-color: var(--danger);
}

.batch-item-cancel svg {
  width: 14px;
  height: 14px;
}

.batch-item-progress {
  height: 3px;
  background: var(--bg-elev-3);
  border-radius: 2px;
  overflow: hidden;
}

.batch-item-progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 1s linear;
}

.batch-item-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text-tertiary);
}

.batch-item-stats b {
  color: var(--text-secondary);
  font-weight: 600;
}

/* ============================================
   RELIST OVERLAY (режим перезапуска из Telegram)
   ============================================ */
.relist-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-base);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 24px;
}

.relist-card {
  width: 100%;
  max-width: 320px;
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  animation: screenIn 0.35s var(--ease-out);
}

.relist-card img {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  object-fit: cover;
}

.relist-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  font-family: var(--font-display);
}

.relist-sub {
  font-size: 13px;
  color: var(--text-secondary);
  font-family: var(--font-display);
}

.relist-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 700;
}

.relist-icon.success {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
  border: 2px solid rgba(52, 211, 153, 0.3);
}

.relist-icon.cancel {
  background: rgba(139, 149, 168, 0.15);
  color: var(--text-tertiary);
  border: 2px solid var(--border);
}

.relist-icon.error {
  background: rgba(255, 71, 87, 0.15);
  color: var(--danger);
  border: 2px solid rgba(255, 71, 87, 0.3);
}

.relist-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ============================================
   EXTENSION STATUS
   ============================================ */
.extension-status {
  margin-bottom: 12px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.ext-checking {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-elev-2);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-tertiary);
}

.ext-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

.ext-active {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.2);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: #34d399;
}

.ext-active svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.ext-inactive {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.ext-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ext-info span:first-child {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.ext-sub {
  font-size: 11px !important;
  color: var(--text-tertiary) !important;
  font-weight: 400 !important;
}

.btn-install-ext {
  flex-shrink: 0;
  padding: 7px 14px;
  background: var(--accent);
  color: white;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity var(--t-fast);
  white-space: nowrap;
}

.btn-install-ext:hover { opacity: 0.85; }

.ext-error {
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-tertiary);
  background: var(--bg-elev-2);
  border-radius: var(--radius-sm);
}

/* ============================================
   TRADING WALLET MODAL
   ============================================ */
.tw-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 9000;
  padding: 16px;
  animation: fadeIn 0.2s var(--ease-smooth);
}

.tw-modal-overlay.hidden {
  display: none;
}

.tw-modal {
  width: 100%;
  max-width: 420px;
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: screenIn 0.3s var(--ease-spring);
}

.tw-modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

.tw-modal-sub {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.tw-textarea {
  width: 100%;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-primary);
  resize: none;
  line-height: 1.6;
  transition: border-color var(--t-fast);
  box-sizing: border-box;
}

.tw-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.tw-modal-note {
  font-size: 11px;
  color: var(--text-tertiary);
  background: var(--bg-elev-2);
  border-radius: 8px;
  padding: 8px 10px;
}

.tw-modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.tw-btn-cancel {
  flex: 1;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--t-fast);
}

.tw-btn-cancel:hover {
  background: var(--bg-elev-3);
}

.tw-btn-save {
  flex: 2;
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
  color: white;
  background: var(--accent);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: opacity var(--t-fast);
}

.tw-btn-save:hover { opacity: 0.85; }
.tw-btn-save:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============================================
   МОДАЛКА ВВОДА СИД-ФРАЗЫ (24 слова)
   ============================================ */
.tw-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12px 12px 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.tw-modal {
  background: var(--bg-elev-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}

.tw-modal-header {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.tw-modal-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.tw-modal-sub {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.tw-close-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 14px;
  flex-shrink: 0;
  transition: background var(--t-fast), color var(--t-fast);
}

.tw-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.tw-modal-body {
  padding: 12px 14px;
}

.tw-progress {
  height: 2px;
  background: var(--border);
  border-radius: 2px;
  margin-bottom: 12px;
  overflow: hidden;
}

.tw-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.2s var(--ease-smooth);
}

.tw-word-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.tw-col {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.tw-word-field {
  display: flex;
  align-items: center;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color var(--t-fast), background var(--t-fast);
}

.tw-word-field:focus-within {
  border-color: rgba(58, 168, 255, 0.5);
  background: #1e2a3d;
}

.tw-word-num {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-montserrat);
  width: 26px;
  min-width: 26px;
  text-align: right;
  flex-shrink: 0;
  padding-right: 4px;
  padding-left: 6px;
}

.tw-word-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 12px;
  color: var(--text-primary);
  padding: 8px 6px 8px 2px;
  font-family: var(--font-montserrat);
  min-width: 0;
  width: 0;
}

.tw-word-input::placeholder {
  color: var(--text-muted);
}

.tw-modal-footer {
  padding: 10px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  border-top: 1px solid var(--border);
}

.tw-paste-btn {
  width: 100%;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
  border: 1px solid rgba(58, 168, 255, 0.2);
  cursor: pointer;
  font-size: 12px;
  color: var(--accent);
  transition: background var(--t-fast);
}

.tw-paste-btn:hover {
  background: rgba(58, 168, 255, 0.22);
}

.tw-modal-note {
  font-size: 11px;
  color: var(--text-tertiary);
  text-align: center;
  line-height: 1.4;
}

.tw-btn-save {
  width: 100%;
  padding: 11px;
  border-radius: var(--radius-md);
  background: var(--accent);
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.1px;
  transition: background var(--t-fast), transform var(--t-fast), opacity var(--t-fast);
}

.tw-btn-save:hover:not(:disabled) {
  background: var(--accent-hover);
}

.tw-btn-save:active:not(:disabled) {
  transform: scale(0.98);
}

.tw-btn-save:disabled {
  background: var(--bg-elev-2);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* ============================================
   ОБЩИЕ НАСТРОЙКИ (BULK APPLY)
   ============================================ */
.bulk-settings-card {
  background: var(--bg-elev-1);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 10px;
}

.bulk-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 10px;
  letter-spacing: -0.1px;
}

.bulk-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.bulk-apply-btn {
  width: 100%;
  height: 100%;
  min-height: 36px;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  transition: background var(--t-fast), transform var(--t-fast);
  align-self: end;
}

.bulk-apply-btn:hover {
  background: var(--accent-hover);
}

.bulk-apply-btn:active {
  transform: scale(0.97);
  background: var(--accent);
}

.bulk-apply-btn:visited,
.bulk-apply-btn:focus {
  background: var(--accent);
  outline: none;
}

.bulk-settings-card .ov-input-wrap input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: 'Montserrat', system-ui, sans-serif !important;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  padding: 7px 0;
  width: 0;
  min-width: 0;
  -webkit-appearance: none;
  -moz-appearance: textfield;
}

.bulk-settings-card .ov-input-wrap input::placeholder {
  color: var(--text-muted);
  font-size: 11px;
}

.bulk-settings-card .ov-input-wrap input::-webkit-outer-spin-button,
.bulk-settings-card .ov-input-wrap input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}


/* ============================================
   ВЫБОР И МАССОВАЯ ОТМЕНА АУКЦИОНОВ
   Тот же язык, что у выбора NFT: чипы, голубой чекбокс, подсветка карточки
   ============================================ */
.active-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.active-toolbar.hidden, .tb-group.hidden, .cancel-bar.hidden, .select-hint.hidden { display: none; }
.tb-group { display: flex; gap: 8px; }

.filter-chip.chip-accent {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  background: var(--accent-dim);
  border-color: var(--accent);
  font-weight: 600;
}
.filter-chip.chip-accent.on {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 4px 16px rgba(58, 168, 255, 0.35);
}
.filter-chip.chip-strong {
  color: var(--text-primary);
  background: var(--bg-elev-2);
  border-color: var(--border-strong);
  font-weight: 600;
}
.filter-chip .chip-ico { width: 15px; height: 15px; margin-right: 6px; }

.select-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin: -4px 2px 12px;
}

/* Чекбокс — копия .nft-checkbox */
.sel-box {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border-strong);
  border-radius: 6px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  position: relative;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.sel-box svg {
  width: 14px;
  height: 14px;
  color: #fff;
  opacity: 0;
  transition: opacity var(--t-fast);
}
.sel-box.checked { background: var(--accent); border-color: var(--accent); }
.sel-box.checked svg { opacity: 1; }
.sel-box.partial { border-color: var(--accent); background: var(--accent-dim); }
.sel-box.partial::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 2px;
  border-radius: 1px;
  background: var(--accent);
}

.active-list.select-mode .batch-item { cursor: pointer; }
.batch-item.selected {
  background: linear-gradient(135deg, var(--accent-dim), transparent);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 4px 16px rgba(58, 168, 255, 0.2);
}
.batch-item-row .sel-box { margin-right: 2px; }
.active-list.has-bar { padding-bottom: 96px; }

/* Нижняя панель отмены — в стиле нижней навигации */
.cancel-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  max-width: 560px;
  margin: 0 auto;
  bottom: calc(var(--tabbar-h) + 10px);
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px 10px 16px;
  background: rgba(10, 14, 20, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}
.cancel-bar-info {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}
.cancel-bar-info b { font-size: 20px; color: var(--text-primary); }
.cancel-bar-btn {
  height: 46px;
  padding: 0 20px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(135deg, var(--danger), #d63447);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(255, 71, 87, 0.3);
}
.cancel-bar-btn:disabled { opacity: 0.4; box-shadow: none; }


/* Юзернейм со ставкой: выбрать нельзя */
.nft-item.has-bid { opacity: 0.6; cursor: default; }
.nft-item.has-bid .nft-checkbox { visibility: hidden; }

.nft-section { margin: 14px 4px 6px; font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--text-secondary, #8e8e93); text-transform: uppercase; }
.nft-section:first-child { margin-top: 2px; }
.nft-section-n { opacity: .6; font-weight: 500; margin-left: 4px; }

/* Цены в долларах: подсказка с переводом в TON и строка курса */
.ov-conv { margin-top: 4px; font-size: 11px; color: var(--text-secondary, #8e8e93); min-height: 13px; }
.bulk-rate { margin: 2px 0 10px; font-size: 12px; color: var(--text-secondary, #8e8e93); }
.bulk-rate.rate-bad { color: var(--danger, #ff3b30); }
.batch-item-stats .in-ton { opacity: .55; font-weight: 500; }
