:root{
  --bg:#0b1220;
  --panel:#0f1a2c;
  --card:#111f35;
  --text:#e6eefc;
  --muted:#9bb0d1;
  --stroke:rgba(255,255,255,.08);
  --green:#1fd18a;
  --red:#ff4d5a;
  --accent:#5aa2ff;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: linear-gradient(180deg, #081022, #070b14);
  color:var(--text);
}

a{color:var(--accent); text-decoration:none}
a:hover{text-decoration:underline}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 12px;
  border-bottom:1px solid var(--stroke);
  background:rgba(11,18,32,.9);
  backdrop-filter: blur(8px);
  position:sticky;
  top:0;
  z-index:10;
}

.brand{display:flex;align-items:center;gap:10px;min-width:220px}
.logo{
  width:38px;height:38px;
  border-radius:10px;
  display:grid;
  place-items:center;
  background: linear-gradient(135deg, rgba(90,162,255,.25), rgba(31,209,138,.22));
  border:1px solid var(--stroke);
  font-weight:800;
  letter-spacing:-1px;
}
.title{font-weight:800}
.subtitle{font-size:12px;color:var(--muted);margin-top:2px}
.status{font-weight:700}
.status-on{color:var(--green)}
.status-off{color:var(--red)}

.controls{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.control{
  background:rgba(255,255,255,.05);
  border:1px solid var(--stroke);
  color:var(--text);
  padding:10px 12px;
  border-radius:12px;
  outline:none;
}
.control:focus{border-color:rgba(90,162,255,.55)}
.control.ghost{background:transparent}

.tf{display:flex;gap:6px}
.tf-btn{
  background:rgba(255,255,255,.05);
  border:1px solid var(--stroke);
  color:var(--text);
  padding:10px 10px;
  border-radius:12px;
  cursor:pointer;
}
.tf-btn.is-active{border-color:rgba(90,162,255,.7); box-shadow:0 0 0 3px rgba(90,162,255,.12) inset}
.tf-btn:hover{border-color:rgba(255,255,255,.18)}

.layout{
  display:grid;
  grid-template-columns: 1fr 360px;
  gap:12px;
  padding:12px;
}

.chartWrap{
  background:rgba(15,26,44,.55);
  border:1px solid var(--stroke);
  border-radius:16px;
  overflow:hidden;
  min-height:520px;
}

.chartHeader{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:10px;
  padding:12px 12px 10px 12px;
  border-bottom:1px solid var(--stroke);
}

.pair{
  font-size:14px;
  color:var(--muted);
  letter-spacing:.2px;
}

.priceBox{text-align:right}
.priceMain{font-size:24px;font-weight:900;letter-spacing:-.4px}
.priceSub{font-size:12px;color:var(--muted)}
.sep{opacity:.6;margin:0 6px}

.chart{width:100%;height:460px;}

.panel{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.card{
  background:rgba(17,31,53,.75);
  border:1px solid var(--stroke);
  border-radius:16px;
  padding:12px;
}

.cardTitle{
  font-weight:900;
  margin-bottom:10px;
}

.row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin:10px 0;
}
.row label{color:var(--muted);font-size:13px}
.row input,.row select{
  width:160px;
  background:rgba(255,255,255,.05);
  border:1px solid var(--stroke);
  border-radius:12px;
  color:var(--text);
  padding:10px 10px;
  outline:none;
}
.row input:focus,.row select:focus{border-color:rgba(90,162,255,.55)}

.pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:76px;
  padding:8px 10px;
  border-radius:999px;
  background:rgba(90,162,255,.12);
  border:1px solid rgba(90,162,255,.25);
  font-weight:800;
}

.two{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:10px}
.btn{
  border:none;
  border-radius:14px;
  padding:14px 10px;
  font-weight:950;
  letter-spacing:.6px;
  cursor:pointer;
  color:#06121f;
}
.btn.up{background:linear-gradient(135deg, rgba(31,209,138,1), rgba(31,209,138,.75))}
.btn.down{background:linear-gradient(135deg, rgba(255,77,90,1), rgba(255,77,90,.75))}
.btn:active{transform:translateY(1px)}

.balance{
  margin-top:12px;
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  padding-top:10px;
  border-top:1px dashed rgba(255,255,255,.12);
}
.balanceLabel{color:var(--muted);font-size:13px}
.balanceVal{font-size:18px;font-weight:950}

.hint{
  margin-top:10px;
  color:rgba(155,176,209,.95);
  font-size:12px;
  line-height:1.35;
  background:rgba(0,0,0,.15);
  border:1px solid rgba(255,255,255,.06);
  border-radius:12px;
  padding:10px;
}

.list{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.list.empty{color:var(--muted);font-size:13px}
.item{
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.04);
  border-radius:12px;
  padding:10px;
}
.itemTop{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:12px;
  font-weight:900;
  padding:4px 8px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
}
.badge.up{background:rgba(31,209,138,.12); color:var(--green)}
.badge.down{background:rgba(255,77,90,.12); color:var(--red)}
.meta{color:var(--muted);font-size:12px;margin-top:6px;line-height:1.35}

.footer{
  padding:10px 12px 14px 12px;
  color:var(--muted);
  font-size:12px;
  border-top:1px solid var(--stroke);
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:center;
}

@media (max-width: 980px){
  .layout{grid-template-columns:1fr; }
  .brand{min-width:auto}
  .chart{height:420px}
}
