/* Dashboard-specific */
.balance-card {
  padding: 1.6rem;
  display: flex; flex-direction: column; align-items: center;
  gap: 0.6rem;
  max-width: 520px;
  margin: 0 auto 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.balance-card::before {
  content: ""; position: absolute; inset: -30% -10% auto -10%; height: 130%;
  background: radial-gradient(circle at 50% 20%, rgba(123,92,255,.25), transparent 60%);
  pointer-events: none;
}
.balance-card .balance-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; background: rgba(123,92,255,.1); border: 1px solid var(--stroke); }
.balance-label { color: var(--text-dim); font-size: 0.95rem; }
.balance-value { font-size: 2.1rem; font-weight: 800; background: var(--grad); -webkit-background-clip: text; color: transparent; }

/* Cabinet tabs */
.cabinet-tabs {
  display: flex; flex-wrap: wrap; gap: 0.55rem;
  padding: 0.35rem;
  background: rgba(20,25,55,.45);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  margin: 0 auto 1rem;
  max-width: max-content;
}
.cabinet-tab {
  padding: 0.6rem 1rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  font-weight: 600;
  cursor: pointer;
}
.cabinet-tab.is-active {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 6px 18px rgba(123,92,255,.3);
}

.cabinet-panel { display: none; margin-top: 0.5rem; }
.cabinet-panel.is-active { display: block; }

/* Bot cards & contract cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.card-tile {
  padding: 1.2rem;
  border-radius: 14px;
  display: flex; flex-direction: column;
  gap: 0.5rem;
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.card-tile:hover { transform: translateY(-3px); border-color: var(--primary-2); }
.card-tile-icon {
  width: 56px; height: 56px; border-radius: 14px;
  background: rgba(43,225,255,.1);
  display: grid; place-items: center;
  border: 1px solid var(--stroke-2);
  margin-bottom: 0.3rem;
}
.card-tile h3 { font-size: 1.05rem; }
.card-tile .price { font-size: 1.55rem; font-weight: 800; background: var(--grad); -webkit-background-clip: text; color: transparent; }
.card-tile .meta  { font-size: 0.85rem; color: var(--text-dim); }

/* Owned bot chips */
.owned-chips { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0.8rem 0; }
.owned-chip {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: rgba(20,25,55,.55);
  font-weight: 600;
}
.owned-chip small { color: var(--text-dim); font-weight: 500; margin-left: 0.3rem; }

/* Trading runtime */
.trade-runtime { padding: 1.2rem; margin-top: 1rem; }
.trade-progress-wrap { height: 10px; background: rgba(255,255,255,.05); border-radius: 999px; overflow: hidden; }
.trade-progress { height: 100%; width: 0%; background: var(--grad); transition: width 0.25s ease; }
.trade-timer { font-variant-numeric: tabular-nums; color: var(--primary-2); font-weight: 700; margin-top: 0.6rem; }
.trade-grid { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 1rem; margin-top: 1rem; }
.trade-grid > div { padding: 1rem; border-radius: 12px; background: rgba(20,25,55,.4); border: 1px solid var(--stroke); }
.trade-section-title { text-transform: uppercase; letter-spacing: .1em; font-size: 0.72rem; color: var(--muted); margin-bottom: 0.4rem; }
@media (max-width: 900px) { .trade-grid { grid-template-columns: 1fr; } }

.verify-box { margin-top: 1rem; padding: 1rem; border-radius: 12px; background: rgba(255,200,87,.08); border: 1px solid rgba(255,200,87,.35); }
.verify-code-display { font-size: 1.4rem; letter-spacing: .2em; font-weight: 800; text-align: center; padding: 0.8rem; border-radius: 10px; background: rgba(255,255,255,.04); margin: 0.6rem 0; }

/* Calculator cards (Support tab) */
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 700px) { .calc-grid { grid-template-columns: 1fr; } }
.calc-card { padding: 1.1rem; }
.calc-result { margin-top: 0.7rem; font-weight: 700; color: var(--primary-2); }

/* =================================================== *
 *               TRADING DASHBOARD                       *
 * =================================================== */

.trading-dashboard { margin-top: 1rem; }
.td-howit-link { margin-top: -0.3rem; }
.td-howit-link a { color: #ff3d6a; text-decoration: underline; text-underline-offset: 3px; }

/* Start controls card */
.trade-start-card { padding: 1.1rem 1.2rem; margin-bottom: 1rem; }
.trade-start-inner { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.trade-start-inner > div:first-child { flex: 1; min-width: 260px; }

.trade-selected-wrap {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: rgba(20,25,55,.45);
}
.trade-selected-label { color: var(--text-dim); font-size: 0.85rem; }
.trade-selected-chip  { color: var(--text); font-weight: 700; font-size: 1rem; }
.trade-selected-chip strong { color: #ff3d6a; }

.btn.btn-lg { padding: 0.85rem 1.4rem; font-size: 1rem; }

/* Owned bot chip selected state */
#owned-bots-list .owned-chip.is-selected {
  border-color: #ff3d6a;
  background: linear-gradient(135deg, rgba(255,61,106,.2), rgba(255,61,106,.04));
  box-shadow: 0 6px 20px rgba(255,61,106,.25);
}

/* LOCKED principal pill */
.trade-locked-pill {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.55rem 1rem;
  margin-bottom: 0.9rem;
  border-radius: 999px;
  background: rgba(12,14,32,.7);
  border: 1px solid var(--stroke);
}
.trade-locked-label  { color: var(--text-dim); letter-spacing: .14em; font-size: 0.7rem; font-weight: 700; }
.trade-locked-amount { color: #ff3d6a; font-weight: 800; font-size: 1.15rem; font-variant-numeric: tabular-nums; }

/* Trading in progress — pink bar + timer */
.trade-progress-card { padding: 1.1rem 1.2rem; margin-bottom: 0.8rem; }
.trade-progress-card .trade-section-title { color: #e6eaff; font-size: 0.95rem; text-transform: none; letter-spacing: 0; }
.trade-progress-outer {
  height: 10px; border-radius: 999px;
  background: rgba(255,255,255,.04); overflow: hidden;
  margin-top: 0.6rem;
}
.trade-progress-inner {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #ff3d6a 0%, #ff7090 80%, #ffb0c3 100%);
  box-shadow: 0 0 16px rgba(255,61,106,.55);
  transition: width 0.25s ease;
  border-radius: 999px;
}
.trade-next-code {
  color: #ff3d6a; font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin: 0.7rem 0 0;
}

/* Full-width Stop Trading bar */
.stop-trading-bar {
  width: 100%;
  padding: 0.9rem 1rem;
  margin-bottom: 0.9rem;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(255,61,106,.18), rgba(255,91,127,.08));
  border: 1px solid rgba(255,61,106,.5);
  color: #ff6a8a; font-weight: 700; font-size: 1rem;
  cursor: pointer; text-align: center;
  transition: background .15s, border-color .15s;
}
.stop-trading-bar:hover { background: linear-gradient(90deg, rgba(255,61,106,.3), rgba(255,91,127,.15)); border-color: #ff3d6a; }

/* 3-column trading layout */
.trade-panel-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.4fr 0.9fr;
  gap: 0.9rem;
}
@media (max-width: 1080px) { .trade-panel-grid { grid-template-columns: 1fr; } }

.trade-panel {
  padding: 1rem 1.1rem;
  position: relative;
  overflow: hidden;
}

/* Market stream rows */
.ts-row {
  padding: 0.7rem 0.9rem;
  margin: 0.5rem 0;
  background: rgba(8,10,25,.55);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  display: flex; flex-direction: column; gap: 0.15rem;
}
.ts-lbl { color: var(--text-dim); font-size: 0.78rem; }
.ts-val { font-size: 1.05rem; color: var(--text); font-variant-numeric: tabular-nums; }
.ts-profit { color: #2ee5a5; }

/* AI engine panel */
.trade-ai-panel {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.8rem; min-height: 380px;
  background:
    radial-gradient(700px 320px at 50% 60%, rgba(255,61,106,.08), transparent 70%),
    var(--surface);
}
.ai-head {
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.45rem 0.95rem;
  background: rgba(255,61,106,.08);
  border: 1px solid rgba(255,61,106,.45);
  border-radius: 999px;
  color: #ffdbe4; font-size: 0.95rem;
}
.ai-head .ai-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: #ff3d6a;
  box-shadow: 0 0 0 0 rgba(255,61,106,.6);
  animation: mcio-ai-dot 1.6s ease-in-out infinite;
}
@keyframes mcio-ai-dot {
  0%,100% { box-shadow: 0 0 0 0 rgba(255,61,106,.55); }
  50%     { box-shadow: 0 0 0 10px rgba(255,61,106,0); }
}

/* Radar */
.ai-radar-wrap {
  position: relative;
  width: 220px; height: 220px;
  display: grid; place-items: center;
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,61,106,.08), transparent 70%),
    linear-gradient(180deg, rgba(255,61,106,.04), rgba(0,0,0,.25));
  border: 1px solid rgba(255,61,106,.25);
  overflow: hidden;
}
.ai-radar-grid {
  position: absolute; inset: 0;
  background:
    linear-gradient(rgba(255,61,106,.08) 1px, transparent 1px) 0 0 / 100% 22px,
    linear-gradient(90deg, rgba(255,61,106,.08) 1px, transparent 1px) 0 0 / 22px 100%;
  opacity: .35;
  mask-image: radial-gradient(circle at 50% 50%, #000 60%, transparent 85%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 60%, transparent 85%);
}
.ai-radar-rings { position: absolute; inset: 0; display: grid; place-items: center; }
.ai-radar-rings span {
  position: absolute;
  border: 2px solid rgba(255,61,106,.55);
  border-radius: 50%;
  opacity: 0;
  animation: ai-ring 3.6s ease-out infinite;
  width: 30px; height: 30px;
}
.ai-radar-rings span:nth-child(2) { animation-delay: 0.9s; }
.ai-radar-rings span:nth-child(3) { animation-delay: 1.8s; }
.ai-radar-rings span:nth-child(4) { animation-delay: 2.7s; }
@keyframes ai-ring {
  0%   { width: 30px;  height: 30px;  opacity: 1;   border-color: rgba(255,61,106,.8); }
  100% { width: 220px; height: 220px; opacity: 0;   border-color: rgba(255,61,106,0); }
}
.ai-radar-core {
  position: relative; z-index: 2;
  width: 68px; height: 68px; border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #ffc2cf 0%, #ff3d6a 45%, #9a0e2a 100%);
  box-shadow: 0 0 30px rgba(255,61,106,.65), inset 0 0 16px rgba(255,255,255,.25);
}
.ai-status {
  color: #ff3d6a; font-weight: 700; font-size: 0.95rem; margin: 0;
}
.ai-bottom-grid {
  width: 100%; height: 42px;
  background:
    linear-gradient(rgba(255,61,106,.18) 1px, transparent 1px) 0 0 / 100% 8px,
    linear-gradient(90deg, rgba(255,61,106,.18) 1px, transparent 1px) 0 0 / 14px 100%;
  border-radius: 8px;
  border: 1px solid rgba(255,61,106,.3);
  opacity: 0.7;
}

/* Cycle progress bar */
.cycle-progress-outer {
  height: 6px; border-radius: 999px;
  background: rgba(255,255,255,.04); overflow: hidden;
  margin: 0.55rem 0;
}
.cycle-progress-inner {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #ff3d6a, #ff9dae);
  box-shadow: 0 0 10px rgba(255,61,106,.55);
  transition: width .3s ease;
  border-radius: 999px;
}

/* Last trades rows */
.last-trades { display: flex; flex-direction: column; gap: 0.4rem; }
.last-trade-row {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 0.7rem; align-items: center;
  padding: 0.55rem 0.8rem;
  background: rgba(20,25,55,.45);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  font-size: 0.85rem;
}
.lt-pair     { color: #ff3d6a; font-weight: 700; }
.lt-exchange { color: var(--text); }
.lt-profit   { color: #2ee5a5; font-weight: 700; text-align: right; }
.is-up { color: #2ee5a5; }
.is-dn { color: #ff6a8a; }

/* Verification box */
.verify-box { padding: 1rem; margin-top: 0.8rem; }
.verify-box input { margin: 0.55rem 0; }
.verify-actions { display: flex; gap: 0.45rem; margin-top: 0.45rem; }

/* =================================================== *
 *                MARKET OVERVIEW                        *
 * =================================================== */
.market-overview { margin-top: 1.8rem; }
.market-overview-title { margin-bottom: 0.9rem; }
.market-exchanges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.85rem;
}
.mkt-ex {
  padding: 0.85rem;
  border-radius: 16px;
  display: flex; flex-direction: column; gap: 0.5rem;
  background: rgba(12,14,32,.75);
  border: 1px solid var(--stroke);
}
.mkt-ex-head {
  font-size: 1rem; font-weight: 800; letter-spacing: .01em;
  color: #e6eaff; padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(255,61,106,.18);
}
.mkt-pair {
  padding: 0.55rem 0.7rem;
  background: rgba(8,10,25,.55);
  border: 1px solid rgba(255,255,255,.04);
  border-radius: 10px;
  display: flex; flex-direction: column; gap: 0.15rem;
}
.mkt-sym { font-weight: 700; font-size: 0.88rem; color: #ecebff; }
.mkt-price { font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; color: #ff3d6a; }
.mkt-price.is-dn { color: #ff8aa3; }
.mkt-price.is-up { color: #ff3d6a; }
.mkt-meta {
  display: flex; justify-content: space-between; gap: 0.5rem;
  font-size: 0.75rem; color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

/* Active contract rows */
.active-contract-row {
  padding: 0.85rem 1rem;
  margin-bottom: 0.7rem;
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 0.8rem;
}
.active-contract-row .ac-amt   { font-weight: 800; color: #ff3d6a; font-size: 1.05rem; letter-spacing: .01em; }
.active-contract-row .ac-rate  { color: var(--text-dim); font-weight: 600; font-size: .92rem; }
.active-contract-row .ac-daily { color: #2ee5a5; font-weight: 700; font-size: .95rem; }
.active-contract-row .ac-left  { color: var(--muted); font-size: .85rem; }
.active-contract-row .ac-spacer{ flex: 1; }
.active-contract-row .ac-exit  {
  background: transparent; border: 1px solid rgba(255,91,127,.55);
  color: #ffbecb; padding: .5rem .95rem; border-radius: 999px;
  font-weight: 600; font-size: .82rem; cursor: pointer;
  transition: background .18s, border-color .18s;
}
.active-contract-row .ac-exit:hover { background: rgba(255,91,127,.12); border-color: #ff8aa3; }
.active-contract-row .ac-bar-outer {
  flex: 0 0 100%;
  height: 8px;
  background: rgba(255,255,255,.05);
  border-radius: 999px; overflow: hidden; margin-top: .35rem;
}
.active-contract-row .ac-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, #ff3d6a 0%, #ff6a95 55%, #ffaec2 100%);
  box-shadow: 0 0 14px rgba(255,61,106,.45);
  border-radius: 999px;
}

/* Team panel */
.team-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.8rem; margin-top: 1rem; }
.team-stat { padding: 1rem; text-align: center; border-radius: 12px; border: 1px solid var(--stroke); background: rgba(20,25,55,.5); }
.team-stat .num { font-size: 1.4rem; font-weight: 800; background: var(--grad); -webkit-background-clip: text; color: transparent; }
.team-stat .label { font-size: 0.8rem; color: var(--text-dim); }
