/* =====================================================
   PrimeCopy — Post-login Dashboard (OKX-inspired mobile)
   Palette: black / white / green
   ===================================================== */
@import url("brand.css");

:root{
  --bg:          #000000;
  --surface:     #0e0e0e;
  --surface-2:   #161616;
  --surface-3:   #1c1c1c;
  --line:        #1d1d1d;
  --line-soft:   #131313;

  --white:       #ffffff;
  --text:        #ededed;
  --text-dim:    #9a9a9a;
  --text-mute:   #5a5a5a;

  --green:       #00d672;
  --green-bright:#1aee8c;
  --green-soft:  rgba(0,214,114,.10);
  --red:         #ff4d4d;

  --font-sans: "Inter", system-ui, -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-display: "Inter Tight", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

*,*::before,*::after{ box-sizing:border-box; }
html{
  margin:0; padding:0;
  width:100%;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html,body{ background: #050505; }
body{
  margin:0; padding:0;
  font-family: var(--font-sans);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.45;
  overflow-x: clip;
  overscroll-behavior-x: none;
  width: 100%;
  max-width: 100%;
  min-height: 100dvh;
  touch-action: manipulation;
}
img,svg{ display:block; max-width:100%; }
a{ color:inherit; text-decoration:none; }
button{ font: inherit; cursor:pointer; border:none; background:none; color:inherit; padding:0; }

.up{ color: var(--green); }
.dn{ color: var(--red); }

/* ============ APP SHELL (phone-style frame) ============ */
.app{
  width: 100%;
  max-width: min(440px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  padding-bottom: 96px; /* room for bottom nav */
  overflow-x: clip;
  min-width: 0;
}

/* ============ TOP BAR ============ */
.topbar{
  display:flex; align-items:center; gap: 10px;
  padding: 14px 16px 10px;
  position: sticky; top: 0; z-index: 30;
  background: rgba(0,0,0,.86);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.iconbtn{
  width: 38px; height: 38px;
  display:grid; place-items:center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
  flex-shrink: 0;
  position: relative;
  transition: background .15s ease;
}
.iconbtn.ghost{ background: transparent; color: var(--text-dim); }
.iconbtn:hover{ background: var(--surface-3); }
.iconbtn svg{ width: 18px; height: 18px; }
.iconbtn.notif .dot{
  position:absolute; top: 2px; right: 2px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: #ff3b3b; color: #fff;
  border-radius: 100px;
  font-size: 10px; font-weight: 600;
  display:grid; place-items:center;
  border: 2px solid var(--bg);
}

.searchbar{
  flex: 1;
  height: 38px;
  display:flex; align-items:center; gap: 8px;
  padding: 0 14px;
  background: var(--surface-2);
  border-radius: 100px;
  color: var(--text-mute);
}
.searchbar svg{ width: 16px; height: 16px; }
.searchbar input{
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font: inherit; font-size: 16px;
}
.searchbar input::placeholder{ color: var(--text-mute); }

/* ============ ACCOUNT ROW ============ */
.account{
  display:flex; align-items:center; justify-content:space-between;
  padding: 4px 20px 10px;
}
.account-left{ display:flex; align-items:center; gap: 10px; }
.acc-mark{
  width: 22px; height: 22px;
  background: linear-gradient(135deg, #1aee8c, #00a352);
  border-radius: 4px;
}
.acc-name{ color: var(--white); font-weight: 500; font-size: 15px; }
.chev{ width: 16px; height: 16px; color: var(--text-dim); }

/* ============ BALANCE + CHART ============ */
.balance{
  padding: 10px 20px 18px;
  display:flex; align-items:flex-start; justify-content:space-between; gap: 12px;
}
.bal-amt{
  font-family: var(--font-display);
  font-size: 38px; line-height: 1;
  letter-spacing: -.02em;
  color: var(--white); font-weight: 700;
  font-feature-settings: "tnum";
}
.bal-delta{
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 13px; color: var(--green);
  display:flex; align-items:center; gap: 6px;
  font-feature-settings: "tnum";
}
.bal-delta .period{ color: var(--text-mute); }
.bal-chart{
  width: 140px; height: 60px; flex-shrink: 0;
}
.bal-chart svg{ width: 100%; height: 100%; }

/* ============ QUICK ACTIONS ============ */
.quick{
  display:grid; grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 4px 12px 18px;
}
.qa{
  display:flex; flex-direction:column; align-items:center; gap: 8px;
  padding: 8px 4px;
  color: var(--text);
  transition: opacity .15s ease;
}
.qa:hover{ opacity: .8; }
.qa-circle{
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--surface-2);
  display:grid; place-items:center;
  color: var(--white);
  border: 1px solid var(--line);
}
.qa-circle svg{ width: 20px; height: 20px; }
.qa-l{ font-size: 12px; color: var(--text); font-weight: 500; }

/* ============ TAB PILLS ============ */
.pills{
  display:flex; gap: 8px;
  padding: 0 16px 14px;
  overflow-x: auto;
  scrollbar-width: none;
}
.pills::-webkit-scrollbar{ display:none; }
.pill{
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 100px;
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 13px; font-weight: 500;
  display:inline-flex; align-items:center; gap: 6px;
  transition: background .15s ease, color .15s ease;
}
.pill:hover{ color: var(--white); }
.pill.active{ background: var(--white); color: #000; }
.pill .pcount{
  font-family: var(--font-mono);
  font-size: 11px;
  background: rgba(0,0,0,.08);
  padding: 1px 6px; border-radius: 100px;
}
.pill.active .pcount{ background: rgba(0,0,0,.08); color: #000; }

/* ============ ROWS (active copies) ============ */
.rows{
  padding: 0 4px;
}
.row{
  display:flex; align-items:center; justify-content:space-between; gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  transition: background .15s ease;
}
.row:hover{ background: var(--surface); }
.row-l{ display:flex; align-items:center; gap: 12px; min-width: 0; }
.avatar{
  width: 40px; height: 40px; border-radius: 50%;
  display:grid; place-items:center;
  background: var(--surface-2);
  border:1px solid var(--line);
  color: var(--white); font-size: 13px; font-weight: 600;
  flex-shrink: 0;
}
.row-id{ min-width: 0; }
.row-name{
  font-size: 15px; color: var(--white); font-weight: 600;
  display:flex; align-items:center; gap: 6px; flex-wrap: wrap;
}
.row-name .verify{ width: 14px; height: 14px; }
.row-sub{ font-size: 12px; color: var(--text-mute); margin-top: 2px; }
.row-r{ text-align: right; flex-shrink: 0; }
.row-bal{
  font-family: var(--font-mono); font-size: 14px; color: var(--white); font-weight: 600;
  font-feature-settings: "tnum";
}
.row-delta{
  font-family: var(--font-mono); font-size: 12px;
  margin-top: 4px; font-feature-settings: "tnum";
}

.tier{
  font-size: 9.5px; padding: 2px 7px;
  border-radius: 3px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600;
  display: inline-block; white-space: nowrap;
}
.tier-gold     { color: #ffd24a; background: rgba(255,210,74,.08); border:1px solid rgba(255,210,74,.22); }
.tier-platinum { color: #c5e8ff; background: rgba(197,232,255,.05); border:1px solid rgba(197,232,255,.18); }
.tier-silver   { color: #c0c8c4; background: rgba(192,200,196,.05); border:1px solid rgba(192,200,196,.18); }
.tier-bronze   { color: #cd7f32; background: rgba(205,127,50,.05); border:1px solid rgba(205,127,50,.22); }
.tier-legend   { color: var(--green); background: rgba(0,214,114,.07); border:1px solid rgba(0,214,114,.25); }

/* ---------- Balance split (Capital / Available) ---------- */
.balance{ flex-wrap: wrap; }
.bal-blocks{
  display: flex; gap: 22px;
  flex-wrap: wrap;
}
.bal-block{ min-width: 0; }
.bal-block .bb-l{
  font-size: 11px;
  color: var(--text-mute);
  text-transform: uppercase; letter-spacing: .06em;
}
.bal-block .bb-v{
  font-family: var(--font-display);
  font-size: 28px; line-height: 1;
  color: var(--white); font-weight: 700;
  letter-spacing: -.01em; margin-top: 4px;
  font-feature-settings: "tnum";
}
.bal-block .bb-d{
  font-size: 11px; color: var(--text-mute); margin-top: 4px;
}
.bal-block .bb-d.up{ color: var(--green); }
.bal-block .bb-d.dn{ color: var(--red); }
.roll-profit-btn{
  margin-top:10px;
  width:100%;
  padding:8px 10px;
  border-radius:8px;
  border:1px solid rgba(0,214,114,.28);
  background:rgba(0,214,114,.08);
  color:var(--green);
  font-size:11px;
  font-weight:600;
  cursor:pointer;
  transition:background .15s ease, border-color .15s ease;
}
.roll-profit-btn:hover{ background:rgba(0,214,114,.14); border-color:rgba(0,214,114,.4); }
.roll-profit-btn:disabled{ opacity:.5; cursor:not-allowed; }
@media(min-width:520px){
  .bal-block .bb-v{ font-size: 32px; }
}

/* ---------- Open position cards (MetaTrader-style) ---------- */
#positionsRows{
  padding: 8px 12px 12px;
}

/* ---------- Compact open position lines ---------- */
.pos-lines{
  padding: 0 16px 8px;
}
.pos-line{
  display:flex;
  align-items:center;
  gap:8px;
  padding:9px 0;
  border-bottom:1px solid var(--line-soft);
  font-family:var(--font-mono);
  font-size:11px;
}
.pos-line:last-child{ border-bottom:none; }
.pos-pair{
  font-weight:700;
  color:var(--white);
  letter-spacing:.03em;
  min-width:68px;
  font-size:11px;
}
.pos-side{
  font-size:9px;
  font-weight:700;
  padding:1px 5px;
  border-radius:3px;
  letter-spacing:.04em;
}
.pos-side.buy{ color:var(--green); background:rgba(0,214,114,.08); }
.pos-side.sell{ color:var(--red); background:rgba(255,77,77,.08); }
.pos-meta{
  flex:1;
  font-size:10px;
  color:var(--text-mute);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.pos-pnl{
  font-weight:700;
  font-size:11px;
  font-feature-settings:"tnum";
  white-space:nowrap;
}

/* ---------- MetaTrader-style open position card (legacy) ---------- */
.mt-card{
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 0 4px 8px;
  position: relative;
  overflow: hidden;
  transition: border-color .15s ease;
}
.mt-card.win::before, .mt-card.loss::before{
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
}
.mt-card.win::before { background: var(--green); }
.mt-card.loss::before{ background: var(--red); }

.mt-row1{ display:flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.mt-row1 .avatar.coin{ width: 32px; height: 32px; }
.mt-row1 .mt-pair{ font-size: 14px; color: var(--white); font-weight: 700; letter-spacing: -.01em; }
.mt-row1 .mt-side{
  font-size: 10px; padding: 2px 7px; border-radius: 3px;
  font-weight: 700; letter-spacing: .04em;
  font-family: var(--font-mono);
}
.mt-row1 .mt-side.buy { color: var(--green); background: rgba(0,214,114,.08); border:1px solid rgba(0,214,114,.25); }
.mt-row1 .mt-side.sell{ color: var(--red);   background: rgba(255,77,77,.08); border:1px solid rgba(255,77,77,.25); }
.mt-row1 .mt-lot{
  font-size: 11px; color: var(--text-dim);
  margin-left: auto;
  font-family: var(--font-mono);
}
.mt-row1 .mt-time{
  font-size: 10px; color: var(--text-mute);
  font-family: var(--font-mono);
}

.mt-row2{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}
.mt-cell{ min-width: 0; }
.mt-cell .l{
  font-size: 9.5px; color: var(--text-mute);
  text-transform: uppercase; letter-spacing: .05em;
}
.mt-cell .v{
  font-family: var(--font-mono); font-size: 13px;
  color: var(--white); margin-top: 3px;
  font-feature-settings: "tnum";
}
.mt-cell .v.big{ font-size: 15px; font-weight: 700; }
.mt-cell .v.up { color: var(--green); }
.mt-cell .v.dn { color: var(--red); }
.mt-cell .v.big.pnl-flash-up{
  animation: pnlFlashUp 0.4s ease;
}
.mt-cell .v.big.pnl-flash-dn{
  animation: pnlFlashDn 0.4s ease;
}
@keyframes pnlFlashUp{
  0%{ filter: brightness(1.35); transform: scale(1.03); }
  100%{ filter: brightness(1); transform: scale(1); }
}
@keyframes pnlFlashDn{
  0%{ filter: brightness(1.25); transform: scale(1.02); }
  100%{ filter: brightness(1); transform: scale(1); }
}

.mt-row3{
  display:flex; justify-content:space-between; align-items:center;
  margin-top: 8px; padding-top: 8px;
  border-top: 1px dashed var(--line);
  font-size: 11px; color: var(--text-mute);
}
.mt-pulse{
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono);
}
.mt-pulse .d{
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  animation: mt-pulse 1.4s ease-in-out infinite;
}
.mt-pulse.dn .d{ background: var(--red); }
@keyframes mt-pulse{ 0%,100%{ opacity:1; } 50%{ opacity:.3; } }

/* ----- LONG / SHORT side badges ----- */
.side{
  font-family: var(--font-mono);
  font-size: 10px; padding: 2px 7px;
  border-radius: 3px;
  font-weight: 600; letter-spacing: .04em;
  display: inline-block; white-space: nowrap;
}
.side-long{
  color: var(--green);
  background: rgba(0,214,114,.08);
  border: 1px solid rgba(0,214,114,.22);
}
.side-short{
  color: var(--red);
  background: rgba(255,77,77,.08);
  border: 1px solid rgba(255,77,77,.22);
}

/* ----- Coin avatar — wraps an inline SVG of the actual logo ----- */
.avatar.coin{
  background: transparent;
  border: none;
  padding: 0;
  overflow: hidden;
}
.avatar.coin svg{
  width: 100%;
  height: 100%;
  display: block;
}

.rows-foot{ text-align:center; padding: 14px 0 28px; }
.link-grn{ color: var(--green); font-size: 13px; font-weight: 500; }

/* ============ BOTTOM NAV ============ */
.botnav{
  position: fixed;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 440px;
  display:grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(8,8,8,.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  z-index: 40;
}
.bn{
  display:flex; flex-direction:column; align-items:center; gap: 4px;
  padding: 6px 0;
  color: var(--text-mute);
  font-size: 10.5px;
  transition: color .15s ease;
}
.bn svg{ width: 22px; height: 22px; stroke-width: 1.8; }
.bn:hover{ color: var(--text-dim); }
.bn.active{ color: var(--white); }
.bn.fab{
  position: relative;
  color: #000;
}
.bn.fab .fab-ring{
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--green);
  display:grid; place-items:center;
  margin-top: -22px;
  box-shadow: 0 8px 24px rgba(0,214,114,.35), 0 0 0 4px var(--bg);
  transition: background .15s ease;
}
.bn.fab .fab-ring svg{ width: 22px; height: 22px; stroke-width: 2.4; }
.bn.fab:hover .fab-ring{ background: var(--green-bright); }
.bn.fab .fab-l{
  font-size: 10.5px;
  font-weight: 600;
  color: var(--white);
  margin-top: -2px;
  white-space: nowrap;
}

/* ============ DRAWER (full menu) ============ */
.drawer-scrim{
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
  z-index: 60;
}
.drawer-scrim.open{ opacity: 1; pointer-events: auto; }

.drawer{
  position: fixed; top: 0; left: 0;
  width: 86%; max-width: 360px; height: 100dvh;
  background: var(--surface);
  border-right: 1px solid var(--line);
  z-index: 70;
  transform: translateX(-105%);
  transition: transform .28s cubic-bezier(.2,.7,.2,1);
  display:flex; flex-direction:column;
}
.drawer.open{ transform: translateX(0); }

.drawer-head{
  display:flex; align-items:center; justify-content:space-between;
  padding: 22px 20px 16px;
  border-bottom: 1px solid var(--line);
}
.prof{ display:flex; align-items:center; gap: 12px; }
.prof-avatar{
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, #1aee8c, #00a352);
  display:grid; place-items:center;
  color: #001a0d; font-weight: 700; font-size: 14px;
}
.prof-name{ color: var(--white); font-size: 15px; font-weight: 600; }
.prof-addr{ color: var(--text-mute); font-size: 12px; font-family: var(--font-mono); }

.drawer-bal{
  padding: 18px 20px 18px;
  border-bottom: 1px solid var(--line);
}
.drawer-bal .l{ font-size: 11px; color: var(--text-mute); text-transform: uppercase; letter-spacing: .06em; }
.drawer-bal .v{
  font-family: var(--font-display);
  font-size: 28px; color: var(--white); font-weight: 700;
  letter-spacing: -.02em; margin-top: 4px;
  font-feature-settings: "tnum";
}
.drawer-bal .d{ font-family: var(--font-mono); font-size: 12px; margin-top: 4px; font-feature-settings: "tnum"; }

.menu{
  flex: 1; overflow-y: auto;
  padding: 12px 8px;
}
.mi{
  display:flex; align-items:center; gap: 14px;
  padding: 12px 16px;
  border-radius: 10px;
  color: var(--text-dim);
  font-size: 14px; font-weight: 500;
  transition: background .15s ease, color .15s ease;
}
.mi:hover{ background: var(--surface-2); color: var(--white); }
.mi.active{ background: var(--surface-2); color: var(--white); }
.mi.active svg{ color: var(--green); }
.mi svg{ width: 20px; height: 20px; flex-shrink: 0; }
.mi span:first-of-type{ flex: 1; }
.mi .badge{
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--surface-3);
  color: var(--text-dim);
}
.mi .badge.gr{ background: var(--green-soft); color: var(--green); }
.mi .pillette{
  font-size: 10px; letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 4px; font-weight: 600;
  background: rgba(255,210,74,.08); color: #ffd24a; border:1px solid rgba(255,210,74,.22);
}

.drawer-foot{
  padding: 14px 16px calc(20px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
.btn-out{
  display:flex; align-items:center; gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  color: var(--text-dim);
  font-size: 14px; font-weight: 500;
}
.btn-out:hover{ background: var(--surface-2); color: var(--red); }
.btn-out svg{ width: 18px; height: 18px; }

/* Hide drawer-only elements outside small screens? Keep as-is. */

/* =====================================================
   DESKTOP / TABLET LAYOUT (>= 900px)
   - Persistent left sidebar (was the drawer on mobile)
   - Bottom nav hidden, hamburger hidden
   - Main content uses the full remaining width
   ===================================================== */
@media (min-width: 900px){
  html,body{ background: var(--bg); }
  body{
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100dvh;
  }

  /* --- Drawer becomes persistent sidebar --- */
  .drawer-scrim{ display: none !important; }
  .drawer{
    position: sticky;
    top: 0;
    grid-row: 1;
    grid-column: 1;
    transform: none !important;
    height: 100dvh;
    width: 260px;
    max-width: 260px;
    background: var(--surface);
    border-right: 1px solid var(--line);
    z-index: 5;
    display: flex; flex-direction: column;
  }
  .app{
    grid-row: 1;
    grid-column: 2;
  }
  .drawer .drawer-head{
    padding: 22px 20px 16px;
  }
  .drawer .drawer-head .iconbtn{ display: none; } /* hide close on desktop */

  /* --- Main app area --- */
  .app{
    max-width: none;
    width: 100%;
    padding: 0 0 48px;
    grid-column: 2;
  }

  .topbar{
    padding: 16px 32px 14px;
    gap: 14px;
  }
  .topbar #openMenu{ display: none; }   /* hamburger no longer needed */

  .searchbar{ max-width: 460px; }

  /* Push notif/globe to the right */
  .topbar .iconbtn:nth-of-type(2),
  .topbar .iconbtn:nth-of-type(3){ margin-left: 0; }

  .account{
    padding: 6px 32px 8px;
  }

  /* Bigger balance band */
  .balance{
    padding: 16px 32px 28px;
    gap: 32px;
    align-items: center;
  }
  .bal-amt{ font-size: 56px; }
  .bal-chart{
    width: 100%;
    max-width: 520px;
    height: 110px;
    margin-left: auto;
  }

  /* Quick actions wider, more breathing room */
  .quick{
    grid-template-columns: repeat(4, minmax(0, 220px));
    gap: 14px;
    padding: 0 32px 28px;
    justify-content: start;
  }
  .qa{
    flex-direction: row;
    gap: 14px;
    padding: 14px 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    justify-content: flex-start;
    transition: border-color .15s ease, background .15s ease;
  }
  .qa:hover{
    background: var(--surface-2);
    border-color: var(--surface-3);
    opacity: 1;
  }
  .qa-circle{
    width: 40px; height: 40px;
    background: var(--surface-2);
    border: 1px solid var(--line);
  }
  .qa-circle svg{ width: 17px; height: 17px; }
  .qa-l{ font-size: 14px; }

  /* Tabs */
  .pills{
    padding: 0 32px 16px;
    border-bottom: 1px solid var(--line);
  }
  .pill{ padding: 9px 16px; font-size: 13px; }

  /* Trader rows — wider, two extra columns */
  .rows{ padding: 8px 16px; }
  .row{
    padding: 18px 24px;
    border-radius: 12px;
    border-bottom: 1px solid var(--line-soft);
  }
  .row:last-of-type{ border-bottom: none; }
  .row-l{ flex: 1; }
  .avatar{ width: 44px; height: 44px; }
  .row-name{ font-size: 16px; }
  .row-sub{ font-size: 13px; }
  .row-bal{ font-size: 16px; }
  .row-delta{ font-size: 13px; }

  /* Bottom nav not needed */
  .botnav{ display: none; }
}

/* =====================================================
   LARGER DESKTOP (>= 1280px) — wider sidebar, more room
   ===================================================== */
@media (min-width: 1280px){
  body{ grid-template-columns: 280px 1fr; }
  .drawer, .drawer.open{ width: 280px; max-width: 280px; }
  .app{
    max-width: 1180px;
    padding-left: 16px;
    padding-right: 16px;
    margin: 0 auto;
  }
  .topbar{ padding: 22px 32px 18px; }
  .balance{ padding: 24px 32px 36px; }
  .bal-amt{ font-size: 64px; }
}

/* =====================================================
   MOBILE TWEAKS (< 900px) keep original phone-frame
   but make sure it fills the screen cleanly
   ===================================================== */
@media (max-width: 899px){
  body{ background: #050505; }
  .app{
    max-width: 480px;
    margin: 0 auto;
  }
}
@media (min-width: 600px) and (max-width: 899px){
  /* tablet portrait: just a wider phone frame, no sidebar yet */
  .app{
    margin-top: 24px; margin-bottom: 24px;
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid var(--line);
    box-shadow: 0 30px 80px rgba(0,0,0,.6);
  }
  .botnav{
    border-radius: 0 0 28px 28px;
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
  }
}

/* =====================================================
   COMPACT MODE — applied to all logged-in app pages
   Smaller type · tighter padding · translucent cards
   ===================================================== */

/* ---- Page header ---- */
.page-head h1{ font-size: clamp(20px, 2.4vw, 24px) !important; letter-spacing: -.02em; }
.page-head .lead{ font-size: 12.5px; }
.page-head .crumb{ font-size: 11px; }

/* ---- Cards: translucent + tighter ---- */
.card, .list-card, .stat-card{
  background: rgba(13,13,13,.55) !important;
  border: 1px solid rgba(255,255,255,.06) !important;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}
.card{ padding: 16px 18px !important; border-radius: 12px !important; }
.card h2{ font-size: 13px !important; }
.card .sub{ font-size: 11.5px !important; margin: 0 0 12px !important; }

.list-item{ padding: 12px 14px !important; }
.li-t{ font-size: 13px !important; }
.li-d{ font-size: 11px !important; }
.li-ic{ width: 32px !important; height: 32px !important; }
.li-ic svg{ width: 15px !important; height: 15px !important; }

/* ---- Buttons ---- */
.btn-small{ font-size: 11px !important; padding: 5px 10px !important; }
.btn-full{ font-size: 13px !important; padding: 11px 14px !important; }

/* ---- Tables ---- */
.tbl{ font-size: 12px !important; }
.tbl thead th{ font-size: 10px !important; padding: 9px 12px !important; }
.tbl tbody td{ padding: 10px 12px !important; }

/* ---- Forms ---- */
.input{ font-size: 13px !important; padding: 11px 14px !important; }
.field-l{ font-size: 11px !important; }
.notice{ font-size: 12px !important; padding: 10px 12px !important; }
.info-row{ font-size: 12px !important; padding: 9px 0 !important; }

/* ---- Dashboard balance ---- */
.bal-block .bb-v{ font-size: 22px !important; }
@media(min-width:520px){ .bal-block .bb-v{ font-size: 24px !important; } }
.bal-block .bb-l{ font-size: 10px !important; }
.bal-block .bb-d{ font-size: 10px !important; }
.bal-amt{ font-size: 28px !important; }
@media(min-width:520px){ .bal-amt{ font-size: 32px !important; } }

/* ---- MetaTrader-style position card ---- */
.mt-card{ padding: 11px 13px !important; }
.mt-row1 .mt-pair{ font-size: 13px !important; }
.mt-cell .v{ font-size: 12px !important; }
.mt-cell .v.big{ font-size: 14px !important; }

/* ---- Traders page cards ---- */
.t-card{ padding: 14px !important; }
.t-name{ font-size: 14px !important; }
.t-meta{ font-size: 11px !important; }
.t-roi-v{ font-size: 24px !important; }
.t-stats .v{ font-size: 12px !important; }
.btn-cp, .btn-vw{ font-size: 12px !important; padding: 8px 12px !important; }

/* ---- Pills / tabs ---- */
.pill{ font-size: 12px !important; padding: 6px 12px !important; }
.tab{ font-size: 12px !important; padding: 8px 12px !important; }
.seg-b{ font-size: 11px !important; padding: 6px 12px !important; }

/* ---- Referral banner ---- */
.ref-banner{ padding: 22px !important; }
.ref-banner h2{ font-size: clamp(20px, 2.4vw, 28px) !important; }
.ref-banner p{ font-size: 12.5px !important; }
.ref-stat .v{ font-size: 16px !important; }
.tier-cell .v{ font-size: 20px !important; }

/* ---- Settings sections ---- */
.section-title{ font-size: 11px !important; margin: 14px 4px 6px !important; }

/* =====================================================
   LOADING SKELETON
   ===================================================== */
.skel{
  display:inline-block;
  background: linear-gradient(90deg,
    rgba(255,255,255,.04) 0%,
    rgba(255,255,255,.09) 50%,
    rgba(255,255,255,.04) 100%);
  background-size: 200% 100%;
  animation: skel-shimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
  color: transparent !important;
  user-select: none;
}
@keyframes skel-shimmer{
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skel-block{ display:block; height: 14px; margin: 4px 0; }
.skel-block.lg{ height: 22px; }
.skel-block.xl{ height: 32px; }
.skel-row{
  display:flex; align-items:center; gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.skel-row .skel-avatar{
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,.05);
  flex-shrink: 0;
}
.skel-row .skel-body{ flex:1; }
.skel-row .skel-body .skel-block{ height: 10px; margin: 3px 0; }

.spinner-dot{
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.15);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin-dot .7s linear infinite;
  display:inline-block;
}
@keyframes spin-dot{ to{ transform: rotate(360deg); } }
.loading-center{
  display:flex; align-items:center; justify-content:center; gap: 10px;
  padding: 36px 16px;
  color: var(--text-mute);
  font-size: 12px;
}
