/* ---------- design tokens ---------- */
:root {
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --bg-hover: #f5f5f5;
  --border: #e5e5e5;
  --border-strong: #d4d4d4;
  --text: #0a0a0a;
  --text-2: #404040;
  --muted: #737373;
  --muted-2: #a3a3a3;
  --accent: #0a0a0a;          /* monochrome: button bg, progress fill */
  --accent-fg: #ffffff;
  --accent-soft: #f0f0f0;
  --success: #15803d;
  --warn: #b45309;
  --danger: #b91c1c;
  --launch: #d97706;          /* one warm hue for the LAUNCHPAD pill */
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body { min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 32px;
  padding: 14px 28px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-weight: 600; font-size: 14px; letter-spacing: 0.02em;
}
.brand-mark {
  width: 26px; height: 26px; border-radius: 50%;
  object-fit: contain;
  flex-shrink: 0;
}
.nav-links { display: flex; gap: 4px; }
.nav-link {
  font-family: var(--mono); font-size: 13px;
  color: var(--muted);
  padding: 6px 12px; border-radius: 6px;
}
.nav-link:hover { background: var(--bg-hover); color: var(--text); }
.nav-link.active { color: var(--text); background: var(--bg-hover); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.status-pill {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  padding: 5px 10px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 999px;
}
.status-pill .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--muted-2);
}
.status-pill.ok .dot { background: var(--success); box-shadow: 0 0 6px rgba(21,128,61,0.6); }
.status-pill.bad .dot { background: var(--danger); }
.btn-wallet {
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  padding: 7px 14px;
  background: var(--accent); color: var(--accent-fg);
  border-radius: 6px;
}
.btn-wallet:hover { background: #262626; }
.btn-wallet.warn { background: var(--warn); color: white; }
.btn-wallet.warn:hover { background: #92400e; }

/* ---------- page container ---------- */
.page {
  max-width: 1400px; margin: 0 auto; padding: 24px 28px 64px;
}

/* ---------- hero (compact, single line) ---------- */
.hero {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; margin-bottom: 20px;
}
.hero-text h1 {
  font-size: 22px; font-weight: 600; letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.hero-text p { color: var(--muted); font-size: 13px; max-width: 720px; }
.hero-text a.inline { color: var(--text); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 2px; }

/* ---------- stats strip ---------- */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg);
  margin-bottom: 28px;
  overflow: hidden;
}
.stat {
  padding: 16px 20px;
  border-right: 1px solid var(--border);
}
.stat:last-child { border-right: none; }
.stat-label {
  font-family: var(--mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted); margin-bottom: 6px;
}
.stat-value { font-family: var(--mono); font-size: 18px; font-weight: 500; color: var(--text); }

/* ---------- filter bar ---------- */
.filter-bar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.filter-bar .tabs { display: flex; gap: 2px; }
.tab {
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  padding: 7px 14px; border-radius: 6px;
  color: var(--muted);
}
.tab:hover { background: var(--bg-hover); color: var(--text); }
.tab.active { background: var(--accent); color: var(--accent-fg); }
.filter-bar .search {
  margin-left: auto;
  display: flex; align-items: center;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 6px;
  padding: 6px 10px; min-width: 240px;
}
.filter-bar .search input {
  background: none; border: none; outline: none; flex: 1;
  font-family: var(--mono); font-size: 12px;
}
.filter-bar .search input::placeholder { color: var(--muted-2); }

/* ---------- token table ---------- */
.table-wrap {
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  background: var(--bg);
}
.token-table { width: 100%; border-collapse: collapse; }
.token-table thead th {
  text-align: left;
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted);
  padding: 12px 16px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
}
.token-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 80ms ease;
}
.token-table tbody tr:last-child { border-bottom: none; }
.token-table tbody tr:hover { background: var(--bg-soft); }
.token-table td {
  padding: 14px 16px;
  vertical-align: middle;
  font-size: 13px;
}
.col-num { color: var(--muted); font-family: var(--mono); font-size: 12px; width: 36px; }
.col-ticker .ticker-cell {
  display: flex; align-items: center; gap: 10px;
}
.ticker-avatar {
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}
.ticker-name {
  font-family: var(--mono); font-weight: 600; font-size: 14px;
}
.ticker-sub {
  font-size: 11px; color: var(--muted); margin-top: 1px;
}
.col-progress { min-width: 180px; }
.mini-progress {
  height: 6px; background: var(--bg-hover); border-radius: 999px; overflow: hidden;
  margin-bottom: 5px;
}
.mini-progress .fill {
  height: 100%; background: var(--accent); border-radius: 999px;
  transition: width 300ms ease;
}
.progress-text { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.progress-text strong { color: var(--text); font-weight: 500; }
.col-num-val { font-family: var(--mono); font-size: 13px; }
.col-num-val .sub { font-size: 11px; color: var(--muted); }
.tag-launch {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 9px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 3px 7px; border-radius: 4px;
  background: rgba(217, 119, 6, 0.1); color: var(--launch);
  margin-left: 6px;
}
.tag-launch .dot {
  width: 5px; height: 5px; border-radius: 50%; background: var(--launch);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.btn-row {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  padding: 6px 12px; border-radius: 6px;
  border: 1px solid var(--border-strong); background: var(--bg);
  color: var(--text);
}
.btn-row:hover { background: var(--bg-soft); }
.btn-row.primary {
  background: var(--accent); color: var(--accent-fg);
  border-color: var(--accent);
}
.btn-row.primary:hover { background: #262626; }
.btn-row[disabled], .btn-row.disabled {
  opacity: 0.5; cursor: not-allowed; background: var(--bg-soft); color: var(--muted);
  border-color: var(--border);
}

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(10, 10, 10, 0.4);
  display: none; align-items: center; justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%; max-width: 480px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  overflow: hidden;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 16px; font-weight: 600; }
.modal-close { color: var(--muted); font-family: var(--mono); font-size: 18px; padding: 4px 8px; border-radius: 4px; }
.modal-close:hover { background: var(--bg-hover); color: var(--text); }
.modal-body { padding: 22px; display: grid; gap: 14px; }
.modal-body label {
  display: grid; gap: 6px;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.modal-body input, .modal-body select, .modal-body textarea {
  border: 1px solid var(--border); border-radius: 6px;
  padding: 10px 12px;
  font-family: var(--mono); font-size: 13px;
  background: var(--bg);
  color: var(--text);
}
.modal-body input:focus, .modal-body select:focus, .modal-body textarea:focus {
  outline: none; border-color: var(--accent);
}
.modal-foot {
  display: flex; gap: 10px;
  padding: 16px 22px; background: var(--bg-soft); border-top: 1px solid var(--border);
}
.modal-foot .btn-row { padding: 9px 16px; font-size: 13px; }
.modal-foot .btn-row.primary { flex: 1; justify-content: center; }
.modal-info {
  font-size: 12px; color: var(--muted);
  background: var(--bg-soft); border: 1px solid var(--border);
  padding: 12px 14px; border-radius: 6px;
  line-height: 1.6;
}
.modal-info code {
  font-family: var(--mono); font-size: 11px;
  background: var(--bg); padding: 1px 5px; border-radius: 3px; border: 1px solid var(--border);
}

/* ---------- generic card (used on deploy/portfolio) ---------- */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
}
.card h2 { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.form-row { display: grid; gap: 6px; margin-bottom: 14px; }
.form-row label { font-family: var(--mono); font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.form-row input, .form-row select, .form-row textarea {
  border: 1px solid var(--border); border-radius: 6px;
  padding: 10px 12px; font-family: var(--mono); font-size: 13px;
  background: var(--bg);
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: none; border-color: var(--accent);
}
.kv-output {
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 6px;
  padding: 12px 14px; font-family: var(--mono); font-size: 12px;
  word-break: break-all; white-space: pre-wrap;
  margin-bottom: 12px;
}
.kv-label { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 14px 0 4px; }

/* ---------- generic placeholder ---------- */
.placeholder {
  padding: 36px 20px;
  text-align: center;
  color: var(--muted);
  font-family: var(--mono); font-size: 13px;
}

/* ---------- foot ---------- */
.foot {
  margin-top: 80px;
  padding: 28px;
  text-align: center;
  color: var(--muted); font-size: 12px;
  border-top: 1px solid var(--border);
}
.foot a { text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 2px; }

/* ---------- listings grid (marketplace) ---------- */
.listings {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.listing {
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: border-color 100ms ease, transform 100ms ease;
}
.listing:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.listing-art {
  aspect-ratio: 1 / 1;
  background: var(--bg-soft);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  padding: 18px;
  overflow: hidden; word-break: break-all;
  border-bottom: 1px solid var(--border);
}
.listing-body { padding: 14px; display: grid; gap: 4px; }
.listing-row { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--mono); font-size: 12px; }
.listing-row .k { color: var(--muted); }
.listing-row .v { color: var(--text); }
.listing .ticker {
  font-family: var(--mono); font-weight: 600; font-size: 13px;
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .token-table td, .token-table th { padding: 12px 12px; }
  .col-progress { min-width: 140px; }
}
@media (max-width: 820px) {
  .col-progress { min-width: 110px; }
  .token-table .hide-narrow { display: none; }
}
@media (max-width: 600px) {
  .nav { padding: 12px 14px; gap: 10px; }
  .nav-links { display: none; }
  .page { padding: 14px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2n) { border-right: none; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .hero { flex-direction: column; align-items: flex-start; }
  .token-table .hide-mobile { display: none; }
  .filter-bar { flex-wrap: wrap; }
  .filter-bar .search { width: 100%; min-width: 0; margin-left: 0; }
}

/* Used for the (locked) marketplace banner */
.banner {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; color: var(--text-2);
  margin-bottom: 16px;
}
.banner .icon { font-family: var(--mono); font-size: 14px; color: var(--launch); }
.banner a { color: var(--text); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 2px; }
