html, body { min-height: 100%; }
body { padding: calc(56px + env(safe-area-inset-top)) 0 calc(72px + env(safe-area-inset-bottom)); }
.small { font-size: 13px; }
.wide { width: 100%; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

.bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10; height: calc(56px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 16px 0; display: flex; align-items: center; gap: 10px;
  background: rgba(7, 11, 20, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.bar .title { font-weight: 700; font-size: 17px; flex: 1; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.dot.on { background: var(--green); box-shadow: 0 0 0 4px rgba(47, 191, 113, .18); }
.dot.off { background: var(--red); }

.screen { max-width: 640px; margin: 0 auto; padding: 16px; }
.screen h2 { font-size: 20px; margin: 8px 0 12px; }
.screen .card { padding: 16px; margin-bottom: 12px; }

.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(12, 18, 32, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 10px; color: var(--muted); font-size: 11px; }
.tabs a span { font-size: 19px; line-height: 1.2; }
.tabs a:hover { text-decoration: none; }
.tabs a.on { color: var(--gold); }

.auth-logo { text-align: center; margin: 12px 0 18px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 14px; }
.seg button { background: none; border: 0; color: var(--muted); padding: 9px; border-radius: 9px; font: 600 14px var(--font); cursor: pointer; }
.seg button.on { background: var(--card-2); color: var(--gold); }

.big { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.kpis .card { margin: 0; }
.kpis .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.kpis .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.status-card { display: flex; align-items: center; gap: 14px; }
.status-card .ring { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; background: var(--card-2); }
.status-card .ring.on { background: #0d2219; color: var(--green); }
.status-card .ring.off { background: #250f10; color: var(--red); }

.list { display: grid; gap: 10px; }
.item { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.item .head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.item .sym { font-weight: 700; }
.item .meta { font-size: 13px; color: var(--muted); margin-top: 4px; }
.item .levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; font-size: 13px; font-variant-numeric: tabular-nums; }
.item .levels div { background: var(--bg-2); border-radius: 8px; padding: 6px 8px; }
.item .levels b { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }
.buy { color: var(--green); }
.sell { color: var(--red); }

.chart { display: flex; align-items: flex-end; gap: 5px; height: 130px; }
.chart .c { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; height: 100%; min-width: 0; }
.chart .c i { display: block; width: 100%; border-radius: 4px 4px 0 0; background: var(--green); }
.chart .c i.n { background: var(--red); border-radius: 0 0 4px 4px; }
.chart .c small { font-size: 10px; color: var(--muted); }

.set-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--card-2); border: 1px solid var(--line); border-radius: 999px; transition: .2s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; border-radius: 50%; background: var(--muted); transition: .2s; }
.switch input:checked + span { background: #3a300c; border-color: var(--gold); }
.switch input:checked + span::before { transform: translateX(18px); background: var(--gold); }
.prose-sm p { font-size: 15px; }
.empty { text-align: center; color: var(--muted); padding: 32px 12px; }
#install { max-width: 640px; margin: 12px auto 0; padding: 0 16px; }
#install .card { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-color: rgba(232, 185, 35, .45);
  background: radial-gradient(400px 120px at 100% 0%, rgba(232, 185, 35, .14), transparent 70%), var(--card); }
#install img { border-radius: 12px; flex: none; }
#install .t { flex: 1; font-size: 14px; }
#install .x { background: none; border: 0; color: var(--muted); font-size: 20px; cursor: pointer; padding: 4px; }
