/* Темна тема в стилі Telegram, mobile-first */
:root {
  --bg: #1a1a2e;
  --card: #16213e;
  --green: #00d4aa;
  --red: #ff4757;
  --blue: #4ecdc4;
  --yellow: #ffd700;
  --text: #eaeaea;
  --muted: #8892a6;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  min-height: 100vh;
}

.header {
  padding: 12px 14px;
  background: var(--card);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.header-title {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  animation: pulse-dot 2s ease-in-out infinite;
}

.dot.ok {
  background: var(--green);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 2;
}

.tab {
  flex: 1 1 auto;
  min-width: 56px;
  padding: 10px 8px;
  border: none;
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.tab:active {
  transform: scale(0.98);
}

.tab.active {
  background: linear-gradient(135deg, #1f3460, var(--card));
  box-shadow: 0 0 0 1px rgba(78, 205, 196, 0.35);
}

.panel {
  padding: 12px 14px 24px;
}

.panel.hidden {
  display: none;
}

.pair-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  font-weight: 700;
}

.price-pill {
  font-size: 14px;
  color: var(--blue);
}

.chart-wrap {
  max-width: 220px;
  margin: 0 auto 12px;
}

.chart-wrap-sm {
  max-width: 200px;
}

.overview-main-title {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
}

.overview-card {
  padding: 14px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.overview-coin-title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 8px;
}

.overview-stats {
  margin-bottom: 8px;
}

.hourly-line {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.orderbook-wrap {
  margin-bottom: 16px;
}

.orderbook-card {
  padding: 12px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: rgba(22, 33, 62, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  line-height: 1.45;
}

.orderbook-card .ob-line {
  margin-bottom: 4px;
}

.orderbook-card .ob-strong {
  font-weight: 700;
}

.stats-row {
  display: flex;
  justify-content: space-around;
  gap: 12px;
  padding: 10px;
  background: var(--card);
  border-radius: 12px;
  font-size: 14px;
  margin-bottom: 14px;
}

.table-title {
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--muted);
  font-weight: 600;
}

.table-scroll {
  max-height: 42vh;
  overflow: auto;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.trades-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.trades-table th {
  text-align: left;
  padding: 10px 8px;
  color: var(--muted);
  font-weight: 600;
  position: sticky;
  top: 0;
  background: #1a2540;
}

.trades-table td {
  padding: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.trades-table tr.row-new td {
  animation: slide-in 0.35s ease-out;
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.row-whale td {
  background: rgba(255, 215, 0, 0.12);
  font-weight: 700;
  font-size: 14px;
}

.row-buy .type-cell {
  color: var(--green);
}

.row-sell .type-cell {
  color: var(--red);
}

.whale-list {
  padding: 8px;
}

.whale-card {
  padding: 12px;
  margin-bottom: 8px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  animation: slide-in 0.3s ease-out;
}

.whale-card .line1 {
  font-weight: 700;
  font-size: 15px;
}

.whale-card .line2 {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.liq-totals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.liq-total-box {
  padding: 12px;
  border-radius: 12px;
  background: var(--card);
  font-size: 14px;
}

.liq-row {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
}

.liq-row.whale {
  background: rgba(255, 215, 0, 0.1);
  font-weight: 600;
}

.whale-flash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
  color: var(--yellow);
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  padding: 24px;
  animation: flash-in 0.25s ease-out;
}

.whale-flash.hidden {
  display: none;
}

@keyframes flash-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Вкладка «Стакан»: усі пари */
.ob-all-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ob-all-section {
  border-radius: 12px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.ob-all-pair-head {
  padding: 10px 12px;
  font-weight: 700;
  font-size: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.2);
}

.ob-all-ex {
  font-weight: 600;
  color: var(--muted);
  font-size: 13px;
}

.ob-empty {
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
}

.ob-all-row {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 13px;
}

.ob-all-row:last-child {
  border-bottom: none;
}

.ob-all-bid {
  border-left: 3px solid var(--green);
}

.ob-all-ask {
  border-left: 3px solid var(--red);
}

.ob-all-bid .ob-all-side {
  color: var(--green);
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 4px;
}

.ob-all-ask .ob-all-side {
  color: var(--red);
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 4px;
}

.ob-all-mid {
  font-weight: 600;
  margin-bottom: 4px;
}

.ob-all-usd {
  color: var(--text);
}

.ob-all-at {
  color: var(--muted);
  font-weight: 400;
}

.ob-all-px {
  color: var(--blue);
}

.ob-all-meta {
  font-size: 12px;
  color: var(--muted);
}
