:root {
  --bg: #0f1720; --panel: #17212c; --line: #263342; --text: #e6edf3; --muted: #8b9bab;
  --accent: #3ddc97; --accent-text: #06281a; --bad: #ff6b6b; --buy: #3ddc97; --sell: #ff8f6b;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}
header {
  display: flex; justify-content: space-between; align-items: center;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px; border-bottom: 1px solid var(--line);
}
.brand { color: var(--text); text-decoration: none; font-weight: 700; font-size: 18px; }
.brand span { color: var(--accent); font-weight: 600; }
.net { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.banner { margin: 0; padding: 6px 16px; font-size: 13px; color: var(--muted); background: var(--panel); }
main { max-width: 720px; margin: 0 auto; padding: 16px; }
h1 { font-size: 26px; margin: 8px 0; }
h2 { font-size: 18px; margin: 24px 0 8px; }
.lead { color: var(--muted); margin-top: 0; }
.muted { color: var(--muted); font-size: 14px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; word-break: break-all; }
.big { font-size: 28px; font-weight: 700; margin: 8px 0; }
.list { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  color: var(--text); text-decoration: none;
}
a.row:hover { border-color: var(--accent); }
.sym { font-weight: 700; font-size: 17px; }
.right { text-align: right; }
.badge {
  display: inline-block; margin-top: 4px; padding: 2px 8px; border-radius: 999px;
  background: var(--accent); color: var(--accent-text); font-size: 12px; font-weight: 700;
}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-weight: 600; margin-top: 2px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin: 16px 0; }
.card h2 { margin-top: 0; }
.form, .actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.form input { flex: 1 1 160px; }
input {
  width: 100%; min-height: 44px; padding: 10px 12px; margin: 4px 0; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); font-size: 16px;
}
input[type=file] { min-height: 0; padding: 8px 0; border: 0; background: none; }
button {
  min-height: 44px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font-size: 16px; font-weight: 600; cursor: pointer;
}
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.msg { min-height: 1.4em; margin: 8px 0 0; }
.msg.bad { color: var(--bad); }
.buy { color: var(--buy); font-weight: 700; }
.sell { color: var(--sell); font-weight: 700; }
a { color: var(--accent); }
nav {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around;
  background: var(--panel); border-top: 1px solid var(--line); padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
}
nav a { color: var(--muted); text-decoration: none; font-weight: 600; padding: 8px 16px; border-radius: 10px; }
nav a.here { color: var(--accent); }
[hidden] { display: none !important; }
.grow { flex: 1; min-width: 0; }
.wide { width: 100%; }
.notice { background: var(--panel); border: 1px solid var(--accent); border-radius: 12px; padding: 10px 12px; margin: 0 0 8px; }
.tabs { display: flex; gap: 6px; margin: 8px 0; }
.tab { flex: 1; min-height: 40px; padding: 6px 10px; font-size: 15px; }
.tab.here { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.sell-tab.here, button.sell-btn { background: var(--sell); color: #2a0d05; border-color: var(--sell); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.chip { min-height: 36px; padding: 6px 12px; font-size: 14px; border-radius: 999px; }
.ticker { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.ticker::-webkit-scrollbar { display: none; }
.tick {
  flex: none; white-space: nowrap; padding: 6px 10px; border-radius: 999px; font-size: 13px;
  background: var(--panel); border: 1px solid var(--line); color: var(--text); text-decoration: none;
}
.tick .buy, .tick .sell { font-weight: 700; }
.tick.fresh { border-color: var(--accent); animation: shake .35s 2; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
@media (prefers-reduced-motion: reduce) { .tick.fresh { animation: none; } }
.sym-sm { font-weight: 700; }
progress {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 8px; margin: 6px 0 2px;
  border: 0; border-radius: 999px; background: var(--line); overflow: hidden;
}
progress::-webkit-progress-bar { background: var(--line); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.chart svg { display: block; width: 100%; height: 160px; }
.chart polyline { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.chart polyline.up { stroke: var(--buy); }
.chart polyline.down { stroke: var(--sell); }
