/* Region Global Styles
   Aesthetic: "Quant Terminal" — fintech терминал с РФ-палитрой (синий-белый-красный).
   Display: Instrument Serif italic (accent moments) | UI: Geist | Numbers: JetBrains Mono */
@import url('/static/css/fonts.css');

/* Coin icon overlay — real logo over letter fallback */
.coin-overlay-img {
  position:absolute; top:0; left:0; width:100%; height:100%;
  border-radius:50%; object-fit:cover; z-index:1;
}
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* Surface palette — deep navy с синим уклоном */
  --bg-primary: #0A1330;
  --bg-secondary: #0F1A3F;
  --bg-card: #131F4A;
  --bg-input: #0F1A3F;
  --bg-hover: #1A2659;
  --border: #1F2D5C;
  --border-light: #2D3D7A;
  --text-primary: #FFFFFF;
  --text-secondary: #B8C2DB;
  --text-muted: #6E7AA0;
  /* Brand: насыщенный синий (доминирующий) + красный акцент (на ключевых моментах) */
  --accent: #2D6EFF;
  --accent-dark: #1A4FCC;
  --accent-glow: rgba(45, 110, 255, 0.45);
  --accent-red: #E4364C;
  --accent-red-dark: #B82038;
  --accent-red-glow: rgba(228, 54, 76, 0.40);
  /* Legacy alias — где код ещё ссылается на --mint оставим зелёный */
  --mint: #00E0A4;
  --mint-glow: rgba(0, 224, 164, 0.40);
  /* Trading semantics — конвенция: long=зелёный, short=красный */
  --green: #00C896;
  --red: #FF4D6A;
  --green-bg: rgba(0, 200, 150, 0.10);
  --red-bg: rgba(255, 77, 106, 0.10);
  /* Type tokens */
  --font-body: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-display: 'Instrument Serif', 'Geist', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.35);
  --shadow-lg: 0 18px 48px rgba(0,0,0,0.55);
  --shadow-glow: 0 0 0 1px rgba(45,110,255,0.30), 0 8px 32px rgba(45,110,255,0.28);
  --shadow-glow-red: 0 0 0 1px rgba(228,54,76,0.30), 0 8px 32px rgba(228,54,76,0.25);
}

/* ─── LIGHT THEME ─── */
[data-theme="light"] {
  --bg-primary: #F4F6FC;
  --bg-secondary: #E9EDF8;
  --bg-card: #FFFFFF;
  --bg-input: #F1F4FC;
  --bg-hover: #E7ECF8;
  --border: #DCE2F0;
  --border-light: #B7C0D8;
  --text-primary: #0A1330;
  --text-secondary: #3D4A6B;
  --text-muted: #6E7AA0;
  --accent: #1A4FCC;
  --accent-dark: #0F3AA0;
  --accent-glow: rgba(26, 79, 204, 0.30);
  --accent-red: #C8243C;
  --accent-red-dark: #9B142A;
  --accent-red-glow: rgba(200, 36, 60, 0.30);
  --mint: #00B488;
  --mint-glow: rgba(0,180,136,0.3);
  --green: #00A472;
  --red: #E0364F;
  --green-bg: rgba(0,164,114,0.08);
  --red-bg: rgba(224,54,79,0.08);
  --shadow-md: 0 4px 14px rgba(15,23,42,0.06);
  --shadow-lg: 0 18px 48px rgba(15,23,42,0.10);
  --shadow-glow: 0 0 0 1px rgba(26,79,204,0.18), 0 8px 32px rgba(26,79,204,0.20);
  --shadow-glow-red: 0 0 0 1px rgba(200,36,60,0.18), 0 8px 32px rgba(200,36,60,0.18);
}

/* ── Atmosphere utilities — subtle texture & depth ───────────────────────── */

/* SVG noise grain overlay — apply to a wrapper or via .grain ::before */
body::before {
  content:''; position: fixed; inset: 0; pointer-events: none; z-index: 1;
  opacity: 0.035; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
[data-theme="light"] body::before { opacity: 0.025; mix-blend-mode: multiply; }

/* Faint dot-grid background (use on hero / empty surfaces) */
.dot-grid {
  background-image: radial-gradient(circle, rgba(140,160,210,0.10) 1px, transparent 1px);
  background-size: 22px 22px;
}
[data-theme="light"] .dot-grid {
  background-image: radial-gradient(circle, rgba(15,23,42,0.08) 1px, transparent 1px);
}

/* Hairline divider with gradient fade */
.hairline {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-light), transparent);
}

/* Glow utility — apply to CTAs */
.glow-accent { box-shadow: var(--shadow-glow); }
.glow-mint   { box-shadow: 0 0 0 1px rgba(0,224,164,0.25), 0 8px 32px rgba(0,224,164,0.25); }
.glow-green  { box-shadow: 0 0 0 1px rgba(0,200,150,0.30), 0 8px 28px rgba(0,200,150,0.30); }
.glow-red    { box-shadow: 0 0 0 1px rgba(255,77,106,0.30), 0 8px 28px rgba(255,77,106,0.30); }

/* Display type — italic serif for editorial moments */
.display-serif {
  font-family: var(--font-display);
  font-style: italic; font-weight: 400;
  letter-spacing: -0.02em;
}

/* Staggered reveal — opacity+translate cascade for hero blocks */
@keyframes heroReveal {
  from { opacity: 0; transform: translateY(14px); filter: blur(6px); }
  to   { opacity: 1; transform: translateY(0);    filter: blur(0); }
}
.reveal-stagger > * {
  opacity: 0;
  animation: heroReveal 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.reveal-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.reveal-stagger > *:nth-child(2) { animation-delay: 0.18s; }
.reveal-stagger > *:nth-child(3) { animation-delay: 0.32s; }
.reveal-stagger > *:nth-child(4) { animation-delay: 0.46s; }
.reveal-stagger > *:nth-child(5) { animation-delay: 0.60s; }
.reveal-stagger > *:nth-child(6) { animation-delay: 0.74s; }
@media (prefers-reduced-motion: reduce) {
  .reveal-stagger > * { animation: none; opacity: 1; }
  body::before { display: none; }
}

/* Theme toggle button */
.theme-toggle {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 16px;
  width: 32px; height: 32px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s; flex-shrink: 0;
}
.theme-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  font-feature-settings: 'ss01' on, 'cv11' on;  /* Geist stylistic alternates */
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Headings inherit display font in select moments via .display-serif;
   default headings stay in body sans for readability across data-dense screens. */
h1, h2, h3 { letter-spacing: -0.015em; font-weight: 700; }

/* Numerical/monospace contexts everywhere */
.font-mono, .price-cell, .ob-row, .nav-balance-value,
.chart-price, .chart-stat-value, .stat-num, .stat-value,
.tape-price, .totp-input { font-family: var(--font-mono); font-feature-settings: 'tnum' on, 'zero' on; }

/* Nav balance skeleton — pulsing while loading */
@keyframes navSkel { 0%,100%{opacity:0.4} 50%{opacity:0.9} }
.nav-skel {
  display: inline-block; min-width: 72px; height: 13px;
  background: var(--border-light); border-radius: 4px;
  animation: navSkel 1.4s ease-in-out infinite;
  vertical-align: middle;
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Utilities */
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--accent); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.font-mono { font-family: 'JetBrains Mono', 'Fira Code', monospace; }

/* Buttons */
.btn {
  border: none; border-radius: 6px; padding: 8px 16px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all 0.15s; display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-green { background: var(--green); color: #000; }
.btn-green:hover { background: #01a866; }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: #d93350; }
.btn-ghost {
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-full { width: 100%; justify-content: center; }

/* Form elements */
.input, input[type="text"], input[type="email"], input[type="password"], input[type="number"], select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
  padding: 8px 12px;
  width: 100%;
}
.input:focus, input:focus, select:focus { border-color: var(--accent); }
input::placeholder { color: var(--text-muted); }
select { cursor: pointer; }
select option { background: var(--bg-card); }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th {
  color: var(--text-muted); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  text-align: left; white-space: nowrap;
}
.table td {
  padding: 10px 12px; border-bottom: 1px solid rgba(43,49,57,0.5);
  white-space: nowrap;
}
.table tr:hover td { background: rgba(43,49,57,0.4); }
.table tr:last-child td { border-bottom: none; }

/* Tags / Badges */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 600;
}
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-accent { background: rgba(51,117,255,0.1); color: var(--accent); }
.badge-gray { background: var(--bg-hover); color: var(--text-secondary); }

/* Modals */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.75); z-index: 1000;
  display: none; align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 28px; min-width: 340px; max-width: 480px;
  width: 90%; animation: modalIn 0.2s ease;
}
@keyframes modalIn {
  from { transform: scale(0.95) translateY(10px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 20px; line-height: 1; padding: 4px;
}
.modal-close:hover { color: var(--text-primary); }

/* Toast notifications */
.toast-container {
  position: fixed; top: 70px; right: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 16px; max-width: 300px;
  font-size: 13px; animation: toastIn 0.3s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
.toast.info { border-left: 3px solid var(--accent); }

/* Loader */
.loader {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s infinite;
  border-radius: 4px;
}
@keyframes skeleton { to { background-position: -200% 0; } }

/* Number coloring */
.positive { color: var(--green); }
.negative { color: var(--red); }

/* ─── NAVBAR ─────────────────────────────────────────────────── */
.navbar {
  height: 56px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 16px;
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  gap: 0;
}
.nav-brand {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; margin-right: 24px;
}
.nav-logo {
  width: 32px; height: 32px; border-radius: 7px;
  background: linear-gradient(135deg, #2D6EFF, #1A4FCC);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 13px; color: #fff;
}
.nav-brand-name { font-size: 18px; font-weight: 800; color: var(--accent); letter-spacing: -0.5px; }
.nav-links { display: flex; align-items: center; gap: 0; flex: 1; overflow: hidden; }
.nav-link {
  padding: 5px 9px; border-radius: 6px; text-decoration: none;
  color: var(--text-secondary); font-size: 13px; font-weight: 500;
  transition: all 0.15s; cursor: pointer; border: none; background: none;
  white-space: nowrap;
}
.nav-link:hover { color: var(--text-primary); background: var(--bg-hover); }
.nav-link.active { color: var(--text-primary); background: var(--bg-hover); }
.nav-right { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }
.nav-balance { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.nav-balance-label { font-size: 10px; color: var(--text-muted); }
.nav-balance-value { font-size: 14px; font-weight: 700; color: var(--accent); }
.nav-user {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 6px; cursor: pointer;
  background: var(--bg-hover);
}
.nav-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #2D6EFF, #1A4FCC);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
}

/* ─── TRADE LAYOUT ───────────────────────────────────────────── */
.trade-layout {
  display: grid;
  grid-template-columns: 220px 1fr 280px;
  grid-template-rows: 1fr;
  height: calc(100vh - 56px);
  margin-top: 56px;
  overflow: hidden;
}

.trade-sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden;
}

.sidebar-search {
  padding: 12px; border-bottom: 1px solid var(--border);
}
.search-input {
  background: var(--bg-primary) !important;
  font-size: 12px !important; padding: 7px 10px !important;
}

.pairs-header {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  padding: 6px 12px; border-bottom: 1px solid var(--border);
}
.pairs-header span { font-size: 10px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }
.pairs-header span:last-child { text-align: right; }
.pairs-header span:nth-child(2) { text-align: right; }

.pairs-list { overflow-y: auto; flex: 1; }
.pair-item {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  padding: 8px 12px; cursor: pointer; transition: background 0.1s;
  border-bottom: 1px solid rgba(43,49,57,0.3);
}
.pair-item:hover { background: var(--bg-hover); }
.pair-item.active { background: rgba(51,117,255,0.08); }
.pair-name { font-size: 12px; font-weight: 600; color: var(--text-primary); }
.pair-base { font-size: 10px; color: var(--text-muted); display: block; }
.pair-price { font-size: 12px; font-weight: 600; text-align: right; }
.pair-change { font-size: 11px; font-weight: 600; text-align: right; }

/* ─── TRADE CENTER ───────────────────────────────────────────── */
.trade-center {
  display: flex; flex-direction: column;
  overflow: hidden;
}

.chart-header {
  display: flex; align-items: center; gap: 20px;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  background: var(--bg-card); flex-shrink: 0;
  overflow-x: auto;          /* keep all controls reachable when toolbar is wider than viewport */
  -webkit-overflow-scrolling: touch;
}
.chart-header > * { flex-shrink: 0; }
.chart-header::-webkit-scrollbar { height: 4px; }
.chart-header::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.chart-symbol { font-size: 18px; font-weight: 800; }
.chart-price { font-size: 22px; font-weight: 800; }
.chart-stats { display: flex; gap: 16px; }
.chart-stat { display: flex; flex-direction: column; gap: 1px; }
.chart-stat-label { font-size: 10px; color: var(--text-muted); }
.chart-stat-value { font-size: 13px; font-weight: 600; }

.interval-tabs { display: flex; gap: 2px; margin-left: auto; }
.interval-btn {
  padding: 4px 10px; border: none; background: transparent;
  color: var(--text-muted); font-size: 12px; font-weight: 600;
  cursor: pointer; border-radius: 4px; transition: all 0.15s;
}
.interval-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.interval-btn.active { background: var(--bg-hover); color: var(--accent); }

.chart-container {
  flex: 1; position: relative; min-height: 0;
}

/* Bottom panel */
.trade-bottom {
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column;
  height: 220px; flex-shrink: 0;
  background: var(--bg-card);
}
.bottom-tabs { display: flex; border-bottom: 1px solid var(--border); }
.bottom-tab {
  padding: 10px 16px; border: none; background: transparent;
  color: var(--text-muted); font-size: 13px; font-weight: 600;
  cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.15s;
}
.bottom-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.bottom-content { overflow-y: auto; flex: 1; }

/* ─── ORDER BOOK ──────────────────────────────────────────────── */
.orderbook {
  border-left: 1px solid var(--border);
  background: var(--bg-card);
  display: flex; flex-direction: column;
  overflow: hidden; width: 200px; flex-shrink: 0;
  border-right: 1px solid var(--border);
}
.orderbook-header {
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  font-size: 12px; font-weight: 700;
  display: grid; grid-template-columns: 1fr 1fr;
}
.orderbook-header span:last-child { text-align: right; }
#obBook { display: flex; flex-direction: column; flex: 1; overflow: hidden; }
.ob-asks, .ob-bids { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.ob-asks { border-bottom: 1px solid var(--border); }
.ob-row {
  display: grid; grid-template-columns: 1fr 1fr;
  padding: 2px 12px; font-size: 11px; position: relative; cursor: pointer;
}
.ob-row:hover { background: var(--bg-hover); }
.ob-row .ob-fill {
  position: absolute; top: 0; bottom: 0; right: 0;
  opacity: 0.08; pointer-events: none;
}
.ob-ask .ob-fill { background: var(--red); }
.ob-bid .ob-fill { background: var(--green); }
.ob-ask .ob-price { color: var(--red); font-weight: 600; }
.ob-bid .ob-price { color: var(--green); font-weight: 600; }
.ob-qty { text-align: right; color: var(--text-secondary); }
.ob-spread {
  text-align: center; padding: 6px; font-size: 12px; font-weight: 700;
  color: var(--accent); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

/* ─── ORDER FORM ──────────────────────────────────────────────── */
.order-panel {
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow-y: auto;
}

.order-type-tabs {
  display: flex; border-bottom: 1px solid var(--border);
}
.order-type-tab {
  flex: 1; padding: 12px 8px; border: none; background: transparent;
  color: var(--text-muted); font-size: 13px; font-weight: 600; cursor: pointer;
  border-bottom: 2px solid transparent; transition: all 0.15s;
}
.order-type-tab.active { color: var(--text-primary); border-bottom-color: var(--accent); }

.order-form { padding: 14px; }

.side-tabs { display: flex; gap: 4px; margin-bottom: 14px; }
.side-tab {
  flex: 1; padding: 10px; border: none; border-radius: 6px;
  font-size: 14px; font-weight: 700; cursor: pointer; transition: all 0.15s;
  background: var(--bg-hover); color: var(--text-muted);
}
.side-tab.buy-active { background: var(--green); color: #000; }
.side-tab.sell-active { background: var(--red); color: #fff; }

.form-row { margin-bottom: 10px; }
.form-row label { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
.input-wrap { position: relative; }
.input-wrap input {
  padding-right: 50px !important; font-family: 'JetBrains Mono', monospace; font-size: 13px;
}
.input-unit {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 11px; font-weight: 600; color: var(--text-muted);
}
.input-max {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 10px; font-weight: 700; color: var(--accent); cursor: pointer;
  background: rgba(51,117,255,0.1); padding: 2px 6px; border-radius: 3px;
}
.input-max:hover { background: rgba(51,117,255,0.2); }

.leverage-row { margin-bottom: 12px; }
.leverage-label { display: flex; justify-content: space-between; margin-bottom: 6px; }
.leverage-label span:first-child { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }
.leverage-value {
  font-size: 12px; font-weight: 700; color: var(--accent);
  background: rgba(51,117,255,0.1); padding: 2px 8px; border-radius: 4px;
}
input[type="range"] {
  -webkit-appearance: none; width: 100%; height: 4px;
  background: var(--border); border-radius: 2px; outline: none;
  border: none; padding: 0;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); cursor: pointer; border: 2px solid var(--bg-card);
}
.leverage-presets { display: flex; gap: 4px; margin-top: 6px; }
.lev-preset {
  flex: 1; padding: 4px; border: 1px solid var(--border); border-radius: 4px;
  font-size: 11px; font-weight: 600; cursor: pointer; color: var(--text-muted);
  background: transparent; text-align: center; transition: all 0.15s;
}
.lev-preset:hover { border-color: var(--accent); color: var(--accent); }
.lev-preset.active { border-color: var(--accent); color: var(--accent); background: rgba(51,117,255,0.08); }

.order-info { background: var(--bg-primary); border-radius: 6px; padding: 10px 12px; margin-bottom: 12px; }
.order-info-row { display: flex; justify-content: space-between; margin-bottom: 4px; font-size: 12px; }
.order-info-row:last-child { margin-bottom: 0; }
.order-info-label { color: var(--text-muted); }
.order-info-value { font-weight: 600; }

.available-balance {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px; font-size: 12px;
}
.available-balance span:first-child { color: var(--text-muted); }
.available-balance span:last-child { font-weight: 700; color: var(--accent); }

/* Percent buttons */
.percent-btns { display: flex; gap: 4px; margin-bottom: 10px; }
.pct-btn {
  flex: 1; padding: 5px; border: 1px solid var(--border); border-radius: 4px;
  font-size: 11px; font-weight: 600; cursor: pointer; color: var(--text-muted);
  background: transparent; transition: all 0.15s;
}
.pct-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ─── POSITIONS TABLE ─────────────────────────────────────────── */
.positions-empty {
  display: flex; align-items: center; justify-content: center;
  height: 80px; color: var(--text-muted); font-size: 13px;
}
.pnl-positive { color: var(--green); font-weight: 600; }
.pnl-negative { color: var(--red); font-weight: 600; }

/* ─── ADMIN ───────────────────────────────────────────────────── */
.admin-layout {
  display: flex;
  margin-top: 56px;
  min-height: calc(100vh - 56px);
}
.admin-sidebar {
  width: 220px; background: var(--bg-card); border-right: 1px solid var(--border);
  padding: 20px 0; flex-shrink: 0; position: sticky; top: 56px; height: calc(100vh - 56px);
}
.admin-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; cursor: pointer; transition: background 0.15s;
  font-size: 13px; font-weight: 500; color: var(--text-secondary);
  border-left: 3px solid transparent;
}
.admin-nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.admin-nav-item.active { color: var(--accent); border-left-color: var(--accent); background: rgba(51,117,255,0.05); }
.admin-nav-icon { font-size: 16px; width: 22px; text-align: center; display: inline-flex; align-items: center; justify-content: center; }
.admin-nav-icon .icon { width: 16px; height: 16px; }
.pw-req svg { width: 11px; height: 11px; vertical-align: -1px; margin-right: 5px; }
.ref-badge svg { vertical-align: -1px; }

.admin-main { flex: 1; padding: 24px; overflow-y: auto; }
.admin-title { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.admin-subtitle { color: var(--text-muted); margin-bottom: 24px; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  padding: 18px; display: flex; flex-direction: column; gap: 8px;
}
.stat-card-label { font-size: 12px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-card-value { font-size: 26px; font-weight: 800; color: var(--text-primary); }
.stat-card-sub { font-size: 12px; color: var(--text-muted); }

.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 20px; margin-bottom: 20px;
}
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }

.admin-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 12px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
.form-group input, .form-group select { font-size: 13px; }

.section { display: none; }
.section.active { display: block; }

.user-actions { display: flex; gap: 6px; }

/* ─── INDICATOR BUTTONS ───────────────────────────────────────────── */
.ind-btns { display: flex; gap: 3px; margin-left: 8px; }
.ind-btn {
  padding: 3px 8px; border: 1px solid var(--border); border-radius: 4px;
  font-size: 10px; font-weight: 700; cursor: pointer; color: var(--text-muted);
  background: transparent; transition: all 0.15s; text-transform: uppercase; letter-spacing: 0.4px;
}
.ind-btn:hover { border-color: var(--border-light); color: var(--text-secondary); }
.ind-btn.active { border-color: var(--accent); color: var(--accent); background: rgba(51,117,255,0.08); }

/* ─── ORDER BOOK TABS ─────────────────────────────────────────────── */
.ob-tabs { display: flex; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.ob-tab {
  flex: 1; padding: 8px 4px; border: none; background: transparent;
  color: var(--text-muted); font-size: 11px; font-weight: 700; cursor: pointer;
  border-bottom: 2px solid transparent; transition: all 0.15s; text-transform: uppercase; letter-spacing: 0.4px;
}
.ob-tab:hover { color: var(--text-primary); }
.ob-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ─── RECENT TRADES FEED ──────────────────────────────────────────── */
.trades-header {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  padding: 6px 10px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.trades-header span { font-size: 9px; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; }
.trades-header span:last-child { text-align: right; }
.trades-header span:nth-child(2) { text-align: center; }
.trades-body { overflow-y: auto; flex: 1; }
.trade-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  padding: 3px 10px; font-size: 11px; font-family: 'JetBrains Mono', monospace;
  border-bottom: 1px solid rgba(43,49,57,0.3);
}
.trade-row:hover { background: var(--bg-hover); }
.trade-row span:last-child { text-align: right; font-size: 10px; }
.trade-row span:nth-child(2) { text-align: center; color: var(--text-secondary); }

/* ─── ANNOUNCEMENT BANNER ────────────────────────────────────────── */
.announcement-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  background: linear-gradient(90deg, rgba(51,117,255,0.12), rgba(51,117,255,0.06));
  border-bottom: 1px solid rgba(51,117,255,0.25);
  padding: 7px 16px; display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--accent); font-weight: 500; gap: 12px;
}
.ann-close {
  background: none; border: none; color: var(--accent); cursor: pointer;
  font-size: 14px; opacity: 0.7; position: absolute; right: 12px;
  line-height: 1; padding: 2px 6px;
}
.ann-close:hover { opacity: 1; }

/* ─── NAV EQUITY ─────────────────────────────────────────────────── */
.nav-equity {
  display: flex; flex-direction: column; align-items: flex-end;
  margin-right: 8px; border-right: 1px solid var(--border); padding-right: 12px;
}
.nav-equity .nav-balance-label { font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.nav-equity .nav-balance-value { font-family: 'JetBrains Mono', monospace; font-size: 13px; }

/* ─── SKELETON LOADING ───────────────────────────────────────────── */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--bg-hover) 25%, #323a44 50%, var(--bg-hover) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 4px;
  display: inline-block;
}
.skel-row td { padding: 10px 12px; }
.skel-cell { height: 12px; border-radius: 4px; }

/* ─── NOTIFICATION BELL ──────────────────────────────────────────── */
.notif-wrap { position: relative; margin-right: 4px; }
.notif-bell {
  background: none; border: none; cursor: pointer;
  color: var(--text-secondary); font-size: 18px;
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  position: relative; transition: all 0.15s;
}
.notif-bell:hover { background: var(--bg-hover); color: var(--text-primary); }
.notif-badge {
  position: absolute; top: 3px; right: 3px;
  background: var(--red); color: #fff; border-radius: 10px;
  font-size: 9px; font-weight: 700; min-width: 15px; height: 15px;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
}
.notif-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; width: 300px; z-index: 500;
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
  overflow: hidden;
}
.notif-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
}
.notif-title { font-size: 13px; font-weight: 700; }
.notif-clear {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 11px; transition: color 0.15s;
}
.notif-clear:hover { color: var(--accent); }
.notif-list { max-height: 280px; overflow-y: auto; }
.notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid rgba(43,49,57,0.5);
  font-size: 12px; transition: background 0.1s;
}
.notif-item:hover { background: var(--bg-hover); }
.notif-item:last-child { border-bottom: none; }
.notif-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; margin-top: 4px;
}
.notif-dot.success { background: var(--green); }
.notif-dot.error { background: var(--red); }
.notif-dot.info { background: var(--accent); }
.notif-empty { padding: 20px; text-align: center; color: var(--text-muted); font-size: 12px; }

/* ─── SIDEBAR TABS ───────────────────────────────────────────────── */
.sidebar-tabs { display: flex; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.sidebar-tab {
  flex: 1; padding: 7px 4px; border: none; background: transparent;
  color: var(--text-muted); font-size: 11px; font-weight: 700; cursor: pointer;
  border-bottom: 2px solid transparent; transition: all 0.15s;
  text-transform: uppercase; letter-spacing: 0.4px;
}
.sidebar-tab:hover { color: var(--text-primary); }
.sidebar-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ─── PAIR STAR BUTTON ───────────────────────────────────────────── */
.star-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 12px; padding: 0 2px;
  line-height: 1; transition: color 0.15s; flex-shrink: 0;
}
.star-btn:hover { color: var(--accent); }
.star-btn.active { color: var(--accent); }

/* ─── LIQUIDATION DANGER ──────────────────────────────────────────── */
@keyframes liqPulse {
  0%, 100% { background: transparent; }
  50% { background: rgba(246,70,93,0.08); }
}
.liq-danger { animation: liqPulse 1s ease-in-out infinite; }
.liq-danger td:nth-child(5) { color: var(--red) !important; font-weight: 800; animation: liqPulse 0.6s ease-in-out infinite; }

/* ═══════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE
   ═══════════════════════════════════════════════════════════════════ */

/* ─── HAMBURGER ───────────────────────────────────────────────────── */
.hamburger {
  display: none;
  flex-direction: column; gap: 5px;
  cursor: pointer; background: none; border: none; padding: 6px; margin-left: 4px;
}
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--text-secondary); border-radius: 2px; transition: all 0.25s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── MOBILE MENU OVERLAY ─────────────────────────────────────────── */
.mobile-menu {
  display: none;
  position: fixed; top: 56px; left: 0; right: 0; z-index: 999;
  background: var(--bg-card); border-bottom: 1px solid var(--border);
  flex-direction: column; padding: 6px 0;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  max-height: calc(100vh - 56px); overflow-y: auto;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  padding: 13px 22px; color: var(--text-secondary);
  text-decoration: none; font-size: 14px; font-weight: 600;
  border-bottom: 1px solid rgba(43,49,57,0.4);
}
.mobile-menu a:hover, .mobile-menu a:active { background: var(--bg-hover); color: var(--text-primary); }
.mobile-menu a.active { color: var(--accent); }
.mobile-menu-footer {
  padding: 12px 22px; display: flex; align-items: center; gap: 10px;
  border-top: 1px solid var(--border); margin-top: 4px;
}

/* ─── MOBILE TRADE BOTTOM NAV ─────────────────────────────────────── */
.mobile-trade-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 300;
  background: var(--bg-card); border-top: 2px solid var(--border);
  grid-template-columns: repeat(4, 1fr);
  /* Account for iOS home indicator / safe area */
  height: calc(56px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.mob-tab {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; border: none; background: transparent;
  color: var(--text-muted); font-size: 9px; font-weight: 700;
  cursor: pointer; transition: color 0.15s;
  text-transform: uppercase; letter-spacing: 0.4px; padding: 6px 0;
}
.mob-tab .mob-icon { font-size: 18px; line-height: 1; }
.mob-tab.active { color: var(--accent); }

/* ─── MOBILE QUICK ACTION BAR (BUY/SELL) ──────────────────────────────
   Sits as a floating bar directly above the bottom navigation. Two
   full-width buttons — primary CTA on the trade screen. Hidden when
   any sheet is open (the sheet has its own submit button). */
.mob-quick-action {
  display: none;
  position: fixed; left: 0; right: 0;
  bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  z-index: 310;
  padding: 8px 12px;
  background: linear-gradient(180deg, transparent 0%, var(--bg-primary) 30%);
  gap: 8px;
}
.mob-quick-action.hidden { display: none !important; }
@media (max-width: 620px) {
  .mob-quick-action { display: flex; }
}
.mqa-btn {
  flex: 1; height: 46px; border: none; border-radius: 10px;
  font-size: 15px; font-weight: 700; letter-spacing: 0.2px;
  cursor: pointer; transition: transform 0.12s ease, filter 0.15s ease;
  font-family: var(--font-body);
}
.mqa-buy {
  background: var(--green); color: #00231A;
  box-shadow: 0 6px 20px rgba(0,200,150,0.35);
}
.mqa-sell {
  background: var(--red); color: #fff;
  box-shadow: 0 6px 20px rgba(255,77,106,0.35);
}
.mqa-btn:active { transform: scale(0.97); filter: brightness(0.95); }

/* ─── MOBILE SHEET BACKDROP ───────────────────────────────────────── */
.mob-sheet-backdrop {
  display: none;
  position: fixed;
  top: 56px; right: 0; left: 0;
  bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  background: rgba(0,0,0,0.5);
  z-index: 320;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.mob-sheet-backdrop.show { display: block; }
@media (min-width: 621px) {
  .mob-sheet-backdrop { display: none !important; }
}

/* ─── SHEET HEADER (drag handle + title + close, mobile only) ─────── */
.sheet-header { display: none; }
@media (max-width: 620px) {
  .sheet-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 14px 8px; position: relative;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    position: sticky; top: 0; z-index: 5;
  }
  .sheet-handle {
    position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
    width: 38px; height: 4px; border-radius: 2px;
    background: var(--border-light);
  }
  .sheet-title {
    font-size: 14px; font-weight: 700; color: var(--text-primary);
    margin-top: 8px;
  }
  .sheet-close {
    background: none; border: none; color: var(--text-secondary);
    font-size: 26px; line-height: 1; cursor: pointer; padding: 0 6px;
    margin-top: 8px;
  }
  .sheet-close:active { color: var(--text-primary); }
}

/* Lock body scroll while a mobile sheet is open */
body.mob-sheet-open { overflow: hidden; }

/* ─── TABLET (≤ 960px) ────────────────────────────────────────────── */
@media (max-width: 960px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .nav-equity { display: none; }

  /* Trade: hide pairs sidebar, 2-column layout */
  .trade-layout { grid-template-columns: 1fr 280px; }
  .trade-sidebar { display: none; }
  .trade-sidebar.mob-visible {
    display: flex; position: fixed;
    top: 56px; left: 0; bottom: 0; z-index: 400;
    width: 250px; box-shadow: 4px 0 24px rgba(0,0,0,0.6);
  }

  /* Wallet sidebar: slightly narrower */
  .wallet-sidebar { width: 200px; }

  /* Profile sidebar: narrower */
  .profile-sidebar { width: 220px; }

  /* Launchpad grid: 2 cols max */
  .projects-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

/* ─── PHONE (≤ 620px) ─────────────────────────────────────────────── */
@media (max-width: 620px) {
  /* Navbar: keep only essentials so hamburger stays in viewport.
     User can still log out / toggle theme via the mobile menu footer. */
  .nav-balance { display: none; }
  .nav-user { display: none; }
  .nav-equity { display: none; }
  .ws-indicator { display: none; }
  #soundToggleBtn { display: none; }
  .theme-toggle { display: none; }
  .nav-right > .btn-ghost { display: none; }   /* desktop logout button */

  /* Trade layout: full single-column. Use dvh so iOS Safari/Brave URL bar
     don't crop the layout. Account for: navbar (56) + bottom-nav (56) +
     quick-action bar (62) + iOS home indicator. */
  .trade-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    height: calc(100vh - 56px - 56px - 62px - env(safe-area-inset-bottom, 0px));
    height: calc(100dvh - 56px - 56px - 62px - env(safe-area-inset-bottom, 0px));
    overflow: hidden;
    padding-bottom: 0;
  }
  .trade-center {
    grid-column: 1; grid-row: 1;
    height: 100%; overflow: hidden;
  }

  /* Chart header: compact + horizontally scrollable instead of clipped */
  .chart-stats { display: none; }
  .chart-price { font-size: 17px; }
  .chart-symbol { font-size: 14px; }
  .ind-btns { display: none; }
  .alert-btn { display: none; }
  .draw-toolbar { display: none; }              /* drawings need precise pointer */
  .chart-header {
    gap: 6px; padding: 6px 10px;
    flex-wrap: nowrap; overflow-x: auto;
    scroll-snap-type: x mandatory;
  }
  .chart-header > * { scroll-snap-align: start; }
  .interval-tabs { gap: 1px; margin-left: auto; }
  .interval-btn { padding: 5px 8px; font-size: 11px; min-height: 30px; }

  /* Symbol becomes tappable to open pair search on mobile */
  .chart-symbol { cursor: pointer; padding: 2px 6px; border-radius: 4px; }
  .chart-symbol:active { background: var(--bg-hover); }

  /* Bottom panel: compact + horizontal scroll for tables */
  .trade-bottom { height: 200px; }
  .bottom-tab { padding: 9px 12px; font-size: 12px; min-height: 38px; }
  .bottom-content { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .bottom-content table { min-width: 580px; }
  .bottom-content table th,
  .bottom-content table td { padding: 8px 10px; font-size: 12px; }
  .positions-empty { padding: 22px 12px !important; font-size: 12px; }

  /* Order panel: slide-up sheet (true bottom-sheet UX, à la Binance/Bybit).
     Use top + bottom positioning so the sheet always fills the available
     space between the navbar and the mobile nav (with safe-area insets) —
     no more vh values that get cropped by iOS Safari's URL bar. */
  .order-panel {
    position: fixed;
    top: 80px;                                                /* below navbar with a bit of breathing room */
    left: 0; right: 0;
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));   /* sit on top of mobile-trade-nav */
    height: auto; max-height: none; z-index: 350;
    border-left: none; border-top: none;
    border-top-left-radius: 16px; border-top-right-radius: 16px;
    transform: translateY(110%); transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
    overflow-y: auto; box-shadow: 0 -12px 40px rgba(0,0,0,0.6);
    -webkit-overflow-scrolling: touch;
    background: var(--bg-card);
    display: flex; flex-direction: column;
  }
  .order-panel.mob-visible { transform: translateY(0); }

  /* All inputs in the order form ≥16px so iOS Safari doesn't auto-zoom on focus */
  .order-panel input[type="number"],
  .order-panel input[type="text"],
  .order-panel select {
    font-size: 16px !important; min-height: 42px;
  }
  .order-panel .side-tab { padding: 13px; font-size: 15px; }
  .order-panel .order-mode-btn,
  .order-panel .mm-btn { padding: 10px 6px; font-size: 13px; min-height: 38px; }
  .order-panel .pct-btn { padding: 9px; min-height: 36px; font-size: 12px; }
  .order-panel .lev-preset { min-height: 32px; }

  /* Sticky submit button: visible without scrolling, no matter how tall the form is */
  .order-panel .btn-full {
    position: sticky; bottom: 0;
    margin-top: 14px; padding: 14px;
    font-size: 16px; font-weight: 800;
    z-index: 4; border-radius: 10px;
    box-shadow: 0 -8px 16px rgba(28,32,48,0.6);
  }
  /* Add bottom padding inside form so sticky button doesn't hide last fields */
  .order-form { padding-bottom: 18px; }

  /* Orderbook: slide-up sheet, near-fullscreen (orderbook needs vertical room) */
  .orderbook {
    position: fixed; top: 56px; left: 0; right: 0;
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    height: auto; width: 100%; z-index: 340;
    border-left: none; border-top: none;
    border-top-left-radius: 16px; border-top-right-radius: 16px;
    transform: translateY(110%); transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 0 -12px 40px rgba(0,0,0,0.6);
  }
  .orderbook.mob-visible { transform: translateY(0); display: flex; }

  /* Pairs sidebar on mobile: slide from left, full height between navbar and bottom nav */
  .trade-sidebar.mob-visible {
    top: 56px; bottom: calc(56px + env(safe-area-inset-bottom, 0px)); left: 0;
    width: 86%; max-width: 360px;
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
    z-index: 340;
  }

  /* Mobile trade nav: clean 4-column grid, equal columns */
  .mobile-trade-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
  }

  /* ── Other pages ── */

  /* ─── WALLET — clean stacked layout on phone ───────────────────────
     - sidebar collapses to a compact balance bar + horizontal tabs at top
     - main content gets full width below; no overlap with sidebar nav
     - all inputs get tap-friendly hit area (≥44px height) */
  .wallet-layout {
    flex-direction: column;
    display: flex;
    margin-top: 56px;
    padding-bottom: 64px;             /* space for bottom mob-app-tabs */
  }
  .wallet-sidebar {
    width: 100%;
    height: auto;
    position: static;
    overflow: visible;
    flex-shrink: 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
    display: flex; flex-direction: column;
  }
  .wallet-balance-card {
    padding: 12px 16px;
    background: var(--bg);
  }
  .wallet-balance-card .wbal-pnl { display: none; }   /* save vertical space */
  .wbal-value { font-size: 20px; }
  .wbal-label { font-size: 10px; }
  .wbal-sub { display: none; }
  .wallet-nav {
    flex: none;                       /* no flex:1 grabbing extra height */
    padding: 0;
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0;
    border-top: 1px solid var(--border);
  }
  .wallet-nav-item {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 11px 16px;
    border-left: none;
    border-bottom: 2px solid transparent;
    border-right: 1px solid var(--border);
    font-size: 13px;
  }
  .wallet-nav-item.active {
    border-left-color: transparent;
    border-bottom-color: var(--accent);
    background: transparent;
  }
  .wallet-main {
    padding: 16px;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }
  /* Deposit / Withdraw form: vertical, full-width inputs with big tap target */
  .dw-grid { grid-template-columns: 1fr; gap: 14px; }
  .coin-select-grid { grid-template-columns: repeat(4, 1fr); }
  .network-select-grid { grid-template-columns: repeat(2, 1fr); }
  .input-wrap input, .wf-input, #wdAddress, #wdAmount, #depAmount, #depTxid {
    font-size: 16px;                  /* iOS won't auto-zoom on inputs ≥16px */
    padding: 12px 14px;
    min-height: 44px;
  }
  .wf-submit, .btn-primary, .btn-submit { min-height: 46px; }

  /* ─── PROFILE — same pattern as wallet ──────────────────────────── */
  .profile-layout {
    flex-direction: column;
    display: flex;
    padding-bottom: 64px;             /* room for bottom mob-app-tabs */
  }
  .profile-sidebar {
    width: 100%; height: auto;
    position: static; overflow: visible;
    flex-shrink: 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
    display: flex; flex-direction: column;
  }
  .profile-avatar-card { padding: 16px; display: flex; align-items: center; gap: 14px; }
  .profile-big-avatar { width: 48px; height: 48px; font-size: 18px; margin: 0; }
  .profile-username { text-align: left; font-size: 15px; }
  .profile-email { text-align: left; }
  .profile-nav {
    display: flex; flex-direction: row;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    gap: 0; padding: 0;
    border-top: 1px solid var(--border);
  }
  .profile-nav-item {
    white-space: nowrap; flex-shrink: 0;
    flex-direction: row; gap: 6px;
    padding: 11px 14px; border-radius: 0;
    border-left: none; border-bottom: 2px solid transparent;
    font-size: 12px;
  }
  .profile-nav-item.active {
    border-bottom-color: var(--accent);
    border-left-color: transparent;
    background: transparent;
  }
  .sidebar-stats { display: none; }
  .profile-badges { display: none; }
  .profile-main { min-width: 0; padding: 16px; }

  /* ─── EARN — modal sheet on phone, inputs ≥16px ────────────────── */
  .modal { width: 100%; max-width: 100vw; border-radius: 14px 14px 0 0;
           padding: 20px 18px; max-height: 90vh; overflow-y: auto; }
  .modal-overlay { align-items: flex-end; }
  .sub-input-wrap input { font-size: 16px; min-height: 44px; }
  .sub-max-btn { min-height: 36px; padding: 6px 12px; }

  /* Markets */
  .markets-table th:nth-child(5),
  .markets-table td:nth-child(5),
  .markets-table th:nth-child(6),
  .markets-table td:nth-child(6),
  .markets-table th:nth-child(7),
  .markets-table td:nth-child(7) { display: none; }

  /* Leaderboard */
  .lb-layout { padding: 16px; }
  .podium { gap: 6px; }
  .podium-item { min-width: 95px; padding: 12px; }
  .podium-crown { font-size: 18px; }
  .podium-rank { font-size: 22px; }
  .podium-avatar { width: 42px; height: 42px; font-size: 17px; }
  .lb-table th:nth-child(5),
  .lb-table td:nth-child(5) { display: none; }

  /* Admin */
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; height: auto; position: static; display: flex; flex-direction: row; overflow-x: auto; padding: 0; }
  .admin-nav-item { white-space: nowrap; flex-shrink: 0; border-left: none; border-bottom: 3px solid transparent; padding: 12px 16px; }
  .admin-nav-item.active { border-left-color: transparent; border-bottom-color: var(--accent); }
  .admin-form-grid { grid-template-columns: 1fr; }
  .admin-main { padding: 16px; }

  /* General */
  .prof-title { font-size: 18px; }
  .security-card { padding: 16px; }
  .modal-content { margin: 10px; max-width: calc(100vw - 20px); }
}

/* ── TRADE PAGE: PAIR LIST HOVER ─────────────────────────── */
.pair-item {
  transition: background 0.12s ease, transform 0.12s ease;
}
.pair-item:hover {
  transform: translateX(2px);
}
.pair-item.active {
  border-left: 2px solid var(--accent);
  padding-left: 10px;
}

/* ── TRADE PAGE: ORDERBOOK FLASH ANIMATIONS ──────────────── */
@keyframes obFlashBid { 0%{background:rgba(2,192,118,0.2)} 100%{background:transparent} }
@keyframes obFlashAsk { 0%{background:rgba(246,70,93,0.2)} 100%{background:transparent} }
.ob-bid.flash { animation: obFlashBid 0.5s ease-out; }
.ob-ask.flash { animation: obFlashAsk 0.5s ease-out; }

/* ── PNL SMOOTH TRANSITION ───────────────────────────────── */
.pnl-positive, .pnl-negative {
  transition: color 0.4s ease;
}

/* ── MOBILE APP NAV ──────────────────────────────────────── */
.mobile-app-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 300;
  background: var(--bg-card); border-top: 1px solid var(--border);
  grid-template-columns: repeat(5, 1fr);
  height: calc(56px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (max-width: 620px) {
  .mobile-app-nav { display: grid; }
  body.has-mobile-nav { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
}
.mob-app-tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; border: none; background: transparent;
  color: var(--text-muted); font-size: 9px; font-weight: 700;
  cursor: pointer; text-transform: uppercase; letter-spacing: 0.4px;
  padding: 6px 0; text-decoration: none; transition: color 0.15s;
}
.mob-app-tab .mob-icon { font-size: 18px; line-height: 1; }
.mob-app-tab.active { color: var(--accent); }

/* ── Bonus Celebration Overlay ───────────────────────────────────────────── */
#bonusCelebration {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
#bonusCelebration.active { opacity: 1; pointer-events: auto; }
#bonusConfetti {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none;
}
@keyframes confettiFall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity:1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity:0; }
}
.confetti-piece {
  position: absolute; top: -10px;
  animation: confettiFall linear forwards;
}
.bonus-celeb-card {
  position: relative; z-index: 1;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 20px; padding: 40px 48px; text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  animation: modalPop 0.4s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
@keyframes modalPop {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.bonus-celeb-icon { font-size: 56px; margin-bottom: 12px; }
.bonus-celeb-title { color: var(--text-secondary); font-size: 14px; margin-bottom: 8px; }
.bonus-celeb-amount {
  font-size: 48px; font-weight: 700;
  background: linear-gradient(135deg, #2D6EFF, #00C896);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; margin-bottom: 4px;
}

/* ── Welcome Bonus Modal ─────────────────────────────────────────────────── */
#welcomeBonusModal {
  position: fixed; inset: 0; z-index: 9998;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.65); backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
#welcomeBonusModal.active { opacity: 1; pointer-events: auto; }
.welcome-modal-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 20px; padding: 36px 40px; max-width: 420px; width: 90%;
  text-align: center; position: relative;
  animation: modalPop 0.4s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
.welcome-modal-close {
  position: absolute; top: 16px; right: 18px;
  background: none; border: none; color: var(--text-secondary);
  font-size: 20px; cursor: pointer; line-height: 1;
}
.welcome-modal-icon { font-size: 52px; margin-bottom: 16px; }
.welcome-modal-title { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.welcome-modal-sub { color: var(--text-secondary); font-size: 14px; margin-bottom: 24px; }
.welcome-bonus-list { text-align: left; margin-bottom: 24px; display: flex; flex-direction: column; gap: 12px; }
.welcome-bonus-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-primary); border-radius: 10px; padding: 12px 16px;
}
.welcome-bonus-item .wb-icon { font-size: 24px; }
.welcome-bonus-item .wb-info { flex: 1; }
.welcome-bonus-item .wb-label { font-size: 13px; color: var(--text-secondary); }
.welcome-bonus-item .wb-amount { font-size: 16px; font-weight: 600; color: #00C896; }
.btn-welcome-start {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, #2D6EFF, #1A4FCC);
  color: #fff; border: none; border-radius: 10px;
  font-size: 16px; font-weight: 600; cursor: pointer; transition: opacity 0.2s;
}
.btn-welcome-start:hover { opacity: 0.9; }

/* ── Floating Bonus Tasks Widget ─────────────────────────────────────────── */
#bonusTasksWidget {
  position: fixed; bottom: 80px; right: 20px; z-index: 900;
}
@media (max-width: 620px) {
  #bonusTasksWidget { bottom: calc(130px + env(safe-area-inset-bottom, 0px)); right: 12px; }
  /* On trade page (has the quick-action bar) the widget overlaps the BUY/SELL buttons.
     Hide it in portrait — bonus center stays accessible from /profile. */
  body:has(.mob-quick-action) #bonusTasksWidget { display: none; }
}
#bonusTasksToggle {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, #2D6EFF, #00C896);
  border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 22px; box-shadow: 0 4px 16px rgba(45,110,255,0.4);
  position: relative; transition: transform 0.2s;
}
#bonusTasksToggle:hover { transform: scale(1.08); }
#bonusTasksBadge {
  position: absolute; top: -4px; right: -4px;
  background: #F6465D; color: #fff; border-radius: 50%;
  width: 18px; height: 18px; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
#bonusTasksPanel {
  position: absolute; bottom: 62px; right: 0;
  width: 300px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,0.3);
  overflow: hidden; display: none;
}
#bonusTasksWidget.open #bonusTasksPanel { display: block; }
.bonus-tasks-header {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 14px;
}
#bonusTasksList { padding: 8px; max-height: 300px; overflow-y: auto; }
.bonus-task-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 8px; margin-bottom: 4px;
  background: var(--bg-primary);
}
.bonus-task-item.claimed { opacity: 0.5; }
.bonus-task-info { flex: 1; }
.bonus-task-title { display: block; font-size: 13px; font-weight: 600; }
.bonus-task-desc { display: block; font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.bonus-task-reward {
  font-size: 13px; font-weight: 700; color: #00C896; white-space: nowrap;
}
.bonus-task-reward.claimed { color: var(--text-secondary); }

/* ── Bonus History (profile/wallet) ─────────────────────────────────────── */
.bonus-history-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.bonus-history-row:last-child { border-bottom: none; }
.bonus-history-info { display: flex; flex-direction: column; gap: 2px; }
.bonus-history-desc { font-size: 14px; }
.bonus-history-date { font-size: 12px; color: var(--text-secondary); }
.bonus-history-amount { font-size: 15px; font-weight: 700; color: #00C896; }
.bonus-loading, .bonus-empty { text-align: center; color: var(--text-secondary); padding: 24px; font-size: 14px; }

/* ── Empty States — Quant Terminal: dashed wireframe data-slot, no SaaS pills ── */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 44px 24px; gap: 14px; text-align: center; position: relative;
}
.empty-state::before {
  /* mono status tag rendered before the icon — sets the terminal tone */
  content: attr(data-tag);
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--text-muted); opacity: 0.7;
}
.empty-state-icon {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: var(--text-secondary);
  border: 1px dashed rgba(45,110,255,0.35);
  border-radius: 4px;
  background: linear-gradient(135deg, rgba(45,110,255,0.04), rgba(0,224,164,0.02));
  margin-top: 18px; margin-bottom: 2px;
  position: relative;
}
.empty-state-icon::before, .empty-state-icon::after {
  /* tiny corner brackets — terminal "data slot" feel */
  content: ''; position: absolute; width: 6px; height: 6px;
  border: 1px solid var(--accent); opacity: 0.5;
}
.empty-state-icon::before { top: -3px; left: -3px; border-right: none; border-bottom: none; }
.empty-state-icon::after  { bottom: -3px; right: -3px; border-left: none; border-top: none; }
.empty-state-title {
  font-family: 'Instrument Serif', serif; font-style: italic; font-weight: 400;
  font-size: 19px; color: var(--text-primary); line-height: 1.2;
}
.empty-state-desc {
  font-size: 13px; color: var(--text-muted); max-width: 340px; line-height: 1.55;
}
.empty-state-cta {
  margin-top: 6px; padding: 9px 18px;
  border-radius: 4px; border: 1px solid var(--accent);
  background: rgba(45,110,255,0.08); color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px; font-weight: 500; letter-spacing: 0.6px; text-transform: uppercase;
  cursor: pointer; text-decoration: none;
  transition: all 0.18s ease;
  display: inline-flex; align-items: center; gap: 8px;
}
.empty-state-cta::before { content: '['; opacity: 0.6; }
.empty-state-cta::after  { content: ']'; opacity: 0.6; }
.empty-state-cta:hover {
  background: var(--accent); color: #fff;
  box-shadow: 0 4px 16px rgba(45,110,255,0.3);
}
.empty-state-cta:hover::before, .empty-state-cta:hover::after { opacity: 0.7; }
.empty-state-cta-ghost {
  background: transparent;
}
/* Compact variant for table-cell empty rows — same DNA, tighter spacing */
.empty-state-compact { padding: 30px 16px 26px; gap: 10px; }
.empty-state-compact::before { top: 11px; font-size: 9px; letter-spacing: 1.2px; }
.empty-state-compact .empty-state-icon { width: 42px; height: 42px; font-size: 19px; margin-top: 10px; }
.empty-state-compact .empty-state-title { font-size: 16px; }
.empty-state-compact .empty-state-desc { font-size: 12px; }

/* ── Zero-balance prompt on /trade — pushes new users to fund their wallet ─ */
.zero-balance-banner {
  display: none;
  margin: 0 0 14px 0;
  padding: 14px 18px;
  border-radius: 6px;
  border: 1px dashed rgba(0,224,164,0.45);
  background: linear-gradient(135deg, rgba(0,224,164,0.08), rgba(45,110,255,0.04));
  position: relative;
}
.zero-balance-banner.visible { display: block; }
.zero-balance-banner::before {
  content: '[ ОНБОРДИНГ · ШАГ 1 / 2 ]';
  position: absolute; top: -7px; left: 12px;
  background: var(--bg-card); padding: 0 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; letter-spacing: 1.2px; color: var(--mint);
}
.zero-balance-banner-title {
  font-family: 'Instrument Serif', serif; font-style: italic; font-weight: 400;
  font-size: 19px; color: var(--text-primary); margin-bottom: 4px; line-height: 1.2;
}
.zero-balance-banner-desc {
  font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 10px;
}
.zero-balance-banner-cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 4px;
  background: var(--mint); color: #0A1330;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  text-decoration: none; transition: all 0.18s ease;
  box-shadow: 0 4px 16px rgba(0,224,164,0.25);
}
.zero-balance-banner-cta::before { content: '['; opacity: 0.6; }
.zero-balance-banner-cta::after  { content: ']'; opacity: 0.6; }
.zero-balance-banner-cta:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(0,224,164,0.4); }

/* ── TP/SL presets — terminal-token style, not Bootstrap pill ───────────── */
.tpsl-presets {
  display: flex; gap: 4px; margin-top: 8px;
}
.tpsl-preset {
  flex: 1; padding: 6px 4px;
  border-radius: 3px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 500; letter-spacing: 0.4px;
  cursor: pointer;
  transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}
.tpsl-preset:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(45,110,255,0.06);
}
.tpsl-preset:active {
  background: rgba(45,110,255,0.14);
}

/* ── LUCIDE-BASED ICON SYSTEM ──────────────────
   Inline SVG sprite at /static/icons.svg. Use:
   <svg class="icon"><use href="/static/icons.svg#i-target"/></svg>
   stroke/fill must be set on the outer <svg> for the <use> shadow to inherit. */
.icon {
  width: 1em; height: 1em;
  display: inline-block; vertical-align: -0.125em;
  flex-shrink: 0; line-height: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Filled brand icons (Telegram, etc.) override the stroke-based default */
.icon-filled { fill: currentColor; stroke: none; }
.icon-sm { width: 16px; height: 16px; }
.icon-md { width: 20px; height: 20px; }
.icon-lg { width: 28px; height: 28px; }

/* Default icon sizing for known wrap classes (index.html) */
.platform-icon-wrap .icon { width: 24px; height: 24px; color: #7BB8FF; }
.sec-badge-icon-wrap .icon { width: 22px; height: 22px; }
.sec-badge-icon-blue .icon { color: #7BB8FF; }
.sec-badge-icon-green .icon { color: #7FE4BD; }
.sec-badge-icon-yellow .icon { color: #F6BA2F; }
.promo-card-icon .icon { width: 32px; height: 32px; }
.promo-card-blue .promo-card-icon .icon { color: #7BB8FF; }
.promo-card-green .promo-card-icon .icon { color: #7FE4BD; }
.promo-card-purple .promo-card-icon .icon { color: #C4A0FF; }
.bonus-pill-icon .icon { width: 14px; height: 14px; vertical-align: -0.2em; }
.welcome-modal-icon .icon { width: 48px; height: 48px; color: var(--accent); }
.wb-icon .icon { width: 22px; height: 22px; color: #00C896; }
.bonus-celeb-icon .icon { width: 56px; height: 56px; color: #00C896; }
.footer-social .icon { width: 18px; height: 18px; }

/* About page icons (mission cards, timeline) */
.mc-icon .icon, .tl-content-icon .icon, .val-icon .icon {
  width: 28px; height: 28px; color: var(--accent);
}
.mc-icon, .val-icon {
  display: inline-flex; align-items: center; justify-content: center;
}

/* When .platform-icon-wrap was sized for an emoji (font-size:22px on the wrap),
   make sure the SVG renders at our explicit size, not the wrap's font-size. */
.platform-icon-wrap, .sec-badge-icon-wrap, .promo-card-icon,
.welcome-modal-icon, .wb-icon, .bonus-celeb-icon {
  line-height: 0;
}

/* Mobile nav tabs (wallet/trade/markets/earn/profile bottom nav) */
.mob-icon .icon { width: 20px; height: 20px; }
.mob-app-tab .icon { width: 22px; height: 22px; margin-bottom: 2px; }

/* Buycrypto contact cards */
.bc-contact-icon .icon { width: 28px; height: 28px; color: var(--accent); }

/* Trade page bonus task button */
.bonus-task-icon-svg { width: 22px; height: 22px; vertical-align: -3px; }

/* Trade mode badge — quickly tell Spot from Futures pages apart */
.trade-mode-badge { margin-top: 4px; }
.tmb {
  display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: 0.8px;
  padding: 3px 8px; border-radius: 4px; text-transform: uppercase;
}
.tmb-spot { background: rgba(2,192,118,0.14); color: #00C896; border: 1px solid rgba(2,192,118,0.35); }
.tmb-fut { background: rgba(246,186,47,0.14); color: #F6BA2F; border: 1px solid rgba(246,186,47,0.35); }

/* ─────────────────────────────────────────────────────────────────────
   MOBILE NAV CLEANUP (≤ 620px)
   На мобилке топ-нав был перегружен (логотип + ws-dot + EN/RU + sound +
   notif + Админ + ≡). Bybit/Binance держат минимум: лого + меню/уведомления.
   Hide-rules используют !important, чтобы выиграть у inline-style.
   ──────────────────────────────────────────────────────────────────── */
@media (max-width: 620px) {
  /* Hide secondary nav controls — they доступны через mobile-menu */
  .ws-indicator,
  #soundToggleBtn,
  #lang-switcher,
  .nav-balance,
  .nav-user,
  .theme-toggle,
  .nav-equity,
  .nav-right > .btn-ghost,                       /* logout */
  .nav-right > .btn.btn-sm,                      /* Админ */
  .nav-right > a.btn.btn-sm { display: none !important; }

  /* Compact notif bell — single icon, no extra padding */
  .nav-right .notif-bell { width: 36px; height: 36px; font-size: 16px; }

  /* Nav-right общий лейаут: правый край = hamburger, между notif и hamburger 6px */
  .nav-right { gap: 6px !important; padding-right: 4px; }

  /* Hamburger чуть крупнее и контрастнее */
  .hamburger { width: 36px; height: 36px; }

  /* ─── TRADE POSITIONS/ORDERS/HISTORY TABLES ───
     Раньше: таблица 1020px не помещалась в 390. Сейчас: горизонтальный скролл уже есть
     (overflow-x:auto), но колонок слишком много. Делаем некоторые скрытыми, оставляя
     только то, что критично на мобилке. */
  .bottom-content table th:nth-child(n+5),
  .bottom-content table td:nth-child(n+5) {
    display: none;        /* скрываем колонки 5+ — Mark, Liq, P&L и т.д. */
  }
  .bottom-content table { min-width: 0; width: 100%; }
  .bottom-content table th,
  .bottom-content table td {
    padding: 8px 8px; font-size: 12px; white-space: nowrap;
  }

  /* Алерты-кнопка в chart-header не должна обрезаться. Если включена — даём место */
  .alert-btn { font-size: 11px; padding: 4px 8px; }

  /* Балансная плашка слева в order-panel — short labels */
  .order-panel .bal-label { font-size: 11px; }
}

/* ─── PHONE (≤ 480px) — самый узкий, ужесточённые правки ───────── */
@media (max-width: 480px) {
  /* Совсем узкий: показываем минимум колонок в таблицах */
  .bottom-content table th:nth-child(n+4),
  .bottom-content table td:nth-child(n+4) {
    display: none;
  }
  /* Chart header вотчасто: chart-symbol скрываем у узких */
  .chart-symbol-sub { display: none; }
}
