*{box-sizing:border-box}
:root{--bg:#070d16;--panel:#0d1522;--panel2:#111827;--line:#263247;--text:#d9e7ff;--muted:#8ba4c6;--blue:#2563eb;--green:#05a66b;--red:#e23d44}
html,body{margin:0;background:var(--bg);color:var(--text);font-family:Inter,Arial,sans-serif;font-size:13px}
body{min-height:100dvh;overflow:hidden}
.app{height:100dvh;display:grid;grid-template-columns:300px minmax(0,1fr);min-height:0;overflow:hidden}
.sidebar{background:var(--panel2);border-right:1px solid var(--line);padding:10px;overflow:auto;min-height:0;-webkit-overflow-scrolling:touch}
h1{font-size:22px;margin:0 0 12px;font-weight:800}h1 span{font-size:13px;color:#7ea4ff}h2,h3{margin:0 0 8px;font-size:13px;color:#9fc2ff}.box,.panel{background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:12px;margin-bottom:10px}label{display:block;color:var(--muted);font-size:12px;margin:8px 0 4px}input,select,button{width:100%;height:36px;border-radius:7px;border:1px solid #2e3d56;background:#111d30;color:#eaf2ff;padding:0 10px;font-weight:600}button{cursor:pointer;background:#1f56e0;border:0}button:hover{filter:brightness(1.12)}.two{display:grid;grid-template-columns:1fr 1fr;gap:8px}.buy{background:var(--green)}.sell{background:var(--red)}
.main{height:100dvh;min-width:0;min-height:0;overflow:hidden;display:flex;flex-direction:column;background:#070d16}
.topbar{height:34px;min-height:34px;display:flex;align-items:center;justify-content:space-between;background:var(--panel);border-bottom:1px solid var(--line);padding:0 10px;gap:10px;overflow:hidden}.tools{display:flex;gap:8px;flex:0 0 auto}.tools button{width:auto;height:26px;padding:0 10px;background:#17233a;white-space:nowrap}.tools button.active{background:#2464ff}#status{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
#chart{flex:1 1 auto;min-height:280px;width:100%;overflow:hidden;border-bottom:1px solid var(--line)}
#rsiWrap{flex:0 0 130px;height:130px;min-height:130px;border-top:1px solid var(--line);background:#070d16;position:relative;overflow:hidden}.panelTitle{position:absolute;z-index:2;padding:8px;color:#9fc2ff;font-weight:700;pointer-events:none}#rsiChart{height:130px;width:100%;min-height:0}.hidden{display:none!important}
.bottom{flex:0 0 clamp(220px,30dvh,340px);min-height:220px;display:grid;grid-template-columns:1.1fr 1fr 1fr 1fr;gap:10px;padding:10px;border-top:1px solid var(--line);background:#0a101a;overflow:hidden}.panel{margin:0;overflow:auto;min-height:0;-webkit-overflow-scrolling:touch}.indicatorRow{display:grid;grid-template-columns:1fr 80px 90px;gap:8px}.indItem,.tradeItem,.pendingItem,.histItem{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--line);padding:7px 0;color:#dce8ff;gap:8px}.miniBtn{width:auto;height:24px;padding:0 8px;background:#20304d}.priceUp{color:#0fd084}.priceDown{color:#ff515c}.err{color:#ff6b70;white-space:pre-wrap}.ok{color:#8cffc1}
@media (max-height:760px) and (min-width:901px){.bottom{flex-basis:210px;min-height:210px;padding:6px;gap:6px}.box,.panel{padding:8px}.sidebar{padding:6px}input,select,button{height:32px}#rsiWrap{flex-basis:105px;height:105px;min-height:105px}#rsiChart{height:105px}#chart{min-height:220px}}
@media (max-width:900px){body{overflow:auto}.app{height:auto;min-height:100dvh;display:block;overflow:visible}.sidebar{display:block;border-right:0;border-bottom:1px solid var(--line);max-height:none;overflow:visible}.main{height:auto;min-height:calc(100dvh - 360px);overflow:visible}.topbar{position:sticky;top:0;z-index:5;overflow-x:auto}.tools{overflow-x:auto}.tools button{height:30px}.box{margin-bottom:8px}.sidebar{padding:8px}.main #chart{height:62dvh;min-height:380px;flex:none}.bottom{height:auto;min-height:0;overflow:visible;display:grid;grid-template-columns:1fr;gap:8px;padding:8px;flex:none}.panel{min-height:120px;max-height:260px}.indicatorRow{grid-template-columns:1fr 74px 74px}.two{gap:6px}#rsiWrap{height:150px;min-height:150px;flex:none}#rsiChart{height:150px}}
@media (max-width:520px){html,body{font-size:12px}.main #chart{height:58dvh;min-height:320px}.topbar{height:auto;min-height:38px;padding:6px;align-items:flex-start;flex-direction:column}#status{white-space:normal;line-height:1.3}.tools{width:100%;display:grid;grid-template-columns:1fr 1fr;gap:6px}.tools button{width:100%}.indicatorRow{grid-template-columns:1fr 65px 70px}.panel{max-height:240px}input,select,button{height:34px;padding:0 8px}}
