:root {
  --bg: #f9f9f7;
  --hero: #e9e9e1;
  --black: #002b31;
  --black-2: #0a3a40;
  --line: #e6e7e5;
  --line-dark: rgba(255, 255, 255, 0.08);
  --earth: #7c704f;
  --green: #00c805;
  --green-hover: #00a804;
  --green-tint: #e8fbe9;
  --red: #ff8585;
  --muted: #8ea3a6;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Manrope", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; background: var(--bg); color: var(--black); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }

/* nav */
.nav { position: sticky; top: 0; z-index: 10; background: rgba(249, 249, 247, 0.9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.nav-inner { max-width: 1280px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; gap: 28px; }
.nav .logo { height: 26px; width: auto; color: var(--black); display: block; }
.nav a.link { text-decoration: none; font-size: 0.95rem; color: #33555a; }
.nav a.link:hover { color: var(--black); }
.nav .spacer { flex: 1; }
.nav .pill { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.04em; color: var(--earth); border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; display: inline-flex; gap: 8px; align-items: center; }
.nav .pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-tint); }
.btn { border: 0; border-radius: 999px; padding: 10px 18px; background: var(--green); color: var(--black); font-weight: 600; font-size: 0.95rem; }
.btn:hover { background: var(--green-hover); }
.btn.ghost { background: transparent; border: 1px solid rgba(0, 43, 49, 0.25); }
.btn.dark { background: var(--black); color: #fff; }
.btn:disabled { opacity: 0.5; cursor: default; }

/* header */
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.head { padding: 28px 0 18px; display: grid; grid-template-columns: 1.3fr auto 1fr; gap: 32px; align-items: end; }
.head h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); line-height: 1.05; letter-spacing: -0.02em; margin: 0 0 8px; font-weight: 500; }
.head h1 u { text-decoration: none; color: var(--green); border-bottom: 3px solid var(--green); }
.head p { margin: 0; font-size: 0.98rem; color: #33555a; max-width: 46rem; }
.facts { display: flex; gap: 28px; justify-content: flex-end; font-family: var(--mono); font-size: 0.8rem; color: var(--earth); }
.facts b { display: block; color: var(--black); font-family: var(--sans); font-size: 1.6rem; font-weight: 500; letter-spacing: -0.02em; }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 18px 0; border-top: 1px solid var(--line); }
.filters .lbl { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--earth); margin-right: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 0.85rem; }
.chip input, .chip select { border: 0; background: transparent; font: inherit; color: var(--black); width: 6.5em; outline: none; }
.chip select { width: auto; }
.chip.toggle { cursor: pointer; user-select: none; }
.chip.toggle.on { background: var(--green-tint); border-color: var(--green); }
.chip.search input { width: 12em; }
.filters .count { margin-left: auto; font-family: var(--mono); font-size: 0.75rem; color: var(--earth); }

/* table */
.card { background: var(--black); color: #e8ecec; border-radius: 12px; overflow: hidden; margin-bottom: 40px; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line-dark); font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.04em; color: var(--muted); }
.card-head .live { color: var(--green); }
table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
th, td { padding: 13px 14px; text-align: right; white-space: nowrap; }
th:first-child, td:first-child, th.l, td.l { text-align: left; }
thead th { font-family: var(--mono); font-weight: 400; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: #a9bcb9; border-bottom: 1px solid var(--line-dark); cursor: pointer; user-select: none; }
thead th.sorted { color: var(--green); }
thead th.sorted::after { content: " ↓"; }
thead th.sorted.asc::after { content: " ↑"; }
tbody tr { border-bottom: 1px solid var(--line-dark); }
tbody tr:hover { background: var(--black-2); }
td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.pair { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.pair .fee { font-family: var(--mono); font-weight: 400; font-size: 0.7rem; color: var(--muted); }
.tag { font-family: var(--mono); font-size: 0.65rem; padding: 2px 6px; border-radius: 4px; border: 1px solid var(--line-dark); color: var(--muted); }
.tag.in { color: var(--green); border-color: rgba(0, 200, 5, 0.4); }
.tag.out { color: var(--red); border-color: rgba(255, 133, 133, 0.4); }
.pos { color: var(--green); }
.neg { color: var(--red); }
.mono { font-family: var(--mono); }
.owner a { color: var(--muted); text-decoration: none; }
.owner a:hover { color: #fff; }
td .btn.copy { padding: 6px 12px; font-size: 0.78rem; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 12px 18px; font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }
.pager button { background: transparent; border: 1px solid var(--line-dark); color: #e8ecec; border-radius: 6px; padding: 4px 10px; }
.pager button:disabled { opacity: 0.35; }
.empty { padding: 40px; text-align: center; color: var(--muted); font-family: var(--mono); }

/* drawer */
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: min(560px, 100vw); background: #fff; border-left: 1px solid var(--line); box-shadow: -20px 0 60px rgba(0, 43, 49, 0.12); transform: translateX(100%); transition: transform 0.25s ease; z-index: 20; overflow-y: auto; }
.drawer.open { transform: none; }
.scrim { position: fixed; inset: 0; background: rgba(0, 43, 49, 0.25); opacity: 0; pointer-events: none; transition: opacity 0.25s; z-index: 15; }
.scrim.on { opacity: 1; pointer-events: auto; }
.drawer .inner { padding: 28px; }
.drawer h2 { margin: 0 0 4px; font-size: 1.6rem; font-weight: 500; letter-spacing: -0.02em; }
.drawer .sub { font-family: var(--mono); font-size: 0.75rem; color: var(--earth); margin-bottom: 20px; }
.drawer .close { position: absolute; top: 18px; right: 18px; border: 1px solid var(--line); background: #fff; border-radius: 50%; width: 34px; height: 34px; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; margin: 0 0 22px; }
.kv div { border-top: 1px solid var(--line); padding-top: 8px; }
.kv .k { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--earth); }
.kv .v { font-family: var(--mono); font-size: 0.95rem; margin-top: 2px; word-break: break-all; }
.range { position: relative; height: 34px; background: var(--hero); border-radius: 6px; margin: 4px 0 22px; overflow: hidden; }
.range .band { position: absolute; top: 0; bottom: 0; background: var(--green-tint); border-left: 2px solid var(--green); border-right: 2px solid var(--green); }
.range .now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--black); }
.range .lab { position: absolute; bottom: 4px; font-family: var(--mono); font-size: 0.62rem; color: var(--earth); }
.section-title { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--earth); margin: 26px 0 10px; }
.copy-box { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
.copy-box .row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.copy-box label { font-family: var(--mono); font-size: 0.72rem; color: var(--earth); width: 6.5em; }
.copy-box input { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font: inherit; font-family: var(--mono); background: #fff; }
.copy-box .hint { font-size: 0.82rem; color: #33555a; margin: 8px 0 14px; }
.steps { list-style: none; padding: 0; margin: 14px 0 0; font-family: var(--mono); font-size: 0.78rem; }
.steps li { padding: 6px 0; border-top: 1px solid var(--line); color: #33555a; }
.steps li.done { color: var(--green); }
.steps li.err { color: #c0392b; }
.links { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 0.85rem; margin-top: 22px; }
.foot { padding: 30px 0 50px; font-family: var(--mono); font-size: 0.72rem; color: var(--earth); display: flex; justify-content: space-between; border-top: 1px solid var(--line); }
@media (max-width: 900px) {
  .head { grid-template-columns: 1fr; }
  .facts { justify-content: flex-start; }
  .hide-m { display: none; }
}

/* tabs + views */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-top: 6px; }
.tabs button { background: none; border: 0; padding: 12px 14px; font-size: 0.92rem; color: #33555a; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--black); border-bottom-color: var(--green); font-weight: 600; }
.tabs .badge { font-family: var(--mono); font-size: 0.65rem; background: var(--green-tint); color: var(--black); border-radius: 999px; padding: 1px 6px; margin-left: 4px; }
.tabs .badge:empty { display: none; }
.view { padding: 22px 0 40px; }
.fine { font-family: var(--mono); font-size: 0.72rem; color: var(--earth); max-width: 60rem; }
.lp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.lp { background: var(--black); color: #e8ecec; border-radius: 12px; padding: 18px; cursor: pointer; display: flex; flex-direction: column; gap: 10px; border: 1px solid transparent; }
.lp:hover { border-color: rgba(0, 200, 5, 0.5); }
.lp .who { display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-size: 0.8rem; }
.lp .rank { color: var(--green); }
.lp .big { font-size: 1.7rem; font-weight: 500; letter-spacing: -0.02em; }
.lp .big small { font-size: 0.75rem; color: var(--muted); font-family: var(--mono); font-weight: 400; margin-left: 8px; }
.lp .row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }
.lp .row3 b { display: block; color: #e8ecec; font-weight: 500; font-size: 0.9rem; }
.lp .pairs { font-size: 0.78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp .follow { align-self: flex-start; }
.btn.small { padding: 5px 11px; font-size: 0.76rem; }
.btn.following { background: var(--green-tint); color: var(--black); }
.feed { list-style: none; padding: 0; margin: 0; }
.feed li { display: grid; grid-template-columns: 80px 90px 1fr auto; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 0.88rem; align-items: baseline; }
.feed .k { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; }
.feed .k.opened { color: var(--green); } .feed .k.closed { color: #c0392b; } .feed .k.moved { color: var(--earth); }
.feed .t { font-family: var(--mono); font-size: 0.72rem; color: var(--earth); }
.mode { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin-bottom: 12px; }
.mode button { background: #fff; border: 0; padding: 6px 12px; font-size: 0.8rem; color: #33555a; }
.mode button.on { background: var(--black); color: #fff; }
.plan { font-family: var(--mono); font-size: 0.75rem; color: #33555a; margin: 8px 0 0; padding-left: 16px; }
.lp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.card.light { background: #fff; color: var(--black); border: 1px solid var(--line); }
.card.light thead th { color: var(--earth); border-color: var(--line); }
.card.light tbody tr { border-color: var(--line); } .card.light tbody tr:hover { background: var(--bg); }
.card.light .card-head { color: var(--earth); border-color: var(--line); }
.card.light .owner a { color: #33555a; } .card.light .tag { color: var(--earth); border-color: var(--line); }
.card.light .tag.in { color: var(--green-hover); } .card.light .pager button { color: var(--black); border-color: var(--line); }

/* dither canvases */
.dk-host { position: relative; overflow: hidden; }
.dk-host canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.dk-crisp { image-rendering: pixelated; }
.dk-bloom { mix-blend-mode: plus-lighter; image-rendering: auto; pointer-events: none; }
.dk-tip { position: absolute; z-index: 2; pointer-events: none; display: none; background: var(--black); color: #e8ecec; border: 1px solid rgba(255,255,255,.12); border-radius: 6px; padding: 6px 9px; font-family: var(--mono); font-size: 0.7rem; line-height: 1.4; white-space: nowrap; }
.dk-tip b { color: var(--green); font-weight: 500; }

/* hero chart */
.hero-chart { margin-top: 8px; background: var(--black); border-radius: 12px; padding: 16px 18px 10px; color: #e8ecec; position: relative; overflow: hidden; }
.hero-chart .wash { position: absolute; inset: 40% 0 0 0; opacity: .5; }
.hero-chart .ttl { position: relative; display: flex; justify-content: space-between; align-items: baseline; font-family: var(--mono); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.hero-chart .ttl b { color: var(--green); font-weight: 500; }
.hero-chart .plot { position: relative; height: 110px; }
.hero-chart .axis { position: relative; display: flex; justify-content: space-between; font-family: var(--mono); font-size: .62rem; color: var(--muted); margin-top: 4px; }

/* lp cards */
.lp .who { align-items: center; }
.lp .ident { display: flex; align-items: center; gap: 10px; }
.lp .ava { border-radius: 6px; overflow: hidden; background: rgba(255,255,255,.04); flex: none; }
.lp .mini { height: 34px; margin: 2px 0 -2px; }
.lp-head .ava { border-radius: 8px; overflow: hidden; flex: none; }
.lp-head .ident { display: flex; align-items: center; gap: 14px; }

/* drawer charts */
.chart { background: var(--black); border-radius: 10px; padding: 12px 14px 8px; color: #e8ecec; margin: 6px 0 18px; }
.chart .ttl { display: flex; justify-content: space-between; font-family: var(--mono); font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.chart .plot { height: 120px; }
.chart .axis { display: flex; justify-content: space-between; font-family: var(--mono); font-size: .62rem; color: var(--muted); margin-top: 4px; }
.chart .legend { display: flex; gap: 14px; font-family: var(--mono); font-size: .65rem; color: var(--muted); margin-top: 6px; }
.chart .legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.stock-bars { background: var(--black); border-radius: 12px; padding: 16px 18px 10px; color: #e8ecec; margin-bottom: 18px; }
.stock-bars .plot { height: 120px; }
.stock-bars .labels { display: grid; font-family: var(--mono); font-size: .62rem; color: var(--muted); margin-top: 4px; text-align: center; }
.spark { height: 26px; width: 88px; display: inline-block; vertical-align: middle; }
td .spark { margin-left: 8px; }
.card .btn.copy { background: var(--green); }
.card .btn.small.follow { background: transparent; border: 1px solid rgba(255,255,255,.2); color: #e8ecec; }
.card .btn.small.follow.following { border-color: var(--green); color: var(--green); }

.lp-head { padding-right: 56px; }
.lp-head .btn { flex: none; }

/* deslop: chart titles are one summary line, small and grey */
.hero-chart .ttl, .stock-bars .ttl, .chart .ttl { justify-content: flex-end; }
.stock-bars .ttl { font-family: var(--mono); font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; display: flex; }
.head p { max-width: 34rem; }
.kv.three { grid-template-columns: repeat(3, 1fr); }

/* critic round 1 */
tr.src td { background: rgba(0, 200, 5, 0.12); } tr.src td:first-child { box-shadow: inset 3px 0 0 var(--green); }
tr[data-id], tr[data-pool] { cursor: pointer; } tr[data-id]:hover td, tr[data-pool]:hover td { background: rgba(255,255,255,.04); }
.card.light tr[data-id]:hover td, .card.light tr[data-pool]:hover td { background: rgba(0,0,0,.03); }
.hero-chart .plot-row { display: grid; grid-template-columns: 76px 1fr; gap: 10px; }
.hero-chart .y { position: relative; font-family: var(--mono); font-size: .62rem; color: var(--muted); text-align: right; }
.hero-chart .y span { position: absolute; right: 0; transform: translateY(-50%); white-space: nowrap; } .hero-chart .y span:first-child { top: 0; transform: none; } .hero-chart .y span:last-child { bottom: 0; transform: none; }
.hero-chart .axis { padding-left: 86px; }
.hero-chart .ttl { justify-content: space-between; }

/* payoff preview */
.payoff { margin: 12px 0 4px; background: var(--black); color: #e8ecec; border-radius: 10px; padding: 12px 14px 10px; }
.payoff .facts3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 10px; font-family: var(--mono); font-size: .68rem; color: var(--muted); }
.payoff .facts3 b { display: block; font-family: var(--sans); font-size: 1.15rem; font-weight: 500; color: #e8ecec; letter-spacing: -.01em; margin-bottom: 2px; }
.payoff .ttl { display: flex; justify-content: space-between; font-family: var(--mono); font-size: .64rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.payoff .plot { height: 90px; }
.payoff .labels { display: grid; font-family: var(--mono); font-size: .58rem; color: var(--muted); text-align: center; margin-top: 4px; }
.kv .k .neg, .kv .k .pos { text-transform: none; letter-spacing: 0; }
.head p a.learn-link { color: var(--green-hover); text-decoration: none; border-bottom: 1px solid var(--green); margin-left: 4px; }
.foot a { color: var(--earth); }

/* mobile */
@media (max-width: 900px) {
  .facts { display: none; }
  .tabs { overflow-x: auto; white-space: nowrap; scrollbar-width: none; -webkit-overflow-scrolling: touch; } .tabs::-webkit-scrollbar { display: none; } .tabs button { flex: none; }
  .hero-chart .ttl span:first-child { display: none; } .hero-chart .ttl { justify-content: flex-end; }
  .hero-chart .plot-row { grid-template-columns: 60px 1fr; } .hero-chart .axis { padding-left: 70px; }
  .card { overflow: hidden; } .card > div[style] { overflow-x: auto; }
  .head { padding-top: 18px; }
  .drawer { width: 100vw; max-width: 100vw; } .drawer .inner { padding: 18px 16px; }
  .kv.three { grid-template-columns: 1fr 1fr; }
  .payoff .facts3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 500px) { .payoff .labels span:nth-child(even) { visibility: hidden; } }

/* ============================================================ light surfaces (no dark panels) */
:root { --card: #ffffff; --ink: #002b31; --ink-2: #33555a; --red-ink: #d64040; }
.card, .card.light { background: var(--card); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 1px 0 rgba(0,43,49,.03); }
thead th, .card.light thead th { color: var(--earth); border-bottom: 1px solid var(--line); }
tbody tr, .card.light tbody tr { border-bottom: 1px solid var(--line); }
tbody tr:hover, .card.light tbody tr:hover, tr[data-id]:hover td, tr[data-pool]:hover td { background: #f3faf3; }
tr.src td { background: var(--green-tint); }
.tag { color: var(--earth); border-color: var(--line); background: #fff; }
.tag.in { color: var(--green-hover); border-color: rgba(0,168,4,.35); }
.tag.out { color: var(--red-ink); border-color: rgba(214,64,64,.35); }
.neg { color: var(--red-ink); } .pos { color: var(--green-hover); }
.owner a { color: var(--ink-2); } .owner a:hover { color: var(--ink); }
.pair .fee { color: var(--earth); }
.pager { color: var(--earth); } .pager button { color: var(--ink); border-color: var(--line); }
.empty { color: var(--earth); }
.dk-tip { background: var(--ink); color: #fff; border-color: transparent; }
.hero-chart, .stock-bars, .chart, .payoff, .lp { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.hero-chart .ttl, .stock-bars .ttl, .chart .ttl, .payoff .ttl, .chart .legend, .hero-chart .axis, .chart .axis, .stock-bars .labels, .payoff .labels, .hero-chart .y { color: var(--earth); }
.hero-chart .ttl b, .chart .ttl b, .payoff .ttl b { color: var(--green-hover); }
.hero-chart .wash { display: none; }
.chart .legend i[style*="rgb(120,232,170)"] { background: rgb(40,168,96) !important; }
.chart .legend i[style*="#e8ecec"] { background: var(--ink) !important; }
.payoff .facts3 { color: var(--earth); } .payoff .facts3 b { color: var(--ink); }
.lp { box-shadow: 0 1px 0 rgba(0,43,49,.03); } .lp:hover { border-color: var(--green); }
.lp .row3 { color: var(--earth); } .lp .row3 b { color: var(--ink); }
.lp .pairs, .lp .who span:last-child { color: var(--earth); }
.lp .rank { color: var(--green-hover); }
.lp .ava { background: var(--bg); }
.lp .who { color: var(--ink); }
.card .btn.small.follow { border: 1px solid var(--line); color: var(--ink); background: #fff; }
.card .btn.small.follow.following, .lp .btn.following { border-color: var(--green); color: var(--green-hover); background: var(--green-tint); }
.mode button.on { background: var(--ink); }

/* row visuals */
.rbar { position: relative; display: inline-block; width: 110px; height: 12px; border-radius: 3px; background: #eef1ef; vertical-align: middle; margin-left: 0; overflow: hidden; flex: none; }
.rbar .band { position: absolute; top: 0; bottom: 0; background: rgba(0,176,24,.28); border-left: 1px solid rgba(0,176,24,.6); border-right: 1px solid rgba(0,176,24,.6); }
.rbar.out .band { background: rgba(214,64,64,.22); border-color: rgba(214,64,64,.6); }
.rbar .now { position: absolute; top: -1px; bottom: -1px; left: 50%; width: 2px; background: var(--ink); }
.rbar .now.mark { background: var(--ink); }
td.pnlbar { position: relative; }
td.pnlbar .fillbar { position: absolute; right: 0; top: 6px; bottom: 6px; width: var(--w); background: linear-gradient(to left, rgba(0,176,24,.18), rgba(0,176,24,.04)); border-radius: 3px; pointer-events: none; }
td.pnlbar.neg .fillbar { background: linear-gradient(to left, rgba(214,64,64,.18), rgba(214,64,64,.04)); }
td.pnlbar span { position: relative; }
.pool-mini { display: inline-block; width: 128px; height: 28px; vertical-align: middle; }
.lp .mini { height: 38px; background: var(--bg); border-radius: 6px; padding: 3px; }
td.rng { padding-left: 6px; padding-right: 6px; }

/* ============================================================ contract: numbers, identifiers, tokens */
:root { --r-lg: 12px; --r-md: 8px; --r-sm: 4px; --ctl-h: 36px; --row-h: 52px; --focus: 0 0 0 2px #fff, 0 0 0 4px var(--green-hover); }
.numeric, td.num { font-family: var(--mono); font-variant-numeric: tabular-nums lining-nums; text-align: right; white-space: nowrap; }
.identifier { font-family: var(--mono); font-variant-numeric: tabular-nums slashed-zero; }
.est { border-bottom: 1px dotted var(--earth); cursor: help; }
thead th button { all: unset; cursor: pointer; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; } thead th small { text-transform: none; letter-spacing: 0; opacity: .7; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ============================================================ state matrix */
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
tr[data-id]:focus-visible, tr[data-pool]:focus-visible { box-shadow: inset 0 0 0 2px var(--green-hover); outline: none; }
.btn:active { transform: translateY(1px); } .btn:focus-visible { box-shadow: var(--focus); }
.btn.ghost { color: var(--ink); border-color: rgba(0,43,49,.25); background: #fff; }
.btn.small.ghost { padding: 4px 10px; }
.btn.copy { min-width: 4.6em; } .btn.copy.busy { color: transparent; position: relative; } .btn.copy.busy::after { content: "…"; color: var(--ink); position: absolute; inset: 0; display: grid; place-items: center; }
tr.sk td { padding-top: 15px; padding-bottom: 15px; } tr.sk i { display: inline-block; height: 12px; border-radius: 3px; background: #eef1ef; }
table[aria-busy="true"] tbody:not(:has(tr.sk)) { opacity: .6; transition: opacity .2s .15s; }
.count.busy::after { content: " · refreshing"; }
.load-error { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 18px; background: #fff6e5; color: #6b4a00; border-bottom: 1px solid #f1dfb3; font-family: var(--mono); font-size: .75rem; }
td.chg { animation: chg 1.8s ease-out; } @keyframes chg { 0% { background: rgba(0,176,24,.22); } 100% { background: transparent; } }
.pager .fresh { font-family: var(--mono); font-size: .7rem; color: var(--earth); } .pager .fresh.stale { color: #9a5b00; } .pager .spacer { flex: 1; }
.pager { justify-content: flex-start; }
body.locked { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .drawer { transition: none; } td.chg { animation: none; background: rgba(0,176,24,.12); } .scrim { transition: none; } }

/* range strip: arrows for off-scale, hatched (not only red) when out of range, printed width */
.rbar { vertical-align: middle; } .rbar.out .band { background: repeating-linear-gradient(135deg, rgba(214,64,64,.30) 0 2px, rgba(214,64,64,.08) 2px 4px); }
.rbar .arrow { position: absolute; top: -3px; font-size: 12px; line-height: 12px; color: var(--red-ink); font-style: normal; } .rbar.below .arrow { left: 2px; } .rbar.above .arrow { right: 2px; }
.rtxt { display: block; font-family: var(--mono); font-size: .62rem; color: var(--earth); margin-top: 3px; font-variant-numeric: tabular-nums; }
td.rng { vertical-align: middle; }

/* responsive priorities: p3 goes first, then p2; Pool, Range, PnL, APR and Copy always stay */
thead th { position: sticky; top: var(--nav-h, 71px); background: var(--card); z-index: 2; box-shadow: 0 1px 0 var(--line), 0 -1px 0 var(--card); }
@media (max-width: 1180px) { .p3, td:nth-child(3), td:nth-child(4) { display: none; } }
@media (max-width: 760px) { .p2, td:nth-child(5), td:nth-child(8), td:nth-child(9) { display: none; } .rbar { width: 72px; } }

.load-error[hidden] { display: none; }
[hidden] { display: none !important; }
/* sticky header needs the page as scroll container: the overflow wrapper only scrolls on narrow screens */
@media (min-width: 761px) { .card > div[style*="overflow-x"] { overflow: visible !important; } .card { overflow: visible; } }
@media (max-width: 760px) { thead th { position: static; box-shadow: 0 1px 0 var(--line); } }

/* account */
.nav .pts { font-family: var(--mono); font-size: .7rem; color: var(--green-hover); margin-left: 6px; }
#ref-link { flex: 1; font-size: .82rem; }
table.light { width: 100%; font-size: .85rem; } table.light td { padding: 8px 6px; border-bottom: 1px solid var(--line); }
.hint.neg { color: var(--red-ink); } .hint.pos { color: var(--green-hover); }

/* libraries.dev effects */
.fx-slot { line-height: normal; vertical-align: middle; }
.orb { display: inline-block; width: 20px; height: 20px; vertical-align: middle; margin-right: 8px; }
.sub.loading { display: flex; align-items: center; gap: 2px; }
.orb-plan { margin: 10px 0 -6px; display: block; }
.tabs { position: relative; }
.tab-pill { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; border-radius: 1px; background: var(--green); transition: transform .35s cubic-bezier(.2,.8,.2,1), width .35s cubic-bezier(.2,.8,.2,1); pointer-events: none; }
.tabs button.on { border-bottom-color: transparent; }
.fx-goo { position: absolute; left: 0; right: 0; bottom: -4px; height: 8px; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .tab-pill { transition: none; } .tabs button.on { border-bottom-color: var(--green); } .tab-pill { display: none; } }

/* no layout shake between views: reserve the scrollbar, keep a floor under short views */
html { scrollbar-gutter: stable; }
.view, #view-positions { min-height: 60vh; }

/* toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 40px)); pointer-events: none; }
.toast { pointer-events: auto; display: grid; grid-template-columns: 26px 1fr auto auto; gap: 10px; align-items: start; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 12px 12px 12px 14px; box-shadow: 0 16px 40px -18px rgba(0,43,49,.35), 0 1px 0 rgba(0,43,49,.04); font-size: .88rem; animation: toast-in .5s cubic-bezier(.2,.9,.25,1.15) both; }
.toast.out { animation: toast-out .28s ease both; }
.toast .t-ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-size: .8rem; font-weight: 600; background: var(--green-tint); color: var(--green-hover); }
.toast.error .t-ic { background: #fdecec; color: var(--red-ink); }
.toast .t-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; } .toast .t-body b { font-weight: 600; } .toast .t-body span { color: var(--ink-2); font-size: .82rem; line-height: 1.4; }
.toast .t-x { all: unset; cursor: pointer; color: var(--earth); font-size: 1.1rem; line-height: 1; padding: 0 2px; } .toast .t-x:hover { color: var(--ink); }
.toast .btn.small.ghost { white-space: nowrap; align-self: center; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.96); filter: blur(6px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(.98); filter: blur(4px); } }
@media (prefers-reduced-motion: reduce) { .toast, .toast.out { animation-duration: .01s; } }

/* address chips */
.addrs { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: -8px 0 18px; }
.addr { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; color: var(--ink-2); }
.addr em { font-style: normal; color: var(--earth); text-transform: uppercase; letter-spacing: .06em; font-size: .62rem; }
.copy-a { all: unset; cursor: pointer; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; border: 1px solid var(--line); color: var(--earth); background: #fff; }
.copy-a:hover { color: var(--ink); border-color: rgba(0,43,49,.3); } .copy-a:focus-visible { box-shadow: var(--focus); }
.copy-a.did { color: var(--green-hover); border-color: var(--green); } .copy-a.did svg { display: none; } .copy-a.did::after { content: "✓"; font-size: .7rem; }
.addrs .x { font-family: var(--mono); font-size: .72rem; color: var(--earth); align-self: center; }
.elsewhere { margin-top: 12px; font-size: .8rem; color: var(--ink-2); line-height: 1.5; } .elsewhere a { color: var(--ink); } .elsewhere .identifier { font-size: .76rem; }
.copy-a.cielo { text-decoration: none; } .lp .who .cielo { width: 18px; height: 18px; margin-left: 2px; vertical-align: -4px; }
.nav .fx-slot { vertical-align: middle; }

/* stock token directory */
.stock-dir { margin-bottom: 18px; }
.dir-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.dir-head b { display: block; font-weight: 600; } .dir-head span { font-size: .82rem; color: var(--ink-2); }
.fakes { margin: 12px 18px 4px; padding: 10px 12px; background: #fdf1f1; border: 1px solid rgba(214,64,64,.25); border-radius: 8px; font-size: .82rem; color: #6b1d1d; line-height: 1.6; }
.fakes b { color: var(--red-ink); } .fake { display: inline-block; font-family: var(--mono); font-size: .72rem; background: #fff; border: 1px solid rgba(214,64,64,.3); border-radius: 4px; padding: 1px 6px; margin-right: 4px; color: var(--red-ink); }
table.dir td { padding: 8px 14px; } table.dir .name { color: var(--ink-2); font-weight: 400; font-size: .85rem; margin-left: 6px; }
table.dir tr.none td { color: var(--earth); } table.dir tr.none b { color: var(--ink-2); } table.dir tr.has { cursor: pointer; }
.dir-foot { padding: 10px 18px; font-family: var(--mono); font-size: .7rem; color: var(--earth); border-top: 1px solid var(--line); }

.tag.warn { color: #8a6a00; border-color: rgba(138,106,0,.35); background: #fff8e1; }
.tiers { white-space: nowrap; } .tier { display: inline-block; font-family: var(--mono); font-size: .7rem; padding: 2px 7px; border: 1px solid var(--line); border-radius: 4px; margin-right: 4px; color: var(--ink-2); text-decoration: none; } .tier:hover { border-color: var(--green); color: var(--ink); } .tier.v4 { border-style: dashed; }
.hookbox { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: .88rem; line-height: 1.5; background: #f3faf3; margin-bottom: 8px; }
.hookbox.risky { background: #fdf1f1; border-color: rgba(214,64,64,.3); } .hookbox ul { margin: 6px 0; padding-left: 1.1rem; } .hookbox .fine { margin-top: 6px; }
#fast-token { border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font: inherit; font-family: var(--mono); background: #fff; max-width: 9em; }
#fast-amt { flex: 1; }

.emis { display: block; font-size: .66rem; color: #6b4fbb; margin-top: 2px; white-space: nowrap; }
.emisbox { border: 1px solid rgba(107,79,187,.3); background: #f5f2fd; border-radius: 10px; padding: 10px 12px; font-size: .85rem; line-height: 1.5; margin: 0 0 16px; color: #2c2450; } .emisbox b { color: #6b4fbb; } .emisbox a { color: #2c2450; }

/* Polars branding: the pixel polar and wordmark shared with the arena */
.px { image-rendering: pixelated; }
.polars-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--black); }
.polars-brand img { width: 40px; height: 40px; }
.polars-brand b { font: 400 32px/1 "Jersey 15", monospace; letter-spacing: 0.01em; }
.polars-brand .classic { font: 600 11px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--earth); border: 1px solid var(--line); border-radius: 999px; padding: 5px 8px; }
.race-link { font-weight: 700; }
.head-polar { width: 168px; height: 168px; flex: none; align-self: end; cursor: pointer; }
@media (max-width: 760px) { .head-polar { display: none; } }
@media (max-width: 560px) { .race-link, .polars-brand .classic { display: none; } .polars-brand b { font-size: 28px; } }
.card > div[style*="overflow-x"] { position: relative; }  /* keeps visually-hidden spans inside the scroller */
