.tp-overlay{position:fixed;inset:0;z-index:10010;display:flex;align-items:center;justify-content:center;padding:16px;background:rgba(0,0,0,.45);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);animation:tp-fade .15s ease-out}
.tp-overlay[hidden]{display:none}
.tp-dialog{position:relative;display:flex;flex-direction:column;gap:12px;width:100%;max-width:660px;height:min(600px,calc(100vh - 32px));padding:16px;overflow:hidden;border:1px solid var(--relay-colors-subtle-border-color);border-radius:16px;background:var(--relay-colors-modal-background);color:var(--relay-colors-gray12);font-family:var(--fonts-body),sans-serif;animation:tp-pop .18s ease-out}
.tp-title{flex-shrink:0;margin:0;font-size:16px;font-weight:700;line-height:24px;color:var(--relay-colors-gray12)}
.tp-close{display:flex;align-items:center;justify-content:center;width:32px;height:32px;padding:8px;border:0;border-radius:12px;background:transparent;color:var(--relay-colors-gray9);cursor:pointer}
.tp-close svg{width:16px;height:16px}
.tp-close:hover{background:var(--relay-colors-gray3)}
.tp-close-d{position:absolute;top:13px;right:11px}
.tp-body{display:flex;gap:12px;flex:1;min-height:0}

.tp-chains{display:flex;flex-direction:column;flex-shrink:0;width:212px;min-height:0;padding:12px;border-radius:12px;background:var(--relay-colors-gray3)}
.tp-field{position:relative;flex-shrink:0}
.tp-field svg{position:absolute;top:50%;left:16px;width:16px;height:16px;transform:translateY(-50%);color:var(--relay-colors-gray9);pointer-events:none}
.tp-input{width:100%;height:40px;padding:12px 16px 12px 42px;border:1px solid transparent;border-radius:8px;outline:none;font:inherit;font-size:16px;line-height:16px;color:var(--relay-colors-gray12)}
.tp-input::placeholder{color:var(--relay-colors-gray9)}
.tp-input:focus{border-color:var(--relay-colors-primary7)}
.tp-chains .tp-field{margin-bottom:8px}
.tp-chains .tp-input{border-color:var(--relay-colors-subtle-border-color);background:var(--relay-colors-modal-background)}
.tp-chain-list{display:flex;flex-direction:column;gap:4px;flex:1;min-height:0;margin:0;padding:0;overflow-y:auto;list-style:none;scrollbar-color:var(--relay-colors-gray5) transparent}
.tp-chain{display:flex;align-items:center;gap:8px;width:100%;height:40px;flex-shrink:0;padding:8px;border:0;border-radius:8px;background:transparent;color:var(--relay-colors-gray12);font:inherit;font-size:16px;font-weight:500;line-height:20px;text-align:left;cursor:pointer}
.tp-chain:hover{background:var(--relay-colors-gray4)}
.tp-chain[aria-pressed="true"]{background:var(--relay-colors-gray6)}
.tp-chain>img{flex-shrink:0;width:24px;height:24px;border-radius:4px}
.tp-chain span.tp-cname{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.tp-all{display:grid;flex-shrink:0;grid-template-columns:1fr 1fr;gap:2px;width:24px;height:24px}
.tp-all img{width:11px;height:11px;border-radius:2px}
.tp-section{display:flex;align-items:center;gap:4px;height:32px;flex-shrink:0;padding:4px 8px;font-size:14px;font-weight:500;line-height:21px;color:var(--relay-colors-text-subtle)}
.tp-star{flex-shrink:0;width:12px;height:16px;color:var(--relay-colors-primary9)}
.dark .tp-star{color:var(--relay-colors-primary11)}
.tp-info{flex-shrink:0;width:12px;height:16px;color:var(--relay-colors-gray9)}
.tp-new{padding:2px 8px;border-radius:100px;background:var(--relay-colors-primary3);color:var(--relay-colors-primary11);font-size:12px;font-style:italic;font-weight:500;line-height:16px}

.tp-tokens{display:flex;flex-direction:column;flex:1;min-width:0;min-height:0}
.tp-top{display:flex;flex-shrink:0;align-items:center;gap:12px;margin-bottom:4px}
.tp-top .tp-field{flex:1;min-width:0}
.tp-tokens .tp-input{background:var(--relay-colors-dropdown-background)}
.tp-scroll{display:flex;flex-direction:column;gap:12px;flex:1;min-height:0;padding-top:8px;overflow-y:auto;scrollbar-color:var(--relay-colors-gray5) transparent}
.tp-group{display:flex;flex-direction:column;gap:4px}
.tp-label{font-size:14px;font-weight:500;line-height:21px;color:var(--relay-colors-text-subtle)}
.tp-item{display:flex;align-items:center;gap:8px;width:100%;height:58px;flex-shrink:0;padding:8px;border:0;border-radius:8px;background:transparent;color:var(--relay-colors-gray12);font:inherit;text-align:left;cursor:pointer}
.tp-item:hover,.tp-item:focus-visible{outline:none;background:var(--relay-colors-gray3)}
.tp-icon{position:relative;flex-shrink:0;width:40px;height:40px;overflow:hidden;border-radius:4px}
.tp-icon>img{width:100%;height:100%;border-radius:9999px;object-fit:cover}
.tp-badge{position:absolute;right:0;bottom:0;display:flex;width:18px;height:18px;overflow:hidden;border:1px solid var(--relay-colors-modal-background);border-radius:4px;background:var(--relay-colors-modal-background)}
.tp-badge img{width:100%;height:100%;border-radius:4px}
.tp-text{display:flex;flex-direction:column;gap:2px;min-width:0}
.tp-symrow{display:flex;align-items:center;gap:4px;min-width:0}
.tp-sym{overflow:hidden;font-size:16px;font-weight:700;line-height:20px;white-space:nowrap;text-overflow:ellipsis;color:var(--relay-colors-gray12)}
.tp-gas{flex-shrink:0;padding:4px 6px;border-radius:100px;background:var(--relay-colors-gray3);font-size:12px;font-weight:500;line-height:12px;color:var(--relay-colors-gray12)}
.tp-sub{display:flex;align-items:center;gap:4px;min-width:0;font-size:12px;font-weight:500;line-height:20px;white-space:nowrap;color:var(--relay-colors-gray12)}
.tp-sub>span{overflow:hidden;text-overflow:ellipsis}
.tp-addr{flex-shrink:0;color:var(--relay-colors-text-subtle)}
.tp-warn{flex-shrink:0;width:14px;height:14px;color:var(--relay-colors-gray8)}
.tp-more{display:inline-flex;align-self:flex-end;align-items:center;gap:8px;height:24px;padding:4px 8px;border:0;border-radius:9999px;background:var(--relay-colors-gray3);font:inherit;cursor:pointer}
.tp-more span{font-size:12px;font-weight:500;line-height:20px;color:var(--relay-colors-text-subtle)}
.tp-more svg{width:12px;height:12px;color:var(--relay-colors-gray9);transition:transform .2s ease}
.tp-more[aria-expanded="true"] svg{transform:rotate(180deg)}
.tp-featured{display:flex;flex-wrap:wrap;gap:4px;margin:8px 0}
.tp-fchip{display:inline-flex;align-items:center;gap:4px;padding:4px 8px 4px 4px;border:1px solid var(--relay-colors-gray5);border-radius:9999px;background:transparent;color:var(--relay-colors-gray12);font:inherit;font-size:16px;font-weight:700;line-height:20px;cursor:pointer}
.tp-fchip:hover{background:var(--relay-colors-gray3)}
.tp-fchip .tp-icon{width:32px;height:32px}
.tp-fchip .tp-badge{width:14px;height:14px}
.tp-empty{padding:16px 0;font-size:14px;font-weight:500;color:var(--relay-colors-text-subtle)}

.tp-close-m,.tp-chead,.tp-mchips,.tp-flabel{display:none}
.tp-mchip{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;gap:4px;min-width:44px;height:40px;padding:8px 12px;border:0;border-radius:12px;background:var(--relay-colors-gray3);color:var(--relay-colors-gray12);font:inherit;font-size:16px;font-weight:700;line-height:20px;cursor:pointer}
.tp-mchip img{width:24px;height:24px;border-radius:4px}
.tp-mchip[aria-pressed="true"]{background:var(--relay-colors-gray5)}
.tp-mchip-more{padding:0 8px;border-radius:8px}
.tp-mchip-more svg{width:16px;height:16px;color:var(--relay-colors-gray9)}

@media (max-width:640px){
  .tp-overlay{padding:0;align-items:stretch}
  .tp-dialog{max-width:none;height:100vh;height:100dvh;padding:16px;border-radius:0}
  .tp-title,.tp-close-d{display:none}
  .tp-close-m{display:flex;flex-shrink:0;width:40px;height:40px;padding:12px}
  .tp-top{gap:8px;margin-bottom:0}
  .tp-body{flex-direction:column}
  .tp-tokens{flex:1}
  .tp-mchips{display:flex;flex-shrink:0;gap:8px;margin:16px 0 8px;padding:0 8px;overflow-x:auto;scrollbar-width:none}
  .tp-flabel{display:block}
  .tp-mchips::-webkit-scrollbar{display:none}
  .tp-chains{display:none}
  .tp-chains-open .tp-tokens{display:none}
  .tp-chains-open .tp-chains{display:flex;flex:1;width:auto;padding:0;background:transparent}
  .tp-chead{display:flex;align-items:center;gap:8px;margin-bottom:12px}
  .tp-chains .tp-input{background:var(--relay-colors-gray3)}
  .tp-chain[aria-pressed="true"]{background:var(--relay-colors-gray4)}
}
@keyframes tp-fade{from{opacity:0}}
@keyframes tp-pop{from{opacity:0;transform:translateY(8px) scale(.98)}}
