@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: block;
}

:root {
  --bg: #101010;
  --panel: #131314;
  --elev: #1c1c1d;
  --elev-2: #222224;
  --line: #28282a;
  --line-2: #323234;
  --text: #f5f5f5;
  --text-2: #c8c8c8;
  --sub: #8d8d92;
  --muted: #6e6e6e;
  --green: #54d490;
  --red: #e5646e;
  --orange: #ff8649;
  --font: "Inter", ui-sans-serif, system-ui, sans-serif;
  --t15: 15px;
  --t13: 13px;
  --t12: 12px;
  --t11: 11px;
  --w4: 400;
  --w5: 500;
  --w6: 600;
  --pad: 16px;
  --gap: 8px;
  --row: 56px;
  --avatar: 24px;
  --pill: 20px;
  --icon: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 400px;
  height: 720px;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: var(--w4);
  font-feature-settings: "ss01", "cv11", "tnum";
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
}
body.overview-body {
  width: auto;
  height: auto;
  overflow: hidden;
  background: var(--bg);
}

.panel {
  width: 400px;
  height: 720px;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

/* ── Header / tabs: shared 16px left edge ── */
.header {
  height: 48px;
  flex: 0 0 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--pad);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: var(--gap); }
.logo { width: 24px; height: 24px; flex: 0 0 24px; display: block; }
.wordmark {
  font-size: var(--t15);
  font-weight: var(--w6);
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
}
.header-right { display: flex; align-items: center; gap: var(--gap); }
.live {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--sub);
  font-size: var(--t11);
  font-weight: var(--w4);
  white-space: nowrap;
}
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex: 0 0 6px;
}
.live-lat { color: var(--muted); }
.icon-btn {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: var(--sub);
  border: none;
  background: transparent;
  flex: 0 0 24px;
}
.icon-btn svg { display: block; }

.tabs {
  height: 40px;
  flex: 0 0 40px;
  display: flex;
  align-items: center;
  gap: var(--gap);
  padding: 0 var(--pad);
  border-bottom: 1px solid var(--line);
}
.tab {
  height: var(--pill);
  padding: 0 var(--gap);
  display: flex;
  align-items: center;
  color: var(--sub);
  font-size: var(--t12);
  font-weight: var(--w5);
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.tab.active {
  color: var(--text);
  background: var(--elev);
  border-color: var(--line-2);
  font-weight: var(--w5);
}

.main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.footer {
  flex: 0 0 32px;
  height: 32px;
  display: flex;
  align-items: center;
  padding: 0 var(--pad);
  border-top: 1px solid var(--line);
}

/* ── Info icon + tooltip ── */
.info {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--icon);
  height: var(--icon);
  flex: 0 0 14px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--elev);
  color: var(--sub);
  font-family: var(--font);
  font-size: 11px;
  font-weight: var(--w6);
  line-height: 1;
  letter-spacing: 0;
  cursor: default;
}
.info.warn { color: var(--orange); border-color: #3a2a22; }
.tip {
  display: none;
  position: absolute;
  z-index: 20;
  left: 0;
  top: calc(100% + 8px);
  width: 240px;
  padding: 8px;
  border-radius: var(--gap);
  background: var(--elev);
  border: 1px solid var(--line-2);
  color: var(--text-2);
  font-size: var(--t12);
  font-weight: var(--w4);
  line-height: 1.45;
  text-align: left;
  letter-spacing: 0;
  text-transform: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  white-space: normal;
}
.tip strong { color: var(--text); font-weight: var(--w6); }
.info.open .tip { display: block; }
.tip.up {
  top: auto;
  bottom: calc(100% + 8px);
}
.tip.left {
  left: auto;
  right: 0;
}

/* ── Shared type ── */
.pos { color: var(--green) !important; }
.neg { color: var(--red) !important; }
.warn { color: var(--orange) !important; }
.r { text-align: right; }
.num {
  font-size: var(--t13);
  font-weight: var(--w5);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.2;
  white-space: nowrap;
}
.sub12 {
  font-size: var(--t12);
  font-weight: var(--w4);
  color: var(--sub);
  line-height: 1.3;
  white-space: nowrap;
}

/* ── Pills ── */
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--pill);
  padding: 0 var(--gap);
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--elev);
  color: var(--sub);
  font-size: var(--t11);
  font-weight: var(--w5);
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  flex: 0 0 auto;
}
.pill.enter { color: var(--green); border-color: #1d3a2c; background: rgba(84, 212, 144, 0.08); }
.pill.exit { color: var(--red); border-color: #3a2226; background: rgba(229, 100, 110, 0.10); }
.pill.oor { color: var(--orange); border-color: #3a2a22; background: rgba(255, 134, 73, 0.10); }
.pill.best { color: var(--text-2); }
.pill.tier { color: var(--text-2); min-width: 20px; padding: 0 6px; }
.pill.tier.s { color: var(--text); }
.pill.tier.b { color: var(--muted); }

.chips {
  display: flex;
  align-items: center;
  gap: var(--gap);
  padding: var(--gap) var(--pad) 0;
}
.chip {
  height: var(--pill);
  padding: 0 var(--gap);
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--sub);
  font-size: var(--t12);
  font-weight: var(--w5);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.chip.active {
  background: var(--elev);
  border-color: var(--line-2);
  color: var(--text);
}
.chip .n { font-size: var(--t11); color: var(--muted); font-variant-numeric: tabular-nums; }

/* ── Avatars / tokens ── */
.tok, .av {
  width: var(--avatar);
  height: var(--avatar);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: var(--t11);
  font-weight: var(--w6);
  letter-spacing: -0.02em;
  color: #fff;
  flex: 0 0 24px;
  line-height: 1;
}
.tok { border-radius: 6px; }
.tok.mh { background: #c45c22; }
.tok.pt { background: #5b45c0; }
.tok.da { background: #b03a7a; }
.tok.ca { background: #2b5fd0; }
.tok.us { background: #0f766e; }
.av.w8r { background: #0f766e; }
.av.w6p { background: #1d4ed8; }
.av.w3t { background: #b45309; }
.av.w9j { background: #6d28d9; }
.av.w5h { background: #be123c; }
.av.w3n { background: #047857; }

/* ── Section head ── */
.sec {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  padding: 16px var(--pad) 8px;
  min-height: 40px;
}
.sec-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.sec h2 {
  font-size: var(--t15);
  font-weight: var(--w6);
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
}
.sec .chips { padding: 0; }

/* ── Insight ── */
.insight {
  padding: 16px var(--pad) 0;
  font-size: var(--t13);
  line-height: 1.4;
  color: var(--text-2);
  font-weight: var(--w4);
}
.insight strong { color: var(--text); font-weight: var(--w6); }

/* ── Generic 4-col table ── */
.table { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.thead, .trow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px 72px 64px;
  column-gap: 8px;
  padding: 0 var(--pad);
  align-items: center;
}
.thead {
  height: 32px;
  flex: 0 0 32px;
  border-bottom: 1px solid var(--line);
}
.thead span {
  font-size: var(--t11);
  font-weight: var(--w4);
  color: var(--muted);
  letter-spacing: 0;
  text-transform: none;
  line-height: 1;
}
.thead span:first-child,
.whead span:first-child {
  padding-left: 32px; /* align with name, after 24px avatar + 8px gap */
}
.trow {
  height: var(--row);
  flex: 0 0 56px;
  border-bottom: 1px solid var(--line);
}
.trow:last-child { border-bottom: none; }

.ident {
  display: flex;
  align-items: center;
  gap: var(--gap);
  min-width: 0;
}
.ident .text { min-width: 0; }
.name {
  font-size: var(--t13);
  font-weight: var(--w6);
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--text);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.name .pair { font-weight: var(--w5); color: var(--muted); }
.meta {
  margin-top: 2px;
  font-size: var(--t12);
  font-weight: var(--w4);
  color: var(--sub);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.meta .dot {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--muted);
  flex: 0 0 2px;
}
.cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.cell.r { align-items: flex-end; text-align: right; }

/* ── Feed ── */
.alert {
  margin: 8px var(--pad) 0;
  padding: 8px 0 8px 12px;
  border-left: 2px solid var(--red);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  column-gap: 16px;
  align-items: start;
}
.alert-kicker {
  font-size: var(--t11);
  font-weight: var(--w5);
  color: var(--red);
  margin-bottom: 4px;
  line-height: 1;
}
.alert p {
  font-size: var(--t13);
  line-height: 1.35;
  color: var(--text-2);
  font-weight: var(--w4);
}
.alert strong { color: var(--text); font-weight: var(--w6); }
.alert .ago {
  color: var(--muted);
  font-size: var(--t11);
  font-weight: var(--w4);
  text-align: right;
  padding-top: 1px;
  font-variant-numeric: tabular-nums;
}

.feed { display: flex; flex-direction: column; flex: 1; min-height: 0; margin-top: 8px; }
.ev {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  column-gap: 16px;
  align-items: center;
  height: 48px;
  flex: 0 0 48px;
  padding: 0 var(--pad);
  border-top: 1px solid var(--line);
}
.ev-title {
  font-size: var(--t13);
  font-weight: var(--w5);
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ev-title .verb { font-weight: var(--w4); color: var(--sub); }
.ev-sub {
  margin-top: 2px;
  font-size: var(--t12);
  color: var(--sub);
  font-weight: var(--w4);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  min-width: 0;
}
.ev-sub .dot, .th-stats .dot {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--muted);
  flex: 0 0 2px;
}
.ev-ago {
  font-size: var(--t11);
  color: var(--muted);
  font-weight: var(--w4);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ── Pools ── */
.search {
  height: 32px;
  margin: 16px var(--pad) 0;
  display: flex;
  align-items: center;
  gap: var(--gap);
  padding: 0 12px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
}
.search .q {
  flex: 1;
  font-size: var(--t12);
  color: var(--text);
  font-weight: var(--w4);
  font-variant-numeric: tabular-nums;
}
.search svg { flex: 0 0 14px; display: block; }

.token-head {
  display: flex;
  align-items: center;
  gap: var(--gap);
  padding: 16px var(--pad);
  border-bottom: 1px solid var(--line);
}
.th-name {
  font-size: var(--t15);
  font-weight: var(--w6);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.th-name .pair { font-size: var(--t13); font-weight: var(--w5); color: var(--muted); }
.th-stats {
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--t12);
  color: var(--sub);
  font-weight: var(--w4);
  white-space: nowrap;
}
.th-stats .dot { width: 2px; height: 2px; border-radius: 50%; background: var(--muted); }

.phead, .prow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px 72px 64px;
  column-gap: 8px;
  padding: 0 var(--pad);
  align-items: center;
}
.phead {
  height: 32px;
  border-bottom: 1px solid var(--line);
}
.phead span {
  font-size: var(--t11);
  font-weight: var(--w4);
  color: var(--muted);
}
.prow {
  height: 64px;
  flex: 0 0 64px;
  border-bottom: 1px solid var(--line);
}
.prow:last-child { border-bottom: none; }

/* ── Calculator ── */
.calc {
  padding: 16px var(--pad) 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  min-height: 0;
}
.flab {
  font-size: var(--t11);
  font-weight: var(--w4);
  color: var(--muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
}
.select, .input {
  height: 40px;
  display: flex;
  align-items: center;
  gap: var(--gap);
  padding: 0 12px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
}
.select { justify-content: space-between; }
.select-left { display: flex; align-items: center; gap: var(--gap); min-width: 0; }
.select-name {
  font-size: var(--t13);
  font-weight: var(--w6);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.select-sub { font-size: var(--t12); color: var(--sub); font-weight: var(--w4); margin-top: 2px; }
.chev { color: var(--muted); display: block; }
.input .amount {
  flex: 1;
  font-size: var(--t15);
  font-weight: var(--w6);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.suffix {
  font-size: var(--t11);
  font-weight: var(--w5);
  color: var(--sub);
}

.out-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 16px;
}
.out + .out { border-left: 1px solid var(--line); padding-left: 16px; }
.out .lab {
  font-size: var(--t11);
  font-weight: var(--w4);
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
}
.out .lab em { font-style: normal; color: var(--sub); font-weight: var(--w5); }
.out .val {
  margin-top: 8px;
  font-size: var(--t15);
  font-weight: var(--w6);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1.1;
}
.out .hint { margin-top: 4px; font-size: var(--t12); color: var(--sub); font-weight: var(--w4); }

.il-head, .be-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.il-head h3, .be-head h3 {
  font-size: var(--t15);
  font-weight: var(--w6);
  letter-spacing: -0.02em;
  line-height: 1;
}
table.ilt { width: 100%; border-collapse: collapse; }
.ilt th {
  text-align: right;
  font-size: var(--t11);
  font-weight: var(--w4);
  color: var(--muted);
  padding: 0 0 8px 16px;
  border-bottom: 1px solid var(--line);
  line-height: 1;
}
.ilt th:first-child { text-align: left; padding-left: 0; }
.ilt td {
  text-align: right;
  font-size: var(--t13);
  font-weight: var(--w5);
  font-variant-numeric: tabular-nums;
  padding: 12px 0 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  letter-spacing: -0.01em;
  height: 40px;
  white-space: nowrap;
}
.ilt tr:last-child td { border-bottom: none; }
.ilt td:first-child { text-align: left; color: var(--sub); font-weight: var(--w5); padding-left: 0; }
.ilt td.dim { color: var(--sub); }

.be { position: relative; }

/* ── Wallets: Wallet | 30d PnL | Win rate | Fees ── */
.whead, .wrow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px 48px 56px;
  column-gap: 8px;
  padding: 0 var(--pad);
  align-items: center;
}
.whead {
  height: 32px;
  flex: 0 0 32px;
  border-bottom: 1px solid var(--line);
}
.whead span {
  font-size: var(--t11);
  font-weight: var(--w4);
  color: var(--muted);
}
.wrow {
  height: var(--row);
  flex: 0 0 56px;
  border-bottom: 1px solid var(--line);
}
.wrow:last-child { border-bottom: none; }

/* ── Overview artboard ── */
.artboard {
  width: 2208px;
  height: 1000px;
  padding: 48px 48px 40px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}
.ov-head {
  margin-bottom: 24px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}
.ov-brand { display: flex; align-items: center; gap: 12px; }
.ov-brand .logo { width: 24px; height: 24px; flex-basis: 24px; }
.ov-title {
  font-size: var(--t15);
  font-weight: var(--w6);
  letter-spacing: -0.02em;
  line-height: 1;
}
.ov-sub { margin-top: 6px; font-size: var(--t13); color: var(--sub); font-weight: var(--w4); }
.ov-meta { text-align: right; font-size: var(--t11); color: var(--muted); line-height: 1.5; }
.ov-grid {
  display: grid;
  grid-template-columns: repeat(5, 400px);
  gap: 28px;
}
.frame { display: flex; flex-direction: column; gap: 8px; }
.frame-label {
  font-size: var(--t11);
  font-weight: var(--w4);
  color: var(--sub);
  padding-left: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.frame-label b { color: var(--muted); font-weight: var(--w5); }
.frame .panel, .frame img.panel {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg);
}
