:root {
  color-scheme: dark;
  --bg: #090b0d;
  --bg-soft: #0d1012;
  --panel: rgba(17,20,22,.82);
  --panel-solid: #111416;
  --text: #f5f7f8;
  --muted: #8b9298;
  --muted-2: #555d63;
  --border: rgba(255,255,255,.085);
  --border-strong: rgba(255,255,255,.12);
  --bnb: #f3ba2f;
  --up: #a8ff78;
  --down: #ff6675;
  --signal: #a8ff78;
  --radius: 27px;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  background:
    radial-gradient(75% 48% at 50% -12%, rgba(255,255,255,.055), transparent 68%),
    radial-gradient(55% 28% at 88% 40%, rgba(168,255,120,.025), transparent 70%),
    var(--bg);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

.app-shell {
  width: min(100%, 660px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 16px max(30px, env(safe-area-inset-bottom));
}

.topbar {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 27px;
  padding: 0 3px;
}
.brand { display: inline-flex; align-items: center; gap: 13px; }
.brand-mark {
  width: 35px;
  height: 24px;
  overflow: visible;
}
.brand-mark path {
  fill: none;
  stroke: var(--up);
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 8px rgba(168,255,120,.2));
}
.brand-word {
  font-size: 16px;
  font-weight: 520;
  letter-spacing: .34em;
  padding-left: .06em;
}
.chain-pill {
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.024);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #aeb4b8;
  font-weight: 650;
  font-size: 10px;
  letter-spacing: .09em;
}
.chain-pill svg { width: 13px; height: 13px; fill: var(--bnb); }

.search-wrap { margin-bottom: 26px; }
.search-box {
  min-height: 62px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,.047), rgba(255,255,255,.027));
  border: 1px solid rgba(255,255,255,.09);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.022), 0 14px 38px rgba(0,0,0,.16);
  display: flex;
  align-items: center;
  padding: 6px 6px 6px 16px;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.search-box:focus-within {
  border-color: rgba(168,255,120,.24);
  background: linear-gradient(180deg, rgba(255,255,255,.057), rgba(255,255,255,.035));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.028), 0 16px 42px rgba(0,0,0,.2), 0 0 0 3px rgba(168,255,120,.025);
}
.search-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin-right: 11px;
  fill: none;
  stroke: #6a7278;
  stroke-width: 1.55;
  stroke-linecap: round;
}
.search-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  letter-spacing: -.005em;
}
.search-box input::placeholder { color: #626a70; }
.search-btn {
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 15px;
  background: rgba(255,255,255,.055);
  color: #e4e7e9;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
  transition: transform .15s ease, background .18s ease, opacity .15s ease;
}
.search-btn:hover { background: rgba(255,255,255,.08); }
.search-btn:active { transform: scale(.965); }
.search-btn:disabled { opacity: .4; cursor: default; }
.search-btn svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.search-hint { margin: 9px 5px 0; font-size: 9px; color: #4e565c; letter-spacing: .08em; text-transform: uppercase; }

.empty-state { padding: 12vh 8px 0; text-align: center; color: var(--muted-2); }
.empty-line { height: 132px; opacity: .72; }
.empty-line svg { width: 100%; height: 100%; overflow: visible; }
.empty-line path { fill: none; stroke: url(#emptyStroke); stroke-width: 1.8; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.empty-state p { margin: 26px 0 0; font-size: 11px; letter-spacing: .08em; color: #4f575d; }

.asset-card {
  --signal: var(--up);
  position: relative;
  overflow: hidden;
  padding: 25px 22px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    radial-gradient(95% 70% at 92% 32%, color-mix(in srgb, var(--signal) 5%, transparent), transparent 62%),
    linear-gradient(180deg, rgba(18,22,24,.91), rgba(13,16,18,.94));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.035),
    0 22px 70px rgba(0,0,0,.2);
  animation: reveal .3s cubic-bezier(.2,.8,.2,1) both;
}
.asset-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(125deg, rgba(255,255,255,.018), transparent 35%);
}
.asset-card.trend-down { --signal: var(--down); }
.asset-card.trend-neutral { --signal: #dce1e4; }
@keyframes reveal { from { opacity: 0; transform: translateY(5px) scale(.997); } to { opacity: 1; transform: none; } }

.token-head { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.token-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.token-avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #0a0c0e;
  border: 1px solid rgba(255,255,255,.09);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 8px 20px rgba(0,0,0,.18);
  font-weight: 760;
  font-size: 13px;
  overflow: hidden;
}
.token-avatar img { width: 100%; height: 100%; object-fit: cover; }
.token-title-wrap { min-width: 0; }
.token-title-row { display: flex; align-items: baseline; gap: 6px; }
.token-title-row h1 { margin: 0; font-size: 17px; line-height: 1.05; font-weight: 620; letter-spacing: -.015em; }
.pair-label { font-size: 10px; color: #646c72; font-weight: 550; }
.token-sub-row { margin-top: 7px; display: flex; gap: 7px; align-items: center; min-width: 0; font-size: 9px; color: #686f75; }
.chain-inline { display: inline-flex; align-items: center; gap: 5px; color: #8d9499; font-weight: 600; }
.chain-inline svg { width: 11px; height: 11px; fill: var(--bnb); }
.dot-separator { color: #3f464b; }
#tokenName { max-width: 126px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contract-chip { border: 0; padding: 0; color: #50585e; background: transparent; cursor: pointer; font-size: 9px; }
.contract-chip:hover { color: #92999e; }
.icon-btn {
  width: 39px;
  height: 39px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
}
.icon-btn:hover { background: rgba(255,255,255,.03); border-color: rgba(255,255,255,.055); }
.icon-btn svg { width: 19px; fill: none; stroke: #676f75; stroke-width: 1.55; stroke-linejoin: round; transition: .18s ease; }
.icon-btn.saved svg { fill: var(--bnb); stroke: var(--bnb); }

.price-block { position: relative; z-index: 2; margin-top: 29px; }
.price {
  font-size: clamp(39px, 11vw, 60px);
  font-weight: 470;
  line-height: .98;
  letter-spacing: -.055em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 14px rgba(255,255,255,.025);
  overflow-wrap: anywhere;
}
.change-row { display: flex; align-items: center; gap: 7px; margin-top: 12px; font-size: 14px; font-weight: 570; font-variant-numeric: tabular-nums; }
.change.up { color: var(--up); }
.change.down { color: var(--down); }
.change.neutral { color: #a0a6aa; }
.change-period { color: #555d63; font-size: 10px; font-weight: 630; letter-spacing: .05em; }

.chart-wrap {
  position: relative;
  height: clamp(250px, 46vh, 355px);
  margin: 12px -12px 0;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-drag: none;
}
.chart-wrap,
.chart-wrap * {
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
  -webkit-user-drag: none;
}
#chart { display: block; width: 100%; height: 100%; overflow: visible; }
.chart-area { fill: url(#chartFill); pointer-events: none; }
.chart-path {
  fill: none;
  stroke: var(--signal);
  stroke-width: 2.05;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: url(#lineGlow);
  transition: stroke .2s ease;
}
.crosshair { stroke: rgba(255,255,255,.11); stroke-width: 1; stroke-dasharray: 3 7; }
.chart-dot { fill: var(--panel-solid); stroke: var(--signal); stroke-width: 2; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--signal) 55%, transparent)); }
.chart-tooltip {
  position: absolute;
  top: 10px;
  left: 8px;
  pointer-events: none;
  background: rgba(8,10,11,.84);
  border: 1px solid rgba(255,255,255,.085);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  gap: 8px;
  align-items: baseline;
  box-shadow: 0 9px 24px rgba(0,0,0,.18);
  font-variant-numeric: tabular-nums;
}
.chart-tooltip strong { font-size: 11px; font-weight: 650; }
.chart-tooltip span { font-size: 9px; color: var(--muted); }
.chart-loader { position: absolute; inset: 0; display: grid; place-items: center; z-index: 3; background: rgba(11,14,16,.32); }
.chart-loader span { width: 23px; height: 23px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.11); border-top-color: var(--signal); animation: spin .72s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.chart-error { position: absolute; inset: 0; display: grid; place-items: center; color: #656d73; font-size: 11px; }

.periods {
  position: relative;
  z-index: 2;
  height: 46px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  align-items: center;
  margin: -3px -5px 0;
}
.periods button {
  border: 0;
  background: transparent;
  color: #666d73;
  font-size: 10px;
  font-weight: 600;
  height: 100%;
  cursor: pointer;
  position: relative;
  transition: color .18s ease;
}
.periods button:hover { color: #a9afb3; }
.periods button.active { color: var(--signal); }
.periods button.active::after {
  content: "";
  position: absolute;
  bottom: 3px;
  left: 38%;
  right: 38%;
  height: 1.5px;
  border-radius: 99px;
  background: var(--signal);
  box-shadow: 0 0 7px color-mix(in srgb, var(--signal) 45%, transparent);
}

.card-footer {
  position: relative;
  z-index: 2;
  margin: 7px -22px -2px;
  padding: 20px 22px 2px;
  border-top: 1px solid rgba(255,255,255,.064);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.metric { min-width: 92px; }
.metric span { display: block; color: #71787e; font-size: 10px; letter-spacing: .02em; }
.metric strong { display: block; margin-top: 5px; font-size: 21px; line-height: 1; font-weight: 520; letter-spacing: -.025em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.footer-actions { display: flex; align-items: center; gap: 8px; }
.footer-actions a {
  height: 38px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 12px;
  background: rgba(255,255,255,.022);
  color: #b8bdc1;
  font-size: 10px;
  font-weight: 560;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.footer-actions a:hover { background: rgba(255,255,255,.045); border-color: rgba(255,255,255,.11); color: #f0f2f3; }
#buyLink { border-color: color-mix(in srgb, var(--signal) 24%, rgba(255,255,255,.075)); background: color-mix(in srgb, var(--signal) 6%, rgba(255,255,255,.022)); color: color-mix(in srgb, var(--signal) 72%, #dfe4e1); }
#buyLink:hover { border-color: color-mix(in srgb, var(--signal) 38%, rgba(255,255,255,.11)); background: color-mix(in srgb, var(--signal) 10%, rgba(255,255,255,.035)); color: #f3fff0; }
.footer-actions svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.45; stroke-linecap: round; stroke-linejoin: round; }
.footer-actions .external { width: 11px; height: 11px; color: #666e74; }
.updated-at { position: relative; z-index: 2; text-align: right; margin-top: 11px; color: #41484d; font-size: 8px; letter-spacing: .04em; }

.error-state { margin-top: 18vh; text-align: center; }
.error-state strong { font-size: 15px; font-weight: 600; }
.error-state p { margin: 9px auto 0; color: #727a80; font-size: 11px; line-height: 1.6; max-width: 300px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (min-width: 700px) {
  .app-shell { padding-left: 24px; padding-right: 24px; padding-top: 24px; }
  .asset-card { padding: 28px 27px 20px; }
  .card-footer { margin-left: -27px; margin-right: -27px; padding-left: 27px; padding-right: 27px; }
  .chart-wrap { height: 350px; }
}

@media (max-width: 430px) {
  .app-shell { padding-left: 13px; padding-right: 13px; }
  .topbar { margin-bottom: 23px; }
  .asset-card { padding: 22px 18px 16px; border-radius: 24px; }
  .price { font-size: clamp(37px, 11.2vw, 50px); }
  .chart-wrap { height: clamp(242px, 43vh, 320px); margin-left: -9px; margin-right: -9px; }
  .card-footer { margin-left: -18px; margin-right: -18px; padding-left: 18px; padding-right: 18px; }
  .footer-actions a { padding: 0 9px; }
  .footer-actions .external { display: none; }
}

@media (max-width: 355px) {
  .brand-word { letter-spacing: .28em; }
  .chain-pill { padding: 0 10px; }
  .asset-card { padding-left: 15px; padding-right: 15px; }
  .price { font-size: 35px; }
  #tokenName { max-width: 95px; }
  .card-footer { margin-left: -15px; margin-right: -15px; padding-left: 15px; padding-right: 15px; }
  .metric strong { font-size: 18px; }
  .footer-actions { gap: 6px; }
  .footer-actions a { height: 36px; padding: 0 8px; font-size: 9px; }
}
