:root{
    --bg:#101216;
    --card:#171a20;
    --muted:#aab2c0;
    --text:#e7ecf2;
    --green:#22c55e;
    --red:#ef4444;
    --accent:#8b5cf6;
    --divider:#222531;
}

html,body{height:100%}
body{
    margin:0;
    background:var(--bg);
    color:var(--text);
    /* -15% размера шрифта */
    font-size: 85%;
    font-family: ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,"Noto Sans","Helvetica Neue",Arial,"Apple Color Emoji","Segoe UI Emoji";
}

.wrap{ max-width:720px; margin:0 auto; padding:16px 14px 28px; }

.hdr{display:flex;align-items:center;justify-content:flex-start;font-weight:700;font-size:18px;letter-spacing:.2px}
.muted{color:var(--muted);font-weight:500}
.bal{font-weight:800}

.tabs{display:flex;gap:8px;margin-top:12px}
.tab{
    background:transparent;color:var(--text);
    border:1px solid var(--divider);padding:8px 12px;border-radius:10px;
    font-weight:800
}
.tab.active{background:var(--card)}
.tab-pane{display:none}
.tab-pane.active{display:block}

.grid{margin-top:12px;display:flex;flex-direction:column;gap:10px}

.card{background:var(--card);border:1px solid var(--divider);border-radius:12px}

.row{
    background:var(--card);border-radius:12px;padding:12px 12px;
    display:flex;flex-direction:column;gap:8px;
    border:1px solid var(--divider);
}
.row .left{display:flex;flex-direction:column;gap:6px}
.name-line{display:flex;align-items:center;gap:8px}
.sym{font-weight:800;letter-spacing:.3px}
.side{
    font-size:12px;border:1px solid var(--divider);
    padding:2px 6px;border-radius:999px;color:var(--muted)
}
.icons-line{display:flex;gap:6px}
.icon{
    min-width:24px;height:20px;line-height:18px;
    padding:0 6px;border-radius:999px;
    border:1px solid rgba(255,122,0,.35);
    color:#8ce3ae;background:rgba(255,122,0,.08);
    font-weight:900;font-size:12px;display:inline-flex;align-items:center;justify-content:center;
}
.icon.off{opacity:.25;filter:grayscale(1)}

.pnl{font-weight:800;display:flex;align-items:center;justify-content:flex-end}
.pnl.positive{color:var(--green)}
.pnl.negative{color:var(--red)}

.details{border-top:1px dashed var(--divider);padding-top:8px;margin-top:2px}
.details.hidden{display:none}
.detail-row{display:flex;align-items:center;justify-content:space-between;padding:3px 0}
.detail-row b{font-weight:800}
.detail-row b.positive{color:var(--green)}
.detail-row b.negative{color:var(--red)}

.err{text-align:center;margin-top:12px;color:var(--muted)}

.row-history{gap:4px}
.hist-first{display:flex;align-items:center;justify-content:space-between}
.hist-left{display:flex;align-items:center;gap:8px}
.status{
    font-size:12px;border:1px solid var(--divider);padding:1px 6px;border-radius:999px;color:var(--muted)
}
.hist-right{font-weight:800}
.hist-right.positive{color:var(--green)}
.hist-right.negative{color:var(--red)}
.hist-second,.hist-third{font-size:.95em}

/* Статистика */
.stats-box{display:flex;flex-direction:column;gap:12px;margin-top:12px}
.stats-title{font-weight:800;letter-spacing:.2px}
.stats-total{font-size:1.4em;font-weight:900}
.stats-total.positive{color:var(--green)}
.stats-total.negative{color:var(--red)}
.stats-range{font-size:.95em}
.row-day{gap:2px}

/* График */
.chart{padding:10px}
#stats-chart{width:100%;height:140px;display:block}
.chart-zero{stroke:#2a3142;stroke-width:1}
.chart-line{fill:none;stroke:#7c5cff;stroke-width:2}
