/* Sniper Terminal v5 — iOS design language.
   Palette: iOS dark system colours (true-black base, grouped #1C1C1E / #2C2C2E
   surfaces, systemGreen/Red/Blue). Type: the system stack, which is SF Pro on
   Apple devices (Apple's licence allows that, not shipping the font files);
   Inter elsewhere. Icons: Framework7 Icons (MIT, SF Symbols-style).
   Layout: iPadOS sidebar >= 1024px, iPhone tab bar below. Motion: iOS spring
   curve; things move because something changed, and taps press in. */

:root {
  --bg: #000000;
  --bg-elev: #0b0b0d;
  --card: #1c1c1e;
  --card-2: #2c2c2e;
  --card-3: #3a3a3c;
  --sep: rgba(84, 84, 88, .55);
  --sep-soft: rgba(84, 84, 88, .32);
  --fill: rgba(118, 118, 128, .24);
  --fill-2: rgba(118, 118, 128, .18);
  --t1: #ffffff;
  --t2: rgba(235, 235, 245, .62);
  --t3: rgba(235, 235, 245, .36);
  --t4: rgba(235, 235, 245, .2);
  --up: #30d158;
  --up-bg: rgba(48, 209, 88, .16);
  --down: #ff453a;
  --down-bg: rgba(255, 69, 58, .16);
  --blue: #0a84ff;
  --blue-bg: rgba(10, 132, 255, .18);
  --amber: #ff9f0a;
  --amber-bg: rgba(255, 159, 10, .16);
  --yellow: #ffd60a;
  --violet: #bf5af2;
  --violet-bg: rgba(191, 90, 242, .17);
  --teal: #64d2ff;
  --accent: var(--blue);
  --accent-bg: var(--blue-bg);
  --r-cell: 12px;
  --r-card: 16px;
  --r-widget: 22px;
  --spring: cubic-bezier(.32, .72, 0, 1);
  --ease: cubic-bezier(.25, .1, .25, 1);
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
  --sidebar: 252px;
  --tabbar: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scrollbar-width: thin; scrollbar-color: var(--card-3) transparent; }
body {
  margin: 0; background: var(--bg); color: var(--t1);
  font: 15px/1.4 var(--sans); letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  min-height: 100vh; overscroll-behavior-y: none;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--blue-bg); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.f7-icons { font-size: 22px; line-height: 1; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--sans); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.up { color: var(--up); } .down { color: var(--down); } .mut { color: var(--t2); } .dim { color: var(--t3); }

/* ── iPadOS sidebar ──────────────────────────────────────────────────── */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 40;
  display: flex; flex-direction: column; gap: 6px;
  padding: calc(18px + var(--safe-t)) 12px 16px;
  background: rgba(22, 22, 24, .82);
  backdrop-filter: saturate(180%) blur(30px); -webkit-backdrop-filter: saturate(180%) blur(30px);
  border-right: .5px solid var(--sep);
}
.sb-brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 16px; }
.sb-brand img { width: 38px; height: 38px; border-radius: 10px; box-shadow: 0 4px 14px -4px rgba(10,132,255,.55); }
.sb-brand b { display: block; font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.sb-brand small { display: block; font-size: 12px; color: var(--t2); margin-top: 1px; }
.sb-nav { display: grid; gap: 2px; }
.sb-nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px;
  font-size: 15px; font-weight: 500; color: var(--t1);
  transition: background .2s var(--ease), transform .2s var(--spring);
}
.sb-nav a .f7-icons { font-size: 21px; color: var(--blue); width: 24px; text-align: center; }
.sb-nav a:hover { background: var(--fill-2); }
.sb-nav a:active { transform: scale(.98); }
.sb-nav a.on { background: var(--blue); }
.sb-nav a.on .f7-icons { color: #fff; }
.sb-foot { margin-top: auto; display: grid; gap: 10px; padding: 0 6px; }
.sb-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--t3); }
.shell { margin-left: var(--sidebar); min-width: 0; }

/* ── navigation bar (large title collapses into it) ──────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 35; height: calc(50px + var(--safe-t));
  padding: var(--safe-t) 18px 0; display: flex; align-items: center; gap: 10px;
  background: transparent; border-bottom: .5px solid transparent;
  transition: background .25s var(--ease), border-color .25s var(--ease);
}
.navbar.scrolled {
  background: rgba(16, 16, 18, .78);
  backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-bottom-color: var(--sep);
}
.nb-icon { width: 26px; height: 26px; border-radius: 7px; display: none; }
.nb-title {
  position: absolute; left: 50%; transform: translate(-50%, 6px); opacity: 0;
  font-size: 17px; font-weight: 600; letter-spacing: -.02em; white-space: nowrap;
  transition: opacity .25s var(--ease), transform .35s var(--spring);
}
.navbar.scrolled .nb-title { opacity: 1; transform: translate(-50%, 0); }
.nb-live { margin-left: auto; display: none; }

/* ── tab bar (iPhone) ────────────────────────────────────────────────── */
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 45; display: none;
  height: calc(var(--tabbar) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(18, 18, 20, .82);
  backdrop-filter: saturate(180%) blur(26px); -webkit-backdrop-filter: saturate(180%) blur(26px);
  border-top: .5px solid var(--sep);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--t3); font-size: 10.5px; font-weight: 500; letter-spacing: 0;
  transition: color .2s var(--ease), transform .25s var(--spring);
}
.tabbar a .f7-icons { font-size: 25px; }
.tabbar a:active { transform: scale(.9); }
.tabbar a.on { color: var(--blue); }

/* chips */
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 11px;
  border-radius: 999px; background: var(--fill-2); font-size: 12.5px; font-weight: 600;
  color: var(--t1); white-space: nowrap; width: max-content;
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--up); position: relative; flex: none; }
.live-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; background: var(--up); opacity: .35; animation: ping 2s var(--ease) infinite; }
.chip.stale .live-dot, .chip.stale .live-dot::after { background: var(--amber); }
.chip.dead .live-dot { background: var(--down); }
.chip.dead .live-dot::after { animation: none; opacity: 0; }
@keyframes ping { 0% { transform: scale(.6); opacity: .5; } 80%, 100% { transform: scale(2.1); opacity: 0; } }
.badge-paper { color: var(--amber); font-weight: 700; letter-spacing: .08em; font-size: 11px; background: var(--amber-bg); padding: 3px 8px; border-radius: 6px; }

/* ── ticker (live activity strip) ────────────────────────────────────── */
.ticker {
  height: 34px; overflow: hidden; margin: 0 18px; border-radius: 10px; background: var(--card);
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.ticker-track { display: flex; width: max-content; height: 100%; align-items: center; animation: marquee 70s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.tk { display: inline-flex; align-items: center; gap: 7px; padding: 0 16px; font-size: 12.5px; color: var(--t2); white-space: nowrap; }
.tk + .tk { border-left: .5px solid var(--sep-soft); }
.tk .t { max-width: 240px; overflow: hidden; text-overflow: ellipsis; color: var(--t1); }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ── layout ──────────────────────────────────────────────────────────── */
main { max-width: 1400px; margin: 0 auto; padding: 4px 18px 64px; }
.view { animation: viewIn .45s var(--spring) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.grid { display: grid; gap: 14px; }
.g-main { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
.g-kpi { grid-template-columns: 1.6fr repeat(5, 1fr); }
.g-arms { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.stack { display: grid; gap: 14px; }

.page-hd { display: flex; align-items: flex-end; gap: 14px; margin: 14px 2px 18px; flex-wrap: wrap; }
.page-hd h1 { margin: 0; font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: -.025em; }
.page-hd p { margin: 4px 0 0; color: var(--t2); font-size: 15px; max-width: 760px; }

/* cards = iOS grouped cells */
.card { background: var(--card); border-radius: var(--r-card); position: relative; overflow: hidden; }
.card-hd { display: flex; align-items: center; gap: 10px; padding: 14px 16px 2px; min-height: 44px; flex-wrap: wrap; row-gap: 8px; }
.card-hd h3 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.02em; color: var(--t1); text-transform: none; }
.card-hd .aux { margin-left: auto; display: flex; gap: 8px; align-items: center; font-size: 13px; }
.card-bd { padding: 12px 16px 16px; }

/* widgets (KPI tiles) */
.kpi {
  border-radius: var(--r-widget); padding: 15px 16px; min-height: 104px;
  display: flex; flex-direction: column; justify-content: space-between;
  transition: transform .3s var(--spring);
}
.kpi .lbl { font-size: 13px; font-weight: 600; color: var(--t2); display: flex; gap: 6px; align-items: center; letter-spacing: -.005em; }
.kpi .lbl .f7-icons { font-size: 15px; }
.kpi .val { font-size: 26px; font-weight: 700; letter-spacing: -.03em; margin-top: 6px; }
.kpi .sub { font-size: 12.5px; color: var(--t3); margin-top: 2px; }
.kpi .val.pair { font-size: 17px; white-space: nowrap; margin-top: 12px; }
.kpi.hero { background: linear-gradient(145deg, rgba(48,209,88,.24), rgba(48,209,88,.02) 60%), var(--card); }
.kpi.hero.neg { background: linear-gradient(145deg, rgba(255,69,58,.24), rgba(255,69,58,.02) 60%), var(--card); }
.kpi.hero .val { font-size: 40px; letter-spacing: -.035em; }

/* segmented control with sliding thumb */
.seg { position: relative; display: inline-flex; padding: 2px; border-radius: 9px; background: var(--fill); isolation: isolate; }
.seg button {
  position: relative; z-index: 1; padding: 5px 12px; border-radius: 7px; white-space: nowrap;
  font-size: 13px; font-weight: 600; color: var(--t1); transition: opacity .2s var(--ease);
}
.seg button:active { opacity: .6; }
.seg .thumb {
  position: absolute; z-index: 0; top: 2px; bottom: 2px; left: 0; border-radius: 7px;
  background: #636366; box-shadow: 0 3px 8px rgba(0,0,0,.25), 0 0 0 .5px rgba(0,0,0,.08);
  transition: transform .4s var(--spring), width .4s var(--spring);
}
.seg:not(.has-thumb) button.on { background: #636366; }

/* chart */
.chart { height: 300px; margin: 6px 6px 0; }
.chart.sm { height: 150px; }
.chart-legend { display: flex; gap: 14px; padding: 2px 16px 0; font-size: 13px; color: var(--t2); flex-wrap: wrap; }
.chart-legend b { color: var(--t1); font-weight: 600; }

/* pills */
.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px;
  border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: 0; text-transform: none;
  background: var(--fill); color: var(--t1); white-space: nowrap;
}
.pill.up { background: var(--up-bg); color: var(--up); }
.pill.down { background: var(--down-bg); color: var(--down); }
.pill.amber { background: var(--amber-bg); color: var(--amber); }
.pill.violet { background: var(--violet-bg); color: var(--violet); }
.pill.accent { background: var(--blue-bg); color: var(--blue); }
.pill .d { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.open .d { animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }

/* avatars + strategy tiles = app-icon squircles */
.av {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.av.lg { width: 56px; height: 56px; border-radius: 14px; font-size: 19px; }
.strat { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-size: 11px; font-weight: 800; flex: none; }

/* ── pulse feed = inset list ─────────────────────────────────────────── */
.feed { max-height: 780px; overflow-y: auto; padding: 4px 0 8px; }
.fi {
  display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 10px 16px; position: relative; transition: background .2s var(--ease);
}
.fi:hover { background: rgba(255,255,255,.03); }
.fi + .fi::after { content: ""; position: absolute; top: 0; left: 60px; right: 0; height: .5px; background: var(--sep); }
.fi .ttl { font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.015em; }
.fi .meta { font-size: 13px; color: var(--t2); display: flex; gap: 6px; align-items: center; margin-top: 2px; white-space: nowrap; overflow: hidden; }
.fi .rt { text-align: right; font-size: 15px; font-weight: 600; }
.fi .rt .s { font-size: 12.5px; color: var(--t3); margin-top: 2px; font-weight: 400; }
.fi.new { animation: feedIn .7s var(--spring) both; }
.fi.new::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, var(--blue-bg), transparent 75%); animation: glowOut 2.4s var(--ease) forwards; }
@keyframes feedIn { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
@keyframes glowOut { from { opacity: 1; } to { opacity: 0; } }

/* ── tables ──────────────────────────────────────────────────────────── */
.tw { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
thead th {
  position: sticky; top: 0; z-index: 1; text-align: left; padding: 8px 14px;
  font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--t3);
  background: var(--card); border-bottom: .5px solid var(--sep); white-space: nowrap;
}
thead th.r, td.r { text-align: right; }
thead th.sortable { cursor: pointer; user-select: none; }
thead th.sortable:hover { color: var(--t2); }
thead th.sorted { color: var(--blue); }
td { padding: 0 14px; height: 52px; border-bottom: .5px solid var(--sep-soft); white-space: nowrap; vertical-align: middle; }
tbody tr { transition: background .15s var(--ease); }
tbody tr:hover td { background: rgba(255,255,255,.03); }
tbody tr.click { cursor: pointer; }
tbody tr.click:active td { background: rgba(255,255,255,.07); }
tbody tr:last-child td { border-bottom: 0; }
td .cell { display: flex; align-items: center; gap: 11px; min-width: 0; }
td .cell .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
td .cell .sb { font-size: 12px; color: var(--t3); }
.mkt { max-width: 340px; overflow: hidden; text-overflow: ellipsis; display: block; font-weight: 500; }

.flash-up { animation: flUp 1.1s var(--ease); }
.flash-down { animation: flDown 1.1s var(--ease); }
@keyframes flUp { 0%, 30% { background: var(--up-bg); } 100% { background: transparent; } }
@keyframes flDown { 0%, 30% { background: var(--down-bg); } 100% { background: transparent; } }
.flash-up, .flash-down { border-radius: 6px; }

.wl { display: flex; height: 6px; width: 84px; border-radius: 3px; overflow: hidden; background: var(--fill); }
.wl i { display: block; height: 100%; transition: width .6s var(--spring); }
.wl i.w { background: var(--up); } .wl i.l { background: var(--down); opacity: .8; }
.zbar { width: 54px; height: 6px; border-radius: 3px; background: var(--fill); position: relative; overflow: hidden; display: inline-block; vertical-align: middle; margin-left: 8px; }
.zbar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: linear-gradient(90deg, var(--blue), var(--violet)); transition: width .6s var(--spring); }
.px { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.px .arrow { color: var(--t3); }

svg.spark { display: block; overflow: visible; }
svg.spark path.ln { fill: none; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
svg.spark path.ln.draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw 1.2s var(--spring) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* strategy cards (widget style) */
.arm {
  padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; cursor: pointer;
  border-radius: var(--r-widget); transition: transform .35s var(--spring), background .2s var(--ease);
}
.arm:hover { background: #222224; }
.arm:active { transform: scale(.975); }
.arm .row { display: flex; align-items: center; gap: 11px; }
.arm .row > div:nth-child(2) { flex: 1; min-width: 0; }
.arm .nm { font-weight: 700; font-size: 17px; letter-spacing: -.02em; }
.arm .lb { font-size: 13px; color: var(--t2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arm .pnl { margin-left: auto; font-size: 20px; font-weight: 700; letter-spacing: -.03em; white-space: nowrap; flex: none; }
.arm .stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.arm .st { font-size: 12px; color: var(--t2); }
.arm .st b { display: block; color: var(--t1); font-size: 15px; font-weight: 600; margin-top: 2px; }
.arm.retired { opacity: .55; }
.arm.retired:hover { opacity: .9; }

/* toolbar / search field */
.toolbar { display: flex; gap: 10px; align-items: center; padding: 14px 16px; flex-wrap: wrap; }
.search {
  display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 10px; min-width: 240px;
  background: var(--fill-2); border-radius: 10px; color: var(--t3);
}
.search .f7-icons { font-size: 17px; }
.search input { background: none; border: 0; outline: 0; color: var(--t1); font: inherit; font-size: 15px; width: 100%; }
.search input::placeholder { color: var(--t3); }

/* ── sheet (wallet detail) ───────────────────────────────────────────── */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity .35s var(--ease); }
.scrim.on { opacity: 1; pointer-events: auto; }
/* desktop: iPad form sheet, centred, scales in */
.drawer {
  position: fixed; z-index: 61; left: 50%; top: 50%; width: min(680px, calc(100vw - 32px)); max-height: min(86vh, 900px);
  transform: translate(-50%, -46%) scale(.96); opacity: 0; pointer-events: none;
  background: var(--bg-elev); border-radius: 22px; box-shadow: 0 40px 80px -20px rgba(0,0,0,.8), 0 0 0 .5px var(--sep);
  display: flex; flex-direction: column; overflow: hidden;
  transition: transform .5s var(--spring), opacity .3s var(--ease);
}
.drawer.on { transform: translate(-50%, -50%) scale(1); opacity: 1; pointer-events: auto; }
.drawer-hd { position: relative; display: flex; gap: 14px; align-items: center; padding: 22px 20px 16px; }
.drawer-hd::before { content: ""; display: none; position: absolute; top: 7px; left: 50%; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: var(--card-3); }
.drawer-hd .x {
  margin-left: auto; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--fill); color: var(--t2); font-size: 13px; font-weight: 700; flex: none;
}
.drawer-hd .x:active { transform: scale(.92); }
.drawer-bd {
  overflow-y: auto; padding: 0 20px 34px; display: grid; gap: 14px;
  grid-auto-rows: max-content; align-content: start; flex: 1; min-height: 0;
}
.drawer .card { background: var(--card); }
.mgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; background: var(--card); border-radius: var(--r-card); overflow: hidden; }
.mgrid > div { padding: 12px 14px; border-right: .5px solid var(--sep-soft); border-bottom: .5px solid var(--sep-soft); }
.mgrid > div:nth-child(4n) { border-right: 0; }
.mgrid .k { font-size: 12px; font-weight: 500; color: var(--t2); }
.mgrid .v { font-size: 17px; font-weight: 600; margin-top: 3px; letter-spacing: -.02em; }
.why { font-size: 14px; color: var(--t2); background: var(--card); border-radius: var(--r-card); padding: 12px 14px; line-height: 1.5; }
.copybtn { font-size: 12.5px; font-weight: 600; color: var(--blue); padding: 4px 10px; border-radius: 999px; background: var(--blue-bg); display: inline-flex; gap: 4px; align-items: center; }
.copybtn:active { opacity: .6; }

.sec { display: flex; align-items: baseline; gap: 10px; margin: 30px 2px 12px; }
.sec h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.025em; }
.sec .aux { font-size: 13px; color: var(--t2); }

.empty { padding: 36px 16px; text-align: center; color: var(--t2); font-size: 14px; }
.sk { position: relative; overflow: hidden; background: var(--card-2); border-radius: 7px; }
.sk::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

.foot { text-align: center; color: var(--t3); font-size: 12px; margin-top: 30px; }
.foot a { color: var(--blue); }

/* toasts = iOS banner notifications */
.toasts { position: fixed; z-index: 80; top: calc(12px + var(--safe-t)); right: 16px; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); }
.toast {
  background: rgba(44, 44, 46, .86); backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-radius: 18px; padding: 12px 14px; font-size: 14px; display: flex; gap: 12px; align-items: center;
  box-shadow: 0 18px 40px -16px rgba(0,0,0,.8); animation: toastIn .55s var(--spring) both;
}
.toast.out { animation: toastOut .4s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-16px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px) scale(.97); } }

/* ── responsive ──────────────────────────────────────────────────────── */
@media (max-width: 1320px) { .hide-md { display: none; } }
@media (max-width: 1180px) {
  .g-main { grid-template-columns: 1fr; }
  .g-kpi { grid-template-columns: repeat(3, 1fr); }
  .kpi.hero { grid-column: span 3; }
  .feed { max-height: 480px; }
}
/* iPhone / small iPad: tab bar replaces sidebar; title shows in nav bar */
@media (max-width: 1023px) {
  .sidebar { display: none; }
  .shell { margin-left: 0; }
  .tabbar { display: flex; }
  .nb-icon, .nb-live { display: inline-flex; }
  main { padding: 0 16px calc(var(--tabbar) + var(--safe-b) + 28px); }
  .ticker { margin: 0 16px; }
  .toasts { top: auto; bottom: calc(var(--tabbar) + var(--safe-b) + 12px); right: 16px; }
}
@media (max-width: 700px) {
  body { font-size: 15px; }
  .page-hd { margin: 8px 2px 14px; }
  .g-kpi { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .kpi.hero { grid-column: span 2; }
  .kpi { min-height: 96px; padding: 14px; }
  .kpi.hero .val { font-size: 36px; }
  .chart { height: 240px; }
  .card-hd .aux { margin-left: 0; width: 100%; justify-content: space-between; }
  .mgrid { grid-template-columns: repeat(2, 1fr); }
  .mgrid > div:nth-child(4n) { border-right: .5px solid var(--sep-soft); }
  .mgrid > div:nth-child(2n) { border-right: 0; }
  .arm .stats { grid-template-columns: repeat(4, 1fr); }
  .ticker { display: none; }
  /* sheet slides up from the bottom with a grabber */
  .drawer {
    left: 0; right: 0; top: auto; bottom: 0; width: 100%; max-height: 92vh;
    border-radius: 14px 14px 0 0; transform: translateY(100%); opacity: 1;
  }
  .drawer.on { transform: translateY(0); }
  .drawer-hd { padding-top: 26px; }
  .drawer-hd::before { display: block; }
  .drawer-bd { padding-bottom: calc(34px + var(--safe-b)); }
  /* tables become list cells */
  table.listy, table.listy tbody { display: block; }
  table.listy thead { display: none; }
  table.listy tr { display: grid; align-items: center; column-gap: 10px; padding: 10px 16px; position: relative; }
  table.listy tr + tr::after { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: .5px; background: var(--sep); }
  table.listy td { display: block; height: auto; padding: 0; border: 0; background: none !important; }
  table.listy td.c-hide { display: none; }
  /* roster cell: [wallet ........ our P&L] / [status · W–L · WR] */
  table.roster tr { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "w o" "s s"; row-gap: 6px; }
  table.roster td.c-wallet { grid-area: w; }
  table.roster td.c-ourpnl { grid-area: o; font-size: 15px; font-weight: 600; }
  table.roster td.c-status { grid-area: s; display: flex; gap: 8px; align-items: center; }
  table.roster td.c-status::after { content: attr(data-extra); color: var(--t2); font-size: 13px; }
  /* positions cell: [market .... uP&L] / [arm · entry→now · cost] */
  table.positions tr { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "m u" "p p"; row-gap: 4px; }
  table.positions td.c-mkt { grid-area: m; min-width: 0; }
  table.positions td.c-upnl { grid-area: u; font-weight: 600; }
  table.positions td.c-px { grid-area: p; }
  table.positions td.c-px .px { justify-content: flex-start; font-size: 13px; color: var(--t2); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .ticker-track { animation: none; }
}
