.table-panel {
  min-width: 0;
  overflow: hidden;
}

.table-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 16px;
  border-bottom: 1px solid var(--line-soft);
  padding: 14px;
}

.table-status {
  margin: 0;
  color: var(--chrome);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 1000;
  text-align: right;
  text-transform: uppercase;
}

.info-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 14px 14px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  color: rgba(232, 255, 251, 0.82);
  background: rgba(110, 245, 232, 0.04);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
}

.info-banner p {
  margin: 0;
}

.info-icon,
.header-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--teal-soft);
  border-radius: 999px;
  color: var(--teal-soft);
  background: transparent;
}

.info-icon {
  width: 18px;
  height: 18px;
  font-size: 12px;
  font-weight: 1000;
}

.info-banner button {
  border: 0;
  color: var(--teal-soft);
  background: transparent;
  font-size: 18px;
  font-weight: 1000;
  line-height: 1;
}

.info-banner button:hover,
.info-banner button:focus-visible {
  color: #fff;
}

.table-scroll {
  flex: 1;
  min-height: 360px;
  max-height: 80vh;
  overflow: auto;
  scrollbar-color: rgba(110, 245, 232, 0.4) rgba(6, 16, 15, 0.4);
}

.trade-table {
  width: 100%;
  min-width: 940px;
  border-collapse: separate;
  border-spacing: 0;
  color: #e8fffb;
  font-variant-numeric: tabular-nums;
}

.trade-table caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.trade-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 1px solid rgba(110, 245, 232, 0.26);
  padding: 0;
  color: var(--teal-soft);
  background: #071513;
  font-size: 11px;
  font-weight: 1000;
  text-align: right;
  text-transform: uppercase;
}

.header-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  width: 100%;
  min-height: 44px;
  padding-right: 8px;
}

.header-wrap-static {
  justify-content: flex-start;
  padding: 12px 14px;
}

.header-label {
  white-space: nowrap;
}

.trade-table thead .pair-col,
.trade-table tbody .pair-col {
  position: sticky;
  left: 0;
  z-index: 6;
  text-align: left;
}

.trade-table thead .pair-col,
.trade-table tbody .pair-col {
  background: #071513;
}

.trade-table th .sort-button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  flex: 1;
  width: auto;
  min-height: 44px;
  min-width: 0;
  border: 0;
  padding: 12px 4px 12px 12px;
  color: inherit;
  background: transparent;
  font-size: inherit;
  font-weight: inherit;
  text-align: inherit;
  text-transform: inherit;
}

.trade-table th .sort-button > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-table th.pair-col {
  min-width: 220px;
  padding: 0;
}

.trade-table th .sort-button:hover {
  color: #fff;
  background: rgba(20, 217, 197, 0.12);
}

.header-help {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  padding: 0;
  font-size: 11px;
  font-weight: 1000;
  line-height: 1;
}

.header-help:hover,
.header-help:focus-visible,
.header-help[aria-expanded="true"] {
  color: #06100f;
  background: var(--teal-soft);
}

.header-popover {
  position: fixed;
  z-index: 50;
  max-width: 280px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  color: #e8fffb;
  background: #071513;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 18px rgba(110, 245, 232, 0.12);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
  text-transform: none;
}

.sort-mark {
  min-width: 12px;
  color: var(--yellow);
}

.trade-table td {
  border-bottom: 1px solid rgba(110, 245, 232, 0.1);
  padding: 13px 12px;
  text-align: right;
  vertical-align: middle;
}

.trade-row {
  background: rgba(6, 16, 15, 0.72);
  cursor: pointer;
  transition: background-color 160ms ease;
}

.trade-row.is-alt {
  background: rgba(255, 255, 255, 0.02);
}

.trade-row:hover td,
.trade-row:focus-within td {
  background-color: rgba(110, 245, 232, 0.06);
}

.trade-row.is-expanded td {
  border-bottom-color: rgba(247, 201, 72, 0.28);
}

.trade-row.is-flashing td {
  animation: rowFlash 300ms ease;
}

.skeleton-row {
  background: rgba(6, 16, 15, 0.72);
  pointer-events: none;
}

.skeleton-row:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.skeleton-row td {
  height: 46px;
  padding: 13px 12px;
}

.skeleton-row td:first-child {
  position: sticky;
  left: 0;
  z-index: 4;
  background: #071513;
}

.skeleton-bar {
  display: block;
  width: 74%;
  height: 16px;
  margin-left: auto;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(110, 245, 232, 0.08) 0%,
    rgba(110, 245, 232, 0.18) 38%,
    rgba(255, 255, 255, 0.34) 50%,
    rgba(110, 245, 232, 0.18) 62%,
    rgba(110, 245, 232, 0.08) 100%
  );
  background-size: 220% 100%;
  animation: skeletonShimmer 2s linear infinite;
}

.skeleton-row td:first-child .skeleton-bar {
  width: 82%;
  margin-right: auto;
  margin-left: 0;
}

.pair-cell {
  display: grid;
  gap: 3px;
  text-align: left;
}

.pair-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  color: #fff;
  font-weight: 1000;
  white-space: nowrap;
}

.pair-symbol {
  overflow: hidden;
  text-overflow: ellipsis;
}

.direction {
  font-size: 11px;
  font-weight: 1000;
  text-transform: uppercase;
}

.direction.long {
  color: var(--teal-soft);
}

.direction.short {
  color: var(--magenta-5);
}

.pair-meta {
  overflow: hidden;
  color: rgba(232, 255, 251, 0.44);
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.num {
  font-weight: 1000;
  white-space: nowrap;
}

.und-cell {
  color: rgba(232, 255, 251, 0.74);
}

.theo-cell {
  color: var(--chrome);
}

.lt-cell {
  color: #fff;
}

.gap-cell {
  color: var(--gap-color, #e8fffb);
  background: var(--gap-bg, transparent);
  font-weight: 1000;
}

.gap-cell.is-missing,
.theo-cell.is-missing,
.und-cell.is-missing {
  color: rgba(232, 255, 251, 0.34);
}

.vol-cell {
  position: relative;
  min-width: 118px;
  overflow: hidden;
}

.vol-cell::before {
  content: "";
  position: absolute;
  inset: 9px auto 9px 0;
  width: var(--vol-pct, 0%);
  max-width: 100%;
  border-radius: 0 999px 999px 0;
  background: rgba(110, 245, 232, 0.12);
  pointer-events: none;
}

.vol-cell > span {
  position: relative;
  z-index: 1;
}

.mobile-meme-toggle {
  display: none;
}

.meme-count {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: #fff;
  font-weight: 1000;
}

.chevron {
  color: var(--yellow);
  font-size: 12px;
}

.trade-row.is-expanded .chevron {
  transform: rotate(180deg);
}

.expand-row td {
  border-bottom: 1px solid rgba(247, 201, 72, 0.22);
  padding: 0;
  background: rgba(6, 16, 15, 0.86);
}

.expand-panel {
  padding: 14px;
}

.expand-title {
  margin: 0 0 10px;
  color: var(--yellow);
  font-size: 12px;
  font-weight: 1000;
  text-transform: uppercase;
}

.meme-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(110, 245, 232, 0.18);
  border-radius: 8px;
  background: rgba(6, 16, 15, 0.62);
}

.meme-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.meme-table th,
.meme-table td {
  border-bottom: 1px solid rgba(110, 245, 232, 0.1);
  padding: 9px 10px;
  text-align: right;
}

.meme-table th:first-child,
.meme-table td:first-child {
  text-align: left;
}

.meme-table th {
  color: var(--teal-soft);
  background: rgba(13, 36, 34, 0.76);
  font-size: 11px;
  font-weight: 1000;
  text-transform: uppercase;
}

.meme-table tr:last-child td {
  border-bottom: 0;
}

.meme-name strong {
  display: block;
  color: #fff;
  font-weight: 1000;
}

.meme-name small {
  display: block;
  max-width: 220px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meme-link,
.more-link {
  color: var(--yellow);
  font-weight: 1000;
  text-decoration: none;
}

.meme-link:hover,
.more-link:hover {
  text-decoration: underline;
}

.more-row td {
  color: var(--chrome);
  text-align: left;
}

.empty-row td {
  height: 240px;
  color: rgba(232, 255, 251, 0.5);
  font-size: 14px;
  font-weight: 1000;
  text-align: center;
  text-transform: uppercase;
}

.trade-sidebar .legend-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.trade-sidebar .legend-list li {
  color: var(--chrome);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.35;
}

.filter-card button:disabled,
.search-control input:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.metric strong.is-stale {
  color: #ffcc66;
  text-shadow: 0 0 16px rgba(255, 204, 102, 0.28);
}

@keyframes rowFlash {
  0% {
    background-color: rgba(247, 201, 72, 0.08);
  }

  100% {
    background-color: transparent;
  }
}

@keyframes skeletonShimmer {
  0% {
    background-position: 220% 0;
  }

  100% {
    background-position: -220% 0;
  }
}

@media (max-width: 1099px) {
  .trade-sidebar {
    order: -1;
    display: flex;
    flex-direction: row;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .trade-card,
  .trade-card:last-child {
    flex: 0 0 min(360px, 88vw);
    scroll-snap-align: start;
  }

  .table-scroll {
    max-height: none;
  }
}

@media (max-width: 760px) {
  .table-head {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .table-status {
    width: 100%;
    text-align: left;
  }

  .info-banner {
    align-items: start;
  }

  .trade-table {
    min-width: 760px;
  }

  .trade-table th.pair-col {
    min-width: 180px;
  }
}

@media (max-width: 520px) {
  .trade-table {
    min-width: 650px;
  }

  .theo-col,
  .memes-col {
    display: none;
  }

  .trade-table th.pair-col {
    min-width: 158px;
  }

  .trade-table td,
  .trade-table th .sort-button {
    padding-right: 9px;
    padding-left: 9px;
  }

  .trade-table th.pair-col {
    padding: 0;
  }

  .header-wrap {
    padding-right: 6px;
  }

  .header-wrap-static {
    padding-right: 9px;
    padding-left: 9px;
  }

  .pair-title {
    gap: 5px;
  }

  .pair-meta {
    max-width: 138px;
  }

  .mobile-meme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 8px;
    color: var(--yellow);
    font-size: 11px;
    font-weight: 1000;
  }
}
