body{
  --bg:#101318;
  --panel:#1b2028;
  --text:#e8e9ed;
  --muted:#a0a6b2;
  --accent:#d6a95a;
  --accent-2:#f0c77a;
  --border:#2b313a;
  --shadow:0 12px 30px rgba(0,0,0,.35);
  --input-bg:#111827;
  --input-border:#374151;
  padding:0;
  font-family:'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}
html[data-theme="dark"]{
  --bg:#101318;
  --panel:#1b2028;
  --text:#e8e9ed;
  --muted:#a0a6b2;
  --accent:#d6a95a;
  --accent-2:#f0c77a;
  --border:#2b313a;
  --shadow:0 12px 30px rgba(0,0,0,.35);
  --input-bg:#111827;
  --input-border:#374151;
}
html[data-theme="light"]{
  --bg:#f6f7fb;
  --panel:#ffffff;
  --text:#0b1220;
  --muted:#475569;
  --accent:#f59e0b;
  --accent-2:#f97316;
  --border:#e2e8f0;
  --shadow:0 10px 30px rgba(15,23,42,.08);
  --input-bg:#ffffff;
  --input-border:#cbd5e1;
}
body.dark{
  --bg:#101318;
  --panel:#1b2028;
  --text:#e8e9ed;
  --muted:#a0a6b2;
  --accent:#d6a95a;
  --accent-2:#f0c77a;
  --border:#2b313a;
  --shadow:0 12px 30px rgba(0,0,0,.35);
  --input-bg:#111827;
  --input-border:#374151;
}
body.light{
  --bg:#f6f7fb;
  --panel:#ffffff;
  --text:#0b1220;
  --muted:#475569;
  --accent:#f59e0b;
  --accent-2:#f97316;
  --border:#e2e8f0;
  --shadow:0 10px 30px rgba(15,23,42,.08);
  --input-bg:#ffffff;
  --input-border:#cbd5e1;
}
.container{
  width:100%;
  max-width:1200px;
  margin:18px auto 0;
  padding:0 16px 18px;
}
h2{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:18px;
  font-size:22px;
  font-weight:600;
  color: var(--text);
}
.page-subtitle{
  font-size:13px;
  color: var(--muted);
  line-height:1.4;
  margin-bottom:14px;
}
.update-timer{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:4px 10px;
  border-radius:999px;
  border:1px solid rgba(240, 199, 122, 0.35);
  background:rgba(240, 199, 122, 0.12);
  font-size:12px;
  font-weight:600;
  color: var(--text);
  letter-spacing:0.02em;
}

.update-timer .update-label{
  font-size:11px;
  font-weight:700;
  letter-spacing:0.08em;
  text-transform:uppercase;
  color: var(--accent-2);
}

.update-timer .update-value{
  font-variant-numeric: tabular-nums;
  font-family: "SFMono-Regular", "Consolas", "Liberation Mono", monospace;
}


.toolbar{
  display:flex;
  gap:10px;
  margin-bottom:10px;
  flex-wrap:wrap;
  align-items:center;
  position:relative;
  z-index:10;
}

.toolbar .update-timer{
  margin-left:auto;
  margin-right:12px;
}

.toolbar .form-control,
.toolbar .btn{
  border-radius:10px;
  border:1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
}

.toolbar .btn,
.toolbar .dropdown-toggle{
  white-space:nowrap;
}

.toolbar .dropdown-menu{
  background: var(--panel);
  border:1px solid var(--border);
  z-index:1060;
  color: var(--text);
}

.toolbar .form-control::placeholder{
  color: var(--muted);
}

.toolbar .btn-outline-primary{
  border-color: var(--input-border);
  color: var(--text);
}

.toolbar .btn-outline-primary:hover{
  background: var(--panel);
}

.token-search{
  width:180px;
}

.btn-outline-dark{
  border-radius:999px;
}

.view-switch .btn-group{
  display:inline-flex;
  align-items:stretch;
  flex-wrap:nowrap;
  gap:0;
  border:1px solid var(--input-border);
  border-radius:12px;
  overflow:hidden;
  background: var(--input-bg);
}

.view-switch .btn-group > .btn,
.view-switch .btn-group > .btn-group > .btn{
  margin:0 !important;
  border-radius:0;
  border-width:0 1px 0 0;
  border-color:var(--input-border);
  box-shadow:none;
}

.view-switch .btn-group > .btn:last-child{
  border-right-width:0;
}

.view-switch .btn-group > .btn-group{
  display:inline-flex;
  margin:0;
}

.view-switch .btn{
  border-radius:0;
  padding:6px 12px;
  font-weight:600;
  font-size:13px;
}
.view-switch .btn.active{
  pointer-events:none;
}

.view-switch .btn.btn-primary.active{
  color:#1f2937 !important;
  background:rgba(59,130,246,.16) !important;
  border-color:rgba(59,130,246,.48) !important;
}
body.dark .view-switch .btn-outline-primary{
  border-color:#888;
  color:#ddd;
}
body.dark .view-switch .btn-outline-primary:hover{
  background:#444;
  border-color:#aaa;
  color:#fff;
}

body.dark .view-switch .btn.btn-primary.active{
  color:#dbeafe !important;
  background:rgba(59,130,246,.24) !important;
  border-color:rgba(96,165,250,.56) !important;
}

body.dark .update-timer{
  border-color:rgba(229, 186, 110, 0.35);
  background:rgba(229, 186, 110, 0.16);
}


#exFilter{
  width:330px;
  max-width:92vw;
  max-height:70vh;
  overflow:hidden;
}
.exch-scroll{
  max-height:56vh;
  overflow:auto;
}
.exch-item{
  display:flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  margin-bottom:6px;
  border:1px solid #e5e7eb;
  border-radius:10px;
  background:#fff;
  font-size:14px;
  line-height:1.2;
}
.exch-item input{ margin:0; }
.exch-item img{ width:16px;height:16px; }
.exch-item:hover{ background:#f7f7f7; }


.table-wrapper{
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  border-radius:8px;
  display:block;
  padding:0;
  position:relative;
  min-height:0;
}

.table-loading{
  position:absolute;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:12px;
  border-radius:12px;
  background:rgba(16, 19, 24, 0.65);
  color: var(--text);
  font-weight:600;
  z-index:5;
}

body:not(.dark) .table-loading{
  background:rgba(255, 255, 255, 0.85);
  color:#2b313a;
}

.table-loading .spinner{
  width:18px;
  height:18px;
  border-radius:50%;
  border:2px solid rgba(240, 199, 122, 0.35);
  border-top-color: var(--accent-2);
  animation: spin 0.9s linear infinite;
}

body:not(.dark) .table-loading .spinner{
  border-color:rgba(43, 49, 58, 0.2);
  border-top-color:rgba(181, 132, 31, 0.85);
}

.table-loading .loading-text{
  font-size:13px;
}

.table-wrapper.is-loading .table-loading{
  display:flex;
}

.table-wrapper.is-loading table{
  opacity:0.4;
  pointer-events:none;
}

@keyframes spin{
  to { transform: rotate(360deg); }
}
table{
  width:100%;
  border-collapse:collapse;
  background: var(--panel);
  border-radius:12px;
  overflow:hidden;
  box-shadow: var(--shadow);
}
thead{
  background:#151821;
}
thead th{
  position:sticky;
  top:0;
  z-index:4;
  background:#151821;
  font-weight:700;
  color:#cfd8dc;
  text-transform:uppercase;
  font-size:11px;
  letter-spacing:.4px;
  padding:8px 6px;
  text-align:center;
  white-space:nowrap;
}
th,td{
  padding:6px 6px;
  text-align:center;
  font-size:13px;
  border-bottom:1px solid var(--border);
  white-space:nowrap;
  color: var(--text);
  vertical-align:middle;
}

#spot-table{
  width:100%;
  min-width:980px;
  max-width:100%;
  border-left:1px solid var(--border);
  border-right:1px solid var(--border);
}

#spot-table th:nth-child(1),
#spot-table td:nth-child(1){
  width:170px;
  min-width:170px;
  text-align:center;
}

body.dark #spot-table td.cell-token[data-label="Token"],
body.dark.table-mobile-ref #spot-table td.cell-token[data-label="Token"]{
  text-align:center !important;
}

#spot-table th:nth-child(2),
#spot-table td:nth-child(2){
  width:300px;
  min-width:300px;
}

#spot-table th,
#spot-table td{
  padding-top:6px;
  padding-right:4px;
  padding-bottom:6px;
  padding-left:4px;
}

#spot-table td[data-label="Token"] a{
  color:#2f8cff;
  text-decoration:none;
  font-weight:700;
}

#spot-table td[data-label="Token"] a:hover{
  color:#63b2ff;
  text-decoration:underline;
}

#spot-table td[data-label="Token"] mark{
  background:rgba(255,255,0,.18);
  padding:0 2px;
}

.spot-exchange .exchange-cell{
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:4px;
  width:100%;
  max-width:300px;
  margin:0 auto;
}

.spot-exchange .exchange-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:6px;
  min-height:28px;
  width:100%;
  padding:3px 6px;
  border-radius:6px;
  background:#fafafa;
}

.spot-exchange .exchange-name{
  display:flex;
  align-items:center;
  gap:6px;
  min-width:0;
  width:110px;
  white-space:nowrap;
  overflow:hidden;
}

.spot-exchange .exchange-price-wrap{
  display:flex;
  align-items:center;
}

.spot-exchange .exchange-name .ex-badge{
  display:flex;
  align-items:center;
  flex:0 1 auto;
  min-width:0;
  max-width:100%;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
  color:inherit;
  font-size:13px;
  font-weight:500;
  gap:4px;
  overflow:hidden;
  text-decoration:none;
}

.spot-exchange .exchange-name .ex-badge span{
  display:inline-block;
  min-width:0;
  max-width:82px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.spot-exchange .exchange-name .ex-badge img{
  flex:0 0 auto;
  width:16px;
  height:16px;
}

.spot-exchange .exchange-name .ex-tag{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  min-width:42px;
  padding:2px 6px;
  border-radius:999px;
  font-size:10px;
  font-weight:700;
  line-height:1.1;
  letter-spacing:.02em;
  text-transform:uppercase;
}

.spot-exchange .exchange-name .ex-tag.buy{
  background:#dbeafe;
  color:#1e3a8a;
}

.spot-exchange .exchange-name .ex-tag.sell{
  background:#fee2e2;
  color:#7f1d1d;
}

.spot-exchange .exchange-price{
  flex:0 0 auto;
  min-width:70px;
  text-align:right;
  color:#333;
  font-size:13px;
  font-weight:400;
  font-variant-numeric:tabular-nums;
}

.spot-exchange .bg-long,
.spot-exchange .bg-short{
  border-radius:6px;
  padding:2px 6px;
  display:inline-flex;
  align-items:center;
  gap:6px;
}

.token-label-content{
  display:inline-flex;
  align-items:flex-start;
  gap:2px;
  min-width:0;
  max-width:100%;
  vertical-align:middle;
}

.token-label-text{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.token-new-badge{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:12px;
  height:12px;
  border:1px solid rgba(34,197,94,.7);
  border-radius:999px;
  background:rgba(34,197,94,.18);
  color:#22c55e;
  padding:0;
  margin-left:2px;
  transform:translateY(-.05em);
  font-size:8px;
  font-weight:800;
  line-height:1;
  letter-spacing:0;
}

.matched-new-token-links{
  margin-top:12px;
  padding:6px 8px;
  border:1px solid rgba(148,163,184,.12);
  border-radius:8px;
  background:rgba(15,23,42,.35);
}
.matched-new-token-links[hidden]{
  display:none!important;
}
.matched-new-token-links__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:6px;
}
.matched-new-token-links__title{
  display:inline-flex;
  align-items:center;
  min-height:0;
  margin:0;
  padding:0;
  border:none;
  background:transparent;
  color:rgba(148,163,184,.82);
  font-size:11px;
  font-weight:700;
  line-height:1;
  letter-spacing:.08em;
  text-transform:uppercase;
  white-space:nowrap;
}
.matched-new-token-links__meta{
  display:inline-flex;
  align-items:center;
  min-height:26px;
  font-size:12px;
  color:rgba(148,163,184,.86);
  background:rgba(30,41,59,.4);
  border:1px solid rgba(148,163,184,.16);
  border-radius:999px;
  padding:0 8px;
}
.matched-new-token-links__items{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}
.matched-new-token-link{
  display:inline-flex;
  align-items:center;
  min-height:24px;
  padding:3px 8px;
  border-radius:8px;
  border:1px solid rgba(96,165,250,.28);
  background:rgba(15,23,42,.6);
  color:#e2e8f0;
  font-size:12px;
  font-weight:700;
  text-decoration:none;
}
.page-title-row{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.page-info-icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:22px;
  height:22px;
  border-radius:999px;
  border:1px solid rgba(148,163,184,.45);
  color:rgba(226,232,240,.9);
  font-size:12px;
  font-weight:800;
  text-decoration:none;
}
.page-info-icon:hover,
.page-info-icon:focus{
  color:#fff;
  border-color:rgba(59,130,246,.6);
  text-decoration:none;
}
.page-info-sheet{
  position:relative;
  margin-top:10px;
  border:1px solid rgba(148,163,184,.18);
  background:rgba(10,16,24,.88);
  box-shadow:0 16px 32px rgba(0,0,0,.28);
  border-radius:10px;
  max-height:0;
  opacity:0;
  overflow:hidden;
  transition:max-height .2s ease, opacity .2s ease;
}
.page-info-sheet[open]{
  max-height:70vh;
  opacity:1;
}
.page-info-sheet summary{
  display:none;
}
.page-info-sheet .spot-seo-disclosure-body{
  max-height:70vh;
  overflow:auto;
  padding:22px 24px 26px;
}
.page-info-sheet .page-info-sheet__close{
  position:absolute;
  top:12px;
  right:16px;
  width:28px;
  height:28px;
  border-radius:999px;
  border:1px solid rgba(148,163,184,.35);
  background:transparent;
  color:rgba(226,232,240,.9);
  font-size:16px;
  font-weight:700;
  line-height:1;
  cursor:pointer;
}
.page-info-sheet .page-info-sheet__close:hover,
.page-info-sheet .page-info-sheet__close:focus{
  color:#fff;
  border-color:rgba(59,130,246,.6);
}
.matched-new-token-link:hover,
.matched-new-token-link:focus{
  color:#fff;
  border-color:rgba(59,130,246,.6);
  text-decoration:none;
}
.matched-new-token-empty{
  color:rgba(148,163,184,.9);
  font-size:12px;
}
.matched-new-token-links.is-compact{
  display:flex;
  align-items:center;
  gap:10px 12px;
  flex-wrap:wrap;
}
.matched-new-token-links.is-compact .matched-new-token-links__head{
  display:contents;
}
.matched-new-token-links.is-compact .matched-new-token-links__items{
  order:2;
  gap:6px;
  flex:1 1 280px;
  min-width:0;
}
.matched-new-token-links.is-compact .matched-new-token-links__title{
  order:1;
  margin:0;
  white-space:nowrap;
}
.matched-new-token-links.is-compact .matched-new-token-links__meta{
  order:3;
  margin-left:auto;
  white-space:nowrap;
}
.matched-new-token-links.is-compact .matched-new-token-empty{
  white-space:nowrap;
}
body.light .matched-new-token-links{
  border-color:rgba(148,163,184,.22);
  background:rgba(255,255,255,.82);
}
body.light .matched-new-token-links__title{
  color:rgba(71,85,105,.88);
}
body.light .matched-new-token-links__meta{
  color:rgba(71,85,105,.88);
  background:rgba(241,245,249,.92);
  border-color:rgba(148,163,184,.22);
}
body.light .matched-new-token-link{
  border-color:rgba(148,163,184,.3);
  background:#fff;
  color:#0f172a;
}
body.light .matched-new-token-link:hover,
body.light .matched-new-token-link:focus{
  color:#0f172a;
  border-color:rgba(59,130,246,.35);
  background:rgba(248,250,252,.98);
}
body.light .matched-new-token-empty{
  color:rgba(71,85,105,.9);
}

.mobile-token-cell a{
  color:#2f8cff;
  text-decoration:none;
  font-weight:700;
}

.mobile-token-cell a:hover{
  color:#63b2ff;
  text-decoration:underline;
}


.ex-badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:3px 8px;
  border-radius:999px;
  background:#f0f3f8;
  border:1px solid #e0e6ef;
  color: var(--text);
  font-weight:600;
  text-decoration:none;
}
.ex-badge img{ width:16px;height:16px; }


.num{
  font-variant-numeric:tabular-nums;
}


.sp-pill{
  display:inline-block;
  min-width:64px;
  border-radius:6px;
  padding:5px 7px;
  font-weight:700;
  text-align:center;
  font-variant-numeric:tabular-nums;
}
.sp-pos{
  background:#0a0f0a;
  color:#dfe4ec;
  border:1px solid rgba(255,255,255,.055);
}
.sp-neg{
  background:#210b0b;
  color:#ffd6d6;
  border:1px solid rgba(255,255,255,.055);
}


.spark{ width:86px;height:22px; }
.spark svg{
  display:block;
  width:86px;
  height:22px;
}
.spark path{
  fill:none;
  stroke-width:1.5;
}
.spark .pos{ stroke:#16c784; }
.spark .neg{ stroke:#ea3943; }
.spark .zero{ stroke:#5b6b7e; }


.dw-wrap{
  display:inline-flex;
  align-items:center;
  gap:6px;
  justify-content:center;
}
.dw{
  display:inline-flex;
  width:22px;
  height:22px;
  border-radius:999px;
  align-items:center;
  justify-content:center;
  font-weight:800;
  border:1px solid #d9e0ea;
  background:#f0f3f8;
  color:#334155;
}
.dw.ok{
  background:#e6fbf1;
  border-color:#baf0d3;
  color:#0b8f54;
}
.dw.bad{
  background:#ffe9e9;
  border-color:#ffc0c0;
  color:#b53d3d;
}
.dw.unk{
  background:#eef2f7;
  border-color:#e3e8f0;
  color:#556;
}


.vol{
  font-weight:700;
}
.vol-red{ color:#e11d48; }
.vol-yellow{ color:#b45309; }
.vol-green{ color:#15803d; }


tr.stale td{
  opacity:.65;
}


td.age{
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
}


body.dark{
  background: var(--bg);
  color:#e0e0e0;
}
body.dark table{
  background:#181818;
  color:#e0e0e0;
}
body.dark thead{
  background:#202020;
}
body.dark thead th{
  background:#1a1a1a;
  color:#ddd;
  border-bottom:1px solid #2b2b2b;
}
body.dark td{
  color:#ddd;
  border-bottom:1px solid #2a2a2a;
}
body.dark tbody tr:nth-child(even){ background:#131313; }
body.dark tbody tr:nth-child(odd){ background:#131313; }
body.dark .table-wrapper{
  border:1px solid #2f3846;
  border-radius:14px;
}
body.dark #spot-table{
  border:1px solid #333;
  border-radius:12px;
  overflow:hidden;
}
body.dark #spot-table td[data-label="Token"] a{
  color:#64b5ff;
}
body.dark #spot-table td[data-label="Token"] a:hover{
  color:#9cd3ff;
}
body.dark #spot-table td[data-label="Token"] mark{
  background:rgba(255,255,0,.28);
}
body.dark .spot-exchange .exchange-row{
  background:rgba(255,255,255,.035);
  border:0;
}
body.dark .spot-exchange .exchange-price{
  color:#c7cfdb;
}
body.dark .spot-exchange .bg-long{
  background:rgba(34,197,94,.18);
  color:#d8f8e4;
}
body.dark .spot-exchange .bg-short{
  background:rgba(244,63,94,.18);
  color:#ffd6dd;
}
body.dark .spot-exchange .exchange-name .ex-tag.buy{
  background:#1f3a5f;
  color:#cfe7ff;
}
body.dark .spot-exchange .exchange-name .ex-tag.sell{
  background:#4a1f1f;
  color:#ffd6d6;
}
#spot-table .spot-exchange .exchange-name .ex-badge,
body.dark #spot-table .spot-exchange .exchange-name .ex-badge{
  background:transparent !important;
  border-color:transparent !important;
  color:inherit !important;
  box-shadow:none !important;
}
body.dark .mobile-token-cell a{
  color:#64b5ff;
}
body.dark .mobile-token-cell a:hover{
  color:#9cd3ff;
}
body.dark .ex-badge{
  background:#1d2430;
  border-color:#2b374a;
  color:#dbe7ff;
}
body.dark .btn-outline-dark{
  color:#eee;
  border-color:#555;
}
body.dark .update-timer{
  color:#aaa;
}
body.dark .dw{
  background:#1d2430;
  border-color:#2b374a;
  color:#dbe7ff;
}
body.dark .dw.ok{
  background:#0b8f5415;
  border-color:#0b8f54;
  color:#64f0a3;
}
body.dark .dw.bad{
  background:#b53d3d20;
  border-color:#b53d3d;
  color:#ff9c9c;
}
body.dark .dw.unk{
  background:#2a3140;
  border-color:#3a4356;
  color:#9fb2d0;
}
body.dark #exFilter{
  background:#151515;
  border-color:#333;
}
body.dark .exch-item{
  background:#141414;
  border-color:#2a2a2a;
}
body.dark .exch-item:hover{
  background:#1a1a1a;
}


#err{
  display:none;
  position:fixed;
  left:0;
  right:0;
  top:0;
  z-index:9999;
  background:#fee2e2;
  color:#991b1b;
  border-bottom:1px solid #fecaca;
  padding:8px 12px;
  font-size:13px;
}
#err code{
  background:#fff;
  padding:0 6px;
  border:1px solid #fecaca;
  border-radius:4px;
}

@media (max-width:900px){
  .table-wrapper{
    padding:2px 4px 10px;
    overflow:visible;
    min-height:150px;
  }

  #spot-table{
    min-width:0;
    width:100%;
    border:0;
    background:transparent;
    box-shadow:none;
  }

  #spot-table thead{
    display:none;
  }

  #spot-table tbody{
    display:grid;
    grid-template-columns:1fr;
    gap:10px;
  }

  #spot-table tbody tr{
    display:grid;
    grid-template-columns:minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "token spread"
      "exchange exchange"
      "volbuy volsell"
      "dw age";
    gap:7px 8px;
    padding:10px;
    border:1px solid var(--border);
    border-radius:14px;
    background:linear-gradient(165deg, rgba(27, 32, 40, 0.96), rgba(16, 19, 24, 0.96));
    box-shadow:0 12px 24px rgba(0, 0, 0, 0.28);
  }

  body.light #spot-table tbody tr{
    background:linear-gradient(180deg, #ffffff, #f8fafc);
    box-shadow:0 10px 22px rgba(15, 23, 42, 0.09);
  }

  #spot-table tbody tr td{
    border:0;
    padding:0;
    margin:0;
    min-width:0;
    text-align:left;
    white-space:normal;
  }

  #spot-table tbody tr td::before{
    display:none;
  }

  #spot-table tbody tr .cell-token{ grid-area:token; align-self:center; text-align:center; }
  #spot-table tbody tr .cell-spread{ grid-area:spread; justify-self:end; }
  #spot-table tbody tr .cell-exchange{ grid-area:exchange; }
  #spot-table tbody tr .cell-vol-buy{ grid-area:volbuy; }
  #spot-table tbody tr .cell-vol-sell{ grid-area:volsell; }
  #spot-table tbody tr .cell-dw{ grid-area:dw; }
  #spot-table tbody tr .cell-age{ grid-area:age; justify-self:end; text-align:right; }

  #spot-table tbody tr .cell-token b{
    display:block;
    font-size:15px;
    line-height:1.1;
  }

  #spot-table tbody tr .cell-token a{
    color:#2f8cff;
    font-weight:700;
  }

  body.dark #spot-table tbody tr .cell-token a{
    color:#64b5ff;
  }

  #spot-table tbody tr .spot-exchange .exchange-cell{
    max-width:none;
  }

  .ex-badge{
    width:auto;
    max-width:100%;
    justify-content:flex-start;
    padding:3px 8px;
    font-size:11px;
    background:rgba(255,255,255,0.02);
  }

  body.light .ex-badge{
    background:#fff;
  }

  .ex-badge span{
    display:inline-block;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    max-width:120px;
  }

  .sp-pill{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border-radius:999px;
    padding:3px 10px;
    font-size:12px;
    font-weight:700;
    line-height:1.2;
  }

  #spot-table tbody tr .cell-vol-buy::before,
  #spot-table tbody tr .cell-vol-sell::before,
  #spot-table tbody tr .cell-dw::before,
  #spot-table tbody tr .cell-age::before{
    display:block;
    font-size:10px;
    font-weight:700;
    letter-spacing:.05em;
    text-transform:uppercase;
    color:var(--muted);
    margin-bottom:4px;
  }

  #spot-table tbody tr .cell-vol-buy::before{ content:"Vol Buy"; }
  #spot-table tbody tr .cell-vol-sell::before{ content:"Vol Sell"; }
  #spot-table tbody tr .cell-dw::before{ content:"W / D"; }
  #spot-table tbody tr .cell-age::before{ content:"Age"; }

  #spot-table tbody tr .cell-dw .dw-wrap{
    justify-content:flex-start;
  }

  #spot-table tbody tr .cell-age span{
    font-variant-numeric:tabular-nums;
  }

  .vol{
    font-size:12px;
    font-weight:700;
  }

  .dw{
    width:20px;
    height:20px;
    font-size:10px;
  }

  #spot-table tbody tr td[colspan]{
    grid-column:1 / -1;
    text-align:center;
    padding:8px 0;
  }
}

@media (max-width:560px){
  .table-wrapper{
    padding:2px 0 8px;
  }

  #spot-table tbody{
    gap:8px;
  }

  #spot-table tbody tr{
    padding:9px;
    border-radius:13px;
    gap:6px 7px;
  }

  #spot-table tbody tr .cell-token b{
    font-size:14px;
  }

  .ex-badge{
    font-size:10px;
    padding:3px 7px;
  }

  .sp-pill{
    font-size:11px;
    padding:3px 9px;
  }

  .dw{
    width:18px;
    height:18px;
  }
}


.mobile-table-switch{
  display:none;
}

@media (max-width:768px){
  .toolbar{
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    gap:6px;
    align-items:stretch;
    margin-bottom:8px;
  }

  .toolbar .view-switch{
    display:none !important;
  }

  .toolbar .mobile-table-switch{
    grid-column:1 / -1;
    width:100%;
    display:block;
  }

  .toolbar .mobile-table-switch > .btn{
    width:100%;
    min-height:34px;
    border-radius:10px;
    font-size:12px;
    font-weight:700;
    padding:5px 10px;
    text-align:left;
  }

  .toolbar .mobile-table-switch .dropdown-menu{
    width:100%;
    min-width:0;
    border-radius:12px;
    padding:4px;
  }

  .toolbar .mobile-table-switch .dropdown-item{
    border-radius:10px;
    padding:7px 10px;
    font-size:12px;
  }

  .toolbar .mobile-table-switch .dropdown-item.active{
    background:rgba(47,140,255,.16);
    color:var(--text);
  }

  .toolbar > .dropdown:not(.mobile-table-switch){
    grid-column:1 / 2;
    width:100% !important;
    margin-left:0 !important;
  }

  .toolbar > .dropdown:not(.mobile-table-switch) > .btn{
    min-height:36px;
    border-radius:10px;
    font-size:13px;
    padding-top:5px;
    padding-bottom:5px;
  }

  .toolbar > #last-update{
    grid-column:2 / 3;
    width:100% !important;
    margin:0 !important;
    justify-content:center;
    min-height:32px;
    border-radius:10px;
    font-size:10px;
    gap:4px;
    padding:1px 7px;
  }

  .toolbar > #last-update .update-label{
    font-size:9px;
  }

  .toolbar > #last-update .update-value{
    font-size:10px;
  }

  .toolbar > #tokenFilter{
    grid-column:1 / -1;
    width:100% !important;
    min-height:36px;
    border-radius:10px;
    font-size:15px;
    padding-top:5px;
    padding-bottom:5px;
  }

  .container{
    margin-top:12px;
    padding-left:10px;
    padding-right:10px;
  }

  h2{
    margin-bottom:6px;
    font-size:clamp(22px, 7.2vw, 34px);
    line-height:1.04;
  }

  .page-subtitle{
    margin-bottom:8px;
    font-size:clamp(12px, 3.8vw, 14px);
    line-height:1.22;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    overflow:hidden;
  }

  #exFilter{
    width:92vw;
  }

  .exch-item{
    padding:8px 10px;
    font-size:15px;
  }
}

@media (max-width: 480px){
  .toolbar{
    grid-template-columns:minmax(0,1fr) 106px;
    gap:5px;
  }

  .toolbar .mobile-table-switch > .btn{
    min-height:32px;
    font-size:11px;
    padding:4px 9px;
  }

  .toolbar > .dropdown:not(.mobile-table-switch) > .btn{
    min-height:34px;
    font-size:12px;
  }

  .toolbar > #last-update{
    min-height:30px;
    font-size:9.5px;
  }

  .toolbar > #tokenFilter{
    min-height:32px;
  }

  h2{
    margin-bottom:4px;
    font-size:clamp(20px, 7.6vw, 28px);
  }
}

@media (max-width: 420px){
  .page-subtitle{
    display:none;
  }

  .toolbar > #last-update{
    font-size:9px;
  }
}

img[src^="/uploads/exchange-logos/"]{
  width:18px;
  height:18px;
  object-fit:contain;
  border-radius:5px;
  background:transparent;
  box-shadow:none;
}
body.light img[src^="/uploads/exchange-logos/"]{
  background:transparent;
  box-shadow:none;
}

/* Mobile compact toolbar: one row (table switch + exchanges + search) */
@media (max-width: 768px){
  .toolbar{
    display:flex !important;
    flex-wrap:nowrap !important;
    align-items:center !important;
    gap:6px !important;
    overflow-x:auto;
    overflow-y:visible;
    -webkit-overflow-scrolling:touch;
    padding-bottom:2px;
    margin-bottom:8px !important;
    position:relative;
    z-index:1200;
    isolation:isolate;
  }

  .toolbar.dropdown-open,
  .toolbar:has(.dropdown.show){
    overflow:visible !important;
  }

  .toolbar .dropdown,
  .toolbar .mobile-table-switch{
    position:relative;
    z-index:1201;
  }

  .toolbar .dropdown-menu{
    z-index:1400 !important;
  }

  .table-wrapper{
    position:relative;
    z-index:1;
  }

  .toolbar .view-switch{
    display:none !important;
  }

  .toolbar .mobile-table-switch{
    display:block !important;
    width:auto !important;
    min-width:112px;
    flex:0 0 auto;
  }

  .toolbar .mobile-table-switch > .btn{
    width:auto !important;
    min-height:34px;
    border-radius:10px;
    font-size:12px;
    font-weight:700;
    padding:5px 10px;
    text-align:left;
    white-space:nowrap;
  }

  .toolbar .mobile-table-switch .dropdown-menu{
    width:220px !important;
    min-width:220px !important;
    max-width:90vw;
  }

  .toolbar > #calc-btn,
  .toolbar > #url-builder-btn,
  .toolbar > #signup-links-btn,
  .toolbar > #last-update-timer,
  .toolbar > #last-update{
    display:none !important;
  }

  .toolbar > .dropdown:not(.mobile-table-switch){
    grid-column:auto !important;
    width:auto !important;
    margin-left:0 !important;
    min-width:106px;
    flex:0 0 auto;
  }

  .toolbar > .dropdown:not(.mobile-table-switch) > .btn{
    width:auto !important;
    min-height:34px;
    border-radius:10px;
    font-size:12px;
    padding:5px 10px;
    white-space:nowrap;
  }

  .toolbar > .token-search,
  .toolbar > #tokenFilter{
    grid-column:auto !important;
    width:auto !important;
    min-height:34px;
    border-radius:10px;
    font-size:14px;
    padding-top:5px;
    padding-bottom:5px;
    min-width:140px;
    flex:1 0 140px;
  }
}

@media (max-width: 480px){
  .toolbar .mobile-table-switch{
    min-width:102px;
  }

  .toolbar > .dropdown:not(.mobile-table-switch){
    min-width:98px;
  }

  .toolbar > .token-search,
  .toolbar > #tokenFilter{
    min-width:126px;
    flex-basis:126px;
    font-size:13px;
  }
}

@media (min-width: 901px){
  body.dark .table-wrapper{
    border:1px solid rgba(88,101,120,.34) !important;
    border-radius:14px !important;
  }

  body.dark #spot-table{
    border:1px solid rgba(88,101,120,.34) !important;
    border-collapse:separate !important;
    border-spacing:0 !important;
    border-radius:12px !important;
    overflow:hidden !important;
  }

  body.dark #spot-table thead th:first-child{
    border-top-left-radius:12px;
  }

  body.dark #spot-table thead th:last-child{
    border-top-right-radius:12px;
  }

  body.dark #spot-table tbody tr:last-child td:first-child{
    border-bottom-left-radius:12px;
  }

  body.dark #spot-table tbody tr:last-child td:last-child{
    border-bottom-right-radius:12px;
  }
}

/* Final dark table frame override (all breakpoints) */
body.dark .table-wrapper{
  border:1px solid rgba(88,101,120,.34) !important;
  border-radius:14px !important;
  overflow:hidden;
}

body.dark #spot-table{
  border:1px solid rgba(88,101,120,.34) !important;
  border-collapse:separate !important;
  border-spacing:0 !important;
  border-radius:12px !important;
  overflow:hidden !important;
}

body.dark #spot-table thead th:first-child{
  border-top-left-radius:12px;
}

body.dark #spot-table thead th:last-child{
  border-top-right-radius:12px;
}

body.dark #spot-table tbody tr:last-child td:first-child{
  border-bottom-left-radius:12px;
}

body.dark #spot-table tbody tr:last-child td:last-child{
  border-bottom-right-radius:12px;
}
