html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

@media (min-width: 1024px) {
  html, body { height: 100%; overflow: hidden; }
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2b3139; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #474d57; }

.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }

/* Orderbook rows */
.ob-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  padding: 1px 12px;
  position: relative;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.ob-row:hover { background: rgba(255,255,255,0.04); }
.ob-row > span:nth-child(2),
.ob-row > span:nth-child(3) { text-align: right; }
.ob-row .bg {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  z-index: 0;
  opacity: 0.15;
}
.ob-row > span { position: relative; z-index: 1; }
.ob-row.ask .bg { background: #f6465d; }
.ob-row.bid .bg { background: #0ecb81; }

/* Recent trades rows */
.trade-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  padding: 2px 12px;
  font-variant-numeric: tabular-nums;
}
.trade-row > span:nth-child(2),
.trade-row > span:nth-child(3) { text-align: right; }

/* Pair list rows */
.pair-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.8fr;
  padding: 6px 12px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}
.pair-row:hover { background: #1e2329; }
.pair-row.active { background: #1e2329; }
.pair-row > span:nth-child(2),
.pair-row > span:nth-child(3) { text-align: right; }

/* Position / orders / history table */
.pos-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  min-width: 720px;  /* enables horizontal scroll on narrow screens */
}
.pos-table thead th {
  text-align: left;
  font-weight: 400;
  color: #848e9c;
  font-size: 11px;
  padding: 8px 12px;
  border-bottom: 1px solid #2b3139;
  background: #181a20;
  position: sticky;
  top: 0;
  z-index: 1;
  white-space: nowrap;
}
.pos-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #1e2329;
  white-space: nowrap;
}
.pos-table tbody tr:hover { background: #1e2329; }
.pos-table .num { text-align: right; }

.tag-long { background: rgba(14,203,129,0.12); color: #0ecb81; padding: 2px 6px; border-radius: 2px; font-size: 11px; font-weight: 500; }
.tag-short { background: rgba(246,70,93,0.12); color: #f6465d; padding: 2px 6px; border-radius: 2px; font-size: 11px; font-weight: 500; }
.tag-buy { color: #0ecb81; font-weight: 500; }
.tag-sell { color: #f6465d; font-weight: 500; }

button { cursor: pointer; }
input { font-variant-numeric: tabular-nums; }

#chartContainer { background: #0b0e11; }

.toast-show { transform: translateY(0) !important; opacity: 1 !important; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #5e6673;
  font-size: 12px;
  gap: 8px;
  padding: 32px;
}

/* Mobile drawer slide-in */
#pairDrawer.open #pairDrawerInner { transform: translateX(0); }

/* Avoid input zoom on iOS by ensuring 16px font on focus on mobile only when needed */
@media (max-width: 640px) {
  input[type="text"], input[type="search"] { font-size: 14px; }
}
