:root {
  --bg: #f4f7fc;
  --surface: #ffffff;
  --surface-2: #f8fbff;
  --line: #dce4f0;
  --line-2: #e8eef7;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #64748b;
  --brand: #1756d6;
  --brand-2: #0f3f9f;
  --up: #0f9d63;
  --down: #d33c5a;
  --radius: 14px;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  --topbar-h: 70px;
  --ticker-h: 38px;
  --mobile-nav-h: 0px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: Inter, sans-serif;
  background: radial-gradient(circle at top right, #eaf3ff 0%, var(--bg) 36%, #f2f6fd 100%);
  color: var(--text);
  line-height: 1.45;
  overflow-x: hidden;
}
a, button, input { font-family: inherit; }
button { cursor: pointer; }

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 18px 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.topbar__left {
  display: flex;
  align-items: center;
  gap: 22px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}
.brand {
  min-width: 0;
  flex: 0 1 auto;
}
.brand img {
  height: 48px;
  max-width: 100%;
  width: auto;
  display: block;
}

.desktop-nav {
  display: flex;
  gap: 4px;
}
.nav-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
}
.desktop-nav .nav-btn:hover,
.desktop-nav .nav-btn.active {
  color: var(--brand);
  background: #eaf1ff;
  border-color: #c8dafc;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid #8fdfba;
  background: #ebfbf3;
  color: #0a8e57;
  font-size: 12px;
  font-weight: 700;
}
.live-pill span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #0a8e57;
  animation: livePulse 1.4s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .6; transform: scale(1.3); }
}

.btn {
  border-radius: 10px;
  padding: 8px 12px;
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn--ghost {
  border-color: var(--line);
  color: var(--text-2);
}
.btn--primary {
  background: var(--brand);
  color: #fff;
}
.btn--primary:hover { background: var(--brand-2); }
.btn--buy {
  background: var(--up);
  color: #fff;
  border: none;
  justify-content: center;
  padding: 12px;
}
.btn--sell {
  background: var(--down);
  color: #fff;
}

.ticker {
  position: fixed;
  top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
  left: 0;
  right: 0;
  z-index: 99;
  height: var(--ticker-h);
  border-bottom: 1px solid var(--line);
  background: #fff;
  overflow: hidden;
}
.ticker__track {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  height: 100%;
  animation: tickerMove 260s linear infinite;
}
.ticker__track:hover { animation-play-state: paused; }
@keyframes tickerMove {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-right: 1px solid var(--line-2);
  padding: 0 18px;
  font-size: 12px;
}
.ticker-item .s { color: var(--text-3); font-weight: 700; }
.ticker-item .p { color: var(--text); font-weight: 600; }
.ticker-item .c.up { color: var(--up); }
.ticker-item .c.down { color: var(--down); }

.app-main {
  padding: 18px;
  padding-bottom: calc(18px + var(--mobile-nav-h));
  margin-top: calc(var(--topbar-h) + var(--ticker-h) + env(safe-area-inset-top, 0px));
  min-height: calc(100vh - var(--topbar-h) - var(--ticker-h));
}

.view { display: none; }
.view.active { display: block; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 14px;
}
.section-head h1 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.02em;
  font-size: clamp(22px, 2vw, 30px);
}
.section-head p {
  margin: 6px 0 0;
  color: var(--text-2);
  font-size: 14px;
}
.head-stats {
  display: flex;
  gap: 10px;
}
.stat-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  min-width: 120px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}
.stat-box span {
  display: block;
  color: var(--text-3);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stat-box strong {
  display: block;
  margin-top: 5px;
  font-size: 14px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 12px;
}
.filter-chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-2);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 700;
}
.filter-chip.active {
  color: var(--brand);
  border-color: #8eb3f6;
  background: #edf4ff;
}

.table-shell {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: auto;
}
.market-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}
.market-table th,
.market-table td {
  padding: 11px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line-2);
  font-size: 13px;
  white-space: nowrap;
}
.market-table th {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
  background: var(--surface-2);
}
.market-table th.sortable { cursor: pointer; }
.market-table tr:hover td { background: #f8fbff; }
.market-table tr:last-child td { border-bottom: 0; }

.token-cell {
  display: flex;
  align-items: center;
  gap: 9px;
}
.token-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
  font-family: "Space Grotesk", sans-serif;
}
.token-meta strong { display: block; font-size: 13px; }
.token-meta span { display: block; font-size: 11px; color: var(--text-3); }
.category-badge {
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 4px 9px;
  border: 1px solid transparent;
}
.pd-source {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 11px;
  color: var(--text-2);
}
.pd-time {
  color: var(--text-3);
  font-size: 11px;
  margin-left: 8px;
}
.price-up { color: var(--up); font-weight: 700; }
.price-down { color: var(--down); font-weight: 700; }
.trade-link {
  border: 1px solid #9fc0fb;
  background: #edf4ff;
  color: var(--brand);
  border-radius: 9px;
  padding: 5px 10px;
  font-weight: 700;
  font-size: 12px;
}

.trade-grid {
  display: grid;
  grid-template-columns: 250px 1fr 250px;
  gap: 12px;
  min-height: calc(100vh - var(--topbar-h) - var(--ticker-h) - 44px);
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel__head {
  padding: 12px;
  border-bottom: 1px solid var(--line-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.panel__head h2,
.panel__head h3 { margin: 0; font-family: "Space Grotesk", sans-serif; }
.panel__head input {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 6px 9px;
  font-size: 13px;
}

.pair-list {
  max-height: calc(100vh - 240px);
  overflow: auto;
}
.pair-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-2);
  cursor: pointer;
}
.pair-item:hover { background: #f7faff; }
.pair-item.active {
  background: #edf4ff;
  border-left: 2px solid var(--brand);
}
.pair-item .name { font-size: 11px; color: var(--text-3); }
.pair-item .value { text-align: right; font-size: 12px; }

.chart-panel { display: flex; flex-direction: column; overflow: hidden; }
.pair-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line-2);
  background: var(--surface-2);
}
.pair-symbol {
  font-family: "Space Grotesk", sans-serif;
  font-size: 18px;
  font-weight: 700;
}
.pair-price {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
}
.pair-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(84px, 1fr));
  gap: 10px;
}
.pair-meta span {
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.pair-meta strong {
  display: block;
  margin-top: 3px;
  font-size: 12px;
}

.chart-switch,
.mini-tabs,
.tabs {
  display: flex;
  gap: 6px;
  align-items: center;
}
.chip-btn,
.mini-tab,
.tab {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-2);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
}
.tab { flex: 1; }
.chip-btn.active,
.mini-tab.active,
.tab.active {
  color: var(--brand);
  background: #edf4ff;
  border-color: #9bbcf7;
}
.chart-zoom {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
  padding-left: 6px;
  border-left: 1px solid var(--line);
}
.zoom-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-2);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 8px;
  line-height: 1;
}
.zoom-btn:hover {
  color: var(--brand);
  border-color: #9bbcf7;
  background: #edf4ff;
}
.zoom-btn--reset {
  padding: 5px 10px;
}
.zoom-label {
  min-width: 42px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
}

.chart-wrap {
  position: relative;
  min-height: 320px;
  max-height: 420px;
  padding: 10px 10px 4px;
}
.chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text-3);
  font-size: 14px;
  background: rgba(248, 251, 255, 0.78);
}
.chart-empty.hidden { display: none; }

.trade-bottom {
  display: grid;
  grid-template-columns: 320px 1fr;
  border-top: 1px solid var(--line-2);
  min-height: 320px;
}
.order-form {
  border-right: 1px solid var(--line-2);
  display: flex;
  flex-direction: column;
}
.order-form .tabs {
  padding: 10px;
  border-bottom: 1px solid var(--line-2);
}
.form-grid {
  padding: 12px;
  display: grid;
  gap: 10px;
}
.form-grid label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
}
.form-grid input[type="number"],
.form-grid input[type="text"] {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 10px;
  font-size: 13px;
}
.range-label input[type="range"] { width: 100%; }
.totals {
  display: grid;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
}
.totals div {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}
.totals span { color: var(--text-3); }

.orderbook {
  display: flex;
  flex-direction: column;
}
.orderbook__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-2);
}
.orderbook__head h3 { margin: 0; font-size: 14px; }
.ob-label {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  padding: 7px 12px;
  color: var(--text-3);
  font-size: 11px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line-2);
}
.ob-list { flex: 1; overflow: auto; }
.ob-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  padding: 5px 12px;
  font-size: 12px;
  position: relative;
}
.ob-row .depth {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  opacity: 0.14;
}
.ob-row.ask .price { color: var(--down); }
.ob-row.bid .price { color: var(--up); }
.ob-spread {
  text-align: center;
  padding: 6px;
  font-size: 12px;
  font-weight: 700;
  border-top: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
  background: var(--surface-2);
}

.trade-feed {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.small-head { padding: 10px 12px; }
.recent-trades {
  flex: 1;
  overflow: auto;
  min-height: 200px;
}
.recent-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  padding: 5px 12px;
  border-bottom: 1px solid var(--line-2);
  font-size: 12px;
}
.recent-row .t { color: var(--text-3); }
.empty {
  color: var(--text-3);
  font-size: 12px;
  padding: 14px 12px;
}

.section-title {
  margin: 0 0 12px;
  font-family: "Space Grotesk", sans-serif;
}
.portfolio-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.portfolio-stats article {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}
.portfolio-stats span {
  color: var(--text-3);
  font-size: 11px;
  text-transform: uppercase;
}
.portfolio-stats strong {
  display: block;
  margin-top: 4px;
  font-size: 19px;
  font-family: "Space Grotesk", sans-serif;
}
.portfolio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.canvas-wrap {
  height: 280px;
  padding: 4px 12px 12px;
}
.holdings-list {
  padding: 6px 12px 12px;
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
}
.hold-item {
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.hold-item .meta { display: flex; gap: 8px; align-items: center; }

/* ─── ABOUT SECTION ─── */
.about-layout {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 40px;
}
.about-hero { text-align: center; padding: 40px 20px 0; }
.about-hero h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 36px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
}
.gradient-text {
  background: linear-gradient(135deg, #1756d6, #ff8c00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.about-lead {
  font-size: 15px;
  color: var(--text-2);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}
.about-lead strong { color: var(--text); }
.about-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.about-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  transition: border-color .2s, transform .2s;
}
.about-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.about-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #eaf1ff;
  color: var(--brand);
  display: grid;
  place-items: center;
  font-size: 20px;
  margin-bottom: 14px;
}
.about-card h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
}
.about-card p {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
  margin: 0;
}
.token-grid h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}
.token-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.token-badge-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s;
}
.token-badge-item:hover { border-color: var(--brand); color: var(--brand); }
.token-badge-item__icon {
  width: 20px;
  height: 20px;
  border-radius: 3px;
  display: grid;
  place-items: center;
  font-size: 7px;
  font-weight: 800;
}
.category-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.cat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-2);
}
.cat-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.cat-dot.hree { background: #c084fc; }
.cat-dot.lmree { background: #60a5fa; }
.cat-dot.pgm { background: #f0b90b; }
.cat-dot.tech { background: #0ecb81; }
.cat-dot.industrial { background: #fb923c; }
.cat-dot.processed-base { background: #2563eb; }
.cat-dot.agri { background: #34d399; }

.mobile-nav {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.5);
  z-index: 150;
}
.modal.open { display: flex; }
.modal__dialog {
  width: min(420px, calc(100vw - 20px));
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.24);
}
.modal__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line-2);
  padding: 12px 14px;
}
.modal__head h3 { margin: 0; }
.modal__head button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  width: 30px;
  height: 30px;
}
.wallet-options {
  padding: 12px;
  display: grid;
  gap: 8px;
}
.wallet-option {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}
.wallet-option img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.wallet-option .wallet-icon {
  width: 28px;
  height: 28px;
  display: block;
  flex: 0 0 28px;
}
.wallet-option i {
  font-size: 22px;
  color: var(--brand);
}
.wallet-note {
  margin: 0;
  color: var(--text-3);
  font-size: 12px;
  text-align: center;
  padding: 0 12px 12px;
}

.wallet-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #9ddabc;
  background: #ebfbf3;
  color: #0b8f58;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 7px 10px;
}
.wallet-tag span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #0b8f58;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 200;
  padding: 10px 12px;
  border-radius: 10px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  transform: translateY(8px);
  transition: all .24s ease;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.toast.success { background: var(--up); }
.toast.error { background: var(--down); }
.toast.info { background: var(--brand); }

@media (max-width: 1240px) {
  .trade-grid { grid-template-columns: 230px 1fr; }
  .trade-feed { display: none; }
  .about-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 980px) {
  :root { --mobile-nav-h: 62px; }
  .desktop-nav { display: none; }
  .topbar { padding-inline: 10px; }
  .brand img {
    height: auto;
    width: min(64vw, 250px);
    max-height: 38px;
  }
  .live-pill,
  #notifyBtn { display: none; }
  #connectWalletBtn {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    padding: 0;
    font-size: 0;
    justify-content: center;
  }
  #connectWalletBtn i { font-size: 13px; margin: 0; }

  .section-head { flex-direction: column; align-items: stretch; }
  .section-head h1 { font-size: 24px; }
  .section-head p { font-size: 13px; }
  .head-stats { overflow: auto; }
  .stat-box { min-width: 118px; }

  .table-shell {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .market-table { min-width: 840px; }
  .filters { gap: 6px; }
  .filter-chip { font-size: 11px; padding: 6px 10px; }

  .trade-grid {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .panel__head {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .panel__head input {
    width: 100%;
  }
  .pair-list {
    max-height: 180px;
    display: flex;
    overflow: auto;
  }
  .pair-item {
    min-width: 210px;
    border-bottom: 0;
    border-right: 1px solid var(--line-2);
  }

  .trade-bottom { grid-template-columns: 1fr; }
  .order-form { border-right: 0; border-bottom: 1px solid var(--line-2); }
  .orderbook__head {
    flex-wrap: wrap;
    gap: 8px;
  }
  #depthTabs {
    width: 100%;
    flex-wrap: wrap;
  }
  .chart-switch {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  .chart-zoom {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
    width: 100%;
    justify-content: flex-end;
  }
  .pair-meta {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .chart-wrap {
    min-height: 280px;
    max-height: 360px;
    padding: 8px 8px 4px;
  }

  .portfolio-stats { grid-template-columns: 1fr 1fr; }
  .portfolio-grid { grid-template-columns: 1fr; }
  .canvas-wrap { height: 240px; }
  .hold-item {
    align-items: flex-start;
    gap: 10px;
  }

  .about-layout { gap: 26px; }
  .about-hero { padding: 22px 10px 0; }
  .about-hero h1 { font-size: 30px; }
  .about-lead { font-size: 14px; }
  .about-cards { grid-template-columns: 1fr; }
  .about-card { padding: 18px; }
  .category-legend {
    padding: 14px;
    gap: 10px;
  }
  .cat-item {
    width: 100%;
    font-size: 11px;
  }

  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 120;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    height: var(--mobile-nav-h);
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    backdrop-filter: blur(10px);
  }
  .mobile-nav .nav-btn {
    border: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: var(--text-2);
    padding: 0;
  }
  .mobile-nav .nav-btn i { font-size: 14px; }
  .mobile-nav .nav-btn.active { color: var(--brand); }
}

@media (max-width: 680px) {
  :root { --topbar-h: 62px; }
  .brand img {
    width: min(70vw, 220px);
    max-height: 32px;
  }
  .app-main { padding: 10px; }
  .topbar { padding-inline: 8px; }
  .market-table th,
  .market-table td { padding-inline: 10px; }
  .market-table { min-width: 760px; }
  .token-meta strong { font-size: 12px; }
  .token-meta span { font-size: 10px; }
  .pair-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pair-price { font-size: 20px; }
  .pair-symbol { font-size: 15px; }
  .pair-item { min-width: 180px; }
  .trade-bottom { min-height: 0; }
  .orderbook { min-height: 250px; }
  .order-form .tabs { padding: 8px; }
  .form-grid { padding: 10px; gap: 8px; }

  .chart-zoom { margin-left: 0; border-left: 0; padding-left: 0; }
  .zoom-btn { padding: 5px 7px; }
  .zoom-btn--reset { padding: 5px 8px; }
  .zoom-label { min-width: 38px; font-size: 10px; }

  .about-layout { gap: 20px; }
  .about-cards { grid-template-columns: 1fr; }
  .token-badges { gap: 6px; }
  .token-badge-item {
    padding: 6px 10px;
    font-size: 11px;
  }
  .token-grid h2 { font-size: 16px; }

  .portfolio-stats { grid-template-columns: 1fr; }
  .modal__dialog { width: calc(100vw - 14px); }
  .wallet-option { font-size: 13px; padding: 9px 10px; }
  .toast { bottom: calc(var(--mobile-nav-h) + 10px); }
}

@media (max-width: 520px) {
  .topbar {
    padding-inline: 6px;
    gap: 6px;
  }
  .topbar__left { gap: 10px; }
  .brand img {
    width: min(72vw, 190px);
    max-height: 30px;
  }
  #connectWalletBtn {
    width: 32px;
    height: 32px;
  }
  .section-head h1 { font-size: 21px; }
  .section-head p { font-size: 12px; }
  .head-stats { gap: 8px; }
  .stat-box { min-width: 106px; padding: 9px 10px; }

  .pair-head {
    padding: 10px;
    gap: 8px;
  }
  .pair-symbol { font-size: 14px; }
  .pair-price { font-size: 18px; }
  .pair-meta {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .chart-wrap {
    min-height: 250px;
    max-height: 310px;
  }
  .chart-switch {
    justify-content: flex-start;
    gap: 5px;
  }
  .chip-btn {
    font-size: 11px;
    padding: 5px 8px;
  }
  .chart-zoom {
    justify-content: flex-start;
    gap: 5px;
  }
  .zoom-label {
    min-width: 34px;
    font-size: 10px;
  }

  .mobile-nav .nav-btn span {
    font-size: 9px;
    line-height: 1.05;
  }
  .mobile-nav .nav-btn i { font-size: 13px; }
}
