:root {
  --bg: #111;
  --panel: #1b1b1b;
  --text: #e6e6e6;
  --muted: #9aa0a6;
  --accent: #3d7bfd;
  --red: #c84b4b;
  --green: #3fb950;
  --orange: #e29d2d;
  --purple: #8b5cf6;
  --yellow: #fbbf24;
  --blue: #0ea5e9;
  --grid-cols: 2;
  --spot-grid-cols: 2;
  --ui-scale: 1;
  --bid-active-color: #3fb950;
  --bid-inactive-color: #2d4a2d;
  --ask-active-color: #c84b4b;
  --ask-inactive-color: #4a2d2d;
}

/* Анимации для алертов */
@keyframes alertPulseLong {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(63, 185, 80, 0);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(63, 185, 80, 1),
                0 0 0 8px rgba(63, 185, 80, 0.5);
  }
}

@keyframes alertPulseShort {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(200, 75, 75, 0);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(200, 75, 75, 1),
                0 0 0 8px rgba(200, 75, 75, 0.5);
  }
}

.panel.alert-long {
  animation: alertPulseLong 1s infinite;
}

.panel.alert-short {
  animation: alertPulseShort 1s infinite;
}

html, body {
  height: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell,
    Noto Sans, Helvetica Neue, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

#app {
  transform: scale(var(--ui-scale));
  transform-origin: top left;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: #222;
  border-bottom: 1px solid #333;
  flex-shrink: 0;
  z-index: 10;
}
.title {
  font-weight: 600;
}
.spacer { flex: 1; }
.icon-btn {
  background: #2a2a2a;
  color: var(--text);
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.icon-btn:hover {
  background: #3a3a3a;
  border-color: #4a4a4a;
}

.mute-btn.muted {
  background: var(--red);
  border-color: var(--red);
}

.mute-btn.muted:hover {
  background: #d85555;
  border-color: #d85555;
}

.sound-mode-btn {
  background: var(--accent);
  border-color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  padding: 4px 10px;
  min-width: 32px;
  white-space: nowrap;
}

.sound-mode-btn:hover {
  background: #4a86ff;
  border-color: #4a86ff;
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 10px;
}

.queue-indicator {
  color: #fff;
  font-size: 12px;
  font-family: monospace;
  padding: 4px 8px;
  background: #2a2a2a;
  border-radius: 4px;
  border: 1px solid #555;
  min-width: 40px;
  text-align: center;
  margin-right: 8px;
}

.queue-indicator.low {
  background: #1a4a1a;
  border-color: #2d5a2d;
  color: #4ade80;
}

.queue-indicator.medium {
  background: #4a3a1a;
  border-color: #5a4d2d;
  color: #fbbf24;
}

.queue-indicator.high {
  background: #4a1a1a;
  border-color: #5a2d2d;
  color: #f87171;
}

.connection-indicator {
  color: #fff;
  font-size: 12px;
  font-family: monospace;
  padding: 4px 8px;
  background: #2a2a2a;
  border-radius: 4px;
  border: 1px solid #555;
  min-width: 40px;
  text-align: center;
}

.connection-indicator.healthy {
  background: #1a4a1a;
  border-color: #2d5a2d;
  color: #4ade80;
}

.connection-indicator.partial {
  background: #4a3a1a;
  border-color: #5a4d2d;
  color: #fbbf24;
}

.connection-indicator.disconnected {
  background: #4a1a1a;
  border-color: #5a2d2d;
  color: #f87171;
}

.refresh-btn {
  animation: none;
  transition: transform 0.2s ease;
}

.refresh-btn:hover {
  background: #4a86ff;
  border-color: #4a86ff;
}

.refresh-btn:active {
  transform: rotate(90deg);
}

.refresh-btn.refreshing {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.controls {
  padding: 8px;
  border-bottom: 1px solid #2a2a2a;
}
.legend { 
  color: var(--muted); 
  font-size: 13px; 
  line-height: 1.4;
}

.panel {
  background: var(--panel);
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  overflow: hidden;
  animation: slideIn 0.3s ease-out;
  max-height: 320px; /* Фиксированная максимальная высота панели */
  height: fit-content; /* Высота адаптируется к содержимому */
}

/* ── Panel inline stats (spread / trades / turnover) inside panel-head ── */
.panel-stats-inline {
  display: flex;
  align-items: center;
  gap: 0;
  font-size: 12px;
  font-family: monospace;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 1;
  overflow: hidden;
  background: #0d0d0d;
  border-radius: 5px;
  border: 1px solid #2a2a2a;
  padding: 2px 0;
}
.panel-stats-inline span {
  padding: 0 7px;
}
.panel-stats-inline span + span {
  border-left: 1px solid #333;
}
.panel-stats-inline .spread-pct    { color: #e6b800; }
.panel-stats-inline .trades-count  { color: #58a6ff; }
.panel-stats-inline .trades-turnover { color: #3fb950; }

/* Chart expanded — increase max-height to fit canvas */
.panel.chart-open {
  max-height: 700px;
  overflow: visible;
}

/* ── Chart toggle button ── */
.chart-toggle-btn {
  background: transparent;
  border: 1px solid #3a3a3a;
  border-radius: 4px;
  color: #8b949e;
  font-size: 11px;
  cursor: pointer;
  padding: 1px 5px;
  line-height: 1.4;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.chart-toggle-btn:hover {
  background: #2a2a2a;
  color: #e6e6e6;
  border-color: #555;
}
.chart-toggle-btn.active {
  background: #1f3a5f;
  color: #58a6ff;
  border-color: #388bfd;
}

/* ── Chart container ── */
.chart-container {
  border-top: 1px solid #2a2a2a;
  background: #161b22;
  overflow: hidden;
}

/* ── Chart toolbar (timeframe buttons) ── */
.chart-toolbar {
  display: flex;
  gap: 4px;
  padding: 4px 8px;
  background: #1c2128;
  border-bottom: 1px solid #21262d;
}
.chart-tf-btn {
  background: transparent;
  border: 1px solid #30363d;
  border-radius: 4px;
  color: #8b949e;
  font-size: 10px;
  font-family: monospace;
  cursor: pointer;
  padding: 2px 6px;
  transition: all 0.12s ease;
}
.chart-tf-btn:hover {
  background: #21262d;
  color: #e6e6e6;
}
.chart-tf-btn.active {
  background: #1f3a5f;
  color: #58a6ff;
  border-color: #388bfd;
  font-weight: 600;
}

/* ── Chart canvas ── */
.chart-canvas {
  display: block;
  width: 100%;
  cursor: crosshair;
}

/* Зелёный фон для панелей Hyperliquid */
.panel.exchange-hyperliquid {
  background: linear-gradient(135deg, #1a2a1a 0%, #1b1b1b 100%);
  border-color: #2a3a2a;
}

.panel.exchange-hyperliquid .panel-head {
  background: linear-gradient(135deg, #2a3a2a 0%, #2a2a2a 100%);
}

/* Золотой фон для панелей Aster */
.panel.exchange-aster {
  background: linear-gradient(135deg, #2a2410 0%, #1b1b1b 100%);
  border-color: #3a3420;
}

.panel.exchange-aster .panel-head {
  background: linear-gradient(135deg, #3a3420 0%, #2a2a2a 100%);
}

/* Серебристый фон для панелей Lighter */
.panel.exchange-lighter {
  background: linear-gradient(135deg, #1f2528 0%, #1b1b1b 100%);
  border-color: #2f3538;
}

.panel.exchange-lighter .panel-head {
  background: linear-gradient(135deg, #2f3538 0%, #2a2a2a 100%);
}

/* Желтый фон для панелей Binance */
.panel.exchange-binance {
  background: linear-gradient(135deg, #2a2408 0%, #1b1b1b 100%);
  border-color: #3a3010;
}

.panel.exchange-binance .panel-head {
  background: linear-gradient(135deg, #3a3010 0%, #2a2a2a 100%);
}

/* Фиолетовый фон для панелей Gate.io */
.panel.exchange-gateio {
  background: linear-gradient(135deg, #1f1530 0%, #1b1b1b 100%);
  border-color: #2f2540;
}

.panel.exchange-gateio .panel-head {
  background: linear-gradient(135deg, #2f2540 0%, #2a2a2a 100%);
}

.panel.exchange-okx {
  background: linear-gradient(135deg, #0d1830 0%, #1b1b1b 100%);
  border-color: #1e3060;
}

.panel.exchange-okx .panel-head {
  background: linear-gradient(135deg, #1e3060 0%, #2a2a2a 100%);
}

.panel .panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #2a2a2a;
  color: var(--muted);
  font-size: 13px;
}
.panel .panel-head .coin-title  { flex-shrink: 0; min-width: 0; }
.panel .panel-head .panel-controls { flex-shrink: 0; }

.panel .panel-head .coin-title {
  color: white;
  font-weight: bold;
  font-size: 13px;
  cursor: pointer;
  transition: color 0.2s ease;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel .panel-head .coin-title a {
  color: white;
  text-decoration: none;
  transition: color 0.2s ease;
}

.panel .panel-head .coin-title a:hover {
  color: var(--accent);
}

.panel .panel-head .coin-title a:active {
  color: var(--green);
}

.panel .panel-head .coin-title:hover {
  color: var(--accent);
}

.panel .panel-head .coin-title:active {
  color: var(--green);
}

/* Кнопка копирования названия монеты */
.copy-coin-btn {
  background: transparent;
  border: none;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 4px;
  opacity: 0.7;
  transition: opacity 0.2s ease, transform 0.1s ease;
  line-height: 1;
}

.copy-coin-btn:hover {
  opacity: 1;
  transform: scale(1.1);
}

.copy-coin-btn:active {
  transform: scale(0.95);
}

/* Отображение разниц цен между биржами */
.price-differences {
  font-size: 11px;
  font-weight: 500;
  margin-top: 4px;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
  border: 1px solid #444;
  font-family: 'Courier New', monospace;
  letter-spacing: 0.5px;
  text-align: center;
  min-width: 80px;
  display: inline-block;
}

.panel .panel-head .status {
  font-size: 14px;
  margin-left: auto;
  padding-left: 8px;
}

.panel .panel-head .status.online {
  color: var(--green);
}

.panel .panel-head .status.offline {
  color: var(--red);
}

/* Панель управления с кнопками */
.panel-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Отображение объемов стакана */
.orderbook-volume {
  font-size: 10px;
  font-weight: 600;
  font-family: monospace;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
  border: 1px solid #444;
}

.orderbook-volume .ask-volume,
.orderbook-volume .bid-volume {
  font-weight: 700;
}

/* Кнопки закрепления */
.pin-order-btn, .pin-coin-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  transition: all 0.2s ease;
  opacity: 0.7;
}

.pin-order-btn:hover, .pin-coin-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent);
  opacity: 1;
  transform: scale(1.1);
}

.pin-order-btn:active, .pin-coin-btn:active {
  transform: scale(0.95);
}

/* Выделение закрепленных элементов */
.limit-order-panel[data-pinned="true"] {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--panel) 0%, rgba(61, 123, 253, 0.05) 100%);
  box-shadow: 0 0 8px rgba(61, 123, 253, 0.2);
}

.panel[data-pinned="true"] {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--panel) 0%, rgba(61, 123, 253, 0.05) 100%);
  box-shadow: 0 0 8px rgba(61, 123, 253, 0.2);
}

/* НОВОЕ: ЯРКО ЗЕЛЕНАЯ рамка для ордеров со стенками */
.limit-order-panel.has-wall {
  border: 3px solid #00ff00 !important;
  background: linear-gradient(135deg, var(--panel) 0%, rgba(0, 255, 0, 0.08) 100%) !important;
  box-shadow: 0 0 15px rgba(0, 255, 0, 0.4), inset 0 0 20px rgba(0, 255, 0, 0.05) !important;
  animation: pulse-green 2s ease-in-out infinite;
}

@keyframes pulse-green {
  0%, 100% {
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.4), inset 0 0 20px rgba(0, 255, 0, 0.05);
  }
  50% {
    box-shadow: 0 0 25px rgba(0, 255, 0, 0.6), inset 0 0 30px rgba(0, 255, 0, 0.1);
  }
}

.panel .rows {
  max-height: 240px;
  overflow-y: auto;
}

.row {
  display: grid;
  grid-template-columns: 40px 1fr 1fr 120px;
  gap: 5px;
  align-items: center;
  padding: 5px;
  margin: 5px;
  border: 1px solid #444;
  border-radius: 4px;
  background: #2c2c2c;
  position: relative;
  transition: all 0.3s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.row:hover {
  border-color: #666;
  background: #333;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

.row:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.row .pos {
  color: var(--muted);
  width: 32px;
  text-align: right;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}

.row .price {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 12px;
}

.row .volume {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  font-size: 11px;
}

.row .usd { 
  color: var(--muted); 
  text-align: right;
  font-size: 12px;
}

.row .bar { 
  position: absolute; 
  inset: 0; 
  pointer-events: none; 
  opacity: 0.18; 
  border-radius: 6px;
}

.row .bar .fill { 
  position: absolute; 
  top: 0; 
  bottom: 0; 
  background: var(--bid-active-color);
  border-radius: 6px;
  transition: width 0.3s ease;
}

.row.ask .bar .fill { 
  background: var(--ask-active-color); 
  right: 0; 
  left: auto; 
}

.row.bid .bar .fill { 
  left: 0; 
  right: auto; 
}

/* Эффекты анимации для изменений */
.row.flash-up {
  animation: pulseGreen 0.7s ease;
  border-color: var(--green);
  box-shadow: 0 0 8px rgba(63,185,80,0.4);
}

.row.flash-down {
  animation: pulseRed 0.7s ease;
  border-color: var(--red);
  box-shadow: 0 0 8px rgba(200,75,75,0.4);
}

.row.wall-resumed {
  animation: resumeGlow 1s ease;
}

@keyframes pulseGreen {
  0% { 
    box-shadow: 0 0 0px rgba(63,185,80,0.0);
    transform: scale(1);
  }
  50% { 
    box-shadow: 0 0 12px rgba(63,185,80,0.6);
    transform: scale(1.02);
  }
  100% { 
    box-shadow: 0 0 0px rgba(63,185,80,0.0);
    transform: scale(1);
  }
}

@keyframes pulseRed {
  0% { 
    box-shadow: 0 0 0px rgba(200,75,75,0.0);
    transform: scale(1);
  }
  50% { 
    box-shadow: 0 0 12px rgba(200,75,75,0.6);
    transform: scale(1.02);
  }
  100% { 
    box-shadow: 0 0 0px rgba(200,75,75,0.0);
    transform: scale(1);
  }
}

@keyframes resumeGlow {
  0% {
    box-shadow: 0 0 0px rgba(139,92,246,0.0);
    border-color: var(--purple);
  }
  50% {
    box-shadow: 0 0 15px rgba(139,92,246,0.6);
    border-color: var(--purple);
  }
  100% {
    box-shadow: 0 0 0px rgba(139,92,246,0.0);
    border-color: #444;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Невидимые стенки */
.row.invisible {
  opacity: 0.7;
  border-color: #666;
  background: #252525;
  border-style: dashed;
  transition: all 0.5s ease;
}

.row.invisible .pos {
  color: var(--orange);
  font-weight: bold;
}

.row.invisible .price {
  color: var(--muted);
}

.row.invisible .volume {
  color: var(--muted);
}

.row.invisible .bar .fill {
  opacity: 0.5;
}

.row.bid.invisible .bar .fill {
  background: var(--bid-inactive-color);
}

.row.ask.invisible .bar .fill {
  background: var(--ask-inactive-color);
}



/* Индикатор статуса стенки */
.wall-status {
  font-size: 10px;
  margin-left: 2px;
  color: var(--yellow);
  animation: pulse 2s infinite;
}

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

/* Диалог настроек */
dialog::backdrop { background: rgba(0,0,0,0.7); }
dialog { 
  background: #1b1b1b; 
  color: var(--text); 
  border: 1px solid #333; 
  border-radius: 8px;
  max-width: 95vw;
  max-height: 95vh;
  padding: 0;
}

.settings-form { 
  display: grid; 
  gap: 15px; 
  min-width: 800px;
  padding: 20px;
}

.settings-form h3 {
  margin: 0;
  color: var(--accent);
  border-bottom: 2px solid #333;
  padding-bottom: 10px;
}

.settings-form h4 {
  margin: 15px 0 10px 0;
  color: var(--accent);
  font-size: 16px;
  border-bottom: 1px solid #333;
  padding-bottom: 8px;
}

.settings-form label { 
  display: flex; 
  flex-direction: column; 
  gap: 6px; 
  font-size: 14px; 
}

.settings-form .row { 
  flex-direction: row; 
  justify-content: space-between; 
  align-items: center; 
}

.table-wrap {
  max-height: 60vh;
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  -webkit-overflow-scrolling: touch;
}

#settingsTable,
#spotSettingsTable,
#lighterSettingsTable,
#asterSettingsTable,
#binanceSettingsTable,
#bybitSettingsTable,
#binanceSpotSettingsTable,
#gateioSettingsTable,
#okxSettingsTable {
  min-width: 900px;
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

#settingsTable th,
#settingsTable td,
#spotSettingsTable th,
#spotSettingsTable td,
#lighterSettingsTable th,
#lighterSettingsTable td,
#asterSettingsTable th,
#asterSettingsTable td,
#binanceSettingsTable th,
#binanceSettingsTable td,
#bybitSettingsTable th,
#bybitSettingsTable td,
#binanceSpotSettingsTable th,
#binanceSpotSettingsTable td,
#gateioSettingsTable th,
#gateioSettingsTable td,
#okxSettingsTable th,
#okxSettingsTable td {
  padding: 8px 12px;
  border-bottom: 1px solid #2a2a2a;
  text-align: center;
  vertical-align: middle;
}

#settingsTable th,
#spotSettingsTable th,
#lighterSettingsTable th,
#asterSettingsTable th,
#binanceSettingsTable th,
#bybitSettingsTable th,
#binanceSpotSettingsTable th,
#gateioSettingsTable th,
#okxSettingsTable th {
  background: #232323;
  font-weight: 600;
  color: var(--accent);
  position: sticky;
  top: 0;
  z-index: 1;
}

#settingsTable th:first-child,
#spotSettingsTable th:first-child,
#lighterSettingsTable th:first-child,
#asterSettingsTable th:first-child,
#binanceSettingsTable th:first-child,
#bybitSettingsTable th:first-child,
#binanceSpotSettingsTable th:first-child,
#gateioSettingsTable th:first-child,
#okxSettingsTable th:first-child {
  text-align: left;
}

#settingsTable td:first-child,
#spotSettingsTable td:first-child,
#lighterSettingsTable td:first-child,
#asterSettingsTable td:first-child,
#binanceSettingsTable td:first-child,
#bybitSettingsTable td:first-child,
#binanceSpotSettingsTable td:first-child,
#gateioSettingsTable td:first-child,
#okxSettingsTable td:first-child {
  text-align: left;
  font-weight: 600;
  color: var(--text);
}

/* Специальные стили для новых столбцов */
#settingsTable th:nth-child(3),
#spotSettingsTable th:nth-child(3),
#lighterSettingsTable th:nth-child(3),
#asterSettingsTable th:nth-child(3),
#binanceSettingsTable th:nth-child(3),
#bybitSettingsTable th:nth-child(3),
#binanceSpotSettingsTable th:nth-child(3),
#gateioSettingsTable th:nth-child(3),
#okxSettingsTable th:nth-child(3) { /* Alert Level */
  background-color: #2d4a2d !important;
}

#settingsTable th:nth-child(5),
#spotSettingsTable th:nth-child(5),
#lighterSettingsTable th:nth-child(5),
#asterSettingsTable th:nth-child(5),
#binanceSettingsTable th:nth-child(5),
#bybitSettingsTable th:nth-child(5),
#binanceSpotSettingsTable th:nth-child(5),
#gateioSettingsTable th:nth-child(5),
#okxSettingsTable th:nth-child(5) { /* Мин уровень */
  background-color: #2d4a2d !important;
}

#settingsTable th:nth-child(7),
#spotSettingsTable th:nth-child(7),
#lighterSettingsTable th:nth-child(7),
#asterSettingsTable th:nth-child(7),
#binanceSettingsTable th:nth-child(7),
#bybitSettingsTable th:nth-child(7),
#binanceSpotSettingsTable th:nth-child(7),
#gateioSettingsTable th:nth-child(7),
#okxSettingsTable th:nth-child(7) { /* Fol $ */
  background-color: #4a2d2d !important;
}

#settingsTable input[type="number"],
#spotSettingsTable input[type="number"],
#lighterSettingsTable input[type="number"],
#asterSettingsTable input[type="number"],
#binanceSettingsTable input[type="number"],
#bybitSettingsTable input[type="number"],
#binanceSpotSettingsTable input[type="number"],
#gateioSettingsTable input[type="number"],
#okxSettingsTable input[type="number"] {
  width: 70px;
  background: #333;
  color: var(--text);
  border: 1px solid #555;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 13px;
  text-align: center;
}

/* Специальные стили для input'ов в новых столбцах - зелёные (Alert Level) */
#settingsTable tbody td:nth-child(3) input,
#spotSettingsTable tbody td:nth-child(3) input,
#lighterSettingsTable tbody td:nth-child(3) input,
#asterSettingsTable tbody td:nth-child(3) input,
#binanceSettingsTable tbody td:nth-child(3) input,
#bybitSettingsTable tbody td:nth-child(3) input,
#binanceSpotSettingsTable tbody td:nth-child(3) input,
#gateioSettingsTable tbody td:nth-child(3) input,
#okxSettingsTable tbody td:nth-child(3) input {
  background: #2a3a2a !important;
  border-color: var(--green) !important;
}

/* Специальные стили для input'ов в новых столбцах - зелёные (Мин уровень) */
#settingsTable tbody td:nth-child(5) input,
#spotSettingsTable tbody td:nth-child(5) input,
#lighterSettingsTable tbody td:nth-child(5) input,
#asterSettingsTable tbody td:nth-child(5) input,
#binanceSettingsTable tbody td:nth-child(5) input,
#bybitSettingsTable tbody td:nth-child(5) input,
#binanceSpotSettingsTable tbody td:nth-child(5) input,
#gateioSettingsTable tbody td:nth-child(5) input,
#okxSettingsTable tbody td:nth-child(5) input {
  background: #2a3a2a !important;
  border-color: var(--green) !important;
}

/* Специальные стили для input'ов в новых столбцах - красные (Fol $) */
#settingsTable tbody td:nth-child(7) input,
#spotSettingsTable tbody td:nth-child(7) input,
#lighterSettingsTable tbody td:nth-child(7) input,
#asterSettingsTable tbody td:nth-child(7) input,
#binanceSettingsTable tbody td:nth-child(7) input,
#bybitSettingsTable tbody td:nth-child(7) input,
#binanceSpotSettingsTable tbody td:nth-child(7) input,
#gateioSettingsTable tbody td:nth-child(7) input,
#okxSettingsTable tbody td:nth-child(7) input {
  background: #3a2a2a !important;
  border-color: var(--red) !important;
}

#settingsTable input[type="text"],
#spotSettingsTable input[type="text"],
#lighterSettingsTable input[type="text"],
#asterSettingsTable input[type="text"],
#binanceSettingsTable input[type="text"],
#bybitSettingsTable input[type="text"],
#binanceSpotSettingsTable input[type="text"],
#gateioSettingsTable input[type="text"],
#okxSettingsTable input[type="text"] {
  width: 120px;
  background: #333;
  color: var(--text);
  border: 1px solid #555;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 13px;
}

#settingsTable input[type="checkbox"],
#spotSettingsTable input[type="checkbox"],
#lighterSettingsTable input[type="checkbox"],
#asterSettingsTable input[type="checkbox"],
#binanceSettingsTable input[type="checkbox"],
#bybitSettingsTable input[type="checkbox"],
#binanceSpotSettingsTable input[type="checkbox"],
#gateioSettingsTable input[type="checkbox"],
#okxSettingsTable input[type="checkbox"] {
  transform: scale(1.3);
  accent-color: var(--accent);
}

#settingsTable select,
#spotSettingsTable select,
#lighterSettingsTable select,
#asterSettingsTable select,
#binanceSettingsTable select,
#bybitSettingsTable select,
#binanceSpotSettingsTable select,
#gateioSettingsTable select,
#okxSettingsTable select {
  background: #333;
  color: var(--text);
  border: 1px solid #555;
  border-radius: 4px;
  padding: 6px 8px;
  min-width: 120px;
  font-size: 13px;
}

#settingsTable select option,
#spotSettingsTable select option,
#lighterSettingsTable select option,
#asterSettingsTable select option,
#binanceSettingsTable select option,
#bybitSettingsTable select option,
#binanceSpotSettingsTable select option,
#gateioSettingsTable select option,
#okxSettingsTable select option {
  background: #333;
  color: var(--text);
}

/* Стили для таблицы настроек лимитных ордеров */
#limitOrderSettingsTable,
#spotLimitOrderSettingsTable { 
  width: 100%; 
  border-collapse: collapse; 
  font-size: 13px; 
}

#limitOrderSettingsTable th, 
#limitOrderSettingsTable td,
#spotLimitOrderSettingsTable th,
#spotLimitOrderSettingsTable td { 
  padding: 8px 12px; 
  border-bottom: 1px solid #2a2a2a; 
  text-align: center;
  vertical-align: middle;
}

#limitOrderSettingsTable th,
#spotLimitOrderSettingsTable th {
  background: #232323;
  font-weight: 600;
  color: var(--accent);
  position: sticky;
  top: 0;
  z-index: 1;
}

#limitOrderSettingsTable th:first-child,
#spotLimitOrderSettingsTable th:first-child {
  text-align: left;
}

#limitOrderSettingsTable td:first-child,
#spotLimitOrderSettingsTable td:first-child {
  text-align: left;
  font-weight: 600;
  color: var(--text);
}

#limitOrderSettingsTable input[type="number"],
#spotLimitOrderSettingsTable input[type="number"] { 
  width: 70px; 
  background: #333;
  color: var(--text);
  border: 1px solid #555;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 13px;
  text-align: center;
}

#limitOrderSettingsTable input[type="checkbox"],
#spotLimitOrderSettingsTable input[type="checkbox"] {
  transform: scale(1.3);
  accent-color: var(--accent);
}

#limitOrderSettingsTable select,
#spotLimitOrderSettingsTable select {
  background: #333;
  color: var(--text);
  border: 1px solid #555;
  border-radius: 4px;
  padding: 6px 8px;
  min-width: 120px;
  font-size: 13px;
}

#limitOrderSettingsTable select option,
#spotLimitOrderSettingsTable select option {
  background: #333;
  color: var(--text);
}

.ui-row { 
  display: flex; 
  gap: 12px; 
  align-items: center; 
  background: #2a2a2a;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid #333;
}

.ui-row label { 
  display: flex; 
  gap: 6px; 
  align-items: center; 
  font-weight: 600;
}

.ui-row input {
  background: #333;
  color: var(--text);
  border: 1px solid #555;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 14px;
}

.colors-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  background: #2a2a2a;
  padding: 15px;
  border-radius: 6px;
  border: 1px solid #333;
  margin-bottom: 15px;
}

.color-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.color-setting label {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  min-width: 120px;
}

.color-setting input[type="color"] {
  width: 50px;
  height: 35px;
  border: 1px solid #555;
  border-radius: 6px;
  background: #333;
  cursor: pointer;
  padding: 2px;
}

.color-setting input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.color-setting input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 4px;
}

/* Справка по настройкам */
.settings-help {
  background: #2a2a2a;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 15px;
  margin-top: 10px;
  margin-bottom: 10px;
}

/* Секция отслеживания кошельков */
.wallet-tracking-section {
  background: #2a2a2a;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 15px;
}

.wallet-add-form {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.wallet-add-form input[type="text"] {
  background: #333;
  color: var(--text);
  border: 1px solid #555;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 13px;
}

.wallet-add-form input[type="color"] {
  width: 40px;
  height: 35px;
  border: 1px solid #555;
  border-radius: 4px;
  background: #333;
  cursor: pointer;
  padding: 2px;
}

.wallet-add-form button {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  padding: 8px 16px;
  font-size: 13px;
}

.wallet-add-form button:hover {
  background: #4a86ff;
  border-color: #4a86ff;
}

.tracked-wallets-list {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #444;
  border-radius: 4px;
  background: #1a1a1a;
}

.wallet-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid #333;
  transition: background 0.2s ease;
}

.wallet-item:last-child {
  border-bottom: none;
}

.wallet-item:hover {
  background: #333;
}

.wallet-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.wallet-color-indicator {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid #555;
  flex-shrink: 0;
}

.wallet-address {
  font-family: monospace;
  font-size: 12px;
  color: var(--accent);
  min-width: 100px;
}

.wallet-winrate {
  font-family: monospace;
  font-size: 13px;
  font-weight: 700;
  cursor: help;
  padding: 1px 3px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.2);
  transition: background 0.2s;
  margin: 0;
}

.wallet-winrate:hover {
  background: rgba(0, 0, 0, 0.4);
}

.cancelled-order {
  opacity: 0.6;
  background: rgba(200, 75, 75, 0.1) !important;
}

.copy-address-btn {
  margin: 0;
  padding: 0;
  font-size: 11px;
  background: transparent;
  border: none;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  line-height: 1;
}

.copy-address-btn:hover {
  opacity: 1;
}

.wallet-description {
  font-size: 13px;
  color: var(--text);
  flex: 1;
}

.wallet-remove {
  background: var(--red);
  border: 1px solid var(--red);
  color: white;
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wallet-remove:hover {
  background: #d85555;
  border-color: #d85555;
}

.wallet-help {
  margin-top: 15px;
  margin-bottom: 0;
}

.wallet-help p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

/* Секция черного списка */
.blacklist-section {
  background: #2a2a2a;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 15px;
}

.blacklist-add-form {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.blacklist-add-form input[type="text"] {
  background: #333;
  color: var(--text);
  border: 1px solid #555;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 13px;
}

.blacklist-add-form button {
  background: var(--red);
  border-color: var(--red);
  color: white;
  padding: 8px 16px;
  font-size: 13px;
}

.blacklist-add-form button:hover {
  background: #d85555;
  border-color: #d85555;
}

.blacklist-list {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #444;
  border-radius: 4px;
  background: #1a1a1a;
}

.blacklist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid #333;
  transition: background 0.2s ease;
}

.blacklist-item:last-child {
  border-bottom: none;
}

.blacklist-item:hover {
  background: #333;
}

.blacklist-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.blacklist-address {
  font-family: monospace;
  font-size: 12px;
  color: var(--red);
  min-width: 100px;
}

.clickable-address {
  cursor: pointer;
  transition: color 0.2s ease;
}

.clickable-address:hover {
  color: var(--accent) !important;
  text-decoration: underline;
}

.blacklist-reason {
  font-size: 13px;
  color: var(--text);
  flex: 1;
}

.blacklist-remove {
  background: var(--red);
  border: 1px solid var(--red);
  color: white;
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.blacklist-remove:hover {
  background: #d85555;
  border-color: #d85555;
}

.blacklist-help {
  margin-top: 15px;
  margin-bottom: 0;
}

.blacklist-help p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.settings-help h4 {
  margin: 0 0 10px 0;
  color: var(--accent);
  font-size: 14px;
}

.settings-help ul {
  margin: 0;
  padding-left: 20px;
  line-height: 1.5;
}

.settings-help li {
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--muted);
}

.settings-help strong {
  color: var(--text);
}

/* Глобальные настройки */
.global-settings-section {
  background: #222;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 16px;
  margin: 16px 0;
}

.global-settings-section h4, .global-settings-section h5 {
  margin: 0 0 12px 0;
  color: var(--accent);
  font-size: 15px;
}

.global-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-control input {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 4px;
  color: #fff;
  padding: 8px 12px;
  font-size: 13px;
  min-width: 200px;
}

.search-control input:focus {
  border-color: var(--accent);
  outline: none;
}

.global-settings-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: start;
}

.global-setting {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.global-setting label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.global-setting input,
.global-setting select {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 4px;
  color: #fff;
  padding: 6px 8px;
  font-size: 12px;
}

.global-setting input:focus,
.global-setting select:focus {
  border-color: var(--accent);
  outline: none;
}

.apply-global-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  align-self: flex-start;
  transition: background 0.2s ease;
}

.apply-global-btn:hover {
  background: #2c5bcd;
}

.apply-global-btn:active {
  transform: scale(0.98);
}

/* Секция глобальных звуков */
.global-sounds-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #333;
}

.global-sounds-section h6 {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

.global-sounds-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.global-sound-setting {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.global-sound-setting label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.global-sound-setting select {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 4px;
  color: #fff;
  padding: 6px 8px;
  font-size: 12px;
}

.global-sound-setting select:focus {
  border-color: var(--accent);
  outline: none;
}

/* Кнопки */
button {
  background: #333;
  color: var(--text);
  border: 1px solid #555;
  border-radius: 6px;
  padding: 10px 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 600;
}

button:hover {
  background: #444;
  border-color: #666;
  transform: translateY(-1px);
}

button:active {
  background: #555;
  transform: translateY(0);
}

/* Меню кнопок в диалоге */
menu {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin: 0;
  padding: 0;
  border-top: 1px solid #333;
  padding-top: 15px;
}

menu button:first-child {
  background: var(--accent);
  border-color: var(--accent);
}

menu button:first-child:hover {
  background: #4a86ff;
  border-color: #4a86ff;
}

/* Лента отмененных стенок */
.canceled-walls-strip {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1a1a1a;
  border-top: 2px solid #333;
  padding: 8px;
  z-index: 100;
  max-height: 100px;
  overflow: hidden;
}

.strip-header {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Кнопка скрытия/показа ленты */
.toggle-strip-btn {
  background: transparent;
  border: 1px solid #333;
  color: var(--muted);
  font-size: 12px;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  min-width: 24px;
  height: 24px;
  justify-content: center;
}

.toggle-strip-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(1.1);
}

.toggle-strip-btn:active {
  transform: scale(0.95);
}

.toggle-arrow {
  transition: transform 0.3s ease;
  font-size: 10px;
  line-height: 1;
}

/* Анимация скрытия/показа ленты */
.canceled-walls-strip .strip-content {
  transition: all 0.3s ease;
  overflow: hidden;
}

.canceled-walls-strip.collapsed {
  padding-bottom: 4px;
}

.canceled-walls-strip.collapsed .strip-content {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
}

.strip-content {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.canceled-wall {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 6px 10px;
  white-space: nowrap;
  min-width: 240px;
  font-size: 12px;
  animation: slideInFromRight 0.3s ease-out;
  position: relative;
}

.canceled-wall.bid {
  border-left: 3px solid var(--green);
}

.canceled-wall.ask {
  border-left: 3px solid var(--red);
}

.wall-exchange {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #fff;
  background: #555;
}

.wall-exchange-hyperliquid { background: #3fb950; }
.wall-exchange-binance { background: #f0b90b; color: #000; }
.wall-exchange-binance_spot { background: #d4a20a; color: #000; }
.wall-exchange-bybit { background: #f7a600; color: #000; }
.wall-exchange-aster { background: #e84142; }
.wall-exchange-lighter { background: #00bfff; color: #000; }
.wall-exchange-gateio { background: #7B3FF2; }
.wall-exchange-okx { background: #2563EB; }

.wall-coin {
  font-weight: 600;
  color: var(--accent);
  min-width: 45px;
}

.wall-side {
  font-size: 10px;
  padding: 3px 7px;
  border-radius: 3px;
  font-weight: 600;
  min-width: 35px;
  text-align: center;
}

.canceled-wall.bid .wall-side {
  background: var(--green);
  color: white;
}

.canceled-wall.ask .wall-side {
  background: var(--red);
  color: white;
}

.wall-price {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  min-width: 65px;
}

.wall-volume {
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-weight: 600;
  min-width: 75px;
}

.wall-reason {
  font-size: 14px;
  min-width: 20px;
  text-align: center;
  opacity: 0.8;
}

.wall-time {
  color: var(--muted);
  font-size: 11px;
  margin-left: auto;
  min-width: 30px;
  text-align: right;
}

@keyframes slideInFromRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Специальные цвета для разных причин отмены */
.canceled-wall[data-reason="timeout"] {
  border-bottom-color: var(--orange);
}

.canceled-wall[data-reason="reduced"] {
  border-bottom-color: var(--purple);
}

.canceled-wall[data-reason="removed"] {
  border-bottom-color: var(--red);
}

.canceled-wall[data-reason="resumed"] {
  border-bottom-color: var(--green);
  background: #2a3a2a;
}

/* Скроллбары */
.strip-content::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar,
::-webkit-scrollbar {
  width: 8px;
  height: 6px;
}

.strip-content::-webkit-scrollbar-track,
.table-wrap::-webkit-scrollbar-track,
::-webkit-scrollbar-track {
  background: #1a1a1a;
  border-radius: 3px;
}

.strip-content::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb,
::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 3px;
}

.strip-content::-webkit-scrollbar-thumb:hover,
.table-wrap::-webkit-scrollbar-thumb:hover,
::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Анимация для обновления времени */
.wall-time.updated {
  animation: timeUpdate 0.5s ease;
}

@keyframes timeUpdate {
  0% {
    color: var(--accent);
    transform: scale(1.1);
  }
  100% {
    color: var(--muted);
    transform: scale(1);
  }
}

/* Секция лимитных ордеров */
.limit-orders-section {
  position: fixed;
  bottom: 45px; /* Точно над лентой отмененных стенок */
  left: 0;
  right: 0;
  height: calc(50vh - 45px); /* Половина экрана минус высота ленты */
  background: var(--bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 50;
}

/* Перетаскиваемый разделитель */
.draggable-splitter {
  width: 100%;
  height: 8px;
  background: #2a2a2a;
  border-top: 1px solid #444;
  border-bottom: 1px solid #444;
  cursor: ns-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 60;
  transition: background-color 0.2s ease;
  flex-shrink: 0;
}

.draggable-splitter:hover {
  background: #3a3a3a;
}

.draggable-splitter.dragging {
  background: var(--accent);
  border-color: var(--accent);
}

.splitter-handle {
  width: 40px;
  height: 3px;
  background: #666;
  border-radius: 2px;
  transition: all 0.2s ease;
}

.draggable-splitter:hover .splitter-handle {
  background: #888;
  width: 60px;
}

.draggable-splitter.dragging .splitter-handle {
  background: white;
  width: 80px;
  height: 4px;
}

/* Стили для состояния перетаскивания */
.dragging-splitter {
  cursor: ns-resize !important;
}

.dragging-splitter * {
  cursor: ns-resize !important;
}

.section-header {
  font-size: 10px;
  color: var(--muted);
  padding: 4px 10px;
  font-weight: 600;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

/* Кнопка паузы для лимитных ордеров */
.pause-btn {
  background: transparent;
  border: 1px solid #333;
  color: var(--muted);
  font-size: 14px;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-right: 8px;
}

.pause-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}

.pause-btn:active {
  transform: scale(0.95);
}

/* Кнопка загрузки временных ордеров */
.load-btn {
  background: transparent;
  border: 1px solid #333;
  color: var(--muted);
  font-size: 14px;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-right: 8px;
}

.load-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}

.load-btn:active {
  transform: scale(0.95);
}

.load-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  border-color: #222;
  color: #555;
}

.load-btn:disabled:hover {
  background: transparent;
  border-color: #222;
  color: #555;
  transform: scale(1);
}

.limit-order-filters {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sort-select {
  background: var(--panel);
  color: var(--text);
  border: 1px solid #333;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 10px;
  cursor: pointer;
}

.sort-select:hover {
  border-color: var(--accent);
}

.sort-select option {
  background: var(--panel);
  color: var(--text);
}

.coin-name:hover {
  color: var(--accent) !important;
  text-decoration: underline !important;
}

.mexc-link {
  font-weight: bold;
  font-size: 10px;
  padding: 1px 3px;
  border-radius: 2px;
  background: #ff6b35;
  color: white !important;
}

.mexc-link:hover {
  background: #ff8c69 !important;
  text-decoration: none !important;
}

.limit-orders-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(var(--grid-cols), 1fr);
  grid-auto-rows: min-content;
  gap: 8px;
  padding: 8px;
  overflow-y: auto;
  align-items: start;
}

/* SPOT лимитные ордера используют настройки SPOT сетки */
.limit-orders-spot .limit-orders-grid {
  grid-template-columns: repeat(var(--spot-grid-cols), 1fr);
}

.limit-order-panel {
  background: var(--panel);
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  overflow: hidden;
  animation: slideIn 0.3s ease-out;
  height: fit-content;
}

.limit-order-panel .panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 8px;
  background: #2a2a2a;
  font-size: 11px;
}

.order-title {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  line-height: 1.2;
}

.order-title > * {
  margin: 0;
  padding: 0;
}

.order-title .coin-name {
  color: white;
  font-weight: bold;
  font-size: 12px;
}

.order-title a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

.order-title a:hover {
  color: var(--green);
  text-decoration: underline;
}

.order-title .wallet-address {
  display: inline-flex;
  align-items: center;
  gap: 0;
  min-width: auto;
}

.address-link {
  font-family: monospace;
  font-size: 11px;
}

.tx-link {
  font-size: 11px;
}

.order-details {
  padding: 6px 8px;
  background: #2c2c2c;
  margin: 3px 5px;
  border-radius: 4px;
  border: 1px solid #444;
  position: relative;
  overflow: hidden;
}

.order-details.long {
  border-left: 3px solid var(--green);
  background: linear-gradient(90deg, rgba(63,185,80,0.1) 0%, transparent 100%);
}

.order-details.short {
  border-left: 3px solid var(--red);
  background: linear-gradient(90deg, rgba(200,75,75,0.1) 0%, transparent 100%);
}

.order-row {
  display: grid;
  grid-template-columns: 55px 1fr auto;
  gap: 8px;
  align-items: center;
}

.price-gap {
  font-weight: 600;
  font-size: 11px;
  text-align: center;
  padding: 2px 5px;
  background: #333;
  border-radius: 3px;
  border: 1px solid #555;
  min-width: 45px;
}

.order-details.long .price-gap {
  color: var(--green);
  border-color: var(--green);
}

.order-details.short .price-gap {
  color: var(--red);
  border-color: var(--red);
}

.order-price {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 12px;
  color: var(--text);
}

.order-volume {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 12px;
  color: var(--accent);
}

/* Кнопка копирования адреса */
.copy-address-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
  padding: 1px 2px;
  margin: 0 2px;
  border-radius: 2px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

.copy-address-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent);
  transform: scale(1.1);
}

.copy-address-btn:active {
  transform: scale(0.95);
}

/* Уведомление о копировании */
.copy-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 6px;
  color: white;
  font-size: 14px;
  font-weight: 600;
  transform: translateX(100%);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1000;
  pointer-events: none;
}

.copy-notification.success {
  background: var(--green);
}

.copy-notification.error {
  background: var(--red);
}

.copy-notification.show {
  transform: translateX(0);
  opacity: 1;
}

/* Адаптация сетки стенок под лимитные ордера - управляется через #grid */

/* Диалог истории лимитных ордеров */
.history-form {
  display: grid;
  gap: 15px;
  min-width: 800px;
  max-width: 95vw;
  padding: 20px;
}

.history-content {
  max-height: 70vh;
  overflow-y: auto;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 10px;
  background: #1a1a1a;
}

.loading {
  text-align: center;
  color: var(--muted);
  padding: 20px;
}

.history-item {
  background: var(--panel);
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  margin-bottom: 10px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.history-item:hover {
  border-color: var(--accent);
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #2a2a2a;
  cursor: pointer;
  user-select: none;
}

.history-header:hover {
  background: #333;
}

.history-main-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.history-side {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.history-side.long {
  background: rgba(63, 185, 80, 0.2);
  color: #3fb950;
  border: 1px solid rgba(63, 185, 80, 0.3);
}

.history-side.short {
  background: rgba(200, 75, 75, 0.2);
  color: #c84b4b;
  border: 1px solid rgba(200, 75, 75, 0.3);
}

.history-price {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.history-coin {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

.history-tx {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  font-family: monospace;
}

.history-tx:hover {
  color: var(--accent);
  text-decoration: underline;
}

.history-address {
  font-size: 12px;
  color: var(--muted);
  font-family: monospace;
}

.history-expand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.history-expand-icon {
  transition: transform 0.3s ease;
}

.history-item.expanded .history-expand-icon {
  transform: rotate(180deg);
}

.history-details {
  display: none;
  border-top: 1px solid #333;
  padding: 0;
}

.history-item.expanded .history-details {
  display: block;
}

.history-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #2a2a2a;
}

.history-action:last-child {
  border-bottom: none;
}

.history-action-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.history-action-type {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.history-action-type.created {
  background: var(--green);
  color: white;
}

.history-action-type.modified {
  background: var(--orange);
  color: white;
}

.history-action-type.cancelled {
  background: var(--red);
  color: white;
}

.history-action-type.filled {
  background: var(--purple);
  color: white;
}

.history-action-details {
  font-size: 13px;
  color: var(--text);
}

.history-action-time-block {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.history-action-time {
  font-size: 11px;
  color: var(--muted);
  font-family: monospace;
}

.history-tx-link {
  font-size: 10px;
  color: var(--muted);
  text-decoration: none;
  font-family: monospace;
  padding: 2px 4px;
  background: rgba(61, 123, 253, 0.1);
  border-radius: 3px;
  border: 1px solid rgba(61, 123, 253, 0.2);
  transition: all 0.2s ease;
}

.history-tx-link:hover {
  color: var(--accent);
  background: rgba(61, 123, 253, 0.2);
  border-color: var(--accent);
  text-decoration: none;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
  .settings-form {
    min-width: 95vw;
    padding: 15px;
  }
  
  .grid {
    grid-template-columns: 1fr;
    --grid-cols: 1;
    padding-bottom: 10px;
  }
  
  /* Мобильные стили для разделителя */
  .draggable-splitter {
    height: 12px; /* Увеличиваем высоту для лучшего касания */
  }
  
  .splitter-handle {
    width: 60px; /* Больше для мобильных */
    height: 4px;
  }
  
  .draggable-splitter:hover .splitter-handle,
  .draggable-splitter.dragging .splitter-handle {
    width: 80px;
    height: 5px;
  }
  
  .table-wrap {
    max-height: 50vh;
  }

  #settingsTable,
  #spotSettingsTable,
  #lighterSettingsTable,
  #asterSettingsTable {
    font-size: 11px;
  }

  #settingsTable th,
  #settingsTable td,
  #spotSettingsTable th,
  #spotSettingsTable td,
  #lighterSettingsTable th,
  #lighterSettingsTable td,
  #asterSettingsTable th,
  #asterSettingsTable td {
    padding: 6px 8px;
  }

  #settingsTable input[type="number"],
  #settingsTable input[type="text"],
  #spotSettingsTable input[type="number"],
  #spotSettingsTable input[type="text"],
  #lighterSettingsTable input[type="number"],
  #lighterSettingsTable input[type="text"],
  #asterSettingsTable input[type="number"],
  #asterSettingsTable input[type="text"] {
    width: 60px;
    padding: 4px 6px;
    font-size: 12px;
  }

  #settingsTable select,
  #spotSettingsTable select,
  #lighterSettingsTable select,
  #asterSettingsTable select {
    min-width: 100px;
    font-size: 12px;
  }
  
  .row {
    grid-template-columns: 35px 1fr 1fr 100px;
    padding: 4px;
    margin: 4px;
  }

  .row .price {
    font-size: 11px;
  }

  .row .pos {
    width: 30px;
    font-size: 9px;
  }

  .row .volume {
    font-size: 10px;
  }
  
  .canceled-walls-strip {
    max-height: 80px;
    padding: 6px;
  }
  
  .strip-header {
    font-size: 11px;
    margin-bottom: 4px;
    gap: 6px;
  }
  
  .toggle-strip-btn {
    min-width: 20px;
    height: 20px;
    padding: 2px 4px;
    font-size: 10px;
  }
  
  .toggle-arrow {
    font-size: 9px;
  }
  
  .canceled-wall {
    min-width: 200px;
    font-size: 11px;
    padding: 4px 8px;
  }
  
  .wall-side {
    font-size: 9px;
    padding: 2px 5px;
  }
  
  .wall-time {
    font-size: 10px;
  }
  
  .wall-coin {
    min-width: 35px;
  }
  
  .wall-price {
    min-width: 55px;
  }
  
  .wall-volume {
    min-width: 65px;
  }
  
  .settings-help {
    padding: 12px;
  }
  
  .settings-help ul {
    padding-left: 15px;
  }
  
  .settings-help li {
    font-size: 12px;
  }
  
  /* Мобильные стили для глобальных настроек */
  .global-settings-section {
    padding: 12px;
    margin: 12px 0;
  }
  
  .global-settings-section h4, .global-settings-section h5 {
    font-size: 14px;
  }
  
  .global-sounds-section h6 {
    font-size: 13px;
  }
  
  .global-settings-controls {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .global-sounds-controls {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .global-sound-setting {
    gap: 2px;
  }
  
  .global-sound-setting label {
    font-size: 11px;
  }
  
  .global-sound-setting select {
    font-size: 11px;
    padding: 4px 6px;
  }
  
  .search-control {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  
  .search-control input {
    min-width: unset;
    font-size: 12px;
    padding: 6px 10px;
  }
  
  .global-setting {
    gap: 2px;
  }
  
  .global-setting label {
    font-size: 11px;
  }
  
  .global-setting input,
  .global-setting select {
    font-size: 11px;
    padding: 4px 6px;
  }
  
  .apply-global-btn {
    font-size: 12px;
    padding: 8px 16px;
    align-self: stretch;
    margin-top: 8px;
  }
  
  .ui-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .history-form {
    min-width: 95vw;
    padding: 15px;
  }
  
  .history-main-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  
  .history-action {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .history-action-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  
  .history-action-time-block {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

@media (max-width: 480px) {
  .settings-form {
    min-width: 100vw;
    padding: 10px;
  }

  #settingsTable,
  #spotSettingsTable,
  #lighterSettingsTable,
  #asterSettingsTable {
    font-size: 10px;
  }

  #settingsTable input[type="number"],
  #settingsTable input[type="text"],
  #spotSettingsTable input[type="number"],
  #spotSettingsTable input[type="text"],
  #lighterSettingsTable input[type="number"],
  #lighterSettingsTable input[type="text"],
  #asterSettingsTable input[type="number"],
  #asterSettingsTable input[type="text"] {
    width: 50px;
  }

  #settingsTable select,
  #spotSettingsTable select,
  #lighterSettingsTable select,
  #asterSettingsTable select {
    min-width: 80px;
  }
  
  .canceled-wall {
    min-width: 180px;
  }
  
  .history-form {
    min-width: 100vw;
    padding: 10px;
  }
  
  .history-price {
    font-size: 14px;
  }
  
  .history-coin {
    font-size: 12px;
  }
  
  .history-tx {
    font-size: 10px;
  }
  
  .history-address {
    font-size: 10px;
  }
  
  /* Уведомление о копировании на мобильных */
  .copy-notification {
    top: 10px;
    right: 10px;
    left: 10px;
    text-align: center;
  }
}

/* Стили для фильтров истории */
.history-filters {
  margin-bottom: 16px;
  padding: 12px;
  background: #222;
  border-radius: 8px;
  border: 1px solid #333;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}

.filter-group label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.filter-group input {
  padding: 6px 8px;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 4px;
  color: var(--text);
  font-size: 13px;
}

.filter-group input:focus {
  outline: none;
  border-color: var(--accent);
}

.filter-group input::placeholder {
  color: var(--muted);
}

.apply-filters-btn, .clear-filters-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
  margin-top: auto;
}

.apply-filters-btn {
  background: var(--accent);
  color: white;
}

.apply-filters-btn:hover {
  background: #2c5bcd;
}

.clear-filters-btn {
  background: #444;
  color: var(--text);
}

.clear-filters-btn:hover {
  background: #555;
}

/* Стили для пагинации */
.history-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding: 12px;
  background: #222;
  border-radius: 8px;
  border: 1px solid #333;
  flex-wrap: wrap;
  gap: 8px;
}

.pagination-btn {
  padding: 6px 12px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.pagination-btn:hover:not(:disabled) {
  background: #2c5bcd;
}

.pagination-btn:disabled {
  background: #444;
  color: var(--muted);
  cursor: not-allowed;
}

.page-info {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}

.pagination-info {
  font-size: 11px;
  color: var(--muted);
}

.records-info {
  font-size: 11px;
  color: var(--muted);
}

/* Адаптивность фильтров и пагинации для мобильных устройств */
@media (max-width: 600px) {
  .filter-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-group {
    min-width: unset;
  }
  
  .apply-filters-btn, .clear-filters-btn {
    margin-top: 8px;
  }
  
  .history-pagination {
    flex-direction: column;
    text-align: center;
  }
  
  .pagination-btn {
    width: 100%;
    max-width: 120px;
  }
}

/* Стили для истории стенок */
.walls-history-content {
  max-height: 60vh;
  overflow-y: auto;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 10px;
  background: #1a1a1a;
}

.walls-history-content .canceled-wall {
  margin-bottom: 8px;
  padding: 8px 12px;
  background: #2a2a2a;
  border-radius: 6px;
  border: 1px solid #444;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.walls-history-content .canceled-wall:hover {
  background: #333;
}

.walls-history-content .wall-time {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
}

/* Стили для аналитики */
.analytics-content {
  max-height: 60vh;
  overflow-y: auto;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 15px;
  background: #1a1a1a;
  margin-bottom: 15px;
}

.analytics-stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.analytics-stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background: #2a2a2a;
  border-radius: 6px;
  border-left: 3px solid var(--accent);
}

.analytics-stat-label {
  font-weight: 500;
  color: var(--fg);
}

.analytics-stat-value {
  font-weight: 600;
  font-size: 16px;
  color: var(--accent);
}

.analytics-stat-item.winrate {
  border-left-color: var(--green);
}

.analytics-stat-item.winrate .analytics-stat-value {
  color: var(--green);
}

.analytics-stat-item.filled {
  border-left-color: var(--green);
}

.analytics-stat-item.cancelled {
  border-left-color: var(--red);
}

.analytics-stat-item.timeout {
  border-left-color: var(--orange);
}

/* Стили для финального действия в истории */
.history-action.final-action {
  border-left: 3px solid var(--accent);
  background: rgba(52, 152, 219, 0.1);
  padding-left: 12px;
}

.history-action.final-action .history-action-type.filled {
  color: white;
  font-weight: bold;
}

.history-action.final-action .history-action-type.cancelled {
  color: white;
  font-weight: bold;
}

.history-action-price {
  font-size: 11px;
  color: var(--muted);
  margin-left: 8px;
  font-family: 'Courier New', monospace;
}

/* Стили для статуса ордера в заголовке истории */
.history-status {
  font-size: 12px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
}

.history-status.filled {
  background: rgba(39, 174, 96, 0.2);
  color: #27ae60;
  border: 1px solid rgba(39, 174, 96, 0.3);
}

.history-status.cancelled {
  background: rgba(231, 76, 60, 0.2);
  color: #e74c3c;
  border: 1px solid rgba(231, 76, 60, 0.3);
}

/* УЛУЧШЕНИЕ: Стили для объема в названии монеты - белый жирный как название */
.history-volume {
  font-size: inherit;  /* Такой же размер как у названия монеты */
  color: white;        /* Белый цвет */
  font-weight: bold;   /* Жирный шрифт */
  margin-left: 4px;
}

/* УЛУЧШЕНИЕ: Стили для кликабельного кошелька */
.clickable-wallet {
  cursor: pointer;
  transition: color 0.2s;
  user-select: none;
}

.clickable-wallet:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* УЛУЧШЕНИЕ: Адаптивность для фильтров (теперь 3 поля) */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.filter-group {
  flex: 1;
  min-width: 120px;
}

@media (max-width: 768px) {
  .filter-group {
    min-width: 100px;
    flex: 1 1 calc(50% - 5px);
  }
  
  .filter-group:nth-child(3) {
    flex: 1 1 100%;
  }
}

/* ============ SPOT STYLES ============ */

/* Контейнер для Futures и SPOT grid рядом */
.grids-container {
  display: flex;
  gap: 0;
  width: 100%;
  position: relative;
}

/* Вертикальный разделитель между Futures и SPOT */
.vertical-splitter {
  width: 4px;
  background: linear-gradient(to right, #444 0%, #666 50%, #444 100%);
  cursor: col-resize;
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s;
}

.vertical-splitter:hover {
  background: linear-gradient(to right, #666 0%, #888 50%, #666 100%);
}

.vertical-splitter::before {
  content: '';
  position: absolute;
  left: -2px;
  right: -2px;
  top: 0;
  bottom: 0;
}

/* SPOT grid справа */
.spot-grid {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(var(--spot-cols, 2), minmax(250px, 1fr));
  gap: 8px;
  padding: 8px;
  background: var(--bg);
}

/* SPOT панели монет */
.spot-coin-panel {
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 8px;
  position: relative;
}

.spot-coin-panel .panel-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #333;
}

.spot-coin-panel .coin-title {
  font-weight: 600;
  color: #4ade80;
  font-size: 14px;
}

.spot-coin-panel .coin-title::before {
  content: '🟢 ';
  font-size: 10px;
}

.spot-coin-panel[data-pinned="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(52, 152, 219, 0.3);
}

/* SPOT level rows */
.spot-coin-panel .level-row {
  padding: 4px 6px;
  border-radius: 4px;
  margin: 2px 0;
  font-size: 12px;
  background: rgba(74, 222, 128, 0.05);
  border-left: 2px solid #4ade80;
}

/* Limit Orders с разделением Futures/SPOT */
.limit-orders-split-container {
  display: flex;
  gap: 0;
  width: 100%;
  position: relative;
}

.limit-orders-futures-section {
  flex: 1;
  min-width: 0;
}

.limit-orders-spot-section {
  flex: 1;
  min-width: 0;
}

.limit-orders-spot-section .section-header {
  background: linear-gradient(135deg, #1e1e1e 0%, #2a4a2a 100%);
}

.limit-orders-spot-section .section-header::before {
  content: '🟢 SPOT ';
}

/* Контейнер для лимитных ордеров Futures/SPOT */
.limit-orders-container {
  display: flex;
  flex-direction: row;
  width: 100%;
  height: 100%;
  gap: 0;
  overflow: hidden;
}

.limit-orders-futures,
.limit-orders-spot {
  display: flex;
  flex-direction: column;
  min-width: 20%;
  height: 100%;
  overflow: hidden;
}

.limit-orders-futures {
  width: 50%;
}

.limit-orders-spot {
  width: 50%;
}

/* Ползунки для лимитных ордеров */
#limitOrdersVerticalSplitter {
  width: 8px;
  min-width: 8px;
  background: linear-gradient(90deg, rgba(50, 50, 70, 0.5), rgba(70, 70, 90, 0.5));
  cursor: col-resize;
  position: relative;
  z-index: 100;
  transition: background 0.2s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#limitOrdersVerticalSplitter:hover {
  background: linear-gradient(90deg, rgba(70, 100, 150, 0.7), rgba(90, 120, 170, 0.7));
}

#limitOrdersVerticalSplitter.dragging {
  background: linear-gradient(90deg, rgba(100, 150, 200, 0.9), rgba(120, 170, 220, 0.9));
}

#limitOrdersVerticalSplitter .vertical-splitter-handle {
  width: 2px;
  height: 60px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 1px;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
}

#limitOrdersVerticalSplitter:hover .vertical-splitter-handle {
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 8px rgba(100, 150, 255, 0.5);
}

/* Контейнер стенок - растягивается на всё доступное пространство */
#grid {
  display: flex;
  flex-direction: row;
  width: 100%;
  flex: 1;
  min-height: 0;
  gap: 0;
  overflow: hidden;
  padding-bottom: 100px; /* место для fixed canceled-walls-strip */
}

/* Секции стенок Futures/SPOT (как у лимитных ордеров) */
.walls-section {
  display: flex;
  flex-direction: column;
  min-width: 20%;
  height: 100%;
  overflow: hidden;
}

.futures-walls {
  width: 50%;
}

.spot-walls {
  width: 50%;
}

.walls-header {
  font-size: 11px;
  color: var(--muted);
  padding: 6px 12px;
  font-weight: 600;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.walls-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(var(--grid-cols), 1fr);
  grid-auto-rows: min-content;
  gap: 8px;
  padding: 8px;
  overflow-y: auto;
  align-items: start;
}

/* Отдельная настройка колонок для SPOT стенок */
.spot-walls .walls-grid {
  grid-template-columns: repeat(var(--spot-grid-cols), 1fr);
}

/* Стиль для SPOT стенок заголовка */
.spot-walls .walls-header {
  background: #1a1a1a;
}

/* Ползунок для стенок */
#wallsVerticalSplitter {
  width: 8px;
  min-width: 8px;
  background: linear-gradient(90deg, rgba(50, 50, 70, 0.5), rgba(70, 70, 90, 0.5));
  cursor: col-resize;
  position: relative;
  z-index: 100;
  transition: background 0.2s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#wallsVerticalSplitter:hover {
  background: linear-gradient(90deg, rgba(70, 100, 150, 0.7), rgba(90, 120, 170, 0.7));
}

#wallsVerticalSplitter.dragging {
  background: linear-gradient(90deg, rgba(100, 150, 200, 0.9), rgba(120, 170, 220, 0.9));
}

#wallsVerticalSplitter .vertical-splitter-handle {
  width: 2px;
  height: 60px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 1px;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
}

#wallsVerticalSplitter:hover .vertical-splitter-handle {
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 8px rgba(100, 150, 255, 0.5);
}

.track-order-btn {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 16px;
  padding: 0 5px;
  margin-left: 4px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  opacity: 0.7;
  transition: opacity 0.18s;
}
.track-order-btn:hover { opacity: 1; }

/* ==================== TWAP Styles ==================== */
.twap-panel {
  background: linear-gradient(135deg, #2a2510 0%, #1f1f0d 100%);
  border: 2px solid #fbbf24;
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.15);
  transition: all 0.3s ease;
}

.twap-panel:hover {
  box-shadow: 0 6px 18px rgba(251, 191, 36, 0.25);
  transform: translateY(-2px);
}

.twap-header {
  background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 100%);
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #1a1a0a;
  font-size: 13px;
  position: relative;
}

.twap-delete-btn {
  background: rgba(200, 75, 75, 0.3);
  border: 1px solid rgba(200, 75, 75, 0.5);
  color: #fff;
  padding: 2px 6px;
  cursor: pointer;
  border-radius: 4px;
  margin-left: auto;
  margin-right: 4px;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.2s ease;
  line-height: 1;
}

.twap-delete-btn:hover {
  background: rgba(200, 75, 75, 0.6);
  border-color: rgba(200, 75, 75, 0.8);
  transform: scale(1.15);
}

.twap-delete-btn:active {
  transform: scale(0.95);
}

.twap-toggle-btn {
  background: rgba(0, 0, 0, 0.2);
  border: none;
  color: #1a1a0a;
  font-size: 12px;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 3px;
  transition: all 0.2s;
  font-weight: 700;
}

.twap-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.35);
  transform: scale(1.1);
}

.twap-coin {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.twap-wallet-link {
  color: #fbbf24;
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  background: rgba(251, 191, 36, 0.15);
  border-radius: 3px;
  transition: all 0.2s;
  cursor: pointer;
  display: inline-block;
  font-family: monospace;
}

.twap-wallet-link:hover {
  background: rgba(251, 191, 36, 0.3);
  color: #f59e0b;
  transform: scale(1.05);
}

.twap-interval {
  color: rgba(26, 26, 10, 0.8);
  font-size: 12px;
}

.twap-stats {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.2);
  padding: 2px 8px;
  border-radius: 4px;
}

.twap-body {
  padding: 10px;
  transition: all 0.3s ease;
  overflow: hidden;
}

.twap-body.twap-collapsed {
  max-height: 0;
  padding: 0 10px;
  opacity: 0;
}

.twap-progress {
  background: rgba(251, 191, 36, 0.1);
  height: 18px;
  border-radius: 4px;
  overflow: visible;
  margin-bottom: 8px;
  position: relative;
}

.twap-progress-bar {
  background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 100%);
  height: 100%;
  transition: width 0.5s ease;
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
  border-radius: 4px;
}

.twap-progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  z-index: 1;
}

.twap-info {
  font-size: 12px;
  line-height: 1.6;
}

.twap-position-main {
  font-size: 13px;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(251, 191, 36, 0.2);
}

.twap-position-value {
  color: #fbbf24;
  font-weight: 600;
  margin-left: 4px;
}

.twap-cycles-badge {
  color: #9aa0a6;
  font-size: 11px;
  margin-left: 8px;
}

.twap-cycles-count {
  color: #0ea5e9;
  font-weight: 600;
}

.twap-info-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  color: #d4d4d4;
}

.twap-info-row strong {
  color: #fbbf24;
  font-weight: 600;
}

.twap-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(251, 191, 36, 0.2);
}

.twap-stats-column {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.twap-stats-compact {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  color: #d4d4d4;
}

.twap-stats-compact span {
  display: flex;
  justify-content: space-between;
}

.twap-info-section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(251, 191, 36, 0.2);
}

.twap-info-title {
  font-weight: 600;
  color: #fbbf24;
  margin-bottom: 3px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.twap-info-row .positive {
  color: #4caf50;
  font-weight: 600;
}

.twap-info-row .negative {
  color: #f44336;
  font-weight: 600;
}

.twap-meta {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(251, 191, 36, 0.15);
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #e6e6e6;
}

.twap-meta-item {
  display: flex;
  gap: 6px;
  align-items: center;
}

.twap-meta-item strong {
  color: #fbbf24;
  font-weight: 600;
}

/* TWAP в wallsGrid - адаптация под сетку */
#wallsGrid .twap-panel,
#spotWallsGrid .twap-panel {
  grid-column: span 1;
}

/* ========== FRONTMARKET ПАНЕЛИ ========== */

.frontmarket-panel {
  background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
  border: 2px solid #ffffff;
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
  transition: all 0.3s ease;
}

.frontmarket-panel:hover {
  box-shadow: 0 6px 18px rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.frontmarket-header {
  background: rgba(255, 255, 255, 0.1);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #e6e6e6;
  font-size: 13px;
  border-left: 4px solid #ffffff;
}

.frontmarket-coin {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.frontmarket-volume,
.frontmarket-count,
.frontmarket-countdown {
  font-size: 12px;
  opacity: 0.9;
}

.frontmarket-wallet {
  font-size: 12px;
  color: #e6e6e6;
  text-decoration: none;
  transition: color 0.2s, opacity 0.2s;
  opacity: 0.9;
}

.frontmarket-wallet:hover {
  color: #3fb950;
  opacity: 1;
  text-decoration: underline;
}

.frontmarket-body {
  padding: 12px;
}

.frontmarket-progress {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  height: 24px;
  position: relative;
  overflow: hidden;
}

.frontmarket-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.6));
  transition: width 1s linear;
  border-radius: 4px;
}

.frontmarket-progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  font-weight: 700;
  color: #e6e6e6;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* FrontMarket панели в grid */
#wallsGrid .frontmarket-panel,
#spotWallsGrid .frontmarket-panel {
  grid-column: span 1;
}

/* ========== FRONTMARKET НАСТРОЙКИ ========== */

.frontmarket-settings-section {
  margin: 20px 0;
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.frontmarket-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 20px 0;
}

.frontmarket-setting {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.frontmarket-setting label {
  font-weight: 600;
  color: #e6e6e6;
}

.frontmarket-setting select {
  padding: 8px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: #e6e6e6;
  font-size: 14px;
}

/* ========== TWAP ВИЗУАЛЬНЫЕ ЭФФЕКТЫ ========== */

/* Стили для настроек TWAP */
.twap-settings-section {
  margin: 20px 0;
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.twap-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 20px 0;
}

.twap-setting {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.twap-setting label {
  font-weight: 600;
  color: #e6e6e6;
}

.twap-setting select {
  padding: 8px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: #e6e6e6;
  font-size: 14px;
}

.twap-setting input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.twap-visual-hint {
  font-size: 12px;
  color: #999;
  font-style: italic;
  margin-left: 8px;
}

/* Анимация зеленой вспышки (появление TWAP) */
.twap-flash-green {
  animation: twapFlashGreen 2s ease-out;
}

@keyframes twapFlashGreen {
  0% {
    box-shadow: 0 0 0px rgba(76, 175, 80, 0);
    border-color: transparent;
  }
  10% {
    box-shadow: 0 0 60px rgba(76, 175, 80, 0.9),
                inset 0 0 40px rgba(76, 175, 80, 0.4);
    border-color: rgba(76, 175, 80, 0.8);
    background: rgba(76, 175, 80, 0.1);
  }
  30% {
    box-shadow: 0 0 50px rgba(76, 175, 80, 0.7),
                inset 0 0 30px rgba(76, 175, 80, 0.3);
    border-color: rgba(76, 175, 80, 0.6);
    background: rgba(76, 175, 80, 0.08);
  }
  100% {
    box-shadow: 0 0 0px rgba(76, 175, 80, 0);
    border-color: transparent;
    background: transparent;
  }
}

/* Анимация красной вспышки (исчезновение TWAP) */
.twap-flash-red {
  animation: twapFlashRed 2s ease-out;
}

@keyframes twapFlashRed {
  0% {
    box-shadow: 0 0 0px rgba(244, 67, 54, 0);
    border-color: transparent;
  }
  10% {
    box-shadow: 0 0 60px rgba(244, 67, 54, 0.9),
                inset 0 0 40px rgba(244, 67, 54, 0.4);
    border-color: rgba(244, 67, 54, 0.8);
    background: rgba(244, 67, 54, 0.1);
  }
  30% {
    box-shadow: 0 0 50px rgba(244, 67, 54, 0.7),
                inset 0 0 30px rgba(244, 67, 54, 0.3);
    border-color: rgba(244, 67, 54, 0.6);
    background: rgba(244, 67, 54, 0.08);
  }
  100% {
    box-shadow: 0 0 0px rgba(244, 67, 54, 0);
    border-color: transparent;
    background: transparent;
  }
}
/* Стили для истории временной таблицы */
.temp-history-stats {
  padding: 15px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 6px;
  margin-bottom: 15px;
  font-size: 14px;
}

.temp-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 500px;
  overflow-y: auto;
}

.temp-history-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 12px;
  transition: all 0.2s ease;
}

.temp-history-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.temp-history-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.temp-coin {
  font-weight: 600;
  font-size: 16px;
  color: #fff;
}

.temp-side {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.temp-side.long-side {
  background: rgba(76, 175, 80, 0.2);
  color: #4caf50;
}

.temp-side.short-side {
  background: rgba(244, 67, 54, 0.2);
  color: #f44336;
}

.temp-date {
  margin-left: auto;
  font-size: 12px;
  color: #999;
}

.temp-history-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 13px;
}

.temp-detail {
  color: #ccc;
}

.temp-detail strong {
  color: #fff;
  margin-right: 5px;
}

.copyable-address,
.copyable-hash {
  cursor: pointer;
  color: #3b82f6;
  transition: color 0.2s ease;
}

.copyable-address:hover,
.copyable-hash:hover {
  color: #60a5fa;
  text-decoration: underline;
}

/* Стили для истории временной таблицы */
.temp-history-stats {
  padding: 15px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 6px;
  margin-bottom: 15px;
  font-size: 14px;
}

.temp-table-wrapper {
  max-height: 500px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
}

.temp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: rgba(0, 0, 0, 0.3);
}

.temp-table thead {
  position: sticky;
  top: 0;
  background: rgba(30, 30, 30, 0.95);
  z-index: 10;
}

.temp-table th {
  padding: 12px 10px;
  text-align: left;
  font-weight: 600;
  color: #fff;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  white-space: nowrap;
}

.temp-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background-color 0.2s ease;
}

.temp-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.08);
}

.temp-table td {
  padding: 10px;
  color: #ccc;
  vertical-align: middle;
}

.temp-coin-cell {
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}

.temp-price-cell {
  font-family: 'Courier New', monospace;
  white-space: nowrap;
}

.temp-volume-cell {
  font-weight: 500;
  white-space: nowrap;
}

.temp-date-cell {
  color: #999;
  font-size: 12px;
  white-space: nowrap;
}

.temp-side {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  min-width: 50px;
}

.temp-side.long-side {
  background: rgba(76, 175, 80, 0.2);
  color: #4caf50;
}

.temp-side.short-side {
  background: rgba(244, 67, 54, 0.2);
  color: #f44336;
}

.copyable-address,
.copyable-hash {
  cursor: pointer;
  color: #3b82f6;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.copyable-address:hover,
.copyable-hash:hover {
  color: #60a5fa;
  text-decoration: underline;
}

/* ===== FrontMarket Orders Styles ===== */

.frontmarket-section {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--bg);
  border-bottom: 1px solid #333;
}

.frontmarket-futures,
.frontmarket-spot {
  flex: 1;
  min-width: 0;
}

.frontmarket-section-header {
  font-weight: 600;
  font-size: 14px;
  padding: 8px 12px;
  background: #222;
  border: 1px solid #333;
  border-radius: 6px 6px 0 0;
  text-align: center;
}

.frontmarket-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  background: var(--panel);
  border: 1px solid #333;
  border-top: none;
  border-radius: 0 0 6px 6px;
  min-height: 120px;
  max-height: 400px;
  overflow-y: auto;
}

.frontmarket-order {
  position: relative;
  background: #222;
  border: 2px solid #ffffff;
  border-radius: 8px;
  padding: 12px;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.frontmarket-order.visible {
  opacity: 1;
  transform: translateY(0);
}

.frontmarket-order.removing {
  opacity: 0;
  transform: scale(0.95);
}

.frontmarket-order.spot {
  border-color: #90ee90;
}

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

.frontmarket-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.frontmarket-title .direction-indicator {
  font-size: 16px;
}

.frontmarket-title .coin-name {
  font-size: 16px;
  color: var(--text);
}

.frontmarket-title .volume {
  font-size: 14px;
  color: var(--accent);
  font-weight: 700;
}

.frontmarket-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

.frontmarket-meta .total-count {
  background: rgba(255, 215, 0, 0.15);
  color: #ffd700;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.frontmarket-meta .wallet-address {
  font-family: monospace;
  color: var(--accent);
  cursor: pointer;
}

.frontmarket-meta .wallet-address:hover {
  text-decoration: underline;
}

.frontmarket-meta .countdown {
  font-weight: 700;
  color: var(--orange);
  min-width: 40px;
  text-align: right;
}

.frontmarket-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.frontmarket-progress {
  display: flex;
  align-items: center;
  gap: 12px;
}

.frontmarket-progress-bar {
  flex: 1;
  height: 24px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.frontmarket-progress-fill {
  height: 100%;
  width: 0%;
  transition: width 0.3s ease, background 0.3s ease;
  border-radius: 12px;
}

.frontmarket-progress-text {
  min-width: 50px;
  text-align: right;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}

.frontmarket-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

.frontmarket-info .info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.frontmarket-info .info-row .label {
  color: var(--muted);
}

.frontmarket-info .info-row .value,
.frontmarket-info .info-row .frontmarket-stats {
  color: var(--text);
  font-weight: 600;
}

/* Настройки FrontMarket в диалоге настроек */
.frontmarket-settings-section {
  margin: 16px 0;
}

.frontmarket-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 16px 0;
}

.frontmarket-setting {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.frontmarket-setting label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.frontmarket-setting select {
  background: #2a2a2a;
  color: var(--text);
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
}

.frontmarket-setting select:hover {
  background: #3a3a3a;
  border-color: #4a4a4a;
}

/* Эффект пульсации для новых FrontMarket ордеров */
@keyframes frontmarketPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(255, 255, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

.frontmarket-order.new {
  animation: frontmarketPulse 1s ease-out;
}

/* Адаптивность для маленьких экранов */
@media (max-width: 768px) {
  .frontmarket-section {
    flex-direction: column;
  }

  .frontmarket-settings-grid {
    grid-template-columns: 1fr;
  }
}

/* Стили для сворачиваемых блоков настроек */
.settings-block {
  margin: 10px 0;
  border: 1px solid #333;
  border-radius: 8px;
  background: #1a1a1a;
  overflow: hidden;
}

.settings-block-header {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  margin: 0;
  background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
  cursor: pointer;
  user-select: none;
  transition: all 0.3s ease;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  border-bottom: 1px solid transparent;
}

.settings-block-header:hover {
  background: linear-gradient(135deg, #333 0%, #252525 100%);
}

.settings-block-header.collapsed {
  border-bottom: none;
}

.toggle-icon {
  display: inline-block;
  margin-right: 12px;
  font-size: 14px;
  transition: transform 0.3s ease;
  color: #4a9eff;
}

.settings-block-header.collapsed .toggle-icon {
  transform: rotate(0deg);
}

.settings-block-content {
  padding: 20px;
  background: #0d1117;
  animation: slideDown 0.3s ease;
  contain: layout style;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 10000px;
  }
}

.settings-block-content[style*="display: none"] {
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 1;
    max-height: 10000px;
  }
  to {
    opacity: 0;
    max-height: 0;
  }
}

/* Цветовые маркеры для разных бирж */
.exchange-hyperliquid {
  background-color: rgba(0, 80, 40, 0.3) !important; /* Темно-зеленый */
}

.exchange-aster {
  background-color: rgba(80, 60, 0, 0.3) !important; /* Темно-желтый */
}

.exchange-lighter {
  background-color: rgba(30, 30, 35, 0.5) !important; /* Черно-серый */
}

.exchange-binance {
  background-color: rgba(80, 60, 0, 0.3) !important; /* Темно-желтый Binance */
}

.exchange-gateio {
  background-color: rgba(60, 30, 120, 0.3) !important; /* Темно-фиолетовый Gate.io */
}

.exchange-okx {
  background-color: rgba(13, 24, 48, 0.3) !important; /* Темно-синий OKX */
}

/* Индикаторы подключения для бирж */
.exchange-indicators {
  display: flex;
  gap: 15px;
  align-items: center;
}

.exchange-indicator-group {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  font-size: 12px;
}

.exchange-label {
  font-weight: 600;
  color: #4a9eff;
  min-width: 30px;
}

.exchange-connect-btn {
  background: rgba(100, 200, 100, 0.2);
  border: 1px solid rgba(100, 200, 100, 0.4);
  border-radius: 3px;
  padding: 2px 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.exchange-connect-btn:hover {
  background: rgba(100, 200, 100, 0.4);
  transform: scale(1.1);
}

.exchange-connect-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.exchange-connect-btn.connected {
  background: rgba(100, 200, 100, 0.5);
  border-color: rgba(100, 200, 100, 0.8);
}

/* Aster Settings UI */
.coin-setting-item {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.coin-setting-header {
  margin-bottom: 10px;
}

.coin-name-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
}

.coin-name-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.coin-name {
  color: #fff;
}

.coin-setting-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 10px;
}

.coin-setting-fields label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  color: #aaa;
}

.coin-setting-fields input,
.coin-setting-fields select {
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: #fff;
  font-size: 13px;
}

.coin-setting-fields input:focus,
.coin-setting-fields select:focus {
  outline: none;
  border-color: rgba(100, 200, 100, 0.5);
}

.twitter-link {
  color: #888;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 3px 7px;
  border-radius: 4px;
  border: 1px solid #333;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}
.twitter-link:hover {
  color: #fff;
  border-color: #555;
}
