:root {
  --bg: #0b0b0e;
  --bg-elev: #121217;
  --surface: rgba(22, 22, 28, 0.55);
  --surface-strong: rgba(28, 28, 36, 0.85);
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text: #e9e9ee;
  --muted: #8a8a96;
  --accent: #ff7a18;
  --accent-strong: #ff9544;
  --accent-glow: 0 0 12px rgba(255, 122, 24, 0.45);
  --green: #3ddc84;
  --red: #ff5577;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background:
    radial-gradient(1200px 800px at 80% -10%, rgba(255, 122, 24, 0.12), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(255, 122, 24, 0.06), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  overflow-x: hidden;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 18px;
  gap: 14px;
}

.glass {
  background: var(--surface);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand h1 { font-size: 18px; font-weight: 600; letter-spacing: 0.5px; margin: 0; }
.brand h1 small { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0.3px; margin-left: 4px; }
.accent { color: var(--accent); text-shadow: var(--accent-glow); }
.logo-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: var(--accent-glow); }

.topbar-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }

.status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot-red { background: var(--red); box-shadow: 0 0 8px var(--red); }
.dot-green { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot-amber { background: #f5b042; box-shadow: 0 0 8px #f5b042; }

/* CS2 market-cap widget (pricempire.com global cap) */
.mc-widget {
  display: flex; align-items: baseline; gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid var(--border-strong);
  font-size: 12px; line-height: 1;
  cursor: help;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.mc-widget:hover {
  border-color: rgba(255,255,255,0.18);
  background: #1a1a24;
}
.mc-widget .mc-lbl {
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px;
  font-size: 9px; font-weight: 700;
}
.mc-widget .mc-value { color: var(--text); font-weight: 700; font-size: 13px; }
.mc-widget .mc-change { font-weight: 600; font-size: 11px; }
.mc-widget .mc-change.up { color: var(--green); }
.mc-widget .mc-change.down { color: var(--red); }
.mc-widget .mc-change.flat { color: var(--muted); }

/* Spend ring widget */
.spend-widget {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid var(--border-strong);
}
.spend-ring-wrap { position: relative; width: 52px; height: 52px; flex: 0 0 52px; }
.spend-ring { display: block; }
.spend-ring-bg { fill: none; stroke: rgba(255, 255, 255, 0.08); stroke-width: 5; }
.spend-ring-fg {
  fill: none;
  stroke: var(--accent);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 163.36;
  stroke-dashoffset: 163.36;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 0.4s ease, stroke 0.2s ease;
  filter: drop-shadow(0 0 6px rgba(255, 122, 24, 0.35));
}
.spend-widget.exceeded .spend-ring-fg { stroke: var(--green); filter: drop-shadow(0 0 6px rgba(61, 220, 132, 0.45)); }
.spend-pct {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--text);
}
.spend-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.spend-row { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.spend-lbl { color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; font-size: 9px; font-weight: 700; min-width: 28px; }
.spend-amount { color: var(--text); font-weight: 700; font-size: 13px; }
.spend-target {
  width: 64px; padding: 2px 6px; font-size: 12px; font-weight: 600;
  background: rgba(255, 255, 255, 0.04); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 6px; outline: none;
}
.spend-target:focus { border-color: var(--accent); }
.spend-target::-webkit-outer-spin-button,
.spend-target::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.spend-reset {
  background: transparent; color: var(--muted); border: none; cursor: pointer;
  padding: 2px 4px; font-size: 13px; line-height: 1;
}
.spend-reset:hover { color: var(--accent); }

.btn { border: none; cursor: pointer; padding: 10px 18px; border-radius: 10px; font-weight: 600; font-size: 13px; transition: transform 0.05s ease, box-shadow 0.2s ease; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-strong)); color: #1b1100; box-shadow: 0 6px 18px rgba(255, 122, 24, 0.35); }
.btn-primary:hover { box-shadow: 0 6px 22px rgba(255, 122, 24, 0.55); }
.btn-buy { background: var(--accent); color: #1b1100; padding: 8px 14px; font-size: 12px; box-shadow: var(--accent-glow); width: 100%; text-align: center; display: inline-flex; align-items: center; justify-content: center; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border-strong); }
.pause-btn { display: inline-flex; align-items: center; gap: 6px; }
.pause-btn:hover { border-color: var(--accent); color: var(--accent); }
.pause-btn.paused { background: rgba(255, 122, 24, 0.12); border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 1px rgba(255, 122, 24, 0.35) inset; }
.pause-btn .pause-ico { font-size: 12px; line-height: 1; }
.pause-btn[disabled] { opacity: 0.55; cursor: wait; }
.account-btn { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.account-btn:hover { border-color: var(--accent); color: var(--accent); }
.account-btn .account-ico { font-size: 13px; line-height: 1; }
.btn-icon { background: transparent; color: var(--muted); border: none; cursor: pointer; padding: 6px 8px; font-size: 14px; }
.btn-icon:hover { color: var(--accent); }

/* Accounts bar */
.accountsbar {
  display: flex; align-items: center; gap: 14px; padding: 10px 18px;
  flex-wrap: wrap;
}
.accounts-label {
  font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; font-weight: 700;
}
.accounts-list {
  display: flex; flex-wrap: wrap; gap: 8px; flex: 1; min-width: 0;
}
.accounts-summary { font-size: 11px; white-space: nowrap; }
.accounts-summary.warn { color: #f5b042; font-weight: 600; }
.accounts-summary.paused { color: var(--accent); font-weight: 600; }
.acc-pill.paused { border-color: rgba(255, 122, 24, 0.45) !important; background: rgba(255, 122, 24, 0.08) !important; opacity: 0.85; }
.acc-pill.paused .acc-dot { background: var(--accent) !important; box-shadow: 0 0 8px var(--accent) !important; animation: none !important; }
.acc-pill.paused .acc-meta { color: var(--accent) !important; }

.acc-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--surface-strong); border: 1px solid var(--border-strong);
  font-size: 12px; font-weight: 600; color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.acc-pill .acc-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto;
}
.acc-pill .acc-role {
  font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px;
}
.acc-pill .acc-name { font-weight: 700; }
.acc-pill .acc-meta { font-size: 10px; color: var(--muted); }

/* State colors */
.acc-pill.ok { border-color: rgba(61, 220, 132, 0.35); }
.acc-pill.ok .acc-dot { background: var(--green); box-shadow: 0 0 8px var(--green); }

.acc-pill.cooldown { border-color: rgba(245, 176, 66, 0.5); background: rgba(245, 176, 66, 0.08); }
.acc-pill.cooldown .acc-dot { background: #f5b042; box-shadow: 0 0 8px #f5b042; animation: pulse 1.2s ease-in-out infinite; }
.acc-pill.cooldown .acc-meta { color: #f5b042; }

.acc-pill.stale { border-color: rgba(255, 85, 119, 0.5); background: rgba(255, 85, 119, 0.08); }
.acc-pill.stale .acc-dot { background: var(--red); box-shadow: 0 0 8px var(--red); }
.acc-pill.stale .acc-meta { color: var(--red); }

.acc-pill.proxy_down {
  border-color: var(--red); background: rgba(255, 85, 119, 0.12);
  box-shadow: 0 0 0 1px rgba(255, 85, 119, 0.3);
}
.acc-pill.proxy_down .acc-dot {
  background: var(--red); box-shadow: 0 0 10px var(--red);
  animation: pulse 0.9s ease-in-out infinite;
}
.acc-pill.proxy_down .acc-meta { color: var(--red); font-weight: 700; }
.acc-pill.proxy_down .acc-name { color: var(--red); }

.acc-pill.idle { border-style: dashed; opacity: 0.85; }
.acc-pill.idle .acc-dot { background: var(--muted); }

.acc-pill.not_configured { opacity: 0.45; }
.acc-pill.not_configured .acc-dot { background: #555; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* Filter bar */
.filterbar {
  display: flex; align-items: center; gap: 18px; padding: 12px 18px; flex-wrap: wrap;
}
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-group label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; }
.filter-group input, .filterbar select {
  padding: 6px 10px; background: var(--surface-strong);
  color: var(--text); border: 1px solid var(--border-strong); border-radius: 8px; font-size: 13px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.filter-group input { width: 80px; }
.filter-group input:focus, .filterbar select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 122, 24, 0.18);
}

/* Search field */
.filter-search { flex: 1; min-width: 220px; max-width: 360px; }
.search-wrap { position: relative; display: flex; align-items: center; }
.search-wrap .search-icon {
  position: absolute; left: 10px; color: var(--muted); pointer-events: none;
}
.search-wrap input {
  width: 100%; padding: 7px 30px 7px 32px !important; background: var(--surface-strong);
  color: var(--text); border: 1px solid var(--border-strong); border-radius: 10px;
  font-size: 13px; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search-wrap input::placeholder { color: var(--muted); }
.search-wrap input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 122, 24, 0.18);
}
.search-clear {
  position: absolute; right: 6px; width: 20px; height: 20px;
  border: none; border-radius: 50%; background: transparent;
  color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1;
  opacity: 0; pointer-events: none; transition: opacity 0.15s ease, background 0.15s ease;
}
.search-wrap.has-value .search-clear { opacity: 1; pointer-events: auto; }
.search-clear:hover { background: rgba(255,255,255,0.08); color: var(--text); }

/* Pill toggle buttons (Hide knives / gloves / StatTrak / Mute) */
.pill-group { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.pill {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px; cursor: pointer; user-select: none;
  background: var(--surface-strong); border: 1px solid var(--border-strong);
  color: var(--muted); font-size: 12px; font-weight: 600;
  transition: all 0.15s ease;
}
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill:hover { border-color: rgba(255, 122, 24, 0.4); color: var(--text); }
.pill:has(input:checked) {
  background: linear-gradient(135deg, rgba(255, 122, 24, 0.18), rgba(255, 149, 68, 0.10));
  border-color: var(--accent);
  color: var(--accent-strong);
  box-shadow: 0 0 0 1px rgba(255, 122, 24, 0.25), 0 4px 14px rgba(255, 122, 24, 0.18);
}
.pill:has(input:checked)::before {
  content: "✓"; font-size: 11px; color: var(--accent); font-weight: 700; margin-right: 2px;
}

/* Liquidity tier filter pills — checked = show items in that tier.
   Color/glow on check matches the .liquid-badge palette so the filter
   reads as the same scale as the lightning-bolt badge in each card. */
.liq-pill-group { align-items: center; }
.pill-group-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.6px;
  text-transform: uppercase; color: var(--muted); margin-right: 2px;
}
.liq-pill { padding: 5px 10px; font-size: 11px; gap: 4px; }
.liq-pill:has(input:checked)::before { content: none; }
.liq-pill:has(input:checked) {
  background: var(--surface-strong);
  box-shadow: none;
}
.liq-pill.liq-t0:has(input:checked) { background: rgba(120,130,145,0.15); color: #8a95a4; border-color: rgba(120,130,145,0.55); }
.liq-pill.liq-t1:has(input:checked) { background: rgba(255,80,80,0.18);   color: #ff7a7a; border-color: rgba(255,80,80,0.65); }
.liq-pill.liq-t2:has(input:checked) { background: rgba(255,140,40,0.20);  color: #ffb060; border-color: rgba(255,140,40,0.70); }
.liq-pill.liq-t3:has(input:checked) { background: rgba(255,213,74,0.22);  color: #ffd54a; border-color: rgba(255,213,74,0.70); }
.liq-pill.liq-t4:has(input:checked) { background: rgba(120,220,90,0.22);  color: #9ee870; border-color: rgba(120,220,90,0.70); }
.liq-pill.liq-t5:has(input:checked) { background: rgba(60,200,200,0.25);  color: #5ee3df; border-color: rgba(60,200,200,0.75); }
.liq-pill.liq-t6:has(input:checked) {
  background: linear-gradient(135deg, rgba(111,77,255,0.22), rgba(255,90,200,0.18));
  color: #c8b5ff; border-color: rgba(111,77,255,0.75);
  box-shadow: 0 0 10px rgba(111,77,255,0.35);
}
.liq-pill:not(:has(input:checked)) {
  background: transparent;
  color: rgba(160,170,185,0.45);
  border-color: rgba(120,130,145,0.18);
  box-shadow: none;
}
.liq-pill:not(:has(input:checked)):hover {
  border-color: rgba(160,170,185,0.45);
  color: rgba(220,225,235,0.75);
}

/* Legacy .check (kept for Snooze) */
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; }
.check input { accent-color: var(--accent); }
.audio-controls { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.vol { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.vol input[type=range] { accent-color: var(--accent); width: 90px; }
.audio-controls select { background: var(--surface-strong); color: var(--text); border: 1px solid var(--border-strong); border-radius: 6px; padding: 4px; font-size: 12px; }

.layout { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) clamp(480px, 32vw, 760px); gap: 18px; min-height: 0; }
.layout > * { min-width: 0; }

.section-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.section-head h2 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase; color: var(--muted); }
.counter { font-size: 12px; color: var(--muted); }
.counter span { color: var(--accent); font-weight: 700; }

.feed-section { display: flex; flex-direction: column; min-height: 0; }
.feed { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.feed-empty { padding: 60px 0; text-align: center; color: var(--muted); }

.feed-pager {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; padding: 14px 0 4px; flex-wrap: wrap;
  border-top: 1px solid var(--border); margin-top: 8px;
}
.feed-pager label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.feed-pager select {
  padding: 4px 8px; background: var(--surface-strong); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 6px; font-size: 12px;
}
.feed-pager button[disabled] { opacity: 0.4; cursor: not-allowed; }
.feed-pager #page-indicator { min-width: 70px; text-align: center; font-variant-numeric: tabular-nums; }

.card {
  display: grid;
  /* Fixed widths on every numeric / button column so the grid resolves the
   * same in every card regardless of how wide the values are. With `auto`
   * columns the grid would shrink the fr columns row-by-row whenever NET
   * PROFIT or PE got long, breaking column alignment across cards. */
  grid-template-columns:
    60px                         /* image */
    minmax(180px, 360px)         /* name (capped so excess width spreads to stats) */
    minmax(90px, 1fr)            /* AVG 7D */
    minmax(90px, 1fr)            /* BUY */
    minmax(90px, 1fr)            /* EXPECTED */
    minmax(220px, 1.4fr)         /* PE */
    minmax(150px, 1fr)           /* NET PROFIT */
    32px                         /* pin */
    96px;                        /* Buy Now */
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface-strong);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  animation: slideIn 0.25s ease;
  transition: border-color 0.15s ease;
}
.card:hover { border-color: var(--accent); }
.card.pinned { border-color: var(--accent); box-shadow: var(--accent-glow); }
.card img { width: 60px; height: 45px; object-fit: contain; }
.card .name { font-weight: 600; font-size: 13px; min-width: 0; overflow: visible; }
.card .name .name-text { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.card .name small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.card .qual-tag { display: inline-block; font-size: 9px; padding: 1px 6px; border-radius: 4px; margin-left: 4px; background: rgba(255,122,24,0.15); color: var(--accent); text-transform: uppercase; letter-spacing: 0.5px; }
.card .qual-tag.souvenir { background: rgba(255,200,80,0.15); color: #ffc850; }
.card .name small .blue-pct { color: #2b8ef7; font-weight: 600; cursor: help; }
.card .name small .compare-link { color: var(--accent); text-decoration: none; font-weight: 600; }
.card .name small .compare-link:hover { text-decoration: underline; }
.card .name .rare-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  vertical-align: -2px;
  cursor: help;
  filter: drop-shadow(0 0 3px rgba(43,142,247,0.55));
  position: relative;
}
.liquid-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: -4px;
  cursor: help;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.55);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
/* Liquidity badge lives in the BUY label (next to "BUY"), like the info icon
   next to EXPECTED. Smaller size + label-aligned vertical baseline. */
.card .stat-buy .lbl .liquid-badge {
  width: 14px;
  height: 14px;
  margin-left: 4px;
  vertical-align: -3px;
}
.card .stat-buy .lbl .liquid-badge svg {
  width: 9px;
  height: 9px;
}
.liquid-badge.liquid-t0 { background: #2a2f38; color: #6a7480; box-shadow: inset 0 0 0 1px rgba(120,130,145,0.25); }
.liquid-badge.liquid-t1 { background: rgba(255,80,80,0.18);  color: #ff7a7a; box-shadow: inset 0 0 0 1px rgba(255,80,80,0.45); }
.liquid-badge.liquid-t2 { background: rgba(255,140,40,0.20); color: #ffb060; box-shadow: inset 0 0 0 1px rgba(255,140,40,0.50); }
.liquid-badge.liquid-t3 { background: rgba(255,213,74,0.22); color: #ffd54a; box-shadow: inset 0 0 0 1px rgba(255,213,74,0.50); }
.liquid-badge.liquid-t4 { background: rgba(120,220,90,0.22); color: #9ee870; box-shadow: inset 0 0 0 1px rgba(120,220,90,0.55); }
.liquid-badge.liquid-t5 { background: rgba(60,200,200,0.25); color: #5ee3df; box-shadow: inset 0 0 0 1px rgba(60,200,200,0.60); }
.liquid-badge.liquid-t6 {
  background: linear-gradient(135deg, #6f4dff 0%, #2bc9ff 100%);
  color: #ffffff;
  box-shadow: 0 0 8px rgba(111,77,255,0.6), inset 0 0 0 1px rgba(255,255,255,0.25);
}
.liquid-badge:hover {
  background: rgba(255,255,255,0.12);
  transform: translateY(-1px);
}
.liquid-badge.liquid-t1:hover { background: rgba(255,80,80,0.32);  box-shadow: inset 0 0 0 1px rgba(255,80,80,0.75),  0 0 10px rgba(255,80,80,0.35); }
.liquid-badge.liquid-t2:hover { background: rgba(255,140,40,0.34); box-shadow: inset 0 0 0 1px rgba(255,140,40,0.80), 0 0 10px rgba(255,140,40,0.40); }
.liquid-badge.liquid-t3:hover { background: rgba(255,213,74,0.36); box-shadow: inset 0 0 0 1px rgba(255,213,74,0.85), 0 0 12px rgba(255,213,74,0.45); }
.liquid-badge.liquid-t4:hover { background: rgba(120,220,90,0.36); box-shadow: inset 0 0 0 1px rgba(120,220,90,0.85), 0 0 12px rgba(120,220,90,0.45); }
.liquid-badge.liquid-t5:hover { background: rgba(60,200,200,0.40); box-shadow: inset 0 0 0 1px rgba(60,200,200,0.95), 0 0 12px rgba(60,200,200,0.55); }
.liquid-badge.liquid-t6:hover { box-shadow: 0 0 16px rgba(111,77,255,0.85), inset 0 0 0 1px rgba(255,255,255,0.45); }

/* Liquidity tooltip (lightning-bolt hover card) — portal, same pattern as
   `.info-tip-portal`. Color of the accent bar / title matches the tier. */
.liq-tip-portal {
  position: fixed;
  transform: translateX(-50%) translateY(-4px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 240px;
  padding: 12px 14px 11px;
  background: linear-gradient(180deg, #161620 0%, #11111a 100%);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: 0 14px 38px rgba(0,0,0,0.6), 0 0 0 1px rgba(0,0,0,0.6);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  text-align: left;
  color: var(--text);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.14s ease, transform 0.14s ease;
  overflow: hidden;
}
.liq-tip-portal.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.liq-tip-portal::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -6px;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: #161620;
  border-left: 1px solid var(--border-strong);
  border-top: 1px solid var(--border-strong);
}
/* Top accent bar — colored to match the tier badge */
.liq-tip-portal::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--liq-accent, rgba(255,255,255,0.25));
  box-shadow: 0 0 12px var(--liq-glow, rgba(255,255,255,0.25));
}
.liq-tip-t0 { --liq-accent: #6a7480;                                       --liq-glow: rgba(120,130,145,0.45); }
.liq-tip-t1 { --liq-accent: #ff7a7a;                                       --liq-glow: rgba(255,80,80,0.55); }
.liq-tip-t2 { --liq-accent: #ffb060;                                       --liq-glow: rgba(255,140,40,0.55); }
.liq-tip-t3 { --liq-accent: #ffd54a;                                       --liq-glow: rgba(255,213,74,0.55); }
.liq-tip-t4 { --liq-accent: #9ee870;                                       --liq-glow: rgba(120,220,90,0.55); }
.liq-tip-t5 { --liq-accent: #5ee3df;                                       --liq-glow: rgba(60,200,200,0.60); }
.liq-tip-t6 { --liq-accent: linear-gradient(90deg, #6f4dff, #2bc9ff);      --liq-glow: rgba(111,77,255,0.70); }

.liq-tip .liq-tip-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.liq-tip .liq-tip-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: #8a96a3;
  font-weight: 700;
}
.liq-tip .liq-tip-tier {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--liq-accent, #e6edf5);
  /* gradient text fallback for t6 */
  background: var(--liq-accent);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: right;
  max-width: 60%;
}
.liq-tip-t0 .liq-tip-tier,
.liq-tip-t1 .liq-tip-tier,
.liq-tip-t2 .liq-tip-tier,
.liq-tip-t3 .liq-tip-tier,
.liq-tip-t4 .liq-tip-tier,
.liq-tip-t5 .liq-tip-tier {
  background: none;
  -webkit-text-fill-color: currentColor;
  color: var(--liq-accent);
}
.liq-tip .liq-tip-figure {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.liq-tip .liq-tip-unit {
  font-size: 11px;
  font-weight: 600;
  color: #8a96a3;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 4px;
}
.liq-tip .liq-tip-sub {
  font-size: 11px;
  color: #b9c4d1;
  line-height: 1.4;
  margin-top: -2px;
}
.liq-tip .liq-tip-scale {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 0 2px;
}
.liq-tip .liq-dot {
  flex: 1 1 0;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.06);
  transition: background 0.15s ease;
}
.liq-tip .liq-dot-on.liq-dot-t0 { background: #6a7480; }
.liq-tip .liq-dot-on.liq-dot-t1 { background: #ff7a7a; }
.liq-tip .liq-dot-on.liq-dot-t2 { background: #ffb060; }
.liq-tip .liq-dot-on.liq-dot-t3 { background: #ffd54a; }
.liq-tip .liq-dot-on.liq-dot-t4 { background: #9ee870; }
.liq-tip .liq-dot-on.liq-dot-t5 { background: #5ee3df; }
.liq-tip .liq-dot-on.liq-dot-t6 { background: linear-gradient(90deg, #6f4dff, #2bc9ff); box-shadow: 0 0 6px rgba(111,77,255,0.55); }
.liq-tip .liq-tip-foot {
  font-size: 10px;
  color: #6f7d8c;
  line-height: 1.45;
  padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.card .name .rare-badge[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  transform: translateX(-50%);
  background: #0f1620;
  color: #e6edf5;
  border: 1px solid rgba(43,142,247,0.45);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.45;
  white-space: pre-line;
  text-align: left;
  min-width: 180px;
  max-width: 280px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.45), 0 0 0 1px rgba(0,0,0,0.6);
  z-index: 50;
  pointer-events: none;
}
.card .name .rare-badge[data-tip]:hover::before {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(100% + 2px);
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: rgba(43,142,247,0.45);
  z-index: 50;
  pointer-events: none;
}
.card .stat { display: flex; flex-direction: column; gap: 3px; min-width: 0; position: relative; }
.card .stat .lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; white-space: nowrap; }
.card .stat .val { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.card .stat .info-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(43,142,247,0.18);
  color: #6ab4ff;
  border: 1px solid rgba(43,142,247,0.55);
  font-size: 10px;
  font-weight: 700;
  font-style: italic;
  font-family: inherit;
  letter-spacing: 0;
  text-transform: none;
  margin-left: 5px;
  vertical-align: -2px;
  cursor: help;
  line-height: 1;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
  /* Don't create a stacking context — tooltip lives on .stat instead */
  position: static;
}
.card .stat .info-badge:hover {
  background: rgba(43,142,247,0.35);
  border-color: rgba(43,142,247,0.95);
  transform: scale(1.1);
}

/* Structured tooltip card — rendered as a portal directly in document.body
   so it escapes the feed card's stacking context and can paint above sibling
   cards in the list. Position is set by JS via getBoundingClientRect. */
.info-tip-portal {
  position: fixed;
  transform: translateX(-50%) translateY(-4px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 280px;
  padding: 12px 14px;
  background: #14141d;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.55), 0 0 0 1px rgba(0,0,0,0.6);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0;
  text-align: left;
  color: var(--text);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s, transform 0.12s;
}
.info-tip-portal.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
/* Triangle pointer above the tooltip */
.info-tip-portal::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -6px;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: #14141d;
  border-left: 1px solid var(--border-strong);
  border-top: 1px solid var(--border-strong);
}

.info-tip .tip-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.info-tip .tip-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #6ab4ff;
  font-weight: 700;
}
.info-tip .tip-final {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.info-tip .tip-source {
  font-size: 11px;
  color: #b9c4d1;
  line-height: 1.4;
}
.info-tip .tip-section-lbl {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: #6f7d8c;
  font-weight: 700;
  margin-top: 2px;
}
.info-tip .tip-section-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}
.info-tip .tip-section-row .tip-section-lbl { margin-top: 0; }
.info-tip .tip-section-meta {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6fdf9f;
  background: rgba(60,200,120,0.10);
  border: 1px solid rgba(60,200,120,0.30);
  border-radius: 10px;
  padding: 2px 7px;
  font-variant-numeric: tabular-nums;
}
.info-tip .tip-section-meta-thin {
  color: #ffc878;
  background: rgba(255,180,80,0.10);
  border-color: rgba(255,180,80,0.30);
}
.info-tip .tip-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 8px;
}
.info-tip .tip-cell {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  padding: 3px 7px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 4px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.info-tip .tip-cell-active {
  background: rgba(43,142,247,0.15);
  border-color: rgba(43,142,247,0.45);
}
.info-tip .tip-k {
  color: #8a96a3;
  text-transform: uppercase;
  font-size: 9px;
  letter-spacing: 0.5px;
}
.info-tip .tip-v {
  color: #e6edf5;
  font-weight: 600;
}
.info-tip .tip-cell-active .tip-v {
  color: #cfe3ff;
}
.info-tip .tip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11px;
}
.info-tip .tip-row-val {
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.info-tip .tip-tag {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(60,200,120,0.15);
  color: #6fdf9f;
  border: 1px solid rgba(60,200,120,0.35);
  font-weight: 600;
}
.info-tip .tip-tag-soft {
  background: rgba(255,180,80,0.12);
  color: #ffc878;
  border-color: rgba(255,180,80,0.35);
}
.info-tip .tip-gap {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.info-tip .tip-gap-pos { color: #6fdf9f; }
.info-tip .tip-gap-neg { color: #ff6f6f; }
.info-tip .tip-chips {
  flex-wrap: wrap;
}
.info-tip .tip-chip {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(43,142,247,0.12);
  border: 1px solid rgba(43,142,247,0.30);
  color: #b9d4ff;
  font-variant-numeric: tabular-nums;
}
.card .profit .val { color: var(--accent); text-shadow: var(--accent-glow); }
.card .profit-pct { color: var(--accent); font-weight: 700; }
.card .pe-quote { gap: 4px; }
.card .pe-quote .val { white-space: normal; overflow: visible; line-height: 1.35; font-size: 12px; }
.card .pe-quote .val .pe-line { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .pe-quote .muted-val { color: var(--muted); font-weight: 500; }
.card .pe-spark { display: flex; align-items: center; gap: 8px; height: 22px; min-width: 0; }
.card .pe-spark svg { display: block; flex: 1 1 auto; min-width: 0; height: 22px; }
.card .pe-spark .spark-pct { font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.card .pe-spark.pe-spark-empty { opacity: 0; }
.card .pe-quote .pe-change { font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }

@keyframes slideIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

/* Portfolio */
.portfolio-section { display: flex; flex-direction: column; min-height: 0; }
.pnl-row { display: flex; gap: 10px; padding: 14px; }
.pnl-card { flex: 1; background: var(--surface-strong); border: 1px solid var(--border); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.pnl-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; }
.pnl-value { font-size: 18px; font-weight: 700; color: var(--accent); }

.heatmap-block { padding: 8px 14px 14px; }
.heatmap-head { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.heatmap-head .muted { color: var(--muted); }
.heatmap-wrap { position: relative; }
#heatmap { width: 100%; height: 64px; display: block; background: var(--surface-strong); border: 1px solid var(--border); border-radius: 8px; cursor: crosshair; }

.tabs { display: flex; padding: 0 14px; gap: 4px; border-bottom: 1px solid var(--border); }
.tab { flex: 1; background: none; border: none; color: var(--muted); padding: 10px 0; font-size: 12px; font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; transition: 0.2s; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-panel { display: none; flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px 14px; min-width: 0; box-sizing: border-box; scrollbar-gutter: stable; }
.tab-panel#tab-calendar { padding: 10px 8px; }
.tab-panel.active { display: block; }
.port-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.port-list li { padding: 8px 10px; background: var(--surface-strong); border: 1px solid var(--border); border-radius: 8px; font-size: 12px; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.port-list .price { color: var(--accent); font-weight: 600; }

/* History summary strip */
.history-summary {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px;
  padding: 8px; margin-bottom: 8px;
  background: var(--surface-strong); border: 1px solid var(--border); border-radius: 8px;
}
.history-summary .hs-cell { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.history-summary .hs-lbl { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.history-summary .hs-val { font-size: 14px; font-weight: 700; color: var(--text); }
.history-summary .hs-val.pos { color: var(--green); }
.history-summary .hs-val.neg { color: var(--red); }

.history-pager {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 10px 0 2px; margin-top: 8px; flex-wrap: wrap;
  border-top: 1px solid var(--border);
}
.history-pager button { padding: 4px 10px; font-size: 12px; }
.history-pager button[disabled] { opacity: 0.4; cursor: not-allowed; }
.history-pager label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.history-pager select {
  padding: 4px 8px; background: var(--surface-strong); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 6px; font-size: 12px;
}
.history-pager #history-indicator {
  min-width: 52px; text-align: center; font-variant-numeric: tabular-nums; font-size: 12px;
}

/* Purchase row (History tab) */
.purchase-row { flex-direction: row; align-items: center; gap: 10px; }
.purchase-row .pr-img { width: 56px; height: 42px; object-fit: contain; flex-shrink: 0; }
.purchase-row .pr-img--placeholder { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; display: inline-block; }
.purchase-row .pr-body { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.purchase-row .pr-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.purchase-row .pr-name { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.purchase-row .pr-pnl { font-weight: 700; font-size: 12px; white-space: nowrap; color: var(--muted); }
.purchase-row .pr-pnl.pos { color: var(--green); }
.purchase-row .pr-pnl.neg { color: var(--red); }
.purchase-row .pr-mid { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 6px; }
.purchase-row .pr-cell { display: flex; flex-direction: column; gap: 2px; padding: 4px 6px; background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 6px; min-width: 0; }
.purchase-row .pr-lbl { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.purchase-row .pr-val { font-size: 12px; font-weight: 600; }
.purchase-row .pr-expected { position: relative; }
.purchase-row .pr-input {
  background: transparent; border: none; color: var(--accent); font-weight: 600;
  font-size: 12px; padding: 0; width: 100%; outline: none; font-family: inherit;
}
.purchase-row .pr-input:focus { color: var(--accent-strong); }
.purchase-row .pr-input::-webkit-outer-spin-button,
.purchase-row .pr-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.purchase-row .pr-clear {
  position: absolute; top: 2px; right: 4px; background: none; border: none;
  color: var(--muted); cursor: pointer; font-size: 12px; line-height: 1; padding: 2px 4px;
}
.purchase-row .pr-clear:hover { color: var(--red); }
.purchase-row .pr-unlock.locked .pr-val { color: var(--accent); }
.purchase-row .pr-unlock.unlocked .pr-val { color: var(--green); }
.purchase-row .pr-sold { color: var(--green); font-size: 12px; font-weight: 600; }
.purchase-row .pr-delta { font-size: 9px; font-weight: 600; margin-top: 1px; color: var(--muted); }
.purchase-row .pr-delta.pos { color: var(--green); }
.purchase-row .pr-delta.neg { color: var(--red); }
.purchase-row--sold .pr-expected { background: rgba(76, 175, 80, 0.06); }

/* Modal */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px;
}
.modal.hidden { display: none; }
.modal-card { padding: 22px 24px; min-width: 360px; max-width: 480px; }
.modal-card h3 { margin: 0 0 14px; }
.modal-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; color: var(--muted); }
.modal-row strong { color: var(--text); max-width: 60%; text-align: right; word-break: break-all; }
.modal-card label { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; font-size: 12px; color: var(--muted); }
.modal-card input { padding: 10px; background: var(--surface-strong); color: var(--text); border: 1px solid var(--border-strong); border-radius: 8px; font-size: 14px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }
.buy-result { margin-top: 12px; font-size: 12px; min-height: 16px; }
.buy-result.ok { color: var(--green); }
.buy-result.err { color: var(--red); }

/* PNL tab ------------------------------------------------------------------ */
.pnl-tab { display: flex; flex-direction: column; gap: 12px; }

.pnl-headline {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  background: var(--surface-strong); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px;
}
.pnl-hero { display: flex; flex-direction: column; gap: 2px; }
.pnl-hero-lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; }
.pnl-hero-val { font-size: 26px; font-weight: 800; color: var(--text); line-height: 1.1; }
.pnl-hero-val.pos { color: var(--green); text-shadow: 0 0 14px rgba(61,220,132,0.35); }
.pnl-hero-val.neg { color: var(--red); text-shadow: 0 0 14px rgba(255,85,119,0.35); }
.pnl-hero-sub { font-size: 11px; }
.pnl-hero-split { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; justify-content: center; }
.pnl-hero-split > div { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.pnl-hero-split span { font-size: 9px; text-transform: uppercase; letter-spacing: 0.5px; }
.pnl-hero-split strong { font-size: 14px; font-weight: 700; color: var(--text); }
.pnl-hero-split strong.pos { color: var(--green); }
.pnl-hero-split strong.neg { color: var(--red); }

.pnl-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
}
.pnl-stat {
  background: var(--surface-strong); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px;
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.pnl-stat-lbl { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.pnl-stat-val { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pnl-stat-val.pos { color: var(--green); }
.pnl-stat-val.neg { color: var(--red); }

.pnl-superlatives { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pnl-super {
  background: var(--surface-strong); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 3px;
  position: relative; overflow: hidden;
}
.pnl-super.big-win { border-color: rgba(61, 220, 132, 0.35); }
.pnl-super.big-win::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(60% 80% at 0% 0%, rgba(61,220,132,0.15), transparent 70%);
  pointer-events: none;
}
.pnl-super.big-loss { border-color: rgba(255, 85, 119, 0.35); }
.pnl-super.big-loss::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(60% 80% at 0% 0%, rgba(255,85,119,0.15), transparent 70%);
  pointer-events: none;
}
.pnl-super-lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; position: relative; }
.pnl-super-name { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; }
.pnl-super-val { font-size: 18px; font-weight: 800; position: relative; }
.pnl-super-val.pos { color: var(--green); }
.pnl-super-val.neg { color: var(--red); }
.pnl-super-meta { font-size: 10px; position: relative; }

.pnl-chart-block {
  background: var(--surface-strong); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px;
}
.pnl-chart-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; color: var(--muted); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
#pnlt-chart { width: 100%; height: 180px; display: block; cursor: crosshair; }
#pnlt-bars { width: 100%; height: 120px; display: block; cursor: crosshair; }
.chart-overlay { pointer-events: none; }
.chart-tooltip {
  position: absolute; z-index: 20; pointer-events: none;
  min-width: 140px; padding: 8px 10px;
  background: rgba(20, 22, 28, 0.96); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.45);
  font-size: 11px; line-height: 1.35;
  backdrop-filter: blur(6px);
}
.chart-tooltip .cht-date {
  font-size: 10px; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 4px;
}
.chart-tooltip .cht-row {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
}
.chart-tooltip .cht-row b { font-weight: 700; }
.chart-tooltip .cht-row b.pos { color: var(--green); }
.chart-tooltip .cht-row b.neg { color: var(--red); }
.chart-tooltip .cht-sw {
  display: inline-block; width: 8px; height: 8px; border-radius: 2px;
  margin-right: 5px; vertical-align: middle;
}

.pnl-leader { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pnl-leader-col,
.pnl-recent {
  background: var(--surface-strong); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px;
}
.pnl-leader-col h4,
.pnl-recent h4 {
  margin: 0 0 6px; font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600;
}
.pnl-leader-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.pnl-leader-list li {
  display: grid; grid-template-columns: 1fr auto; column-gap: 8px; row-gap: 1px;
  align-items: center; padding: 6px 8px;
  background: rgba(255,255,255,0.02); border: 1px solid var(--border);
  border-radius: 6px; font-size: 11px;
}
.pnl-leader-list li.muted { color: var(--muted); justify-content: center; display: flex; }
.pnl-leader-list .li-name { font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pnl-leader-list .li-pnl { font-weight: 700; text-align: right; grid-row: 1 / span 2; align-self: center; }
.pnl-leader-list .li-pnl.pos { color: var(--green); }
.pnl-leader-list .li-pnl.neg { color: var(--red); }
.pnl-leader-list .li-meta { font-size: 10px; grid-column: 1; }

.pnl-leader-list li.pnl-recent-row,
.pnl-leader-list li.pnl-leader-row {
  grid-template-columns: 40px 1fr auto;
  grid-template-rows: auto;
  column-gap: 12px;
  padding: 8px 10px;
}
.pnl-leader-list .pnl-recent-row .li-img,
.pnl-leader-list .pnl-leader-row .li-img {
  grid-column: 1; grid-row: 1;
  align-self: center; justify-self: center;
  width: 40px; height: 40px; object-fit: contain;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border); border-radius: 4px;
  display: block;
}
.pnl-leader-list .li-img--placeholder { background: rgba(255,255,255,0.02); }
.pnl-leader-list .pnl-recent-row .li-text,
.pnl-leader-list .pnl-leader-row .li-text {
  grid-column: 2; grid-row: 1;
  display: flex; flex-direction: column; gap: 2px;
  min-width: 0; text-align: left;
}
.pnl-leader-list .pnl-recent-row .li-name,
.pnl-leader-list .pnl-leader-row .li-name {
  grid-column: auto; text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pnl-leader-list .pnl-recent-row .li-meta,
.pnl-leader-list .pnl-leader-row .li-meta {
  grid-column: auto; text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pnl-leader-list .pnl-recent-row .li-pnl,
.pnl-leader-list .pnl-leader-row .li-pnl {
  grid-column: 3; grid-row: 1;
  align-self: center;
  font-variant-numeric: tabular-nums;
  min-width: 64px;
}

/* In-tab search row (My stall, History) */
.tab-search-row { margin-bottom: 8px; }
.tab-search-row .search-wrap { width: 100%; }

/* My stall tab */
.stall-summary {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px; padding: 8px 10px; margin-bottom: 8px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border); border-radius: 6px;
}
.stall-summary .ss-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stall-summary .ss-lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.stall-summary .ss-val { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stall-summary .ss-val.pos { color: var(--green); }
.stall-summary .ss-val.neg { color: var(--red); }

.stall-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.stall-list li.stall-row {
  display: grid; grid-template-columns: 44px 1fr;
  gap: 10px; align-items: center;
  padding: 8px 10px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border); border-radius: 6px;
}
.stall-list .sr-img {
  width: 44px; height: 44px; object-fit: contain;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border); border-radius: 4px;
  display: block;
}
.stall-list .sr-img--placeholder { background: rgba(255,255,255,0.02); }
.stall-list .sr-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stall-list .sr-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px 80px;
  column-gap: 8px;
  align-items: center;
}
.stall-list .sr-name {
  font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}
.stall-list .sr-pnl { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.stall-list .sr-pnl.pos { color: var(--green); }
.stall-list .sr-pnl.neg { color: var(--red); }
.stall-list .sr-pnl.muted { color: var(--muted); font-weight: 500; font-size: 11px; }
.stall-list .sr-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
}
.stall-list .sr-cell { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.stall-list .sr-lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.stall-list .sr-val { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stall-list .sr-val.neg { color: var(--red); }
.stall-list .sr-val.warn { color: var(--accent); }

/* Order book trigger button on each stall row */
.stall-list .sr-ob-btn {
  background: transparent; border: 1px solid rgba(255,255,255,0.08);
  color: var(--muted); cursor: pointer;
  width: 22px; height: 22px; border-radius: 5px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; flex-shrink: 0;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.stall-list .sr-ob-btn:hover {
  color: var(--accent); border-color: rgba(255,122,24,0.45);
  background: rgba(255,122,24,0.08);
}

/* Order book popover (portal) */
.ob-tip-portal {
  position: fixed;
  transform: translateX(-50%) translateY(-4px);
  width: 340px;
  background: linear-gradient(180deg, #161620 0%, #11111a 100%);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: 0 14px 38px rgba(0,0,0,0.6), 0 0 0 1px rgba(0,0,0,0.6);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.14s ease, transform 0.14s ease;
  overflow: hidden;
}
.ob-tip-portal.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.ob-tip-portal::before {
  content: "";
  position: absolute; left: 50%; top: -6px;
  transform: translateX(-50%) rotate(45deg);
  width: 10px; height: 10px;
  background: #161620;
  border-left: 1px solid var(--border-strong);
  border-top: 1px solid var(--border-strong);
}
.ob-tip { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.ob-tip-loading { padding: 14px; text-align: center; color: var(--muted); font-size: 12px; }
.ob-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ob-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.7px; color: #b8c0cc; }
.ob-refresh {
  background: transparent; color: var(--muted); border: 1px solid rgba(255,255,255,0.08);
  width: 22px; height: 22px; border-radius: 5px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; line-height: 1;
}
.ob-refresh:hover { color: var(--accent); border-color: rgba(255,122,24,0.45); }
.ob-refresh:disabled { opacity: 0.5; cursor: default; }
.ob-refresh.spin { animation: ob-spin 0.7s linear infinite; }
@keyframes ob-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.ob-meta {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: 11px; color: var(--muted);
  border-bottom: 1px solid rgba(255,255,255,0.06); padding-bottom: 6px;
}
.ob-meta b { color: var(--text); font-variant-numeric: tabular-nums; }
.ob-buy {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; font-variant-numeric: tabular-nums;
}
.ob-bo-price { color: var(--green); font-weight: 700; }
.ob-suggest {
  display: flex; flex-direction: column; gap: 3px;
  padding: 6px 8px; border-radius: 5px;
  background: rgba(255,122,24,0.06);
  border: 1px solid rgba(255,122,24,0.22);
}
.ob-sg-line {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  font-variant-numeric: tabular-nums;
}
.ob-sg-price { color: var(--accent-strong); font-weight: 700; font-size: 14px; }
.ob-sg-diff { font-size: 12px; font-weight: 600; }
.ob-sg-diff.pos { color: var(--green); }
.ob-sg-diff.neg { color: var(--red); }
.ob-sg-diff.muted { color: var(--muted); }
.ob-sg-note { font-size: 10.5px; }
.ob-sg-warn { color: var(--red); font-weight: 600; }
.ob-section-lbl {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--muted); font-weight: 700;
}
.ob-table-wrap { max-height: 260px; overflow-y: auto; }
.ob-table {
  width: 100%; border-collapse: collapse; font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.ob-table thead th {
  position: sticky; top: 0;
  background: #11111a;
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--muted); text-align: left; font-weight: 700;
  padding: 4px 6px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.ob-table tbody td { padding: 3px 6px; border-bottom: 1px solid rgba(255,255,255,0.04); }
.ob-table tbody tr:last-child td { border-bottom: none; }
.ob-table .ob-price { color: var(--text); font-weight: 600; }
.ob-table .ob-float { color: #b8c0cc; }
.ob-table .ob-delta .ob-fd.pos { color: var(--green); }
.ob-table .ob-delta .ob-fd.neg { color: var(--red); }
.ob-table .ob-delta .ob-fd.muted { color: var(--muted); }
.ob-table tr.ob-mine { background: rgba(255,122,24,0.10); }
.ob-table tr.ob-mine td { color: var(--accent-strong); }
.ob-mine-tag {
  display: inline-block; padding: 1px 5px; border-radius: 4px;
  background: rgba(255,122,24,0.25); color: var(--accent-strong);
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
}
.ob-foot { font-size: 11px; padding-top: 4px; border-top: 1px solid rgba(255,255,255,0.06); }
.ob-tip .neg { color: var(--red); }
.ob-tip .muted { color: var(--muted); }

@media (max-width: 1100px) {
  .pnl-grid { grid-template-columns: repeat(2, 1fr); }
  .pnl-headline { grid-template-columns: 1fr; }
  .pnl-hero-split { align-items: flex-start; }
  .pnl-hero-split > div { align-items: flex-start; }
  .pnl-superlatives,
  .pnl-leader { grid-template-columns: 1fr; }
  .stall-summary { grid-template-columns: repeat(2, 1fr); }
  .stall-list .sr-grid { grid-template-columns: repeat(3, 1fr); }
}

/* --- Calendar tab --------------------------------------------------------- */
.cal-toolbar {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
}
.cal-toolbar .btn { padding: 4px 10px; font-size: 12px; }
.cal-title {
  flex: 1; text-align: center;
  font-size: 14px; font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.cal-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 12px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.cs-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cs-lbl { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.cs-val { font-size: 13px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.cs-val.pos { color: var(--green); }
.cs-val.neg { color: var(--red); }

.cal-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
  min-width: 0;
}
.cal-dow {
  text-align: center; padding: 4px 0;
  font-size: 9px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700;
  min-width: 0;
}
.cal-day {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  min-height: 80px;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
  display: flex; flex-direction: column; gap: 3px;
  font-size: 11px; cursor: pointer;
  transition: border-color 0.12s, transform 0.1s;
}
.cal-day:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.cal-day.empty { opacity: 0.35; cursor: default; }
.cal-day.empty:hover { transform: none; border-color: var(--border); }
.cal-day.today { border-color: var(--accent); box-shadow: var(--accent-glow); }
.cal-day.selected { border-color: var(--accent-strong); background: var(--surface-strong); }
.cal-day.outside { opacity: 0.25; }

.cal-date {
  font-size: 11px; font-weight: 700; color: var(--text);
  display: flex; justify-content: space-between; align-items: center;
}
.cal-date-num { font-variant-numeric: tabular-nums; }
.cal-date-net.pos { color: var(--green); font-weight: 700; }
.cal-date-net.neg { color: var(--red); font-weight: 700; }

.cal-row {
  display: flex; justify-content: space-between; gap: 4px;
  font-size: 10px; color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 0;
}
.cal-row .cal-row-lbl { color: var(--muted); flex-shrink: 0; }
.cal-row .cal-row-val { color: var(--text); font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-row.pos .cal-row-val { color: var(--green); }
.cal-row.neg .cal-row-val { color: var(--red); }

.cal-detail {
  margin-top: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.cal-detail-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
  font-weight: 700; color: var(--text);
}
.cal-detail-head .btn { padding: 2px 8px; font-size: 14px; line-height: 1; }
.cal-detail-body {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.cal-detail-section h5 {
  margin: 0 0 6px 0; font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.cal-detail-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 4px;
  max-height: 240px; overflow-y: auto;
}
.cal-detail-list li {
  display: grid; grid-template-columns: 1fr auto auto;
  gap: 8px; align-items: center;
  padding: 4px 6px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 11px;
}
.cal-detail-list li.two-col { grid-template-columns: 1fr auto; }
.cal-detail-list li.muted { background: transparent; border: none; color: var(--muted); }
.cal-detail-list .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.cal-detail-list .price { font-variant-numeric: tabular-nums; color: var(--muted); }
.cal-detail-list .pnl { font-variant-numeric: tabular-nums; font-weight: 700; }
.cal-detail-list .pnl.pos { color: var(--green); }
.cal-detail-list .pnl.neg { color: var(--red); }

@media (max-width: 1100px) {
  .cal-summary { grid-template-columns: repeat(2, 1fr); }
  .cal-detail-body { grid-template-columns: 1fr; }
  .cal-day { min-height: 60px; }
}

@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .card {
    grid-template-columns:
      50px
      minmax(160px, 1.4fr)
      minmax(0, 1fr)
      minmax(160px, 1.2fr)
      minmax(100px, auto)
      auto auto;
  }
  .card .stat:nth-of-type(3), .card .stat:nth-of-type(4) { display: none; }
}

/* AVG 7D personal trade-history badge — small clock icon next to the label.
   Mirrors the .info-badge pattern (a hover affordance inside the .lbl line). */
.history-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px;
  margin-left: 4px;
  color: var(--muted);
  cursor: help;
  vertical-align: middle;
  transition: color 0.15s ease, transform 0.15s ease;
}
.history-badge:hover { color: var(--accent); transform: scale(1.12); }
.history-badge.has-history { color: var(--accent); }

/* History tooltip — wider than info-tip to fit per-row buy/sell pairs. */
.history-tip-portal {
  position: fixed;
  transform: translateX(-50%) translateY(-4px);
  display: flex; flex-direction: column; gap: 8px;
  width: 320px; max-height: 60vh; overflow-y: auto;
  padding: 12px 14px;
  background: #14141d;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.55), 0 0 0 1px rgba(0,0,0,0.6);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease, transform 0.12s ease;
}
.history-tip-portal.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.history-tip-portal::before {
  content: ""; position: absolute; left: 50%; top: -6px;
  transform: translateX(-50%) rotate(45deg);
  width: 10px; height: 10px;
  background: #14141d;
  border-left: 1px solid var(--border-strong);
  border-top: 1px solid var(--border-strong);
}
.history-tip-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.history-tip-title { font-size: 12px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; color: var(--muted); }
.history-tip-count { font-size: 11px; font-weight: 700; color: var(--accent); }
.history-tip-name { font-size: 12px; color: var(--text); opacity: 0.85; word-break: break-word; }
.history-tip-loading, .history-tip-empty { font-size: 12px; color: var(--muted); padding: 8px 0; text-align: center; }
.history-tip-rows { display: flex; flex-direction: column; gap: 8px; }
.history-row {
  display: flex; flex-direction: column; gap: 4px;
  padding: 7px 9px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 7px;
  font-size: 12px;
}
.history-row .hr-buy, .history-row .hr-sale {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.history-row .hr-lbl {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--muted); min-width: 40px;
}
.history-row .hr-float {
  margin-left: auto;
  font-size: 10px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.history-row .hr-pnl { margin-left: auto; font-weight: 700; }
.history-row .hr-pnl.up { color: var(--green); }
.history-row .hr-pnl.down { color: var(--red); }
.history-row .hr-pnl.flat { color: var(--muted); }
.history-row .hr-open { color: var(--muted); font-style: italic; }
.history-tip-foot {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 6px;
  font-size: 11px;
  color: var(--muted);
  display: flex; flex-direction: column; gap: 2px;
}
.history-tip-realized { font-weight: 700; }
.history-tip-realized.up { color: var(--green); }
.history-tip-realized.down { color: var(--red); }
.history-tip-realized.flat { color: var(--muted); }
.history-tip-realized .muted { color: var(--muted); font-weight: 500; }

/* CS2 market-cap hover tooltip (portal) */
.mc-tip-portal {
  position: fixed;
  left: 0; top: 0;
  display: flex; flex-direction: column; gap: 12px;
  width: 280px;
  padding: 14px 14px 12px;
  background: linear-gradient(180deg, #181822 0%, #12121b 100%);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow:
    0 18px 48px rgba(0,0,0,0.55),
    0 0 0 1px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,255,255,0.04);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}
.mc-tip-portal.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.mc-tip-portal::before {
  content: "";
  position: absolute;
  left: var(--mc-arrow-x, 50%);
  top: -6px;
  transform: translateX(-50%) rotate(45deg);
  width: 10px; height: 10px;
  background: #181822;
  border-left: 1px solid var(--border-strong);
  border-top: 1px solid var(--border-strong);
}

.mc-tip-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.mc-tip-title {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.6px; text-transform: uppercase;
  color: var(--muted);
}
.mc-tip-src {
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--accent);
  text-decoration: none;
  opacity: 0.75;
  transition: opacity 0.15s ease;
}
.mc-tip-src:hover { opacity: 1; text-decoration: underline; }

.mc-tip-current {
  display: flex; flex-direction: column; gap: 3px;
  align-items: flex-start;
}
.mc-tip-current-val {
  font-size: 22px; font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.mc-tip-current-sub {
  font-size: 10px; color: var(--muted);
  letter-spacing: 0.3px;
}

.mc-tip-periods {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.mc-tip-period {
  display: flex; flex-direction: column; gap: 3px;
  align-items: center; justify-content: center;
  padding: 7px 4px 6px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 7px;
}
.mc-tip-period-lbl {
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--muted);
}
.mc-tip-period-val {
  font-size: 12px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.mc-tip-period-up   .mc-tip-period-val { color: var(--green); }
.mc-tip-period-down .mc-tip-period-val { color: var(--red); }
.mc-tip-period-flat .mc-tip-period-val { color: var(--muted); }
.mc-tip-period-up   { border-color: rgba(80, 200, 120, 0.18); background: rgba(80, 200, 120, 0.06); }
.mc-tip-period-down { border-color: rgba(220, 80, 80, 0.18);  background: rgba(220, 80, 80, 0.06); }

.mc-tip-ath {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 7px;
}
.mc-tip-ath-row {
  display: flex; align-items: baseline; gap: 8px;
}
.mc-tip-ath-lbl {
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--muted);
}
.mc-tip-ath-val {
  font-size: 13px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.mc-tip-ath-pct {
  margin-left: auto;
  font-size: 11px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.mc-tip-ath-date {
  font-size: 10px; color: var(--muted);
  padding-left: 30px;
}

.mc-tip-foot {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.3px;
  text-align: right;
  opacity: 0.7;
}

.mc-tip-empty { font-size: 12px; color: var(--muted); padding: 8px 0; text-align: center; }

/* -------------------------------------------------------------------------
   Tier gating — Pro-only features get a padlock overlay + upsell tooltip
   when the user is on Starter. Toggle is controlled by body[data-plan].
   Pro users see no overlay; markup with .pro-feature is otherwise inert.
   ------------------------------------------------------------------------- */
.pro-feature { position: relative; }

body[data-plan="starter"] .pro-feature {
  /* Visually fade the gated widget and freeze its controls. Children stay
     visible (so the user still sees what they're missing) but uninteractive. */
  pointer-events: none;
  filter: grayscale(0.6) brightness(0.55);
  user-select: none;
}

body[data-plan="starter"] .pro-feature::before {
  content: "";
  position: absolute; inset: 0;
  background: rgba(10, 10, 14, 0.35);
  border-radius: inherit;
  z-index: 5;
  pointer-events: auto;
  cursor: not-allowed;
}

body[data-plan="starter"] .pro-feature::after {
  content: "🔒 " attr(data-pro-label);
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #ff7a18, #ff9544);
  color: #1b1100;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
  box-shadow: 0 8px 24px rgba(255, 122, 24, 0.35);
  z-index: 6;
  pointer-events: auto;
  cursor: pointer;
  white-space: nowrap;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

body[data-plan="starter"] .pro-feature:hover::after {
  content: "🔒 " attr(data-pro-label) " — Click to upgrade";
}

/* Tall locked sections (e.g. the Trading Journal aside): keep the lock badge
   centered both horizontally and vertically so it sits in the middle of the
   gated card rather than drifting to the top or being lost off-screen. */
body[data-plan="starter"] .portfolio-section.pro-feature::after {
  top: 50%;
  transform: translate(-50%, -50%);
}

/* Pro badge variant for inline lock indicators on signal cards & similar */
.pro-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 122, 24, 0.18), rgba(255, 149, 68, 0.18));
  border: 1px solid rgba(255, 122, 24, 0.45);
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  cursor: help;
}

/* Subtle inline lock for small controls (pill buttons etc.) */
.pro-lock-icon::before {
  content: "🔒 ";
  margin-right: 4px;
}

/* ---- Starter-tier locked-state badges & tooltips ------------------------- */
/* Gray, lifeless variants of the per-card stat badges. Visually different
   from the live colored versions so Starter can tell at a glance that the
   data is gated, without removing the badge entirely. */
.liquid-badge.liquid-locked {
  background: rgba(120, 120, 130, 0.14);
  color: rgba(180, 180, 190, 0.45);
  box-shadow: inset 0 0 0 1px rgba(120, 120, 130, 0.25);
}
.liquid-badge.liquid-locked:hover {
  background: rgba(120, 120, 130, 0.22);
  box-shadow: inset 0 0 0 1px rgba(160, 160, 170, 0.50);
}
.history-badge.locked,
.info-badge.locked {
  opacity: 0.5;
  filter: grayscale(1);
}
.history-badge.locked::after,
.info-badge.locked::after,
.liquid-badge.liquid-locked::after {
  content: "🔒";
  position: absolute;
  bottom: -3px;
  right: -3px;
  font-size: 7px;
  line-height: 1;
  pointer-events: none;
}
.history-badge.locked,
.card .stat .info-badge.locked,
.liquid-badge.liquid-locked { position: relative; }

/* Locked-tooltip portal — shown to Starter on hover of the gated badges. Same
   portal pattern as .info-tip-portal / .liq-tip-portal but with a Pro-CTA. */
.locked-tip-portal {
  position: fixed;
  transform: translate(-50%, 0);
  width: 240px;
  background: linear-gradient(180deg, rgba(28,28,36,0.98), rgba(20,20,26,0.98));
  border: 1px solid rgba(255, 140, 42, 0.45);
  border-radius: 12px;
  padding: 12px 14px 10px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,140,42,0.15);
  z-index: 9999;
  opacity: 0;
  pointer-events: auto;
  transition: opacity 0.12s ease;
  font-size: 12px;
  line-height: 1.45;
  color: #e6e6ec;
}
.locked-tip-portal.show { opacity: 1; }
.locked-tip-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.locked-tip-lock { font-size: 13px; }
.locked-tip-title {
  font-weight: 700;
  font-size: 12px;
  color: #ff9544;
  letter-spacing: 0.01em;
}
.locked-tip-body {
  color: #b8b8c0;
  font-size: 11.5px;
  margin-bottom: 10px;
}
.locked-tip-cta {
  display: block;
  text-align: center;
  background: linear-gradient(135deg, #ff7a18, #ff9544);
  color: #0a0a0f;
  font-weight: 700;
  font-size: 11.5px;
  padding: 6px 10px;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(255, 122, 24, 0.35);
}
.locked-tip-cta:hover { filter: brightness(1.08); }

/* Per-card "2-sec delay" reminder shown only on Starter — sits inline in the
   <small> meta line next to "Float / seen / Compare". */
.starter-delay-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  color: #ff9544;
  text-decoration: none;
  font-weight: 600;
  padding: 2px 8px;
  margin-top: 4px;
  border-radius: 6px;
  background: rgba(255, 140, 42, 0.10);
  border: 1px solid rgba(255, 140, 42, 0.25);
  font-size: 11px;
  letter-spacing: 0.01em;
  transition: background 0.15s, border-color 0.15s;
}
.starter-delay-chip:hover {
  background: rgba(255, 140, 42, 0.20);
  border-color: rgba(255, 140, 42, 0.50);
}
