#token-modal[hidden] {
  display: none !important;
}

.token-modal {
  position: fixed;
  inset: 0;
  z-index: 100002;
  display: flex;
  align-items: stretch;
  justify-content: center;
  pointer-events: auto;
}

.token-modal-overlay {
  position: absolute;
  inset: 0;
  background-color: var(--scrim);
  opacity: 0;
  transition: opacity 300ms ease-in-out;
  pointer-events: auto;
}

.token-modal-shell {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.token-modal-panel {
  display: flex;
  flex-direction: column;
  position: relative;
  box-sizing: border-box;
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: min(720px, 85vh);
  overflow: hidden;
  background-color: var(--surface1);
  border: 1px solid var(--surface3);
  border-bottom: none;
  border-top-left-radius: var(--t-radius-rounded24, 24px);
  border-top-right-radius: var(--t-radius-rounded24, 24px);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  box-shadow: 0 -4px 24px rgba(19, 19, 19, 0.08);
  outline: none;
  gap: var(--t-space-spacing4, 8px);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(100%);
  transition:
    transform 300ms cubic-bezier(0.17, 0.67, 0.45, 1),
    opacity 300ms ease-in-out;
  will-change: transform, opacity;
}

.token-modal-handle {
  display: block;
  flex-shrink: 0;
  width: 36px;
  height: 4px;
  margin: 10px auto 2px;
  border-radius: 999px;
  background: rgba(19, 19, 19, 0.15);
}

.token-modal.is-open .token-modal-overlay {
  opacity: 0.5;
}

.token-modal.is-open .token-modal-panel {
  opacity: 1;
  transform: translateY(0);
}

#quick-select-section[hidden],
#crosschain-banner[hidden],
#list-section-header[hidden] {
  display: none !important;
}

.token-modal-panel > div._overflowY-hidden {
  overflow: visible;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.token-modal-panel > div._overflowY-hidden > div {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.token-modal-list-scroll {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(19, 19, 19, 0.08) transparent;
}

.crosschain-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 16px 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #fff3fc;
  border: 1px solid #ffd8f3;
}

.crosschain-banner-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #ffe8f8;
  color: #fc72ff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.crosschain-banner-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
  font-size: 13px;
  line-height: 1.35;
  color: var(--neutral1, #131313);
}

.crosschain-banner-copy strong {
  font-size: 14px;
  font-weight: 535;
}

.crosschain-banner-copy span {
  color: var(--neutral2, rgba(19, 19, 19, 0.63));
}

.banner-dismiss {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--neutral2, rgba(19, 19, 19, 0.63));
  cursor: pointer;
  flex-shrink: 0;
}

.banner-dismiss:hover {
  background: rgba(19, 19, 19, 0.04);
}

.network-dropdown {
  position: fixed;
  z-index: 100003;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(-6px);
  transition:
    opacity 180ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 180ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.network-dropdown:not([hidden]) {
  opacity: 1;
  transform: translateY(0);
}

.network-dropdown[hidden] {
  display: none !important;
}

#quick-select {
  gap: 8px;
}

.token-modal-quick-item {
  display: flex;
  flex: 1 1 0;
  min-width: 0;
  flex-direction: column;
}

@media (max-width: 639px) {
  .token-modal-handle {
    margin: 10px auto 12px;
  }

  .token-modal-title-row {
    display: none !important;
  }

  #close-modal {
    display: none !important;
  }

  .token-modal-title-row + div > div {
    margin-top: 0 !important;
    margin-bottom: 8px !important;
  }

  #quick-select {
    gap: 6px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .token-modal-quick-item {
    flex: 1 1 0;
    min-width: 0;
  }

  .token-modal-quick-item [role="button"] > div {
    padding: 10px 4px !important;
    gap: 6px;
  }

  .token-modal-list-scroll {
    max-height: calc(85vh - 160px);
  }
}

@media (min-width: 640px) {
  .token-modal-handle {
    display: none;
  }

  .token-modal-shell {
    align-items: center;
  }

  .token-modal-panel {
    width: calc(100vw - 32px);
    max-width: 400px;
    height: auto;
    max-height: min(700px, calc(100vh - 32px));
    border-radius: var(--t-radius-rounded16, 16px);
    border-bottom: 1px solid var(--surface3);
    transform: translateY(12px) scale(0.98);
    transition:
      transform 100ms cubic-bezier(0.17, 0.67, 0.45, 1),
      opacity 100ms cubic-bezier(0.17, 0.67, 0.45, 1);
  }

  .token-modal.is-open .token-modal-panel {
    transform: translateY(0) scale(1);
  }

  .token-modal-list-scroll {
    min-height: 420px;
    max-height: min(560px, calc(100vh - 180px));
  }
}
