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, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing:antialiased;
}
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);
}
.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;
}
.page-subtitle{
  font-size:13px;
  color: var(--muted);
  line-height:1.4;
  margin-bottom:14px;
}


.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 .vip-pill,
.mobile-table-switch .vip-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:24px;
  height:16px;
  padding:0 5px;
  border-radius:999px;
  font-size:9px;
  font-weight:700;
  letter-spacing:.05em;
  line-height:1;
  text-transform:uppercase;
  color:#5b3b00;
  background:#ffd76a;
  border:1px solid rgba(0,0,0,.08);
  vertical-align:middle;
}

.mobile-table-switch .dropdown-item .vip-pill{
  margin-left:auto;
}

.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 .view-switch .vip-pill,
body.dark .mobile-table-switch .vip-pill{
  color:#1f2937;
  background:#fbbf24;
  border-color:rgba(255,255,255,.14);
}

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


#exFilter,
#chainFilter,
#futFilter,
#spotFilter{
  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:7px 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 span{ color:#111827;font-weight:500; }
.exch-item:hover{
  background:#f3f4f6;
  border-color:#d1d5db;
}
body.dark #exFilter,
body.dark #chainFilter,
body.dark #futFilter,
body.dark #spotFilter{
  background:#151515;
  border-color:#333;
}
body.dark .exch-item{
  background:#111827;
  border-color:#374151;
}
body.dark .exch-item:hover{
  background:#1f2937;
  border-color:#4b5563;
}
body.dark .exch-item span{
  color:#f9fafb;
}


.table-wrapper{
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  border-radius:8px;
  display:block;
  padding:0 12px 12px;
  position:relative;
  min-height:220px;
}
body.light .table-wrapper,
body.dark .table-wrapper{
  background:transparent;
  border:0;
  box-shadow:none;
}

.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.42;
  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);
}
#dex-table{
  min-width:1140px;
  table-layout:fixed;
  width:100%;
  border-left:1px solid var(--border);
  border-right:1px solid var(--border);
}

body.dex-spread-page #dex-table th:nth-child(1),
body.dex-spread-page #dex-table td:nth-child(1){
  width:168px;
}
body.dex-spread-page #dex-table th:nth-child(2),
body.dex-spread-page #dex-table td:nth-child(2){
  width:240px;
}
body.dex-spread-page #dex-table th:nth-child(3),
body.dex-spread-page #dex-table td:nth-child(3){
  width:150px;
}
body.dex-spread-page #dex-table th:nth-child(4),
body.dex-spread-page #dex-table td:nth-child(4){
  width:120px;
}
body.dex-spread-page #dex-table th:nth-child(5),
body.dex-spread-page #dex-table td:nth-child(5){
  width:112px;
}
body.dex-spread-page #dex-table th:nth-child(6),
body.dex-spread-page #dex-table td:nth-child(6){
  width:128px;
}
body.dex-spread-page #dex-table th:nth-child(7),
body.dex-spread-page #dex-table td:nth-child(7){
  width:88px;
}

body.futures-dex-page #dex-table th:nth-child(1),
body.futures-dex-page #dex-table td:nth-child(1){
  width:168px;
}
body.futures-dex-page #dex-table th:nth-child(2),
body.futures-dex-page #dex-table td:nth-child(2){
  width:240px;
}
body.futures-dex-page #dex-table th:nth-child(3),
body.futures-dex-page #dex-table td:nth-child(3){
  width:188px;
}
body.futures-dex-page #dex-table th:nth-child(4),
body.futures-dex-page #dex-table td:nth-child(4){
  width:116px;
}
body.futures-dex-page #dex-table th:nth-child(5),
body.futures-dex-page #dex-table td:nth-child(5){
  width:120px;
}
body.futures-dex-page #dex-table th:nth-child(6),
body.futures-dex-page #dex-table td:nth-child(6){
  width:92px;
}
body.futures-dex-page #dex-table th:nth-child(7),
body.futures-dex-page #dex-table td:nth-child(7){
  width:110px;
}
body.futures-dex-page #dex-table th:nth-child(8),
body.futures-dex-page #dex-table td:nth-child(8){
  width:128px;
}
body.futures-dex-page #dex-table th:nth-child(9),
body.futures-dex-page #dex-table td:nth-child(9){
  width:88px;
}

body.futures-dex-page #dex-table{
  min-width:1250px;
}

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);
  vertical-align:middle;
  white-space:nowrap;
  color:var(--text);
}
tbody tr{
  background:transparent;
}
body.light tbody tr:nth-child(even){
  background:#fff;
}
body.light tbody tr:nth-child(odd){
  background:#fff;
}
body.light tbody tr:hover{
  background:#f7fbff;
}
body.dark tbody tr:nth-child(odd){
  background:#131313;
}
body.dark tbody tr:nth-child(even){
  background:#131313;
}
body.dark tbody tr:hover{
  background:#181c24;
}

td.token{
  text-align:left;
}
td.token a{
  color:#2f8cff;
  text-decoration:none;
  font-weight:700;
}
td.token a:hover{
  color:#63b2ff;
  text-decoration:underline;
}

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

.token-cell{
  display:grid;
  grid-template-columns:52px minmax(0, 1fr);
  align-items:center;
  column-gap:6px;
  min-width:0;
}
.token-cell a{
  justify-self:start;
  display:block;
  min-width:0;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.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 .dexspread-seo-disclosure-body,
.page-info-sheet .fdex-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);
}
.group-toggle{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:4px;
  min-width:46px;
  padding:2px 6px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.04);
  color:#9fb3c8;
  font-size:11px;
  line-height:1;
  cursor:pointer;
}
.group-toggle .caret{
  width:0;
  height:0;
  border-left:4px solid transparent;
  border-right:4px solid transparent;
  border-top:6px solid currentColor;
  transition:transform .2s ease;
}
.group-toggle.expanded .caret{
  transform:rotate(180deg);
}
.group-toggle.spacer{
  visibility:hidden;
}

.token-group-row.is-collapsed{
  display:none;
}
.token-group-row{
  background:rgba(47,140,255,.04);
}
body.dark .token-group-row{
  background:rgba(255,255,255,.03);
}

.exchange-cell{
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:4px;
}
.exchange-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:6px;
  padding:3px 6px;
  border-radius:6px;
  background:#fafafa;
  min-height:28px;
}
.exchange-name{
  display:flex;
  align-items:center;
  gap:6px;
  width:110px;
  min-width:110px;
  white-space:nowrap;
  overflow:hidden;
}
.exchange-name img{
  width:16px;
  height:16px;
}
.exchange-name span{
  font-weight:500;
  font-size:13px;
  white-space:nowrap;
}
.exchange-price{
  font-variant-numeric:tabular-nums;
  color:#333;
  font-size:13px;
  min-width:60px;
  text-align:right;
}
.bg-long,
.bg-short{
  border-radius:6px;
  padding:2px 6px;
  display:inline-flex;
  align-items:center;
  gap:6px;
}
.bg-long{
  background:#d4f8e6;
}
.bg-short{
  background:#f8d4d4;
}
body.dark .exchange-row{
  background:#1a1a1a;
}
body.dark .exchange-price{
  color:#999;
}
body.dark .bg-long{
  background:#2a4a36;
  color:#b9f6ca;
}
body.dark .bg-short{
  background:#4a2a2a;
  color:#ffbdbd;
}

.fund-wrap{
  display:inline-flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
  padding:5px 6px;
  background:#f3f4f6;
  border-radius:5px;
  border:1px solid #e1e4ea;
}
.fund-row{
  display:grid;
  grid-template-columns:76px 34px 60px;
  justify-content:center;
  align-items:center;
  column-gap:8px;
  line-height:1.4;
}
.fund-rate{
  display:block;
  font-weight:500;
  text-align:right;
  min-width:0;
  font-variant-numeric:tabular-nums;
}
.fund-interval{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:11px;
  font-weight:600;
  border-radius:4px;
  padding:2px 4px;
  text-align:center;
  color:#fff;
  min-width:0;
}
.timer{
  display:block;
  min-width:0;
  width:100%;
  text-align:center;
  font-size:11px;
  font-weight:400;
  font-variant-numeric:tabular-nums;
}
.fund-rate.is-empty,
.fund-interval.is-empty,
.timer.is-empty{
  text-align:center;
}
.fund-interval.is-empty{
  background:transparent !important;
  color:inherit !important;
  border:none !important;
  padding:0 !important;
}
body.dark .fund-wrap{
  background:rgba(255,255,255,.03);
  border-color:rgba(148,163,184,.14);
}
body.dark .timer{
  color:#d7deea;
}

.interval-1h{ --interval-bg:rgba(134,239,172,.18); --interval-border:rgba(134,239,172,.34); --interval-fg:#bbf7d0; }
.interval-2h{ --interval-bg:rgba(59,130,246,.14); --interval-border:rgba(59,130,246,.26); --interval-fg:#93c5fd; }
.interval-3h{ --interval-bg:rgba(132,204,22,.14); --interval-border:rgba(132,204,22,.26); --interval-fg:#bef264; }
.interval-4h{ --interval-bg:rgba(4,120,87,.22); --interval-border:rgba(4,120,87,.38); --interval-fg:#34d399; }
.interval-6h{ --interval-bg:rgba(234,179,8,.14); --interval-border:rgba(234,179,8,.28); --interval-fg:#fde68a; }
.interval-8h{ --interval-bg:rgba(249,115,22,.14); --interval-border:rgba(249,115,22,.28); --interval-fg:#fdba74; }
.interval-default{ --interval-bg:rgba(148,163,184,.14); --interval-border:rgba(148,163,184,.26); --interval-fg:#cbd5e1; }

.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;
}
body.dark .ex-badge{
  background:#1d2430;
  border-color:#2b374a;
  color:#dbe7ff;
}

.volume-col .vol-line{
  display:block;
  line-height:1.8;
  font-weight:600;
  margin:0;
  font-size:inherit;
  color:inherit;
  font-variant-numeric:tabular-nums;
}
body.dark .volume-col .vol-line{
  opacity:.85;
}

.sp-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:80px;
  border-radius:6px;
  padding:5px 7px;
  font-weight:700;
  font-variant-numeric:tabular-nums;
}
.sp-pos{
  background:#d4f8e6;
  color:#0b8f54;
  border:1px solid rgba(22,163,74,.18);
}
.sp-neg{
  background:#f8d4d4;
  color:#b53d3d;
  border:1px solid rgba(220,38,38,.16);
}
body.dark .sp-pos{
  background:#2a4a36;
  color:#bbf7d0;
  border-color:rgba(34,197,94,.28);
}
body.dark .sp-neg{
  background:#4a2a2a;
  color:#fecaca;
  border-color:rgba(248,113,113,.28);
}

.dir-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:4px 10px;
  border-radius:999px;
  font-size:11px;
  font-weight:700;
  white-space:nowrap;
}
.dir-up{
  background:rgba(34,197,94,0.12);
  color:#15803d;
}
.dir-down{
  background:rgba(248,113,113,0.13);
  color:#b91c1c;
}
body.dark .dir-up{
  background:rgba(34,197,94,0.25);
  color:#bbf7d0;
}
body.dark .dir-down{
  background:rgba(248,113,113,0.28);
  color:#fecaca;
}

.dw-wrap{
  display:inline-flex;
  align-items:center;
  gap:6px;
}
.dw{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:28px;
  height:28px;
  border-radius:999px;
  font-size:11px;
  font-weight:700;
  border:1px solid transparent;
}
.dw.ok{
  background:rgba(34,197,94,0.12);
  color:#15803d;
  border-color:rgba(34,197,94,0.2);
}
.dw.bad{
  background:rgba(248,113,113,0.14);
  color:#b91c1c;
  border-color:rgba(248,113,113,0.22);
}
.dw.unk{
  background:rgba(148,163,184,0.16);
  color:#475569;
  border-color:rgba(148,163,184,0.18);
}
body.dark .dw.ok{
  background:rgba(34,197,94,0.22);
  color:#bbf7d0;
  border-color:rgba(34,197,94,0.28);
}
body.dark .dw.bad{
  background:rgba(248,113,113,0.22);
  color:#fecaca;
  border-color:rgba(248,113,113,0.28);
}
body.dark .dw.unk{
  background:rgba(148,163,184,0.22);
  color:#e2e8f0;
  border-color:rgba(148,163,184,0.26);
}

.chain-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:4px;
  padding:5px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:600;
  background:rgba(148,163,184,0.14);
  color:#334155;
  white-space:nowrap;
}
.chain-pill small{
  margin-left:0;
  font-size:11px;
  opacity:.78;
}
body.dark .chain-pill{
  background:rgba(148,163,184,0.24);
  color:#e5e7eb;
}

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


body.dark .btn-outline-dark{
  color:#eee;
  border-color:#555;
}


.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){
    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 > .token-search,
  .toolbar > #tokenFilter{
    grid-column:1 / -1;
    width:100% !important;
    min-height:36px;
    border-radius:10px;
    font-size:15px;
    padding-top:5px;
    padding-bottom:5px;
  }

  .toolbar > #last-update-timer,
  .toolbar > #last-update{
    grid-column:1 / -1;
    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-timer .update-label,
  .toolbar > #last-update .update-label{
    font-size:9px;
  }

  .toolbar > #last-update-timer .update-value,
  .toolbar > #last-update .update-value{
    font-size: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;
  }

  #dex-table{
    min-width:940px;
  }
}

@media (max-width: 480px){
  .toolbar{
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    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-timer,
  .toolbar > #last-update{
    min-height:30px;
    font-size:9.5px;
  }

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

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

@media (max-width: 560px){
  body.futures-dex-page .fund-wrap{
    display:flex;
    width:100%;
    border-radius:10px;
    padding:6px 8px;
    overflow:hidden;
  }

  body.futures-dex-page .fund-row{
    width:100%;
    grid-template-columns:minmax(70px, 1fr) 34px 60px;
    column-gap:6px;
  }

  body.futures-dex-page .fund-rate{
    font-size:12px;
    font-weight:700;
  }

  body.futures-dex-page .timer{
    max-width:60px;
    overflow:hidden;
    font-size:10px;
    justify-self:end;
  }

  body.futures-dex-page #dex-table{
    min-width:1110px;
  }
}

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

  .toolbar > #last-update-timer,
  .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 #2a2a2a !important;
    border-radius:14px !important;
  }

  body.dark #dex-table{
    border:1px solid #2a2a2a !important;
    border-collapse:separate !important;
    border-spacing:0 !important;
    border-radius:12px !important;
    overflow:hidden !important;
  }

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

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

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

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

body.dark .table-wrapper{
  border:1px solid #2a2a2a !important;
  border-radius:14px !important;
  overflow:hidden;
}

body.dark #dex-table{
  border:1px solid #2a2a2a !important;
  border-collapse:separate !important;
  border-spacing:0 !important;
  border-radius:12px !important;
  overflow:hidden !important;
}

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

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

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

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

body.dark.dex-spread-page > .container .table-wrapper,
body.dark.futures-dex-page > .container .table-wrapper{
  background:transparent !important;
  border:1px solid #2a2a2a !important;
  border-radius:14px !important;
  box-shadow:none !important;
  padding-left:0 !important;
  padding-right:0 !important;
}

body.dark.dex-spread-page > .container #dex-table,
body.dark.futures-dex-page > .container #dex-table{
  background:transparent !important;
  border:1px solid #2a2a2a !important;
  border-left:1px solid #2a2a2a !important;
  border-right:1px solid #2a2a2a !important;
  border-radius:0 !important;
  box-shadow:none !important;
  overflow:visible !important;
}

body.dark.dex-spread-page .view-switch .vip-pill,
body.dark.dex-spread-page .mobile-table-switch .vip-pill,
body.dark.futures-dex-page .view-switch .vip-pill,
body.dark.futures-dex-page .mobile-table-switch .vip-pill{
  color:#1f2937 !important;
  background:#fbbf24 !important;
  border-color:rgba(255,255,255,.14) !important;
}

/* Keep DEX table typography aligned with Futures/Spot arbitrage tables. */
body.table-mobile-ref #dex-table th,
body.table-mobile-ref #dex-table td{
  font-size:13px;
  line-height:1.25;
}

body.table-mobile-ref #dex-table thead th{
  font-size:11px;
  font-weight:700;
  letter-spacing:.4px;
}

body.table-mobile-ref #dex-table td.token a{
  color:#2f8cff;
  font-size:13px;
  font-weight:700;
  line-height:1.2;
  text-decoration:none;
}

body.table-mobile-ref #dex-table td.token a:hover{
  color:#63b2ff;
  text-decoration:underline;
}

body.table-mobile-ref.dark #dex-table td.token a{
  color:var(--wuah-table-link, #64b5ff) !important;
}

body.table-mobile-ref.dark #dex-table td.token a:hover{
  color:var(--wuah-table-link-hover, #9cd3ff) !important;
}

body.table-mobile-ref #dex-table .exchange-cell{
  align-items:stretch;
  max-width:230px;
  margin:0 auto;
}

body.table-mobile-ref #dex-table .exchange-row{
  min-height:28px;
  width:100%;
  padding:3px 6px;
}

body.table-mobile-ref #dex-table .exchange-name{
  flex:0 1 110px;
  min-width:0;
}

body.table-mobile-ref #dex-table .exchange-name a{
  min-width:0;
  max-width:100%;
  overflow:hidden;
}

body.table-mobile-ref #dex-table .exchange-name span{
  display:inline-block;
  min-width:0;
  max-width:82px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:13px !important;
  font-weight:500 !important;
  line-height:1.15 !important;
  letter-spacing:0 !important;
}

body.table-mobile-ref #dex-table .exchange-price{
  flex:0 0 auto;
  min-width:70px;
  color:#333;
  font-size:13px !important;
  font-weight:400 !important;
  line-height:1.2;
  text-align:right;
}

body.table-mobile-ref.dark #dex-table .exchange-price{
  color:#c7cfdb !important;
}

/* Unified interval chips */
.fund-interval{
  box-sizing:border-box !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  min-width:28px !important;
  padding:1px 5px !important;
  border-radius:5px !important;
  border:1px solid var(--interval-border, rgba(148,163,184,.28)) !important;
  background:var(--interval-bg, rgba(148,163,184,.14)) !important;
  color:var(--interval-fg, #cbd5e1) !important;
  font-size:12px !important;
  font-weight:700 !important;
  line-height:1.15 !important;
  text-align:center !important;
}

.fund-interval.is-empty{
  background:transparent !important;
  color:var(--muted) !important;
  border:0 !important;
  padding:0 !important;
  min-width:0 !important;
}

.interval-1h{ --interval-bg:rgba(134,239,172,.18); --interval-border:rgba(134,239,172,.34); --interval-fg:#bbf7d0; }
.interval-2h{ --interval-bg:rgba(59,130,246,.14); --interval-border:rgba(59,130,246,.26); --interval-fg:#93c5fd; }
.interval-3h{ --interval-bg:rgba(132,204,22,.14); --interval-border:rgba(132,204,22,.26); --interval-fg:#bef264; }
.interval-4h{ --interval-bg:rgba(4,120,87,.22); --interval-border:rgba(4,120,87,.38); --interval-fg:#34d399; }
.interval-6h{ --interval-bg:rgba(234,179,8,.14); --interval-border:rgba(234,179,8,.28); --interval-fg:#fde68a; }
.interval-8h{ --interval-bg:rgba(249,115,22,.14); --interval-border:rgba(249,115,22,.28); --interval-fg:#fdba74; }
.interval-default{ --interval-bg:rgba(148,163,184,.14); --interval-border:rgba(148,163,184,.26); --interval-fg:#cbd5e1; }

body.light .interval-1h,
body[data-theme="light"] .interval-1h,
html[data-theme="light"] body .interval-1h{ --interval-bg:rgba(187,247,208,.55); --interval-border:rgba(74,222,128,.34); --interval-fg:#16a34a; }
body.light .interval-2h,
body[data-theme="light"] .interval-2h,
html[data-theme="light"] body .interval-2h{ --interval-bg:rgba(37,99,235,.10); --interval-border:rgba(37,99,235,.20); --interval-fg:#2563eb; }
body.light .interval-3h,
body[data-theme="light"] .interval-3h,
html[data-theme="light"] body .interval-3h{ --interval-bg:rgba(101,163,13,.10); --interval-border:rgba(101,163,13,.22); --interval-fg:#4d7c0f; }
body.light .interval-4h,
body[data-theme="light"] .interval-4h,
html[data-theme="light"] body .interval-4h{ --interval-bg:rgba(4,120,87,.16); --interval-border:rgba(4,120,87,.28); --interval-fg:#065f46; }
body.light .interval-6h,
body[data-theme="light"] .interval-6h,
html[data-theme="light"] body .interval-6h{ --interval-bg:rgba(202,138,4,.12); --interval-border:rgba(202,138,4,.22); --interval-fg:#a16207; }
body.light .interval-8h,
body[data-theme="light"] .interval-8h,
html[data-theme="light"] body .interval-8h{ --interval-bg:rgba(234,88,12,.10); --interval-border:rgba(234,88,12,.22); --interval-fg:#c2410c; }
body.light .interval-default,
body[data-theme="light"] .interval-default,
html[data-theme="light"] body .interval-default{ --interval-bg:rgba(100,116,139,.10); --interval-border:rgba(100,116,139,.20); --interval-fg:#475569; }
