:root{
  --bg:#0b0d10;
  --panel:#10141a;
  --panel2:#0f1318;
  --stroke:#1f2732;
  --text:#d7dde6;
  --muted:#8b97aa;
  --green:#18c37e;
  --red:#ff4d5f;
  --blue:#00a3ff;
}

*{box-sizing:border-box}
html,body{height:100%}

body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Helvetica Neue", sans-serif;
}

.app{
  height:100vh;
  display:grid;
  grid-template-columns: 1fr 420px;
  gap:10px;
  padding:10px;
}

.left{
  display:grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap:10px;
  min-width:0;
  min-height:0;
}

.right{
  display:flex;
  flex-direction:column;
  gap:10px;
  min-width:0;
  min-height:0;
}

.card{
  background:linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.0));
  border:1px solid var(--stroke);
  border-radius:10px;
  overflow:hidden;
  min-width:0;
  min-height:0;
}

.chart{
  display:flex;
  flex-direction:column;
  height:100%;
  min-height:0;
}

.chart-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 12px;
  border-bottom:1px solid var(--stroke);
  background:rgba(16,20,26,.7);
  font-size:13px;
}

.chart-title{
  display:flex;
  gap:10px;
  align-items:center;
  min-width:0;
}

.badge{
  font-size:12px;
  padding:4px 8px;
  border-radius:999px;
  background:rgba(0,163,255,.12);
  border:1px solid rgba(0,163,255,.25);
  color:#bfe7ff;
  white-space:nowrap;
}

.tf{
  color:var(--muted);
  font-variant-numeric: tabular-nums;
  white-space:nowrap;
}

.chart-body{
  flex:1;
  min-height:0;
  position:relative;
  background:var(--panel2);
}

.chart-canvas{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
}

.chart-error{
  position:absolute;
  inset:auto 10px 10px 10px;
  padding:8px 10px;
  border-radius:10px;
  background:rgba(255,77,95,.10);
  border:1px solid rgba(255,77,95,.22);
  color:#ffd2d7;
  font-size:12px;
  display:none;
  user-select:text;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.panel{
  background:var(--panel);
  border:1px solid var(--stroke);
  border-radius:10px;
  overflow:hidden;
  min-height:0;
  display:flex;
  flex-direction:column;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 12px;
  border-bottom:1px solid var(--stroke);
  background:rgba(16,20,26,.7);
}

.leftinfo{
  display:flex;
  gap:10px;
  align-items:center;
  min-width:0;
}

.symbol{font-weight:700; letter-spacing:.2px; white-space:nowrap}
.price{font-variant-numeric: tabular-nums; font-weight:700}
.delta.up{color:var(--green)}
.delta.down{color:var(--red)}

.status{
  font-size:12px;
  color:var(--muted);
  display:flex;
  align-items:center;
  gap:8px;
  white-space:nowrap;
}

.dot{
  width:8px;height:8px;border-radius:50%;
  background:var(--red);
  box-shadow:0 0 0 3px rgba(255,77,95,.12);
}
.dot.ok{
  background:var(--green);
  box-shadow:0 0 0 3px rgba(24,195,126,.12);
}

.panel-head{
  padding:10px 12px;
  border-bottom:1px solid var(--stroke);
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
  background:rgba(16,20,26,.7);
}

.panel-head h3{
  margin:0;
  font-size:13px;
  font-weight:700;
  color:#e7edf6;
}

.search{
  flex:1;
  max-width:220px;
  display:flex;
  align-items:center;
  gap:8px;
  padding:7px 10px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.03);
}

.search input{
  width:100%;
  background:transparent;
  border:0;
  outline:none;
  color:var(--text);
  font-size:12px;
}

.scroll{
  overflow:auto;
  min-height:0;
  flex:1;
}

.table{
  width:100%;
  border-collapse:collapse;
  font-size:12px;
  font-variant-numeric: tabular-nums;
}

.table th, .table td{
  padding:8px 10px;
  border-bottom:1px solid rgba(255,255,255,.06);
  white-space:nowrap;
}

.table th{
  text-align:left;
  color:var(--muted);
  font-weight:600;
  position:sticky;
  top:0;
  background:rgba(16,20,26,.9);
  z-index:1;
}

.table tbody tr{cursor:pointer}
.table tbody tr:hover{background:rgba(255,255,255,.03)}

.table .sym{font-weight:700; color:#e7edf6}
.table .chg.up{color:var(--green)}
.table .chg.down{color:var(--red)}
.muted{color:var(--muted)}

.foot{
  padding:10px 12px;
  color:var(--muted);
  font-size:12px;
  border-top:1px solid rgba(255,255,255,.06);
  display:flex;
  justify-content:space-between;
  gap:10px;
}

.btn{
  border:1px solid rgba(0,163,255,.25);
  background:rgba(0,163,255,.12);
  color:#bfe7ff;
  border-radius:10px;
  padding:6px 10px;
  font-size:12px;
  cursor:pointer;
  user-select:none;
}
.btn:active{transform:translateY(1px)}
