:root { color-scheme: dark; }
body { font-feature-settings: "tnum" 1, "cv11" 1; }

.sel {
  height: 32px; background: #12161c; border: 1px solid #222933; border-radius: 6px;
  padding: 0 28px 0 10px; font-size: 13px; font-weight: 500; color: #e5e7eb; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237d8794' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
}
.sel:focus { outline: none; border-color: #3b82f6; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px;
  border: 1px solid #222933; font-size: 12px; font-weight: 500; color: #c9ced6; white-space: nowrap;
}
.dot { width: 7px; height: 7px; border-radius: 999px; display: inline-block; }
.dot.pulse { animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }

.kpi { background: #0b0e11; padding: 14px 16px; }
.kpi-l { font-size: 11px; color: #7d8794; text-transform: uppercase; letter-spacing: .04em; font-weight: 500; }
.kpi-v { font-family: 'JetBrains Mono', monospace; font-size: 18px; font-weight: 600; margin-top: 4px; white-space: nowrap; }
.kpi-v small { font-size: 12px; font-weight: 500; }

.tab {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 6px;
  font-size: 13px; color: #7d8794; font-weight: 500; white-space: nowrap;
}
.tab:hover { color: #e5e7eb; background: #12161c; }
.tab.active { color: #e5e7eb; background: #181d25; }
#tabs { overflow-x: auto; scrollbar-width: none; }

.btn-ghost {
  height: 34px; border-radius: 8px; border: 1px solid #222933; font-size: 12px; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; color: #c9ced6; transition: .15s;
}
.btn-ghost:hover:not(:disabled) { background: #12161c; border-color: #3a4350; }
.btn-ghost:disabled { opacity: .4; cursor: not-allowed; }

.stat { display: flex; justify-content: space-between; background: #12161c; border: 1px solid #222933; border-radius: 6px; padding: 8px 10px; }

table.grid-t { width: 100%; font-size: 12px; border-collapse: collapse; }
table.grid-t th { text-align: left; font-weight: 500; color: #7d8794; padding: 8px 16px; border-bottom: 1px solid #222933; position: sticky; top: 0; background: #0b0e11; white-space: nowrap; }
table.grid-t td { padding: 9px 16px; border-bottom: 1px solid #161b22; white-space: nowrap; font-family: 'JetBrains Mono', monospace; }
table.grid-t tr:hover td { background: #0f1318; }

.field label { display: block; font-size: 12px; color: #7d8794; margin-bottom: 6px; font-weight: 500; }
.field input[type=number] {
  width: 100%; height: 36px; background: #12161c; border: 1px solid #222933; border-radius: 6px; padding: 0 10px;
  font-family: 'JetBrains Mono', monospace; font-size: 13px; color: #e5e7eb;
}
.field input:focus { outline: none; border-color: #3b82f6; }
.field .hint { font-size: 11px; color: #5b6470; margin-top: 4px; }

.switch { position: relative; width: 36px; height: 20px; border-radius: 999px; background: #222933; transition: .15s; flex-shrink: 0; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 999px; background: #7d8794; transition: .15s; }
.switch.on { background: #16c784; }
.switch.on::after { left: 18px; background: #fff; }

.toast { background: #181d25; border: 1px solid #222933; border-radius: 8px; padding: 10px 14px; font-size: 13px; display: flex; align-items: center; gap: 8px; animation: slidein .2s ease-out; max-width: 360px; }
@keyframes slidein { from { transform: translateY(8px); opacity: 0 } to { transform: none; opacity: 1 } }

.empty { padding: 48px 16px; text-align: center; color: #5b6470; font-size: 13px; }
.empty svg { margin: 0 auto 10px; opacity: .6; }

.badge { min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: #16c784; color: #000; font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
table.grid-t tr.sel td { background: #121821; }
table.grid-t tr.sel td:first-child { box-shadow: inset 2px 0 0 #3b82f6; }
.pulse-i { animation: pulse 1.4s infinite; }

.pair-opt { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 8px; border: 1px solid #222933; font-size: 13px; text-align: left; transition: .15s; }
.pair-opt:hover:not(:disabled) { background: #181d25; }
.pair-opt.on { border-color: #16c78466; background: #16c7840d; }
.pair-opt:disabled { opacity: .7; cursor: not-allowed; }

/* Settings drawer */
.set-nav { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 6px; font-size: 13px; color: #7d8794; font-weight: 500; white-space: nowrap; text-align: left; }
.set-nav:hover { color: #e5e7eb; background: #12161c; }
.set-nav.active { color: #e5e7eb; background: #181d25; }
.set-card { background: #0f1318; border: 1px solid #222933; border-radius: 10px; padding: 14px 16px; }
.set-row { padding: 12px 0; border-bottom: 1px solid #1a2029; }
.set-row:last-child { border-bottom: 0; padding-bottom: 2px; }
.num-wrap { display: flex; align-items: center; height: 32px; background: #12161c; border: 1px solid #222933; border-radius: 6px; padding: 0 8px; flex-shrink: 0; }
.num-wrap:focus-within { border-color: #3b82f6; }
.num-in { width: 72px; background: transparent; border: 0; outline: none; font-family: 'JetBrains Mono', monospace; font-size: 13px; color: #e5e7eb; text-align: right; -moz-appearance: textfield; }
.num-in::-webkit-outer-spin-button, .num-in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.num-unit { font-size: 11px; color: #7d8794; margin-left: 4px; font-family: 'JetBrains Mono', monospace; }
.rng { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 4px; outline: none; cursor: pointer;
  background: linear-gradient(to right, #3b82f6 0, #3b82f6 var(--p, 0%), #222933 var(--p, 0%), #222933 100%); }
.rng::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 999px; background: #e5e7eb; border: 2px solid #0b0e11; }
.rng::-moz-range-thumb { width: 12px; height: 12px; border-radius: 999px; background: #e5e7eb; border: 2px solid #0b0e11; }
.preset { text-align: left; padding: 10px 12px; border-radius: 8px; border: 1px solid #222933; color: #c9ced6; transition: .15s; }
.preset:hover { background: #12161c; }
.preset.active { border-color: #3b82f6; background: #3b82f60f; color: #e5e7eb; }
.sel-sm { height: 26px; font-size: 11px; padding: 0 24px 0 8px; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #222933; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }
