:root {
  --bg: #000;
  --card: #000;
  --elev: #16181c;
  --line: #2f3336;
  --text: #e7e9ea;
  --muted: #71767b;
  --blue: #1d9bf0;
  --green: #00ba7c;
  --red: #f4212e;
  --gold: #ffd400;
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.35;
  -webkit-text-size-adjust: 100%;
}
#app {
  max-width: 600px;
  margin: 0 auto;
  min-height: 100dvh;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}
.top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 12px 16px 10px;
}
.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.live-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted);
}
.dot.on { background: var(--green); box-shadow: 0 0 0 3px rgba(0,186,124,.25); }
.dot.off { background: var(--muted); }
.as-of { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}
.metric {
  background: var(--elev);
  border-radius: 12px;
  padding: 10px 12px;
}
.metric .val { font-size: 20px; font-weight: 800; letter-spacing: -0.03em; }
.metric .lbl { font-size: 12px; color: var(--muted); margin-top: 2px; }
.metric .det { font-size: 12px; color: var(--muted); }
.tone-success { color: var(--green); }
.tone-danger { color: var(--red); }
.summary { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--bg);
}
.tab {
  flex: 1;
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  padding: 14px 8px;
  cursor: pointer;
  position: relative;
}
.tab.on { color: var(--text); }
.tab.on::after {
  content: "";
  position: absolute;
  left: 20%;
  right: 20%;
  bottom: 0;
  height: 4px;
  border-radius: 4px 4px 0 0;
  background: var(--blue);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px 0;
}
.chip {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.chip.on { background: var(--text); color: #000; border-color: var(--text); }
.panel { padding-bottom: 48px; }
.hidden { display: none; }
.opens { padding: 8px 16px 0; display: grid; gap: 8px; }
.open {
  background: var(--elev);
  border-radius: 12px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  text-decoration: none;
  color: inherit;
}
.open .name { font-weight: 700; }
.open .meta { color: var(--muted); font-size: 13px; }
.open .pnl { font-weight: 700; text-align: right; }
.feed { margin-top: 4px; }
.card {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.card.fresh {
  animation: slideIn .35s ease;
  background: rgba(29,155,240,.06);
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-14px); }
  to { opacity: 1; transform: none; }
}
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; color: #fff;
}
.av-open, .av-add { background: #1d9bf0; }
.av-partial { background: var(--green); }
.av-close { background: #536471; }
.av-close.tone-success { background: var(--green); }
.av-close.tone-danger { background: var(--red); }
.body { min-width: 0; }
.title { font-size: 15px; font-weight: 650; }
.meta-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px;
  margin-top: 4px; color: var(--muted); font-size: 13px;
}
.badge {
  display: inline-flex; align-items: center;
  border-radius: 999px; padding: 1px 8px;
  font-size: 11px; font-weight: 800; letter-spacing: .02em;
  text-transform: uppercase;
}
.badge-moi { background: var(--blue); color: #fff; }
.badge-paper { background: var(--elev); color: var(--muted); border: 1px solid var(--line); }
.links { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 8px; }
.links a {
  color: var(--blue);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
.links a:hover { text-decoration: underline; }
.pnl { margin-top: 6px; font-weight: 800; }
.grads { padding: 8px 16px 24px; display: grid; gap: 10px; }
.grad {
  background: var(--elev);
  border-radius: 14px;
  padding: 12px;
  text-decoration: none;
  color: inherit;
  display: block;
}
.grad-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.grad-name { font-weight: 700; }
.grad-pct { font-weight: 800; color: var(--gold); }
.bar {
  margin: 8px 0 6px;
  height: 6px; background: #2f3336; border-radius: 99px; overflow: hidden;
}
.bar > i {
  display: block; height: 100%; background: var(--gold); border-radius: 99px;
  width: 0; transition: width .4s ease;
}
.grad-meta { color: var(--muted); font-size: 13px; display: flex; justify-content: space-between; gap: 8px; }
.empty { color: var(--muted); padding: 24px 16px; text-align: center; }
@media (max-width: 640px) {
  #app { border: 0; }
  h1 { font-size: 18px; }
  .metric .val { font-size: 18px; }
}
