:root {
  color-scheme: dark;
  --bg: #080907;
  --panel: #10120e;
  --panel-2: #151811;
  --line: #2b3023;
  --line-soft: #1e211a;
  --text: #f3f4eb;
  --muted: #8f9683;
  --acid: #d7ff45;
  --acid-dark: #9db91f;
  --green: #7dff8b;
  --red: #ff6d6d;
  --amber: #ffc864;
  --cyan: #62d9ff;
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% -25%, rgba(215, 255, 69, 0.13), transparent 35%),
    linear-gradient(180deg, #090a08 0%, var(--bg) 42%, #050604 100%);
  color: var(--text);
}

button, input, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.ambient {
  position: fixed;
  z-index: -1;
  width: 34rem;
  height: 34rem;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.08;
  pointer-events: none;
}
.ambient-one { top: -16rem; left: -10rem; background: var(--acid); }
.ambient-two { right: -16rem; bottom: -20rem; background: #5d7bff; }

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(100%, 470px);
  padding: 44px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(23, 26, 18, 0.98), rgba(10, 11, 8, 0.98));
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.45), inset 0 1px rgba(255,255,255,0.035);
}

.brand-mark {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  margin-bottom: 28px;
  border-radius: 17px 17px 17px 4px;
  background: var(--acid);
  color: #101207;
  font-weight: 950;
  letter-spacing: -0.08em;
  box-shadow: 0 0 44px rgba(215,255,69,0.16);
}

.brand-mark-small { width: 42px; height: 42px; margin: 0; border-radius: 12px 12px 12px 3px; }
.eyebrow { margin: 0 0 8px; color: var(--acid); font-size: 11px; font-weight: 800; letter-spacing: 0.18em; }
.login-card h1 { margin: 0; font-size: clamp(32px, 7vw, 48px); letter-spacing: -0.055em; line-height: 1; }
.login-copy { margin: 18px 0 32px; color: var(--muted); line-height: 1.6; }
.login-form label { display: block; margin-bottom: 9px; color: #c7cbbd; font-size: 12px; font-weight: 700; }
.password-row { display: flex; gap: 9px; }
.password-row input,
.search-wrap,
select {
  min-height: 45px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #0a0c09;
  color: var(--text);
  outline: none;
}
.password-row input { min-width: 0; flex: 1; padding: 0 14px; }
.password-row input:focus, .search-wrap:focus-within, select:focus { border-color: var(--acid-dark); box-shadow: 0 0 0 3px rgba(215,255,69,0.08); }
.password-row button {
  border: 0;
  border-radius: 11px;
  padding: 0 20px;
  background: var(--acid);
  color: #0c0e07;
  font-weight: 850;
}
.form-error { min-height: 20px; margin: 10px 0 0; color: var(--red); font-size: 12px; }

.dashboard-shell { width: min(1540px, calc(100% - 36px)); margin: 0 auto 80px; }
.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-soft);
}
.brand-lockup, .topbar-actions, .control-panel, .results-heading { display: flex; align-items: center; }
.brand-lockup { gap: 12px; }
.brand-lockup h1 { margin: 0; font-size: 18px; letter-spacing: -0.03em; }
.brand-lockup .eyebrow { margin: 0 0 1px; font-size: 9px; }
.topbar-actions { gap: 10px; }
.freshness { color: var(--muted); font-size: 12px; }
.quiet-button, .icon-button, .view-toggle button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #0d0f0b;
  color: #d5d8cd;
}
.quiet-button { padding: 0 14px; }
.icon-button { width: 38px; font-size: 19px; }
.quiet-button:hover, .icon-button:hover, .view-toggle button:hover { border-color: #4b523a; color: var(--acid); }
.icon-button.loading { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.stat-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  overflow: hidden;
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(13,15,11,0.82);
}
.stat-strip article { min-width: 0; padding: 21px 24px; border-right: 1px solid var(--line); }
.stat-strip article:last-child { border-right: 0; }
.stat-strip span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }
.stat-strip strong { font-size: clamp(21px, 3vw, 31px); letter-spacing: -0.045em; }

.control-panel { flex-wrap: wrap; gap: 9px; padding: 26px 0 18px; }
.search-wrap { flex: 1 1 290px; display: flex; align-items: center; gap: 8px; padding: 0 13px; }
.search-wrap span { color: var(--acid); font-size: 21px; transform: translateY(-1px); }
.search-wrap input { width: 100%; border: 0; background: transparent; color: var(--text); outline: 0; }
.search-wrap input::placeholder { color: #656b5d; }
select { min-width: 145px; padding: 0 32px 0 12px; color: #cfd2c7; font-size: 12px; }
.view-toggle { display: flex; gap: 4px; }
.view-toggle button { width: 42px; font-size: 18px; }
.view-toggle button.active { border-color: var(--acid-dark); background: rgba(215,255,69,0.09); color: var(--acid); }

.results-heading { justify-content: space-between; gap: 20px; padding: 5px 2px 13px; color: var(--muted); font-size: 12px; }
.results-heading p { margin: 0; }
.results-heading strong { color: var(--text); }

.token-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 12px; }
.token-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(20,23,16,0.96), rgba(10,12,9,0.96));
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}
.token-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 2px; background: var(--move-color, #3f4438); opacity: 0.85; }
.token-card:hover { transform: translateY(-2px); border-color: #3b4130; background: linear-gradient(145deg, rgba(24,28,18,0.98), rgba(11,13,9,0.98)); }
.card-main { padding: 17px 18px 14px; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.identity { min-width: 0; }
.symbol-row { display: flex; min-width: 0; align-items: center; gap: 8px; }
.symbol { overflow: hidden; margin: 0; color: #fafbf3; font-size: 19px; font-weight: 850; letter-spacing: -0.035em; text-overflow: ellipsis; white-space: nowrap; }
.tracked-dot { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 11px rgba(215,255,69,0.5); }
.name { overflow: hidden; margin: 4px 0 0; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.move { flex: 0 0 auto; text-align: right; }
.move strong { display: block; font-size: 19px; letter-spacing: -0.035em; }
.move span { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; }
.positive { color: var(--green); }
.negative { color: var(--red); }
.neutral { color: #adb2a5; }
.badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 13px; }
.badge { display: inline-flex; align-items: center; min-height: 21px; padding: 0 7px; border: 1px solid #30352a; border-radius: 6px; color: #aeb4a4; font-size: 9px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.badge.chain { border-color: color-mix(in srgb, var(--chain-color, #899) 45%, #25281f); color: var(--chain-color, #cdd2c7); }
.badge.status-active, .badge.status-listed { color: var(--green); }
.badge.status-paused, .badge.status-muted { color: var(--amber); }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 17px; }
.metric { min-width: 0; padding: 10px; border: 1px solid #20241b; border-radius: 9px; background: rgba(6,7,5,0.42); }
.metric span { display: block; margin-bottom: 4px; color: #737a6b; font-size: 8px; font-weight: 800; letter-spacing: 0.11em; text-transform: uppercase; }
.metric strong { display: block; overflow: hidden; color: #e7e9df; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 18px; border-top: 1px solid var(--line-soft); background: rgba(5,6,4,0.35); }
.contract { min-width: 0; overflow: hidden; border: 0; background: transparent; color: #71786a; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.contract:hover { color: var(--acid); }
.links { display: flex; gap: 8px; }
.links a { color: #9da493; font-size: 10px; font-weight: 750; text-decoration: none; text-transform: uppercase; }
.links a:hover { color: var(--acid); }

.token-grid.list-view { display: flex; flex-direction: column; gap: 7px; }
.list-view .token-card { display: grid; grid-template-columns: minmax(280px, 1.3fr) minmax(250px, 1fr) minmax(200px, 0.8fr); align-items: center; }
.list-view .card-main { display: contents; }
.list-view .card-top { padding: 13px 18px; }
.list-view .badges { margin: 0; padding: 13px 10px; }
.list-view .metrics { margin: 0; padding: 8px 10px; }
.list-view .card-foot { grid-column: 1 / -1; padding: 7px 18px; }

.empty-state { padding: 90px 20px; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; }
.empty-state div { color: var(--acid); font-size: 42px; }
.empty-state h3 { margin: 10px 0 5px; font-size: 22px; }
.empty-state p { margin: 0; color: var(--muted); }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 20; transform: translateY(20px); padding: 11px 15px; border: 1px solid #3c4230; border-radius: 10px; background: #151911; color: #e8ebdf; font-size: 12px; opacity: 0; pointer-events: none; transition: 160ms ease; }
.toast.show { transform: translateY(0); opacity: 1; }

@media (max-width: 900px) {
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .stat-strip article { border-bottom: 1px solid var(--line); }
  .stat-strip article:nth-child(even) { border-right: 0; }
  .stat-strip article:last-child { grid-column: 1 / -1; border-bottom: 0; }
  .list-view .token-card { display: block; }
  .list-view .card-main { display: block; }
  .list-view .card-top { padding: 17px 18px 0; }
  .list-view .badges { padding: 13px 18px 0; }
  .list-view .metrics { padding: 0 18px 14px; margin-top: 17px; }
}

@media (max-width: 620px) {
  .dashboard-shell { width: min(100% - 22px, 1540px); }
  .topbar { min-height: 66px; }
  .freshness { display: none; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .stat-strip article { padding: 15px; }
  .stat-strip article:last-child { grid-column: auto; }
  .control-panel { align-items: stretch; }
  .control-panel select { flex: 1 1 calc(50% - 9px); min-width: 0; }
  .view-toggle { margin-left: auto; }
  .results-heading { align-items: flex-start; }
  .results-heading p:last-child { max-width: 50%; text-align: right; }
  .token-grid { grid-template-columns: 1fr; }
  .login-card { padding: 32px 24px; }
  .password-row { display: grid; }
  .password-row button { min-height: 45px; }
}
