:root {
  --ink: #142033;
  --muted: #5c6b82;
  --faint: #8b98ad;
  --line: rgba(28, 63, 120, 0.1);
  --card: rgba(255, 255, 255, 0.92);
  --green: #0fbe78;
  --green-deep: #079a62;
  --red: #ff4d6a;
  --blue: #2f7bff;
  --sky: #e7f4ff;
  --shadow: 0 12px 40px rgba(47, 123, 255, 0.08);
  --sidebar: 248px;
  --radius: 18px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px 380px at 0% -10%, #ffe9a8 0%, transparent 55%),
    radial-gradient(820px 460px at 100% -8%, #c9ecff 0%, transparent 52%),
    radial-gradient(700px 420px at 90% 110%, #d9ffe8 0%, transparent 50%),
    #f4fbff;
}
button, input, a { font: inherit; color: inherit; }
button { cursor: pointer; }
a { text-decoration: none; }
svg { display: block; }
[hidden] { display: none !important; }

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px 16px;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.72);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(16px);
  z-index: 20;
}
.sidebar.collapsed { width: 84px; flex-basis: 84px; }
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .profile-copy { display: none; }
.sidebar.collapsed .collapse-btn svg { transform: rotate(180deg); }

.side-top { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 18px; }
.brand-mark, .profile-avatar, .paid-logo, .token-logo {
  display: grid;
  place-items: center;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(160deg, #3ee0a2, #1492ff);
  color: white;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(20, 146, 255, 0.28);
}
.icon-btn {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  display: grid;
  place-items: center;
}
.icon-btn:hover, .mini-icon:hover { background: #fff; }

.side-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--muted);
  font-weight: 600;
  font-size: 15px;
}
.nav-link svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.nav-link:hover { background: rgba(255, 255, 255, 0.8); color: var(--ink); }
.nav-link.active { color: var(--ink); background: white; box-shadow: 0 6px 16px rgba(47, 123, 255, 0.08); }

.profile {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
}
.profile:hover { background: white; }
.profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #111827;
  color: white;
  font-weight: 800;
  font-size: 14px;
}
.profile-copy { display: flex; flex-direction: column; min-width: 0; }
.profile-copy strong { font-size: 14px; }
.profile-copy span, .ticker, .meta-row, .sub, .fine, .ohlc span { color: var(--muted); }

.workspace { flex: 1; min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 22px;
  background: rgba(244, 251, 255, 0.8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
}
.menu-btn { display: none; }
.search-wrap { flex: 1; display: flex; justify-content: center; position: relative; }
.search {
  width: min(560px, 100%);
  height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px 0 16px;
  border-radius: 999px;
  background: white;
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(47, 123, 255, 0.06);
}
.search svg { width: 16px; height: 16px; fill: var(--faint); }
.search input {
  border: 0;
  outline: none;
  width: 100%;
  background: transparent;
}
.search-results {
  position: absolute;
  top: 50px;
  width: min(560px, calc(100% - 8px));
  background: white;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 30;
}
.search-results button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 10px 12px;
}
.search-results button:hover { background: var(--sky); }
.search-results small { display: block; color: var(--muted); }

.top-actions { display: flex; gap: 8px; margin-left: auto; }
.btn {
  border-radius: 999px;
  padding: 9px 16px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 700;
}
.btn-solid { background: #142033; color: white; }
.btn-solid:hover { background: #24344d; }
.btn-ghost { background: white; border-color: var(--line); }
.btn-ghost:hover { border-color: #b9d7ff; }
.wide { width: 100%; display: inline-flex; justify-content: center; margin-top: 8px; }

main { width: min(1080px, calc(100% - 40px)); margin: 0 auto; padding: 22px 0 48px; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.back-link:hover { color: var(--ink); }
.retry {
  display: block;
  margin: 8px auto 18px;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.stat-card, .next-card { padding: 16px 18px; }
.stat-card {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
}
.card-hit { position: absolute; inset: 0; border-radius: inherit; z-index: 1; }
.token-id, .name-row, .meta-row, .who, .tabs, .socials { display: flex; align-items: center; }
.token-id { gap: 12px; position: relative; z-index: 2; }
.token-logo { position: relative; width: 52px; height: 52px; }
.token-logo img, .bubble img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
  display: block;
}
.token-logo.sm { width: 42px; height: 42px; }
.token-logo.sm img { border-radius: 12px; }
.bubble {
  width: 32px;
  height: 32px;
  overflow: hidden;
  border-radius: 10px;
  background: #111;
}
.live-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid white;
}
.paid-logo {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #111827;
  color: white;
  font-weight: 800;
  font-size: 26px;
}
.check {
  position: absolute;
  right: -4px;
  bottom: -2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  font-size: 10px;
  display: grid;
  place-items: center;
  border: 2px solid white;
}
.name-row { gap: 8px; }
.name-row h1, .name-row h2, .page-title { margin: 0; font-size: 18px; letter-spacing: -0.03em; }
.ticker { font-size: 14px; }
.mini-icon, .meta-row a, .x-link {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 2px;
  border-radius: 8px;
  position: relative;
  z-index: 2;
}
.meta-row { gap: 8px; margin-top: 4px; font-size: 13px; font-weight: 600; }
.meta-row svg, .x-link svg { fill: currentColor; }
.stat-value { text-align: right; position: relative; z-index: 2; }
.stat-value strong { font-size: 28px; letter-spacing: -0.04em; }
.stat-value span { display: block; color: var(--faint); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; }

.next-card { margin-top: 14px; }
.next-card h2 { font-size: 16px; margin: 0 0 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.x-word { font-weight: 800; }
.for { color: var(--muted); font-weight: 500; }
.who { gap: 6px; color: var(--muted); font-weight: 600; }
.who-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, #8eb7ff 40%, #111827 42%);
}
.next-card p { margin: 0; color: var(--muted); font-size: 14px; }

.chart-card { margin-top: 14px; padding: 14px 14px 8px; }
.timeframes { display: flex; gap: 4px; }
.timeframes button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  border-radius: 999px;
  padding: 6px 10px;
}
.timeframes button.on { background: #142033; color: white; }
.ohlc { margin: 10px 6px 4px; font-size: 12px; font-weight: 700; }
.ohlc span { font-weight: 600; margin-left: 8px; }
.ohlc .down { color: var(--red); }
.ohlc .up { color: var(--green-deep); }
.chart-frame { position: relative; height: 380px; }
canvas { width: 100%; height: 100%; display: block; }
.tip {
  position: absolute;
  pointer-events: none;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 12px;
  box-shadow: var(--shadow);
  white-space: nowrap;
}

.tabs { gap: 8px; margin: 18px 0 12px; }
.tab {
  border: 1px solid var(--line);
  background: white;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 14px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tab svg { fill: currentColor; }
.tab.on { background: #142033; color: white; border-color: #142033; }
.empty {
  border: 1px dashed rgba(28, 63, 120, 0.16);
  border-radius: var(--radius);
  min-height: 150px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 28px;
  background: rgba(255, 255, 255, 0.45);
}
.empty p { margin: 0; font-weight: 700; }
.empty .sub { font-weight: 500; margin-top: 6px; }

.claims { display: flex; flex-direction: column; gap: 8px; }
.claim {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: white;
  border: 1px solid var(--line);
}
.claim:hover { border-color: #b9d7ff; box-shadow: var(--shadow); }
.claim b { font-size: 17px; }
.claim b span, .claim-time { color: var(--muted); font-weight: 600; font-size: 13px; }
.claim small { display: block; color: var(--faint); font-size: 11px; }
.claim-mid { display: flex; justify-content: center; align-items: center; gap: 8px; }
.pump {
  width: 26px;
  height: 16px;
  border-radius: 999px;
  border: 1.5px solid var(--green);
  transform: rotate(-35deg);
}
.sol {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #14f195, #9945ff);
  color: white;
  font-size: 11px;
  font-weight: 800;
}

.page-title { font-size: 28px; margin: 8px 0 8px; letter-spacing: -0.04em; }
.lede { color: var(--muted); max-width: 62ch; }
.token-row {
  width: min(640px, 100%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: white;
  text-align: left;
}
.token-row span span, .token-row small { display: block; color: var(--muted); font-weight: 600; font-size: 12px; }
.token-row b { margin-left: auto; font-size: 18px; }

.footer {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 24px;
}
.footer h3 { margin: 0 0 10px; font-size: 14px; }
.footer a, .footer p { display: block; color: var(--muted); font-size: 14px; margin: 6px 0; }
.footer a:hover { color: var(--ink); }
.socials { gap: 10px; margin: 10px 0; }
.socials a {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: white;
  border: 1px solid var(--line);
}
.socials svg { fill: var(--ink); }
.fine { font-size: 12px !important; }

.modal {
  border: 0;
  border-radius: 20px;
  padding: 22px;
  width: min(420px, calc(100% - 32px));
  box-shadow: 0 24px 80px rgba(20, 32, 51, 0.18);
}
.modal::backdrop { background: rgba(20, 40, 70, 0.28); }
.modal h2 { margin: 0 0 8px; }
.modal p { color: var(--muted); margin: 0 0 12px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(12px);
  background: #142033;
  color: white;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.scrim { position: fixed; inset: 0; background: rgba(20, 40, 70, 0.28); z-index: 18; }

@media (max-width: 980px) {
  .sidebar {
    position: fixed;
    left: 0;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    background: rgba(255, 255, 255, 0.96);
  }
  .sidebar.open { transform: none; }
  .menu-btn { display: grid; }
  .collapse-btn { display: none; }
  .stat-grid, .footer { grid-template-columns: 1fr; }
  .stat-value strong { font-size: 22px; }
  .chart-frame { height: 280px; }
  .claim { grid-template-columns: 1fr auto; }
  .claim-mid { display: none; }
  .top-actions .btn-ghost { display: none; }
  main { width: min(1080px, calc(100% - 28px)); }
}
