:root {
  color-scheme: dark;
  --bg: #07090b;
  --panel: #0b0e11;
  --panel-2: #0f1317;
  --line: #242a2f;
  --line-soft: #171c20;
  --text: #e7eaf0;
  --muted: #7d858d;
  --faint: #4f575e;
  --green: oklch(0.8 0.17 152);
  --green-dark: oklch(0.42 0.11 152);
  --red: oklch(0.72 0.19 25);
  --gold: oklch(0.83 0.16 88);
  --gold-dark: oklch(0.46 0.11 88);
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --sans: "Archivo", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
}

body {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  color: inherit;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: color-mix(in oklch, var(--green), transparent 62%);
  color: white;
}

* {
  scrollbar-color: #343b41 var(--bg);
  scrollbar-width: thin;
}

.app-shell {
  display: flex;
  width: 100%;
  height: 100vh;
  min-height: 460px;
  flex-direction: column;
  overflow: hidden;
  background:
    linear-gradient(rgba(255,255,255,.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.009) 1px, transparent 1px),
    var(--bg);
  background-size: 32px 32px;
}

.topbar {
  z-index: 20;
  display: flex;
  height: 45px;
  flex: 0 0 45px;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 9, 11, .97);
}

.brand {
  display: flex;
  min-width: 214px;
  align-items: center;
  gap: 9px;
  padding: 0 15px;
  border-right: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.45px;
}

.brand-mark {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border: 1px solid var(--green);
  color: var(--green);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1;
  box-shadow: inset 0 0 12px color-mix(in oklch, var(--green), transparent 85%);
}

.brand-tld {
  color: var(--green);
}

.topnav {
  display: flex;
  align-items: stretch;
}

.nav-link {
  display: flex;
  min-width: 89px;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.nav-link:hover {
  color: var(--text);
  background: var(--panel);
}

.nav-link.active {
  position: relative;
  color: var(--text);
  background: #0b0e10;
}

.nav-link.active::after {
  position: absolute;
  right: 13px;
  bottom: -1px;
  left: 13px;
  height: 2px;
  background: var(--green);
  content: "";
}

.topbar-spacer,
.toolbar-spacer {
  flex: 1;
}

.range-control,
.live-chip,
.wallet-button {
  display: flex;
  align-items: center;
  border-left: 1px solid var(--line);
}

.range-control {
  gap: 2px;
  padding: 0 10px;
}

.range-label {
  margin-right: 5px;
  color: var(--faint);
  font-size: 9px;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.range-button,
.pagination button,
.view-toggle button {
  min-width: 29px;
  padding: 4px 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 9px;
}

.range-button:hover,
.range-button.active,
.pagination button:hover,
.pagination button.active,
.view-toggle button.active {
  background: #1b211f;
  color: var(--green);
}

.live-chip {
  gap: 7px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 9px;
}

.live-dot,
.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 7px var(--green);
  animation: blink 1.5s ease-in-out infinite;
}

.separator {
  color: var(--faint);
}

.wallet-button {
  min-width: 151px;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  background: transparent;
  color: var(--green);
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .055em;
}

.wallet-button:hover {
  background: color-mix(in oklch, var(--green), transparent 91%);
}

.wallet-button.connected {
  color: var(--text);
}

.wallet-dot {
  width: 7px;
  height: 7px;
  border: 1px solid currentColor;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--bg);
  background: currentColor;
}

.app-main {
  position: relative;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.view-scroll {
  width: 100%;
  height: 100%;
  overflow: auto;
}

.metrics-grid {
  display: grid;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 12, 14, .94);
}

.metrics-six {
  grid-template-columns: repeat(6, minmax(150px, 1fr));
}

.metrics-five {
  grid-template-columns: repeat(5, minmax(140px, 1fr));
}

.metric {
  min-width: 0;
  min-height: 87px;
  padding: 15px 16px 11px;
  border-right: 1px solid var(--line);
}

.metric:last-child {
  border-right: 0;
}

.eyebrow,
.metric-detail,
.toolbar-hint,
.column-label,
.column-heading,
.swap-box > div:first-child,
.card-stats small,
.card-price small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: .075em;
  text-transform: uppercase;
}

.metric-value {
  margin-top: 7px;
  overflow: hidden;
  color: var(--text);
  font-size: clamp(18px, 1.7vw, 26px);
  font-weight: 500;
  letter-spacing: -.07em;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-value.green,
.positive {
  color: var(--green);
}

.metric-value.gold,
.gold {
  color: var(--gold);
}

.negative {
  color: var(--red);
}

.metric-detail {
  margin-top: 6px;
  overflow: hidden;
  color: var(--faint);
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-detail {
  display: flex;
  align-items: center;
  gap: 7px;
}

.share-track {
  width: 68px;
  height: 3px;
  overflow: hidden;
  background: #242526;
}

.share-track span {
  display: block;
  height: 100%;
  background: var(--gold);
}

.pair-token-label,
.asset-cell,
.card-token {
  display: flex;
  align-items: center;
  gap: 6px;
}

.token-stack {
  display: flex;
}

.token-stack .token + .token {
  margin-left: -5px;
}

.token {
  --token-size: 21px;
  position: relative;
  display: inline-grid;
  width: var(--token-size);
  height: var(--token-size);
  flex: 0 0 var(--token-size);
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.19);
  border-radius: 50%;
  background: #151a1f;
  color: #fff;
  font-family: var(--sans);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: -.05em;
  text-shadow: 0 1px 3px black;
  box-shadow: 0 0 0 2px var(--bg);
}

.token-initials,
.token img {
  grid-area: 1 / 1;
}

.token.has-logo .token-initials {
  visibility: hidden;
}

.token img {
  z-index: 1;
  width: 72%;
  height: 72%;
  border-radius: 50%;
  object-fit: contain;
}

.token.small {
  --token-size: 19px;
}

.token.large {
  --token-size: 42px;
  font-size: 12px;
}

.toolbar {
  display: flex;
  min-height: 39px;
  align-items: center;
  gap: 10px;
  padding: 0 12px 0 15px;
  border-bottom: 1px solid var(--line);
  background: #090c0f;
}

.section-title {
  color: var(--text);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.muted {
  color: var(--muted);
}

.faint {
  color: var(--faint);
}

.dim {
  color: #a0a6ac;
}

.search {
  display: flex;
  width: 210px;
  height: 25px;
  align-items: center;
  gap: 7px;
  margin-left: 8px;
  padding: 0 8px;
  border: 1px solid var(--line);
  background: #07090b;
  color: var(--green);
}

.search:focus-within {
  border-color: var(--green-dark);
  box-shadow: 0 0 0 1px color-mix(in oklch, var(--green), transparent 88%);
}

.search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 9px;
}

.search input::placeholder {
  color: var(--faint);
}

.table-scroller {
  overflow-x: auto;
}

.stock-table,
.pair-table,
.meme-table,
.pool-table {
  display: grid;
  align-items: center;
}

.stock-table {
  grid-template-columns: 236px 108px 94px 116px 116px 142px 64px 66px 90px minmax(112px, 1fr);
  min-width: 1144px;
}

.pair-table {
  grid-template-columns: 162px minmax(150px, 1fr) 116px 88px 92px 62px 116px 112px 98px;
  min-width: 1100px;
}

.meme-table {
  grid-template-columns: 224px minmax(160px, 1fr) 120px 92px 94px 66px 98px 108px;
  min-width: 950px;
}

.pool-table {
  grid-template-columns: 166px 108px 80px 166px minmax(130px, 1fr) 128px 128px;
  min-width: 1000px;
}

.table-head {
  position: sticky;
  z-index: 5;
  top: 0;
  height: 31px;
  border-bottom: 1px solid var(--line);
  background: #0d1114;
  box-shadow: 0 1px 6px rgba(0,0,0,.35);
}

.table-head > *,
.data-row > * {
  min-width: 0;
  padding: 0 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-head > * + *,
.data-row > * + * {
  border-left: 1px solid var(--line-soft);
}

.column-heading {
  width: 100%;
  height: 100%;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.column-heading:hover {
  color: var(--text);
}

.column-heading.right,
.column-label.right,
.number-cell {
  text-align: right;
}

.column-heading.gold {
  color: var(--gold-dark);
}

.data-row {
  min-height: 35px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(7, 9, 11, .82);
  transition: background-color 150ms ease;
}

a.data-row:hover,
div.data-row[role="button"]:hover {
  background: #11161a;
  cursor: pointer;
}

.data-row.flash-up {
  animation: flash-up .62s ease-out;
}

.data-row.flash-down {
  animation: flash-down .62s ease-out;
}

.asset-cell strong,
.data-row strong {
  font-weight: 600;
}

.asset-name {
  color: #9aa1a8;
}

.market-pair {
  display: flex;
  align-items: center;
  gap: 5px;
}

.stock-symbol {
  min-width: 39px;
  color: var(--text);
  font-weight: 700;
}

.stock-name {
  color: var(--muted);
}

.sparkline {
  width: 40px;
  height: 15px;
  overflow: visible;
  margin-left: auto;
}

.sparkline path {
  fill: none;
  stroke: var(--green);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.share-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.share-cell .share-track {
  width: 57px;
}

.pool-badge,
.pool-type {
  display: inline-flex;
  padding: 2px 5px;
  border: 1px solid #26312e;
  color: #7fa294;
  font-size: 7px;
  font-style: normal;
  letter-spacing: .05em;
}

.pagination {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 2px;
  padding: 0 13px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #090c0f;
  font-size: 9px;
}

.pagination .muted {
  margin-right: 5px;
  font-size: 8px;
}

.pager {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
}

.pagination button:disabled {
  opacity: .3;
  cursor: not-allowed;
}

.stock-layout {
  display: grid;
  width: 100%;
  height: 100%;
  grid-template-columns: minmax(700px, 1fr) 318px;
  overflow: hidden;
}

.stock-content {
  min-width: 0;
  overflow: auto;
  border-right: 1px solid var(--line);
}

.stock-sidebar {
  min-width: 0;
  overflow-y: auto;
  background: #080a0c;
}

.stock-hero {
  display: flex;
  min-height: 72px;
  align-items: center;
  gap: 12px;
  padding: 11px 15px;
  border-bottom: 1px solid var(--line);
  background: rgba(9,12,14,.94);
}

.small-button {
  display: inline-flex;
  height: 24px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 8px;
}

.small-button:hover {
  border-color: var(--green-dark);
  color: var(--green);
}

.stock-identity {
  min-width: 0;
}

.stock-identity > div {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.stock-identity strong {
  font-family: var(--sans);
  font-size: 18px;
}

.stock-identity span {
  color: #a1a7ad;
  font-family: var(--sans);
  font-size: 12px;
}

.stock-identity em {
  padding: 2px 5px;
  border: 1px solid var(--green-dark);
  color: var(--green);
  font-size: 7px;
  font-style: normal;
  letter-spacing: .05em;
}

.stock-identity small,
.stock-price small {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  color: var(--faint);
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-price {
  margin-left: auto;
  text-align: right;
}

.stock-price > div {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 11px;
}

.stock-price strong {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -.07em;
}

.stock-price span {
  font-size: 11px;
  font-weight: 600;
}

.stock-metrics .metric {
  min-height: 68px;
  padding-top: 11px;
}

.stock-metrics .metric-value {
  font-size: 18px;
}

.chart-shell {
  display: grid;
  min-height: 222px;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, .85fr);
  border-bottom: 1px solid var(--line);
}

.chart-panel {
  min-width: 0;
  padding: 11px 15px 7px;
  border-right: 1px solid var(--line);
  background:
    repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(255,255,255,.027) 40px),
    repeating-linear-gradient(90deg, transparent, transparent 69px, rgba(255,255,255,.022) 70px),
    #090c0e;
}

.chart-panel:last-child {
  border-right: 0;
}

.chart-title {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 19px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.chart-title strong {
  color: var(--text);
  font-size: 9px;
}

.chart-svg {
  display: block;
  width: 100%;
  height: 169px;
  overflow: visible;
}

.chart-line {
  fill: none;
  stroke: var(--green);
  stroke-width: 1.45;
  vector-effect: non-scaling-stroke;
}

.chart-fill {
  fill: url(#chartGradient);
  opacity: .34;
}

.chart-volume {
  fill: color-mix(in oklch, var(--gold), transparent 45%);
}

.chart-baseline {
  stroke: #2b3237;
  stroke-width: .5;
  stroke-dasharray: 2 3;
}

.toggle-small {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 8px;
}

.toggle-small > span {
  position: relative;
  width: 22px;
  height: 11px;
  border: 1px solid #32383d;
  border-radius: 7px;
  background: #111519;
}

.toggle-small i {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 130ms ease;
}

.toggle-small.active {
  color: var(--green);
}

.toggle-small.active > span {
  border-color: var(--green-dark);
}

.toggle-small.active i {
  background: var(--green);
  transform: translateX(11px);
}

.view-toggle {
  display: flex;
  border: 1px solid var(--line);
}

.meme-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
  gap: 1px;
  padding: 1px;
  background: var(--line);
}

.meme-card {
  min-height: 143px;
  padding: 12px;
  background: #090c0e;
  cursor: pointer;
  text-align: left;
}

.meme-card:hover {
  background: #11161a;
}

.card-token strong {
  color: var(--gold);
}

.card-token small {
  color: var(--muted);
}

.card-token em {
  margin-left: auto;
  color: var(--faint);
  font-size: 8px;
  font-style: normal;
}

.card-volume {
  display: block;
  margin-top: 14px;
  margin-bottom: 3px;
  font-size: 19px;
  font-weight: 500;
}

.card-stats {
  display: grid;
  margin-top: 12px;
  grid-template-columns: repeat(3, 1fr);
}

.card-stats span {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.card-price {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 9px;
  padding-top: 7px;
  border-top: 1px solid var(--line-soft);
}

.pools-title {
  border-top: 1px solid var(--line);
}

.stock-sidebar section {
  border-bottom: 1px solid var(--line);
}

.panel-title {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
}

.panel-title strong {
  font-family: var(--sans);
  font-size: 12px;
}

.panel-title em,
.panel-title span {
  color: var(--faint);
  font-size: 7px;
  font-style: normal;
  letter-spacing: .06em;
}

.panel-title span {
  margin-left: auto;
}

.swap-panel {
  position: relative;
  padding-bottom: 12px;
}

.swap-panel .panel-title {
  margin-bottom: 11px;
}

.swap-box {
  margin: 0 11px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  background: #0c1013;
}

.swap-box > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.swap-box > div:first-child {
  margin-bottom: 9px;
  color: var(--faint);
}

.swap-box input,
.swap-box > div > strong {
  width: 155px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -.06em;
}

.swap-box button {
  display: flex;
  height: 27px;
  align-items: center;
  gap: 6px;
  padding: 0 7px;
  border: 1px solid var(--line);
  background: #12171a;
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
}

.flip-button {
  position: relative;
  z-index: 2;
  display: block;
  width: 27px;
  height: 27px;
  margin: -4px auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #11161a;
  color: var(--green);
  cursor: pointer;
}

.swap-details {
  margin: 10px 12px;
}

.swap-details div {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  color: var(--muted);
  font-size: 8px;
}

.swap-details dt,
.swap-details dd {
  margin: 0;
}

.swap-details dd {
  color: #afb5ba;
}

.primary-button {
  display: block;
  width: calc(100% - 22px);
  height: 35px;
  margin: 11px;
  border: 1px solid var(--green-dark);
  background: color-mix(in oklch, var(--green), transparent 87%);
  color: var(--green);
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
}

.primary-button:hover {
  background: color-mix(in oklch, var(--green), transparent 79%);
}

.registry {
  padding-bottom: 10px;
}

.registry-list {
  margin: 0;
  padding: 7px 11px;
}

.registry-list div {
  display: grid;
  min-height: 24px;
  grid-template-columns: 111px minmax(0, 1fr);
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
}

.registry-list dt,
.registry-list dd {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.registry-list dt {
  color: var(--faint);
  font-size: 7px;
  letter-spacing: .055em;
}

.registry-list dd {
  color: #adb4ba;
  font-size: 8px;
  text-align: right;
}

.statusbar {
  display: flex;
  height: 23px;
  flex: 0 0 23px;
  align-items: center;
  gap: 10px;
  padding: 0 11px;
  border-top: 1px solid var(--line);
  background: #060709;
  color: var(--faint);
  font-size: 7px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.statusbar > span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.statusbar .right {
  margin-left: auto;
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(2px);
  animation: fade-in 120ms ease-out;
}

.pair-modal {
  width: min(620px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border: 1px solid #323a40;
  background: #090c0f;
  box-shadow: 0 25px 90px rgba(0,0,0,.8);
}

.modal-head {
  display: flex;
  min-height: 55px;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}

.modal-head strong {
  font-family: var(--sans);
  font-size: 15px;
}

.modal-head small {
  color: var(--muted);
}

.modal-head button {
  width: 28px;
  height: 28px;
  margin-left: auto;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.modal-head button:hover {
  background: var(--panel-2);
  color: var(--text);
}

.modal-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
}

.modal-metrics .metric {
  min-height: 69px;
  padding: 11px 10px;
}

.modal-metrics .metric-value {
  font-size: 15px;
}

.modal-body {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
}

.modal-section {
  min-width: 0;
  padding: 12px;
}

.modal-section + .modal-section {
  border-left: 1px solid var(--line);
}

.modal-section h3 {
  margin: 0 0 10px;
  font-family: var(--sans);
  font-size: 10px;
}

.modal-pools {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.modal-pool {
  display: grid;
  min-height: 31px;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 0 7px;
  background: #101418;
}

.modal-pool a {
  color: #a9b1b8;
}

.modal-pool span {
  color: var(--muted);
}

.modal-action {
  display: flex;
  width: 100%;
  min-height: 35px;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  border: 1px solid var(--green-dark);
  background: color-mix(in oklch, var(--green), transparent 90%);
  color: var(--green);
  cursor: pointer;
  font-weight: 700;
}

.empty-state {
  display: grid;
  min-height: 160px;
  place-items: center;
  color: var(--muted);
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

@keyframes flash-up {
  from { background: color-mix(in oklch, var(--green), transparent 76%); }
  to { background: rgba(7, 9, 11, .82); }
}

@keyframes flash-down {
  from { background: color-mix(in oklch, var(--red), transparent 76%); }
  to { background: rgba(7, 9, 11, .82); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 1050px) {
  .metrics-six {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .metrics-six .metric:nth-child(3) {
    border-right: 0;
  }

  .metrics-six .metric:nth-child(-n+3) {
    border-bottom: 1px solid var(--line);
  }

  .stock-layout {
    grid-template-columns: minmax(610px, 1fr) 290px;
  }

  .live-chip {
    display: none;
  }
}

@media (max-width: 800px) {
  .topbar {
    overflow-x: auto;
  }

  .brand {
    min-width: 170px;
  }

  .topnav {
    display: none;
  }

  .range-control {
    margin-left: auto;
  }

  .wallet-button {
    min-width: 120px;
  }

  .stock-layout {
    display: block;
    overflow: auto;
  }

  .stock-content,
  .stock-sidebar {
    overflow: visible;
    border-right: 0;
  }

  .stock-sidebar {
    border-top: 1px solid var(--line);
  }

  .chart-shell {
    grid-template-columns: 1fr;
  }

  .chart-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .stock-metrics {
    grid-template-columns: repeat(3, minmax(130px, 1fr));
    overflow-x: auto;
  }

  .toolbar-hint {
    display: none;
  }
}

@media (max-width: 600px) {
  .range-label,
  .statusbar .optional {
    display: none;
  }

  .metrics-six {
    grid-template-columns: repeat(2, minmax(145px, 1fr));
  }

  .metrics-six .metric {
    border-bottom: 1px solid var(--line);
  }

  .metrics-six .metric:nth-child(2n) {
    border-right: 0;
  }

  .toolbar {
    flex-wrap: wrap;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .search {
    order: 3;
    width: 100%;
    margin-left: 0;
  }

  .stock-hero {
    flex-wrap: wrap;
  }

  .stock-price {
    width: 100%;
  }

  .modal-metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .modal-body {
    grid-template-columns: 1fr;
  }

  .modal-section + .modal-section {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

/* Stock detail refinements mirroring the supplied frontend */
.charts {
  display: grid;
  min-height: 238px;
  grid-template-columns: 1.35fr 1fr;
  border-bottom: 1px solid var(--line);
}

.charts .chart-panel {
  min-width: 0;
  padding: 9px 0 8px;
  background: #080b0d;
}

.charts .chart-title {
  padding: 0 13px 8px;
}

.chart-spacer {
  flex: 1;
}

.charts .chart-svg {
  width: calc(100% - 26px);
  height: 186px;
  margin: 0 13px;
}

.grid-line {
  stroke: #141821;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.chart-labels {
  display: flex;
  justify-content: space-between;
  padding: 7px 13px 0;
  color: var(--faint);
  font-size: 8px;
}

.legend {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 4px;
  vertical-align: -1px;
}

.legend.all {
  background: #2f3947;
}

.legend.meme {
  background: var(--gold);
}

.green {
  color: var(--green);
}

.registry {
  padding: 0 11px 12px;
}

.registry .panel-title {
  margin: 0 -11px 5px;
  padding: 0 11px;
}

.registry dl {
  margin: 0;
}

.registry dl div {
  display: grid;
  min-height: 26px;
  grid-template-columns: 111px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
}

.registry dt,
.registry dd {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.registry dt {
  color: var(--faint);
  font-size: 8px;
  letter-spacing: .05em;
}

.registry dd {
  color: #adb4ba;
  font-size: 9px;
  text-align: right;
  word-break: break-all;
}

.modal-backdrop {
  align-items: start;
  padding: 64px 20px;
}

.pair-modal {
  width: min(820px, 100%);
  border-radius: 6px;
  animation: modal-rise .2s cubic-bezier(.2,.7,.3,1);
}

.pair-modal > header {
  display: flex;
  min-height: 55px;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
}

.modal-heading {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.modal-heading strong,
.modal-price strong {
  font-size: 16px;
  font-weight: 600;
}

.modal-heading small,
.modal-price small {
  color: var(--muted);
  font-size: 8px;
}

.modal-price {
  display: flex;
  margin-left: auto;
  flex-direction: column;
  gap: 5px;
  text-align: right;
}

.pair-modal > header > button {
  width: 25px;
  height: 25px;
  border: 1px solid #262c35;
  border-radius: 3px;
  background: #12161c;
  color: var(--muted);
  cursor: pointer;
}

.token-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  border-bottom: 1px solid var(--line);
  background: var(--line);
}

.token-details > section {
  padding: 10px 12px;
  background: #0b0d11;
}

.detail-token {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 8px 0 7px;
}

.detail-token span {
  overflow: hidden;
  color: var(--muted);
  font-family: var(--sans);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.token-details p {
  display: flex;
  justify-content: space-between;
  margin: 0;
  padding: 4px 0;
  font-size: 9px;
}

.token-details p > span {
  color: var(--muted);
}

.modal-pools {
  gap: 1px;
  padding: 0 13px 13px;
}

.modal-section-title {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 9px;
}

.modal-section-title strong {
  font-family: var(--sans);
  font-size: 10px;
  text-transform: uppercase;
}

.modal-section-title span {
  color: var(--muted);
}

.modal-section-title em {
  margin-left: auto;
  color: var(--faint);
  font-size: 8px;
  font-style: normal;
}

.modal-pool {
  grid-template-columns: 106px 68px minmax(0, 1fr) 106px 102px;
  min-height: 34px;
  border: 1px solid #1a1f27;
  border-radius: 3px;
}

.modal-pool > strong,
.modal-pool > span,
.modal-pool > small {
  text-align: right;
}

.modal-pool small {
  color: var(--faint);
}

.pair-modal > footer {
  display: flex;
  min-height: 54px;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  border-top: 1px solid var(--line);
  background: #08090c;
}

.pair-modal > footer > span {
  flex: 1;
}

.primary-button.compact {
  width: auto;
  height: 32px;
  margin: 0;
  padding: 0 13px;
  border: 0;
  background: var(--green);
  color: #04120a;
}

@keyframes modal-rise {
  from {
    opacity: 0;
    transform: translateY(10px) scale(.995);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 800px) {
  .charts {
    grid-template-columns: 1fr;
  }

  .charts .chart-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 600px) {
  .token-details,
  .modal-pool {
    grid-template-columns: 1fr;
  }

  .modal-pool {
    gap: 6px;
    padding: 9px;
  }

  .modal-pool > strong,
  .modal-pool > span,
  .modal-pool > small {
    text-align: left;
  }
}

/* Live KyberSwap widget */
.swap-token-select {
  display: flex;
  min-width: 132px;
  max-width: 180px;
  height: 30px;
  align-items: center;
  gap: 6px;
  padding: 0 6px;
  border: 1px solid var(--line);
  background: #12171a;
}

.swap-token-select select {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: 700 9px var(--mono);
}

.swap-token-select option {
  background: #12171a;
  color: var(--text);
}

.slippage-settings {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 10px 11px 0;
  color: var(--faint);
  font-size: 7px;
}

.slippage-settings > span {
  margin-right: auto;
  letter-spacing: .05em;
}

.slippage-settings button,
.slippage-settings label {
  height: 23px;
  border: 1px solid var(--line);
  background: #0c1013;
  color: var(--muted);
  font: 700 8px var(--mono);
}

.slippage-settings button {
  padding: 0 6px;
  cursor: pointer;
}

.slippage-settings button.active {
  border-color: var(--green-dark);
  color: var(--green);
}

.slippage-settings label {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 5px;
}

.slippage-settings input {
  width: 34px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: 700 8px var(--mono);
  text-align: right;
}

.swap-details dd {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.swap-message {
  margin: 8px 11px 0;
  color: var(--green);
  font-size: 8px;
  line-height: 1.45;
}

.swap-message.error {
  color: var(--red);
}

.swap-transaction,
.swap-disclaimer {
  display: block;
  margin: 8px 11px 0;
  font-size: 7px;
  line-height: 1.4;
}

.swap-transaction {
  color: var(--green);
  text-decoration: none;
}

.swap-disclaimer {
  color: var(--faint);
  text-align: center;
}

.primary-button:disabled {
  cursor: wait;
  opacity: .55;
}
