/* ============ ROBINTRADE — dashboard ============ */
.app-page { background: var(--bg); }

/* top strip */
.ap-strip {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 28px;
  background: rgba(5, 5, 5, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}
.ap-strip__brand { display: flex; align-items: center; gap: 9px; color: var(--white); }
.ap-strip__brand svg { width: 20px; height: 20px; display: block; }
.ap-strip__right { display: flex; align-items: center; gap: 18px; }
.ap-chain { color: var(--neon); }

.ap-wrap { max-width: 1280px; margin: 0 auto; padding: 36px 28px 90px; }
@media (max-width: 720px) { .ap-wrap { padding: 24px 16px 60px; } }

/* page head */
.ap-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.ap-head__h1 {
  font-family: var(--disp);
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.02;
}
.ap-head__h1 em { font-style: normal; color: var(--neon); }
.ap-head__sub { color: var(--dim); font-size: 14px; margin-top: 8px; max-width: 440px; }

/* the honest phase label — mock data cannot render without it */
.ap-phase {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(240, 200, 90, 0.1);
  color: #e8c45a;
  border: 1px solid rgba(240, 200, 90, 0.32);
  flex-shrink: 0;
}

/* ============ layout ============ */
.ap-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 22px;
  align-items: start;
}
@media (max-width: 1040px) { .ap-grid { grid-template-columns: 1fr; } }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
}
.card + .card { margin-top: 22px; }
.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.card__title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ============ control panel ============ */
.ap-side { position: sticky; top: 78px; }
@media (max-width: 1040px) { .ap-side { position: static; } }

.ctrl__state {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 22px;
}
.ctrl__state.on { color: var(--neon); }
.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
  flex-shrink: 0;
}
.dot--r { color: var(--red); }
.dot--g { color: var(--neon); }
.dot--x { color: var(--faint); }
.pulse { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.25; } }

/* the big switch */
.ctrl__power {
  width: 100%;
  border: 1px solid var(--neon);
  background: var(--neon);
  color: var(--ink);
  border-radius: 10px;
  padding: 17px;
  font-family: var(--disp);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 0 24px rgba(204, 255, 0, 0.28);
  transition: filter 0.2s, box-shadow 0.2s;
}
.ctrl__power:hover { filter: brightness(1.08); box-shadow: 0 0 34px rgba(204, 255, 0, 0.45); }
.ctrl__power.stop {
  background: transparent;
  color: var(--red);
  border-color: rgba(255, 59, 48, 0.55);
  box-shadow: none;
}
.ctrl__power.stop:hover { background: rgba(255, 59, 48, 0.1); }
.ctrl__hint {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--faint);
  text-align: center;
  margin-top: 12px;
  line-height: 1.6;
}

/* fields */
.field { margin-bottom: 22px; }
.field__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.field__label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}
.field__val {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--neon);
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: rgba(204, 255, 0, 0.18);
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--neon);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(204, 255, 0, 0.6);
}
input[type="range"]::-moz-range-thumb {
  width: 15px; height: 15px;
  border: none;
  border-radius: 50%;
  background: var(--neon);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(204, 255, 0, 0.6);
}
input[type="range"]:disabled { opacity: 0.4; }
input[type="range"]:disabled::-webkit-slider-thumb { cursor: not-allowed; }

/* segmented control */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg__btn {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  padding: 9px 4px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--dim);
  transition: all 0.18s;
}
.seg__btn:hover { border-color: rgba(204, 255, 0, 0.35); color: var(--white); }
.seg__btn.active {
  background: var(--neon);
  border-color: var(--neon);
  color: var(--ink);
  font-weight: 700;
}

/* ============ stat row ============ */
.ap-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 22px;
}
@media (max-width: 760px) { .ap-stats { grid-template-columns: repeat(2, 1fr); } }
.ap-stat { background: var(--panel); padding: 20px; }
.ap-stat .label { display: block; margin-bottom: 12px; }
.ap-stat__val {
  font-family: var(--disp);
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 500;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}
.ap-stat__val.pos { color: var(--neon); }
.ap-stat__val.neg { color: var(--red); }
.ap-stat__val.idle { color: var(--faint); }

/* ============ equity chart ============ */
.equity { position: relative; }
.equity__svg { width: 100%; height: 180px; display: block; overflow: visible; }
.equity__line { fill: none; stroke: var(--neon); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.equity__area { fill: url(#eqGrad); stroke: none; }
.equity__empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  text-align: center;
  padding: 0 20px;
}

/* ============ positions ============ */
.pos__cols,
.pos__row {
  display: grid;
  grid-template-columns: 84px 1fr 90px 100px 100px 82px;
  gap: 12px;
  align-items: center;
}
@media (max-width: 860px) {
  .pos__cols { display: none; }
  .pos__row { grid-template-columns: 74px 1fr 82px; row-gap: 6px; }
  .pos__row > :nth-child(n + 4) { grid-column: span 1; }
}
.pos__cols {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.pos__row {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.pos__row:last-child { border-bottom: none; }
.pos__pair { color: var(--white); font-weight: 600; font-family: var(--sans); font-size: 14px; }
.pos__pnl { text-align: right; font-weight: 600; }
.pos__pnl.up { color: var(--neon); }
.pos__pnl.down { color: var(--red); }
.pos__empty {
  padding: 44px 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ============ decision tape ============ */
.tape { max-height: 340px; overflow-y: auto; }
.tape__row {
  display: flex;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.6;
  animation: tapein 0.4s ease;
}
@keyframes tapein { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.tape__time { color: var(--faint); flex-shrink: 0; }
.tape__body { color: var(--dim); }
.tape__body b { color: var(--neon); font-weight: 600; }
.tape__body .who { color: var(--faint); }
.tape__empty {
  padding: 36px 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ============ footer ============ */
.ap-foot {
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.ap-foot a:hover { color: var(--neon); }

/* ============================================================
   ONBOARDING — connect → fund → trade
   The agent stays locked until the vault actually holds
   something, so the panel can't promise what it can't do.
   ============================================================ */

/* ---- step rail ---- */
.ap-steps {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.ap-step {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 15px 7px 7px;
  transition: 0.25s;
}
.ap-step__n {
  width: 19px; height: 19px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(212, 208, 201, 0.1);
  color: var(--faint);
  font-size: 9.5px;
}
.ap-step.is-on { color: var(--neon); border-color: rgba(204, 255, 0, 0.4); background: rgba(204, 255, 0, 0.05); }
.ap-step.is-on .ap-step__n { background: var(--neon); color: var(--ink); font-weight: 700; }
.ap-step.is-done { color: var(--dim); border-color: rgba(204, 255, 0, 0.2); }
.ap-step.is-done .ap-step__n { background: rgba(204, 255, 0, 0.2); color: var(--neon); }
.ap-step__sep { width: 16px; height: 1px; background: var(--line); }
@media (max-width: 620px) { .ap-step__sep { display: none; } }

/* ---- vault card ---- */
.card.is-locked { opacity: 0.5; pointer-events: none; }
.card.is-locked #lockTag { color: var(--faint); }
.vault__blurb { color: var(--dim); font-size: 13px; line-height: 1.6; margin-bottom: 20px; }

.wallet {
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 18px;
}
.wallet__ic { width: 24px; height: 24px; flex: none; }
.wallet__ic svg { width: 100%; height: 100%; display: block; border-radius: 5px; }
.wallet__id { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wallet__id b { font-family: var(--mono); font-size: 12.5px; color: var(--bone); font-weight: 400; }
.wallet__id span { font-size: 10.5px; color: var(--faint); }
.wallet__x {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--faint);
  font-size: 18px;
  line-height: 1;
  padding: 4px 6px;
  transition: color 0.2s;
}
.wallet__x:hover { color: var(--red); }

.vault__bal { margin-bottom: 20px; }
.vault__bal .label { display: block; margin-bottom: 8px; }
.vault__bal__v {
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  color: var(--bone);
}
.vault__bal__v.funded { color: var(--neon); }
.vault__bal__sub { font-family: var(--mono); font-size: 10.5px; color: var(--faint); }

.field__max {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--neon);
  background: none;
  border: 1px solid rgba(204, 255, 0, 0.3);
  border-radius: 999px;
  padding: 2px 8px;
  transition: 0.2s;
}
.field__max:hover { background: var(--neon-soft); }

.dep {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  transition: border-color 0.2s;
}
.dep:focus-within { border-color: rgba(204, 255, 0, 0.45); }
.dep__cur { font-family: var(--mono); color: var(--faint); font-size: 15px; }
.dep__in {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: var(--bone);
  font-family: var(--mono);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}
.dep__tok { font-family: var(--mono); font-size: 10.5px; color: var(--faint); letter-spacing: 0.1em; }
.dep.err { border-color: rgba(255, 59, 48, 0.6); }

.vault__acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.btn-mini {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 9px 6px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--dim);
  transition: 0.2s;
}
.btn-mini:hover { border-color: rgba(204, 255, 0, 0.4); color: var(--neon); }

.ctrl__power:disabled {
  background: transparent;
  color: var(--faint);
  border-color: var(--line);
  box-shadow: none;
  cursor: not-allowed;
}
.ctrl__power:disabled:hover { filter: none; box-shadow: none; }
.ctrl__power.busy { pointer-events: none; opacity: 0.75; }

/* ---- modals ---- */
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal__back { position: absolute; inset: 0; background: rgba(5, 4, 2, 0.78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal__box {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  animation: modalin 0.22s cubic-bezier(.16, 1, .3, 1);
}
@keyframes modalin { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.modal__head h2 { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; color: var(--bone); }
.modal__x { background: none; border: none; color: var(--faint); font-size: 22px; line-height: 1; padding: 2px 6px; transition: color 0.2s; }
.modal__x:hover { color: var(--bone); }
.modal__sub { color: var(--dim); font-size: 12.5px; line-height: 1.6; margin-bottom: 20px; }
.modal__foot {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  text-align: center;
  margin-top: 18px;
}

/* wallet options */
.wpick { display: grid; gap: 9px; }
.wopt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 13px;
  background: transparent;
  transition: 0.2s;
}
.wopt:hover { border-color: rgba(204, 255, 0, 0.45); background: rgba(204, 255, 0, 0.04); }
.wopt.off { opacity: 0.45; }
.wopt__ic { width: 30px; height: 30px; flex: none; }
.wopt__ic svg { width: 100%; height: 100%; display: block; border-radius: 6px; }
.wopt__t { display: flex; flex-direction: column; gap: 2px; }
.wopt__t b { font-size: 13.5px; font-weight: 500; color: var(--bone); }
.wopt__t span { font-family: var(--mono); font-size: 10px; color: var(--faint); }
.wopt__t span.ok { color: var(--neon); }
.wopt__go { margin-left: auto; color: var(--faint); }

/* deposit summary + steps */
.dsum { border: 1px solid var(--line); border-radius: 11px; padding: 14px; margin-bottom: 18px; }
.dsum__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 5px 0;
  color: var(--faint);
}
.dsum__row b { color: var(--bone); font-weight: 400; }
.dsum__row--tot { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; }
.dsum__row--tot b { color: var(--neon); }

.dsteps { list-style: none; display: grid; gap: 10px; margin-bottom: 16px; }
.dstep { display: flex; align-items: center; gap: 11px; opacity: 0.45; transition: opacity 0.25s; }
.dstep.on, .dstep.done { opacity: 1; }
.dstep__ic {
  width: 20px; height: 20px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--line);
  position: relative;
}
.dstep.on .dstep__ic {
  border-color: var(--neon);
  border-top-color: transparent;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.dstep.done .dstep__ic { border-color: var(--neon); background: var(--neon); }
.dstep.done .dstep__ic::after {
  content: "";
  position: absolute;
  left: 6px; top: 2.5px;
  width: 5px; height: 9px;
  border: solid var(--ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.dstep__t { display: flex; flex-direction: column; gap: 1px; }
.dstep__t b { font-size: 12.5px; font-weight: 500; color: var(--bone); }
.dstep__t span { font-size: 10.5px; color: var(--faint); }
.dtx {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--faint);
  text-align: center;
  margin-bottom: 12px;
  word-break: break-all;
}
.dtx b { color: var(--neon); font-weight: 400; }

/* [hidden] must beat the display rules above it — .vault__acts{display:grid}
   and friends otherwise render while hidden. */
[hidden] { display: none !important; }
