.exchange-table { min-width: 0; }

.table-scroll-hint { display: none; }

.payment-context {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.payment-context-icons { display: inline-flex; flex: none; }
.payment-context p { margin: 0; }

.exchange-cell {
  position: relative;
  align-self: stretch;
  align-content: center;
  grid-template-columns: 30px minmax(0, 1fr);
  padding-block: 8px;
}
.exchange-cell > .exchange-name { max-width: 65%; }
.exchange-cell > .exchange-marker-list { grid-area: 2 / 2; }

.exchange-detail-arrow {
  position: absolute;
  left: 89%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: var(--accent);
  font-size: 52px;
  font-weight: 800;
  line-height: 1;
  opacity: .38;
  pointer-events: none;
  transition: opacity .16s;
}
.exchange-cell:hover .exchange-name,
.exchange-cell:focus-within .exchange-name,
.exchange-cell:active .exchange-name { color: var(--accent); }
.exchange-cell:hover .exchange-detail-arrow,
.exchange-cell:focus-within .exchange-detail-arrow,
.exchange-cell:active .exchange-detail-arrow { opacity: 1; }

.exchange-detail-link {
  position: absolute;
  inset: 0 0 0 -44px;
  z-index: 1;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 3%, transparent);
  cursor: pointer;
  touch-action: manipulation;
  transition: background .16s, box-shadow .16s;
}
.exchange-detail-link:hover,
.exchange-detail-link:active {
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  box-shadow: inset 2px 0 0 var(--accent);
}
.exchange-detail-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -3px;
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  box-shadow: inset 2px 0 0 var(--accent);
}
.exchange-cell .compliance-badge,
.exchange-cell .exchange-activity-badge,
.exchange-row > .rank { pointer-events: none; }

/* Hit areas stay inside their own cells. The product rebate dialog remains. */
.exchange-row > .site-rebate-cell:has(> .site-rebate-detail-trigger) {
  position: relative;
  align-self: stretch;
}
.exchange-row .site-rebate-detail-trigger,
.exchange-row .site-rebate-detail-trigger:hover,
.exchange-row .site-rebate-detail-trigger:focus-visible {
  color: var(--rebate);
  text-decoration: none;
  touch-action: manipulation;
  transform: none;
}
.exchange-row .site-rebate-detail-trigger::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 6px;
  cursor: pointer;
  transition: background .16s;
}
.exchange-row .site-rebate-detail-trigger:hover::after,
.exchange-row .site-rebate-detail-trigger:focus-visible::after {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.exchange-row .site-rebate-detail-trigger:focus-visible { outline: none; }
.exchange-row .site-rebate-detail-trigger:focus-visible::after {
  outline: 2px solid var(--accent);
  outline-offset: -3px;
}

.exchange-row > .activity-cell {
  align-self: stretch;
  align-items: stretch;
  padding: 9px 0 9px 14px;
}
.exchange-row .activity-button {
  justify-content: center;
  width: 100%;
  min-height: 52px;
  height: auto;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 650;
  touch-action: manipulation;
  transform: none;
}
.exchange-row a.activity-button { box-shadow: 0 3px 10px #3159c81a; }
.exchange-row a.activity-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.latest-activity-poster > .latest-activity-register-link {
  inset: 0;
  width: auto;
  height: auto;
  border-radius: inherit;
  touch-action: manipulation;
}

@media (min-width: 901px) {
  .table-header,
  .exchange-row {
    grid-template-columns: 32px minmax(210px, 1.65fr) minmax(100px, .85fr) minmax(95px, 1fr) minmax(95px, 1fr) minmax(176px, 1.1fr);
    padding-inline: 12px;
  }
  .exchange-row > .fee-value-cell { padding-right: 16px; }
}

@media (max-width: 900px) {
  .exchange-row {
    grid-template-areas: "exchange exchange" "maker taker" "action action";
  }
  .exchange-cell { --identity-end-space: 124px; grid-template-columns: 25px minmax(0, 1fr); min-height: 58px; padding: 0 var(--identity-end-space) 10px 26px; }
  .exchange-cell > .exchange-name { max-width: 100%; }
  .exchange-detail-arrow { grid-area: 1 / 1 / 3 / -1; left: auto; right: calc(10px - var(--identity-end-space)); transform: translateY(-50%); }
  .exchange-detail-link { inset: -14px -14px 0; border-radius: 10px 10px 0 0; }
  .exchange-row > .site-rebate-cell,
  .exchange-row > .site-rebate-cell:has(> .site-rebate-detail-trigger) {
    position: absolute;
    grid-area: exchange;
    z-index: 2;
    top: 0;
    right: 36px;
    bottom: 10px;
    width: 82px;
    min-height: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }
  .exchange-row > .site-rebate-cell .site-rebate-detail-trigger,
  .exchange-row > .site-rebate-cell .site-rebate-value { font-size: 18px; }
  .exchange-row > .activity-cell .mobile-cell-label { display: none; }
  .exchange-row > .activity-cell { padding: 4px 0 0; }
}

@media (max-width: 480px) {
  .exchange-detail-link { inset: -13px -12px 0; }
  .payment-context { align-items: flex-start; gap: 8px; font-size: 11px; }
  .payment-context-icons { padding-top: 1px; }
}

@media (any-pointer: coarse), (max-width: 900px) {
  .rebate-detail-close,
  .verification-close { min-width: 44px; min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .exchange-detail-link,
  .exchange-detail-arrow,
  .exchange-row .site-rebate-detail-trigger::after { transition: none; }
}

.directory { padding: 24px 16px 48px; }
.directory .heading-row { align-items: flex-start; gap: 18px; }
.directory-heading-copy { min-width: 0; }
.directory .data-stamp { flex-shrink: 0; padding-top: 4px; }
.directory-toolbar { gap: 10px; margin-top: 18px; }
.directory .search-box,
.directory .verification-entry { height: 40px; min-height: 40px; }
.directory .referral-card { margin-top: 16px; }
.directory .referral-heading h2 { font-size: 19px; font-weight: 680; line-height: 1.35; }
.partner-invite {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  margin-top: 12px;
  padding: 15px 20px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: var(--surface-soft);
}
.partner-invite-copy { min-width: 0; }
.partner-invite-kicker { color: var(--accent); font-size: 11px; font-weight: 650; }
.partner-invite h2 { margin: 4px 0 0; color: var(--text); font-size: 17px; font-weight: 680; line-height: 1.4; }
.partner-invite p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.partner-invite-link {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 15px;
  border-radius: 7px;
  background: #3159c8;
  color: #fff;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}
.partner-invite-link:hover { background: #426bdc; }
.partner-invite-handle { font-weight: 500; opacity: .9; }
.directory .rebate-limit-note { flex-wrap: wrap; margin-top: 8px; }
.directory .rebate-limit-note .contact-link {
  min-height: 30px;
  padding: 4px 6px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 650;
}
.directory .rebate-limit-note .contact-link:hover { text-decoration: underline; }
.directory .comparison-toolbar { gap: 10px; margin: 16px 0 8px; }
.directory .payment-context { margin: 8px 0; }

@media (min-width: 1201px) {
  .directory h1 { font-size: 28px; font-weight: 720; line-height: 1.18; white-space: nowrap; }
}

@media (min-width: 901px) and (max-width: 1200px) {
  .directory { padding-inline: 14px; }
  .directory h1 { font-size: 27px; font-weight: 720; line-height: 1.2; }
  .directory .data-stamp { padding-top: 3px; }
}

@media (max-width: 900px) {
  .directory { padding: 22px 14px 40px; }
  .directory .heading-row { gap: 7px; }
  .directory h1 { font-size: 26px; line-height: 1.22; }
  .directory .data-stamp { padding-top: 0; }
  .directory-toolbar { gap: 9px; margin-top: 16px; }
  .directory .search-box,
  .directory .verification-entry { height: 40px; min-height: 40px; }
  .directory .referral-heading h2 { font-size: 18px; line-height: 1.4; }
  .directory .comparison-toolbar { margin-top: 14px; }
}

@media (max-width: 700px) {
  .partner-invite { align-items: stretch; flex-direction: column; gap: 12px; padding: 14px 16px; }
  .partner-invite-link { width: 100%; }
}

@media (max-width: 480px) {
  .directory { padding: 20px 12px 36px; }
  .directory h1 { font-size: 23px; line-height: 1.22; }
  .directory-toolbar { gap: 8px; margin-top: 14px; }
  .directory .search-box,
  .directory .verification-entry { height: 40px; min-height: 40px; }
}
.theme-symbol { display: block; width: 19px; height: 19px; }
.theme-light .icon-button .theme-symbol { display: none; }
.theme-light .icon-button::before {
  content: "";
  position: absolute;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: currentColor;
  -webkit-mask-image: radial-gradient(circle 7.5px at 11px 4px, transparent 7px, #000 7.5px);
  mask-image: radial-gradient(circle 7.5px at 11px 4px, transparent 7px, #000 7.5px);
}
.icon-button { position: relative; }

@media (max-width: 600px) {
  html, body { min-width: 0; }
  .topbar { height: 92px; }
  .topbar-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 51px 40px;
    gap: 0 8px;
    width: calc(100% - 32px);
  }
  .brand { grid-column: 1; grid-row: 1; }
  .top-actions { grid-column: 2; grid-row: 1; gap: 8px; margin-left: 0; }
  .top-actions button { min-width: 40px; min-height: 40px; }
  .main-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    gap: 4px;
    width: 100%;
    height: 40px;
    border-top: 1px solid var(--line);
  }
  .nav-link { height: 34px; padding: 0 12px; font-size: 12px; }
  .nav-link.active::after { bottom: -3px; left: 12px; right: 12px; }
  .page-content { width: 100%; }
  .directory { display: flex; flex-direction: column; padding: 20px 16px 42px; }
  .directory > .heading-row { order: 0; }
  .directory > .directory-toolbar { order: 1; }
  .directory > .comparison-toolbar { order: 2; }
  .directory > .badge-guide { order: 3; }
  .directory > .payment-context { order: 4; }
  .directory > .table-wrap { order: 5; }
  .directory > .rebate-limit-note { order: 6; }
  .directory > .referral-card { order: 7; }
  .directory > .partner-invite { order: 8; }
  .directory .heading-row {
    align-items: flex-start;
    gap: 8px;
    padding: 0;
    border: 0;
    background: none;
  }
  .directory h1 { max-width: 100%; margin-top: 7px; font-size: 23px; line-height: 1.35; letter-spacing: -.5px; }
  .directory-kicker { color: var(--accent); font-size: 12px; }
  .directory .data-stamp { flex-direction: row; align-items: center; gap: 7px; padding: 0; font-size: 10px; }
  .directory-toolbar { display: grid; gap: 4px; margin-top: 18px; }
  .directory .search-box { width: 100%; max-width: none; height: 50px; min-height: 50px; border-radius: 12px; }
  .directory .search-box input { font-size: 16px; }
  .directory .verification-entry { justify-content: space-between; padding-inline: 3px; min-height: 44px; height: auto; border: 0; background: transparent; box-shadow: none; font-size: 12px; }
  .directory .referral-card {
    margin-top: 16px;
    padding: 18px;
    border-left-width: 1px;
    border-radius: 15px;
    background: linear-gradient(145deg, color-mix(in srgb, var(--rebate) 12%, var(--surface)), var(--surface) 68%);
  }
  .directory .referral-card-main { align-items: stretch; gap: 14px; }
  .directory .referral-heading h2 { font-size: 18px; line-height: 1.35; }
  .directory .referral-intro { margin-top: 7px; font-size: 12px; line-height: 1.6; }
  .directory .referral-benefits {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    width: 100%;
  }
  .directory .referral-point,
  .directory .referral-point + .referral-point {
    display: block;
    min-width: 0;
    padding: 10px 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-soft);
  }
  .directory .referral-point-icon { margin-bottom: 7px; }
  .directory .referral-point-copy { gap: 3px; }
  .directory .referral-point-copy strong { font-size: 11px; line-height: 1.3; }
  .directory .referral-point-copy span { font-size: 10px; line-height: 1.4; }
  .partner-invite { margin-top: 10px; padding: 15px 16px; border-left-width: 1px; border-radius: 14px; }
  .partner-invite h2 { font-size: 15px; }
  .partner-invite p { font-size: 11px; }
  .partner-invite-link { min-height: 44px; }
  .directory .rebate-limit-note { margin: 22px 0 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 12px; }
  .directory .comparison-toolbar { scroll-margin-top: 106px; margin: 16px 0 0; gap: 12px; }
  .comparison-heading h2 { font-size: 21px; letter-spacing: -.5px; }
  .comparison-fees { width: 100%; justify-content: space-between; gap: 8px; }
  .comparison-fees .fee-mode-caption { font-size: 11px; }
  .fee-mode-toggle { min-height: 44px; }
  .directory .badge-guide { margin: 3px 0 0; font-size: 11px; }
  .directory .badge-guide summary { min-height: 40px; align-content: center; }
  .directory .payment-context { margin: 0 0 12px; font-size: 11px; }
  .directory .mobile-sort-label { display: none; }
  .directory .table-wrap { border: 0; border-radius: 0; background: transparent; box-shadow: none; overflow: visible; }
  .directory .table-header { gap: 7px; padding: 0 0 12px; overflow: visible; background: transparent; }
  .directory .table-header > .sortable-heading { flex: 1; justify-content: center; padding: 0 7px; min-height: 44px; border-radius: 10px; font-size: 12px; }
  .directory .table-body { display: grid; gap: 12px; }
  .exchange-row {
    grid-template-areas: "exchange exchange" "maker taker" "action action";
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 0 4px 16px #14223b08;
  }
  .exchange-row + .exchange-row { margin-top: 0; border-top: 1px solid var(--line); }
  .exchange-row > .rank { top: 17px; left: 14px; width: 18px; height: 18px; font-size: 10px; }
  .exchange-cell { grid-template-columns: 34px minmax(0, 1fr); gap: 5px 9px; min-height: 66px; padding: 0 var(--identity-end-space) 4px 25px; border: 0; }
  .exchange-cell > .exchange-logo { width: 34px; height: 34px; }
  .exchange-cell > .exchange-name { max-width: 100%; }
  .exchange-cell .exchange-name { font-size: 15px; line-height: 1.45; }
  .exchange-cell > .exchange-marker-list { gap: 5px; flex-wrap: wrap; }
  .exchange-detail-link { inset: -14px -14px -2px; border-radius: 16px 16px 0 0; background: transparent; }
  .exchange-detail-arrow { left: auto; right: calc(10px - var(--identity-end-space)); top: 50%; font-size: 26px; opacity: .7; transform: translateY(-50%); }
  .exchange-row > .site-rebate-cell,
  .exchange-row > .site-rebate-cell:has(> .site-rebate-detail-trigger) {
    position: absolute;
    top: 0;
    right: 28px;
    bottom: 4px;
    width: 82px;
    min-height: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }
  .exchange-row > .site-rebate-cell .mobile-cell-label { font-size: 11px; }
  .exchange-row > .site-rebate-cell .site-rebate-detail-trigger,
  .exchange-row > .site-rebate-cell .site-rebate-value { font-size: 27px; line-height: 1.1; letter-spacing: -.8px; }
  .exchange-row > .fee-value-cell {
    min-height: 57px;
    padding: 9px 11px;
    border: 0;
    border-radius: 9px;
    background: var(--surface-soft);
    font-size: 17px;
    font-weight: 650;
  }
  .exchange-row > .fee-value-cell .mobile-cell-label { font-size: 11px; font-weight: 400; }
  .exchange-row > .activity-cell { padding: 0; border: 0; }
  .exchange-row .activity-button { min-height: 46px; border-radius: 10px; font-size: 14px; }
  .verification-guide-close { min-width: 44px; min-height: 44px; flex-basis: 44px; }
  .rebate-detail-backdrop, .verification-modal-backdrop { align-items: flex-end; padding: 0; }
  .rebate-detail-dialog, .verification-guide { width: 100%; max-height: 88dvh; border-radius: 20px 20px 0 0; padding-bottom: max(20px, env(safe-area-inset-bottom)); }
  .rebate-detail-table { min-width: 100%; table-layout: auto; }
  .rebate-detail-table th, .rebate-detail-table td { min-width: 80px; }
  .verification-steps { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 350px) {
  .exchange-cell { --identity-end-space: 110px; grid-template-columns: 30px minmax(0, 1fr); gap: 7px; }
  .exchange-cell > .exchange-logo { width: 30px; height: 30px; }
  .exchange-cell .exchange-name { font-size: 14px; overflow-wrap: anywhere; }
  .exchange-cell > .exchange-marker-list { grid-area: 2 / 1 / 3 / -1; }
  .exchange-row > .site-rebate-cell,
  .exchange-row > .site-rebate-cell:has(> .site-rebate-detail-trigger) { width: 68px; }
  .exchange-row > .site-rebate-cell .site-rebate-detail-trigger,
  .exchange-row > .site-rebate-cell .site-rebate-value { font-size: 25px; }
}
