/* Opsis terminal. Layout and sizes measured on the reference terminal at 1440 px; colours = Opsis
   (lapis brand from the iris, gold for hooks from the ring, navy night by default, marble bone in light). */
:root {
  color-scheme: dark;
  --bg: #070b17; --surface: #0c1224; --surface-2: #111a31; --sunken: #050812;
  --line: #1a2440; --line-strong: #26324f;
  --text: #eee8dc; --muted: #9198ae; --faint: #4a5573;
  --brand: #3a5cf0; --brand-strong: #2843c9; --brand-text: #8da3ff; --brand-soft: rgb(58 92 240 / .16); --on-brand: #fff;
  --hooked: #d9b55e; --hooked-text: #e2bc62; --hooked-soft: rgb(217 181 94 / .14);
  --vanilla: #a9afc2; --vanilla-soft: rgb(169 175 194 / .12);
  --up: #00d68f; --up-soft: rgb(0 214 143 / .12); --down: #ff4766; --down-soft: rgb(255 71 102 / .13);
  --warn: #ffb020; --warn-soft: rgb(255 176 32 / .14); --live: #00d68f;
  --pop: 0 0 0 1px #26324f, 0 12px 32px -4px rgb(0 0 0 / .72);
  --side: 228px;
  --ff: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --fd: 'Instrument Sans', 'Inter', sans-serif;
  --fm: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}
:root[data-theme=light] {
  color-scheme: light;
  --bg: #eee8dc; --surface: #fbf8f2; --surface-2: #f5f0e6; --sunken: #e5decf;
  --line: #ddd4c2; --line-strong: #c9bea8;
  --text: #0e1a3a; --muted: #5f6478; --faint: #8f8c86;
  --brand: #3a5cf0; --brand-strong: #2843c9; --brand-text: #1f35a0; --brand-soft: #e3e8fb;
  --hooked: #a88330; --hooked-text: #86661f; --hooked-soft: #f1e6cb;
  --vanilla: #5f6478; --vanilla-soft: #e6e1d6;
  --up: #058258; --up-soft: rgb(5 130 88 / .1); --down: #d41938; --down-soft: rgb(212 25 56 / .1);
  --warn: #ad6200; --warn-soft: rgb(173 98 0 / .12); --live: #00b87a;
  --pop: 0 0 0 1px #c9bea8, 0 12px 32px -4px rgb(14 26 58 / .14);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 400 14px/20px var(--ff); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input { font: inherit; color: inherit; background: none; border: 0; outline: 0; min-width: 0; }
svg { flex: none; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.mono { font-family: var(--fm); }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.up { color: var(--up); } .down { color: var(--down); }
::selection { background: var(--brand-soft); }
::-webkit-scrollbar { width: 8px; height: 8px; } ::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; } ::-webkit-scrollbar-track { background: transparent; }

/* ---- shell ---- */
.app { display: flex; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; width: var(--side); flex: none; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 30; }
.side .brand { height: 48px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; border-bottom: 1px solid var(--line); flex: none; }
.brand-lk { display: inline-flex; align-items: center; gap: 8px; border-radius: 4px; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: #eee8dc url(/img/eye-128.png) center / 88% no-repeat; box-shadow: 0 0 0 1px rgb(14 26 58 / .12) inset; flex: none; }
.brand-wm { font: 600 19px/1 var(--fd); letter-spacing: -0.04em; }
.side .collapse { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; color: var(--muted); }
.side .collapse:hover { color: var(--text); background: var(--surface-2); }
.side .find { padding: 8px 10px; border-bottom: 1px solid var(--line); flex: none; }
.find-btn { width: 100%; height: 32px; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; background: var(--sunken); border: 1px solid var(--line); border-radius: 6px; font-size: 12px; color: var(--muted); }
.find-btn span { display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; overflow: hidden; }
.find-btn svg { color: var(--faint); }
kbd { font: 500 10px/1 var(--fm); color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 4px 6px; }
.side nav { padding: 6px; border-bottom: 1px solid var(--line); flex: none; }
.side-lbl { font: 600 10px/20px var(--ff); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 2px 8px 4px; display: flex; justify-content: space-between; }
.nav-a { height: 32px; display: flex; align-items: center; gap: 10px; padding: 0 10px; border-radius: 4px; font: 500 12px/16px var(--ff); color: var(--muted); width: 100%; margin-bottom: 2px; }
.nav-a:hover { color: var(--text); background: var(--surface-2); }
.nav-a.on { background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }
.side .lists { flex: 1; overflow: auto; padding: 8px 6px 6px; }
.side .lists .side-lbl { padding: 2px 4px 6px; }
.lrow { height: 32px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 8px; border-radius: 4px; font-size: 12px; color: var(--muted); width: 100%; }
.lrow:hover { background: var(--surface-2); color: var(--text); }
.lrow.on { background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }
.lrow .l { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.lrow .l span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .v { font: 500 11px/14px var(--ff); color: var(--text); font-variant-numeric: tabular-nums; }
.lrow.on .v { color: var(--brand-text); }
.side .foot { border-top: 1px solid var(--line); padding: 8px 10px; flex: none; font-size: 11px; }
.foot-row { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px; height: 24px; border-radius: 4px; }
.foot-row b { font: 600 10px/14px var(--fm); color: var(--muted); letter-spacing: .04em; display: inline-flex; align-items: center; gap: 6px; }
.chip-link { height: 20px; display: inline-flex; align-items: center; gap: 4px; padding: 0 6px; font: 400 10px/1 var(--fm); color: var(--muted); background: var(--sunken); border: 1px solid var(--line); border-radius: 4px; }
.chip-link:hover { color: var(--text); }
.foot-meta { display: flex; gap: 10px; align-items: center; padding: 6px 4px 0; margin-top: 6px; border-top: 1px solid var(--line); font: 400 11px/14px var(--fm); color: var(--muted); }
.foot-meta a:hover { color: var(--text); }
.dot { width: 6px; height: 6px; border-radius: 99px; background: var(--live); display: inline-block; flex: none; }
.dot.pulse { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.top .bar { height: 48px; display: flex; align-items: center; justify-content: space-between; padding: 6px 16px; gap: 16px; }
.stats { display: flex; align-items: center; gap: 12px; font-size: 12px; white-space: nowrap; overflow: hidden; }
.stat { display: inline-flex; align-items: baseline; gap: 6px; }
.stat .k { font: 500 11px/14px var(--ff); letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.stat .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.stat .s { color: var(--muted); font-variant-numeric: tabular-nums; }
.stats .sep { width: 1px; height: 14px; background: var(--line-strong); }
.acts { display: flex; align-items: center; gap: 8px; flex: none; }
.btn { height: 32px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 10px; border-radius: 6px; font: 600 12px/16px var(--ff); color: var(--muted); background: var(--sunken); border: 1px solid var(--line); white-space: nowrap; }
.btn:hover { color: var(--text); border-color: var(--line-strong); }
.btn.icon { width: 32px; padding: 0; }
.btn.brand { background: var(--brand-strong); border-color: transparent; color: #fff; padding: 0 14px; }
.btn.brand:hover { background: var(--brand); color: #fff; }
.btn.sm { height: 26px; font-size: 12px; }
.btn .cnt { font: 500 11px/1 var(--fm); padding: 3px 6px; border-radius: 4px; background: var(--surface-2); color: var(--muted); }
.live-pill { height: 32px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border-radius: 6px; background: var(--sunken); border: 1px solid var(--line); font: 600 11px/14px var(--fm); color: var(--live); letter-spacing: .04em; }
.live-pill.sync { color: var(--warn); } .live-pill.sync .dot { background: var(--warn); }
.ticker { height: 32px; display: flex; align-items: stretch; background: var(--sunken); border-top: 1px solid var(--line); font-size: 12px; }
.ticker .hot { flex: none; display: flex; align-items: center; gap: 6px; padding: 0 12px; background: var(--surface); font: 700 11px/14px var(--ff); letter-spacing: .04em; }
.ticker .rail { flex: 1; overflow: hidden; position: relative; mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent); }
.ticker .track { display: flex; width: max-content; animation: slide 90s linear infinite; padding: 2px 0; }
.ticker:hover .track, .ticker.paused .track { animation-play-state: paused; }
@keyframes slide { to { transform: translateX(-50%); } }
.tk { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 14px; border-right: 1px solid var(--line); white-space: nowrap; }
.tk:hover { background: var(--surface); }
.tk .r { color: var(--faint); font-weight: 600; }
.tk .p { font-weight: 600; } .tk .x { font-weight: 600; font-variant-numeric: tabular-nums; } .tk .vol { color: var(--muted); font-variant-numeric: tabular-nums; }
.ticker .pause { flex: none; width: 33px; display: grid; place-items: center; background: var(--surface); color: var(--muted); }
main { padding: 12px 16px 80px; flex: 1; }
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 12px 0 14px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.page-h h1 { margin: 0; font: 600 30px/1.1 var(--fd); letter-spacing: -0.035em; }
.page-h p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }

/* ---- cards ---- */
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.card.pad { padding: 12px; }
.card-h { height: 28px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); box-sizing: content-box; }
.card-t { display: inline-flex; align-items: center; gap: 6px; font: 600 12px/16px var(--ff); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.card-t svg { color: var(--brand-text); }
.kpi { padding: 20px 22px; }
.kpi .k { font: 600 11px/14px var(--ff); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.kpi .v { font: 700 22px/28px var(--ff); letter-spacing: -0.02em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.kpi .s { color: var(--muted); font-size: 12px; margin-top: 4px; }
.mini-row { height: 36px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 6px; margin: 0 -6px; border-top: 1px solid var(--line); font-size: 12px; border-radius: 4px; }
.mini-row:first-child { border-top: 0; }
.mini-row:hover { background: var(--surface-2); }
.mini-row .l { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.mini-row .rk { width: 14px; font: 500 11px/14px var(--ff); color: var(--muted); font-variant-numeric: tabular-nums; }
.mini-row .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-row .r { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.mini-row .px { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.mini-row .vv { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 52px; text-align: right; }
.mini-empty { height: 180px; display: grid; place-items: center; color: var(--muted); font-size: 12px; text-align: center; }
.sl { color: var(--faint); font-weight: 400; padding: 0 1px; }

/* segmented controls */
.seg { display: inline-flex; gap: 2px; padding: 2px; background: var(--sunken); border: 1px solid var(--line); border-radius: 6px; }
.seg button { font: 600 11px/14px var(--ff); padding: 2px 8px; border-radius: 4px; color: var(--muted); }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 0 rgb(255 255 255 / .03) inset; }
.seg.lg button { font: 500 12px/16px var(--ff); padding: 4px 10px; }
.seg.tabs { flex-wrap: wrap; }

/* pills */
.chg { display: inline-flex; align-items: center; gap: 2px; padding: 2px 6px; border-radius: 4px; font: 600 11px/14px var(--ff); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; background: var(--sunken); color: var(--muted); white-space: nowrap; }
.chg.up { background: var(--up-soft); color: var(--up); } .chg.down { background: var(--down-soft); color: var(--down); }
.chg i { font-style: normal; font-size: 9px; }
.chg.lg { font-size: 12px; line-height: 16px; }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 6px; border-radius: 4px; font: 600 11px/14px var(--ff); letter-spacing: .01em; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.tag.hook { background: var(--hooked-soft); color: var(--hooked-text); }
.tag.hook:hover { filter: brightness(1.15); }
.tag.mono { font: 500 10px/18px var(--fm); height: 18px; letter-spacing: -0.01em; }
.tag.brand { background: var(--brand-soft); color: var(--brand-text); }
.tag.risk-low { background: var(--up-soft); color: var(--up); } .tag.risk-medium { background: var(--warn-soft); color: var(--warn); } .tag.risk-high { background: var(--down-soft); color: var(--down); }
.tag.ok { background: var(--up-soft); color: var(--up); }
.chipbtn { height: 20px; display: inline-flex; align-items: center; gap: 4px; padding: 0 6px; border-radius: 4px; font: 600 11px/14px var(--ff); letter-spacing: .01em; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.chipbtn:hover { color: var(--text); }
.chipbtn.on { background: var(--hooked-soft); color: var(--hooked-text); }
.chipbtn em { font: 500 10px/1 var(--fm); font-style: normal; opacity: .7; }

/* token icons */
.ti { width: 14px; height: 14px; border-radius: 99px; background: var(--sunken); display: inline-grid; place-items: center; overflow: hidden; flex: none; font: 700 8px/1 var(--fd); color: var(--muted); position: relative; }
.ti img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.ti.md { width: 20px; height: 20px; font-size: 9px; } .ti.lg { width: 36px; height: 36px; font-size: 13px; } .ti.xl { width: 44px; height: 44px; font-size: 15px; }
.ti.eth { background: #627eea; color: #fff; } .ti.usd { background: #2775ca; color: #fff; }
.pairic { display: inline-flex; } .pairic .ti + .ti { margin-left: -7px; box-shadow: 0 0 0 1.5px var(--surface); }
.pairic.lg .ti + .ti { margin-left: -12px; box-shadow: 0 0 0 2px var(--bg); }

/* ---- big table card ---- */
.tcard { overflow: hidden; }
.thead-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.thead-bar .left, .thead-bar .right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search { height: 26px; width: 256px; display: inline-flex; align-items: center; gap: 8px; padding: 0 8px; background: var(--sunken); border-radius: 6px; color: var(--muted); }
.search input { font-size: 12px; flex: 1; color: var(--text); }
.search input::placeholder { color: var(--muted); }
.filter-bar { display: flex; flex-direction: column; gap: 8px; padding: 6px 16px; background: color-mix(in srgb, var(--sunken) 30%, transparent); border-bottom: 1px solid var(--line); }
.filter-bar .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 20px; }
.filter-bar .row.chips { gap: 6px; }
.lnk { display: inline-flex; align-items: center; gap: 4px; font: 600 11px/14px var(--ff); color: var(--brand-text); }
.lnk:hover { text-decoration: underline; }
.twrap { overflow: auto; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; white-space: nowrap; }
table.t th { position: sticky; top: 0; z-index: 2; background: var(--sunken); text-align: right; padding: 12px 16px; font: 600 11px/14px var(--ff); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); cursor: default; user-select: none; }
table.t th.l, table.t td.l { text-align: left; }
table.t th.sortable { cursor: pointer; } table.t th.sortable:hover { color: var(--text); } table.t th.sorted { color: var(--text); }
table.t th:first-child, table.t td:first-child { padding-left: 20px; padding-right: 6px; text-align: left; width: 40px; }
table.t th:last-child, table.t td:last-child { padding-right: 20px; }
table.t td { padding: 12px 16px; border-top: 1px solid var(--line); background: var(--surface); text-align: right; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; vertical-align: middle; }
table.t tbody tr { cursor: pointer; }
table.t tbody tr:hover td { background: var(--surface-2); }
table.t tbody tr.flash td { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: var(--brand-soft); } }
.rk { font: 500 11px/14px var(--ff); color: var(--muted); font-variant-numeric: tabular-nums; }
.pair { display: inline-flex; align-items: center; gap: 8px; }
.pair .nm { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.pair .sub { display: block; font: 400 11px/14px var(--ff); color: var(--muted); }
.v600 { font-weight: 600; } .vq { font: 500 11px/14px var(--ff); color: var(--muted); margin-left: 3px; }
.txn { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 4px; line-height: 13px; }
.txn b { font-weight: 500; } .txn small { font-size: 9px; line-height: 9px; color: var(--muted); }
.ago { font-size: 12px; color: var(--muted); }
.ago.fresh { color: var(--up); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.tradebtn { height: 24px; display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; border-radius: 4px; background: var(--sunken); border: 1px solid var(--line); font: 600 11px/14px var(--ff); color: var(--muted); }
.tradebtn:hover { color: var(--text); border-color: var(--line-strong); }
.side-b { font: 600 11px/14px var(--ff); padding: 2px 6px; border-radius: 4px; }
.side-b.buy { color: var(--up); background: var(--up-soft); } .side-b.sell { color: var(--down); background: var(--down-soft); }
.more { display: flex; justify-content: center; padding: 14px; border-top: 1px solid var(--line); }
.empty { padding: 48px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; }
.split .tapecol { border-left: 1px solid var(--line); max-height: 760px; overflow: auto; }
.tape-row { display: grid; grid-template-columns: 48px 1fr auto; gap: 8px; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--line); font-size: 12px; }
.tape-row .tt { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 11px; }
.tape-row .pp { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tape-row .uu { font-weight: 600; font-variant-numeric: tabular-nums; }
.tape-row.buy .uu { color: var(--up); } .tape-row.sell .uu { color: var(--down); }
.maxed .screener-top { display: none; }

/* ---- detail pages ---- */
.crumbs { display: flex; align-items: center; gap: 8px; font: 400 12px/16px var(--fm); color: var(--muted); padding: 6px 0 10px; }
.crumbs a:hover { color: var(--text); }
.dh { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 20px; }
.dh h1 { margin: 0; font: 600 30px/1.1 var(--fd); letter-spacing: -0.035em; display: inline-flex; align-items: center; gap: 6px; }
.dh h1 .sl { font-weight: 400; }
.pricebox { display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font: 700 20px/1 var(--ff); font-variant-numeric: tabular-nums; }
.dh .spacer { flex: 1; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 16px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-h h3 { margin: 0; font: 600 15px/20px var(--fd); letter-spacing: -0.01em; }
.panel-h p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.panel-b { padding: 16px 20px; }
.chartbox { height: 440px; position: relative; }
.chart-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 20px 0; }
.ohlc { display: flex; flex-wrap: wrap; gap: 12px; padding: 10px 20px 6px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ohlc b { color: var(--text); font-weight: 600; }
.kv { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 12px; }
.kv:first-child { border-top: 0; }
.kv .k { color: var(--muted); } .kv .v { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; display: inline-flex; align-items: center; gap: 6px; }
.addr { font: 400 12px/16px var(--fm); color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.addr button { color: var(--muted); display: inline-grid; place-items: center; } .addr button:hover { color: var(--text); }
.bars2 { height: 6px; border-radius: 6px; overflow: hidden; display: flex; gap: 3px; margin-top: 8px; }
.bars2 i { display: block; height: 100%; border-radius: 6px; } .bars2 .b { background: var(--up); } .bars2 .s { background: var(--down); }
.winbox { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 6px; background: var(--sunken); border-radius: 8px; }
.winbox button { padding: 10px 6px; border-radius: 6px; text-align: center; font: 600 12px/16px var(--ff); color: var(--muted); }
.winbox button .c { display: block; margin-top: 4px; font-size: 13px; }
.winbox button.on { background: var(--surface); box-shadow: 0 0 0 1px var(--line); color: var(--text); }
.power { display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 12px; line-height: 17px; }
.power:first-child { border-top: 0; }
.power .ic { width: 18px; height: 18px; border-radius: 5px; display: grid; place-items: center; font: 700 10px/1 var(--fm); }
.power.swap .ic { background: var(--warn-soft); color: var(--warn); } .power.lp .ic { background: var(--brand-soft); color: var(--brand-text); } .power.pool .ic { background: var(--surface-2); color: var(--muted); }
.permgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.perm { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px; border-radius: 6px; background: var(--sunken); font: 500 11px/14px var(--fm); color: var(--faint); }
.perm.on { color: var(--text); background: var(--hooked-soft); }
.perm .d { width: 6px; height: 6px; border-radius: 9px; background: currentColor; opacity: .6; }
.code { background: var(--sunken); border: 1px solid var(--line); border-radius: 6px; padding: 14px; font: 400 12px/18px var(--fm); color: var(--text); overflow: auto; max-height: 560px; white-space: pre; tab-size: 4; }
.filetabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }

/* swap widget */
.swap { padding: 20px; }
.swap-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.swap-h h3 { margin: 0; font: 600 16px/20px var(--fd); display: inline-flex; align-items: center; gap: 10px; }
.swap-h h3 .ic { width: 28px; height: 28px; border-radius: 6px; background: var(--brand-soft); color: var(--brand-text); display: grid; place-items: center; }
.poolline { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 10px; font-size: 13px; font-weight: 600; }
.leg { background: var(--sunken); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.leg .lh { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }
.leg .lb { display: flex; align-items: center; gap: 10px; margin: 10px 0 6px; }
.leg .lb input { font: 600 26px/32px var(--ff); flex: 1; font-variant-numeric: tabular-nums; }
.leg .lb input::placeholder { color: var(--faint); }
.leg .usd { font-size: 12px; color: var(--muted); }
.tokbtn { height: 40px; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px 0 8px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.pct { display: inline-flex; gap: 4px; } .pct button { font: 500 11px/14px var(--ff); padding: 2px 6px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); } .pct button:hover { color: var(--text); }
.flip { display: flex; justify-content: space-between; align-items: center; padding: 10px 6px; font-size: 13px; color: var(--muted); }
.flip button { width: 30px; height: 30px; border-radius: 6px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface); color: var(--muted); }
.flip button:hover { color: var(--text); }
.bigbtn { width: 100%; height: 48px; margin-top: 14px; border-radius: 6px; background: var(--brand-strong); color: #fff; font: 600 14px/20px var(--ff); display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.bigbtn:hover { background: var(--brand); } .bigbtn:disabled { opacity: .5; cursor: not-allowed; }
.note { font-size: 12px; color: var(--muted); line-height: 17px; margin-top: 12px; }
.note.err { color: var(--down); } .note.ok { color: var(--up); }
.quote { margin-top: 12px; border: 1px solid var(--line); border-radius: 6px; padding: 4px 12px; }

/* overlays */
.fab { position: fixed; right: 20px; bottom: 20px; z-index: 40; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--pop); }
.fab a { height: 32px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 999px; background: var(--brand-strong); color: #fff; font: 600 12px/16px var(--ff); }
.fab a:hover { background: var(--brand); }
.toast { position: fixed; left: calc(var(--side) + 16px); bottom: 20px; z-index: 40; width: 380px; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 8px; background: var(--surface); border: 1px solid var(--brand); box-shadow: var(--pop); font-size: 12px; transform: translateY(140%); transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
.toast.on { transform: none; }
.toast .kind { font: 600 10px/14px var(--fm); letter-spacing: .06em; text-transform: uppercase; padding: 3px 6px; border-radius: 4px; background: var(--brand-soft); color: var(--brand-text); white-space: nowrap; }
.toast .kind.whale { background: var(--up-soft); color: var(--up); } .toast .kind.lp_remove { background: var(--down-soft); color: var(--down); } .toast .kind.new_pool { background: var(--hooked-soft); color: var(--hooked-text); }
.toast b { display: block; font-size: 13px; } .toast span { color: var(--muted); }
.toast .x { color: var(--muted); width: 24px; height: 24px; display: grid; place-items: center; border-radius: 4px; } .toast .x:hover { color: var(--text); background: var(--surface-2); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 420px; z-index: 60; background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--pop); transform: translateX(100%); transition: transform .3s cubic-bezier(.2, .8, .2, 1); display: flex; flex-direction: column; }
.drawer.on { transform: none; }
.drawer .dh2 { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.drawer .dh2 h3 { margin: 0; font: 600 15px/20px var(--fd); display: inline-flex; align-items: center; gap: 8px; }
.drawer .db { flex: 1; overflow: auto; }
.sig { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 12px; }
.sig:hover { background: var(--surface-2); }
.sig .t2 { color: var(--muted); font-size: 11px; }
.veil { position: fixed; inset: 0; z-index: 55; background: rgb(3 6 14 / .5); opacity: 0; pointer-events: none; transition: opacity .2s; }
.veil.on { opacity: 1; pointer-events: auto; }
.modal { position: fixed; z-index: 70; top: 12vh; left: 50%; width: min(640px, calc(100vw - 32px)); transform: translateX(-50%) scale(.98); opacity: 0; pointer-events: none; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--pop); transition: opacity .15s, transform .15s; overflow: hidden; }
.modal.on { opacity: 1; transform: translateX(-50%); pointer-events: auto; }
.modal .mi { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.modal .mi input { flex: 1; font-size: 15px; }
.modal .mr { max-height: 60vh; overflow: auto; padding: 6px; }
.modal .mrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px; border-radius: 6px; font-size: 13px; }
.modal .mrow:hover, .modal .mrow.sel { background: var(--surface-2); }
.modal .grp { font: 600 10px/14px var(--ff); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 10px 10px 4px; }
.wallets { padding: 8px; } .wallets button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 6px; font-weight: 600; font-size: 14px; } .wallets button:hover { background: var(--surface-2); } .wallets img { width: 28px; height: 28px; border-radius: 6px; }
.skel { display: inline-block; height: 12px; width: 60px; border-radius: 4px; background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }
.syncbar { margin-bottom: 12px; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 12px; }
.syncbar .trk { flex: 1; height: 4px; border-radius: 4px; background: var(--sunken); overflow: hidden; } .syncbar .trk i { display: block; height: 100%; background: var(--brand); border-radius: 4px; transition: width .6s; }

/* ---- responsive ---- */
.menu-btn { display: none; }
@media (max-width: 1180px) { .two { grid-template-columns: 1fr; } .grid4 { grid-template-columns: repeat(2, 1fr); } .split { grid-template-columns: 1fr; } .split .tapecol { display: none; } }
@media (max-width: 1024px) { .grid3 { grid-template-columns: 1fr; } .stats .opt { display: none; } }
@media (max-width: 860px) {
  .side { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .25s; box-shadow: var(--pop); }
  .side.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .top .bar { padding: 6px 12px; }
  .stats .stat:not(:first-child), .stats .sep { display: none; }
  .acts .hide-m { display: none; }
  main { padding: 12px 12px 90px; }
  .toast { left: 12px; right: 12px; width: auto; bottom: 76px; }
  .grid4 { grid-template-columns: 1fr 1fr; }
  .search { width: 100%; }
  .thead-bar .left, .thead-bar .right { width: 100%; }
  .dh h1 { font-size: 24px; }
  .drawer { width: 100%; }
}

/* grid children may shrink below their content (tables, code, long names scroll inside instead) */
.two > *, .grid3 > *, .grid4 > *, .two > * > * { min-width: 0; }
.two.trade { grid-template-columns: minmax(0, 560px) minmax(0, 1fr); }
.permgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.perm { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mini-row .l { flex: 1; } .mini-row .nm { min-width: 0; }
@media (max-width: 1180px) { .two.trade { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .mini-row .px { display: none; } .kpi { padding: 14px 16px; } .kpi .v { font-size: 18px; } .pricebox { font-size: 16px; height: 34px; } .dh { gap: 10px; } .dh .btn.brand { width: 100%; } .grid4 { gap: 8px; } }
