/* ======================================================================
   BINANCE MOBILE DARK THEME – FULL STYLE (UPDATED + CLEAN + JS-MATCHED)
   Replace your style.css with this file

   Supports:
   - Home, Markets
   - Spot (BUY/SELL toggle, SL/TP modes, bottom tabs)
   - Futures (margin + leverage toggles, custom leverage input)
   - Signal widgets (spot/futures)
   - Live Spot Orders UI
   - Futures Positions + Open Orders panels
   - Backend flags labels
   ====================================================================== */

/* ======================================================================
   THEME TOKENS
   ====================================================================== */

:root {
  /* main palette */
  --bg-main: #0b0e11;
  --bg-surface: #181a20;
  --bg-surface-soft: #151924;
  --bg-surface-alt: #1e2329;
  --bg-card: #181a20;
  --bg-card-alt: #191f2a;

  --border-soft: #232a33;
  --border-strong: #2b3139;

  --text-main: #eaecef;
  --text-sub: #848e9c;
  --text-muted: #5e6673;
  --text-secondary: #848e9c;

  --accent: #f0b90b;
  --accent-yellow: #f0b90b;
  --accent-tab: #f0b90b;

  --green: #0ecb81;
  --red: #f6465d;
  --gray-pill: #2b3139;

  --nav-active: #ffffff;
  --nav-inactive: #8b93a4;

  --purple: #a855f7;

  /* unified aliases */
  --bin-bg: var(--bg-main);
  --bin-surface: var(--bg-surface);
  --bin-surface-2: var(--bg-surface-alt);
  --bin-surface-3: #11151a;

  --bin-border: var(--border-strong);
  --bin-border-soft: var(--border-soft);

  --bin-text: var(--text-main);
  --bin-sub: var(--text-sub);
  --bin-muted: var(--text-muted);

  --bin-yellow: var(--accent-yellow);
  --bin-green: var(--green);
  --bin-red: var(--red);

  --bin-focus-shadow: 0 0 0 2px rgba(240, 185, 11, 0.18);
}

/* ======================================================================
   RESET / BASE
   ====================================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    Roboto, sans-serif;
  background: #000;
  color: var(--text-main);
  display: flex;
  justify-content: center;
  align-items: stretch;
  min-height: 100vh;
}

/* login page background */
body.dark {
  background: radial-gradient(circle at top, #181a20 0, #0b0e11 55%, #000 100%);
}

/* ======================================================================
   APP SHELL
   ====================================================================== */

.app {
  width: 100%;
  max-width: 430px;
  background: var(--bg-main);
  padding: 12px 14px 4px;
  position: relative;
  min-height: 100vh;
}

/* SCREENS */
.screen {
  display: none;
}
.screen.active {
  display: block;
}

/* ======================================================================
   STATUS BAR (optional)
   ====================================================================== */

.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 4px 12px;
  font-size: 14px;
  color: var(--text-main);
}

.status-right {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  border: 2px solid #fff;
}

.battery {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: #1f2933;
  padding: 1px 4px;
  border-radius: 10px;
  font-size: 9px;
}

.battery-pill {
  width: 15px;
  height: 7px;
  border-radius: 4px;
  background: #22c55e;
}

/* ======================================================================
   TOP ROW / GENERIC HEADER UI
   ====================================================================== */

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

.top-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  font-size: 16px;
  background: #10151c;
}

.badge {
  min-width: 20px;
  height: 16px;
  border-radius: 999px;
  background: var(--accent-yellow);
  color: #000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
}

/* segmented generic */
.segmented {
  display: inline-flex;
  background: #0b0e11;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  gap: 2px;
}

.segment {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-sub);
  cursor: pointer;
  white-space: nowrap;
}

.segment.active {
  background: #272a30;
  color: var(--accent-yellow);
  font-weight: 600;
}

.top-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ======================================================================
   TOTAL VALUE CARD (HOME)
   ====================================================================== */

.total-card {
  background: #181a20;
  border-radius: 22px;
  padding: 14px 14px 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border-soft);
}

.total-card-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-sub);
  margin-bottom: 6px;
}

.total-card-header span:last-child {
  font-size: 14px;
}

.total-card-value {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}

.total-card-pnl {
  font-size: 12px;
  color: var(--red);
  margin-bottom: 2px;
}

/* ======================================================================
   CARDS ROW (HOME)
   ====================================================================== */

.cards-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.card {
  background: var(--bg-card);
  border-radius: 18px;
  padding: 12px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-soft);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 11px;
  color: var(--text-sub);
}

.card-title {
  font-weight: 500;
}

.fiat-tag {
  background: rgba(14, 203, 129, 0.12);
  color: var(--green);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
}

.pair {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.token-circle {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #02c076;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.pair-text-main {
  font-size: 13px;
  font-weight: 500;
}

.pair-text-sub {
  font-size: 11px;
  color: var(--text-sub);
}

.pair-rate {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.card-balance-label {
  font-size: 11px;
  color: var(--text-sub);
  margin-top: 6px;
}

.card-balance-amount {
  font-size: 13px;
  font-weight: 500;
}

.tiny-chart {
  position: absolute;
  right: 12px;
  bottom: 18px;
  width: 40%;
  height: 40px;
  background: linear-gradient(90deg, rgba(14, 203, 129, 0.2), #0ecb81);
  mask-image: linear-gradient(90deg, transparent, black 20%, black 80%, transparent);
  border-radius: 8px;
}

/* ======================================================================
   TABS ROW (Favorites / Hot / ...)
   ====================================================================== */

.tabs-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  margin: 10px 0 8px;
  font-size: 13px;
}

.tab-pill {
  position: relative;
  padding-bottom: 6px;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}

.tab-pill.active {
  color: var(--text-main);
  font-weight: 500;
}

.tab-pill.active::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent-tab);
}

.tab-group {
  display: flex;
  gap: 18px;
  font-size: 12px;
  margin-bottom: 4px;
  color: var(--text-muted);
}

.tab-group span {
  cursor: pointer;
}

.tab-group span.active {
  color: var(--text-main);
  font-weight: 500;
}

/* ======================================================================
   CRYPTO LIST (HOME + MARKETS)
   ====================================================================== */

.list-card {
  background: var(--bg-card-alt);
  border-radius: 22px;
  padding: 12px 14px 10px;
  margin-bottom: 14px;
  border: 1px solid var(--border-soft);
}

.list-header {
  display: grid;
  grid-template-columns: 2fr 1.4fr 1.2fr;
  font-size: 11px;
  color: var(--text-sub);
  margin-bottom: 6px;
}

.list-row {
  display: grid;
  grid-template-columns: 2fr 1.4fr 1.2fr;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid #11151f;
  font-size: 13px;
  cursor: pointer;
}

.list-row:first-of-type {
  border-top: none;
}

.coin-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.coin-hot-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, var(--accent));
}

.price-main {
  font-size: 13px;
  text-align: right;
}

.price-sub {
  font-size: 10px;
  color: var(--text-sub);
  text-align: right;
}

.change-pill {
  justify-self: flex-end;
  min-width: 64px;
  text-align: center;
  border-radius: 999px;
  padding: 5px 4px;
  font-size: 11px;
  font-weight: 500;
  color: #fff;
}

.change-up {
  background: var(--green);
}
.change-down {
  background: var(--red);
}
.change-flat {
  background: var(--gray-pill);
}

.view-more {
  margin-top: 10px;
  text-align: center;
  color: var(--text-sub);
  font-size: 12px;
}

/* ======================================================================
   DISCOVER SECTION
   ====================================================================== */

.discover-section-title {
  display: flex;
  gap: 18px;
  align-items: center;
  font-size: 13px;
  margin-bottom: 10px;
  color: var(--text-sub);
}

.discover-section-title .active {
  color: var(--text-main);
  font-weight: 500;
  position: relative;
  padding-bottom: 6px;
}

.discover-section-title .active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent-tab);
}

.banner {
  background: #272a30;
  border-radius: 999px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #f4f4ff;
  margin-bottom: 14px;
}

.banner-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.banner-logo {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #1e2329;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.banner-text-main {
  font-weight: 500;
}

.banner-tag {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  margin-left: 4px;
}

.banner-right-pill {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ======================================================================
   PROFILE CARD
   ====================================================================== */

.profile-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 65px;
}

.profile-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #1d2535;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.profile-text-main {
  font-size: 13px;
  font-weight: 500;
}

.profile-text-sub {
  font-size: 11px;
  color: var(--text-sub);
}

.profile-badge {
  margin-left: auto;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--accent-yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  font-size: 14px;
}

/* ======================================================================
   BOTTOM NAV
   ====================================================================== */

.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 430px;
  padding: 6px 18px 10px;
  background: linear-gradient(to top, #0b0e11ee, #0b0e11aa, transparent);
  backdrop-filter: blur(18px);
  z-index: 50;
}

.bottom-nav-inner {
  background: #181a20;
  border-radius: 22px 22px 0 0;
  padding: 8px 24px 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-soft);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  color: var(--nav-inactive);
  cursor: pointer;
  user-select: none;
}

.nav-item span.icon {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  background: transparent;
}

.nav-item.active {
  color: var(--nav-active);
  font-weight: 500;
}

.nav-item.active span.icon {
  background: var(--accent-yellow);
  color: #000;
}

/* responsive cards */
@media (max-width: 360px) {
  .cards-row {
    grid-template-columns: 1fr;
  }
}

/* ======================================================================
   MARKETS SCREEN
   ====================================================================== */

.market-header {
  margin-bottom: 10px;
}

.market-search {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 18px;
  background: #0b0e11;
  border: 1px solid var(--border-soft);
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 12px;
}

.market-search-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.market-search-icon {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid #343842;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.market-search-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
}

.market-top-tabs {
  display: flex;
  gap: 18px;
  font-size: 14px;
  margin-bottom: 8px;
}

.market-top-tab {
  position: relative;
  padding-bottom: 6px;
  color: var(--text-muted);
  cursor: pointer;
}

.market-top-tab.active {
  color: #fff;
  font-weight: 500;
}

.market-top-tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent-tab);
}

.market-subtabs,
.market-chains {
  display: flex;
  gap: 14px;
  font-size: 12px;
  margin-bottom: 8px;
  color: var(--text-muted);
}

.market-subtabs span,
.market-chains span {
  cursor: pointer;
  white-space: nowrap;
}

.market-subtabs span.active,
.market-chains span.active {
  color: #fff;
  font-weight: 500;
}

.market-chains {
  align-items: center;
}

.market-chains .right-icon {
  margin-left: auto;
  font-size: 16px;
}

.market-list-card {
  background: transparent;
  border-radius: 0;
  padding: 10px 0 70px;
  border: none;
}

.market-list-card .list-row {
  border-top-color: #1f2933;
}

/* ======================================================================
   COMMON BUTTONS / MSG
   ====================================================================== */

.btn-primary {
  background: var(--green);
  border-radius: 999px;
  border: none;
  color: #041b11;
  font-weight: 600;
  padding: 0.6rem 1.4rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn-outline {
  background: transparent;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  color: #e5e7eb;
  padding: 0.55rem 1.3rem;
  cursor: pointer;
}

.btn-outline.danger {
  border-color: rgba(248, 113, 113, 0.85);
  color: #fecaca;
}

.full-width {
  width: 100%;
}

.msg {
  margin-top: 0.4rem;
  font-size: 0.78rem;
}

.msg.error {
  color: #fb7185;
}
.msg.success {
  color: #22c55e;
}

/* =====================================================================
   FORM CONTROL NORMALIZATION (Spot + Futures + Widgets)
   ===================================================================== */

.screen-spot select,
.screen-futures select,
.screen-spot input[type="number"],
.screen-futures input[type="number"],
.signal-toolbar select,
.signal-toolbar input {
  background: var(--bin-surface-2);
  color: var(--bin-text);
  border: 1px solid var(--bin-border);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12px;
  outline: none;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

/* select arrow */
.screen-spot select,
.screen-futures select,
.signal-toolbar select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--bin-sub) 50%),
    linear-gradient(135deg, var(--bin-sub) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 13px) calc(50% - 3px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}

.screen-spot input::placeholder,
.screen-futures input::placeholder {
  color: #6b7280;
}

/* focus glow */
.screen-spot select:focus,
.screen-futures select:focus,
.screen-spot input:focus,
.screen-futures input:focus,
.signal-toolbar select:focus,
.signal-toolbar input:focus {
  border-color: var(--bin-yellow);
  box-shadow: var(--bin-focus-shadow);
  background: #20252b;
}

/* =====================================================================
   SPOT SCREEN (TRADE)
   ===================================================================== */

.screen-spot {
  margin-top: 4px;
}

/* inner phone frame */
.screen-spot .spot-phone {
  width: 100%;
  background: radial-gradient(circle at top, #1e2329 0, #0b0e11 60%);
  border-radius: 22px;
  padding: 8px 8px 12px;
  border: 1px solid var(--border-soft);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.screen-spot .spot-phone .status-bar {
  font-size: 11px;
  color: #9aa4bf;
  padding: 2px 4px 4px;
}

/* top nav */
.screen-spot .top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 4px 2px;
  font-size: 14px;
}

.screen-spot .top-nav-left {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

#spot-pair-symbol {
  font-weight: 600;
  letter-spacing: 0.4px;
}

.screen-spot .pair-change {
  font-size: 11px;
  color: var(--green);
}

.screen-spot .top-nav-right {
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: #9aa4bf;
}

.screen-spot .top-nav-right span.active {
  color: #ffffff;
  font-weight: 600;
  position: relative;
}

.screen-spot .top-nav-right span.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  border-radius: 999px;
  background: var(--green);
}

/* layout */
.screen-spot .trade-layout {
  display: grid;
  grid-template-columns: 1.1fr 1.6fr;
  gap: 10px;
  margin-top: 10px;
}

/* orderbook left */
.screen-spot .orderbook {
  background: var(--bin-surface);
  border-radius: 12px;
  padding: 10px 8px;
  border: 1px solid var(--bin-border-soft);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
}

.screen-spot .orderbook-header {
  display: flex;
  justify-content: space-between;
  color: #5f6b85;
  font-size: 10px;
}

.screen-spot .order-row {
  display: flex;
  justify-content: space-between;
  margin: 1px 0;
  font-size: 10px;
}

.screen-spot .order-row span:first-child {
  width: 44%;
}
.screen-spot .order-row span:last-child {
  width: 30%;
  text-align: right;
}

.screen-spot .order-row.sell span:first-child {
  color: var(--red);
}
.screen-spot .order-row.buy span:first-child {
  color: var(--green);
}

.screen-spot .last-price {
  text-align: center;
  padding: 4px 0 1px;
}

.screen-spot .last-price-main {
  color: var(--green);
  font-size: 18px;
  font-weight: 700;
}

.screen-spot .last-price-sub {
  font-size: 11px;
  color: #9aa4bf;
}

.screen-spot .depth-bar {
  margin-top: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: #11151f;
  height: 6px;
  position: relative;
}

.screen-spot .depth-bar-buy {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 68%;
  background: rgba(14, 203, 129, 0.5);
}

.screen-spot .depth-bar-sell {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 32%;
  background: rgba(246, 70, 93, 0.6);
}

.screen-spot .orderbook-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 10px;
  color: #9aa4bf;
}

.screen-spot .amount-step {
  padding: 4px 6px;
  border-radius: 6px;
  background: #1c2027;
  border: 1px solid var(--border-soft);
  font-size: 10px;
}



/* NEW: Binance-style bid/ask tape under spot market price */
.screen-spot .orderbook-tape{
  flex: 1 1 auto;
  min-height: 0;
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--bin-border-soft);
  margin-top: 4px;
}

.screen-spot .orderbook-tape .tape-col{
  background: #0f141a;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  overflow: hidden;
}

.screen-spot .orderbook-tape .tape-title{
  padding: 6px 8px;
  font-size: 10px;
  color: #8fa3bb;
  border-bottom: 1px solid var(--border-soft);
  display:flex;
  align-items:center;
  justify-content: space-between;
}

.screen-spot .orderbook-tape .tape-rows{
  flex: 1 1 auto;
  min-height: 0;
  padding: 6px 8px 8px;
  display:flex;
  flex-direction:column;
  justify-content: flex-end; /* push rows down until space ends */
  gap: 4px;
}

.screen-spot .orderbook-tape .tape-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 8px;
  padding: 2px 4px;
  border-radius: 6px;
  font-size: 10px;
}

.screen-spot .orderbook-tape .tape-row .price,
.screen-spot .orderbook-tape .tape-row .qty{
  font-variant-numeric: tabular-nums;
}

.screen-spot .orderbook-tape .tape-row .qty{
  color:#9aa4bf;
}

.screen-spot .orderbook-tape .tape-row.ask .price{ color: var(--red); }
.screen-spot .orderbook-tape .tape-row.bid .price{ color: var(--green); }

.screen-spot .orderbook-tape .tape-row.flash-up{ animation: obFlashUp 650ms ease; }
.screen-spot .orderbook-tape .tape-row.flash-down{ animation: obFlashDown 650ms ease; }

@keyframes obFlashUp{
  0%{ background: rgba(14,203,129,0.18); }
  100%{ background: transparent; }
}
@keyframes obFlashDown{
  0%{ background: rgba(246,70,93,0.18); }
  100%{ background: transparent; }
}


/* NEW: Binance-style bid/ask tape under futures market price */
.screen-futures .orderbook-tape{
  flex: 1 1 auto;
  min-height: 0;
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--bin-border-soft);
  margin-top: 4px;
}

.screen-futures .orderbook-tape .tape-col{
  background: #0f141a;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.screen-futures .orderbook-tape .tape-title{
  padding: 6px 8px;
  font-size: 10px;
  color: #8fa3bb;
  border-bottom: 1px solid var(--border-soft);
  display:flex;
  align-items:center;
  justify-content: space-between;
}

.screen-futures .orderbook-tape .tape-rows{
  flex: 1 1 auto;
  min-height: 0;
  padding: 6px 8px 8px;
  display:flex;
  flex-direction:column;
  justify-content: flex-end; /* push rows down until space ends */
  gap: 4px;
}

.screen-futures .orderbook-tape .tape-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 8px;
  padding: 2px 4px;
  border-radius: 6px;
  font-size: 10px;
}

.screen-futures .orderbook-tape .tape-row .price,
.screen-futures .orderbook-tape .tape-row .qty{
  font-variant-numeric: tabular-nums;
}

.screen-futures .orderbook-tape .tape-row .qty{
  color:#9aa4bf;
}

.screen-futures .orderbook-tape .tape-row.ask .price{ color: var(--red); }
.screen-futures .orderbook-tape .tape-row.bid .price{ color: var(--green); }

.screen-futures .orderbook-tape .tape-row.flash-up{ animation: obFlashUp 650ms ease; }
.screen-futures .orderbook-tape .tape-row.flash-down{ animation: obFlashDown 650ms ease; }

/* Futures leverage typing + available balance placement */
.screen-futures .lev-typed-wrap{
  display:flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 92px;
}

.screen-futures .lev-typed-wrap #fut-custom-leverage{
  width: 82px;
  background: #1b2026;
  border: 1px solid var(--bin-border-soft);
  border-radius: 12px;
  padding: 6px 8px;
  text-align: center;
  font-weight: 700;
  color: #e6eef7;
}

.screen-futures .avbl-inline{
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-yellow);
  white-space: nowrap;
}

/* price pulse on main market price */
.screen-spot .last-price-main.pulse-up{ animation: pricePulseUp 650ms ease; }
.screen-spot .last-price-main.pulse-down{ animation: pricePulseDown 650ms ease; }

@keyframes pricePulseUp{
  0%{ color: var(--green); text-shadow: 0 0 0 rgba(14,203,129,0); }
  35%{ color: #bff7df; text-shadow: 0 0 14px rgba(14,203,129,0.25); }
  100%{ color: var(--green); text-shadow: 0 0 0 rgba(14,203,129,0); }
}
@keyframes pricePulseDown{
  0%{ color: var(--red); text-shadow: 0 0 0 rgba(246,70,93,0); }
  35%{ color: #ffc0c9; text-shadow: 0 0 14px rgba(246,70,93,0.20); }
  100%{ color: var(--red); text-shadow: 0 0 0 rgba(246,70,93,0); }
}

/* trade panel right */
.screen-spot .trade-panel {
  background: var(--bin-surface);
  border-radius: 12px;
  padding: 10px;
  border: 1px solid var(--bin-border-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 11px;
}

/* BUY / SELL toggle */
.screen-spot .buy-sell-toggle {
  display: flex;
  background: #1e2329;
  border-radius: 999px;
  padding: 2px;
  font-size: 12px;
}

.screen-spot .toggle-btn {
  flex: 1;
  text-align: center;
  padding: 6px 0;
  border-radius: 999px;
  cursor: pointer;
  color: #9aa4bf;
  user-select: none;
}

.screen-spot .toggle-btn.active-buy {
  background: var(--green);
  color: #041b11;
  font-weight: 700;
}

.screen-spot .toggle-btn.active-sell {
  background: var(--red);
  color: #2b090c;
  font-weight: 700;
}

/* fields */
.screen-spot .field {
  margin-top: 6px;
}

.screen-spot .field-label {
  font-size: 10px;
  color: #9aa4bf;
  margin-bottom: 2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.screen-spot .field-input {
  background: var(--bin-surface-2);
  border: 1px solid var(--bin-border);
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

/* Spot inline number inputs (JS uses these IDs) */
#spot-amount-asset,
#spot-stop-loss,
#spot-take-profit {
  background: transparent;
  border: none;
  outline: none;
  color: var(--bin-text);
  padding: 2px 0;
  font-size: 12px;
  width: 100%;
}

#spot-stop-loss,
#spot-take-profit {
  text-align: left;
}

/* suffix */
.screen-spot .suffix {
  font-size: 10px;
  color: #9aa4bf;
  margin-left: 6px;
  white-space: nowrap;
}

/* price emphasis (JS updates these IDs) */
#spot-price-display,
#spot-price-display-copy {
  color: var(--green);
  font-weight: 700;
}

/* total field */
#spot-total-usdt {
  color: var(--bin-text);
  font-weight: 700;
}

/* available row */
.screen-spot .avbl-row {
  margin: 4px 0 2px;
  font-size: 10px;
  color: #9aa4bf;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.screen-spot .avbl-row .value {
  color: #ffffff;
  font-weight: 500;
}

/* =====================================================================
   SL/TP MODE BUTTONS (Spot + Futures)
   ===================================================================== */

.sl-tp-mode {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.sl-tp-mode .mode-btn {
  border: 1px solid var(--bin-border);
  background: #1b2026;
  color: #9aa4bf;
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sl-tp-mode .mode-btn.active {
  background: var(--bin-yellow);
  color: #000;
  border-color: transparent;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(240, 185, 11, 0.18);
}

.sl-tp-mode .mode-hint {
  margin-left: auto;
  font-size: 10px;
  color: #636b8f;
}

/* =====================================================================
   RANGE SLIDERS (Spot + Futures)
   ===================================================================== */

#spot-amount-slider,
#fut-amount-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: #2b3139;
  border-radius: 999px;
  outline: none;
}

#spot-amount-slider::-webkit-slider-thumb,
#fut-amount-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bin-yellow);
  border: 2px solid #000;
  box-shadow: 0 0 0 2px rgba(240, 185, 11, 0.2);
  cursor: pointer;
}

#spot-amount-slider::-moz-range-thumb,
#fut-amount-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bin-yellow);
  border: 2px solid #000;
  box-shadow: 0 0 0 2px rgba(240, 185, 11, 0.2);
  cursor: pointer;
}

#spot-amount-slider::-webkit-slider-runnable-track,
#fut-amount-slider::-webkit-slider-runnable-track {
  height: 4px;
  background: #2b3139;
  border-radius: 999px;
}

#spot-amount-slider::-moz-range-track,
#fut-amount-slider::-moz-range-track {
  height: 4px;
  background: #2b3139;
  border-radius: 999px;
}

/* =====================================================================
   SLIDER META BLOCKS (JS IDs)
   ===================================================================== */

/* Spot slider meta */
.slider-meta {
  background: #11151f;
  border: 1px solid var(--bin-border-soft);
  border-radius: 12px;
  padding: 8px 10px;
  margin-top: 6px;
}

.slider-meta-top {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 10px;
  color: #9aa4bf;
}

.slider-meta-bottom {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--bin-text);
}

/* Futures slider meta */
.fut-slider-meta {
  background: #0f1422;
  border: 1px solid #1c2233;
  border-radius: 12px;
  padding: 8px 10px;
  margin-top: 4px;
}

/* =====================================================================
   SPOT ACTION BUTTON (JS: #spot-action-btn)
   ===================================================================== */

#spot-action-btn {
  background: var(--bin-green);
  color: #041b11;
  border: none;
  border-radius: 16px;
  padding: 11px 0;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  width: 100%;
  box-shadow: 0 12px 24px rgba(14, 203, 129, 0.28);
  transition: transform 0.12s ease, filter 0.12s ease, background 0.12s ease;
}

#spot-action-btn.danger {
  background: var(--bin-red);
  color: #2b090c;
  box-shadow: 0 12px 24px rgba(246, 70, 93, 0.25);
}

#spot-action-btn:active {
  transform: translateY(1px);
  filter: brightness(0.98);
}

/* =====================================================================
   SPOT BOTTOM TABS + PANELS (JS-driven)
   ===================================================================== */

#spot-bottom-tabs,
.screen-spot .bottom-tabs {
  margin-top: 10px;
  padding: 0 2px;
  font-size: 11px;
  color: #5f6b85;
  border-bottom: 1px solid #171b27;
  display: flex;
  gap: 20px;
}

#spot-bottom-tabs span,
.screen-spot .bottom-tabs span {
  padding: 6px 0;
  cursor: pointer;
  user-select: none;
}

#spot-bottom-tabs span.active,
.screen-spot .bottom-tabs span.active {
  color: #ffffff;
  position: relative;
  font-weight: 600;
}

#spot-bottom-tabs span.active::after,
.screen-spot .bottom-tabs span.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent-yellow);
}

/* Panels */
.spot-tab-panels {
  margin-top: 6px;
}

.spot-panel {
  display: none;
}
.spot-panel.active {
  display: block;
}

/* simple card/list for holdings/grid */
.simple-card {
  background: #181a20;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 10px 10px 8px;
  margin-top: 8px;
}

.simple-card-title {
  font-size: 11px;
  color: #cbd5f5;
  margin-bottom: 8px;
  font-weight: 700;
}

.simple-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
}

.simple-list.muted {
  color: #636b8f;
}

.simple-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  padding: 6px 4px;
  border-bottom: 1px solid #161b2a;
}

.simple-row:last-child {
  border-bottom: none;
}

.simple-row .asset {
  color: #fff;
  font-weight: 600;
}

.simple-row .qty {
  text-align: right;
}

.simple-row .muted {
  text-align: right;
  color: #636b8f;
}

/* =====================================================================
   SPOT LIVE ORDERS (JS: #spot-live-orders)
   ===================================================================== */

#spot-live-orders {
  margin-top: 6px;
  font-size: 11px;
  color: #9aa4bf;
}

.live-orders {
  background: #121722;
  border: 1px solid #1c2233;
  border-radius: 12px;
  padding: 10px 10px 8px;
}

.live-order-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 8px 2px 6px;
}

.live-order-row:last-child {
  border-bottom: none;
}

.live-order-main {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.order-side {
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.order-side.buy {
  color: var(--green);
}
.order-side.sell {
  color: var(--red);
}

.live-order-type {
  color: #8b93b8;
}

.live-order-price {
  margin-left: auto;
  font-weight: 600;
  color: #e6eef7;
}


.live-order-time{
  margin-left: 8px;
  font-size: 10px;
  color: #9aa4bf;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  font-variant-numeric: tabular-nums;
}
.live-order-sub {
  margin-top: 2px;
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #8b93b8;
}

/* =====================================================================
   FUTURES SCREEN
   ===================================================================== */

.screen-futures {
  margin-top: 4px;
}

.screen-futures .fut-screen {
  width: 100%;
  background: radial-gradient(circle at top, #1e2329 0%, #0b0e11 55%, #000 100%);
  border-radius: 24px;
  padding: 10px 8px 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

/* top bar */
.screen-futures .top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px 8px;
  font-size: 13px;
  color: #8b93b8;
}

.screen-futures .top-bar-left {
  display: flex;
  gap: 10px;
  align-items: center;
}

.screen-futures .top-bar-title span:first-child {
  color: #ffffff;
  font-weight: 700;
}

.screen-futures .top-tabs {
  display: flex;
  gap: 12px;
  font-size: 12px;
}

.screen-futures .top-tabs span {
  opacity: 0.55;
  cursor: pointer;
}

.screen-futures .top-tabs span.active {
  opacity: 1;
  color: #ffffff;
  font-weight: 600;
}

.screen-futures .top-bar-right {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 18px;
  color: #8b93b8;
}

/* pair header */
.screen-futures .pair-header {
  padding: 6px 10px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.screen-futures .pair-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.screen-futures .pair-symbol {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  font-weight: 700;
}

.screen-futures .pair-symbol .badge {
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 11px;
  color: #636b8f;
  min-width: 0;
  height: auto;
}

.screen-futures .pair-change {
  font-size: 13px;
  color: var(--green);
  font-weight: 600;
}

.screen-futures .pair-sub {
  font-size: 11px;
  color: #636b8f;
  display: flex;
  gap: 6px;
  align-items: center;
}

.screen-futures .pair-right {
  display: flex;
  gap: 10px;
  font-size: 18px;
  color: #636b8f;
}

/* layout */
.screen-futures .main-content.fut-main {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr;
  gap: 6px;
  padding: 4px 4px 6px;
}

/* orderbook */
.screen-futures .orderbook {
  background: var(--bin-surface);
  border-radius: 18px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--bin-border-soft);
}

.screen-futures .orderbook-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #636b8f;
  margin-bottom: 4px;
}

.screen-futures .order-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 12px;
}

.screen-futures .order-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  align-items: center;
}

.screen-futures .price-sell {
  color: var(--red);
}
.screen-futures .price-buy {
  color: var(--green);
}

.screen-futures .amount {
  text-align: right;
  color: #8b93b8;
}

.screen-futures .orderbook-mid {
  text-align: center;
  margin: 6px 0;
}

.screen-futures .mid-price-main {
  font-size: 17px;
  font-weight: 700;
  color: var(--green);
}

.screen-futures .mid-price-sub {
  font-size: 11px;
  color: #636b8f;
}

.screen-futures .orderbook-bottom {
  margin-top: auto;
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  color: #8b93b8;
}

.screen-futures .volume-bar {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--green) 75%, var(--red) 75%);
}

/* panel form */
.screen-futures .panel {
  background: var(--bin-surface);
  border-radius: 18px;
  padding: 10px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--bin-border-soft);
}

.screen-futures .panel-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

/* Futures segmented */
.screen-futures .segmented {
  display: inline-flex;
  background: #1e2329;
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
  border: 1px solid var(--bin-border-soft);
}

.screen-futures .segmented button {
  border: none;
  outline: none;
  padding: 3px 8px;
  font-size: 11px;
  border-radius: 999px;
  background: transparent;
  color: #636b8f;
  cursor: pointer;
}

.screen-futures .segmented.small button {
  padding: 3px 6px;
}

.screen-futures .segmented button.active {
  background: #2b3139;
  color: #ffffff;
  font-weight: 600;
}

.screen-futures .panel-label {
  font-size: 11px;
  color: #636b8f;
  margin-bottom: 2px;
}

.screen-futures .input {
  background: var(--bin-surface-3);
  border-radius: 12px;
  border: 1px solid #1f2636;
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  gap: 8px;
}

.screen-futures .input span.unit {
  font-size: 11px;
  color: #8b93b8;
}

/* Futures amount / interval inline fields */
#fut-amount,
#fut-stop-loss,
#fut-take-profit,
#fut-interval,
#fut-custom-leverage {
  background: transparent;
  border: none;
  outline: none;
  color: var(--bin-text);
  padding: 2px 0;
  font-size: 12px;
  width: 100%;
}

/* custom leverage input visual emphasis */
#fut-custom-leverage {
  text-align: center;
  font-weight: 700;
  color: #e6eef7;
}

/* =====================================================================
   FUTURES TABS (Positions / Open Orders)
   JS: #fut-pos-tab, #fut-orders-tab
   ===================================================================== */

.screen-futures .tabs {
  display: flex;
  padding: 6px 10px 2px;
  border-top: 1px solid #161b2a;
  font-size: 12px;
  gap: 18px;
  margin-top: 4px;
}

.screen-futures .tab,
#fut-pos-tab,
#fut-orders-tab {
  position: relative;
  padding-bottom: 4px;
  color: #636b8f;
  cursor: pointer;
  user-select: none;
}

.screen-futures .tab.active,
#fut-pos-tab.active,
#fut-orders-tab.active {
  color: #ffffff;
  font-weight: 600;
}

.screen-futures .tab.active::after,
#fut-pos-tab.active::after,
#fut-orders-tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 999px;
  background: var(--accent-yellow);
}

/* panels container */
.fut-panels {
  margin: 0 6px 8px;
}

.fut-panel {
  display: none;
}
.fut-panel.active {
  display: block;
}

/* ======================================================================
   FUTURES POSITIONS + OPEN ORDERS TABLES
   ====================================================================== */

.fut-pos-header {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.8fr 1fr 1fr 1fr 1fr 1fr 1fr;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid #1f2636;
  font-size: 10px;
  color: var(--text-secondary);
}

.fut-pos-body {
  max-height: 200px;
  overflow: auto;
}

.fut-pos-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.8fr 1fr 1fr 1fr 1fr 1fr 1fr;
  gap: 6px;
  padding: 8px 10px;
  font-size: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.fut-pos-row.empty {
  display: block;
  color: var(--text-secondary);
}

.fut-pos-row .sym {
  color: #fff;
  font-weight: 700;
}

/* futures open orders table */
.fut-ord-header {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.8fr 0.8fr;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid #1f2636;
  font-size: 10px;
  color: var(--text-secondary);
}

.fut-ord-body {
  max-height: 200px;
  overflow: auto;
}

.fut-ord-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.8fr 0.8fr;
  gap: 6px;
  padding: 8px 10px;
  font-size: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.fut-ord-row.empty {
  display: block;
  color: var(--text-secondary);
}

.fut-ord-row .buy {
  color: var(--green);
  font-weight: 700;
}

.fut-ord-row .sell {
  color: var(--red);
  font-weight: 700;
}

/* =====================================================================
   REAL / SIM TOGGLES
   ===================================================================== */

.real-sim-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  gap: 8px;
}

.real-sim-row .muted {
  font-size: 10px;
  color: #9aa4bf;
}

#spot-mode-toggle,
#fut-mode-toggle {
  display: inline-flex;
  gap: 4px;
  background: #0b0e11;
  border: 1px solid var(--bin-border-soft);
  padding: 3px;
  border-radius: 999px;
}

#spot-mode-toggle button,
#fut-mode-toggle button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--bin-sub);
  padding: 4px 10px;
  font-size: 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

#spot-mode-toggle button.active,
#fut-mode-toggle button.active {
  background: #272a30;
  color: var(--bin-yellow);
  border-color: #3a414b;
  font-weight: 700;
}

#spot-mode-toggle button[data-mode="REAL"].active,
#fut-mode-toggle button[data-mode="REAL"].active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(240, 185, 11, 0.2), rgba(240, 185, 11, 0.06));
  border-color: rgba(240, 185, 11, 0.35);
}

#spot-mode-toggle button[data-mode="SIMULATION"].active,
#fut-mode-toggle button[data-mode="SIMULATION"].active {
  color: #cbd5f5;
  background: linear-gradient(135deg, rgba(138, 162, 189, 0.18), rgba(138, 162, 189, 0.06));
  border-color: rgba(138, 162, 189, 0.35);
}

/* Futures Margin + Leverage toggle */
#fut-margin-toggle,
#fut-leverage-toggle {
  background: #1b2026;
  border: 1px solid var(--bin-border-soft);
  padding: 3px;
  border-radius: 999px;
  gap: 4px;
}

#fut-margin-toggle button,
#fut-leverage-toggle button {
  color: #8b93b8;
  padding: 4px 9px;
  font-size: 10px;
}

#fut-margin-toggle button.active,
#fut-leverage-toggle button.active {
  background: #2b3139;
  color: #fff;
  border-color: #3a414b;
  font-weight: 600;
}

/* ======================================================================
   SIGNAL CHART WIDGET
   ====================================================================== */

.signal-widget {
  margin: 8px 0 10px;
  background: linear-gradient(180deg, #14191f, #10151c);
  border: 1px solid #1a2736;
  border-radius: 14px;
  overflow: hidden;
}

.signal-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border-bottom: 1px solid #1a2736;
  background: rgba(11, 15, 20, 0.75);
}

.signal-toolbar .title {
  font-size: 11px;
  color: #e6eef7;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.signal-toolbar .hint {
  font-size: 10px;
  color: #9eb1c7;
}

.signal-toolbar select,
.signal-toolbar input,
.signal-toolbar button {
  background: #0f1621;
  color: #e6eef7;
  border: 1px solid #1a2736;
  border-radius: 10px;
  padding: 5px 8px;
  font-size: 10px;
  outline: none;
}

.signal-toolbar input[list] {
  min-width: 120px;
}

.signal-toolbar .pill {
  font-size: 10px;
  padding: 2px 6px;
  border: 1px solid #1a2736;
  border-radius: 999px;
  color: #9eb1c7;
}

.signal-toolbar .auto-box {
  display: flex;
  align-items: center;
  gap: 6px;
}

.signal-toolbar .auto-box input[type="checkbox"] {
  accent-color: var(--accent-yellow);
  transform: translateY(1px);
}

.signal-toolbar .amt {
  width: 64px;
}

.mode-toggle {
  display: flex;
  gap: 6px;
}

.sig-mode-btn {
  padding: 4px 8px !important;
  font-size: 10px !important;
  opacity: 0.75;
  cursor: pointer;
}
.sig-mode-btn.active {
  opacity: 1;
  border-color: var(--accent-yellow);
  color: #fff;
}

.signal-chart {
  height: 210px;
}

@media (max-width: 360px) {
  .signal-chart {
    height: 190px;
  }
}

/* NEW: Scrollable signal panel (under chart) */
.signal-panel{
  border-top: 1px solid #1a2736;
  background: rgba(12, 17, 24, 0.92);
}

.signal-panel-header{
  display:grid;
  grid-template-columns: 1.4fr .9fr 1fr 1fr 1fr .9fr 1.3fr;
  gap: 8px;
  padding: 8px 10px;
  font-size: 10px;
  color: #8fa3bb;
  border-bottom: 1px solid #1a2736;
  position: sticky;
  top: 0;
  background: rgba(12, 17, 24, 0.96);
  z-index: 2;
}

.signal-panel-body{
  max-height: 150px;
  overflow: auto;
}

.signal-row{
  display:grid;
  grid-template-columns: 1.4fr .9fr 1fr 1fr 1fr .9fr 1.3fr;
  gap: 8px;
  padding: 8px 10px;
  font-size: 10px;
  align-items: center;
  border-bottom: 1px solid rgba(26, 39, 54, 0.55);
}

.signal-row:hover{
  background: rgba(255,255,255,0.03);
}

.signal-row .sym{
  font-weight: 700;
  color: #e6eef7;
}

.signal-side{
  justify-self: start;
  font-weight: 800;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.06);
}

.signal-side.buy{
  color: var(--green);
  background: rgba(14,203,129,0.10);
  border-color: rgba(14,203,129,0.22);
}

.signal-side.sell{
  color: var(--red);
  background: rgba(246,70,93,0.10);
  border-color: rgba(246,70,93,0.22);
}

.signal-strength{
  justify-self: start;
  font-weight: 800;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--accent-yellow);
  background: rgba(240,185,11,0.10);
  border: 1px solid rgba(240,185,11,0.20);
}

.signal-time{
  color: #9eb1c7;
  font-variant-numeric: tabular-nums;
}

/* status label inside widget */
.sig-status {
  font-size: 10px;
  color: #9eb1c7;
}

/* ======================================================================
   BACKEND FLAGS
   ====================================================================== */

#backend-flags-spot,
#backend-flags-fut {
  font-size: 10px;
  color: #8b93b8;
  margin-top: 4px;
}

/* ======================================================================
   LOGIN LAYOUT
   ====================================================================== */

.login-wrapper {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 20px;
  background: rgba(15, 23, 42, 0.95);
  border-radius: 18px;
  border: 1px solid #1f2937;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.8);
  padding: 16px 18px;
}

.login-card-left {
  padding-right: 8px;
}

.app-title {
  font-size: 1.3rem;
  margin-bottom: 6px;
}

.app-subtitle {
  font-size: 0.82rem;
  color: var(--text-sub);
  margin-bottom: 10px;
}

.features-list {
  list-style: disc;
  padding-left: 18px;
  font-size: 0.8rem;
  color: #cbd5f5;
}

.features-list li + li {
  margin-top: 4px;
}

.login-card-right h2 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.login-caption {
  font-size: 0.78rem;
  color: var(--text-sub);
  margin-bottom: 10px;
}

.login-form .field {
  margin-bottom: 8px;
}

.login-form label {
  font-size: 0.78rem;
  color: var(--text-sub);
  display: block;
  margin-bottom: 3px;
}

.login-form input {
  width: 100%;
  padding: 7px 9px;
  border-radius: 9px;
  border: 1px solid #1f2937;
  background: #020617;
  color: #f9fafb;
  font-size: 0.85rem;
}

@media (max-width: 720px) {
  .login-card {
    grid-template-columns: 1fr;
  }
}

/* ======================================================================
   RESPONSIVE / SMALL TWEAKS
   ====================================================================== */

@media (max-width: 480px) {
  .screen-spot .trade-layout {
    grid-template-columns: 1fr;
  }
  .screen-spot .orderbook {
    order: 2;
  }
  .screen-spot .trade-panel {
    order: 1;
  }

  .signal-toolbar {
    gap: 6px;
  }
  .signal-toolbar .amt {
    width: 58px;
  }

  /* Futures manual controls: mobile layout like top section */
  .screen-futures .main-content.fut-main{
    grid-template-columns: 1fr;
    grid-template-areas:
      "panel"
      "orderbook";
  }
  .screen-futures .main-content.fut-main > .orderbook{ grid-area: orderbook; }
  .screen-futures .main-content.fut-main > .panel{ grid-area: panel; }

  .screen-futures .panel-row{
    flex-wrap: wrap;
    align-items: flex-start;
  }
  #fut-margin-toggle{
    flex: 1 1 auto;
  }
  #fut-leverage-toggle{
    flex: 1 1 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .screen-futures .lev-typed-wrap{
    margin-left: auto;
  }
}

@media (max-width: 390px) {
  .app {
    padding: 10px 10px 4px;
  }
  .bottom-nav-inner {
    padding: 8px 14px 6px;
  }
}

@media (max-height: 700px) {
  .screen-futures .fut-screen {
    border-radius: 18px;
  }
  .screen-futures .main-content.fut-main {
    grid-template-columns: 1fr;
    grid-auto-rows: minmax(0, 1fr);
  }
}


/* ======================================================================
   HOME SLIDER + NEWS MARQUEE + COIN LOGOS (ADDED)
   ====================================================================== */

.home-slider {
  margin: 8px 0 14px;
  width: 100%;
  height: 120px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  background: #0f141a;
  position: relative;
}

.home-slider-track {
  display: flex;
  width: 300%;
  height: 100%;
  transition: transform 650ms ease;
}

.home-slide {
  width: 100%;
  height: 100%;
  flex: 0 0 100%;
  object-fit: contain;
  box-sizing: border-box;
  padding: 12px 14px;
  display: block;
}

.home-slider-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  display: flex;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
}

.home-slider-dots .dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
}
.home-slider-dots .dot.active {
  background: var(--accent-yellow);
}

.news-strip {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: #11151a;
}

.news-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #000;
  background: var(--accent-yellow);
  padding: 3px 8px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.news-marquee {
  overflow: hidden;
  white-space: nowrap;
  flex: 1 1 auto;
}

.news-marquee-inner {
  display: inline-block;
  white-space: nowrap;
  padding-left: 100%;
  animation: news-marquee 22s linear infinite;
  font-size: 11px;
  color: var(--text-sub);
}

@keyframes news-marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

.coin-logo {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  object-fit: cover;
  background: #0f141a;
  border: 1px solid var(--border-soft);
  flex: 0 0 auto;
}

.coin-name .coin-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}


/* =====================================================================
   QUICK ACTIONS (Home icons row)
   ===================================================================== */
.quick-actions{
  display:grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  padding: 10px 14px 6px;
}
.qa-item{
  text-align:center;
  cursor:pointer;
  user-select:none;
}
.qa-icon{
  width: 58px;
  height: 58px;
  margin: 0 auto 8px;
  border-radius: 18px;
  background: #222831;
  border: 1px solid rgba(255,255,255,0.06);
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow: 0 8px 18px rgba(0,0,0,0.35);
}
.qa-icon svg{
  width: 30px;
  height: 30px;
  fill: #e9eef6;
}
.qa-icon svg .qa-accent{
  fill: var(--bin-yellow);
}
.qa-label{
  font-size: 12px;
  color: #d7dee8;
  opacity: 0.95;
}

/* =====================================================================
   ASSETS SCREEN (Wallet UI)
   ===================================================================== */
.screen-assets{
  padding: 10px 14px 80px;
}
.assets-header{
  margin-top: 4px;
}
.assets-tabs{
  display:flex;
  gap: 16px;
  align-items:center;
  font-size: 14px;
}
.assets-tab{
  opacity: 0.6;
  cursor:pointer;
  user-select:none;
}
.assets-tab.active{
  opacity: 1;
  color: #fff;
  font-weight: 700;
}
.assets-total{
  margin-top: 12px;
  background: #11151f;
  border: 1px solid var(--bin-border-soft);
  border-radius: 18px;
  padding: 14px 14px 12px;
}
.assets-total-head{
  display:flex;
  justify-content: space-between;
  align-items:center;
  font-size: 12px;
  color: #9aa4bf;
}
.assets-total-value{
  margin-top: 6px;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: #ffffff;
}
.assets-cur{
  font-size: 14px;
  font-weight: 700;
  color: #9aa4bf;
  margin-left: 6px;
}
.assets-total-pnl{
  margin-top: 6px;
  font-size: 12px;
  color: #9aa4bf;
}
.assets-total-pnl span{
  margin-left: 6px;
  font-weight: 700;
  color: var(--bin-green);
}
.assets-actions{
  margin-top: 12px;
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.assets-btn{
  border: 1px solid rgba(255,255,255,0.08);
  background: #1b212b;
  color: #e6eef7;
  border-radius: 14px;
  padding: 10px 10px;
  font-size: 13px;
  font-weight: 700;
  cursor:pointer;
}
.assets-btn.primary{
  background: var(--bin-yellow);
  color: #0b0e11;
  border-color: rgba(240, 185, 11, 0.25);
}
.assets-panel{
  margin-top: 12px;
  background: #0f1422;
  border: 1px solid #1c2233;
  border-radius: 18px;
  padding: 12px 12px;
}
.assets-panel-tabs{
  display:flex;
  gap: 14px;
  font-size: 12px;
  color: #9aa4bf;
  margin-bottom: 10px;
}
.assets-panel-tabs span{
  cursor:pointer;
  user-select:none;
}
.assets-panel-tabs span.active{
  color: #ffffff;
  font-weight: 700;
  position: relative;
}
.assets-panel-tabs span.active::after{
  content:"";
  position:absolute;
  left:0;
  bottom:-6px;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--bin-yellow);
}
.assets-list{
  display:flex;
  flex-direction: column;
  gap: 10px;
}
.assets-row{
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 10px 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 14px;
}
.assets-row-left{
  font-size: 13px;
  font-weight: 700;
  color: #e9eef6;
}
.assets-row-right{
  font-size: 13px;
  font-weight: 800;
  color: #e9eef6;
}


/* ======================================================================
   PATCH: Spot/Futures orderbook columns, Futures close button, Trade panel compact,
   Futures mobile full-height, Spot holdings trades time (ADDED)
   ====================================================================== */

/* asks/bids: show rows from top and tint full columns red/green */
.screen-spot .orderbook-tape .tape-rows,
.screen-futures .orderbook-tape .tape-rows{
  justify-content: flex-start !important;
}

.screen-spot .orderbook-tape .tape-col.tape-asks,
.screen-futures .orderbook-tape .tape-col.tape-asks{
  background: rgba(246,70,93,0.10) !important;
  border-color: rgba(246,70,93,0.22) !important;
}

.screen-spot .orderbook-tape .tape-col.tape-bids,
.screen-futures .orderbook-tape .tape-col.tape-bids{
  background: rgba(14,203,129,0.10) !important;
  border-color: rgba(14,203,129,0.22) !important;
}

/* Futures close position button should be red */
.btn-danger{
  background: var(--red);
  border: none;
  color: #fff;
  font-weight: 700;
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  cursor: pointer;
}
.btn-danger:hover{ filter: brightness(1.05); }
#fut-close-btn{ background: var(--red); }

/* Spot trade panel: smaller design */
.screen-spot .trade-panel{
  padding: 8px !important;
  gap: 6px !important;
  font-size: 10px !important;
  border-radius: 10px !important;
}
.screen-spot .buy-sell-toggle{ font-size: 11px !important; }
.screen-spot .toggle-btn{ padding: 5px 0 !important; }
.screen-spot .trade-panel select,
.screen-spot .trade-panel input[type="number"]{
  padding: 8px 10px !important;
  font-size: 11px !important;
  border-radius: 10px !important;
}

/* Futures page: ensure it uses full mobile screen and doesn't hide behind bottom nav */
@media (max-width: 520px){
  .screen-futures{ padding-bottom: 88px; }
  .screen-futures .fut-screen{
    min-height: calc(100vh - 160px);
    display: flex;
    flex-direction: column;
  }
}

/* Spot holdings: Recent Trades section styling */
.simple-divider{
  height: 1px;
  background: rgba(148,163,184,0.18);
  margin: 10px 0 8px;
}
.simple-subtitle{
  font-size: 11px;
  font-weight: 700;
  color: #e5e7eb;
  margin-bottom: 6px;
}


/* ======================================================================
   CONTROL PANEL (ADDED)
   ====================================================================== */

.screen-control{
  padding: 10px 10px 80px;
}

.screen-control .control-top{
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 8px 4px 10px;
}

.screen-control .control-title{
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.screen-control .control-wrap{
  display:flex;
  flex-direction: column;
  gap: 12px;
}

.screen-control .control-card{
  background: #0f141a;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  padding: 12px 12px;
}

.screen-control .control-card-title{
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 10px;
  color: #e6eef7;
}

.screen-control .control-row{
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 8px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.screen-control .control-row:first-of-type{
  border-top: none;
}

.screen-control .control-toggle{
  display:flex;
  align-items:center;
  gap: 10px;
  font-size: 12px;
  color: #cfd6e4;
  user-select:none;
}
.screen-control .control-toggle input{
  width: 16px;
  height: 16px;
}

.screen-control .control-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.screen-control .control-field{
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 8px 10px;
}

.screen-control .control-label{
  font-size: 10px;
  color: #8fa3bb;
  margin-bottom: 4px;
  font-weight: 700;
}

.screen-control .control-field input,
.screen-control .control-field select{
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #e6eef7;
  font-size: 12px;
  font-weight: 700;
}

.screen-control .control-actions{
  display:flex;
  gap: 10px;
  align-items:center;
  margin-top: 10px;
  flex-wrap: wrap;
}

.screen-control .control-actions .btn-primary,
.screen-control .control-actions .btn-danger{
  padding: 0.55rem 1.05rem;
  font-size: 0.85rem;
}
